at91: introduce commom AT91_BASE_SYS
PATCH 1/8 at91: introduce commom AT91_BASE_SYS
On all at91 except rm9200 and x40 have the System Controller starts at address 0xffffc000 and has a size of 16KiB.
On rm9200 it's start at 0xfffe4000 of 111KiB with non reserved data starting at 0xfffff000
This patch removes the individual definitions of AT91_BASE_SYS and replaces them with a common version at base 0xfffffc000 and size 16KiB and map the same memory space
--- arch/arm/mach-at91/Makefile | 2 +- arch/arm/mach-at91/at91cap9.c | 21 ++++---- arch/arm/mach-at91/at91rm9200.c | 15 +++--- arch/arm/mach-at91/at91sam9260.c | 22 +++------ arch/arm/mach-at91/at91sam9261.c | 22 +++------ arch/arm/mach-at91/at91sam9263.c | 20 ++++---- arch/arm/mach-at91/at91sam9g45.c | 20 ++++---- arch/arm/mach-at91/at91sam9rl.c | 22 +++------ arch/arm/mach-at91/board-1arm.c | 4 +- arch/arm/mach-at91/board-afeb-9260v1.c | 4 +- arch/arm/mach-at91/board-cam60.c | 4 +- arch/arm/mach-at91/board-cap9adk.c | 4 +- arch/arm/mach-at91/board-carmeva.c | 4 +- arch/arm/mach-at91/board-cpu9krea.c | 4 +- arch/arm/mach-at91/board-cpuat91.c | 4 +- arch/arm/mach-at91/board-csb337.c | 4 +- arch/arm/mach-at91/board-csb637.c | 4 +- arch/arm/mach-at91/board-eb9200.c | 4 +- arch/arm/mach-at91/board-ecbat91.c | 4 +- arch/arm/mach-at91/board-eco920.c | 4 +- arch/arm/mach-at91/board-flexibity.c | 4 +- arch/arm/mach-at91/board-foxg20.c | 4 +- arch/arm/mach-at91/board-gsia18s.c | 2 +- arch/arm/mach-at91/board-kafa.c | 4 +- arch/arm/mach-at91/board-kb9202.c | 4 +- arch/arm/mach-at91/board-neocore926.c | 4 +- arch/arm/mach-at91/board-pcontrol-g20.c | 2 +- arch/arm/mach-at91/board-picotux200.c | 4 +- arch/arm/mach-at91/board-qil-a9260.c | 4 +- arch/arm/mach-at91/board-rm9200dk.c | 4 +- arch/arm/mach-at91/board-rm9200ek.c | 4 +- arch/arm/mach-at91/board-sam9-l9260.c | 4 +- arch/arm/mach-at91/board-sam9260ek.c | 4 +- arch/arm/mach-at91/board-sam9261ek.c | 4 +- arch/arm/mach-at91/board-sam9263ek.c | 4 +- arch/arm/mach-at91/board-sam9g20ek.c | 6 +- arch/arm/mach-at91/board-sam9m10g45ek.c | 4 +- arch/arm/mach-at91/board-sam9rlek.c | 4 +- arch/arm/mach-at91/board-snapper9260.c | 4 +- arch/arm/mach-at91/board-stamp9g20.c | 6 +- arch/arm/mach-at91/board-usb-a9260.c | 4 +- arch/arm/mach-at91/board-usb-a9263.c | 4 +- arch/arm/mach-at91/board-yl-9200.c | 4 +- arch/arm/mach-at91/generic.h | 17 +------ arch/arm/mach-at91/include/mach/at91cap9.h | 1 - arch/arm/mach-at91/include/mach/at91rm9200.h | 1 - arch/arm/mach-at91/include/mach/at91sam9260.h | 1 - arch/arm/mach-at91/include/mach/at91sam9261.h | 1 - arch/arm/mach-at91/include/mach/at91sam9263.h | 1 - arch/arm/mach-at91/include/mach/at91sam9g45.h | 1 - arch/arm/mach-at91/include/mach/at91sam9rl.h | 1 - arch/arm/mach-at91/include/mach/hardware.h | 14 ++++++ arch/arm/mach-at91/setup.c | 63 +++++++++++++++++++++++++ arch/arm/mach-at91/soc.h | 20 ++++++++ 54 files changed, 232 insertions(+), 173 deletions(-) create mode 100644 arch/arm/mach-at91/setup.c create mode 100644 arch/arm/mach-at91/soc.h
arch/arm/mach-at91/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -obj-y := irq.o gpio.o +obj-y := irq.o gpio.o setup.o obj-m := obj-n := obj- :=
arch/arm/mach-at91/at91cap9.c +10 -11
@@ -25,16 +25,12 @@#include <mach/at91_rstc.h> #include <mach/at91_shdwc.h> +#include "soc.h" #include "generic.h" #include "clock.h" -static struct map_desc at91cap9_io_desc[]__initdata = { +static struct map_desc at91cap9_sram_desc[]__initdata = { { - .virtual =AT91_VA_BASE_SYS , - .pfn =__phys_to_pfn (AT91_BASE_SYS ), - .length =SZ_16K , - .type =MT_DEVICE , - }, { .virtual =AT91_IO_VIRT_BASE -AT91CAP9_SRAM_SIZE , .pfn =__phys_to_pfn (AT91CAP9_SRAM_BASE ), .length =AT91CAP9_SRAM_SIZE ,
@@ -339,14 +335,12 @@ static void at91cap9_poweroff(void)* AT91CAP9 processor initialization * -------------------------------------------------------------------- */ -void __init at91cap9_map_io (void ) +static void __init at91cap9_map_io (void ) { -/* Map peripherals */ -iotable_init (at91cap9_io_desc,ARRAY_SIZE (at91cap9_io_desc)); +iotable_init (at91cap9_sram_desc,ARRAY_SIZE (at91cap9_sram_desc)); } -void __init at91cap9_initialize (unsigned long main_clock) -{ +static void __init at91cap9_initialize (unsigned long main_clock) at91_arch_reset = at91cap9_reset; pm_power_off = at91cap9_poweroff; at91_extern_irq = (1 <<AT91CAP9_ID_IRQ0 ) | (1 <<AT91CAP9_ID_IRQ1 );
@@ -420,3 +414,8 @@ void __init at91cap9_init_interrupts(unsigned int priority[NR_AIC_IRQS])/* Enable GPIO interrupts */ at91_gpio_irq_setup (); } + +struct at91_soc __initdata at91cap9_soc = { + .map_io = at91cap9_map_io, + .init = at91cap9_initialize, +};
arch/arm/mach-at91/at91rm9200.c +8 -7
@@ -20,16 +20,12 @@#include <mach/at91_st.h> #include <mach/cpu.h> +#include "soc.h" #include "generic.h" #include "clock.h" static struct map_desc at91rm9200_io_desc[]__initdata = { { - .virtual =AT91_VA_BASE_SYS , - .pfn =__phys_to_pfn (AT91_BASE_SYS ), - .length =SZ_4K , - .type =MT_DEVICE , - }, { .virtual =AT91_VA_BASE_EMAC , .pfn =__phys_to_pfn (AT91RM9200_BASE_EMAC ), .length =SZ_16K ,
@@ -315,13 +311,13 @@ void __init at91rm9200_set_type(int type)/* -------------------------------------------------------------------- * AT91RM9200 processor initialization * -------------------------------------------------------------------- */ -void __init at91rm9200_map_io (void ) +static void __init at91rm9200_map_io (void ) {/* Map peripherals */ iotable_init (at91rm9200_io_desc,ARRAY_SIZE (at91rm9200_io_desc)); } -void __init at91rm9200_initialize (unsigned long main_clock) +static void __init at91rm9200_initialize (unsigned long main_clock) { at91_arch_reset = at91rm9200_reset; at91_extern_irq = (1 <<AT91RM9200_ID_IRQ0 ) | (1 <<AT91RM9200_ID_IRQ1 )
@@ -394,3 +390,8 @@ void __init at91rm9200_init_interrupts(unsigned int priority[NR_AIC_IRQS])/* Enable GPIO interrupts */ at91_gpio_irq_setup (); } + +struct at91_soc __initdata at91rm9200_soc = { + .map_io = at91rm9200_map_io, + .init = at91rm9200_initialize, +};
arch/arm/mach-at91/at91sam9260.c +8 -14
@@ -22,18 +22,10 @@#include <mach/at91_rstc.h> #include <mach/at91_shdwc.h> +#include "soc.h" #include "generic.h" #include "clock.h" -static struct map_desc at91sam9260_io_desc[]__initdata = { - { - .virtual =AT91_VA_BASE_SYS , - .pfn =__phys_to_pfn (AT91_BASE_SYS ), - .length =SZ_16K , - .type =MT_DEVICE , - } -}; -static struct map_desc at91sam9260_sram_desc[]__initdata = { { .virtual =AT91_IO_VIRT_BASE -AT91SAM9260_SRAM0_SIZE ,
@@ -349,11 +341,8 @@ static void __init at91sam9xe_map_io(void)iotable_init (at91sam9xe_sram_desc,ARRAY_SIZE (at91sam9xe_sram_desc)); } -void __init at91sam9260_map_io (void ) +static void __init at91sam9260_map_io (void ) { -/* Map peripherals */ -iotable_init (at91sam9260_io_desc,ARRAY_SIZE (at91sam9260_io_desc)); -if (cpu_is_at91sam9xe ())at91sam9xe_map_io ();else if (cpu_is_at91sam9g20 ())
@@ -362,7 +351,7 @@ void __init at91sam9260_map_io(void)iotable_init (at91sam9260_sram_desc,ARRAY_SIZE (at91sam9260_sram_desc)); } -void __init at91sam9260_initialize (unsigned long main_clock) +static void __init at91sam9260_initialize (unsigned long main_clock) { at91_arch_reset = at91sam9_alt_reset; pm_power_off = at91sam9260_poweroff;
@@ -432,3 +421,8 @@ void __init at91sam9260_init_interrupts(unsigned int priority[NR_AIC_IRQS])/* Enable GPIO interrupts */ at91_gpio_irq_setup (); } + +struct at91_soc __initdata at91sam9260_soc = { + .map_io = at91sam9260_map_io, + .init = at91sam9260_initialize, +};
arch/arm/mach-at91/at91sam9261.c +8 -14
@@ -22,18 +22,10 @@#include <mach/at91_rstc.h> #include <mach/at91_shdwc.h> +#include "soc.h" #include "generic.h" #include "clock.h" -static struct map_desc at91sam9261_io_desc[]__initdata = { - { - .virtual =AT91_VA_BASE_SYS , - .pfn =__phys_to_pfn (AT91_BASE_SYS ), - .length =SZ_16K , - .type =MT_DEVICE , - }, -}; -static struct map_desc at91sam9261_sram_desc[]__initdata = { { .virtual =AT91_IO_VIRT_BASE -AT91SAM9261_SRAM_SIZE ,
@@ -302,18 +294,15 @@ static void at91sam9261_poweroff(void)* AT91SAM9261 processor initialization * -------------------------------------------------------------------- */ -void __init at91sam9261_map_io (void ) +static void __init at91sam9261_map_io (void ) { -/* Map peripherals */ -iotable_init (at91sam9261_io_desc,ARRAY_SIZE (at91sam9261_io_desc)); -if (cpu_is_at91sam9g10 ())iotable_init (at91sam9g10_sram_desc,ARRAY_SIZE (at91sam9g10_sram_desc));else iotable_init (at91sam9261_sram_desc,ARRAY_SIZE (at91sam9261_sram_desc)); } -void __init at91sam9261_initialize (unsigned long main_clock) +static void __init at91sam9261_initialize (unsigned long main_clock) { at91_arch_reset = at91sam9_alt_reset; pm_power_off = at91sam9261_poweroff;
@@ -383,3 +372,8 @@ void __init at91sam9261_init_interrupts(unsigned int priority[NR_AIC_IRQS])/* Enable GPIO interrupts */ at91_gpio_irq_setup (); } + +struct at91_soc __initdata at91sam9261_soc = { + .map_io = at91sam9261_map_io, + .init = at91sam9261_initialize, +};
arch/arm/mach-at91/at91sam9263.c +10 -10
@@ -21,16 +21,12 @@#include <mach/at91_rstc.h> #include <mach/at91_shdwc.h> +#include "soc.h" #include "generic.h" #include "clock.h" -static struct map_desc at91sam9263_io_desc[]__initdata = { +static struct map_desc at91sam9263_sram_desc[]__initdata = { { - .virtual =AT91_VA_BASE_SYS , - .pfn =__phys_to_pfn (AT91_BASE_SYS ), - .length =SZ_16K , - .type =MT_DEVICE , - }, { .virtual =AT91_IO_VIRT_BASE -AT91SAM9263_SRAM0_SIZE , .pfn =__phys_to_pfn (AT91SAM9263_SRAM0_BASE ), .length =AT91SAM9263_SRAM0_SIZE ,
@@ -313,13 +309,12 @@ static void at91sam9263_poweroff(void)* AT91SAM9263 processor initialization * -------------------------------------------------------------------- */ -void __init at91sam9263_map_io (void ) +static void __init at91sam9263_map_io (void ) { -/* Map peripherals */ -iotable_init (at91sam9263_io_desc,ARRAY_SIZE (at91sam9263_io_desc)); +iotable_init (at91sam9263_sram_desc,ARRAY_SIZE (at91sam9263_sram_desc)); } -void __init at91sam9263_initialize (unsigned long main_clock) +static void __init at91sam9263_initialize (unsigned long main_clock) { at91_arch_reset = at91sam9_alt_reset; pm_power_off = at91sam9263_poweroff;
@@ -388,3 +383,8 @@ void __init at91sam9263_init_interrupts(unsigned int priority[NR_AIC_IRQS])/* Enable GPIO interrupts */ at91_gpio_irq_setup (); } + +struct at91_soc __initdata at91sam9263_soc = { + .map_io = at91sam9263_map_io, + .init = at91sam9263_initialize, +};
arch/arm/mach-at91/at91sam9g45.c +10 -10
@@ -22,16 +22,12 @@#include <mach/at91_shdwc.h> #include <mach/cpu.h> +#include "soc.h" #include "generic.h" #include "clock.h" -static struct map_desc at91sam9g45_io_desc[]__initdata = { +static struct map_desc at91sam9g45_sram_desc[]__initdata = { { - .virtual =AT91_VA_BASE_SYS , - .pfn =__phys_to_pfn (AT91_BASE_SYS ), - .length =SZ_16K , - .type =MT_DEVICE , - }, { .virtual =AT91_IO_VIRT_BASE -AT91SAM9G45_SRAM_SIZE , .pfn =__phys_to_pfn (AT91SAM9G45_SRAM_BASE ), .length =AT91SAM9G45_SRAM_SIZE ,
@@ -329,13 +325,12 @@ static void at91sam9g45_poweroff(void)* AT91SAM9G45 processor initialization * -------------------------------------------------------------------- */ -void __init at91sam9g45_map_io (void ) +static void __init at91sam9g45_map_io (void ) { -/* Map peripherals */ -iotable_init (at91sam9g45_io_desc,ARRAY_SIZE (at91sam9g45_io_desc)); +iotable_init (at91sam9g45_sram_desc,ARRAY_SIZE (at91sam9g45_sram_desc)); } -void __init at91sam9g45_initialize (unsigned long main_clock) +static void __init at91sam9g45_initialize (unsigned long main_clock) { at91_arch_reset = at91sam9g45_reset; pm_power_off = at91sam9g45_poweroff;
@@ -404,3 +399,8 @@ void __init at91sam9g45_init_interrupts(unsigned int priority[NR_AIC_IRQS])/* Enable GPIO interrupts */ at91_gpio_irq_setup (); } + +struct at91_soc __initdata at91sam9g45_soc = { + .map_io = at91sam9g45_map_io, + .init = at91sam9g45_initialize, +};
arch/arm/mach-at91/at91sam9rl.c +8 -14
@@ -21,18 +21,10 @@#include <mach/at91_rstc.h> #include <mach/at91_shdwc.h> +#include "soc.h" #include "generic.h" #include "clock.h" -static struct map_desc at91sam9rl_io_desc[]__initdata = { - { - .virtual =AT91_VA_BASE_SYS , - .pfn =__phys_to_pfn (AT91_BASE_SYS ), - .length =SZ_16K , - .type =MT_DEVICE , - }, -}; -static struct map_desc at91sam9rl_sram_desc[]__initdata = { { .pfn =__phys_to_pfn (AT91SAM9RL_SRAM_BASE ),
@@ -287,13 +279,10 @@ static void at91sam9rl_poweroff(void)* AT91SAM9RL processor initialization * -------------------------------------------------------------------- */ -void __init at91sam9rl_map_io (void ) +static void __init at91sam9rl_map_io (void ) {unsigned long cidr, sram_size; -/* Map peripherals */ -iotable_init (at91sam9rl_io_desc,ARRAY_SIZE (at91sam9rl_io_desc)); - cidr =at91_sys_read (AT91_DBGU_CIDR );switch (cidr &AT91_CIDR_SRAMSIZ ) {
@@ -312,7 +301,7 @@ void __init at91sam9rl_map_io(void)iotable_init (at91sam9rl_sram_desc,ARRAY_SIZE (at91sam9rl_sram_desc)); } -void __init at91sam9rl_initialize (unsigned long main_clock) +static void __init at91sam9rl_initialize (unsigned long main_clock) { at91_arch_reset = at91sam9_alt_reset; pm_power_off = at91sam9rl_poweroff;
@@ -381,3 +370,8 @@ void __init at91sam9rl_init_interrupts(unsigned int priority[NR_AIC_IRQS])/* Enable GPIO interrupts */ at91_gpio_irq_setup (); } + +struct at91_soc __initdata at91sam9rl_soc = { + .map_io = at91sam9rl_map_io, + .init = at91sam9rl_initialize, +};
arch/arm/mach-at91/board-1arm.c +2 -2
@@ -46,7 +46,7 @@ static void __init onearm_init_early(void)at91rm9200_set_type (ARCH_REVISON_9200_PQFP );/* Initialize processor: 18.432 MHz crystal */ -at91rm9200_initialize (18432000 ); +at91_initialize (18432000 );/* DBGU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
@@ -97,7 +97,7 @@ static void __init onearm_board_init(void)MACHINE_START (ONEARM ,"Ajeco 1ARM single board computer" )/* Maintainer: Lennert Buytenhek <[email protected]> */ .timer = &at91rm9200_timer, - .map_io = at91rm9200_map_io, + .map_io = at91_map_io, .init_early = onearm_init_early, .init_irq = onearm_init_irq, .init_machine = onearm_board_init,
arch/arm/mach-at91/board-afeb-9260v1.c +2 -2
@@ -51,7 +51,7 @@static void __init afeb9260_init_early (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91sam9260_initialize (18432000 ); +at91_initialize (18432000 );/* DBGU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
@@ -219,7 +219,7 @@ static void __init afeb9260_board_init(void)MACHINE_START (AFEB9260 ,"Custom afeb9260 board" )/* Maintainer: Sergey Lapin <[email protected]> */ .timer = &at91sam926x_timer, - .map_io = at91sam9260_map_io, + .map_io = at91_map_io, .init_early = afeb9260_init_early, .init_irq = afeb9260_init_irq, .init_machine = afeb9260_board_init,
arch/arm/mach-at91/board-cam60.c +2 -2
@@ -48,7 +48,7 @@static void __init cam60_init_early (void ) {/* Initialize processor: 10 MHz crystal */ -at91sam9260_initialize (10000000 ); +at91_initialize (10000000 );/* DBGU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
@@ -199,7 +199,7 @@ static void __init cam60_board_init(void)MACHINE_START (CAM60 ,"KwikByte CAM60" )/* Maintainer: KwikByte */ .timer = &at91sam926x_timer, - .map_io = at91sam9260_map_io, + .map_io = at91_map_io, .init_early = cam60_init_early, .init_irq = cam60_init_irq, .init_machine = cam60_board_init,
arch/arm/mach-at91/board-cap9adk.c +2 -2
@@ -53,7 +53,7 @@static void __init cap9adk_init_early (void ) {/* Initialize processor: 12 MHz crystal */ -at91cap9_initialize (12000000 ); +at91_initialize (12000000 );/* Setup the LEDs: USER1 and USER2 LED for cpu/timer... */ at91_init_leds (AT91_PIN_PA10 ,AT91_PIN_PA11 );
@@ -397,7 +397,7 @@ static void __init cap9adk_board_init(void)MACHINE_START (AT91CAP9ADK ,"Atmel AT91CAP9A-DK" )/* Maintainer: Stelian Pop <[email protected]> */ .timer = &at91sam926x_timer, - .map_io = at91cap9_map_io, + .map_io = at91_map_io, .init_early = cap9adk_init_early, .init_irq = cap9adk_init_irq, .init_machine = cap9adk_board_init,
arch/arm/mach-at91/board-carmeva.c +2 -2
@@ -43,7 +43,7 @@static void __init carmeva_init_early (void ) {/* Initialize processor: 20.000 MHz crystal */ -at91rm9200_initialize (20000000 ); +at91_initialize (20000000 );/* DBGU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
@@ -163,7 +163,7 @@ static void __init carmeva_board_init(void)MACHINE_START (CARMEVA ,"Carmeva" )/* Maintainer: Conitec Datasystems */ .timer = &at91rm9200_timer, - .map_io = at91rm9200_map_io, + .map_io = at91_map_io, .init_early = carmeva_init_early, .init_irq = carmeva_init_irq, .init_machine = carmeva_board_init,
arch/arm/mach-at91/board-cpu9krea.c +2 -2
@@ -50,7 +50,7 @@static void __init cpu9krea_init_early (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91sam9260_initialize (18432000 ); +at91_initialize (18432000 );/* DGBU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
@@ -376,7 +376,7 @@ MACHINE_START(CPUAT9G20, "Eukrea CPU9G20")#endif /* Maintainer: Eric Benard - EUKREA Electromatique */ .timer = &at91sam926x_timer, - .map_io = at91sam9260_map_io, + .map_io = at91_map_io, .init_early = cpu9krea_init_early, .init_irq = cpu9krea_init_irq, .init_machine = cpu9krea_board_init,
arch/arm/mach-at91/board-cpuat91.c +2 -2
@@ -57,7 +57,7 @@ static void __init cpuat91_init_early(void)at91rm9200_set_type (ARCH_REVISON_9200_PQFP );/* Initialize processor: 18.432 MHz crystal */ -at91rm9200_initialize (18432000 ); +at91_initialize (18432000 );/* DBGU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
@@ -180,7 +180,7 @@ static void __init cpuat91_board_init(void)MACHINE_START (CPUAT91 ,"Eukrea" )/* Maintainer: Eric Benard - EUKREA Electromatique */ .timer = &at91rm9200_timer, - .map_io = at91rm9200_map_io, + .map_io = at91_map_io, .init_early = cpuat91_init_early, .init_irq = cpuat91_init_irq, .init_machine = cpuat91_board_init,
arch/arm/mach-at91/board-csb337.c +2 -2
@@ -46,7 +46,7 @@static void __init csb337_init_early (void ) {/* Initialize processor: 3.6864 MHz crystal */ -at91rm9200_initialize (3686400 ); +at91_initialize (3686400 );/* Setup the LEDs */ at91_init_leds (AT91_PIN_PB0 ,AT91_PIN_PB1 );
@@ -258,7 +258,7 @@ static void __init csb337_board_init(void)MACHINE_START (CSB337 ,"Cogent CSB337" )/* Maintainer: Bill Gatliff */ .timer = &at91rm9200_timer, - .map_io = at91rm9200_map_io, + .map_io = at91_map_io, .init_early = csb337_init_early, .init_irq = csb337_init_irq, .init_machine = csb337_board_init,
arch/arm/mach-at91/board-csb637.c +2 -2
@@ -43,7 +43,7 @@static void __init csb637_init_early (void ) {/* Initialize processor: 3.6864 MHz crystal */ -at91rm9200_initialize (3686400 ); +at91_initialize (3686400 );/* DBGU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
@@ -139,7 +139,7 @@ static void __init csb637_board_init(void)MACHINE_START (CSB637 ,"Cogent CSB637" )/* Maintainer: Bill Gatliff */ .timer = &at91rm9200_timer, - .map_io = at91rm9200_map_io, + .map_io = at91_map_io, .init_early = csb637_init_early, .init_irq = csb637_init_irq, .init_machine = csb637_board_init,
arch/arm/mach-at91/board-eb9200.c +2 -2
@@ -43,7 +43,7 @@static void __init eb9200_init_early (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91rm9200_initialize (18432000 ); +at91_initialize (18432000 );/* DBGU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
@@ -121,7 +121,7 @@ static void __init eb9200_board_init(void)MACHINE_START (ATEB9200 ,"Embest ATEB9200" ) .timer = &at91rm9200_timer, - .map_io = at91rm9200_map_io, + .map_io = at91_map_io, .init_early = eb9200_init_early, .init_irq = eb9200_init_irq, .init_machine = eb9200_board_init,
arch/arm/mach-at91/board-ecbat91.c +2 -2
@@ -49,7 +49,7 @@ static void __init ecb_at91init_early(void)at91rm9200_set_type (ARCH_REVISON_9200_PQFP );/* Initialize processor: 18.432 MHz crystal */ -at91rm9200_initialize (18432000 ); +at91_initialize (18432000 );/* Setup the LEDs */ at91_init_leds (AT91_PIN_PC7 ,AT91_PIN_PC7 );
@@ -173,7 +173,7 @@ static void __init ecb_at91board_init(void)MACHINE_START (ECBAT91 ,"emQbit's ECB_AT91" )/* Maintainer: emQbit.com */ .timer = &at91rm9200_timer, - .map_io = at91rm9200_map_io, + .map_io = at91_map_io, .init_early = ecb_at91init_early, .init_irq = ecb_at91init_irq, .init_machine = ecb_at91board_init,
arch/arm/mach-at91/board-eco920.c +2 -2
@@ -35,7 +35,7 @@ static void __init eco920_init_early(void)/* Set cpu type: PQFP */ at91rm9200_set_type (ARCH_REVISON_9200_PQFP ); -at91rm9200_initialize (18432000 ); +at91_initialize (18432000 );/* Setup the LEDs */ at91_init_leds (AT91_PIN_PB0 ,AT91_PIN_PB1 );
@@ -135,7 +135,7 @@ static void __init eco920_board_init(void)MACHINE_START (ECO920 ,"eco920" )/* Maintainer: Sascha Hauer */ .timer = &at91rm9200_timer, - .map_io = at91rm9200_map_io, + .map_io = at91_map_io, .init_early = eco920_init_early, .init_irq = eco920_init_irq, .init_machine = eco920_board_init,
arch/arm/mach-at91/board-flexibity.c +2 -2
@@ -40,7 +40,7 @@static void __init flexibity_init_early (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91sam9260_initialize (18432000 ); +at91_initialize (18432000 );/* DBGU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
@@ -155,7 +155,7 @@ static void __init flexibity_board_init(void)MACHINE_START (FLEXIBITY ,"Flexibity Connect" )/* Maintainer: Maxim Osipov */ .timer = &at91sam926x_timer, - .map_io = at91sam9260_map_io, + .map_io = at91_map_io, .init_early = flexibity_init_early, .init_irq = flexibity_init_irq, .init_machine = flexibity_board_init,
arch/arm/mach-at91/board-foxg20.c +2 -2
@@ -60,7 +60,7 @@static void __init foxg20_init_early (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91sam9260_initialize (18432000 ); +at91_initialize (18432000 );/* DBGU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
@@ -267,7 +267,7 @@ static void __init foxg20_board_init(void)MACHINE_START (ACMENETUSFOXG20 ,"Acme Systems srl FOX Board G20" )/* Maintainer: Sergio Tanzilli */ .timer = &at91sam926x_timer, - .map_io = at91sam9260_map_io, + .map_io = at91_map_io, .init_early = foxg20_init_early, .init_irq = foxg20_init_irq, .init_machine = foxg20_board_init,
arch/arm/mach-at91/board-gsia18s.c +1 -1
@@ -577,7 +577,7 @@ static void __init gsia18s_board_init(void)MACHINE_START (GSIA18S ,"GS_IA18_S" ) .timer = &at91sam926x_timer, - .map_io = at91sam9260_map_io, + .map_io = at91_map_io, .init_early = gsia18s_init_early, .init_irq = init_irq, .init_machine = gsia18s_board_init,
arch/arm/mach-at91/board-kafa.c +2 -2
@@ -46,7 +46,7 @@ static void __init kafa_init_early(void)at91rm9200_set_type (ARCH_REVISON_9200_PQFP );/* Initialize processor: 18.432 MHz crystal */ -at91rm9200_initialize (18432000 ); +at91_initialize (18432000 );/* Set up the LEDs */ at91_init_leds (AT91_PIN_PB4 ,AT91_PIN_PB4 );
@@ -99,7 +99,7 @@ static void __init kafa_board_init(void)MACHINE_START (KAFA ,"Sperry-Sun KAFA" )/* Maintainer: Sergei Sharonov */ .timer = &at91rm9200_timer, - .map_io = at91rm9200_map_io, + .map_io = at91_map_io, .init_early = kafa_init_early, .init_irq = kafa_init_irq, .init_machine = kafa_board_init,
arch/arm/mach-at91/board-kb9202.c +2 -2
@@ -48,7 +48,7 @@ static void __init kb9202_init_early(void)at91rm9200_set_type (ARCH_REVISON_9200_PQFP );/* Initialize processor: 10 MHz crystal */ -at91rm9200_initialize (10000000 ); +at91_initialize (10000000 );/* Set up the LEDs */ at91_init_leds (AT91_PIN_PC19 ,AT91_PIN_PC18 );
@@ -140,7 +140,7 @@ static void __init kb9202_board_init(void)MACHINE_START (KB9200 ,"KB920x" )/* Maintainer: KwikByte, Inc. */ .timer = &at91rm9200_timer, - .map_io = at91rm9200_map_io, + .map_io = at91_map_io, .init_early = kb9202_init_early, .init_irq = kb9202_init_irq, .init_machine = kb9202_board_init,
arch/arm/mach-at91/board-neocore926.c +2 -2
@@ -54,7 +54,7 @@static void __init neocore926_init_early (void ) {/* Initialize processor: 20 MHz crystal */ -at91sam9263_initialize (20000000 ); +at91_initialize (20000000 );/* DBGU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
@@ -388,7 +388,7 @@ static void __init neocore926_board_init(void)MACHINE_START (NEOCORE926 ,"ADENEO NEOCORE 926" )/* Maintainer: ADENEO */ .timer = &at91sam926x_timer, - .map_io = at91sam9263_map_io, + .map_io = at91_map_io, .init_early = neocore926_init_early, .init_irq = neocore926_init_irq, .init_machine = neocore926_board_init,
arch/arm/mach-at91/board-pcontrol-g20.c +1 -1
@@ -223,7 +223,7 @@ static void __init pcontrol_g20_board_init(void)MACHINE_START (PCONTROL_G20 ,"PControl G20" )/* Maintainer: pgsellmann at portner-elektronik.at */ .timer = &at91sam926x_timer, - .map_io = at91sam9260_map_io, + .map_io = at91_map_io, .init_early = pcontrol_g20_init_early, .init_irq = init_irq, .init_machine = pcontrol_g20_board_init,
arch/arm/mach-at91/board-picotux200.c +2 -2
@@ -46,7 +46,7 @@static void __init picotux200_init_early (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91rm9200_initialize (18432000 ); +at91_initialize (18432000 );/* DBGU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
@@ -124,7 +124,7 @@ static void __init picotux200_board_init(void)MACHINE_START (PICOTUX2XX ,"picotux 200" )/* Maintainer: Kleinhenz Elektronik GmbH */ .timer = &at91rm9200_timer, - .map_io = at91rm9200_map_io, + .map_io = at91_map_io, .init_early = picotux200_init_early, .init_irq = picotux200_init_irq, .init_machine = picotux200_board_init,
arch/arm/mach-at91/board-qil-a9260.c +2 -2
@@ -51,7 +51,7 @@static void __init ek_init_early (void ) {/* Initialize processor: 12.000 MHz crystal */ -at91sam9260_initialize (12000000 ); +at91_initialize (12000000 );/* DBGU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
@@ -269,7 +269,7 @@ static void __init ek_board_init(void)MACHINE_START (QIL_A9260 ,"CALAO QIL_A9260" )/* Maintainer: calao-systems */ .timer = &at91sam926x_timer, - .map_io = at91sam9260_map_io, + .map_io = at91_map_io, .init_early = ek_init_early, .init_irq = ek_init_irq, .init_machine = ek_board_init,
arch/arm/mach-at91/board-rm9200dk.c +2 -2
@@ -48,7 +48,7 @@static void __init dk_init_early (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91rm9200_initialize (18432000 ); +at91_initialize (18432000 );/* Setup the LEDs */ at91_init_leds (AT91_PIN_PB2 ,AT91_PIN_PB2 );
@@ -228,7 +228,7 @@ static void __init dk_board_init(void)MACHINE_START (AT91RM9200DK ,"Atmel AT91RM9200-DK" )/* Maintainer: SAN People/Atmel */ .timer = &at91rm9200_timer, - .map_io = at91rm9200_map_io, + .map_io = at91_map_io, .init_early = dk_init_early, .init_irq = dk_init_irq, .init_machine = dk_board_init,
arch/arm/mach-at91/board-rm9200ek.c +2 -2
@@ -48,7 +48,7 @@static void __init ek_init_early (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91rm9200_initialize (18432000 ); +at91_initialize (18432000 );/* Setup the LEDs */ at91_init_leds (AT91_PIN_PB1 ,AT91_PIN_PB2 );
@@ -194,7 +194,7 @@ static void __init ek_board_init(void)MACHINE_START (AT91RM9200EK ,"Atmel AT91RM9200-EK" )/* Maintainer: SAN People/Atmel */ .timer = &at91rm9200_timer, - .map_io = at91rm9200_map_io, + .map_io = at91_map_io, .init_early = ek_init_early, .init_irq = ek_init_irq, .init_machine = ek_board_init,
arch/arm/mach-at91/board-sam9-l9260.c +2 -2
@@ -47,7 +47,7 @@static void __init ek_init_early (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91sam9260_initialize (18432000 ); +at91_initialize (18432000 );/* Setup the LEDs */ at91_init_leds (AT91_PIN_PA9 ,AT91_PIN_PA6 );
@@ -213,7 +213,7 @@ static void __init ek_board_init(void)MACHINE_START (SAM9_L9260 ,"Olimex SAM9-L9260" )/* Maintainer: Olimex */ .timer = &at91sam926x_timer, - .map_io = at91sam9260_map_io, + .map_io = at91_map_io, .init_early = ek_init_early, .init_irq = ek_init_irq, .init_machine = ek_board_init,
arch/arm/mach-at91/board-sam9260ek.c +2 -2
@@ -53,7 +53,7 @@static void __init ek_init_early (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91sam9260_initialize (18432000 ); +at91_initialize (18432000 );/* DBGU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
@@ -354,7 +354,7 @@ static void __init ek_board_init(void)MACHINE_START (AT91SAM9260EK ,"Atmel AT91SAM9260-EK" )/* Maintainer: Atmel */ .timer = &at91sam926x_timer, - .map_io = at91sam9260_map_io, + .map_io = at91_map_io, .init_early = ek_init_early, .init_irq = ek_init_irq, .init_machine = ek_board_init,
arch/arm/mach-at91/board-sam9261ek.c +2 -2
@@ -57,7 +57,7 @@static void __init ek_init_early (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91sam9261_initialize (18432000 ); +at91_initialize (18432000 );/* Setup the LEDs */ at91_init_leds (AT91_PIN_PA13 ,AT91_PIN_PA14 );
@@ -621,7 +621,7 @@ MACHINE_START(AT91SAM9G10EK, "Atmel AT91SAM9G10-EK")#endif /* Maintainer: Atmel */ .timer = &at91sam926x_timer, - .map_io = at91sam9261_map_io, + .map_io = at91_map_io, .init_early = ek_init_early, .init_irq = ek_init_irq, .init_machine = ek_board_init,
arch/arm/mach-at91/board-sam9263ek.c +2 -2
@@ -56,7 +56,7 @@static void __init ek_init_early (void ) {/* Initialize processor: 16.367 MHz crystal */ -at91sam9263_initialize (16367660 ); +at91_initialize (16367660 );/* DBGU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
@@ -452,7 +452,7 @@ static void __init ek_board_init(void)MACHINE_START (AT91SAM9263EK ,"Atmel AT91SAM9263-EK" )/* Maintainer: Atmel */ .timer = &at91sam926x_timer, - .map_io = at91sam9263_map_io, + .map_io = at91_map_io, .init_early = ek_init_early, .init_irq = ek_init_irq, .init_machine = ek_board_init,
arch/arm/mach-at91/board-sam9g20ek.c +3 -3
@@ -64,7 +64,7 @@ static int inline ek_have_2mmc(void)static void __init ek_init_early (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91sam9260_initialize (18432000 ); +at91_initialize (18432000 );/* DBGU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
@@ -404,7 +404,7 @@ static void __init ek_board_init(void)MACHINE_START (AT91SAM9G20EK ,"Atmel AT91SAM9G20-EK" )/* Maintainer: Atmel */ .timer = &at91sam926x_timer, - .map_io = at91sam9260_map_io, + .map_io = at91_map_io, .init_early = ek_init_early, .init_irq = ek_init_irq, .init_machine = ek_board_init,
@@ -413,7 +413,7 @@ MACHINE_ENDMACHINE_START (AT91SAM9G20EK_2MMC ,"Atmel AT91SAM9G20-EK 2 MMC Slot Mod" )/* Maintainer: Atmel */ .timer = &at91sam926x_timer, - .map_io = at91sam9260_map_io, + .map_io = at91_map_io, .init_early = ek_init_early, .init_irq = ek_init_irq, .init_machine = ek_board_init,
arch/arm/mach-at91/board-sam9m10g45ek.c +2 -2
@@ -50,7 +50,7 @@static void __init ek_init_early (void ) {/* Initialize processor: 12.000 MHz crystal */ -at91sam9g45_initialize (12000000 ); +at91_initialize (12000000 );/* DGBU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
@@ -422,7 +422,7 @@ static void __init ek_board_init(void)MACHINE_START (AT91SAM9M10G45EK ,"Atmel AT91SAM9M10G45-EK" )/* Maintainer: Atmel */ .timer = &at91sam926x_timer, - .map_io = at91sam9g45_map_io, + .map_io = at91_map_io, .init_early = ek_init_early, .init_irq = ek_init_irq, .init_machine = ek_board_init,
arch/arm/mach-at91/board-sam9rlek.c +2 -2
@@ -41,7 +41,7 @@static void __init ek_init_early (void ) {/* Initialize processor: 12.000 MHz crystal */ -at91sam9rl_initialize (12000000 ); +at91_initialize (12000000 );/* DBGU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
@@ -330,7 +330,7 @@ static void __init ek_board_init(void)MACHINE_START (AT91SAM9RLEK ,"Atmel AT91SAM9RL-EK" )/* Maintainer: Atmel */ .timer = &at91sam926x_timer, - .map_io = at91sam9rl_map_io, + .map_io = at91_map_io, .init_early = ek_init_early, .init_irq = ek_init_irq, .init_machine = ek_board_init,
arch/arm/mach-at91/board-snapper9260.c +2 -2
@@ -42,7 +42,7 @@static void __init snapper9260_init_early (void ) { -at91sam9260_initialize (18432000 ); +at91_initialize (18432000 );/* Debug on ttyS0 */ at91_register_uart (0 ,0 ,0 );
@@ -179,7 +179,7 @@ static void __init snapper9260_board_init(void)MACHINE_START (SNAPPER_9260 ,"Bluewater Systems Snapper 9260/9G20 module" ) .timer = &at91sam926x_timer, - .map_io = at91sam9260_map_io, + .map_io = at91_map_io, .init_early = snapper9260_init_early, .init_irq = snapper9260_init_irq, .init_machine = snapper9260_board_init,
arch/arm/mach-at91/board-stamp9g20.c +3 -3
@@ -35,7 +35,7 @@void __init stamp9g20_init_early (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91sam9260_initialize (18432000 ); +at91_initialize (18432000 );/* DGBU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
@@ -299,7 +299,7 @@ static void __init stamp9g20evb_board_init(void)MACHINE_START (PORTUXG20 ,"taskit PortuxG20" )/* Maintainer: taskit GmbH */ .timer = &at91sam926x_timer, - .map_io = at91sam9260_map_io, + .map_io = at91_map_io, .init_early = portuxg20_init_early, .init_irq = init_irq, .init_machine = portuxg20_board_init,
@@ -308,7 +308,7 @@ MACHINE_ENDMACHINE_START (STAMP9G20 ,"taskit Stamp9G20" )/* Maintainer: taskit GmbH */ .timer = &at91sam926x_timer, - .map_io = at91sam9260_map_io, + .map_io = at91_map_io, .init_early = stamp9g20evb_init_early, .init_irq = init_irq, .init_machine = stamp9g20evb_board_init,
arch/arm/mach-at91/board-usb-a9260.c +2 -2
@@ -51,7 +51,7 @@static void __init ek_init_early (void ) {/* Initialize processor: 12.000 MHz crystal */ -at91sam9260_initialize (12000000 ); +at91_initialize (12000000 );/* DBGU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
@@ -229,7 +229,7 @@ static void __init ek_board_init(void)MACHINE_START (USB_A9260 ,"CALAO USB_A9260" )/* Maintainer: calao-systems */ .timer = &at91sam926x_timer, - .map_io = at91sam9260_map_io, + .map_io = at91_map_io, .init_early = ek_init_early, .init_irq = ek_init_irq, .init_machine = ek_board_init,
arch/arm/mach-at91/board-usb-a9263.c +2 -2
@@ -50,7 +50,7 @@static void __init ek_init_early (void ) {/* Initialize processor: 12.00 MHz crystal */ -at91sam9263_initialize (12000000 ); +at91_initialize (12000000 );/* DBGU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
@@ -245,7 +245,7 @@ static void __init ek_board_init(void)MACHINE_START (USB_A9263 ,"CALAO USB_A9263" )/* Maintainer: calao-systems */ .timer = &at91sam926x_timer, - .map_io = at91sam9263_map_io, + .map_io = at91_map_io, .init_early = ek_init_early, .init_irq = ek_init_irq, .init_machine = ek_board_init,
arch/arm/mach-at91/board-yl-9200.c +2 -2
@@ -56,7 +56,7 @@ static void __init yl9200_init_early(void)at91rm9200_set_type (ARCH_REVISON_9200_PQFP );/* Initialize processor: 18.432 MHz crystal */ -at91rm9200_initialize (18432000 ); +at91_initialize (18432000 );/* Setup the LEDs D2=PB17 (timer), D3=PB16 (cpu) */ at91_init_leds (AT91_PIN_PB16 ,AT91_PIN_PB17 );
@@ -599,7 +599,7 @@ static void __init yl9200_board_init(void)MACHINE_START (YL9200 ,"uCdragon YL-9200" )/* Maintainer: S.Birtles */ .timer = &at91rm9200_timer, - .map_io = at91rm9200_map_io, + .map_io = at91_map_io, .init_early = yl9200_init_early, .init_irq = yl9200_init_irq, .init_machine = yl9200_board_init,
arch/arm/mach-at91/generic.h +2 -15
@@ -11,25 +11,12 @@#include <linux/clkdev.h> /* Map io */ -extern void __init at91rm9200_map_io (void ); -extern void __init at91sam9260_map_io (void ); -extern void __init at91sam9261_map_io (void ); -extern void __init at91sam9263_map_io (void ); -extern void __init at91sam9rl_map_io (void ); -extern void __init at91sam9g45_map_io (void ); -extern void __init at91x40_map_io (void ); -extern void __init at91cap9_map_io (void ); +extern void __init at91_map_io (void );/* Processors */ extern void __init at91rm9200_set_type (int type); -extern void __init at91rm9200_initialize (unsigned long main_clock); -extern void __init at91sam9260_initialize (unsigned long main_clock); -extern void __init at91sam9261_initialize (unsigned long main_clock); -extern void __init at91sam9263_initialize (unsigned long main_clock); -extern void __init at91sam9rl_initialize (unsigned long main_clock); -extern void __init at91sam9g45_initialize (unsigned long main_clock); +extern void __init at91_initialize (unsigned long main_clock);extern void __init at91x40_initialize (unsigned long main_clock); -extern void __init at91cap9_initialize (unsigned long main_clock);/* Interrupts */ extern void __init at91rm9200_init_interrupts (unsigned int priority[]);
arch/arm/mach-at91/include/mach/at91cap9.h +0 -1
@@ -75,7 +75,6 @@#define AT91CAP9_BASE_EMAC 0xfffbc000#define AT91CAP9_BASE_ADC 0xfffc0000#define AT91CAP9_BASE_ISI 0xfffc4000 -#define AT91_BASE_SYS 0xffffe200/* * System Peripherals (offset from AT91_BASE_SYS)
arch/arm/mach-at91/include/mach/at91rm9200.h +0 -1
@@ -74,7 +74,6 @@#define AT91RM9200_BASE_SSC1 0xfffd4000#define AT91RM9200_BASE_SSC2 0xfffd8000#define AT91RM9200_BASE_SPI 0xfffe0000 -#define AT91_BASE_SYS 0xfffff000/*
arch/arm/mach-at91/include/mach/at91sam9260.h +0 -1
@@ -76,7 +76,6 @@#define AT91SAM9260_BASE_TC4 0xfffdc040#define AT91SAM9260_BASE_TC5 0xfffdc080#define AT91SAM9260_BASE_ADC 0xfffe0000 -#define AT91_BASE_SYS 0xffffe800/* * System Peripherals (offset from AT91_BASE_SYS)
arch/arm/mach-at91/include/mach/at91sam9261.h +0 -1
@@ -60,7 +60,6 @@#define AT91SAM9261_BASE_SSC2 0xfffc4000#define AT91SAM9261_BASE_SPI0 0xfffc8000#define AT91SAM9261_BASE_SPI1 0xfffcc000 -#define AT91_BASE_SYS 0xffffea00/*
arch/arm/mach-at91/include/mach/at91sam9263.h +0 -1
@@ -70,7 +70,6 @@#define AT91SAM9263_BASE_EMAC 0xfffbc000#define AT91SAM9263_BASE_ISI 0xfffc4000#define AT91SAM9263_BASE_2DGE 0xfffc8000 -#define AT91_BASE_SYS 0xffffe000/* * System Peripherals (offset from AT91_BASE_SYS)
arch/arm/mach-at91/include/mach/at91sam9g45.h +0 -1
@@ -82,7 +82,6 @@#define AT91SAM9G45_BASE_TC3 0xfffd4000#define AT91SAM9G45_BASE_TC4 0xfffd4040#define AT91SAM9G45_BASE_TC5 0xfffd4080 -#define AT91_BASE_SYS 0xffffe200/* * System Peripherals (offset from AT91_BASE_SYS)
arch/arm/mach-at91/include/mach/at91sam9rl.h +0 -1
@@ -64,7 +64,6 @@#define AT91SAM9RL_BASE_TSC 0xfffd0000#define AT91SAM9RL_BASE_UDPHS 0xfffd4000#define AT91SAM9RL_BASE_AC97C 0xfffd8000 -#define AT91_BASE_SYS 0xffffc000/*
arch/arm/mach-at91/include/mach/hardware.h +14 -0
@@ -36,6 +36,20 @@#error "Unsupported AT91 processor"#endif +#if !defined(CONFIG_ARCH_AT91X40 ) +/* +* On all at91 except rm9200 and x40 have the System Controller starts +* at address 0xffffc000 and has a size of 16KiB. +* +* On rm9200 it's start at 0xfffe4000 of 111KiB with non reserved data starting +* at 0xfffff000 +* +* Removes the individual definitions of AT91_BASE_SYS and +* replaces them with a common version at base 0xfffffc000 and size 16KiB +* and map the same memory space +*/ +#define AT91_BASE_SYS 0xffffc000 +#endif /* * Peripheral identifiers/interrupts.
arch/arm/mach-at91/setup.c new file +63 -0
63 lines not on this page · raw message
arch/arm/mach-at91/soc.h new file +20 -0
@@ -0,0 +1,20 @@ +/* +* Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +* +* Under GPLv2 +*/ + +struct at91_soc { +void (*map_io)(void ); +void (*init)(unsigned long main_clock); +}; + +extern struct at91_soc at91_boot_soc; +extern struct at91_soc at91cap9_soc; +extern struct at91_soc at91rm9200_soc; +extern struct at91_soc at91sam9260_soc; +extern struct at91_soc at91sam9261_soc; +extern struct at91_soc at91sam9263_soc; +extern struct at91_soc at91sam9g45_soc; +extern struct at91_soc at91sam9rl_soc; +extern struct at91_soc at91sam9x5_soc;
Signature · 1 line
1.7.4.1
PATCH 2/8 at91: factorize at91 interrupts init to soc
they are the same except the default priority
--- arch/arm/mach-at91/at91cap9.c | 13 +------------ arch/arm/mach-at91/at91rm9200.c | 13 +------------ arch/arm/mach-at91/at91sam9260.c | 13 +------------ arch/arm/mach-at91/at91sam9261.c | 13 +------------ arch/arm/mach-at91/at91sam9263.c | 13 +------------ arch/arm/mach-at91/at91sam9g45.c | 13 +------------ arch/arm/mach-at91/at91sam9rl.c | 13 +------------ arch/arm/mach-at91/board-1arm.c | 7 +------ arch/arm/mach-at91/board-afeb-9260v1.c | 8 +------- arch/arm/mach-at91/board-cam60.c | 8 +------- arch/arm/mach-at91/board-cap9adk.c | 8 +------- arch/arm/mach-at91/board-carmeva.c | 7 +------ arch/arm/mach-at91/board-cpu9krea.c | 7 +------ arch/arm/mach-at91/board-cpuat91.c | 7 +------ arch/arm/mach-at91/board-csb337.c | 7 +------ arch/arm/mach-at91/board-csb637.c | 7 +------ arch/arm/mach-at91/board-eb9200.c | 7 +------ arch/arm/mach-at91/board-ecbat91.c | 7 +------ arch/arm/mach-at91/board-eco920.c | 7 +------ arch/arm/mach-at91/board-flexibity.c | 7 +------ arch/arm/mach-at91/board-foxg20.c | 8 +------- arch/arm/mach-at91/board-gsia18s.c | 5 ----- arch/arm/mach-at91/board-kafa.c | 7 +------ arch/arm/mach-at91/board-kb9202.c | 7 +------ arch/arm/mach-at91/board-neocore926.c | 8 +------- arch/arm/mach-at91/board-pcontrol-g20.c | 7 ------- arch/arm/mach-at91/board-picotux200.c | 7 +------ arch/arm/mach-at91/board-qil-a9260.c | 8 +------- arch/arm/mach-at91/board-rm9200dk.c | 7 +------ arch/arm/mach-at91/board-rm9200ek.c | 7 +------ arch/arm/mach-at91/board-sam9-l9260.c | 8 +------- arch/arm/mach-at91/board-sam9260ek.c | 8 +------- arch/arm/mach-at91/board-sam9261ek.c | 8 +------- arch/arm/mach-at91/board-sam9263ek.c | 8 +------- arch/arm/mach-at91/board-sam9g20ek.c | 10 ++-------- arch/arm/mach-at91/board-sam9m10g45ek.c | 8 +------- arch/arm/mach-at91/board-sam9rlek.c | 8 +------- arch/arm/mach-at91/board-snapper9260.c | 7 +------ arch/arm/mach-at91/board-stamp9g20.c | 6 ------ arch/arm/mach-at91/board-usb-a9260.c | 8 +------- arch/arm/mach-at91/board-usb-a9263.c | 8 +------- arch/arm/mach-at91/board-yl-9200.c | 8 +------- arch/arm/mach-at91/generic.h | 9 ++------- arch/arm/mach-at91/setup.c | 14 ++++++++++++++ arch/arm/mach-at91/soc.h | 1 + 45 files changed, 57 insertions(+), 318 deletions(-)
arch/arm/mach-at91/at91cap9.c +1 -12
@@ -403,19 +403,8 @@ static unsigned int at91cap9_default_irq_priority[NR_AIC_IRQS] __initdata = { 0, /* Advanced Interrupt Controller (IRQ1) */ }; -void __init at91cap9_init_interrupts (unsigned int priority[NR_AIC_IRQS ]) -{ -if (!priority) - priority = at91cap9_default_irq_priority; - -/* Initialize the AIC interrupt controller */ -at91_aic_init (priority); - -/* Enable GPIO interrupts */ -at91_gpio_irq_setup (); -} -struct at91_soc __initdata at91cap9_soc = { .map_io = at91cap9_map_io, + .default_irq_priority = at91cap9_default_irq_priority, .init = at91cap9_initialize, };
arch/arm/mach-at91/at91rm9200.c +1 -12
@@ -379,19 +379,8 @@ static unsigned int at91rm9200_default_irq_priority[NR_AIC_IRQS] __initdata = { 0 /* Advanced Interrupt Controller (IRQ6) */ }; -void __init at91rm9200_init_interrupts (unsigned int priority[NR_AIC_IRQS ]) -{ -if (!priority) - priority = at91rm9200_default_irq_priority; - -/* Initialize the AIC interrupt controller */ -at91_aic_init (priority); - -/* Enable GPIO interrupts */ -at91_gpio_irq_setup (); -} -struct at91_soc __initdata at91rm9200_soc = { .map_io = at91rm9200_map_io, + .default_irq_priority = at91rm9200_default_irq_priority, .init = at91rm9200_initialize, };
arch/arm/mach-at91/at91sam9260.c +1 -12
@@ -410,19 +410,8 @@ static unsigned int at91sam9260_default_irq_priority[NR_AIC_IRQS] __initdata = { 0, /* Advanced Interrupt Controller */ }; -void __init at91sam9260_init_interrupts (unsigned int priority[NR_AIC_IRQS ]) -{ -if (!priority) - priority = at91sam9260_default_irq_priority; - -/* Initialize the AIC interrupt controller */ -at91_aic_init (priority); - -/* Enable GPIO interrupts */ -at91_gpio_irq_setup (); -} -struct at91_soc __initdata at91sam9260_soc = { .map_io = at91sam9260_map_io, + .default_irq_priority = at91sam9260_default_irq_priority, .init = at91sam9260_initialize, };
arch/arm/mach-at91/at91sam9261.c +1 -12
@@ -361,19 +361,8 @@ static unsigned int at91sam9261_default_irq_priority[NR_AIC_IRQS] __initdata = { 0, /* Advanced Interrupt Controller */ }; -void __init at91sam9261_init_interrupts (unsigned int priority[NR_AIC_IRQS ]) -{ -if (!priority) - priority = at91sam9261_default_irq_priority; - -/* Initialize the AIC interrupt controller */ -at91_aic_init (priority); - -/* Enable GPIO interrupts */ -at91_gpio_irq_setup (); -} -struct at91_soc __initdata at91sam9261_soc = { .map_io = at91sam9261_map_io, + .default_irq_priority = at91sam9261_default_irq_priority, .init = at91sam9261_initialize, };
arch/arm/mach-at91/at91sam9263.c +1 -12
@@ -372,19 +372,8 @@ static unsigned int at91sam9263_default_irq_priority[NR_AIC_IRQS] __initdata = { 0, /* Advanced Interrupt Controller (IRQ1) */ }; -void __init at91sam9263_init_interrupts (unsigned int priority[NR_AIC_IRQS ]) -{ -if (!priority) - priority = at91sam9263_default_irq_priority; - -/* Initialize the AIC interrupt controller */ -at91_aic_init (priority); - -/* Enable GPIO interrupts */ -at91_gpio_irq_setup (); -} -struct at91_soc __initdata at91sam9263_soc = { .map_io = at91sam9263_map_io, + .default_irq_priority = at91sam9263_default_irq_priority, .init = at91sam9263_initialize, };
arch/arm/mach-at91/at91sam9g45.c +1 -12
@@ -388,19 +388,8 @@ static unsigned int at91sam9g45_default_irq_priority[NR_AIC_IRQS] __initdata = { 0, /* Advanced Interrupt Controller (IRQ0) */ }; -void __init at91sam9g45_init_interrupts (unsigned int priority[NR_AIC_IRQS ]) -{ -if (!priority) - priority = at91sam9g45_default_irq_priority; - -/* Initialize the AIC interrupt controller */ -at91_aic_init (priority); - -/* Enable GPIO interrupts */ -at91_gpio_irq_setup (); -} -struct at91_soc __initdata at91sam9g45_soc = { .map_io = at91sam9g45_map_io, + .default_irq_priority = at91sam9g45_default_irq_priority, .init = at91sam9g45_initialize, };
arch/arm/mach-at91/at91sam9rl.c +1 -12
@@ -359,19 +359,8 @@ static unsigned int at91sam9rl_default_irq_priority[NR_AIC_IRQS] __initdata = { 0, /* Advanced Interrupt Controller */ }; -void __init at91sam9rl_init_interrupts (unsigned int priority[NR_AIC_IRQS ]) -{ -if (!priority) - priority = at91sam9rl_default_irq_priority; - -/* Initialize the AIC interrupt controller */ -at91_aic_init (priority); - -/* Enable GPIO interrupts */ -at91_gpio_irq_setup (); -} -struct at91_soc __initdata at91sam9rl_soc = { .map_io = at91sam9rl_map_io, + .default_irq_priority = at91sam9rl_default_irq_priority, .init = at91sam9rl_initialize, };
arch/arm/mach-at91/board-1arm.c +1 -6
@@ -63,11 +63,6 @@ static void __init onearm_init_early(void)at91_set_serial_console (0 ); } -static void __init onearm_init_irq (void ) -{ -at91rm9200_init_interrupts (NULL ); -} -static struct at91_eth_data __initdata onearm_eth_data = { .phy_irq_pin =AT91_PIN_PC4 , .is_rmii =1 ,
@@ -99,6 +94,6 @@ MACHINE_START(ONEARM, "Ajeco 1ARM single board computer") .timer = &at91rm9200_timer, .map_io = at91_map_io, .init_early = onearm_init_early, - .init_irq = onearm_init_irq, + .init_irq = at91_init_irq_default, .init_machine = onearm_board_init,MACHINE_END
arch/arm/mach-at91/board-afeb-9260v1.c +1 -7
@@ -70,12 +70,6 @@ static void __init afeb9260_init_early(void)at91_set_serial_console (0 ); } -static void __init afeb9260_init_irq (void ) -{ -at91sam9260_init_interrupts (NULL ); -} - -/* * USB Host port */
@@ -221,7 +215,7 @@ MACHINE_START(AFEB9260, "Custom afeb9260 board") .timer = &at91sam926x_timer, .map_io = at91_map_io, .init_early = afeb9260_init_early, - .init_irq = afeb9260_init_irq, + .init_irq = at91_init_irq_default, .init_machine = afeb9260_board_init,MACHINE_END
arch/arm/mach-at91/board-cam60.c +1 -7
@@ -57,12 +57,6 @@ static void __init cam60_init_early(void)at91_set_serial_console (0 ); } -static void __init cam60_init_irq (void ) -{ -at91sam9260_init_interrupts (NULL ); -} - -/* * USB Host */
@@ -201,6 +195,6 @@ MACHINE_START(CAM60, "KwikByte CAM60") .timer = &at91sam926x_timer, .map_io = at91_map_io, .init_early = cam60_init_early, - .init_irq = cam60_init_irq, + .init_irq = at91_init_irq_default, .init_machine = cam60_board_init,MACHINE_END
arch/arm/mach-at91/board-cap9adk.c +1 -7
@@ -65,12 +65,6 @@ static void __init cap9adk_init_early(void)at91_set_serial_console (0 ); } -static void __init cap9adk_init_irq (void ) -{ -at91cap9_init_interrupts (NULL ); -} - -/* * USB Host port */
@@ -399,6 +393,6 @@ MACHINE_START(AT91CAP9ADK, "Atmel AT91CAP9A-DK") .timer = &at91sam926x_timer, .map_io = at91_map_io, .init_early = cap9adk_init_early, - .init_irq = cap9adk_init_irq, + .init_irq = at91_init_irq_default, .init_machine = cap9adk_board_init,MACHINE_END
arch/arm/mach-at91/board-carmeva.c +1 -6
@@ -57,11 +57,6 @@ static void __init carmeva_init_early(void)at91_set_serial_console (0 ); } -static void __init carmeva_init_irq (void ) -{ -at91rm9200_init_interrupts (NULL ); -} -static struct at91_eth_data __initdata carmeva_eth_data = { .phy_irq_pin =AT91_PIN_PC4 , .is_rmii =1 ,
@@ -165,6 +160,6 @@ MACHINE_START(CARMEVA, "Carmeva") .timer = &at91rm9200_timer, .map_io = at91_map_io, .init_early = carmeva_init_early, - .init_irq = carmeva_init_irq, + .init_irq = at91_init_irq_default, .init_machine = carmeva_board_init,MACHINE_END
arch/arm/mach-at91/board-cpu9krea.c +1 -6
@@ -81,11 +81,6 @@ static void __init cpu9krea_init_early(void)at91_set_serial_console (0 ); } -static void __init cpu9krea_init_irq (void ) -{ -at91sam9260_init_interrupts (NULL ); -} -/* * USB Host port */
@@ -378,6 +373,6 @@ MACHINE_START(CPUAT9G20, "Eukrea CPU9G20") .timer = &at91sam926x_timer, .map_io = at91_map_io, .init_early = cpu9krea_init_early, - .init_irq = cpu9krea_init_irq, + .init_irq = at91_init_irq_default, .init_machine = cpu9krea_board_init,MACHINE_END
arch/arm/mach-at91/board-cpuat91.c +1 -6
@@ -82,11 +82,6 @@ static void __init cpuat91_init_early(void)at91_set_serial_console (0 ); } -static void __init cpuat91_init_irq (void ) -{ -at91rm9200_init_interrupts (NULL ); -} -static struct at91_eth_data __initdata cpuat91_eth_data = { .is_rmii =1 , };
@@ -182,6 +177,6 @@ MACHINE_START(CPUAT91, "Eukrea") .timer = &at91rm9200_timer, .map_io = at91_map_io, .init_early = cpuat91_init_early, - .init_irq = cpuat91_init_irq, + .init_irq = at91_init_irq_default, .init_machine = cpuat91_board_init,MACHINE_END
arch/arm/mach-at91/board-csb337.c +1 -6
@@ -58,11 +58,6 @@ static void __init csb337_init_early(void)at91_set_serial_console (0 ); } -static void __init csb337_init_irq (void ) -{ -at91rm9200_init_interrupts (NULL ); -} -static struct at91_eth_data __initdata csb337_eth_data = { .phy_irq_pin =AT91_PIN_PC2 , .is_rmii =0 ,
@@ -260,6 +255,6 @@ MACHINE_START(CSB337, "Cogent CSB337") .timer = &at91rm9200_timer, .map_io = at91_map_io, .init_early = csb337_init_early, - .init_irq = csb337_init_irq, + .init_irq = at91_init_irq_default, .init_machine = csb337_board_init,MACHINE_END
arch/arm/mach-at91/board-csb637.c +1 -6
@@ -52,11 +52,6 @@ static void __init csb637_init_early(void)at91_set_serial_console (0 ); } -static void __init csb637_init_irq (void ) -{ -at91rm9200_init_interrupts (NULL ); -} -static struct at91_eth_data __initdata csb637_eth_data = { .phy_irq_pin =AT91_PIN_PC0 , .is_rmii =0 ,
@@ -141,6 +136,6 @@ MACHINE_START(CSB637, "Cogent CSB637") .timer = &at91rm9200_timer, .map_io = at91_map_io, .init_early = csb637_init_early, - .init_irq = csb637_init_irq, + .init_irq = at91_init_irq_default, .init_machine = csb637_board_init,MACHINE_END
arch/arm/mach-at91/board-eb9200.c +1 -6
@@ -60,11 +60,6 @@ static void __init eb9200_init_early(void)at91_set_serial_console (0 ); } -static void __init eb9200_init_irq (void ) -{ -at91rm9200_init_interrupts (NULL ); -} -static struct at91_eth_data __initdata eb9200_eth_data = { .phy_irq_pin =AT91_PIN_PC4 , .is_rmii =1 ,
@@ -123,6 +118,6 @@ MACHINE_START(ATEB9200, "Embest ATEB9200") .timer = &at91rm9200_timer, .map_io = at91_map_io, .init_early = eb9200_init_early, - .init_irq = eb9200_init_irq, + .init_irq = at91_init_irq_default, .init_machine = eb9200_board_init,MACHINE_END
arch/arm/mach-at91/board-ecbat91.c +1 -6
@@ -64,11 +64,6 @@ static void __init ecb_at91init_early(void)at91_set_serial_console (0 ); } -static void __init ecb_at91init_irq (void ) -{ -at91rm9200_init_interrupts (NULL ); -} -static struct at91_eth_data __initdata ecb_at91eth_data = { .phy_irq_pin =AT91_PIN_PC4 , .is_rmii =0 ,
@@ -175,6 +170,6 @@ MACHINE_START(ECBAT91, "emQbit's ECB_AT91") .timer = &at91rm9200_timer, .map_io = at91_map_io, .init_early = ecb_at91init_early, - .init_irq = ecb_at91init_irq, + .init_irq = at91_init_irq_default, .init_machine = ecb_at91board_init,MACHINE_END
arch/arm/mach-at91/board-eco920.c +1 -6
@@ -47,11 +47,6 @@ static void __init eco920_init_early(void)at91_set_serial_console (0 ); } -static void __init eco920_init_irq (void ) -{ -at91rm9200_init_interrupts (NULL ); -} -static struct at91_eth_data __initdata eco920_eth_data = { .phy_irq_pin =AT91_PIN_PC2 , .is_rmii =1 ,
@@ -137,6 +132,6 @@ MACHINE_START(ECO920, "eco920") .timer = &at91rm9200_timer, .map_io = at91_map_io, .init_early = eco920_init_early, - .init_irq = eco920_init_irq, + .init_irq = at91_init_irq_default, .init_machine = eco920_board_init,MACHINE_END
arch/arm/mach-at91/board-flexibity.c +1 -6
@@ -49,11 +49,6 @@ static void __init flexibity_init_early(void)at91_set_serial_console (0 ); } -static void __init flexibity_init_irq (void ) -{ -at91sam9260_init_interrupts (NULL ); -} -/* USB Host port */ static struct at91_usbh_data __initdata flexibity_usbh_data = { .ports =2 ,
@@ -157,6 +152,6 @@ MACHINE_START(FLEXIBITY, "Flexibity Connect") .timer = &at91sam926x_timer, .map_io = at91_map_io, .init_early = flexibity_init_early, - .init_irq = flexibity_init_irq, + .init_irq = at91_init_irq_default, .init_machine = flexibity_board_init,MACHINE_END
arch/arm/mach-at91/board-foxg20.c +1 -7
@@ -101,12 +101,6 @@ static void __init foxg20_init_early(void) } -static void __init foxg20_init_irq (void ) -{ -at91sam9260_init_interrupts (NULL ); -} - -/* * USB Host port */
@@ -269,6 +263,6 @@ MACHINE_START(ACMENETUSFOXG20, "Acme Systems srl FOX Board G20") .timer = &at91sam926x_timer, .map_io = at91_map_io, .init_early = foxg20_init_early, - .init_irq = foxg20_init_irq, + .init_irq = at91_init_irq_default, .init_machine = foxg20_board_init,MACHINE_END
arch/arm/mach-at91/board-gsia18s.c +0 -5
@@ -75,11 +75,6 @@ static void __init gsia18s_init_early(void)at91_register_uart (AT91SAM9260_ID_US4 ,5 ,0 ); } -static void __init init_irq (void ) -{ -at91sam9260_init_interrupts (NULL ); -} -/* * Two USB Host ports */
arch/arm/mach-at91/board-kafa.c +1 -6
@@ -61,11 +61,6 @@ static void __init kafa_init_early(void)at91_set_serial_console (0 ); } -static void __init kafa_init_irq (void ) -{ -at91rm9200_init_interrupts (NULL ); -} -static struct at91_eth_data __initdata kafa_eth_data = { .phy_irq_pin =AT91_PIN_PC4 , .is_rmii =0 ,
@@ -101,6 +96,6 @@ MACHINE_START(KAFA, "Sperry-Sun KAFA") .timer = &at91rm9200_timer, .map_io = at91_map_io, .init_early = kafa_init_early, - .init_irq = kafa_init_irq, + .init_irq = at91_init_irq_default, .init_machine = kafa_board_init,MACHINE_END
arch/arm/mach-at91/board-kb9202.c +1 -6
@@ -69,11 +69,6 @@ static void __init kb9202_init_early(void)at91_set_serial_console (0 ); } -static void __init kb9202_init_irq (void ) -{ -at91rm9200_init_interrupts (NULL ); -} -static struct at91_eth_data __initdata kb9202_eth_data = { .phy_irq_pin =AT91_PIN_PB29 , .is_rmii =0 ,
@@ -142,6 +137,6 @@ MACHINE_START(KB9200, "KB920x") .timer = &at91rm9200_timer, .map_io = at91_map_io, .init_early = kb9202_init_early, - .init_irq = kb9202_init_irq, + .init_irq = at91_init_irq_default, .init_machine = kb9202_board_init,MACHINE_END
arch/arm/mach-at91/board-neocore926.c +1 -7
@@ -66,12 +66,6 @@ static void __init neocore926_init_early(void)at91_set_serial_console (0 ); } -static void __init neocore926_init_irq (void ) -{ -at91sam9263_init_interrupts (NULL ); -} - -/* * USB Host port */
@@ -390,6 +384,6 @@ MACHINE_START(NEOCORE926, "ADENEO NEOCORE 926") .timer = &at91sam926x_timer, .map_io = at91_map_io, .init_early = neocore926_init_early, - .init_irq = neocore926_init_irq, + .init_irq = at91_init_irq_default, .init_machine = neocore926_board_init,MACHINE_END
arch/arm/mach-at91/board-pcontrol-g20.c +0 -7
@@ -53,13 +53,6 @@ static void __init pcontrol_g20_init_early(void)at91_register_uart (AT91SAM9260_ID_US4 ,3 ,0 ); } - -static void __init init_irq (void ) -{ -at91sam9260_init_interrupts (NULL ); -} - -static struct sam9_smc_config __initdata pcontrol_smc_config[2 ] = { { .ncs_read_setup =16 , .nrd_setup =18 ,
arch/arm/mach-at91/board-picotux200.c +1 -6
@@ -60,11 +60,6 @@ static void __init picotux200_init_early(void)at91_set_serial_console (0 ); } -static void __init picotux200_init_irq (void ) -{ -at91rm9200_init_interrupts (NULL ); -} -static struct at91_eth_data __initdata picotux200_eth_data = { .phy_irq_pin =AT91_PIN_PC4 , .is_rmii =1 ,
@@ -126,6 +121,6 @@ MACHINE_START(PICOTUX2XX, "picotux 200") .timer = &at91rm9200_timer, .map_io = at91_map_io, .init_early = picotux200_init_early, - .init_irq = picotux200_init_irq, + .init_irq = at91_init_irq_default, .init_machine = picotux200_board_init,MACHINE_END
arch/arm/mach-at91/board-qil-a9260.c +1 -7
@@ -72,12 +72,6 @@ static void __init ek_init_early(void) } -static void __init ek_init_irq (void ) -{ -at91sam9260_init_interrupts (NULL ); -} - -/* * USB Host port */
@@ -271,6 +265,6 @@ MACHINE_START(QIL_A9260, "CALAO QIL_A9260") .timer = &at91sam926x_timer, .map_io = at91_map_io, .init_early = ek_init_early, - .init_irq = ek_init_irq, + .init_irq = at91_init_irq_default, .init_machine = ek_board_init,MACHINE_END
arch/arm/mach-at91/board-rm9200dk.c +1 -6
@@ -65,11 +65,6 @@ static void __init dk_init_early(void)at91_set_serial_console (0 ); } -static void __init dk_init_irq (void ) -{ -at91rm9200_init_interrupts (NULL ); -} -static struct at91_eth_data __initdata dk_eth_data = { .phy_irq_pin =AT91_PIN_PC4 , .is_rmii =1 ,
@@ -230,6 +225,6 @@ MACHINE_START(AT91RM9200DK, "Atmel AT91RM9200-DK") .timer = &at91rm9200_timer, .map_io = at91_map_io, .init_early = dk_init_early, - .init_irq = dk_init_irq, + .init_irq = at91_init_irq_default, .init_machine = dk_board_init,MACHINE_END
arch/arm/mach-at91/board-rm9200ek.c +1 -6
@@ -65,11 +65,6 @@ static void __init ek_init_early(void)at91_set_serial_console (0 ); } -static void __init ek_init_irq (void ) -{ -at91rm9200_init_interrupts (NULL ); -} -static struct at91_eth_data __initdata ek_eth_data = { .phy_irq_pin =AT91_PIN_PC4 , .is_rmii =1 ,
@@ -196,6 +191,6 @@ MACHINE_START(AT91RM9200EK, "Atmel AT91RM9200-EK") .timer = &at91rm9200_timer, .map_io = at91_map_io, .init_early = ek_init_early, - .init_irq = ek_init_irq, + .init_irq = at91_init_irq_default, .init_machine = ek_board_init,MACHINE_END
arch/arm/mach-at91/board-sam9-l9260.c +1 -7
@@ -67,12 +67,6 @@ static void __init ek_init_early(void)at91_set_serial_console (0 ); } -static void __init ek_init_irq (void ) -{ -at91sam9260_init_interrupts (NULL ); -} - -/* * USB Host port */
@@ -215,6 +209,6 @@ MACHINE_START(SAM9_L9260, "Olimex SAM9-L9260") .timer = &at91sam926x_timer, .map_io = at91_map_io, .init_early = ek_init_early, - .init_irq = ek_init_irq, + .init_irq = at91_init_irq_default, .init_machine = ek_board_init,MACHINE_END
arch/arm/mach-at91/board-sam9260ek.c +1 -7
@@ -70,12 +70,6 @@ static void __init ek_init_early(void)at91_set_serial_console (0 ); } -static void __init ek_init_irq (void ) -{ -at91sam9260_init_interrupts (NULL ); -} - -/* * USB Host port */
@@ -356,6 +350,6 @@ MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK") .timer = &at91sam926x_timer, .map_io = at91_map_io, .init_early = ek_init_early, - .init_irq = ek_init_irq, + .init_irq = at91_init_irq_default, .init_machine = ek_board_init,MACHINE_END
arch/arm/mach-at91/board-sam9261ek.c +1 -7
@@ -69,12 +69,6 @@ static void __init ek_init_early(void)at91_set_serial_console (0 ); } -static void __init ek_init_irq (void ) -{ -at91sam9261_init_interrupts (NULL ); -} - -/* * DM9000 ethernet device */
@@ -623,6 +617,6 @@ MACHINE_START(AT91SAM9G10EK, "Atmel AT91SAM9G10-EK") .timer = &at91sam926x_timer, .map_io = at91_map_io, .init_early = ek_init_early, - .init_irq = ek_init_irq, + .init_irq = at91_init_irq_default, .init_machine = ek_board_init,MACHINE_END
arch/arm/mach-at91/board-sam9263ek.c +1 -7
@@ -68,12 +68,6 @@ static void __init ek_init_early(void)at91_set_serial_console (0 ); } -static void __init ek_init_irq (void ) -{ -at91sam9263_init_interrupts (NULL ); -} - -/* * USB Host port */
@@ -454,6 +448,6 @@ MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK") .timer = &at91sam926x_timer, .map_io = at91_map_io, .init_early = ek_init_early, - .init_irq = ek_init_irq, + .init_irq = at91_init_irq_default, .init_machine = ek_board_init,MACHINE_END
arch/arm/mach-at91/board-sam9g20ek.c +2 -8
@@ -81,12 +81,6 @@ static void __init ek_init_early(void)at91_set_serial_console (0 ); } -static void __init ek_init_irq (void ) -{ -at91sam9260_init_interrupts (NULL ); -} - -/* * USB Host port */
@@ -406,7 +400,7 @@ MACHINE_START(AT91SAM9G20EK, "Atmel AT91SAM9G20-EK") .timer = &at91sam926x_timer, .map_io = at91_map_io, .init_early = ek_init_early, - .init_irq = ek_init_irq, + .init_irq = at91_init_irq_default, .init_machine = ek_board_init,MACHINE_END
@@ -415,6 +409,6 @@ MACHINE_START(AT91SAM9G20EK_2MMC, "Atmel AT91SAM9G20-EK 2 MMC Slot Mod") .timer = &at91sam926x_timer, .map_io = at91_map_io, .init_early = ek_init_early, - .init_irq = ek_init_irq, + .init_irq = at91_init_irq_default, .init_machine = ek_board_init,MACHINE_END
arch/arm/mach-at91/board-sam9m10g45ek.c +1 -7
@@ -63,12 +63,6 @@ static void __init ek_init_early(void)at91_set_serial_console (0 ); } -static void __init ek_init_irq (void ) -{ -at91sam9g45_init_interrupts (NULL ); -} - -/* * USB HS Host port (common to OHCI & EHCI) */
@@ -424,6 +418,6 @@ MACHINE_START(AT91SAM9M10G45EK, "Atmel AT91SAM9M10G45-EK") .timer = &at91sam926x_timer, .map_io = at91_map_io, .init_early = ek_init_early, - .init_irq = ek_init_irq, + .init_irq = at91_init_irq_default, .init_machine = ek_board_init,MACHINE_END
arch/arm/mach-at91/board-sam9rlek.c +1 -7
@@ -53,12 +53,6 @@ static void __init ek_init_early(void)at91_set_serial_console (0 ); } -static void __init ek_init_irq (void ) -{ -at91sam9rl_init_interrupts (NULL ); -} - -/* * USB HS Device port */
@@ -332,6 +326,6 @@ MACHINE_START(AT91SAM9RLEK, "Atmel AT91SAM9RL-EK") .timer = &at91sam926x_timer, .map_io = at91_map_io, .init_early = ek_init_early, - .init_irq = ek_init_irq, + .init_irq = at91_init_irq_default, .init_machine = ek_board_init,MACHINE_END
arch/arm/mach-at91/board-snapper9260.c +1 -6
@@ -55,11 +55,6 @@ static void __init snapper9260_init_early(void)at91_register_uart (AT91SAM9260_ID_US2 ,3 ,0 ); } -static void __init snapper9260_init_irq (void ) -{ -at91sam9260_init_interrupts (NULL ); -} -static struct at91_usbh_data __initdata snapper9260_usbh_data = { .ports =2 , };
@@ -181,7 +176,7 @@ MACHINE_START(SNAPPER_9260, "Bluewater Systems Snapper 9260/9G20 module") .timer = &at91sam926x_timer, .map_io = at91_map_io, .init_early = snapper9260_init_early, - .init_irq = snapper9260_init_irq, + .init_irq = at91_init_irq_default, .init_machine = snapper9260_board_init,MACHINE_END
arch/arm/mach-at91/board-stamp9g20.c +0 -6
@@ -76,12 +76,6 @@ static void __init portuxg20_init_early(void)at91_register_uart (AT91SAM9260_ID_US5 ,6 ,0 ); } -static void __init init_irq (void ) -{ -at91sam9260_init_interrupts (NULL ); -} - -/* * NAND flash */
arch/arm/mach-at91/board-usb-a9260.c +1 -7
@@ -60,12 +60,6 @@ static void __init ek_init_early(void)at91_set_serial_console (0 ); } -static void __init ek_init_irq (void ) -{ -at91sam9260_init_interrupts (NULL ); -} - -/* * USB Host port */
@@ -231,6 +225,6 @@ MACHINE_START(USB_A9260, "CALAO USB_A9260") .timer = &at91sam926x_timer, .map_io = at91_map_io, .init_early = ek_init_early, - .init_irq = ek_init_irq, + .init_irq = at91_init_irq_default, .init_machine = ek_board_init,MACHINE_END
arch/arm/mach-at91/board-usb-a9263.c +1 -7
@@ -59,12 +59,6 @@ static void __init ek_init_early(void)at91_set_serial_console (0 ); } -static void __init ek_init_irq (void ) -{ -at91sam9263_init_interrupts (NULL ); -} - -/* * USB Host port */
@@ -247,6 +241,6 @@ MACHINE_START(USB_A9263, "CALAO USB_A9263") .timer = &at91sam926x_timer, .map_io = at91_map_io, .init_early = ek_init_early, - .init_irq = ek_init_irq, + .init_irq = at91_init_irq_default, .init_machine = ek_board_init,MACHINE_END
arch/arm/mach-at91/board-yl-9200.c +1 -7
@@ -79,12 +79,6 @@ static void __init yl9200_init_early(void)at91_set_serial_console (0 ); } -static void __init yl9200_init_irq (void ) -{ -at91rm9200_init_interrupts (NULL ); -} - -/* * LEDs */
@@ -601,6 +595,6 @@ MACHINE_START(YL9200, "uCdragon YL-9200") .timer = &at91rm9200_timer, .map_io = at91_map_io, .init_early = yl9200_init_early, - .init_irq = yl9200_init_irq, + .init_irq = at91_init_irq_default, .init_machine = yl9200_board_init,MACHINE_END
arch/arm/mach-at91/generic.h +2 -7
@@ -19,14 +19,9 @@ extern void __init at91_initialize(unsigned long main_clock);extern void __init at91x40_initialize (unsigned long main_clock);/* Interrupts */ -extern void __init at91rm9200_init_interrupts (unsigned int priority[]); -extern void __init at91sam9260_init_interrupts (unsigned int priority[]); -extern void __init at91sam9261_init_interrupts (unsigned int priority[]); -extern void __init at91sam9263_init_interrupts (unsigned int priority[]); -extern void __init at91sam9rl_init_interrupts (unsigned int priority[]); -extern void __init at91sam9g45_init_interrupts (unsigned int priority[]); +extern void __init at91_init_irq_default (void ); +extern void __init at91_init_interrupts (unsigned int priority[]);extern void __init at91x40_init_interrupts (unsigned int priority[]); -extern void __init at91cap9_init_interrupts (unsigned int priority[]);extern void __init at91_aic_init (unsigned int priority[]);/* Timer */
arch/arm/mach-at91/setup.c +14 -0
@@ -18,6 +18,20 @@struct at91_soc __initdata at91_boot_soc; +void __init at91_init_irq_default (void ) +{ +at91_init_interrupts (at91_boot_soc.default_irq_priority); +} + +void __init at91_init_interrupts (unsigned int *priority) +{ +/* Initialize the AIC interrupt controller */ +at91_aic_init (priority); + +/* Enable GPIO interrupts */ +at91_gpio_irq_setup (); +} +static struct map_desc at91_io_desc__initdata = { .virtual =AT91_VA_BASE_SYS , .pfn =__phys_to_pfn (AT91_BASE_SYS ),
arch/arm/mach-at91/soc.h +1 -0
@@ -5,6 +5,7 @@*/ struct at91_soc { +unsigned int *default_irq_priority;void (*map_io)(void );void (*init)(unsigned long main_clock); };
Signature · 1 line
1.7.4.1
PATCH 2/8 at91: factorize at91 interrupts init to soc
Quoted 5 lines · Jean-Christophe PLAGNIOL-VILLARD
they are the same except the default priority
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc Nicolas Ferre <[email protected]>Cc Patrice Vilchez <[email protected]>
Very nice!
PATCH 2/8 at91: factorize at91 interrupts init to soc
Quoted 8 lines · Arnd Bergmann
Quoted 5 lines · Jean-Christophe PLAGNIOL-VILLARD
they are the same except the default priority
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc Nicolas Ferre <[email protected]>Cc Patrice Vilchez <[email protected]>Very nice!
tks
we can do so because we have detect the soc type :)
Best Regards,
J.
PATCH 2/8 at91: factorize at91 interrupts init to soc
In reply to Jean-Christophe PLAGNIOL-VILLARDQuoted 9 lines · Jean-Christophe PLAGNIOL-VILLARD
they are the same except the default priority
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc Nicolas Ferre <[email protected]>Cc Patrice Vilchez <[email protected]>--- arch/arm/mach-at91/board-gsia18s.c | 5 ----- arch/arm/mach-at91/board-pcontrol-g20.c | 7 ------- arch/arm/mach-at91/board-stamp9g20.c | 6 ------
Aren't you breaking these boards? You remove their init_irq function without updating the machine structure.
PATCH 2/8 at91: factorize at91 interrupts init to soc
Quoted 11 lines · Christian Glindkamp
Quoted 9 lines · Jean-Christophe PLAGNIOL-VILLARD
they are the same except the default priority
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc Nicolas Ferre <[email protected]>Cc Patrice Vilchez <[email protected]>--- arch/arm/mach-at91/board-gsia18s.c | 5 ----- arch/arm/mach-at91/board-pcontrol-g20.c | 7 ------- arch/arm/mach-at91/board-stamp9g20.c | 6 ------
Quoted 2 lines
Aren't you breaking these boards? You remove their
init_irqfunction without updating the machine structure.
good catch
Best Regards,
J.
PATCH 3/8 at91: remove AT91_DBGU offset from dbgu register macro
In reply to Jean-Christophe PLAGNIOL-VILLARD--- arch/arm/mach-at91/at91sam9260.c | 2 +- arch/arm/mach-at91/at91sam9rl.c | 2 +- arch/arm/mach-at91/include/mach/at91_dbgu.h | 27 +++++++++++++----------- arch/arm/mach-at91/include/mach/cpu.h | 8 +++--- arch/arm/mach-at91/include/mach/debug-macro.S | 14 ++++++------ 5 files changed, 28 insertions(+), 25 deletions(-)
arch/arm/mach-at91/at91sam9260.c +1 -1
@@ -324,7 +324,7 @@ static void __init at91sam9xe_map_io(void) {unsigned long cidr, sram_size; - cidr =at91_sys_read (AT91_DBGU_CIDR ); + cidr =dbgu_readl (AT91_DBGU ,CIDR );switch (cidr &AT91_CIDR_SRAMSIZ ) {case AT91_CIDR_SRAMSIZ_32K :
arch/arm/mach-at91/at91sam9rl.c +1 -1
@@ -283,7 +283,7 @@ static void __init at91sam9rl_map_io(void) {unsigned long cidr, sram_size; - cidr =at91_sys_read (AT91_DBGU_CIDR ); + cidr =dbgu_readl (AT91_DBGU ,CIDR );switch (cidr &AT91_CIDR_SRAMSIZ ) {case AT91_CIDR_SRAMSIZ_32K :
arch/arm/mach-at91/include/mach/at91_dbgu.h +15 -12
@@ -16,22 +16,25 @@#ifndef AT91_DBGU_H #define AT91_DBGU_H +#define dbgu_readl (dbgu, field) \ + __raw_readl(AT91_VA_BASE_SYS + dbgu + AT91_DBGU_ ## field) +#ifdef AT91_DBGU -#define AT91_DBGU_CR (AT91_DBGU + 0x00)/* Control Register */ -#define AT91_DBGU_MR (AT91_DBGU + 0x04)/* Mode Register */ -#define AT91_DBGU_IER (AT91_DBGU + 0x08)/* Interrupt Enable Register */ +#define AT91_DBGU_CR (0x00)/* Control Register */ +#define AT91_DBGU_MR (0x04)/* Mode Register */ +#define AT91_DBGU_IER (0x08)/* Interrupt Enable Register */ #define AT91_DBGU_TXRDY (1 << 1)/* Transmitter Ready */ #define AT91_DBGU_TXEMPTY (1 << 9)/* Transmitter Empty */ -#define AT91_DBGU_IDR (AT91_DBGU + 0x0c)/* Interrupt Disable Register */ -#define AT91_DBGU_IMR (AT91_DBGU + 0x10)/* Interrupt Mask Register */ -#define AT91_DBGU_SR (AT91_DBGU + 0x14)/* Status Register */ -#define AT91_DBGU_RHR (AT91_DBGU + 0x18)/* Receiver Holding Register */ -#define AT91_DBGU_THR (AT91_DBGU + 0x1c)/* Transmitter Holding Register */ -#define AT91_DBGU_BRGR (AT91_DBGU + 0x20)/* Baud Rate Generator Register */ +#define AT91_DBGU_IDR (0x0c)/* Interrupt Disable Register */ +#define AT91_DBGU_IMR (0x10)/* Interrupt Mask Register */ +#define AT91_DBGU_SR (0x14)/* Status Register */ +#define AT91_DBGU_RHR (0x18)/* Receiver Holding Register */ +#define AT91_DBGU_THR (0x1c)/* Transmitter Holding Register */ +#define AT91_DBGU_BRGR (0x20)/* Baud Rate Generator Register */ -#define AT91_DBGU_CIDR (AT91_DBGU + 0x40)/* Chip ID Register */ -#define AT91_DBGU_EXID (AT91_DBGU + 0x44)/* Chip ID Extension Register */ -#define AT91_DBGU_FNR (AT91_DBGU + 0x48)/* Force NTRST Register [SAM9 only] */ +#define AT91_DBGU_CIDR (0x40)/* Chip ID Register */ +#define AT91_DBGU_EXID (0x44)/* Chip ID Extension Register */ +#define AT91_DBGU_FNR (0x48)/* Force NTRST Register [SAM9 only] */ #define AT91_DBGU_FNTRST (1 << 0)/* Force NTRST */ #endif /* AT91_DBGU */
arch/arm/mach-at91/include/mach/cpu.h +4 -4
@@ -41,12 +41,12 @@static inline unsigned long at91_cpu_identify (void ) { -return (at91_sys_read (AT91_DBGU_CIDR ) & ~AT91_CIDR_VERSION ); +return (dbgu_readl (AT91_DBGU ,CIDR ) & ~AT91_CIDR_VERSION ); }static inline unsigned long at91_cpu_fully_identify (void ) { -return at91_sys_read (AT91_DBGU_CIDR ); +return dbgu_readl (AT91_DBGU ,CIDR ); }#define ARCH_EXID_AT91SAM9M11 0x00000001
@@ -62,7 +62,7 @@ static inline unsigned long at91_cpu_fully_identify(void)static inline unsigned long at91_exid_identify (void ) { -return at91_sys_read (AT91_DBGU_EXID ); +return dbgu_readl (AT91_DBGU ,EXID ); }
@@ -72,7 +72,7 @@ static inline unsigned long at91_exid_identify(void)static inline unsigned long at91_arch_identify (void ) { -return (at91_sys_read (AT91_DBGU_CIDR ) &AT91_CIDR_ARCH ); +return (dbgu_readl (AT91_DBGU ,CIDR ) &AT91_CIDR_ARCH ); }#ifdef CONFIG_ARCH_AT91CAP9
arch/arm/mach-at91/include/mach/debug-macro.S +7 -7
@@ -15,23 +15,23 @@ #include <mach/at91_dbgu.h> .macro addruart, rp, rv - ldr \rp, =(AT91_BASE_SYS + AT91_DBGU) @ System peripherals (phys address) - ldr \rv, =(AT91_VA_BASE_SYS + AT91_DBGU) @ System peripherals (virt address) + ldr \rp, =(AT91_BASE_SYS + AT91_DBGU) @ System peripherals (phys address) + ldr \rv, =(AT91_VA_BASE_SYS + AT91_DBGU) @ System peripherals (virt address) .endm .macro senduart,rd,rx - strb \rd, [\rx, #(AT91_DBGU_THR - AT91_DBGU)] @ Write to Transmitter Holding Register + strb \rd, [\rx, #(AT91_DBGU_THR)] @ Write to Transmitter Holding Register .endm .macro waituart,rd,rx -1001: ldr \rd, [\rx, #(AT91_DBGU_SR - AT91_DBGU)] @ Read Status Register - tst \rd, #AT91_DBGU_TXRDY @ DBGU_TXRDY = 1 when ready to transmit +1001: ldr \rd, [\rx, #(AT91_DBGU_SR)] @ Read Status Register + tst \rd, #AT91_DBGU_TXRDY @ DBGU_TXRDY = 1 when ready to transmit beq 1001b .endm .macro busyuart,rd,rx -1001: ldr \rd, [\rx, #(AT91_DBGU_SR - AT91_DBGU)] @ Read Status Register - tst \rd, #AT91_DBGU_TXEMPTY @ DBGU_TXEMPTY = 1 when transmission complete +1001: ldr \rd, [\rx, #(AT91_DBGU_SR)] @ Read Status Register + tst \rd, #AT91_DBGU_TXEMPTY @ DBGU_TXEMPTY = 1 when transmission complete beq 1001b .endm
Signature · 1 line
1.7.4.1
PATCH 3/8 at91: remove AT91_DBGU offset from dbgu register macro
Quoted 1 line · Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
Please add a changelog that describes why you do this. The old code looks just as well as the new one.
Arnd
PATCH v2 3/8 at91: remove AT91_DBGU offset from dbgu register macro
In reply to Jean-Christophe PLAGNIOL-VILLARDto make the soc base specified at runtime instead of compiled time
---
v2:
update commit
Best Regards,
J.
arch/arm/mach-at91/at91sam9260.c | 2 +- arch/arm/mach-at91/at91sam9rl.c | 2 +- arch/arm/mach-at91/include/mach/at91_dbgu.h | 27 +++++++++++++----------- arch/arm/mach-at91/include/mach/cpu.h | 8 +++--- arch/arm/mach-at91/include/mach/debug-macro.S | 14 ++++++------ 5 files changed, 28 insertions(+), 25 deletions(-)
arch/arm/mach-at91/at91sam9260.c +1 -1
@@ -324,7 +324,7 @@ static void __init at91sam9xe_map_io(void) {unsigned long cidr, sram_size; - cidr =at91_sys_read (AT91_DBGU_CIDR ); + cidr =dbgu_readl (AT91_DBGU ,CIDR );switch (cidr &AT91_CIDR_SRAMSIZ ) {case AT91_CIDR_SRAMSIZ_32K :
arch/arm/mach-at91/at91sam9rl.c +1 -1
@@ -283,7 +283,7 @@ static void __init at91sam9rl_map_io(void) {unsigned long cidr, sram_size; - cidr =at91_sys_read (AT91_DBGU_CIDR ); + cidr =dbgu_readl (AT91_DBGU ,CIDR );switch (cidr &AT91_CIDR_SRAMSIZ ) {case AT91_CIDR_SRAMSIZ_32K :
arch/arm/mach-at91/include/mach/at91_dbgu.h +15 -12
@@ -16,22 +16,25 @@#ifndef AT91_DBGU_H #define AT91_DBGU_H +#define dbgu_readl (dbgu, field) \ + __raw_readl(AT91_VA_BASE_SYS + dbgu + AT91_DBGU_ ## field) +#ifdef AT91_DBGU -#define AT91_DBGU_CR (AT91_DBGU + 0x00)/* Control Register */ -#define AT91_DBGU_MR (AT91_DBGU + 0x04)/* Mode Register */ -#define AT91_DBGU_IER (AT91_DBGU + 0x08)/* Interrupt Enable Register */ +#define AT91_DBGU_CR (0x00)/* Control Register */ +#define AT91_DBGU_MR (0x04)/* Mode Register */ +#define AT91_DBGU_IER (0x08)/* Interrupt Enable Register */ #define AT91_DBGU_TXRDY (1 << 1)/* Transmitter Ready */ #define AT91_DBGU_TXEMPTY (1 << 9)/* Transmitter Empty */ -#define AT91_DBGU_IDR (AT91_DBGU + 0x0c)/* Interrupt Disable Register */ -#define AT91_DBGU_IMR (AT91_DBGU + 0x10)/* Interrupt Mask Register */ -#define AT91_DBGU_SR (AT91_DBGU + 0x14)/* Status Register */ -#define AT91_DBGU_RHR (AT91_DBGU + 0x18)/* Receiver Holding Register */ -#define AT91_DBGU_THR (AT91_DBGU + 0x1c)/* Transmitter Holding Register */ -#define AT91_DBGU_BRGR (AT91_DBGU + 0x20)/* Baud Rate Generator Register */ +#define AT91_DBGU_IDR (0x0c)/* Interrupt Disable Register */ +#define AT91_DBGU_IMR (0x10)/* Interrupt Mask Register */ +#define AT91_DBGU_SR (0x14)/* Status Register */ +#define AT91_DBGU_RHR (0x18)/* Receiver Holding Register */ +#define AT91_DBGU_THR (0x1c)/* Transmitter Holding Register */ +#define AT91_DBGU_BRGR (0x20)/* Baud Rate Generator Register */ -#define AT91_DBGU_CIDR (AT91_DBGU + 0x40)/* Chip ID Register */ -#define AT91_DBGU_EXID (AT91_DBGU + 0x44)/* Chip ID Extension Register */ -#define AT91_DBGU_FNR (AT91_DBGU + 0x48)/* Force NTRST Register [SAM9 only] */ +#define AT91_DBGU_CIDR (0x40)/* Chip ID Register */ +#define AT91_DBGU_EXID (0x44)/* Chip ID Extension Register */ +#define AT91_DBGU_FNR (0x48)/* Force NTRST Register [SAM9 only] */ #define AT91_DBGU_FNTRST (1 << 0)/* Force NTRST */ #endif /* AT91_DBGU */
arch/arm/mach-at91/include/mach/cpu.h +4 -4
@@ -41,12 +41,12 @@static inline unsigned long at91_cpu_identify (void ) { -return (at91_sys_read (AT91_DBGU_CIDR ) & ~AT91_CIDR_VERSION ); +return (dbgu_readl (AT91_DBGU ,CIDR ) & ~AT91_CIDR_VERSION ); }static inline unsigned long at91_cpu_fully_identify (void ) { -return at91_sys_read (AT91_DBGU_CIDR ); +return dbgu_readl (AT91_DBGU ,CIDR ); }#define ARCH_EXID_AT91SAM9M11 0x00000001
@@ -62,7 +62,7 @@ static inline unsigned long at91_cpu_fully_identify(void)static inline unsigned long at91_exid_identify (void ) { -return at91_sys_read (AT91_DBGU_EXID ); +return dbgu_readl (AT91_DBGU ,EXID ); }
@@ -72,7 +72,7 @@ static inline unsigned long at91_exid_identify(void)static inline unsigned long at91_arch_identify (void ) { -return (at91_sys_read (AT91_DBGU_CIDR ) &AT91_CIDR_ARCH ); +return (dbgu_readl (AT91_DBGU ,CIDR ) &AT91_CIDR_ARCH ); }#ifdef CONFIG_ARCH_AT91CAP9
arch/arm/mach-at91/include/mach/debug-macro.S +7 -7
@@ -15,23 +15,23 @@ #include <mach/at91_dbgu.h> .macro addruart, rp, rv - ldr \rp, =(AT91_BASE_SYS + AT91_DBGU) @ System peripherals (phys address) - ldr \rv, =(AT91_VA_BASE_SYS + AT91_DBGU) @ System peripherals (virt address) + ldr \rp, =(AT91_BASE_SYS + AT91_DBGU) @ System peripherals (phys address) + ldr \rv, =(AT91_VA_BASE_SYS + AT91_DBGU) @ System peripherals (virt address) .endm .macro senduart,rd,rx - strb \rd, [\rx, #(AT91_DBGU_THR - AT91_DBGU)] @ Write to Transmitter Holding Register + strb \rd, [\rx, #(AT91_DBGU_THR)] @ Write to Transmitter Holding Register .endm .macro waituart,rd,rx -1001: ldr \rd, [\rx, #(AT91_DBGU_SR - AT91_DBGU)] @ Read Status Register - tst \rd, #AT91_DBGU_TXRDY @ DBGU_TXRDY = 1 when ready to transmit +1001: ldr \rd, [\rx, #(AT91_DBGU_SR)] @ Read Status Register + tst \rd, #AT91_DBGU_TXRDY @ DBGU_TXRDY = 1 when ready to transmit beq 1001b .endm .macro busyuart,rd,rx -1001: ldr \rd, [\rx, #(AT91_DBGU_SR - AT91_DBGU)] @ Read Status Register - tst \rd, #AT91_DBGU_TXEMPTY @ DBGU_TXEMPTY = 1 when transmission complete +1001: ldr \rd, [\rx, #(AT91_DBGU_SR)] @ Read Status Register + tst \rd, #AT91_DBGU_TXEMPTY @ DBGU_TXEMPTY = 1 when transmission complete beq 1001b .endm
Signature · 1 line
1.7.5.4
PATCH 4/8 at91: use structure to store the current soc
In reply to Jean-Christophe PLAGNIOL-VILLARDinstead of reading the registers everytime
the current implementation respect the following constrain:
- allow 1 to n soc to be enabled
- allow to have a virtual cpu type and subtype
- always detect the cpu type and subtype and report it
- detect if the soc support is enabled
- prepare for sysfs export support
- drop soc specific code via compiler when the soc not enabled (via cpu_is_xxx)
Today if we read the exid we will have the same value for 9g35 and 9m11 and we will need to check the cidr too
with the new implementation we just need to check the soc subtype
this will also allow to have specific virtual subtype for rm9200 which the board will have to specify via at91rm9200_set_type(int) as we have no way to detect it.
this implementation is inspired by the SH cpu detection support
--- arch/arm/mach-at91/at91cap9.c | 2 +- arch/arm/mach-at91/at91rm9200.c | 10 +-- arch/arm/mach-at91/at91sam9260.c | 9 +- arch/arm/mach-at91/at91sam9261.c | 2 +- arch/arm/mach-at91/at91sam9263.c | 2 +- arch/arm/mach-at91/at91sam9g45.c | 2 +- arch/arm/mach-at91/at91sam9rl.c | 9 +- arch/arm/mach-at91/include/mach/cpu.h | 159 ++++++++++++++----------- arch/arm/mach-at91/setup.c | 209 ++++++++++++++++++++++++++++++--- arch/arm/mach-at91/soc.h | 79 +++++++++---- 10 files changed, 352 insertions(+), 131 deletions(-)
rewrite arch/arm/mach-at91/soc.h (63%)
arch/arm/mach-at91/at91cap9.c +1 -1
@@ -403,7 +403,7 @@ static unsigned int at91cap9_default_irq_priority[NR_AIC_IRQS] __initdata = { 0, /* Advanced Interrupt Controller (IRQ1) */ }; -struct at91_soc __initdata at91cap9_soc = { +struct at91_init_soc __initdata at91cap9_soc = { .map_io = at91cap9_map_io, .default_irq_priority = at91cap9_default_irq_priority, .init = at91cap9_initialize,
arch/arm/mach-at91/at91rm9200.c +1 -9
@@ -300,14 +300,6 @@ static void at91rm9200_reset(void)at91_sys_write (AT91_ST_CR ,AT91_ST_WDRST ); } -int rm9200_type; -EXPORT_SYMBOL (rm9200_type); - -void __init at91rm9200_set_type (int type) -{ - rm9200_type = type; -} -/* -------------------------------------------------------------------- * AT91RM9200 processor initialization * -------------------------------------------------------------------- */
@@ -379,7 +371,7 @@ static unsigned int at91rm9200_default_irq_priority[NR_AIC_IRQS] __initdata = {0 /* Advanced Interrupt Controller (IRQ6) */ }; -struct at91_soc __initdata at91rm9200_soc = { +struct at91_init_soc __initdata at91rm9200_soc = { .map_io = at91rm9200_map_io, .default_irq_priority = at91rm9200_default_irq_priority, .init = at91rm9200_initialize,
arch/arm/mach-at91/at91sam9260.c +4 -5
@@ -17,6 +17,7 @@#include <asm/mach/arch.h> #include <asm/mach/map.h> #include <mach/cpu.h> +#include <mach/at91_dbgu.h> #include <mach/at91sam9260.h> #include <mach/at91_pmc.h> #include <mach/at91_rstc.h>
@@ -322,11 +323,9 @@ static void at91sam9260_poweroff(void)static void __init at91sam9xe_map_io (void ) { -unsigned long cidr, sram_size; +unsigned long sram_size; - cidr =dbgu_readl (AT91_DBGU ,CIDR ); - -switch (cidr &AT91_CIDR_SRAMSIZ ) { +switch (at91_soc_initdata.cidr &AT91_CIDR_SRAMSIZ ) {case AT91_CIDR_SRAMSIZ_32K : sram_size =2 *SZ_16K ;break ;
@@ -410,7 +409,7 @@ static unsigned int at91sam9260_default_irq_priority[NR_AIC_IRQS] __initdata = { 0, /* Advanced Interrupt Controller */ }; -struct at91_soc __initdata at91sam9260_soc = { +struct at91_init_soc __initdata at91sam9260_soc = { .map_io = at91sam9260_map_io, .default_irq_priority = at91sam9260_default_irq_priority, .init = at91sam9260_initialize,
arch/arm/mach-at91/at91sam9261.c +1 -1
@@ -361,7 +361,7 @@ static unsigned int at91sam9261_default_irq_priority[NR_AIC_IRQS] __initdata = { 0, /* Advanced Interrupt Controller */ }; -struct at91_soc __initdata at91sam9261_soc = { +struct at91_init_soc __initdata at91sam9261_soc = { .map_io = at91sam9261_map_io, .default_irq_priority = at91sam9261_default_irq_priority, .init = at91sam9261_initialize,
arch/arm/mach-at91/at91sam9263.c +1 -1
@@ -372,7 +372,7 @@ static unsigned int at91sam9263_default_irq_priority[NR_AIC_IRQS] __initdata = { 0, /* Advanced Interrupt Controller (IRQ1) */ }; -struct at91_soc __initdata at91sam9263_soc = { +struct at91_init_soc __initdata at91sam9263_soc = { .map_io = at91sam9263_map_io, .default_irq_priority = at91sam9263_default_irq_priority, .init = at91sam9263_initialize,
arch/arm/mach-at91/at91sam9g45.c +1 -1
@@ -388,7 +388,7 @@ static unsigned int at91sam9g45_default_irq_priority[NR_AIC_IRQS] __initdata = { 0, /* Advanced Interrupt Controller (IRQ0) */ }; -struct at91_soc __initdata at91sam9g45_soc = { +struct at91_init_soc __initdata at91sam9g45_soc = { .map_io = at91sam9g45_map_io, .default_irq_priority = at91sam9g45_default_irq_priority, .init = at91sam9g45_initialize,
arch/arm/mach-at91/at91sam9rl.c +4 -5
@@ -16,6 +16,7 @@#include <asm/mach/arch.h> #include <asm/mach/map.h> #include <mach/cpu.h> +#include <mach/at91_dbgu.h> #include <mach/at91sam9rl.h> #include <mach/at91_pmc.h> #include <mach/at91_rstc.h>
@@ -281,11 +282,9 @@ static void at91sam9rl_poweroff(void)static void __init at91sam9rl_map_io (void ) { -unsigned long cidr, sram_size; +unsigned long sram_size; - cidr =dbgu_readl (AT91_DBGU ,CIDR ); - -switch (cidr &AT91_CIDR_SRAMSIZ ) { +switch (at91_soc_initdata.cidr &AT91_CIDR_SRAMSIZ ) {case AT91_CIDR_SRAMSIZ_32K : sram_size =2 *SZ_16K ;break ;
@@ -359,7 +358,7 @@ static unsigned int at91sam9rl_default_irq_priority[NR_AIC_IRQS] __initdata = { 0, /* Advanced Interrupt Controller */ }; -struct at91_soc __initdata at91sam9rl_soc = { +struct at91_init_soc __initdata at91sam9rl_soc = { .map_io = at91sam9rl_map_io, .default_irq_priority = at91sam9rl_default_irq_priority, .init = at91sam9rl_initialize,
arch/arm/mach-at91/include/mach/cpu.h +89 -70
246 lines not on this page · raw message
arch/arm/mach-at91/setup.c +192 -17
236 lines not on this page · raw message
arch/arm/mach-at91/soc.h +58 -21
79 lines not on this page · raw message
Signature · 1 line
1.7.4.1
PATCH 5/8 at91: move clock subsystem init to soc generic init
In reply to Jean-Christophe PLAGNIOL-VILLARD--- arch/arm/mach-at91/at91cap9.c | 6 ++---- arch/arm/mach-at91/at91rm9200.c | 5 +---- arch/arm/mach-at91/at91sam9260.c | 5 +---- arch/arm/mach-at91/at91sam9261.c | 5 +---- arch/arm/mach-at91/at91sam9263.c | 5 +---- arch/arm/mach-at91/at91sam9g45.c | 5 +---- arch/arm/mach-at91/at91sam9rl.c | 5 +---- arch/arm/mach-at91/generic.h | 6 +++++- arch/arm/mach-at91/setup.c | 5 ++++- arch/arm/mach-at91/soc.h | 2 +- 10 files changed, 18 insertions(+), 31 deletions(-)
arch/arm/mach-at91/at91cap9.c +2 -4
@@ -340,14 +340,12 @@ static void __init at91cap9_map_io(void)iotable_init (at91cap9_sram_desc,ARRAY_SIZE (at91cap9_sram_desc)); } -static void __init at91cap9_initialize (unsigned long main_clock) +static void __init at91cap9_initialize (void ) +{ at91_arch_reset = at91cap9_reset; pm_power_off = at91cap9_poweroff; at91_extern_irq = (1 <<AT91CAP9_ID_IRQ0 ) | (1 <<AT91CAP9_ID_IRQ1 ); -/* Init clock subsystem */ -at91_clock_init (main_clock); -/* Register the processor-specific clocks */ at91cap9_register_clocks ();
arch/arm/mach-at91/at91rm9200.c +1 -4
@@ -309,7 +309,7 @@ static void __init at91rm9200_map_io(void)iotable_init (at91rm9200_io_desc,ARRAY_SIZE (at91rm9200_io_desc)); } -static void __init at91rm9200_initialize (unsigned long main_clock) +static void __init at91rm9200_initialize (void ) { at91_arch_reset = at91rm9200_reset; at91_extern_irq = (1 <<AT91RM9200_ID_IRQ0 ) | (1 <<AT91RM9200_ID_IRQ1 )
@@ -317,9 +317,6 @@ static void __init at91rm9200_initialize(unsigned long main_clock) | (1 << AT91RM9200_ID_IRQ4) | (1 << AT91RM9200_ID_IRQ5) | (1 <<AT91RM9200_ID_IRQ6 ); -/* Init clock subsystem */ -at91_clock_init (main_clock); -/* Register the processor-specific clocks */ at91rm9200_register_clocks ();
arch/arm/mach-at91/at91sam9260.c +1 -4
@@ -350,16 +350,13 @@ static void __init at91sam9260_map_io(void)iotable_init (at91sam9260_sram_desc,ARRAY_SIZE (at91sam9260_sram_desc)); } -static void __init at91sam9260_initialize (unsigned long main_clock) +static void __init at91sam9260_initialize (void ) { at91_arch_reset = at91sam9_alt_reset; pm_power_off = at91sam9260_poweroff; at91_extern_irq = (1 <<AT91SAM9260_ID_IRQ0 ) | (1 <<AT91SAM9260_ID_IRQ1 ) | (1 <<AT91SAM9260_ID_IRQ2 ); -/* Init clock subsystem */ -at91_clock_init (main_clock); -/* Register the processor-specific clocks */ at91sam9260_register_clocks ();
arch/arm/mach-at91/at91sam9261.c +1 -4
@@ -302,16 +302,13 @@ static void __init at91sam9261_map_io(void)iotable_init (at91sam9261_sram_desc,ARRAY_SIZE (at91sam9261_sram_desc)); } -static void __init at91sam9261_initialize (unsigned long main_clock) +static void __init at91sam9261_initialize (void ) { at91_arch_reset = at91sam9_alt_reset; pm_power_off = at91sam9261_poweroff; at91_extern_irq = (1 <<AT91SAM9261_ID_IRQ0 ) | (1 <<AT91SAM9261_ID_IRQ1 ) | (1 <<AT91SAM9261_ID_IRQ2 ); -/* Init clock subsystem */ -at91_clock_init (main_clock); -/* Register the processor-specific clocks */ at91sam9261_register_clocks ();
arch/arm/mach-at91/at91sam9263.c +1 -4
@@ -314,15 +314,12 @@ static void __init at91sam9263_map_io(void)iotable_init (at91sam9263_sram_desc,ARRAY_SIZE (at91sam9263_sram_desc)); } -static void __init at91sam9263_initialize (unsigned long main_clock) +static void __init at91sam9263_initialize (void ) { at91_arch_reset = at91sam9_alt_reset; pm_power_off = at91sam9263_poweroff; at91_extern_irq = (1 <<AT91SAM9263_ID_IRQ0 ) | (1 <<AT91SAM9263_ID_IRQ1 ); -/* Init clock subsystem */ -at91_clock_init (main_clock); -/* Register the processor-specific clocks */ at91sam9263_register_clocks ();
arch/arm/mach-at91/at91sam9g45.c +1 -4
@@ -330,15 +330,12 @@ static void __init at91sam9g45_map_io(void)iotable_init (at91sam9g45_sram_desc,ARRAY_SIZE (at91sam9g45_sram_desc)); } -static void __init at91sam9g45_initialize (unsigned long main_clock) +static void __init at91sam9g45_initialize (void ) { at91_arch_reset = at91sam9g45_reset; pm_power_off = at91sam9g45_poweroff; at91_extern_irq = (1 <<AT91SAM9G45_ID_IRQ0 ); -/* Init clock subsystem */ -at91_clock_init (main_clock); -/* Register the processor-specific clocks */ at91sam9g45_register_clocks ();
arch/arm/mach-at91/at91sam9rl.c +1 -4
@@ -300,15 +300,12 @@ static void __init at91sam9rl_map_io(void)iotable_init (at91sam9rl_sram_desc,ARRAY_SIZE (at91sam9rl_sram_desc)); } -static void __init at91sam9rl_initialize (unsigned long main_clock) +static void __init at91sam9rl_initialize (void ) { at91_arch_reset = at91sam9_alt_reset; pm_power_off = at91sam9rl_poweroff; at91_extern_irq = (1 <<AT91SAM9RL_ID_IRQ0 ); -/* Init clock subsystem */ -at91_clock_init (main_clock); -/* Register the processor-specific clocks */ at91sam9rl_register_clocks ();
arch/arm/mach-at91/generic.h +5 -1
@@ -31,7 +31,6 @@ extern struct sys_timer at91sam926x_timer;extern struct sys_timer at91x40_timer;/* Clocks */ -extern int __init at91_clock_init (unsigned long main_clock);/* * function to specify the clock of the default console. As we do not * use the device/driver bus, the dev_name is not intialize. So we need
@@ -44,6 +43,11 @@ extern void __init at91sam9263_set_console_clock(int id);extern void __init at91sam9rl_set_console_clock (int id);extern void __init at91sam9g45_set_console_clock (int id);extern void __init at91cap9_set_console_clock (int id); +#ifdef CONFIG_AT91_PMC_UNIT +extern int __init at91_clock_init (unsigned long main_clock); +#else +static int inline at91_clock_init (unsigned long main_clock) {return 0 ; } +#endif struct device ;/* Power Management */
arch/arm/mach-at91/setup.c +4 -1
@@ -248,5 +248,8 @@ void __init at91_map_io(void)void __init at91_initialize (unsigned long main_clock) { - at91_boot_soc.init (main_clock); +/* Init clock subsystem */ +at91_clock_init (main_clock); + + at91_boot_soc.init (); }
arch/arm/mach-at91/soc.h +1 -1
@@ -7,7 +7,7 @@struct at91_init_soc {unsigned int *default_irq_priority;void (*map_io)(void ); -void (*init)(unsigned long main_clock); +void (*init)(void ); };extern struct at91_init_soc at91_boot_soc;
Signature · 1 line
1.7.4.1
PATCH 6/8 at91: move register clocks to soc generic init
In reply to Jean-Christophe PLAGNIOL-VILLARD--- arch/arm/mach-at91/at91cap9.c | 4 +--- arch/arm/mach-at91/at91rm9200.c | 4 +--- arch/arm/mach-at91/at91sam9260.c | 4 +--- arch/arm/mach-at91/at91sam9261.c | 4 +--- arch/arm/mach-at91/at91sam9263.c | 4 +--- arch/arm/mach-at91/at91sam9g45.c | 4 +--- arch/arm/mach-at91/at91sam9rl.c | 4 +--- arch/arm/mach-at91/setup.c | 3 +++ arch/arm/mach-at91/soc.h | 1 + 9 files changed, 11 insertions(+), 21 deletions(-)
arch/arm/mach-at91/at91cap9.c +1 -3
@@ -346,9 +346,6 @@ static void __init at91cap9_initialize(void) pm_power_off = at91cap9_poweroff; at91_extern_irq = (1 <<AT91CAP9_ID_IRQ0 ) | (1 <<AT91CAP9_ID_IRQ1 ); -/* Register the processor-specific clocks */ -at91cap9_register_clocks (); -/* Register GPIO subsystem */ at91_gpio_init (at91cap9_gpio,4 );
@@ -404,5 +401,6 @@ static unsigned int at91cap9_default_irq_priority[NR_AIC_IRQS] __initdata = {struct at91_init_soc __initdata at91cap9_soc = { .map_io = at91cap9_map_io, .default_irq_priority = at91cap9_default_irq_priority, + .register_clocks = at91cap9_register_clocks, .init = at91cap9_initialize, };
arch/arm/mach-at91/at91rm9200.c +1 -3
@@ -317,9 +317,6 @@ static void __init at91rm9200_initialize(void) | (1 << AT91RM9200_ID_IRQ4) | (1 << AT91RM9200_ID_IRQ5) | (1 <<AT91RM9200_ID_IRQ6 ); -/* Register the processor-specific clocks */ -at91rm9200_register_clocks (); -/* Initialize GPIO subsystem */ at91_gpio_init (at91rm9200_gpio,cpu_is_at91rm9200_bga () ?AT91RM9200_BGA :AT91RM9200_PQFP );
@@ -371,5 +368,6 @@ static unsigned int at91rm9200_default_irq_priority[NR_AIC_IRQS] __initdata = {struct at91_init_soc __initdata at91rm9200_soc = { .map_io = at91rm9200_map_io, .default_irq_priority = at91rm9200_default_irq_priority, + .register_clocks = at91rm9200_register_clocks, .init = at91rm9200_initialize, };
arch/arm/mach-at91/at91sam9260.c +1 -3
@@ -357,9 +357,6 @@ static void __init at91sam9260_initialize(void) at91_extern_irq = (1 <<AT91SAM9260_ID_IRQ0 ) | (1 <<AT91SAM9260_ID_IRQ1 ) | (1 <<AT91SAM9260_ID_IRQ2 ); -/* Register the processor-specific clocks */ -at91sam9260_register_clocks (); -/* Register GPIO subsystem */ at91_gpio_init (at91sam9260_gpio,3 ); }
@@ -409,5 +406,6 @@ static unsigned int at91sam9260_default_irq_priority[NR_AIC_IRQS] __initdata = {struct at91_init_soc __initdata at91sam9260_soc = { .map_io = at91sam9260_map_io, .default_irq_priority = at91sam9260_default_irq_priority, + .register_clocks = at91sam9260_register_clocks, .init = at91sam9260_initialize, };
arch/arm/mach-at91/at91sam9261.c +1 -3
@@ -309,9 +309,6 @@ static void __init at91sam9261_initialize(void) at91_extern_irq = (1 <<AT91SAM9261_ID_IRQ0 ) | (1 <<AT91SAM9261_ID_IRQ1 ) | (1 <<AT91SAM9261_ID_IRQ2 ); -/* Register the processor-specific clocks */ -at91sam9261_register_clocks (); -/* Register GPIO subsystem */ at91_gpio_init (at91sam9261_gpio,3 ); }
@@ -361,5 +358,6 @@ static unsigned int at91sam9261_default_irq_priority[NR_AIC_IRQS] __initdata = {struct at91_init_soc __initdata at91sam9261_soc = { .map_io = at91sam9261_map_io, .default_irq_priority = at91sam9261_default_irq_priority, + .register_clocks = at91sam9261_register_clocks, .init = at91sam9261_initialize, };
arch/arm/mach-at91/at91sam9263.c +1 -3
@@ -320,9 +320,6 @@ static void __init at91sam9263_initialize(void) pm_power_off = at91sam9263_poweroff; at91_extern_irq = (1 <<AT91SAM9263_ID_IRQ0 ) | (1 <<AT91SAM9263_ID_IRQ1 ); -/* Register the processor-specific clocks */ -at91sam9263_register_clocks (); -/* Register GPIO subsystem */ at91_gpio_init (at91sam9263_gpio,5 ); }
@@ -372,5 +369,6 @@ static unsigned int at91sam9263_default_irq_priority[NR_AIC_IRQS] __initdata = {struct at91_init_soc __initdata at91sam9263_soc = { .map_io = at91sam9263_map_io, .default_irq_priority = at91sam9263_default_irq_priority, + .register_clocks = at91sam9263_register_clocks, .init = at91sam9263_initialize, };
arch/arm/mach-at91/at91sam9g45.c +1 -3
@@ -336,9 +336,6 @@ static void __init at91sam9g45_initialize(void) pm_power_off = at91sam9g45_poweroff; at91_extern_irq = (1 <<AT91SAM9G45_ID_IRQ0 ); -/* Register the processor-specific clocks */ -at91sam9g45_register_clocks (); -/* Register GPIO subsystem */ at91_gpio_init (at91sam9g45_gpio,5 ); }
@@ -388,5 +385,6 @@ static unsigned int at91sam9g45_default_irq_priority[NR_AIC_IRQS] __initdata = {struct at91_init_soc __initdata at91sam9g45_soc = { .map_io = at91sam9g45_map_io, .default_irq_priority = at91sam9g45_default_irq_priority, + .register_clocks = at91sam9g45_register_clocks, .init = at91sam9g45_initialize, };
arch/arm/mach-at91/at91sam9rl.c +1 -3
@@ -306,9 +306,6 @@ static void __init at91sam9rl_initialize(void) pm_power_off = at91sam9rl_poweroff; at91_extern_irq = (1 <<AT91SAM9RL_ID_IRQ0 ); -/* Register the processor-specific clocks */ -at91sam9rl_register_clocks (); -/* Register GPIO subsystem */ at91_gpio_init (at91sam9rl_gpio,4 ); }
@@ -358,5 +355,6 @@ static unsigned int at91sam9rl_default_irq_priority[NR_AIC_IRQS] __initdata = {struct at91_init_soc __initdata at91sam9rl_soc = { .map_io = at91sam9rl_map_io, .default_irq_priority = at91sam9rl_default_irq_priority, + .register_clocks = at91sam9rl_register_clocks, .init = at91sam9rl_initialize, };
arch/arm/mach-at91/setup.c +3 -0
@@ -251,5 +251,8 @@ void __init at91_initialize(unsigned long main_clock)/* Init clock subsystem */ at91_clock_init (main_clock); +/* Register the processor-specific clocks */ + at91_boot_soc.register_clocks (); + at91_boot_soc.init (); }
arch/arm/mach-at91/soc.h +1 -0
@@ -7,6 +7,7 @@struct at91_init_soc {unsigned int *default_irq_priority;void (*map_io)(void ); +void (*register_clocks)(void );void (*init)(void ); };
Signature · 1 line
1.7.4.1
PATCH 7/8 at91: factorize sram init
In reply to Jean-Christophe PLAGNIOL-VILLARD--- arch/arm/mach-at91/at91cap9.c | 11 +------- arch/arm/mach-at91/at91rm9200.c | 6 +--- arch/arm/mach-at91/at91sam9260.c | 53 ++++++------------------------------- arch/arm/mach-at91/at91sam9261.c | 22 +-------------- arch/arm/mach-at91/at91sam9263.c | 17 +---------- arch/arm/mach-at91/at91sam9g45.c | 11 +------- arch/arm/mach-at91/at91sam9rl.c | 12 +-------- arch/arm/mach-at91/generic.h | 2 + arch/arm/mach-at91/setup.c | 20 ++++++++++++++ 9 files changed, 39 insertions(+), 115 deletions(-)
arch/arm/mach-at91/at91cap9.c +1 -10
@@ -29,15 +29,6 @@#include "generic.h" #include "clock.h" -static struct map_desc at91cap9_sram_desc[]__initdata = { - { - .virtual =AT91_IO_VIRT_BASE -AT91CAP9_SRAM_SIZE , - .pfn =__phys_to_pfn (AT91CAP9_SRAM_BASE ), - .length =AT91CAP9_SRAM_SIZE , - .type =MT_DEVICE , - }, -}; -/* -------------------------------------------------------------------- * Clocks * -------------------------------------------------------------------- */
@@ -337,7 +328,7 @@ static void at91cap9_poweroff(void)static void __init at91cap9_map_io (void ) { -iotable_init (at91cap9_sram_desc,ARRAY_SIZE (at91cap9_sram_desc)); +at91_init_sram (0 ,AT91CAP9_SRAM_BASE ,AT91CAP9_SRAM_SIZE ); }static void __init at91cap9_initialize (void )
arch/arm/mach-at91/at91rm9200.c +1 -5
@@ -30,11 +30,6 @@ static struct map_desc at91rm9200_io_desc[] __initdata = { .pfn = __phys_to_pfn(AT91RM9200_BASE_EMAC), .length = SZ_16K, .type = MT_DEVICE, - }, { - .virtual = AT91_IO_VIRT_BASE - AT91RM9200_SRAM_SIZE, - .pfn = __phys_to_pfn(AT91RM9200_SRAM_BASE), - .length = AT91RM9200_SRAM_SIZE, - .type = MT_DEVICE, }, };
@@ -306,6 +301,7 @@ static void at91rm9200_reset(void)static void __init at91rm9200_map_io (void ) {/* Map peripherals */ +at91_init_sram (0 ,AT91RM9200_SRAM_BASE ,AT91RM9200_SRAM_SIZE );iotable_init (at91rm9200_io_desc,ARRAY_SIZE (at91rm9200_io_desc)); }
arch/arm/mach-at91/at91sam9260.c +9 -44
70 lines not on this page · raw message
arch/arm/mach-at91/at91sam9261.c +2 -20
@@ -26,24 +26,6 @@#include "generic.h" #include "clock.h" -static struct map_desc at91sam9261_sram_desc[]__initdata = { - { - .virtual =AT91_IO_VIRT_BASE -AT91SAM9261_SRAM_SIZE , - .pfn =__phys_to_pfn (AT91SAM9261_SRAM_BASE ), - .length =AT91SAM9261_SRAM_SIZE , - .type =MT_DEVICE , - }, -}; - -static struct map_desc at91sam9g10_sram_desc[]__initdata = { - { - .virtual =AT91_IO_VIRT_BASE -AT91SAM9G10_SRAM_SIZE , - .pfn =__phys_to_pfn (AT91SAM9G10_SRAM_BASE ), - .length =AT91SAM9G10_SRAM_SIZE , - .type =MT_DEVICE , - }, -}; -/* -------------------------------------------------------------------- * Clocks * -------------------------------------------------------------------- */
@@ -297,9 +279,9 @@ static void at91sam9261_poweroff(void)static void __init at91sam9261_map_io (void ) {if (cpu_is_at91sam9g10 ()) -iotable_init (at91sam9g10_sram_desc,ARRAY_SIZE (at91sam9g10_sram_desc)); +at91_init_sram (0 ,AT91SAM9G10_SRAM_BASE ,AT91SAM9G10_SRAM_SIZE );else -iotable_init (at91sam9261_sram_desc,ARRAY_SIZE (at91sam9261_sram_desc)); +at91_init_sram (0 ,AT91SAM9261_SRAM_BASE ,AT91SAM9261_SRAM_SIZE ); }static void __init at91sam9261_initialize (void )
arch/arm/mach-at91/at91sam9263.c +2 -15
@@ -25,20 +25,6 @@#include "generic.h" #include "clock.h" -static struct map_desc at91sam9263_sram_desc[]__initdata = { - { - .virtual =AT91_IO_VIRT_BASE -AT91SAM9263_SRAM0_SIZE , - .pfn =__phys_to_pfn (AT91SAM9263_SRAM0_BASE ), - .length =AT91SAM9263_SRAM0_SIZE , - .type =MT_DEVICE , - }, { - .virtual =AT91_IO_VIRT_BASE -AT91SAM9263_SRAM0_SIZE -AT91SAM9263_SRAM1_SIZE , - .pfn =__phys_to_pfn (AT91SAM9263_SRAM1_BASE ), - .length =AT91SAM9263_SRAM1_SIZE , - .type =MT_DEVICE , - }, -}; -/* -------------------------------------------------------------------- * Clocks * -------------------------------------------------------------------- */
@@ -311,7 +297,8 @@ static void at91sam9263_poweroff(void)static void __init at91sam9263_map_io (void ) { -iotable_init (at91sam9263_sram_desc,ARRAY_SIZE (at91sam9263_sram_desc)); +at91_init_sram (0 ,AT91SAM9263_SRAM0_BASE ,AT91SAM9263_SRAM0_SIZE ); +at91_init_sram (1 ,AT91SAM9263_SRAM1_BASE ,AT91SAM9263_SRAM1_SIZE ); }static void __init at91sam9263_initialize (void )
arch/arm/mach-at91/at91sam9g45.c +1 -10
@@ -26,15 +26,6 @@#include "generic.h" #include "clock.h" -static struct map_desc at91sam9g45_sram_desc[]__initdata = { - { - .virtual =AT91_IO_VIRT_BASE -AT91SAM9G45_SRAM_SIZE , - .pfn =__phys_to_pfn (AT91SAM9G45_SRAM_BASE ), - .length =AT91SAM9G45_SRAM_SIZE , - .type =MT_DEVICE , - } -}; -/* -------------------------------------------------------------------- * Clocks * -------------------------------------------------------------------- */
@@ -327,7 +318,7 @@ static void at91sam9g45_poweroff(void)static void __init at91sam9g45_map_io (void ) { -iotable_init (at91sam9g45_sram_desc,ARRAY_SIZE (at91sam9g45_sram_desc)); +at91_init_sram (0 ,AT91SAM9G45_SRAM_BASE ,AT91SAM9G45_SRAM_SIZE ); }static void __init at91sam9g45_initialize (void )
arch/arm/mach-at91/at91sam9rl.c +1 -11
@@ -26,13 +26,6 @@#include "generic.h" #include "clock.h" -static struct map_desc at91sam9rl_sram_desc[]__initdata = { - { - .pfn =__phys_to_pfn (AT91SAM9RL_SRAM_BASE ), - .type =MT_DEVICE , - } -}; -/* -------------------------------------------------------------------- * Clocks * -------------------------------------------------------------------- */
@@ -293,11 +286,8 @@ static void __init at91sam9rl_map_io(void) sram_size =SZ_16K ; } - at91sam9rl_sram_desc->virtual =AT91_IO_VIRT_BASE - sram_size; - at91sam9rl_sram_desc->length = sram_size; -/* Map SRAM */ -iotable_init (at91sam9rl_sram_desc,ARRAY_SIZE (at91sam9rl_sram_desc)); +at91_init_sram (0 ,AT91SAM9RL_SRAM_BASE , sram_size); }static void __init at91sam9rl_initialize (void )
arch/arm/mach-at91/generic.h +2 -0
@@ -12,6 +12,8 @@/* Map io */ extern void __init at91_map_io (void ); +extern void __init at91_init_sram (int bank,unsigned long base, +unsigned int length);/* Processors */ extern void __init at91rm9200_set_type (int type);
arch/arm/mach-at91/setup.c +20 -0
@@ -45,6 +45,26 @@ void __init at91_init_interrupts(unsigned int *priority)at91_gpio_irq_setup (); } +static struct map_desc sram_desc[2 ]__initdata ; + +void __init at91_init_sram (int bank,unsigned long base,unsigned int length) +{ +struct map_desc *desc = &sram_desc[bank]; + + desc->virtual =AT91_IO_VIRT_BASE - length; +if (bank >0 ) + desc->virtual -= sram_desc[bank -1 ].length; + + desc->pfn =__phys_to_pfn (base); + desc->length = length; + desc->type =MT_DEVICE ; + +pr_info ("AT91: sram at 0x%lx of 0x%x mapped at 0x%lx\n" , + base, length, desc->virtual); + +iotable_init (desc,1 ); +} +static struct map_desc at91_io_desc__initdata = { .virtual =AT91_VA_BASE_SYS , .pfn =__phys_to_pfn (AT91_BASE_SYS ),
Signature · 1 line
1.7.4.1
PATCH 8/8 at91: add arch specific ioremap support
In reply to Jean-Christophe PLAGNIOL-VILLARD--- arch/arm/mach-at91/include/mach/io.h | 16 +++++++++++++++- arch/arm/mach-at91/setup.c | 19 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletions(-)
arch/arm/mach-at91/include/mach/io.h +15 -1
@@ -21,14 +21,28 @@ #ifndef __ASM_ARCH_IO_H #define __ASM_ARCH_IO_H +#include <mach/hardware.h> + #define IO_SPACE_LIMIT 0xFFFFFFFF #define __io(a) __typesafe_io(a) #define __mem_pci(a) (a) - #ifndef __ASSEMBLY__ +#ifndef CONFIG_ARCH_AT91X40 +#define __arch_ioremap at91_ioremap +#define __arch_iounmap at91_iounmap +#endif + +void __iomem *at91_ioremap(unsigned long phys, size_t size, unsigned int type); +void at91_iounmap(volatile void __iomem *addr); + +static inline unsigned int at91_readl(unsigned int pa) +{ + return __raw_readl((void __iomem *)AT91_IO_P2V(pa)); +} + static inline unsigned int at91_sys_read(unsigned int reg_offset) { void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS;
arch/arm/mach-at91/setup.c +19 -0
@@ -7,6 +7,7 @@#include <linux/module.h> #include <linux/io.h> +#include <linux/mm.h> #include <asm/mach/map.h>
@@ -72,6 +73,24 @@ static struct map_desc at91_io_desc __initdata = { .type = MT_DEVICE, }; +void __iomem *at91_ioremap (unsigned long p,size_t size,unsigned int type) +{ +if (p >=AT91_BASE_SYS && p <= (AT91_BASE_SYS +SZ_16K -1 )) +return (void __iomem *)AT91_IO_P2V (p); + +return __arm_ioremap_caller (p, size, type,__builtin_return_address (0 )); +} +EXPORT_SYMBOL (at91_ioremap); + +void at91_iounmap (volatile void __iomem *addr) +{ +unsigned long virt = (unsigned long )addr; + +if (virt >=VMALLOC_START && virt <VMALLOC_END ) +__iounmap (addr); +} +EXPORT_SYMBOL (at91_iounmap); +#define AT91_DBGU0 0xfffff200#define AT91_DBGU1 0xffffee00
Signature · 1 line
1.7.4.1
PATCH 8/8 at91: add arch specific ioremap support
arch/arm/mach-at91/include/mach/io.h line 45
Quoted 6 lines · Jean-Christophe PLAGNIOL-VILLARD
arch/arm/mach-at91/include/mach/io.h +6
-0+ +static inline unsigned int at91_readl (unsigned int pa) +{ +return __raw_readl ((void __iomem *)AT91_IO_P2V (pa)); +} +
This function looks quite unusual and not in a good way. You also don't seem to use it at all.
Why is this needed, can can't you change all users to do ioremap?
Arnd
PATCH 8/8 at91: add arch specific ioremap support
Quoted 12 lines · Arnd Bergmann
arch/arm/mach-at91/include/mach/io.h line 45
Quoted 6 lines · Jean-Christophe PLAGNIOL-VILLARD
arch/arm/mach-at91/include/mach/io.h +6
-0+ +static inline unsigned int at91_readl (unsigned int pa) +{ +return __raw_readl ((void __iomem *)AT91_IO_P2V (pa)); +} +This function looks quite unusual and not in a good way. You also don't seem to use it at all.
Quoted 1 line
Why is this needed, can can't you change all users to do ioremap?
I don't remember why I put it
the whole idea is that everyone use ioremap now
Best Regards,
J.
PATCH 1/8 at91: introduce commom AT91_BASE_SYS
In reply to Jean-Christophe PLAGNIOL-VILLARDQuoted 9 lines · Jean-Christophe PLAGNIOL-VILLARD
On all at91 except rm9200 and x40 have the System Controller starts at address
0xffffc000and has a size of 16KiB.On rm9200 it's start at
0xfffe4000of 111KiB with non reserved data starting at0xfffff000This patch removes the individual definitions of
AT91_BASE_SYSand replaces them with a common version at base0xfffffc000and size 16KiB and map the same memory space
Hi Jean-Christophe,
I have mixed feelings about this series. A lot of the work you do here looks like great cleanups and simplifications, some other IMHO parts are just moving code from one place to another or look like they are instead going in the wrong direction.
As a general comment, please start with a cover-letter (the PATCH 0/8) email that describes the overall intention of the series and holds the combined diffstat.
Quoted 21 lines
arch/arm/mach-at91/setup.c new file +21
-0+void __init at91_map_io (void ) +{ +/* Map peripherals */ +iotable_init (&at91_io_desc,1 ); + +if (cpu_is_at91cap9 ()) + at91_boot_soc = at91cap9_soc; +else if (cpu_is_at91rm9200 ()) + at91_boot_soc = at91rm9200_soc; +else if (cpu_is_at91sam9260 ()) + at91_boot_soc = at91sam9260_soc; +else if (cpu_is_at91sam9261 ()) + at91_boot_soc = at91sam9261_soc; +else if (cpu_is_at91sam9263 ()) + at91_boot_soc = at91sam9263_soc; +else if (cpu_is_at91sam9g10 ()) + at91_boot_soc = at91sam9261_soc; +else if (cpu_is_at91sam9g20 ()) + at91_boot_soc = at91sam9260_soc; +else if (cpu_is_at91sam9g45 ()) + at91_boot_soc = at91sam9g45_soc;
arch/arm/mach-at91/setup.c line 58
Quoted 10 lines
arch/arm/mach-at91/setup.c new file +10
-0+else if (cpu_is_at91sam9rl ()) + at91_boot_soc = at91sam9rl_soc; +else if (cpu_is_at91sam9x5 ()) + at91_boot_soc = at91sam9x5_soc; +else +panic ("Impossible to detect the SOC type" ); + +if (at91_boot_soc.map_io) + at91_boot_soc.map_io (); +}
I think it would be easier to turn this around and have a very short function here:
void __init at91_map_io(void)
{
/* Map peripherals */
iotable_init(&at91_io_desc, 1);
}and then change each of the soc specific functions into
-void __init at91cap9_map_io(void)
+static void __init at91cap9_map_io(void)
{
- /* Map peripherals */
- iotable_init(at91cap9_io_desc, ARRAY_SIZE(at91cap9_io_desc));
+ at91_boot_soc = at91cap9_soc;
+ at91_map_io();
+ iotable_init(at91cap9_sram_desc, ARRAY_SIZE(at91cap9_sram_desc));
}
This would keep the per-soc code local and still consolidate the common code without introducing (IMHO ugly) cpu_is_at91...() checks.
Arnd
PATCH 1/8 at91: introduce commom AT91_BASE_SYS
Quoted 13 lines · Arnd Bergmann
Quoted 9 lines · Jean-Christophe PLAGNIOL-VILLARD
On all at91 except rm9200 and x40 have the System Controller starts at address
0xffffc000and has a size of 16KiB.On rm9200 it's start at
0xfffe4000of 111KiB with non reserved data starting at0xfffff000This patch removes the individual definitions of
AT91_BASE_SYSand replaces them with a common version at base0xfffffc000and size 16KiB and map the same memory spaceHi Jean-Christophe,
Quoted 8 lines
I have mixed feelings about this series. A lot of the work you do here looks like great cleanups and simplifications, some other IMHO parts are just moving code from one place to another or look like they are instead going in the wrong direction.
As a general comment, please start with a cover-letter (the PATCH 0/8) email that describes the overall intention of the series and holds the combined diffstat.
no this detect dynamicly the soc and factorize the init of AT91 in one place as all the soc have the same init
this patch series is just a first step as switch to the CLKDEV
Quoted 55 lines
Quoted 22 lines
arch/arm/mach-at91/setup.c new file +21
-0+void __init at91_map_io (void ) +{ +/* Map peripherals */ +iotable_init (&at91_io_desc,1 ); + +if (cpu_is_at91cap9 ()) + at91_boot_soc = at91cap9_soc; +else if (cpu_is_at91rm9200 ()) + at91_boot_soc = at91rm9200_soc; +else if (cpu_is_at91sam9260 ()) + at91_boot_soc = at91sam9260_soc; +else if (cpu_is_at91sam9261 ()) + at91_boot_soc = at91sam9261_soc; +else if (cpu_is_at91sam9263 ()) + at91_boot_soc = at91sam9263_soc; +else if (cpu_is_at91sam9g10 ()) + at91_boot_soc = at91sam9261_soc; +else if (cpu_is_at91sam9g20 ()) + at91_boot_soc = at91sam9260_soc; +else if (cpu_is_at91sam9g45 ()) + at91_boot_soc = at91sam9g45_soc;arch/arm/mach-at91/setup.c line 58
Quoted 10 lines
arch/arm/mach-at91/setup.c new file +10
-0+else if (cpu_is_at91sam9rl ()) + at91_boot_soc = at91sam9rl_soc; +else if (cpu_is_at91sam9x5 ()) + at91_boot_soc = at91sam9x5_soc; +else +panic ("Impossible to detect the SOC type" ); + +if (at91_boot_soc.map_io) + at91_boot_soc.map_io (); +}I think it would be easier to turn this around and have a very short function here:
void
__initat91_map_io(void){ /* Map peripherals */ iotable_init(&at91_io_desc, 1); }and then change each of the soc specific functions into
arch/arm/mach-at91/at91cap9.c +4
-3-void __init at91cap9_map_io (void ) +static void __init at91cap9_map_io (void ) { -/* Map peripherals */ -iotable_init (at91cap9_io_desc,ARRAY_SIZE (at91cap9_io_desc)); + at91_boot_soc = at91cap9_soc; +at91_map_io (); +iotable_init (at91cap9_sram_desc,ARRAY_SIZE (at91cap9_sram_desc)); }
Quoted 2 lines
This would keep the per-soc code local and still consolidate the common code without introducing (IMHO ugly) cpu_is_at91...() checks.
we detect it this is the whole idea
so not this way is the oposit of the whole idea
Best Regards,
J.
PATCH 1/8 at91: introduce commom AT91_BASE_SYS
Quoted 9 lines · On Friday 01 July 2011 19:25:14 Jean-Christophe PLAGNIOL-VILLARD wrote:
Quoted 3 lines · Arnd Bergmann
As a general comment, please start with a cover-letter (the PATCH 0/8) email that describes the overall intention of the series and holds the combined diffstat.
this detect dynamicly the soc and factorize the init of AT91 in one place as all the soc have the same init
this patch series is just a first step as switch to the CLKDEV
Ok, thanks for the explanation.
Quoted 24 lines · Arnd Bergmann
Quoted 23 lines
I think it would be easier to turn this around and have a very short function here:
void
__initat91_map_io(void){ /* Map peripherals */ iotable_init(&at91_io_desc, 1); }and then change each of the soc specific functions into
arch/arm/mach-at91/at91cap9.c +4
-3-void __init at91cap9_map_io (void ) +static void __init at91cap9_map_io (void ) { -/* Map peripherals */ -iotable_init (at91cap9_io_desc,ARRAY_SIZE (at91cap9_io_desc)); + at91_boot_soc = at91cap9_soc; +at91_map_io (); +iotable_init (at91cap9_sram_desc,ARRAY_SIZE (at91cap9_sram_desc)); }
Quoted 5 lines
Quoted 2 lines
This would keep the per-soc code local and still consolidate the common code without introducing (IMHO ugly) cpu_is_at91...() checks.
we detect it this is the whole idea
so not this way is the oposit of the whole idea
I wouldn't say the whole idea. An major part of your patches is to use the fact that you know the SoC, which is definitely useful. The change I mentioned above would only provide a simpler way to get to that information, based on the fact that you already know the specific board.
What is the advantage that you see of using the CPU register over a pointer from the machine_desc?
Obviously, it doesn't matter much any more once you do the conversion to device tree an end up with a of match table like
struct of_device_id at91_match_table[] = {
{ .compatible = "atmel,at91cap9", .data = &at91cap9_soc, },
{ .compatible = "atmel,at91rm9200, .data = &at91rm9200_soc, },
...
};Arnd