diff options
author | Felix Fietkau <nbd@openwrt.org> | 2007-02-16 09:23:15 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2007-02-16 09:23:15 +0000 |
commit | b7e5e78ae6fd8a08cb01a7a7c8f23f297459db91 (patch) | |
tree | a876d1a91d12fc5c15d05d7ec65dbf21430bcacc /target/linux/atheros-2.6/files/arch/mips/atheros/board.c | |
parent | c55df2a7ed31000b9e3b52b32cf7079f1f5f8cec (diff) | |
download | upstream-b7e5e78ae6fd8a08cb01a7a7c8f23f297459db91.tar.gz upstream-b7e5e78ae6fd8a08cb01a7a7c8f23f297459db91.tar.bz2 upstream-b7e5e78ae6fd8a08cb01a7a7c8f23f297459db91.zip |
major cleanup of the ar531x code, improved hardware detection and support for multiple ethernet interfaces
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6307 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/atheros-2.6/files/arch/mips/atheros/board.c')
-rw-r--r-- | target/linux/atheros-2.6/files/arch/mips/atheros/board.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/target/linux/atheros-2.6/files/arch/mips/atheros/board.c b/target/linux/atheros-2.6/files/arch/mips/atheros/board.c index fe94c3ffc1..7913d8dbd8 100644 --- a/target/linux/atheros-2.6/files/arch/mips/atheros/board.c +++ b/target/linux/atheros-2.6/files/arch/mips/atheros/board.c @@ -106,7 +106,7 @@ int __init ar531x_find_config(char *flash_limit) if (!bcfg) return -ENODEV; - board_config = kmalloc(0x1000, GFP_KERNEL); + board_config = kzalloc(BOARD_CONFIG_BUFSZ, GFP_KERNEL); memcpy(board_config, bcfg, 0x100); /* Radio config starts 0x100 bytes after board config, regardless @@ -116,9 +116,9 @@ int __init ar531x_find_config(char *flash_limit) if (!rcfg) return -ENODEV; - printk("Radio config found at offset 0x%x\n", rcfg - bcfg); radio_config = board_config + 0x100 + ((rcfg - bcfg) & 0xfff); - rcfg_size = 0x1000 - ((rcfg - bcfg) & 0xfff); + printk("Radio config found at offset 0x%x(0x%x)\n", rcfg - bcfg, radio_config - board_config); + rcfg_size = BOARD_CONFIG_BUFSZ - ((rcfg - bcfg) & (BOARD_CONFIG_BUFSZ - 1)); memcpy(radio_config, rcfg, rcfg_size); return 0; @@ -143,18 +143,8 @@ void __init serial_setup(unsigned long mapbase, unsigned int uartclk) void __init plat_mem_setup(void) { - switch(mips_machtype) { -#ifdef CONFIG_ATHEROS_AR5312 - case MACH_ATHEROS_AR5312: - ar5312_plat_setup(); - break; -#endif -#ifdef CONFIG_ATHEROS_AR5315 - case MACH_ATHEROS_AR5315: - ar5315_plat_setup(); - break; -#endif - } + DO_AR5312(ar5312_plat_setup();) + DO_AR5315(ar5315_plat_setup();) /* Disable data watchpoints */ write_c0_watchlo0(0); @@ -166,10 +156,22 @@ const char *get_system_type(void) #ifdef CONFIG_ATHEROS_AR5312 case MACH_ATHEROS_AR5312: return "Atheros AR5312\n"; + + case MACH_ATHEROS_AR2312: + return "Atheros AR2312\n"; + + case MACH_ATHEROS_AR2313: + return "Atheros AR2313\n"; #endif #ifdef CONFIG_ATHEROS_AR5315 - case MACH_ATHEROS_AR5315: - return "Atheros AR5315\n"; + case MACH_ATHEROS_AR2315: + return "Atheros AR2315\n"; + case MACH_ATHEROS_AR2316: + return "Atheros AR2316\n"; + case MACH_ATHEROS_AR2317: + return "Atheros AR2317\n"; + case MACH_ATHEROS_AR2318: + return "Atheros AR2318\n"; #endif } return "Atheros (unknown)"; |