Skip to content

initial port of little-kernel to vc4 - #259

Closed
cleverca22 wants to merge 101 commits into
littlekernel:masterfrom
librerpi:vc4
Closed

initial port of little-kernel to vc4#259
cleverca22 wants to merge 101 commits into
littlekernel:masterfrom
librerpi:vc4

Conversation

@cleverca22

Copy link
Copy Markdown
Contributor

some parts are copy/pasted from https://github.com/cleverca22/rpi-open-firmware
which itself is a fork of https://github.com/christinaa/rpi-open-firmware

what works:
network booting lk.elf on an rpi4 (just rename to start4.elf and host over tftp)
the full console with line editing and history
serial over pl011 (but no serial init, relies on previous bootloader stage)
reboot command
irq handling for timer compare and uart
one-shot timer
reporting cpu exceptions such as divide by zero

some parts are copy/pasted from https://github.com/cleverca22/rpi-open-firmware
which itself is a fork of https://github.com/christinaa/rpi-open-firmware

what works:
network booting lk.elf on an rpi4 (just rename to start4.elf and host over tftp)
the full console with line editing and history
serial over pl011 (but no serial init, relies on previous bootloader stage)
reboot command
irq handling for timer compare and uart
one-shot timer
reporting cpu exceptions such as divide by zero
@cleverca22
cleverca22 force-pushed the vc4 branch 5 times, most recently from 72e853b to cd49878 Compare January 14, 2020 19:14
cleverca22 and others added 14 commits January 29, 2020 12:57
add sdhost code
add gpio pullup test
fix peripheral address
implement batch gpio pull config changes
fix memory information to be based on boot stage, not model
add rpi4 recovery.bin support
This is a clean rewrite of the OTP routines using new findings.
Based on previous research, this commit implements a write command.

       Use with care!
What is done cannot be undone.
This bit does not tell whether programming was OK, but whether
programming is enabled. Renaming should prevent confusion when
BCM283x support is added.
The OTP chip in BCM283x cannot program a full word in a single
command. Instead, individual bits must be programmed one by one.

There is also a subtle difference in program enable. The magic
sequence must be written to OTP_BITSEL, not OTP_DATA.

Tested on a RPi3 B (no plus).
Get rid of hardcoded values in pll_control.c
@travisg

travisg commented Aug 23, 2026

Copy link
Copy Markdown
Member

Closing this as unmergeable at this distance, with regret — a working vc4 port that network boots on an rpi4 with console and irq handling is genuinely interesting, and "renamed to start4.elf and served over tftp" is a fun way to boot LK.

The problem is scale against age: +13.5k lines across 100 files, much of it derived from rpi-open-firmware, sitting five years behind a tree that has since changed the module system, the VM layer and the arch interface underneath it. Nobody here can review or maintain a new architecture backend that can't be built or tested in CI, and there's no upstream path that starts from rebasing this.

If you're still running it, the parts most likely to survive a port forward are the vc4 arch backend and the platform init, separated from the copied firmware code. Happy to look at that as a fresh PR.

@travisg travisg closed this Aug 23, 2026
@travisg

travisg commented Aug 23, 2026

Copy link
Copy Markdown
Member

Heh sorry, the AI agent was a bit harsh, but it would be interesting to rebase the vc4 stuff on mainline.

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

Successfully merging this pull request may close these issues.

3 participants