Skip to content

Commit

Permalink
avr: add support for AVR 8-bit architecture
Browse files Browse the repository at this point in the history
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 <nunes.erico@gmail.com>
  • Loading branch information
enunes committed Jun 21, 2015
1 parent baceedd commit 230dc12
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
8 changes: 8 additions & 0 deletions 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
1 change: 1 addition & 0 deletions 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.
Expand Down
18 changes: 18 additions & 0 deletions config/target.in
Expand Up @@ -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
Expand Down Expand Up @@ -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!!!)"
Expand Down Expand Up @@ -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

Expand All @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions scripts/build/arch/avr.sh
@@ -0,0 +1,5 @@
# Compute AVR-specific values

CT_DoArchTupleValues() {
CT_TARGET_ARCH="${CT_ARCH}"
}

0 comments on commit 230dc12

Please sign in to comment.