diff options
Diffstat (limited to 'arch/avr32')
-rw-r--r-- | arch/avr32/config.mk | 6 | ||||
-rw-r--r-- | arch/avr32/cpu/at32ap700x/clk.c | 2 | ||||
-rw-r--r-- | arch/avr32/cpu/at32ap700x/portmux.c | 2 | ||||
-rw-r--r-- | arch/avr32/cpu/at32ap700x/sm.h | 4 | ||||
-rw-r--r-- | arch/avr32/cpu/cpu.c | 2 | ||||
-rw-r--r-- | arch/avr32/cpu/hsdramc.c | 2 | ||||
-rw-r--r-- | arch/avr32/cpu/hsdramc1.h | 4 | ||||
-rw-r--r-- | arch/avr32/cpu/hsmc3.h | 4 | ||||
-rw-r--r-- | arch/avr32/cpu/interrupts.c | 4 | ||||
-rw-r--r-- | arch/avr32/cpu/portmux-gpio.c | 2 | ||||
-rw-r--r-- | arch/avr32/cpu/portmux-pio.c | 2 | ||||
-rw-r--r-- | arch/avr32/cpu/u-boot.lds | 72 | ||||
-rw-r--r-- | arch/avr32/include/asm/arch-at32ap700x/gpio.h | 12 | ||||
-rw-r--r-- | arch/avr32/include/asm/arch-at32ap700x/hardware.h (renamed from arch/avr32/include/asm/arch-at32ap700x/memory-map.h) | 76 | ||||
-rw-r--r-- | arch/avr32/include/asm/arch-at32ap700x/portmux.h | 10 | ||||
-rw-r--r-- | arch/avr32/include/asm/hmatrix-common.h | 2 | ||||
-rw-r--r-- | arch/avr32/include/asm/setup.h | 8 | ||||
-rw-r--r-- | arch/avr32/lib/bootm.c | 11 |
18 files changed, 160 insertions, 65 deletions
diff --git a/arch/avr32/config.mk b/arch/avr32/config.mk index 9488c49132..d8e7ebb0be 100644 --- a/arch/avr32/config.mk +++ b/arch/avr32/config.mk @@ -26,4 +26,8 @@ CROSS_COMPILE ?= avr32-linux- CONFIG_STANDALONE_LOAD_ADDR ?= 0x00000000 PLATFORM_RELFLAGS += -ffixed-r5 -fPIC -mno-init-got -mrelax -PLATFORM_LDFLAGS += --relax +PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections + +LDFLAGS_u-boot = --gc-sections --relax + +LDSCRIPT = $(SRCTREE)/$(CPUDIR)/u-boot.lds diff --git a/arch/avr32/cpu/at32ap700x/clk.c b/arch/avr32/cpu/at32ap700x/clk.c index 742bc6b5a2..b63b9df143 100644 --- a/arch/avr32/cpu/at32ap700x/clk.c +++ b/arch/avr32/cpu/at32ap700x/clk.c @@ -24,7 +24,7 @@ #include <asm/io.h> #include <asm/arch/clk.h> -#include <asm/arch/memory-map.h> +#include <asm/arch/hardware.h> #include <asm/arch/portmux.h> #include "sm.h" diff --git a/arch/avr32/cpu/at32ap700x/portmux.c b/arch/avr32/cpu/at32ap700x/portmux.c index b1f2c6f1ff..e3e38a2a75 100644 --- a/arch/avr32/cpu/at32ap700x/portmux.c +++ b/arch/avr32/cpu/at32ap700x/portmux.c @@ -24,7 +24,7 @@ #include <asm/io.h> #include <asm/arch/chip-features.h> -#include <asm/arch/memory-map.h> +#include <asm/arch/hardware.h> #include <asm/arch/portmux.h> /* diff --git a/arch/avr32/cpu/at32ap700x/sm.h b/arch/avr32/cpu/at32ap700x/sm.h index b6e4409b22..9a3804efe4 100644 --- a/arch/avr32/cpu/at32ap700x/sm.h +++ b/arch/avr32/cpu/at32ap700x/sm.h @@ -197,8 +197,8 @@ /* Register access macros */ #define sm_readl(reg) \ - readl((void *)SM_BASE + SM_##reg) + readl((void *)ATMEL_BASE_SM + SM_##reg) #define sm_writel(reg,value) \ - writel((value), (void *)SM_BASE + SM_##reg) + writel((value), (void *)ATMEL_BASE_SM + SM_##reg) #endif /* __CPU_AT32AP_SM_H__ */ diff --git a/arch/avr32/cpu/cpu.c b/arch/avr32/cpu/cpu.c index e4489bb2e2..790783767f 100644 --- a/arch/avr32/cpu/cpu.c +++ b/arch/avr32/cpu/cpu.c @@ -27,7 +27,7 @@ #include <asm/sysreg.h> #include <asm/arch/clk.h> -#include <asm/arch/memory-map.h> +#include <asm/arch/hardware.h> #include "hsmc3.h" diff --git a/arch/avr32/cpu/hsdramc.c b/arch/avr32/cpu/hsdramc.c index b6eae667c2..1485494f49 100644 --- a/arch/avr32/cpu/hsdramc.c +++ b/arch/avr32/cpu/hsdramc.c @@ -25,7 +25,7 @@ #include <asm/sdram.h> #include <asm/arch/clk.h> -#include <asm/arch/memory-map.h> +#include <asm/arch/hardware.h> #include "hsdramc1.h" diff --git a/arch/avr32/cpu/hsdramc1.h b/arch/avr32/cpu/hsdramc1.h index 305d2cb5d3..e18e074a7a 100644 --- a/arch/avr32/cpu/hsdramc1.h +++ b/arch/avr32/cpu/hsdramc1.h @@ -136,8 +136,8 @@ /* Register access macros */ #define hsdramc1_readl(reg) \ - readl((void *)HSDRAMC_BASE + HSDRAMC1_##reg) + readl((void *)ATMEL_BASE_HSDRAMC + HSDRAMC1_##reg) #define hsdramc1_writel(reg,value) \ - writel((value), (void *)HSDRAMC_BASE + HSDRAMC1_##reg) + writel((value), (void *)ATMEL_BASE_HSDRAMC + HSDRAMC1_##reg) #endif /* __ASM_AVR32_HSDRAMC1_H__ */ diff --git a/arch/avr32/cpu/hsmc3.h b/arch/avr32/cpu/hsmc3.h index ca533b922e..ac472952a2 100644 --- a/arch/avr32/cpu/hsmc3.h +++ b/arch/avr32/cpu/hsmc3.h @@ -119,8 +119,8 @@ /* Register access macros */ #define hsmc3_readl(reg) \ - readl((void *)HSMC_BASE + HSMC3_##reg) + readl((void *)ATMEL_BASE_HSMC + HSMC3_##reg) #define hsmc3_writel(reg,value) \ - writel((value), (void *)HSMC_BASE + HSMC3_##reg) + writel((value), (void *)ATMEL_BASE_HSMC + HSMC3_##reg) #endif /* __CPU_AT32AP_HSMC3_H__ */ diff --git a/arch/avr32/cpu/interrupts.c b/arch/avr32/cpu/interrupts.c index c6d8d16e39..c6ea435c1d 100644 --- a/arch/avr32/cpu/interrupts.c +++ b/arch/avr32/cpu/interrupts.c @@ -27,7 +27,7 @@ #include <asm/processor.h> #include <asm/sysreg.h> -#include <asm/arch/memory-map.h> +#include <asm/arch/hardware.h> #define HANDLER_MASK 0x00ffffff #define INTLEV_SHIFT 30 @@ -125,7 +125,7 @@ static int set_interrupt_handler(unsigned int nr, void (*handler)(void), intpr = (handler_addr & HANDLER_MASK); intpr |= (priority & INTLEV_MASK) << INTLEV_SHIFT; - writel(intpr, (void *)INTC_BASE + 4 * nr); + writel(intpr, (void *)ATMEL_BASE_INTC + 4 * nr); return 0; } diff --git a/arch/avr32/cpu/portmux-gpio.c b/arch/avr32/cpu/portmux-gpio.c index 9acd040d1b..7b64c89a98 100644 --- a/arch/avr32/cpu/portmux-gpio.c +++ b/arch/avr32/cpu/portmux-gpio.c @@ -22,7 +22,7 @@ #include <common.h> #include <asm/io.h> -#include <asm/arch/memory-map.h> +#include <asm/arch/hardware.h> #include <asm/arch/gpio.h> void portmux_select_peripheral(void *port, unsigned long pin_mask, diff --git a/arch/avr32/cpu/portmux-pio.c b/arch/avr32/cpu/portmux-pio.c index a29f94e3ba..cb5e96205a 100644 --- a/arch/avr32/cpu/portmux-pio.c +++ b/arch/avr32/cpu/portmux-pio.c @@ -22,7 +22,7 @@ #include <common.h> #include <asm/io.h> -#include <asm/arch/memory-map.h> +#include <asm/arch/hardware.h> #include <asm/arch/gpio.h> void portmux_select_peripheral(void *port, unsigned long pin_mask, diff --git a/arch/avr32/cpu/u-boot.lds b/arch/avr32/cpu/u-boot.lds new file mode 100644 index 0000000000..0e532f234e --- /dev/null +++ b/arch/avr32/cpu/u-boot.lds @@ -0,0 +1,72 @@ +/* -*- Fundamental -*- + * + * Copyright (C) 2005-2006 Atmel Corporation + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ +OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32") +OUTPUT_ARCH(avr32) +ENTRY(_start) + +SECTIONS +{ + . = 0; + _text = .; + .text : { + *(.exception.text) + *(.text) + *(.text.*) + } + _etext = .; + + .rodata : { + *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) + } + + . = ALIGN(8); + _data = .; + .data : { + *(.data) + *(.data.*) + } + + . = ALIGN(4); + __u_boot_cmd_start = .; + .u_boot_cmd : { + KEEP(*(.u_boot_cmd)) + } + __u_boot_cmd_end = .; + + . = ALIGN(4); + _got = .; + .got : { + *(.got) + } + _egot = .; + + . = ALIGN(8); + _edata = .; + + .bss (NOLOAD) : { + *(.bss) + *(.bss.*) + } + . = ALIGN(8); + __bss_end__ = .; +} diff --git a/arch/avr32/include/asm/arch-at32ap700x/gpio.h b/arch/avr32/include/asm/arch-at32ap700x/gpio.h index 303e35313a..4322eac1c7 100644 --- a/arch/avr32/include/asm/arch-at32ap700x/gpio.h +++ b/arch/avr32/include/asm/arch-at32ap700x/gpio.h @@ -23,7 +23,7 @@ #define __ASM_AVR32_ARCH_GPIO_H__ #include <asm/arch/chip-features.h> -#include <asm/arch/memory-map.h> +#include <asm/arch/hardware.h> #define NR_GPIO_CONTROLLERS 5 @@ -45,15 +45,15 @@ static inline void *pio_pin_to_port(unsigned int pin) { switch (pin >> 5) { case 0: - return (void *)PIOA_BASE; + return (void *)ATMEL_BASE_PIOA; case 1: - return (void *)PIOB_BASE; + return (void *)ATMEL_BASE_PIOB; case 2: - return (void *)PIOC_BASE; + return (void *)ATMEL_BASE_PIOC; case 3: - return (void *)PIOD_BASE; + return (void *)ATMEL_BASE_PIOD; case 4: - return (void *)PIOE_BASE; + return (void *)ATMEL_BASE_PIOE; default: return NULL; } diff --git a/arch/avr32/include/asm/arch-at32ap700x/memory-map.h b/arch/avr32/include/asm/arch-at32ap700x/hardware.h index 6592c039fa..9172eef60f 100644 --- a/arch/avr32/include/asm/arch-at32ap700x/memory-map.h +++ b/arch/avr32/include/asm/arch-at32ap700x/hardware.h @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */ -#ifndef __AT32AP7000_MEMORY_MAP_H__ -#define __AT32AP7000_MEMORY_MAP_H__ +#ifndef __AT32AP7000_HARDWARE_H__ +#define __AT32AP7000_HARDWARE_H__ /* Internal and external memories */ #define EBI_SRAM_CS0_BASE 0x00000000 @@ -43,44 +43,44 @@ #define INTERNAL_SRAM_SIZE 0x00008000 /* Devices on the High Speed Bus (HSB) */ -#define LCDC_BASE 0xFF000000 -#define DMAC_BASE 0xFF200000 -#define USB_FIFO 0xFF300000 +#define LCDC_BASE 0xFF000000 +#define DMAC_BASE 0xFF200000 +#define USB_FIFO 0xFF300000 /* Devices on Peripheral Bus A (PBA) */ -#define SPI0_BASE 0xFFE00000 -#define SPI1_BASE 0xFFE00400 -#define TWI_BASE 0xFFE00800 -#define USART0_BASE 0xFFE00C00 -#define USART1_BASE 0xFFE01000 -#define USART2_BASE 0xFFE01400 -#define USART3_BASE 0xFFE01800 -#define SSC0_BASE 0xFFE01C00 -#define SSC1_BASE 0xFFE02000 -#define SSC2_BASE 0xFFE02400 -#define PIOA_BASE 0xFFE02800 -#define PIOB_BASE 0xFFE02C00 -#define PIOC_BASE 0xFFE03000 -#define PIOD_BASE 0xFFE03400 -#define PIOE_BASE 0xFFE03800 -#define PSIF_BASE 0xFFE03C00 +#define ATMEL_BASE_SPI0 0xFFE00000 +#define ATMEL_BASE_SPI1 0xFFE00400 +#define ATMEL_BASE_TWI0 0xFFE00800 +#define ATMEL_BASE_USART0 0xFFE00C00 +#define ATMEL_BASE_USART1 0xFFE01000 +#define ATMEL_BASE_USART2 0xFFE01400 +#define ATMEL_BASE_USART3 0xFFE01800 +#define ATMEL_BASE_SSC0 0xFFE01C00 +#define ATMEL_BASE_SSC1 0xFFE02000 +#define ATMEL_BASE_SSC2 0xFFE02400 +#define ATMEL_BASE_PIOA 0xFFE02800 +#define ATMEL_BASE_PIOB 0xFFE02C00 +#define ATMEL_BASE_PIOC 0xFFE03000 +#define ATMEL_BASE_PIOD 0xFFE03400 +#define ATMEL_BASE_PIOE 0xFFE03800 +#define ATMEL_BASE_PSIF 0xFFE03C00 /* Devices on Peripheral Bus B (PBB) */ -#define SM_BASE 0xFFF00000 -#define INTC_BASE 0xFFF00400 -#define HMATRIX_BASE 0xFFF00800 -#define TIMER0_BASE 0xFFF00C00 -#define TIMER1_BASE 0xFFF01000 -#define PWM_BASE 0xFFF01400 -#define MACB0_BASE 0xFFF01800 -#define MACB1_BASE 0xFFF01C00 -#define DAC_BASE 0xFFF02000 -#define MMCI_BASE 0xFFF02400 -#define AUDIOC_BASE 0xFFF02800 -#define HISI_BASE 0xFFF02C00 -#define USB_BASE 0xFFF03000 -#define HSMC_BASE 0xFFF03400 -#define HSDRAMC_BASE 0xFFF03800 -#define ECC_BASE 0xFFF03C00 +#define ATMEL_BASE_SM 0xFFF00000 +#define ATMEL_BASE_INTC 0xFFF00400 +#define ATMEL_BASE_HMATRIX 0xFFF00800 +#define ATMEL_BASE_TIMER0 0xFFF00C00 +#define ATMEL_BASE_TIMER1 0xFFF01000 +#define ATMEL_BASE_PWM 0xFFF01400 +#define ATMEL_BASE_MACB0 0xFFF01800 +#define ATMEL_BASE_MACB1 0xFFF01C00 +#define ATMEL_BASE_DAC 0xFFF02000 +#define ATMEL_BASE_MMCI 0xFFF02400 +#define ATMEL_BASE_AUDIOC 0xFFF02800 +#define ATMEL_BASE_HISI 0xFFF02C00 +#define ATMEL_BASE_USB 0xFFF03000 +#define ATMEL_BASE_HSMC 0xFFF03400 +#define ATMEL_BASE_HSDRAMC 0xFFF03800 +#define ATMEL_BASE_ECC 0xFFF03C00 -#endif /* __AT32AP7000_MEMORY_MAP_H__ */ +#endif /* __AT32AP7000_HARDWARE_H__ */ diff --git a/arch/avr32/include/asm/arch-at32ap700x/portmux.h b/arch/avr32/include/asm/arch-at32ap700x/portmux.h index 1ba52e5ddb..859c121aa0 100644 --- a/arch/avr32/include/asm/arch-at32ap700x/portmux.h +++ b/arch/avr32/include/asm/arch-at32ap700x/portmux.h @@ -24,11 +24,11 @@ #include <asm/arch/gpio.h> -#define PORTMUX_PORT_A ((void *)PIOA_BASE) -#define PORTMUX_PORT_B ((void *)PIOB_BASE) -#define PORTMUX_PORT_C ((void *)PIOC_BASE) -#define PORTMUX_PORT_D ((void *)PIOD_BASE) -#define PORTMUX_PORT_E ((void *)PIOE_BASE) +#define PORTMUX_PORT_A ((void *)ATMEL_BASE_PIOA) +#define PORTMUX_PORT_B ((void *)ATMEL_BASE_PIOB) +#define PORTMUX_PORT_C ((void *)ATMEL_BASE_PIOC) +#define PORTMUX_PORT_D ((void *)ATMEL_BASE_PIOD) +#define PORTMUX_PORT_E ((void *)ATMEL_BASE_PIOE) void portmux_enable_ebi(unsigned int bus_width, unsigned int addr_width, unsigned long flags, unsigned long drive_strength); diff --git a/arch/avr32/include/asm/hmatrix-common.h b/arch/avr32/include/asm/hmatrix-common.h index 4b7e6105dd..9a86fe4baa 100644 --- a/arch/avr32/include/asm/hmatrix-common.h +++ b/arch/avr32/include/asm/hmatrix-common.h @@ -117,7 +117,7 @@ struct hmatrix_regs { /* Register access macros */ #define __hmatrix_reg(reg) \ - (((volatile struct hmatrix_regs *)HMATRIX_BASE)->reg) + (((volatile struct hmatrix_regs *)ATMEL_BASE_HMATRIX)->reg) #define hmatrix_read(reg) \ (__hmatrix_reg(reg)) #define hmatrix_write(reg, value) \ diff --git a/arch/avr32/include/asm/setup.h b/arch/avr32/include/asm/setup.h index e6ef8d6b50..7f5d883442 100644 --- a/arch/avr32/include/asm/setup.h +++ b/arch/avr32/include/asm/setup.h @@ -107,6 +107,13 @@ struct tag_ethernet { #define AETH_INVALID_PHY 0xff +/* board information information */ +#define ATAG_BOARDINFO 0x54410008 + +struct tag_boardinfo { + u32 board_number; +}; + struct tag { struct tag_header hdr; union { @@ -115,6 +122,7 @@ struct tag { struct tag_cmdline cmdline; struct tag_clock clock; struct tag_ethernet ethernet; + struct tag_boardinfo boardinfo; } u; }; diff --git a/arch/avr32/lib/bootm.c b/arch/avr32/lib/bootm.c index 8a47cfeb4a..c9a55ffb2c 100644 --- a/arch/avr32/lib/bootm.c +++ b/arch/avr32/lib/bootm.c @@ -165,6 +165,16 @@ static struct tag *setup_ethernet_tags(struct tag *params) return params; } +static struct tag *setup_boardinfo_tag(struct tag *params) +{ + params->hdr.tag = ATAG_BOARDINFO; + params->hdr.size = tag_size(tag_boardinfo); + + params->u.boardinfo.board_number = gd->bd->bi_board_number; + + return tag_next(params); +} + static void setup_end_tag(struct tag *params) { params->hdr.tag = ATAG_NONE; @@ -195,6 +205,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima params = setup_commandline_tag(params, commandline); params = setup_clock_tags(params); params = setup_ethernet_tags(params); + params = setup_boardinfo_tag(params); setup_end_tag(params); printf("\nStarting kernel at %p (params at %p)...\n\n", |