@@ -251,6 +251,17 @@ config BR2_xtensa
http://en.wikipedia.org/wiki/Xtensa
http://www.tensilica.com/
+config BR2_loongarch64
+ bool "LOONGARCH64 (little endian)"
+ select BR2_ARCH_IS_64
+ select BR2_USE_MMU
+ help
+ MIPS is a RISC microprocessor from MIPS Technologies. Little
+ endian.
+ https://www.loongson.cn/
+ #http://en.wikipedia.org/wiki/MIPS_Technologies
+
+
endchoice
# For some architectures or specific cores, our internal toolchain
@@ -414,6 +425,11 @@ if BR2_xtensa
source "arch/Config.in.xtensa"
endif
+if BR2_loongarch64
+source "arch/Config.in.loongarch"
+endif
+
+
# Set up target binary format
choice
prompt "Target Binary Format"
new file mode 100644
@@ -0,0 +1,52 @@
+# mips default CPU ISAs
+config BR2_LOONGARCH_CPU_LOONGARCH64
+ bool
+ select BR2_LOONGARCH_NAN_LEGACY
+
+choice
+ prompt "Target Architecture Variant"
+ default BR2_loongarch_64 if BR2_loongarch64
+ depends on BR2_loongarch64
+ help
+ Specific CPU variant to use
+
+config BR2_loongarch_64
+ bool "Generic LOONGARCH64"
+ depends on BR2_ARCH_IS_64
+ select BR2_LOONGARCH_CPU_LOONGARCH64
+endchoice
+
+config BR2_LOONGARCH_NAN_LEGACY
+ bool
+
+#config BR2_GCC_TARGET_NAN
+# default "legacy" if BR2_LOONGARCH_NAN_LEGACY
+
+config BR2_ARCH
+ default "loongarch64" if BR2_loongarch64
+
+config BR2_NORMALIZED_ARCH
+ default "loongarch"
+
+config BR2_ENDIAN
+ default "LITTLE" if BR2_loongarch64
+
+config BR2_GCC_TARGET_ARCH
+ default "loongarch64" if BR2_loongarch_64
+
+config BR2_READELF_ARCH_NAME
+ default "LoongArch"
+
+config BR2_LOONGARCH_SOFT_FLOAT
+ bool "Use soft-float"
+ #default y
+ select BR2_SOFT_FLOAT
+ help
+ If your target CPU does not have a Floating Point Unit (FPU)
+ or a kernel FPU emulator, but you still wish to support
+ floating point functions, then everything will need to be
+ compiled with soft floating point support (-msoft-float).
+
+
+# vim: ft=kconfig
+# -*- mode:kconfig; -*-
@@ -21,6 +21,7 @@ config BR2_PACKAGE_GLIBC_ARCH_SUPPORTS
default y if BR2_microblaze
default y if BR2_nios2
default y if BR2_arc && BR2_ARC_ATOMIC_EXT
+ default y if BR2_loongarch64
depends on !BR2_powerpc_SPE
depends on BR2_RISCV_ISA_RVA || !BR2_riscv
depends on BR2_USE_MMU
@@ -164,7 +164,7 @@ case $1 in
basic_os=$field2
;;
# Manufacturers
- dec* | mips* | sequent* | encore* | pc533* | sgi* |
sony* \
+ dec* | mips* | loongarch* | sequent* | encore* |
pc533* | sgi* | sony* \
| att* | 7300* | 3300* | delta* | motorola* |
sun[234]* \
| unicom* | ibm* | next | hp | isi* | apollo |
altos* \
| convergent* | ncr* | news | 32* | 3600* | 3100* \
@@ -632,6 +632,11 @@ case $1 in
basic_machine=ymp-cray
basic_os=unicos
;;
+ loongarch)
+ basic_machine=loongarch-loongson
+ basic_os=
+ ;;
+
*)
basic_machine=$1
basic_os=
@@ -1211,6 +1216,7 @@ case $cpu-$vendor in
| mipsisa64sr71k | mipsisa64sr71kel \
| mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \
+ | loongarch | loongarch64 \
| mmix \
| mn10200 | mn10300 \
| moxie \
@@ -1253,7 +1259,8 @@ case $cpu-$vendor in
| x86 | x86_64 | xc16x | xgate | xps100 \
| xstormy16 | xtensa* \
| ymp \
- | z8k | z80)
+ | z8k | z80 \
+ | loongarch | loongarch64)
;;
*)
@@ -24,7 +24,7 @@ config BR2_TOOLCHAIN_USES_UCLIBC
# architectures
select BR2_TOOLCHAIN_HAS_UCONTEXT if BR2_ARM_CPU_HAS_ARM ||
BR2_i386 \
|| BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el \
- || BR2_sparc || BR2_x86_64
+ || BR2_sparc || BR2_x86_64 || BR2_loongarch64
select BR2_TOOLCHAIN_SUPPORTS_PIE if !BR2_m68k && !BR2_microblaze
&& !BR2_STATIC_LIBS