aboutsummaryrefslogtreecommitdiff
path: root/slof
diff options
context:
space:
mode:
authorAlexey Kardashevskiy <aik@ozlabs.ru>2019-11-06 13:55:54 +1100
committerAlexey Kardashevskiy <aik@ozlabs.ru>2019-11-11 15:40:15 +1100
commitf9661a257028e49f8fcae77b7cc59d41f4983195 (patch)
tree45c3184c087acebd14e8224d6c4bf9d03570068b /slof
parent73dea09dae61ea78364b6761f891023c990957fa (diff)
downloadSLOF-f9661a257028e49f8fcae77b7cc59d41f4983195.zip
SLOF-f9661a257028e49f8fcae77b7cc59d41f4983195.tar.gz
SLOF-f9661a257028e49f8fcae77b7cc59d41f4983195.tar.bz2
client: Load initramdisk location
For ages both vmlinux and zImage accepted the initramdisk location in r3/r4 [1] [2]. If r3==r4==0, vmlinux looks at the device tree for /chosen/linux,initrd-{start|end} but zImage does not so the QEMU user can only pass vmlinux via -kernel if -initrd is passed as well. This initializes r3/r4 to point to the initramdisk location when present. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/kernel/prom_init.c?h=v5.3#n3230 [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/boot/of.c?h=v5.3#n89 Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> --- Changes: v2: * improved readability
Diffstat (limited to 'slof')
-rw-r--r--slof/fs/client.fs8
1 files changed, 8 insertions, 0 deletions
diff --git a/slof/fs/client.fs b/slof/fs/client.fs
index 8a7f6ac..db7a192 100644
--- a/slof/fs/client.fs
+++ b/slof/fs/client.fs
@@ -45,6 +45,14 @@ VARIABLE client-callback \ Address of client's callback function
>r ciregs >r7 ! ciregs >r6 ! client-entry-point @ ciregs >r5 !
\ Initialise client-stack-pointer
cistack ciregs >r1 !
+
+ s" linux,initrd-end" get-chosen IF decode-int nip nip ELSE 0 THEN
+ s" linux,initrd-start" get-chosen IF decode-int nip nip ELSE 0 THEN
+ ( end start )
+ tuck - ( start len )
+ ciregs >r4 !
+ ciregs >r3 !
+
\ jump-client maps to call_client in slof/entry.S
\ When jump-client returns, R3 holds the address of a NUL-terminated string
\ that holds the client interface word the client wants to call, R4 holds