25 #define HW_REG(x) ((void *)(x))
27 #define EXI_CTRL HW_REG(0x0d800070)
28 #define EXI_CTRL_ENABLE (1<<0)
30 #define MEM2_TOP (0x10000000 + 64*1024*1024)
31 #define FIRMWARE_DEFAULT_SIZE (12*1024*1024)
44 static int mipc_check_address(
u32 pa)
47 if (pa < 0x10000000 || pa > 0x14000000)
58 if (mipc_check_address((
u32)hdrp)) {
59 printf(
"mini: invalid hdrp %08X\n", (
u32)hdrp);
65 if (mipc_check_address((
u32)hdr)) {
66 printf(
"mini: invalid hdr %08X\n", (
u32)hdr);
70 if (
memcmp(hdr->magic,
"IPC", 3)) {
71 printf(
"mini: invalid magic\n");
85 hdr = mipc_get_infohdr();
92 printf(
"mini: invalid mem2_boundary %08X\n",
104 static void platform_fixups(
void)
112 mem = finddevice(
"/memory");
114 fatal(
"Can't find memory node\n");
117 len = getprop(mem,
"reg", reg,
sizeof(reg));
118 if (len !=
sizeof(reg)) {
124 error = mipc_get_mem2_boundary(&mem2_boundary);
130 if (mem2_boundary > reg[2] && mem2_boundary < reg[2] + reg[3]) {
131 reg[3] = mem2_boundary - reg[2];
132 printf(
"top of MEM2 @ %08X\n", reg[2] + reg[3]);
133 setprop(mem,
"reg", reg,
sizeof(reg));