]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: update network settings
authorHarald Krapfenbauer <harald.krapfenbauer@bluetechnix.com>
Tue, 17 May 2011 19:25:54 +0000 (15:25 -0400)
committerMike Frysinger <vapier@gentoo.org>
Tue, 12 Jul 2011 06:17:45 +0000 (02:17 -0400)
These boards can have an addon card plugged onto them, so enable
support for it.

Signed-off-by: Harald Krapfenbauer <harald.krapfenbauer@bluetechnix.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
board/cm-bf537e/cm-bf537e.c
board/cm-bf537u/cm-bf537u.c
board/tcm-bf537/tcm-bf537.c
include/configs/cm-bf537e.h
include/configs/cm-bf537u.h
include/configs/tcm-bf537.h

index 1e350dc0648335ef077e9d4b2984889fec5bb48d..38dbc6e7322a4fe366bc882612917369055ee861 100644 (file)
@@ -24,27 +24,37 @@ int checkboard(void)
        return 0;
 }
 
-#ifdef CONFIG_BFIN_MAC
-static void board_init_enetaddr(uchar *mac_addr)
+static void board_init_enetaddr(char *var)
 {
-       puts("Warning: Generating 'random' MAC address\n");
-       bfin_gen_rand_mac(mac_addr);
-       eth_setenv_enetaddr("ethaddr", mac_addr);
+#ifdef CONFIG_NET_MULTI
+       uchar enetaddr[6];
+
+       if (eth_getenv_enetaddr(var, enetaddr))
+               return;
+
+       printf("Warning: %s: generating 'random' MAC address\n", var);
+       bfin_gen_rand_mac(enetaddr);
+       eth_setenv_enetaddr(var, enetaddr);
+#endif
 }
 
+#ifndef CONFIG_BFIN_MAC
+# define bfin_EMAC_initialize(x) 1
+#endif
+#ifndef CONFIG_SMC911X
+# define smc911x_initialize(n, x) 1
+#endif
 int board_eth_init(bd_t *bis)
 {
-       return bfin_EMAC_initialize(bis);
+       /* return ok if at least 1 eth device works */
+       return bfin_EMAC_initialize(bis) &
+              smc911x_initialize(0, CONFIG_SMC911X_BASE);
 }
-#endif
 
 int misc_init_r(void)
 {
-#ifdef CONFIG_BFIN_MAC
-       uchar enetaddr[6];
-       if (!eth_getenv_enetaddr("ethaddr", enetaddr))
-               board_init_enetaddr(enetaddr);
-#endif
+       board_init_enetaddr("ethaddr");
+       board_init_enetaddr("eth1addr");
 
        gpio_cfi_flash_init();
 
index 4b7e8642c971888697c3acb34d791297df3ef084..a62ddd62b688b7bf6f06a01482dd18c68c4b7a88 100644 (file)
@@ -24,34 +24,37 @@ int checkboard(void)
        return 0;
 }
 
-#ifdef CONFIG_BFIN_MAC
-static void board_init_enetaddr(uchar *mac_addr)
+static void board_init_enetaddr(char *var)
 {
-       puts("Warning: Generating 'random' MAC address\n");
-       bfin_gen_rand_mac(mac_addr);
-       eth_setenv_enetaddr("ethaddr", mac_addr);
-}
+#ifdef CONFIG_NET_MULTI
+       uchar enetaddr[6];
 
-int board_eth_init(bd_t *bis)
-{
-       return bfin_EMAC_initialize(bis);
-}
+       if (eth_getenv_enetaddr(var, enetaddr))
+               return;
+
+       printf("Warning: %s: generating 'random' MAC address\n", var);
+       bfin_gen_rand_mac(enetaddr);
+       eth_setenv_enetaddr(var, enetaddr);
 #endif
+}
 
-#ifdef CONFIG_SMC911X
+#ifndef CONFIG_BFIN_MAC
+# define bfin_EMAC_initialize(x) 1
+#endif
+#ifndef CONFIG_SMC911X
+# define smc911x_initialize(n, x) 1
+#endif
 int board_eth_init(bd_t *bis)
 {
-       return smc911x_initialize(0, CONFIG_SMC911X_BASE);
+       /* return ok if at least 1 eth device works */
+       return bfin_EMAC_initialize(bis) &
+              smc911x_initialize(0, CONFIG_SMC911X_BASE);
 }
