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 

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
This commit is contained in:
Erico Nunes 2015-06-21 20:49:10 -03:00
parent baceedd239
commit 230dc12285
4 changed files with 32 additions and 0 deletions
config
scripts/build/arch

8
config/arch/avr.in Normal file
View File

@ -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

View File

@ -1,5 +1,6 @@
# Linux kernel options # Linux kernel options
## depends on ! ARCH_avr
## select KERNEL_SUPPORTS_SHARED_LIBS ## select KERNEL_SUPPORTS_SHARED_LIBS
## ##
## help Build a toolchain targeting systems running Linux as a kernel. ## help Build a toolchain targeting systems running Linux as a kernel.

View File

@ -8,6 +8,7 @@ config ARCH
# Pre-declare target optimisation variables # Pre-declare target optimisation variables
config ARCH_SUPPORTS_BOTH_MMU config ARCH_SUPPORTS_BOTH_MMU
config ARCH_SUPPORTS_BOTH_ENDIAN config ARCH_SUPPORTS_BOTH_ENDIAN
config ARCH_SUPPORTS_8
config ARCH_SUPPORTS_32 config ARCH_SUPPORTS_32
config ARCH_SUPPORTS_64 config ARCH_SUPPORTS_64
config ARCH_SUPPORTS_WITH_ARCH config ARCH_SUPPORTS_WITH_ARCH
@ -60,6 +61,10 @@ config ARCH_SUFFIX
comment "Generic target options" comment "Generic target options"
#-------------------------------------- #--------------------------------------
config ARCH_REQUIRES_MULTILIB
bool
select MULTILIB
config MULTILIB config MULTILIB
bool bool
prompt "Build a multilib toolchain (READ HELP!!!)" prompt "Build a multilib toolchain (READ HELP!!!)"
@ -133,12 +138,18 @@ config ARCH_ENDIAN
default "little" if ARCH_LE default "little" if ARCH_LE
#-------------------------------------- #--------------------------------------
config ARCH_SUPPORTS_8
bool
config ARCH_SUPPORTS_32 config ARCH_SUPPORTS_32
bool bool
config ARCH_SUPPORTS_64 config ARCH_SUPPORTS_64
bool bool
config ARCH_DEFAULT_8
bool
config ARCH_DEFAULT_32 config ARCH_DEFAULT_32
bool bool
@ -147,15 +158,22 @@ config ARCH_DEFAULT_64
config ARCH_BITNESS config ARCH_BITNESS
int int
default "8" if ARCH_8
default "32" if ARCH_32 default "32" if ARCH_32
default "64" if ARCH_64 default "64" if ARCH_64
choice choice
bool bool
prompt "Bitness:" prompt "Bitness:"
default ARCH_8 if ARCH_DEFAULT_8
default ARCH_32 if ARCH_DEFAULT_32 default ARCH_32 if ARCH_DEFAULT_32
default ARCH_64 if ARCH_DEFAULT_64 default ARCH_64 if ARCH_DEFAULT_64
config ARCH_8
bool
prompt "8-bit"
depends on ARCH_SUPPORTS_8
config ARCH_32 config ARCH_32
bool bool
prompt "32-bit" prompt "32-bit"

View File

@ -0,0 +1,5 @@
# Compute AVR-specific values
CT_DoArchTupleValues() {
CT_TARGET_ARCH="${CT_ARCH}"
}