X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=board%2Fcompulab%2Fcm_t35%2Fcm_t35.c;h=189d903b6e39c804edc444041f235e1bbafb6a66;hb=870dd3095facaada8b671d55affc2d060355725f;hp=a3b38ae2d358dab08e3bb8648942d7a88f13e771;hpb=f4a40f05f504407a036e2beee88ce17930d5d45c;p=oweals%2Fu-boot.git diff --git a/board/compulab/cm_t35/cm_t35.c b/board/compulab/cm_t35/cm_t35.c index a3b38ae2d3..189d903b6e 100644 --- a/board/compulab/cm_t35/cm_t35.c +++ b/board/compulab/cm_t35/cm_t35.c @@ -19,10 +19,12 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -42,16 +44,6 @@ const omap3_sysinfo sysinfo = { "NAND", }; -static u32 gpmc_net_config[GPMC_MAX_REG] = { - NET_GPMC_CONFIG1, - NET_GPMC_CONFIG2, - NET_GPMC_CONFIG3, - NET_GPMC_CONFIG4, - NET_GPMC_CONFIG5, - NET_GPMC_CONFIG6, - 0 -}; - #ifdef CONFIG_SPL_BUILD /* * Routine: get_board_mem_timings @@ -68,11 +60,19 @@ void get_board_mem_timings(struct board_sdrc_timings *timings) } #endif -#define CM_T35_SPLASH_NAND_OFFSET 0x100000 +struct splash_location splash_locations[] = { + { + .name = "nand", + .storage = SPLASH_STORAGE_NAND, + .flags = SPLASH_STORAGE_RAW, + .offset = 0x100000, + }, +}; int splash_screen_prepare(void) { - return cl_splash_screen_prepare(CM_T35_SPLASH_NAND_OFFSET); + return splash_source_load(splash_locations, + ARRAY_SIZE(splash_locations)); } /* @@ -105,13 +105,13 @@ int board_init(void) */ u32 get_board_rev(void) { - return cl_eeprom_get_board_rev(); + return cl_eeprom_get_board_rev(CONFIG_SYS_I2C_EEPROM_BUS); }; int misc_init_r(void) { cl_print_pcb_info(); - dieid_num_r(); + omap_die_id_display(); return 0; } @@ -391,37 +391,19 @@ int board_mmc_init(bd_t *bis) } #endif -/* - * Routine: setup_net_chip_gmpc - * Description: Setting up the configuration GPMC registers specific to the - * Ethernet hardware. - */ -static void setup_net_chip_gmpc(void) +#if defined(CONFIG_GENERIC_MMC) +void board_mmc_power_init(void) { - struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE; - - enable_gpmc_cs_config(gpmc_net_config, &gpmc_cfg->cs[5], - CM_T3X_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); + twl4030_power_mmc_init(0); } +#endif #ifdef CONFIG_SYS_I2C_OMAP34XX /* * Routine: reset_net_chip * Description: reset the Ethernet controller via TPS65930 GPIO */ -static void reset_net_chip(void) +static int cm_t3x_reset_net_chip(int gpio) { /* Set GPIO1 of TPS65930 as output */ twl4030_i2c_write_u8(TWL4030_CHIP_GPIO, TWL4030_BASEADD_GPIO + 0x03, @@ -436,9 +418,10 @@ static void reset_net_chip(void) twl4030_i2c_write_u8(TWL4030_CHIP_GPIO, TWL4030_BASEADD_GPIO + 0x0C, 0x02); mdelay(1); + return 0; } #else -static inline void reset_net_chip(void) {} +static inline int cm_t3x_reset_net_chip(int gpio) { return 0; } #endif #ifdef CONFIG_SMC911X @@ -455,17 +438,16 @@ static int handle_mac_address(void) if (rc) return 0; - rc = cl_eeprom_read_mac_addr(enetaddr); + rc = cl_eeprom_read_mac_addr(enetaddr, CONFIG_SYS_I2C_EEPROM_BUS); if (rc) return rc; - if (!is_valid_ether_addr(enetaddr)) + if (!is_valid_ethaddr(enetaddr)) return -1; return eth_setenv_enetaddr("ethaddr", enetaddr); } - /* * Routine: board_eth_init * Description: initialize module and base-board Ethernet chips @@ -474,18 +456,16 @@ int board_eth_init(bd_t *bis) { int rc = 0, rc1 = 0; - setup_net_chip_gmpc(); - reset_net_chip(); - rc1 = handle_mac_address(); if (rc1) printf("No MAC address found! "); - rc1 = smc911x_initialize(0, CM_T3X_SMC911X_BASE); + rc1 = cl_omap3_smc911x_init(0, 5, CM_T3X_SMC911X_BASE, + cm_t3x_reset_net_chip, -EINVAL); if (rc1 > 0) rc++; - rc1 = smc911x_initialize(1, SB_T35_SMC911X_BASE); + rc1 = cl_omap3_smc911x_init(1, 4, SB_T35_SMC911X_BASE, NULL, -EINVAL); if (rc1 > 0) rc++; @@ -493,16 +473,6 @@ int board_eth_init(bd_t *bis) } #endif -void __weak get_board_serial(struct tag_serialnr *serialnr) -{ - /* - * This corresponds to what happens when we can communicate with the - * eeprom but don't get a valid board serial value. - */ - serialnr->low = 0; - serialnr->high = 0; -}; - #ifdef CONFIG_USB_EHCI_OMAP struct omap_usbhs_board_data usbhs_bdata = { .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,