1 hour ago1 hr Hi all,Some of you have seen my earlier posts about the Orange Pi 4 Pro. Tonight I can report something I've wanted to write for a long time: the Allwinner A733 has a working EDK2 (TianoCore) UEFI firmware. As far as we know it's the first UEFI port for this SoC. It boots real operating systems from NVMe, USB and SD through standard UEFI interfaces: a GOP display, UEFI variables and GRUB.One thing makes this project unusual: the engineering was done by an AI. Claude (Anthropic's Opus model) wrote the drivers, read the datasheets and vendor BSP, and made the design decisions. I did the hands-on hardware work: UART wiring, power, cooling, swapping cables, plugging in keyboards and pressing reset more times than I can count. My goal from day one was the first EDK2 port of a SoC done entirely by AI. We're there.---WHAT WORKS (tested on real hardware, Orange Pi 4 Pro)- Persistent UEFI variables on SPI-NOR flash. Boot order, boot counts and settings survive a full power loss. A fault-tolerant write layer and variable reclaim were tested on real hardware. Linux sees the store through efivarfs. For now, writes are allowed only while the firmware is running (boot time); writes from the OS are refused on purpose for safety.- PCIe + NVMe. The link trains from a cold start, and the NVMe shows up as a normal UEFI block device. The firmware can read the disk, its partitions and FAT filesystems.- USB 3.0 (DWC3 / xHCI). Read and write verified on a USB 3 stick.- USB keyboard through the USB 2 (EHCI) path. You can drive the setup menu and the boot menu with a real keyboard.- HDMI output. A proper GOP framebuffer at 1920x1080 on HDMI. The UEFI setup screens, the boot manager and GRUB all show on screen, and Linux gets a clean display hand-off when it starts.- SD/MMC block device, SMBIOS tables (shows 2x Cortex-A76 + 6x Cortex-A55 correctly), firmware version reporting (v0.5).- Booting OSes:- Debian: direct EFI-stub kernel hand-off, no bootloader in between.- Ubuntu 26.04.1 LTS installed on the NVMe: EDK2 -> GRUB 2.14 -> kernel -> NVMe root -> systemd -> login prompt. (See "known issues" for the one remaining kernel-module fix.)- A stock Ubuntu arm64 kernel also boots through the firmware and reads our EFI tables. Mainline Linux just doesn't have drivers for the A733's controllers yet.---THE HARD PARTS (and what they taught us)A few of these may save someone else days:1. SPI flash: the "pin mux" was really a voltage register. Early SPI code wrote the Port C function select to 0x02000040. On the A733's newer GPIO layout, that address is POW_MOD_SEL, the I/O voltage-mode register. The PIO banks are 0x80 apart, starting with PA at 0x080, so Port C is at 0x02000180. SPI0 is function 5 on PC2–PC4 + PC7, and the clock is on PC12, not PC1 as an older note claimed.2. PCIe: it isn't a power-domain problem. We spent time suspecting the power domain. The real requirements are the PCIe clocks (100 MHz ref), the resets, the DCXO reference enable in the RTC block, and a full combo-PHY1 init before the controller can train the link. PERST# is on PD22 and slot power on PL3.3. USB 3.0 had three separate bugs stacked on top of each other: combo-PHY0 was never initialised, the DWC3 global register offsets were off by 16 bytes, and VBUS for the port is on PB7, not the bank we were driving.4. HDMI: the "dark screen" fix was a single register. We brought up the display engine (DE), TCON-TV and the DesignWare HDMI PHY over its internal I2C, and the screen stayed black. The TCON output pins are tri-stated at reset; until you clear the IO tri-state registers, nothing leaves the chip. After that came a framebuffer collision (an old unreserved buffer overlapping ours), fixed by reserving the framebuffer properly in the memory map.5. EndOfDxe was never signalled. The security stub then refused to load anything not built into the firmware: GRUB, kernels, the shell. Signalling EndOfDxe fixed it.6. GRUB on arm64 needs an EFI-stub kernel. The vendor BSP kernel is a plain Image. GRUB 2.14 says "plain image kernel not supported – rebuild with CONFIG_(U)EFI_STUB". The fix is to rebuild the vendor 5.15 kernel with CONFIG_EFI + CONFIG_EFI_STUB, and to build the kernel and its modules together from the same tree so the modules match the kernel.7. Boot-option pile-up. Built-in firmware apps are registered by a device path that contains the firmware volume's memory address. That address moves with every build, so each new build added another "Debian" and another "UEFI Shell" entry. At one point there were 80 of each. Firmware options are now de-duplicated by the file GUID.---THE JOURNEYThis wasn't a straight line. Along the way:- We lost two bench boards to unmeasured voltage (one A733 and an RK3588 board), which taught us a firm rule: measure every source and rail before connecting anything. Never put 3.3 V on a 1.8 V line.- The current board kept powering itself off mid-session. It turned out the heatsink had come off and the CPU was cooking. Proper thermal paste, new power leads and 5.2 V on the bench supply fixed it.- We went through three USB-UART adapters before getting a clean console, and learned the hard way that two programs reading the same serial port will scramble each other's output.- Bring-up was mostly done by comparing register dumps from the vendor Linux kernel (which already had a peripheral running) with what our firmware set up, then working through the differences until they matched.- Licensing was handled carefully. The port is BSD-2-Clause-Patent like EDK2 itself. The vendor BSP is GPL, so we took only hardware facts from it (addresses, register values, init sequences as data tables) and never copied its code.---WHAT'S COMING- Networking inside the firmware (USB network adapters first, then the on-board GMAC Ethernet). This enables PXE/HTTP boot and the next item.- "byai", a small built-in AI assistant in the UEFI menu: a tiny fine-tuned model that can explain firmware settings and help you troubleshoot a boot.- Finishing the Ubuntu image: kernel + matched modules from one build, regenerated initramfs, then possibly a downloadable "byai OS" Ubuntu-based image for the A733.- USB 1.1 (OHCI) support, so the blue port's USB 2 pair works for keyboards in the firmware.- An SD card capacity fix, writing UEFI variables from the OS, and a boot splash.- Longer term: a modern kernel. Community work porting the A733 BSP drivers onto mainline (6.18.y) could let us drop the old 5.15 vendor kernel entirely.---KNOWN ISSUES (being honest)- EDK2 is currently launched by the vendor BOOT0/ATF/U-Boot chain (EDK2 runs as the U-Boot payload). It is not yet flashed as a stand-alone boot ROM.- The OS side still relies on the vendor 5.15 kernel; mainline can boot but can't drive the SoC's peripherals yet.- Ubuntu reached its login prompt, then the vendor Ethernet module crashed because it didn't match the rebuilt kernel. Matched modules are built and are being installed now.I'll post the repo link, build instructions and photos in the replies. Questions and testers with other A733 boards (Radxa Cubie A7A/A7Z, ArmSoM Sige6) are very welcome. Most of the SoC-level work should carry over with board-specific device trees and pin changes.Built by AI, for AI: by-ai-for-ai.com– Jacob George
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.