~ubuntu-branches/ubuntu/saucy/u-boot/saucy

« back to all changes in this revision

Viewing changes to board/cm_t35/cm_t35.c

  • Committer: Package Import Robot
  • Author(s): Clint Adams
  • Date: 2012-05-01 18:07:19 UTC
  • mfrom: (16.1.23 sid)
  • Revision ID: package-import@ubuntu.com-20120501180719-rjntk3287im4a0ns
Tags: 2012.04.01-1
* New upstream version.
  - Update mipsel-native-endianness.diff.
  - Update no-error-on-set-but-unused-variables.diff (partially merged).
  - Drop kirkwood_spi-irq_mask.diff (merged).
  - Drop kirkwood-disable-l2c.diff (merged).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * (C) Copyright 2011
3
 
 * CompuLab, Ltd. <www.compulab.co.il>
 
2
 * (C) Copyright 2011 CompuLab, Ltd. <www.compulab.co.il>
4
3
 *
5
4
 * Authors: Mike Rapoport <mike@compulab.co.il>
6
5
 *          Igor Grinberg <grinberg@compulab.co.il>
34
33
#include <net.h>
35
34
#include <i2c.h>
36
35
#include <twl4030.h>
 
36
#include <linux/compiler.h>
37
37
 
38
38
#include <asm/io.h>
39
39
#include <asm/arch/mem.h>
42
42
#include <asm/arch/sys_proto.h>
43
43
#include <asm/mach-types.h>
44
44
 
 
45
#include "eeprom.h"
 
46
 
45
47
DECLARE_GLOBAL_DATA_PTR;
46
48
 
47
49
const omap3_sysinfo sysinfo = {
316
318
#ifdef CONFIG_GENERIC_MMC
317
319
int board_mmc_init(bd_t *bis)
318
320
{
319
 
        omap_mmc_init(0);
320
 
        return 0;
 
321
        return omap_mmc_init(0);
321
322
}
322
323
#endif
323
324
 
355
356
{
356
357
        /* Set GPIO1 of TPS65930 as output */
357
358
        twl4030_i2c_write_u8(TWL4030_CHIP_GPIO, 0x02,
358
 
                             TWL4030_BASEADD_GPIO+0x03);
 
359
                                TWL4030_BASEADD_GPIO + 0x03);
359
360
        /* Send a pulse on the GPIO pin */
360
361
        twl4030_i2c_write_u8(TWL4030_CHIP_GPIO, 0x02,
361
 
                             TWL4030_BASEADD_GPIO+0x0C);
362
 
        udelay(1);
363
 
        twl4030_i2c_write_u8(TWL4030_CHIP_GPIO, 0x02,
364
 
                             TWL4030_BASEADD_GPIO+0x09);
365
 
        udelay(1);
366
 
        twl4030_i2c_write_u8(TWL4030_CHIP_GPIO, 0x02,
367
 
                             TWL4030_BASEADD_GPIO+0x0C);
 
362
                                TWL4030_BASEADD_GPIO + 0x0C);
 
363
        udelay(1);
 
364
        twl4030_i2c_write_u8(TWL4030_CHIP_GPIO, 0x02,
 
365
                                TWL4030_BASEADD_GPIO + 0x09);
 
366
        mdelay(40);
 
367
        twl4030_i2c_write_u8(TWL4030_CHIP_GPIO, 0x02,
 
368
                                TWL4030_BASEADD_GPIO + 0x0C);
 
369
        mdelay(1);
368
370
}
369
371
#else
370
372
static inline void reset_net_chip(void) {}
371
373
#endif
372
374
 
 
375
#ifdef CONFIG_SMC911X
373
376
/*
374
377
 * Routine: handle_mac_address
375
378
 * Description: prepare MAC address for on-board Ethernet.
383
386
        if (rc)
384
387
                return 0;
385
388
 
386
 
#ifdef CONFIG_DRIVER_OMAP34XX_I2C
387
 
        rc = i2c_read(0x50, 0, 1, enetaddr, 6);
 
389
        rc = cm_t3x_eeprom_read_mac_addr(enetaddr);
388
390
        if (rc)
389
391
                return rc;
390
 
#endif
391
392
 
392
393
        if (!is_valid_ether_addr(enetaddr))
393
394
                return -1;
404
405
{
405
406
        int rc = 0, rc1 = 0;
406
407
 
407
 
#ifdef CONFIG_SMC911X
408
408
        setup_net_chip_gmpc();
409
409
        reset_net_chip();
410
410
 
419
419
        rc1 = smc911x_initialize(1, SB_T35_SMC911X_BASE);
420
420
        if (rc1 > 0)
421
421
                rc++;
422
 
#endif
423
422
 
424
423
        return rc;
425
424
}
 
425
#endif
 
426
 
 
427
void __weak get_board_serial(struct tag_serialnr *serialnr)
 
428
{
 
429
        /*
 
430
         * This corresponds to what happens when we can communicate with the
 
431
         * eeprom but don't get a valid board serial value.
 
432
         */
 
433
        serialnr->low = 0;
 
434
        serialnr->high = 0;
 
435
};