net: Move enetaddr env access code to env config instead of net config
[oweals/u-boot.git] / board / compulab / cm_t3517 / cm_t3517.c
index 624cf4c03463f472b2a3b164cec1c92c0f20c63c..e4e346077c990b0f9920338c109cfd113b5fa7bc 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 #include <status_led.h>
 #include <net.h>
 #include <netdev.h>
@@ -50,12 +51,12 @@ static struct omap_musb_board_data cm_t3517_musb_board_data = {
 };
 
 static struct musb_hdrc_platform_data cm_t3517_musb_pdata = {
-#if defined(CONFIG_MUSB_HOST)
+#if defined(CONFIG_USB_MUSB_HOST)
        .mode           = MUSB_HOST,
-#elif defined(CONFIG_MUSB_GADGET)
+#elif defined(CONFIG_USB_MUSB_GADGET)
        .mode           = MUSB_PERIPHERAL,
 #else
-#error "Please define either CONFIG_MUSB_HOST or CONFIG_MUSB_GADGET"
+#error "Please define either CONFIG_USB_MUSB_HOST or CONFIG_USB_MUSB_GADGET"
 #endif
        .config         = &cm_t3517_musb_config,
        .power          = 250,
@@ -89,8 +90,8 @@ int board_init(void)
        /* boot param addr */
        gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
 
-#if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
-       status_led_set(STATUS_LED_BOOT, STATUS_LED_ON);
+#if defined(CONFIG_LED_STATUS) && defined(CONFIG_LED_STATUS_BOOT_ENABLE)
+       status_led_set(CONFIG_LED_STATUS_BOOT, CONFIG_LED_STATUS_ON);
 #endif
 
        cm_t3517_musb_init();
@@ -98,15 +99,24 @@ int board_init(void)
        return 0;
 }
 
+/*
+ * Routine: get_board_rev
+ * Description: read system revision
+ */
+u32 get_board_rev(void)
+{
+       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;
 }
 
-#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_MMC)
 #define SB_T35_CD_GPIO 144
 #define SB_T35_WP_GPIO 59
 
@@ -132,7 +142,7 @@ static int am3517_get_efuse_enetaddr(u8 *enetaddr)
        enetaddr[4] = (u8)((lsb >> 8)  & 0xff);
        enetaddr[5] = (u8)(lsb & 0xff);
 
-       return is_valid_ether_addr(enetaddr);
+       return is_valid_ethaddr(enetaddr);
 }
 
 static inline int cm_t3517_init_emac(bd_t *bis)
@@ -159,7 +169,7 @@ static int cm_t3517_handle_mac_address(void)
        unsigned char enetaddr[6];
        int ret;
 
-       ret = eth_getenv_enetaddr("ethaddr", enetaddr);
+       ret = eth_env_get_enetaddr("ethaddr", enetaddr);
        if (ret)
                return 0;
 
@@ -170,10 +180,10 @@ static int cm_t3517_handle_mac_address(void)
                        return ret;
        }
 
-       if (!is_valid_ether_addr(enetaddr))
+       if (!is_valid_ethaddr(enetaddr))
                return -1;
 
-       return eth_setenv_enetaddr("ethaddr", enetaddr);
+       return eth_env_set_enetaddr("ethaddr", enetaddr);
 }
 
 #define SB_T35_ETH_RST_GPIO 164