2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright MontaVista Software Inc
7 * Copyright (C) 2003 Atheros Communications, Inc., All Rights Reserved.
8 * Copyright (C) 2006 FON Technology, SL.
9 * Copyright (C) 2006 Imre Kaloz <kaloz@openwrt.org>
10 * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
14 * Prom setup file for ar531x
17 #include <linux/init.h>
18 #include <linux/autoconf.h>
19 #include <linux/kernel.h>
20 #include <linux/string.h>
22 #include <linux/bootmem.h>
24 #include <asm/bootinfo.h>
25 #include <asm/addrspace.h>
28 void __init prom_init(void)
32 mips_machgroup = MACH_GROUP_ATHEROS;
36 * Atheros CPUs before the AR2315 are using MIPS 4Kc core, later designs are
37 * using MIPS 4KEc R2 core. This makes it easy to determine the board at runtime.
40 if (current_cpu_data.cputype == CPU_4KEC) {
41 mips_machtype = MACH_ATHEROS_AR5315;
43 memcfg = sysRegRead(AR5315_MEM_CFG);
44 memsize = 1 + ((memcfg & SDRAM_DATA_WIDTH_M) >> SDRAM_DATA_WIDTH_S);
45 memsize <<= 1 + ((memcfg & SDRAM_COL_WIDTH_M) >> SDRAM_COL_WIDTH_S);
46 memsize <<= 1 + ((memcfg & SDRAM_ROW_WIDTH_M) >> SDRAM_ROW_WIDTH_S);
51 mips_machtype = MACH_ATHEROS_AR5312;
53 memcfg = sysRegRead(AR531X_MEM_CFG1);
54 bank0AC = (memcfg & MEM_CFG1_AC0) >> MEM_CFG1_AC0_S;
55 bank1AC = (memcfg & MEM_CFG1_AC1) >> MEM_CFG1_AC1_S;
56 memsize = (bank0AC ? (1 << (bank0AC+1)) : 0)
57 + (bank1AC ? (1 << (bank1AC+1)) : 0);
61 add_memory_region(0, memsize, BOOT_MEM_RAM);
62 strcpy(arcs_cmdline, "console=ttyS0,9600 rootfstype=squashfs,jffs2");
65 void __init prom_free_prom_memory(void)