From: Albert H. <he...@us...> - 2009-10-25 18:50:37
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/boot In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31074/arch/powerpc/boot Modified Files: Makefile ugecon.c wii.c wrapper Log Message: Merge gc-linux-v2.6.30. Index: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/boot/Makefile,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Makefile 25 Oct 2009 18:45:35 -0000 1.10 --- Makefile 25 Oct 2009 18:50:26 -0000 1.11 *************** *** 66,70 **** 4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c \ cpm-serial.c stdlib.c mpc52xx-psc.c planetcore.c uartlite.c \ ! fsl-soc.c mpc8xx.c pq2.c src-plat := of.c cuboot-52xx.c cuboot-824x.c cuboot-83xx.c cuboot-85xx.c holly.c \ cuboot-ebony.c treeboot-ebony.c prpmc2800.c \ --- 66,70 ---- 4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c \ cpm-serial.c stdlib.c mpc52xx-psc.c planetcore.c uartlite.c \ ! fsl-soc.c mpc8xx.c pq2.c ugecon.c src-plat := of.c cuboot-52xx.c cuboot-824x.c cuboot-83xx.c cuboot-85xx.c holly.c \ cuboot-ebony.c treeboot-ebony.c prpmc2800.c \ *************** *** 76,80 **** cuboot-warp.c cuboot-85xx-cpm2.c cuboot-yosemite.c simpleboot.c \ virtex405-head.S virtex.c redboot-83xx.c cuboot-sam440ep.c \ ! cuboot-acadia.c cuboot-amigaone.c src-boot := $(src-wlib) $(src-plat) empty.c --- 76,80 ---- cuboot-warp.c cuboot-85xx-cpm2.c cuboot-yosemite.c simpleboot.c \ virtex405-head.S virtex.c redboot-83xx.c cuboot-sam440ep.c \ ! cuboot-acadia.c cuboot-amigaone.c gamecube.c wii.c src-boot := $(src-wlib) $(src-plat) empty.c *************** *** 253,256 **** --- 253,258 ---- image-$(CONFIG_MPC7448HPC2) += cuImage.mpc7448hpc2 image-$(CONFIG_PPC_C2K) += cuImage.c2k + image-$(CONFIG_GAMECUBE) += dtbImage.gamecube + image-$(CONFIG_WII) += dtbImage.wii # Board port in arch/powerpc/platform/amigaone/Kconfig Index: wrapper =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/boot/wrapper,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wrapper 25 Oct 2009 18:45:35 -0000 1.1 --- wrapper 25 Oct 2009 18:50:26 -0000 1.2 *************** *** 226,229 **** --- 226,232 ---- binary=y ;; + wii|gamecube) + link_address='0x500000' + ;; esac Index: ugecon.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/boot/ugecon.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ugecon.c 1 Feb 2009 18:29:34 -0000 1.2 --- ugecon.c 25 Oct 2009 18:50:26 -0000 1.3 *************** *** 115,119 **** void *devp; ! devp = finddevice("/exi/usbgecko"); if (devp == NULL) goto err_out; --- 115,119 ---- void *devp; ! devp = find_node_by_alias("ugecon"); if (devp == NULL) goto err_out; Index: wii.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/boot/wii.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wii.c 28 Mar 2009 20:44:19 -0000 1.3 --- wii.c 25 Oct 2009 18:50:26 -0000 1.4 *************** *** 38,43 **** mfmsr 9\n\ andi. 0, 9, (1<<4)|(1<<5) /* MSR_DR|MSR_IR */\n\ ! bcl 20,31,1f\n\ ! 1:\n\ mflr 8\n\ clrlwi 8, 8, 3 /* convert to a real address */\n\ --- 38,43 ---- mfmsr 9\n\ andi. 0, 9, (1<<4)|(1<<5) /* MSR_DR|MSR_IR */\n\ ! bcl 20, 31, 1f\n\ ! 1: \n\ mflr 8\n\ clrlwi 8, 8, 3 /* convert to a real address */\n\ *************** *** 48,52 **** sync\n\ rfi\n\ ! _mmu_off:\n\ /* MMU disabled */\n\ \n\ --- 48,52 ---- sync\n\ rfi\n\ ! _mmu_off: \n\ /* MMU disabled */\n\ \n\ *************** *** 97,101 **** \n\ lis 8, 0xcc00 /* I/O mem */\n\ ! ori 8,8, 0x3ff /* 32MiB */\n\ lis 9, 0x0c00\n\ ori 9, 9, 0x002a /* uncached, guarded, rw */\n\ --- 97,101 ---- \n\ lis 8, 0xcc00 /* I/O mem */\n\ ! ori 8, 8, 0x3ff /* 32MiB */\n\ lis 9, 0x0c00\n\ ori 9, 9, 0x002a /* uncached, guarded, rw */\n\ *************** *** 112,124 **** mtspr 0x21d, 9 /* DBAT2L */\n\ \n\ sync\n\ isync\n\ \n\ li 3, 0\n\ li 4, 0\n\ li 5, 0\n\ \n\ ! bcl 20,31,1f\n\ ! 1:\n\ mflr 8\n\ addi 8, 8, _mmu_on - 1b\n\ --- 112,143 ---- mtspr 0x21d, 9 /* DBAT2L */\n\ \n\ + lis 8, 0x1000 /* MEM2 */\n\ + ori 8, 8, 0x07ff /* 64MiB */\n\ + lis 9, 0x1000\n\ + ori 9, 9, 0x0002 /* rw */\n\ + mtspr 0x216, 8 /* IBAT3U */\n\ + mtspr 0x217, 9 /* IBAT3L */\n\ + mtspr 0x21e, 8 /* DBAT3U */\n\ + mtspr 0x21f, 9 /* DBAT3L */\n\ + \n\ sync\n\ isync\n\ \n\ + /* enable high BATs */\n\ + lis 8, 0x8200\n\ + mtspr 0x3f3, 8 /* HID4 */\n\ + \n\ + /* enable caches */\n\ + mfspr 8, 0x3f0\n\ + ori 8, 8, 0xc000\n\ + mtspr 0x3f0, 8 /* HID0 */\n\ + isync\n\ + \n\ li 3, 0\n\ li 4, 0\n\ li 5, 0\n\ \n\ ! bcl 20, 31, 1f\n\ ! 1: \n\ mflr 8\n\ addi 8, 8, _mmu_on - 1b\n\ *************** *** 129,133 **** sync\n\ rfi\n\ ! _mmu_on:\n\ b _zimage_start_lib\n\ "); --- 148,158 ---- sync\n\ rfi\n\ ! _mmu_on: \n\ ! /* turn on the front blue led (aka: yay! we got here!) */\n\ ! lis 8, 0xcd00\n\ ! ori 8, 8, 0x00c0\n\ ! lwz 9, 0(8)\n\ ! ori 9, 9, 0x20\n\ ! stw 9, 0(8)\n\ b _zimage_start_lib\n\ "); *************** *** 171,174 **** --- 196,300 ---- /* * + * + */ + + struct mipc_infohdr { + char magic[3]; + u8 version; + u32 mem2_boundary; + u32 ipc_in; + size_t ipc_in_size; + u32 ipc_out; + size_t ipc_out_size; + }; + + static int mipc_check_address(u32 pa) + { + if (pa < 0x10000000 || pa > 0x14000000) + return -EINVAL; + return 0; + } + + static void platform_fixups(void) + { + struct mipc_infohdr **hdrp, *hdr; + u32 reg[4]; + u32 mem2_boundary, top; + void *devp; + + /* + * The mini header pointer is specified in the second "reg" entry + * of the starlet-mini-ipc node. + */ + devp = find_node_by_compatible(NULL, "twiizers,starlet-mini-ipc"); + if (!devp) { + printf("unable to find %s node\n", "twiizers,starlet-mini-ipc"); + goto err_out; + } + if (getprop(devp, "reg", ®, sizeof(reg)) != sizeof(reg)) { + printf("unable to find %s property\n", "reg"); + goto err_out; + } + hdrp = (struct mipc_infohdr **)reg[2]; + if (mipc_check_address((u32)hdrp)) { + printf("mini: invalid hdrp %08X\n", (u32)hdrp); + goto err_out; + } + + hdr = *hdrp; + if (mipc_check_address((u32)hdr)) { + printf("mini: invalid hdr %08X\n", (u32)hdr); + goto err_out; + } + if (memcmp(hdr->magic, "IPC", 3)) { + printf("mini: invalid magic, asuming ios\n"); + goto err_out; + } + mem2_boundary = hdr->mem2_boundary; + if (mipc_check_address(mem2_boundary)) { + printf("mini: invalid mem2_boundary %08X\n", mem2_boundary); + goto err_out; + } + + top = mem2_boundary; + printf("top of mem @ %08X (%s)\n", top, "current"); + + /* fixup local memory for EHCI controller */ + devp = NULL; + while ((devp = find_node_by_compatible(devp, + "nintendo,hollywood-ehci"))) { + if (getprop(devp, "reg", ®, sizeof(reg)) == sizeof(reg)) { + top -= reg[3]; + printf("ehci %08X -> %08X\n", reg[2], top); + reg[2] = top; + setprop(devp, "reg", ®, sizeof(reg)); + } + } + + /* fixup local memory for OHCI controllers */ + devp = NULL; + while ((devp = find_node_by_compatible(devp, + "nintendo,hollywood-ohci"))) { + if (getprop(devp, "reg", ®, sizeof(reg)) == sizeof(reg)) { + top -= reg[3]; + printf("ohci %08X -> %08X\n", reg[2], top); + reg[2] = top; + setprop(devp, "reg", ®, sizeof(reg)); + } + } + + /* fixup available memory */ + dt_fixup_memory(0, top); + + printf("top of mem @ %08X (%s)\n", top, "final"); + + return; + + err_out: + return; + } + + /* + * */ void platform_init(unsigned long r3, unsigned long r4, unsigned long r5) *************** *** 182,185 **** --- 308,312 ---- console_ops.write = ug_console_write; + platform_ops.fixups = platform_fixups; save_lowmem_stub(); } |