]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/9/bcm64/mkfile
bcm64: handle 8GB of physical memory for raspberry pi4
[plan9front.git] / sys / src / 9 / bcm64 / mkfile
index 151c7e898430059fee0c530ff6cf81570feb124d..4ba978899911df237d2b148870dfd6a33c06b831 100644 (file)
@@ -1,7 +1,7 @@
 CONF=pi3
-CONFLIST=pi3
+CONFLIST=pi3 pi4
 
-loadaddr=0xffffffff80080000
+loadaddr=0xffffffffc0080000
 
 objtype=arm64
 </$objtype/mkfile
@@ -37,6 +37,7 @@ PORT=\
        taslock.$O\
        tod.$O\
        xalloc.$O\
+       userinit.$O\
 
 OBJ=\
        l.$O\
@@ -44,7 +45,6 @@ OBJ=\
        bootargs.$O\
        clock.$O\
        fpu.$O\
-       irq.$O\
        main.$O\
        mmu.$O\
        sysreg.$O\
@@ -69,14 +69,13 @@ LIB=\
 
 9:V: $p$CONF s$p$CONF
 
-$p$CONF:DQ:    $CONF.c $OBJ $LIB mkfile
-       $CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
+$p$CONF:DQ:    $OBJ $CONF.$O $LIB
        echo '# linking raw kernel'     # H6: no headers, data segment aligned
-       $LD -l -o $target -H6 -R0x10000 -T$loadaddr $OBJ $CONF.$O $LIB
+       $LD -s -l -o $target -H6 -R0x10000 -T$loadaddr $prereq
 
-s$p$CONF:DQ:   $CONF.$O $OBJ $LIB
+s$p$CONF:DQ:   $OBJ $CONF.$O $LIB
        echo '# linking kernel with symbols'
-       $LD -l -o $target -R0x10000 -T$loadaddr $OBJ $CONF.$O $LIB
+       $LD -l -o $target -R0x10000 -T$loadaddr $prereq
        size $target
 
 $p$CONF.gz:D:  $p$CONF
@@ -100,41 +99,26 @@ REPCC=`{../port/mkfilelist ../bcm}
 
 arch.$O clock.$O fpiarm.$O main.$O mmu.$O screen.$O syscall.$O trap.$O: \
        /$objtype/include/ureg.h
-
-l.$O cache.v8.$O mmu.$O: mem.h
-l.$O cache.v8.$O archbcm3.$O clock.$O fpu.$O trap.$O mmu.$O: sysreg.h
-main.$O: reboot.h
+trap.$O main.$O: /sys/include/tos.h
+l.$O cache.v8.$O mmu.$O rebootcode.$O: mem.h
+l.$O cache.v8.$O archbcm3.$O clock.$O fpu.$O trap.$O mmu.$O rebootcode.$O: sysreg.h
+main.$O: rebootcode.i
 
 devmouse.$O mouse.$O screen.$O: screen.h
 usbdwc.$O: dwcotg.h ../port/usb.h
 
-io.h:D:        ../bcm/io.h
-       echo '#include "../bcm/io.h"' > io.h
+io.h:  ../bcm/io.h
+       touch $target
 screen.h:D: ../bcm/screen.h
        echo '#include "../bcm/screen.h"' > screen.h
 dwcotg.h:D: ../bcm/dwcotg.h
        echo '#include "../bcm/dwcotg.h"' > dwcotg.h
 
-init.h:D:      ../port/initcode.c init9.s
-       $CC ../port/initcode.c
-       $AS init9.s
-       $LD -l -R1 -s -o init.out init9.$O initcode.$O /$objtype/lib/libc.a
-       {echo 'uchar initcode[]={'
-        xd -1x <init.out |
-               sed -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
-        echo '};'} > init.h
-
-reboot.h:D:    rebootcode.s cache.v8.$O mem.h sysreg.h
-       $AS rebootcode.s
-       # -T arg is REBOOTADDR
-       $LD -l -o reboot.out -H6 -R1 -T0x1c00 rebootcode.$O cache.v8.$O
-       {echo 'uchar rebootcode[]={'
-        xd -1x reboot.out |
-               sed -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
-        echo '};'} > reboot.h
-
-errstr.h:D:    ../port/mkerrstr ../port/error.h
-       rc ../port/mkerrstr > errstr.h
+initcode.out:          init9.$O initcode.$O /$objtype/lib/libc.a
+       $LD -l -R1 -s -o $target $prereq
+
+rebootcode.out:                rebootcode.$O cache.v8.$O
+       $LD -l -H6 -R1 -T0x1c00 -s -o $target $prereq
 
 $CONF.clean:
-       rm -rf $p$CONF s$p$CONF errstr.h reboot.h io.h screen.h dwcotg.h $CONF.c boot$CONF.c
+       rm -rf $p$CONF s$p$CONF errstr.h screen.h dwcotg.h $CONF.c boot$CONF.c