X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/63b12ffd1bf4012ffb97802ca54a60a3d895903a..5ebab881cae321bc8d7fc543d0255d204a27eaa8:/target/linux/atheros-2.6/files/arch/mips/atheros/prom.c diff --git a/target/linux/atheros-2.6/files/arch/mips/atheros/prom.c b/target/linux/atheros-2.6/files/arch/mips/atheros/prom.c index 6dfa13c77..45f4db9e1 100644 --- a/target/linux/atheros-2.6/files/arch/mips/atheros/prom.c +++ b/target/linux/atheros-2.6/files/arch/mips/atheros/prom.c @@ -27,39 +27,14 @@ void __init prom_init(void) { - u32 memsize, memcfg; mips_machgroup = MACH_GROUP_ATHEROS; mips_machtype = -1; - /* - * Atheros CPUs before the AR2315 are using MIPS 4Kc core, later designs are - * using MIPS 4KEc R2 core. This makes it easy to determine the board at runtime. - */ - - if (current_cpu_data.cputype == CPU_4KEC) { - mips_machtype = MACH_ATHEROS_AR5315; - - memcfg = sysRegRead(AR5315_MEM_CFG); - memsize = 1 + ((memcfg & SDRAM_DATA_WIDTH_M) >> SDRAM_DATA_WIDTH_S); - memsize <<= 1 + ((memcfg & SDRAM_COL_WIDTH_M) >> SDRAM_COL_WIDTH_S); - memsize <<= 1 + ((memcfg & SDRAM_ROW_WIDTH_M) >> SDRAM_ROW_WIDTH_S); - memsize <<= 3; - } else { - int bank0AC, bank1AC; + DO_AR5312(ar5312_prom_init();) + DO_AR5315(ar5315_prom_init();) - mips_machtype = MACH_ATHEROS_AR5312; - - memcfg = sysRegRead(AR531X_MEM_CFG1); - bank0AC = (memcfg & MEM_CFG1_AC0) >> MEM_CFG1_AC0_S; - bank1AC = (memcfg & MEM_CFG1_AC1) >> MEM_CFG1_AC1_S; - memsize = (bank0AC ? (1 << (bank0AC+1)) : 0) - + (bank1AC ? (1 << (bank1AC+1)) : 0); - memsize <<= 20; - } - - add_memory_region(0, memsize, BOOT_MEM_RAM); - strcpy(arcs_cmdline, "console=ttyS0,9600 rootfstype=squashfs,jffs2"); + strcpy(arcs_cmdline, "console=ttyS0,9600 rootfstype=squashfs,jffs2 init=/etc/preinit"); } void __init prom_free_prom_memory(void)