X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/68bffe977f93024131df29ddf22ab0e5682a23ca..51dad7245443d4a057687669bc34bcf934c2f483:/target/linux/atheros-2.6/files/arch/mips/atheros/ar5312.c diff --git a/target/linux/atheros-2.6/files/arch/mips/atheros/ar5312.c b/target/linux/atheros-2.6/files/arch/mips/atheros/ar5312.c index 11f21fe5c..57d56eb0e 100644 --- a/target/linux/atheros-2.6/files/arch/mips/atheros/ar5312.c +++ b/target/linux/atheros-2.6/files/arch/mips/atheros/ar5312.c @@ -215,6 +215,7 @@ int __init ar5312_init_devices(void) struct ar531x_boarddata *bcfg; char *radio, *c; int dev = 0; + uint32_t fctl = 0; if (!is_5312) return 0; @@ -253,6 +254,19 @@ int __init ar5312_init_devices(void) ar5312_eth0_data.board_config = board_config; ar5312_eth1_data.board_config = board_config; + + /* fixup flash width */ + fctl = sysRegRead(AR531X_FLASHCTL) & FLASHCTL_MW; + switch (fctl) { + case FLASHCTL_MWx16: + ar5312_flash_data.width = 2; + break; + case FLASHCTL_MWx8: + default: + ar5312_flash_data.width = 1; + break; + } + ar5312_devs[dev++] = &ar5312_physmap_flash; if (!memcmp(bcfg->enet0Mac, "\xff\xff\xff\xff\xff\xff", 6)) @@ -282,9 +296,11 @@ int __init ar5312_init_devices(void) } if (radio) { - if (*((u32 *) radio) & AR531X_RADIO0_MASK) { - ar5312_wmac[0].dev.platform_data = init_wmac(0); - ar5312_devs[dev++] = &ar5312_wmac[0]; + if (mips_machtype == MACH_ATHEROS_AR5312) { + if (*((u32 *) radio) & AR531X_RADIO0_MASK) { + ar5312_wmac[0].dev.platform_data = init_wmac(0); + ar5312_devs[dev++] = &ar5312_wmac[0]; + } } if (*((u32 *) radio) & AR531X_RADIO1_MASK) { ar5312_wmac[1].dev.platform_data = init_wmac(1);