-#endif
 
 int misc_init_r(void)
 {
-#ifdef CONFIG_BFIN_MAC
-       uchar enetaddr[6];
-       if (!eth_getenv_enetaddr("ethaddr", enetaddr))
-               board_init_enetaddr(enetaddr);
-#endif
+       board_init_enetaddr("ethaddr");
+       board_init_enetaddr("eth1addr");
 
        gpio_cfi_flash_init();
 
index 04d6bdbd3e83f8b2ae539b1aa99e42f4ce3ac628..004e0d9bb121f7927df41c171df8a45a1c85d756 100644 (file)
@@ -24,27 +24,37 @@ int checkboard(void)
        return 0;
 }
 
-#ifdef CONFIG_BFIN_MAC
-static void board_init_enetaddr(uchar *mac_addr)
+static void board_init_enetaddr(char *var)
 {
-       puts("Warning: Generating 'random' MAC address\n");
-       bfin_gen_rand_mac(mac_addr);
-       eth_setenv_enetaddr("ethaddr", mac_addr);
+#ifdef CONFIG_NET_MULTI
+       uchar enetaddr[6];
+
+       if (eth_getenv_enetaddr(var, enetaddr))
+               return;
+
+       printf("Warning: %s: generating 'random' MAC address\n", var);
+       bfin_gen_rand_mac(enetaddr);
+       eth_setenv_enetaddr(var, enetaddr);
+#endif
 }
 
+#ifndef CONFIG_BFIN_MAC
+# define bfin_EMAC_initialize(x) 1
+#endif
+#ifndef CONFIG_SMC911X
+# define smc911x_initialize(n, x) 1
+#endif
 int board_eth_init(bd_t *bis)
 {
-       return bfin_EMAC_initialize(bis);
+       /* return ok if at least 1 eth device works */
+       return bfin_EMAC_initialize(bis) &
+              smc911x_initialize(0, CONFIG_SMC911X_BASE);
 }
-#endif
 
 int misc_init_r(void)
 {
-#ifdef CONFIG_BFIN_MAC
-       uchar enetaddr[6];
-       if (!eth_getenv_enetaddr("ethaddr", enetaddr))
-               board_init_enetaddr(enetaddr);
-#endif
+       board_init_enetaddr("ethaddr");
+       board_init_enetaddr("eth1addr");
 
        gpio_cfi_flash_init();
 
index 04bca6cb292ebf87fe6f0a57900b28959974d6f7..3ee7738cfb2def6a18fee97e91f8104364f0ebd5 100644 (file)
@@ -65,6 +65,9 @@
 #ifndef __ADSPBF534__
 #define ADI_CMDS_NETWORK       1
 #define CONFIG_BFIN_MAC
+#define CONFIG_SMC911X         1
+#define CONFIG_SMC911X_BASE    0x20308000
+#define CONFIG_SMC911X_16_BIT
 #define CONFIG_NETCONSOLE      1
 #define CONFIG_NET_MULTI       1
 #endif
index af2fe896ad79af0711c5d976859a8f01422b8f50..c79192671db623bdbc2306c9c4b79f174d4a9a58 100644 (file)
  */
 #ifndef __ADSPBF534__
 #define ADI_CMDS_NETWORK       1
-#define CONFIG_NET_MULTI
-/* The next 3 lines are for use with SMSC on EXT-BF5xx-USB-ETH2 */
-#define CONFIG_SMC911X 1
-#define CONFIG_SMC911X_BASE    0x24000000
+#define CONFIG_SMC911X         1
+#define CONFIG_SMC911X_BASE    0x20308000
 #define CONFIG_SMC911X_16_BIT
+#define CONFIG_NETCONSOLE      1
+#define CONFIG_NET_MULTI       1
 #endif
 #define CONFIG_HOSTNAME                cm-bf537u
 /* Uncomment next line to use fixed MAC address */
index 9a6100e39c76e3e75d392d4aa56003701ab3ed65..f2c5b989dd27c6182f335aec62213203521dc8cc 100644 (file)
 /*
  * Network Settings
  */
-/* TCM-BF537E has no PHY on it, but EXT-BF5xx-USB/Ethernet board has */
 #ifndef __ADSPBF534__
 #define ADI_CMDS_NETWORK       1
 #define CONFIG_BFIN_MAC
+#define CONFIG_SMC911X         1
+#define CONFIG_SMC911X_BASE    0x20308000
+#define CONFIG_SMC911X_16_BIT
 #define CONFIG_NETCONSOLE      1
 #define CONFIG_NET_MULTI       1
 #endif