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
target: add support for Loongson LoongArch64 (kernel 6.6) #14357
Conversation
Please refrain from sending meaningless comments and focus on development communication. |
6.6 is LTS. |
yes, it is. but right now 6.6 is still stable because 6.7 is still mainline. the longterm maintenance version of the 6.6 kernel has still not been released. |
e0ab2c5
to
87ea501
Compare
https://github.com/openwrt/openwrt/actions/runs/7448683628/job/20263661083?pr=14357
This is weird. Can hexdump be missing on the build system? |
Indeed, its not present, because its not current build host dependency defined and assured in
Containers used on CI are basically reusing buildbot's buildworker container used on https://buildbot.openwrt.org Anyways, that new |
I‘ll give this a try. |
84b2062
to
4a2dee5
Compare
At least all checks passed after introducing util-linux and disabling mac80211 drivers. |
@KFERMercer libffi is not a base package included in the openwrt repo. |
sorry, just mention for other people |
4a2dee5
to
d5c1be3
Compare
Kernel 6.6.14 is now available and it is the longterm version. |
OK. I'll update later |
@hackpascal Skipping Linux 6.1 and preparing the next release based on Linux 6.6 is worth the debate -- the number of backport patches on top of 6.1 is already nearly unbearable by now and using Linux 6.6 as a base will allow us to drop most of those obviously and rather make a release happen sooner than later. Maybe you should open another PR only covering the part introducing support for Linux 6.6? On a personal note, switching to Linux 6.6 has a sad side to me because it drops the support for ox820 SoC (2x ARM11MPCore, 2x SATA, 1x gigE, PCIe1 x1, USB 2.0 x2, parallel NAND to boot, SPARC LEON uC remoteproc 🚀 , even a weird 2D graphics unit) which I had worked on a lot in my free time many years ago. And switching to Linux 6.6 implies dropping the oxnas target in OpenWrt 😢 |
It's reasonable. I'll do this after Chinese New Year. |
tools/Makefile
Outdated
@@ -128,6 +129,7 @@ $(curdir)/quilt/compile := $(curdir)/autoconf/compile $(curdir)/findutils/compil | |||
$(curdir)/sdcc/compile := $(curdir)/bison/compile | |||
$(curdir)/squashfs3-lzma/compile := $(curdir)/lzma-old/compile | |||
$(curdir)/squashfs4/compile := $(curdir)/xz/compile $(curdir)/zlib/compile | |||
$(curdir)/util-linux/compile := $(curdir)/meson/compile $(curdir)/bison/compile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you are using the autotools build system the dependency on meson should be unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. I was trying meson first but it can't precisely select the minimum set of programs to build. That's why now autotools build system is used.
I'll remove this line.
@hackpascal what's the status in having a seperate branch for just the 6.6 bump related changes? |
0742c59
to
d66ebbe
Compare
Please rebase this PR. The musl libc, elfutils and GCC changes are already merged upstream and not needed here any more. |
@hauke Ah. finally. |
Unfortunately musl 1.2.5 doesn't work with kernel 6.6:
Kernel can't recognize /sbin/init as an executable program. So.. I still have to disable musl for loongarch64 for now. |
This is caused by incorrect musl symlink filename (it is created as Create a symlink there (I did a quick hack by creating it in EDIT: |
There are some more things worth mentioning:
|
That's why I disabled squashfs for now lol |
musl now fixed 😃 |
It's better to do this in another PR |
GCC has changed musl dynamic linker name from ld-musl-loongarch-lp64d.so.1 to ld-musl-loongarch64.so.1 recently [1]. Meanwhile musl 1.2.5 only supports the new name. So it's better to follow the new name. [1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=8bccee51f0deac64b79cd9ad75df599422f4c8ff Signed-off-by: Weijie Gao <hackpascal@gmail.com>
GCC has changed musl dynamic linker name from ld-musl-loongarch-lp64d.so.1 to ld-musl-loongarch64.so.1 recently [1]. This means there are two dynamic linker names will be used across different ersions of GCC. But musl 1.2.5 only supports the new name while the GCC we're currently using uses the old name. To maintain compatibility with all versions of GCC, the musl is then patched to generate two symbolic links to libc.so with both old and new names. [1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=8bccee51f0deac64b79cd9ad75df599422f4c8ff Signed-off-by: Weijie Gao <hackpascal@gmail.com>
Add target for Loongson LoongArch64-based boards. LoongArch is a new RISC ISA developed by Loongson. It's a bit like MIPS or RISC-V. LoongArch includes both 32-bit and 64-bit versions (LoongArch32/LoongArch64). Loongson 3A5000 and 3A6000 are the two existing CPUs of LoongArch64 and is used for PC products. It's BIOS supports ACPI and UEFI-only boot. These CPUs supports SMP and SMT. At present only LoongArch64 is supported by linux kernel. Toolchain requirement: binutils >= 2.40 gcc >= 13.1 For details, please check the following links: https://lwn.net/Articles/861951/ https://loongson.github.io/LoongArch-Documentation/README-EN.html Signed-off-by: Weijie Gao <hackpascal@gmail.com>
libtsan and liblsan are not supported by glibc on loongarch64 Signed-off-by: Weijie Gao <hackpascal@gmail.com>
Add TARGET_loongarch64 as dependency for kmod-mdio-devres, kmod-mdio-gpio and kmod-switch-rtl8366-smi Signed-off-by: Weijie Gao <hackpascal@gmail.com>
* Allow kmod-acpi-video to be built for loongarch64: The x86-specific CONFIG_ACPI_WMI will be split from default kmod-acpi-video as a board-specific addition. * Allow kmod-drm-amdgpu to be built for loongarch64: Also add loongarch64-specific configs and modules. Signed-off-by: Weijie Gao <hackpascal@gmail.com>
Add a new package for loongarch64 which only supports EFI. Signed-off-by: Weijie Gao <hackpascal@gmail.com>
Add "linux64-loongarch64-openwrt" into openssl configurations to enable building on loongarch64 machines. Signed-off-by: Weijie Gao <hackpascal@gmail.com>
Modify package depends to allow building for loongarch64. Also fix for building with musl. Signed-off-by: Weijie Gao <hackpascal@gmail.com>
Merged. Thanks! |
Add target for Loongson LoongArch64-based boards.
LoongArch is a new RISC ISA developed by Loongson. It's a bit like MIPS or RISC-V.
LoongArch includes both 32-bit and 64-bit versions (LoongArch32/LoongArch64).
Loongson 3A5000 and 3A6000 are the two existing CPUs of LoongArch64 and is used for PC products.
It's BIOS supports ACPI and UEFI-only boot. These CPUs supports SMP and SMT.
At present only LoongArch64 is supported by linux kernel.
Toolchain requirement:
binutils >= 2.40
gcc >= 13.1
glibc >= 2.36
musl >= 1.2.5
Installation:
Write openwrt-loongarch64-generic-ext4-combined-efi.img directly to a hard disk.
Note:
mac80211 type drivers are now available.
Both integrated graphics (7A2000) and discrete graphics (amdgpu only) works.
Serial port ttyS0 is also enabled for kernel console.
Tested on Loongson-3A6000-HV-7A2000-XA61200.
For details, please check the following links:
https://lwn.net/Articles/861951/
https://loongson.github.io/LoongArch-Documentation/README-EN.html
The picture of XA61200 motherboard is as follows:
https://github.com/loongson/Firmware/blob/main/Image/XA61200.jpg