11 #include <linux/module.h>
12 #include <linux/kernel.h>
15 #include <asm/bootinfo.h>
25 static inline unsigned long get_bank_addr(
unsigned int memconfig)
31 static inline unsigned long get_bank_size(
unsigned int memconfig)
37 static inline unsigned int get_bank_config(
int bank)
40 return bank % 2 ? res & 0xffff : res >> 16;
51 static void __init probe_memory(
void)
53 int i,
j, found,
cnt = 0;
59 unsigned int tmp = get_bank_config(i);
63 bank[
cnt].
size = get_bank_size(tmp);
64 bank[
cnt].
addr = get_bank_addr(tmp);
66 i, bank[cnt].
size / 1024 / 1024, bank[cnt].
addr);
75 for (i = 1; i <
cnt; i++)
76 if (bank[i-1].addr > bank[i].addr) {
88 for (i = 0; i <
cnt; i++) {
90 for (j = 0; j <
ARRAY_SIZE(space) && !found; j++)
91 if (space[j].addr + space[j].size == bank[i].addr) {
98 "(%08lx), expect Bus Error soon\n",
143 #ifndef CONFIG_SGI_IP28
211 #ifdef CONFIG_SGI_IP28
224 sgimc->
mconfig1 = (mconfig1 & 0xffff0000) | 0x2060;
235 spin_unlock_irqrestore(&lock, flags);