From: Florian Fainelli Date: Sat, 24 Mar 2007 21:31:13 +0000 (+0000) Subject: Do not register more than 2 ethernet porst for CFE based devices (i.e : Compex WP54G... X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=1f3c505ef6e7acc33bf0717463d72e8ff09b6759;p=openwrt%2Fstaging%2Fjow.git Do not register more than 2 ethernet porst for CFE based devices (i.e : Compex WP54G-wrt) SVN-Revision: 6683 --- diff --git a/target/linux/adm5120-2.6/files/arch/mips/adm5120/prom.c b/target/linux/adm5120-2.6/files/arch/mips/adm5120/prom.c index 9067fcd976..4c20765596 100644 --- a/target/linux/adm5120-2.6/files/arch/mips/adm5120/prom.c +++ b/target/linux/adm5120-2.6/files/arch/mips/adm5120/prom.c @@ -30,9 +30,10 @@ #include /* 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); diff --git a/target/linux/adm5120-2.6/files/drivers/net/adm5120sw.c b/target/linux/adm5120-2.6/files/drivers/net/adm5120sw.c index 935016c3a1..e4a764f491 100644 --- a/target/linux/adm5120-2.6/files/drivers/net/adm5120sw.c +++ b/target/linux/adm5120-2.6/files/drivers/net/adm5120sw.c @@ -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; diff --git a/target/linux/adm5120-2.6/files/drivers/net/adm5120sw.h b/target/linux/adm5120-2.6/files/drivers/net/adm5120sw.h index 4ea1e6257c..e915a411c8 100644 --- a/target/linux/adm5120-2.6/files/drivers/net/adm5120sw.h +++ b/target/linux/adm5120-2.6/files/drivers/net/adm5120sw.h @@ -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_ */