From 99832196114c7e9451aa79d8cd0eb033cd833c20 Mon Sep 17 00:00:00 2001 From: Jiaxun Yang Date: Fri, 27 Dec 2024 13:23:39 +0000 Subject: [PATCH] lm32: Initial LatticeMicro32 support This target is in GCC/binutils for a while. It's baremetal only without upstream Linux support. Signed-off-by: Jiaxun Yang --- config/arch/lm32.in | 10 ++++++++++ config/kernel/linux.in | 2 +- samples/lm32-unknown-elf/crosstool.config | 6 ++++++ samples/lm32-unknown-elf/reported.by | 3 +++ scripts/build/arch/lm32.sh | 6 ++++++ 5 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 config/arch/lm32.in create mode 100644 samples/lm32-unknown-elf/crosstool.config create mode 100644 samples/lm32-unknown-elf/reported.by create mode 100644 scripts/build/arch/lm32.sh diff --git a/config/arch/lm32.in b/config/arch/lm32.in new file mode 100644 index 00000000..a2ae3b2d --- /dev/null +++ b/config/arch/lm32.in @@ -0,0 +1,10 @@ +# LatticeMico32 soft-core architecture + +## no-package +## select ARCH_SUPPORTS_32 +## select ARCH_DEFAULT_32 +## select ARCH_DEFAULT_BE +## depends on EXPERIMENTAL + +## help The LatticeMico32 soft-core architecture: +## help https://www.latticesemi.com/en/Products/DesignSoftwareAndIP/IntellectualProperty/IPCore/IPCores02/LatticeMico32.aspx diff --git a/config/kernel/linux.in b/config/kernel/linux.in index 0f85ff89..6e929c23 100644 --- a/config/kernel/linux.in +++ b/config/kernel/linux.in @@ -1,6 +1,6 @@ # Linux kernel options -## depends on !ARCH_AVR && !ARCH_MSP430 && !ARCH_MOXIE && !ARCH_PRU +## depends on !ARCH_AVR && !ARCH_LM32 && !ARCH_MSP430 && !ARCH_MOXIE && !ARCH_PRU ## select KERNEL_SUPPORTS_SHARED_LIBS ## help Build a toolchain targeting systems running Linux as a kernel. diff --git a/samples/lm32-unknown-elf/crosstool.config b/samples/lm32-unknown-elf/crosstool.config new file mode 100644 index 00000000..68915de2 --- /dev/null +++ b/samples/lm32-unknown-elf/crosstool.config @@ -0,0 +1,6 @@ +CT_CONFIG_VERSION="4" +CT_EXPERIMENTAL=y +CT_ARCH_LM32=y +CT_CC_LANG_CXX=y +CT_DEBUG_GDB=y +# CT_GDB_CROSS_PYTHON is not set diff --git a/samples/lm32-unknown-elf/reported.by b/samples/lm32-unknown-elf/reported.by new file mode 100644 index 00000000..500de2cd --- /dev/null +++ b/samples/lm32-unknown-elf/reported.by @@ -0,0 +1,3 @@ +reporter_name="Jiaxun Yang " +reporter_url="https://flygoat.com/" +reporter_comment="Example for building a toolchain for LM32 bare metal targets" diff --git a/scripts/build/arch/lm32.sh b/scripts/build/arch/lm32.sh new file mode 100644 index 00000000..77e7c2cb --- /dev/null +++ b/scripts/build/arch/lm32.sh @@ -0,0 +1,6 @@ +# Compute LM32-specific values + +CT_DoArchTupleValues() { + # Do nothing here. Default values are sane. + :; +}