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
Add SOPINE / PINE A64-LTS bootloader #32553
Conversation
For qemu, at 1.4 from upstream. For Sopine / Pine A64-LTS, at 1.0 from fork.
This build is compatible with PINE A64-LTS.
@GrahamcOfBorg eval |
That's what I meant when I said "I bodged this together". This comes from the u-boot derivation, which has Do note that I have no test suite, the only test I'm doing is the "it boots!" test. I'm not even sure where this code lives and how it can be interacted with, if it can be interacted with. |
I wonder how hard would it to have the U-Boot patch as something proper that could go upstream. If you just copy |
"Just" copying the .dts, and the includes, makes it not build anymore.
Not knowing much about device trees, I really don't know what labels or paths not being found means. I've been familiarizing myself with u-boot this evening, and have found out that I was indeed correct in assuming that it loads the file according to what Unless you know some magic or have other tips related to u-boot, I'll be looking into contributing the minor, but impactful copied file change. |
The `CONFIG_DEFAULT_DEVICE_TREE` config is used to build the name of the device tree that is loaded by u-boot. This makes this config config file redundant (and unused). The generated u-boot file is the same, once built.
Sorry this took so long. Apparently the problem on the U-Boot side was much thornier than I expected. But, now there is a patch series from Andre Przywara posted upstream at http://patchwork.ozlabs.org/cover/880198/ which adds proper SoPine support to U-Boot. I expect that will land upstream in 2018.05 but I've picked it here as a patch series in https://github.com/dezgeg/nixpkgs/tree/uboot-aarch64 (or a prebuilt one at Note, U-Boot 2018.05 will also have Allwinner builds produce |
I can confirm, after I don't see any need for split bin/itb files, though I don't know if there are any needs. When previously building u-boot, I was catting them together anyway. Unless you tell me otherwise, I'll leave it to you to close the PR. |
Thanks for testing. Applied to master now.
Yeah, I haven't ever needed them myself, but I haven't ever used the various other methods like DFU / sunxi-tool / NAND so I don't know what those need. But they can be always added later. |
Motivation for this change
Adds the necessary packages to build the bootloader for both the SOPINE and PINE A64-LTS boards.
NixOS (upstream Linux) isn't working 100% with these boards, but the upstream u-boot already has support for the boards. Leaving the configuration out isn't really helpful. Whilst Linux isn't working 100%, the stock, untouched,
sd-image-aarch64
image boots, serial works, and USB ethernet makes this board workable enough that this is what I'm using for aarch64 development, preferred over the raspi 3. (The eMMC module makes a big difference in usability over even the faster SD cards.) From there, support should only get better, hopefully.Arm Trusted Firmware
Arm Trusted Firmware is a dependency (seemingly) needed by u-boot.
I have not tested (used) the QEMU build. It does build, though. This was added mainly because otherwise I couldn't test the default build instructions, as the Allwinner ATF comes from a fork.
Now, that derivation might frighten or sicken you. I bodged this together, inspired by the u-boot configuration. Tell me what I should have done instead and I will fix it. I'm not used to derivations and overriding, this looked like the easiest way to keep everything together while the builds are mostly identical.
u-boot
There's nothing fancy in there, except for one patch. That patch is needed only to make u-boot load the right device tree (dtb). This is because in u-boot, pine64-plus is good enough for all the pine64-plus, sopine and the PINE A64-LTS. Linux, in the other hand, has different DTBs for those platforms. Since u-boot will use the name of the DTB used to build the bootloader to load the DTB for the kernel, this is the simplest way to do it. This should be upstreamed (yes, by me) to u-boot, unless an u-boot expert here tells me there's a more elegant way.
Things done
build-use-sandbox
innix.conf
on non-NixOS)macOSnix-shell -p nox --run "nox-review wip"
Tested execution of all binary files (usually in./result/bin/
)Paging @dezgeg