Code: Select all
.orig 0x8000 .section text .incbin "orig_kernel8-32.img"
That won't help because kernel_old=1will disable the device tree loading by the firmware and the Linux kernel simply will not boot without device tree.
There is a way to do what you want if you are ok with modifying the kernel source and recompiling (which it looks like you are already doing).
Next comment said it worked so I believe not an issue unless anyone knows differently
Are you trying to do this for the primary CPU, one of the secondary CPUs or for all of them?
For all cpus, in __hyp_stub_install_secondaryAre you trying to do this for the primary CPU, one of the secondary CPUs or for all of them?
Right so this is super early and I don't think mmu/caches is the issues. My issue is secure mode vector table not getting copied properly (in a position independent manner I suppose). To debug the early asm code, in circle baremetal library (that smc handler is called) I was setting a variable from asm in early boot code and reading it back in "C" later. e.g.If the point in the kernel where you are trying to insert code already has the MMU enabled then it is way too late, the switch out of hypervisor mode and then back to secure supervisor mode needs to happen almost immediately after the kernel starts executing or it simply cannot work.
I think that's the wrong place to put this, at the time of calling __hyp_stub_install_secondary you are still in hypervisor mode.
Code: Select all
logger: Circle 39.1 started on Raspberry Pi 3 Model B ----: --> CPUACTLR 290c0000:0 ACTLR 0 flag dead0011 ----: --> CPSR (CPU mode) [stock] 600001da [in smc hdlr] 600001d6