From 230dc12285842a51e0a2a95137ae4eae675b97d3 Mon Sep 17 00:00:00 2001 From: Erico Nunes Date: Sun, 21 Jun 2015 20:49:10 -0300 Subject: [PATCH] avr: add support for AVR 8-bit architecture This commit adds support for the Atmel AVR 8-bit RISC architecture. This is the first 8-bit architecture to be added to crosstool-ng so the configuration options for 8-bit architectures are added here as well. gcc has had support for AVR for quite a while, at least since the 4.3 series for the currently popular ATmega microcontroler series. The AVR architecture only supports bare-metal toolchains. gcc for the AVR 8-bit architecture, usually referred to as avr-gcc, is commonly used in conjunction with the avr-libc library which provides additional resources for the Atmel AVR 8-bit microcontrollers. avr-gcc can also be found as a supported package in some recent Linux distributions. This commit also closes #66 Signed-off-by: Erico Nunes --- config/arch/avr.in | 8 ++++++++ config/kernel/linux.in | 1 + config/target.in | 18 ++++++++++++++++++ scripts/build/arch/avr.sh | 5 +++++ 4 files changed, 32 insertions(+) create mode 100644 config/arch/avr.in create mode 100644 scripts/build/arch/avr.sh diff --git a/config/arch/avr.in b/config/arch/avr.in new file mode 100644 index 00000000..cf8e9af7 --- /dev/null +++ b/config/arch/avr.in @@ -0,0 +1,8 @@ +# AVR specific config options + +## select ARCH_SUPPORTS_8 +## select ARCH_DEFAULT_8 +## select ARCH_REQUIRES_MULTILIB +## +## help The 8-bit AVR architecture, as defined by: +## help http://www.atmel.com/products/microcontrollers/avr diff --git a/config/kernel/linux.in b/config/kernel/linux.in index ddefe228..90afabf2 100644 --- a/config/kernel/linux.in +++ b/config/kernel/linux.in @@ -1,5 +1,6 @@ # Linux kernel options +## depends on ! ARCH_avr ## select KERNEL_SUPPORTS_SHARED_LIBS ## ## help Build a toolchain targeting systems running Linux as a kernel. diff --git a/config/target.in b/config/target.in index fb5bbc06..31d2dc1b 100644 --- a/config/target.in +++ b/config/target.in @@ -8,6 +8,7 @@ config ARCH # Pre-declare target optimisation variables config ARCH_SUPPORTS_BOTH_MMU config ARCH_SUPPORTS_BOTH_ENDIAN +config ARCH_SUPPORTS_8 config ARCH_SUPPORTS_32 config ARCH_SUPPORTS_64 config ARCH_SUPPORTS_WITH_ARCH @@ -60,6 +61,10 @@ config ARCH_SUFFIX comment "Generic target options" #-------------------------------------- +config ARCH_REQUIRES_MULTILIB + bool + select MULTILIB + config MULTILIB bool prompt "Build a multilib toolchain (READ HELP!!!)" @@ -133,12 +138,18 @@ config ARCH_ENDIAN default "little" if ARCH_LE #-------------------------------------- +config ARCH_SUPPORTS_8 + bool + config ARCH_SUPPORTS_32 bool config ARCH_SUPPORTS_64 bool +config ARCH_DEFAULT_8 + bool + config ARCH_DEFAULT_32 bool @@ -147,15 +158,22 @@ config ARCH_DEFAULT_64 config ARCH_BITNESS int + default "8" if ARCH_8 default "32" if ARCH_32 default "64" if ARCH_64 choice bool prompt "Bitness:" + default ARCH_8 if ARCH_DEFAULT_8 default ARCH_32 if ARCH_DEFAULT_32 default ARCH_64 if ARCH_DEFAULT_64 +config ARCH_8 + bool + prompt "8-bit" + depends on ARCH_SUPPORTS_8 + config ARCH_32 bool prompt "32-bit" diff --git a/scripts/build/arch/avr.sh b/scripts/build/arch/avr.sh new file mode 100644 index 00000000..501b020b --- /dev/null +++ b/scripts/build/arch/avr.sh @@ -0,0 +1,5 @@ +# Compute AVR-specific values + +CT_DoArchTupleValues() { + CT_TARGET_ARCH="${CT_ARCH}" +}