12 #include <linux/kernel.h>
14 #include <linux/string.h>
17 #include <asm/addrspace.h>
21 #include <asm/bootinfo.h>
30 #define PROM_GET_MEMCONF 58
31 #define PROM_GET_HWCONF 61
33 #define PROM_VEC (u64 *)CKSEG1ADDR(0x1fc00000)
34 #define PROM_ENTRY(x) (PROM_VEC + (x))
36 #define ___prom_putchar ((int *(*)(int))PROM_ENTRY(PROM_PUTCHAR))
37 #define ___prom_getenv ((char *(*)(char *))PROM_ENTRY(PROM_GETENV))
38 #define ___prom_get_memconf ((void (*)(void *))PROM_ENTRY(PROM_GET_MEMCONF))
39 #define ___prom_get_hwconf ((u32 (*)(void))PROM_ENTRY(PROM_GET_HWCONF))
43 static u8 o32_stk[16384];
44 #define O32_STK &o32_stk[sizeof(o32_stk)]
46 #define __PROM_O32(fun, arg) fun arg __asm__(#fun); \
47 __asm__(#fun " = call_o32")
49 int __PROM_O32(__prom_putchar, (
int *(*)(
int),
void *,
int));
50 char *__PROM_O32(
__prom_getenv, (
char *(*)(
char *),
void *,
char *));
51 void __PROM_O32(__prom_get_memconf, (
void (*)(
void *),
void *,
void *));
52 u32 __PROM_O32(__prom_get_hwconf, (
u32 (*)(
void),
void *));
54 #define _prom_putchar(x) __prom_putchar(___prom_putchar, O32_STK, x)
55 #define _prom_getenv(x) __prom_getenv(___prom_getenv, O32_STK, x)
56 #define _prom_get_memconf(x) __prom_get_memconf(___prom_get_memconf, O32_STK, x)
57 #define _prom_get_hwconf() __prom_get_hwconf(___prom_get_hwconf, O32_STK)
60 #define _prom_putchar(x) ___prom_putchar(x)
61 #define _prom_getenv(x) ___prom_getenv(x)
62 #define _prom_get_memconf(x) ___prom_get_memconf(x)
63 #define _prom_get_hwconf(x) ___prom_get_hwconf(x)
81 if (hwconf == 0xffffffff)
101 static void __init sni_mem_init(
void)
117 pr_debug(
"IDProm memsize: %u MByte\n", memsize);
122 pr_debug(
"prom_get_mem_conf memory configuration:\n");
123 for (i = 0; i < 8 && memconf[
i].size; i++) {
126 if (memconf[i].base >= 0x20000000 &&
127 memconf[i].base < 0x30000000)
128 memconf[
i].base -= 0x20000000;
130 pr_debug(
"Bank%d: %08x @ %08x\n", i,
131 memconf[i].
size, memconf[i].base);
146 for (i = 1; i <
argc; i++) {