diff options
author | Imre Kaloz <kaloz@openwrt.org> | 2007-02-19 22:33:06 +0000 |
---|---|---|
committer | Imre Kaloz <kaloz@openwrt.org> | 2007-02-19 22:33:06 +0000 |
commit | 6cb8a1d2b61f918bdfae8c24912aa0a19786474f (patch) | |
tree | 53e90ed2bdfa4dca172a3ad385a6ed71d93afbc2 /target/linux/atheros-2.6/files/arch/mips | |
parent | 27b1d1b0f52ead4cad13b089760105cd2a381279 (diff) | |
download | master-187ad058-6cb8a1d2b61f918bdfae8c24912aa0a19786474f.tar.gz master-187ad058-6cb8a1d2b61f918bdfae8c24912aa0a19786474f.tar.bz2 master-187ad058-6cb8a1d2b61f918bdfae8c24912aa0a19786474f.zip |
autodetect flash width - thanks to Kestutis Kupciunas
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6327 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/atheros-2.6/files/arch/mips')
-rw-r--r-- | target/linux/atheros-2.6/files/arch/mips/atheros/ar5312.c | 14 |
1 files changed, 14 insertions, 0 deletions
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 8404b882c2..384020b27e 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; TODO: constants -> defines */ + fctl = sysRegRead(AR531X_FLASHCTL) & 0x30000000; + switch (fctl) { + case 0x20000000: + ar5312_flash_data.width = 2; + break; + case 0x00000000: + default: + ar5312_flash_data.width = 1; + break; + } + ar5312_devs[dev++] = &ar5312_physmap_flash; if (!memcmp(bcfg->enet0Mac, "\xff\xff\xff\xff\xff\xff", 6)) |