Do not register more than 2 ethernet porst for CFE based devices (i.e : Compex WP54G...
authorFlorian Fainelli <florian@openwrt.org>
Sat, 24 Mar 2007 21:31:13 +0000 (21:31 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Sat, 24 Mar 2007 21:31:13 +0000 (21:31 +0000)
SVN-Revision: 6683

target/linux/adm5120-2.6/files/arch/mips/adm5120/prom.c
target/linux/adm5120-2.6/files/drivers/net/adm5120sw.c
target/linux/adm5120-2.6/files/drivers/net/adm5120sw.h

index 9067fcd976df0b1656ef7963a7e43b43cc2c4e22..4c207655962514f4d0d4a3069898c410aa409d17 100644 (file)
 #include <asm/addrspace.h>
 
 /* boot loaders specific definitions */
-#define CFE_EPTSEAL 0x43464531
+#define CFE_EPTSEAL 0x43464531 /* CFE1 is the magic number to recognize CFE from other bootloaders */
 #define CFE 1
-#define MYLOADER 2
+#define UBOOT 2
+#define MYLOADER 3
 #define UNKNOWN 0
 
 void setup_prom_printf(int);
index 935016c3a1b9ec45c41d43dcfc69903cddca3b6b..e4a764f491934b26fb147aae175eb00cbbc0b73c 100644 (file)
@@ -390,6 +390,9 @@ static int __init adm5120_sw_init(void)
        /* MII port? */
        if (adm5120_get_reg(ADM5120_CODE) & ADM5120_CODE_PQFP)
                adm5120_nrdevs = 5;
+       /* CFE based devices only have two enet ports */
+       else if (boot_loader_type == CFE)
+               adm5120_nrdevs = 2
        else
                adm5120_nrdevs = 6;
 
index 4ea1e6257cc6d1fd562743c0897c22e3899060ec..e915a411c80883151981d0284fc843946a4b612e 100644 (file)
@@ -102,5 +102,12 @@ struct adm5120_info {
        u16     ports;
        u16     vlan;
 };
+#define UNKNOWN 0
+
+#define UBOOT 2
+#define MYLOADER 3
+
+/* Type of boot loader, detected by the prom */
+extern boot_loader_type;
 
 #endif /* _INCLUDE_ADM5120SW_H_ */