Mike Rapoport wrote:
> Add CM-T35 board support
> 
> Signed-off-by: Mike Rapoport <[email protected]>
> 
> --
> v2 changes:
> - rename board config file from omap3_cm-t35.h to cm-t35.h
> - remove SZ_xx references
> - add MAKEALL/MAINTEINERS entries
> 
> v3 changes:
> - fix whitespace and indentation
> - remove eth_init from board_eth_init
> - add CM-T35 entry to doc/README.omap3
> - fixed board name in MAINTAINERS
> 
> v4 changes:
> - rebased agains u-boot-ti/next branch
> 

<snip>

> +static void setup_net_chip(void)
> +{
> +     struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
> +
> +     enable_gpmc_cs_config(gpmc_net_config, &gpmc_cfg->cs[5],
> +                           CM_T35_SMC911X_BASE, GPMC_SIZE_16M);
> +     enable_gpmc_cs_config(gpmc_net_config, &gpmc_cfg->cs[4],
> +                           SB_T35_SMC911X_BASE, GPMC_SIZE_16M);
> +
> +     /* Enable off mode for NWE in PADCONF_GPMC_NWE register */
> +     writew(readw(&ctrl_base->gpmc_nwe) | 0x0E00, &ctrl_base->gpmc_nwe);
> +
> +     /* Enable off mode for NOE in PADCONF_GPMC_NADV_ALE register */
> +     writew(readw(&ctrl_base->gpmc_noe) | 0x0E00, &ctrl_base->gpmc_noe);
> +
> +     /* Enable off mode for ALE in PADCONF_GPMC_NADV_ALE register */
> +     writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00,
> +             &ctrl_base->gpmc_nadv_ale);
> +
> +     /* Reset the ethernet controller via TPS65930 GPIO */
> +     /* Set GPIO1 of TPS65930 as output */
> +     twl4030_i2c_write_u8(TWL4030_CHIP_GPIO, 0x02,
> +                          TWL4030_BASEADD_GPIO+0x03);
> +     /* Send a pulse on the GPIO pin */
> +     twl4030_i2c_write_u8(TWL4030_CHIP_GPIO, 0x02,
> +                          TWL4030_BASEADD_GPIO+0x0C);
> +     udelay(1);
> +     twl4030_i2c_write_u8(TWL4030_CHIP_GPIO, 0x02,
> +                          TWL4030_BASEADD_GPIO+0x09);
> +     udelay(1);
> +     twl4030_i2c_write_u8(TWL4030_CHIP_GPIO, 0x02,
> +                          TWL4030_BASEADD_GPIO+0x0C);

> +}
> +
> +/*
> + * Routine: board_init
> + * Description: Early hardware init.
> + */
> +int board_init(void)
> +{
> +     gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
> +
> +     /* board id for Linux */
> +     gd->bd->bi_arch_number = MACH_TYPE_CM_T35;
> +     /* boot param addr */
> +     gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
> +
> +     return 0;
> +}
> +
> +/*
> + * Routine: misc_init_r
> + * Description: Init ethernet (done here so udelay works)
> + */
> +int misc_init_r(void)
> +{
> +#ifdef CONFIG_DRIVER_OMAP34XX_I2C
> +     i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
> +#endif
> +
> +#if defined(CONFIG_CMD_NET)
> +     setup_net_chip();
> +#endif

Net setup should be dependent on i2c initialization.
The setup_net_chip uses i2c read/write

> +
> +     dieid_num_r();
> +
> +     return 0;
> +}



Tom
_______________________________________________
U-Boot mailing list
[email protected]
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to