Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't boot non device-tree capable kernel on RPi4 #1175

Closed
9pi opened this issue Jul 5, 2019 · 7 comments
Closed

Can't boot non device-tree capable kernel on RPi4 #1175

9pi opened this issue Jul 5, 2019 · 7 comments

Comments

@9pi
Copy link

9pi commented Jul 5, 2019

The Plan 9 kernel uses ATAGs, not device tree, and successfully boots on RPi3 using the latest start.elf. On RPi4 with start4.elf, it boots and R2 is pointing to a flattened device tree. According to documentation, I should be able to specify device_tree= in config.txt, or add a trailer with DTOK=n or DTOK tag missing, to boot with ATAGs instead. But when I do either or both of these, the kernel does not boot at all.

Does start4.elf still support non device-tree capable kernels?

@9pi
Copy link
Author

9pi commented Jul 5, 2019

It seems also that start4.elf won't boot a kernel binary file whose size isn't a multiple of 4 bytes, when the same file boots fine on RPi3. Luckily that's easy to work around!

@pelwell
Copy link
Contributor

pelwell commented Jul 5, 2019

The very latest build (available as a download from this repo and via rpi-update) should work for non-Device Tree uses again. The problem was caused by the stubs exceeding 256 bytes, which is where the ATAGs are created - apparently some old/bare-metal projects expect them to be there.

I wasn't aware of the multiple-of-4 restriction, and off the top of my head I can't think of a reason why Pi4 would be different from Pi3 in this regard.

@9pi
Copy link
Author

9pi commented Jul 5, 2019

Yes, it now works again. Thank you!

@9pi 9pi closed this as completed Jul 5, 2019
@pelwell
Copy link
Contributor

pelwell commented Jul 5, 2019

Cool. If you have a non-multiple-of-4 "kernel" around to try with the new firmware I'd be grateful for the data point.

@9pi
Copy link
Author

9pi commented Jul 5, 2019

If you have a non-multiple-of-4 "kernel" around

Easily done: echo >>/boot/kernel7l.img
Result won't boot, even with the new firmware.

@pelwell
Copy link
Contributor

pelwell commented Jul 5, 2019

Cheers - it shouldn't be hard to fix.

popcornmix added a commit that referenced this issue Jul 8, 2019
See: #1167

firmware: arm_loader: Support CLOCK_EMMC2 from GET_CLOCK_RATE
See: #1179

firmware: arm_loader: Force word alignment for the DTB
See: #1175

firmware: clock_2711: don't set reserved values for KA in PLL KAIP registers

firmware: Assorted minor fixes for tvservice -o
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this issue Jul 8, 2019
See: raspberrypi/firmware#1167

firmware: arm_loader: Support CLOCK_EMMC2 from GET_CLOCK_RATE
See: raspberrypi/firmware#1179

firmware: arm_loader: Force word alignment for the DTB
See: raspberrypi/firmware#1175

firmware: clock_2711: don't set reserved values for KA in PLL KAIP registers

firmware: Assorted minor fixes for tvservice -o
@popcornmix
Copy link
Contributor

popcornmix commented Jul 8, 2019

Latest rpi-update firmware should have a fix for non aligned "kernel" sizes. Please test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants