Port-macppc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: 601s and Open Firmware



> You may find this message of interest:
> <http://mail-index.netbsd.org/port-macppc/2008/09/28/msg000422.html>
>
> it contains a patch to make the "ofwboot.xcf" work.

I patched src/sys/arch/macppc/stand/ofwboot/Locore.c as included below,
based on the patch from the link above.  No matter what I do now, I can't
get a kernel to actually start booting.  I've tried various options with
and without -mcpu=601, PPC_OEA601, debugging, diagnostic, OFWOEA_DEBUG and
more.  All I can ever seem to get is:

0 > boot enet:,nfwboot.xcf file: 192.168.2.63,nfwboot.xcfloading XCOFF
tsize=E110 dsize=268 bsize=2A30 entry=E00000
SECTIONS:
.text    00E00000 00E00000 0000E110 000000E0
.data    00E0F000 00E0F000 00000268 0000E1F0
.bss     00E0F268 00E0F268 00002A30 00000000
loading .text, done..
loading .data, done..
clearing .bss, done..

>> NetBSD/macppc OpenFirmware Boot, Revision 1.10
>> (hbent%sinclair.cs.oberlin.edu@localhost, Thu Nov  6 00:41:02 EST 2008)
file: 192.168.2.63,nfwboot.xcfUsing IP address: 192.168.2.195
root addr=192.168.2.63 path=/export/macppc/root/
2309812+265600 [179104+167245]=0x2c98f0
 start=0x100000
entry is being called with 0, 0, ff8099b8, enet/netbsd, 18

and then things just hang forever.  I can't duplicate the results from
http://mail-index.netbsd.org/port-macppc/2008/09/29/msg000425.html .

-Henry

--

--- Locore.c.orig       2006-09-18 06:19:00.000000000 -0400
+++ Locore.c    2008-11-06 01:54:02.000000000 -0500
@@ -69,6 +69,11 @@
 "      li      %r0,0           \n"
 "      mtmsr   %r0             \n"
 "      isync                   \n"
+"                              \n" /* test for 601 */
+"      mfspr   %r0,287         \n" /* mfpvr %r0 PVR = 287 */
+"      srwi    %r0,%r0,0x10    \n"
+"      cmpi    0,1,%r0,0x02    \n" /* 601 CPU = 0x0001 */
+"      blt     1f              \n" /* skip over non-601 BAT setup */
 "                              \n"
 "      mtibatu 0,%r0           \n"
 "      mtibatu 1,%r0           \n"
@@ -86,10 +91,47 @@
 "      mtibatu 0,%r9           \n"
 "      mtdbatu 0,%r9           \n"
-"      isync                   \n"
+"      b       2f              \n"
+
+       /* PPC 601 BATs*/
+
+"1:    mtibatu 0,%r0           \n"
+"      mtibatu 1,%r0           \n"
+"      mtibatu 2,%r0           \n"
+"      mtibatu 3,%r0           \n"
+"                              \n"
+"      li      %r9,0x7f        \n"
+"      mtibatl 0,%r9           \n"
+"      li      %r9,0x1a        \n"
+"      mtibatu 0,%r9           \n"
+"                              \n"
+"      lis     %r9,0x80        \n"
+"      addi    %r9,%r9,0x7f    \n"
+"      mtibatl 1,%r9           \n"
+"      lis     %r9,0x80        \n"
+"      addi    %r9,%r9,0x1a    \n"
+"      mtibatu 1,%r9           \n"
+"                              \n"
+"      lis     %r9,0x100       \n"
+"      addi    %r9,%r9,0x7f    \n"
+"      mtibatl 2,%r9           \n"
+"      lis     %r9,0x100       \n"
+"      addi    %r9,%r9,0x1a    \n"
+"      mtibatu 2,%r9           \n"
+"                              \n"
+"      lis     %r9,0x180       \n"
+"      addi    %r9,%r9,0x7f    \n"
+"      mtibatl 3,%r9           \n"
+"      lis     %r9,0x180       \n"
+"      addi    %r9,%r9,0x1a    \n"
+"      mtibatu 3,%r9           \n"
+"                              \n"
+"2:    isync                   \n"
 "                              \n"
 "      mtmsr   %r8             \n"
 "      isync                   \n"
 "                              \n"
+
        /*
         * Make sure that .bss is zeroed
         */
@@ -519,6 +561,7 @@
 #if 0
        OF_release(virt, size);
 #endif
+       printf("entry is being called with 0, 0, %x, %s, %x\n",
openfirmware, arg, len);
        entry(0, 0, openfirmware, arg, len);
 }
 #endif





Home | Main Index | Thread Index | Old Index