Initial LoongArch support#109
Merged
Merged
Conversation
In order to making applying patches for LoongArch a little easier, update buildroot to the latest LTS release. As part of this upgrade, we: * Move to ulibc instead of glibc for the RISC-V toolchain, which results in a smaller toolchain download. * Move to a prebuilt toolchain for s390, which results in a faster overall build because the toolchain only has to be downloaded, rather than built. * Drop BR2_powerpc_power8, as it is now the default choice after [1] and [2]. [1]: buildroot/buildroot@c0b0288 [2]: buildroot/buildroot@fdb2369 Signed-off-by: Nathan Chancellor <nathan@kernel.org>
LoongArch support is only available as an in-review patch on the mailing list. Add scaffolding to make it easy to apply patches on top of the Buildroot tarball. To make it easy to add and remove patches while ensuring they get applied properly, keep the downloaded tarball instead of removing it after extraction, so that the source can be cleanly recreated each run. Signed-off-by: Nathan Chancellor <nathan@kernel.org>
LoongArch support for Buildroot is still in review. Apply the latest patch from the mailing list and base the configuration off of that. LoongArch was only supported in GCC 12.x and binutils 2.39, so those are explicitly selected for the toolchain. Signed-off-by: Nathan Chancellor <nathan@kernel.org>
xen0n
reviewed
Jun 28, 2023
xen0n
left a comment
Member
There was a problem hiding this comment.
Thanks for the PR and your continued testing!
FYI, next-20230628 now works with LLVM main branch (I tested llvm/llvm-project@193d3ac) + only https://reviews.llvm.org/D138135 applied (everything else is already upstream).
Closed
LoongArch requires EFI firmware to boot, which is available as a precompiled blob from Loongson's GitHub, so it is downloaded when running 'boot-qemu.py -a loongarch' for the first time. There is no update mechanism like for the rootfs images for a simple implementation. If there comes a time where the firmware has to be updated for the machine to boot properly, such a mechanism can be implemented then. Other than that, the rest of the support is pretty straightforward. The defaults for cores and memory are a little higher than other machines, as that is what other folks are testing. Closes: ClangBuiltLinux#108 Signed-off-by: Nathan Chancellor <nathan@kernel.org>
This is included so that the rootfs image generated by 'buildroot/rebuild.py' can be tested before it is included in a GitHub release. Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Member
Author
Thank you for all the work you have done driving this on both the Linux and LLVM side :)
Yes, confirmed, good to see everything is moving along nicely! |
msfjarvis
approved these changes
Jun 30, 2023
nathanchance
added a commit
to nathanchance/boot-utils
that referenced
this pull request
Jul 10, 2023
Ensure 'images/loongarch' exists before trying to download the firmware. I missed this because 'images/loongarch' was erroneously a part of the history when LoongArch support was merged in ClangBuiltLinux#109. Signed-off-by: Nathan Chancellor <nathan@kernel.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds support for booting LoongArch kernels.
The first patch updates the version of Buildroot that we use and updates the configurations accordingly.
The second third patches add the Buildroot scaffolding needed to support building a LoongArch rootfs. LoongArch support for Buildroot is available as a patch on the Buildroot mailing list, so that is applied to the source before building.
The fourth patch adds support for LoongArch to
boot-qemu.py. The EFI firmware is downloaded from Loongson's GitHub when first booting a LoongArch kernel.The last patch allows this pull request to be tested locally. It will be removed before this pull request is merged.
Source/toolchain information
LLVM:
Linux:
Testing
Additionally, I have verified that the new Buildroot revision successfully builds with all the existing configurations that we have and that there are no boot regressions.