AT91: soc init factorisation and fix
Hi,
The following patch series fatorize the soc init and fix the ioremap by detecting the cpu type
we do not increse the number of ligne of code
The following changes since commit bad3db778f4ea5b41690400ce5bfff262a1d9775:
at91: drop boot_params and PLAT_PHYS_OFFSET (2011-05-09 02:48:06 +0800)
are available in the git repository at:
git at github.com:at91linux/linux-2.6-at91.git j-devel
Jean-Christophe PLAGNIOL-VILLARD (9):
at91rm9200: introduce at91rm9200_set_type to specficy cpu package
at91: introduce commom AT91_BASE_SYS
at91: factorize at91 interrupts init to soc
at91: remove AT91_DBGU offset from dbgu register macro
at91: use structure to store the current soc
at91: move clock subsystem init to soc generic init
at91: move register clocks to soc generic init
at91: factorize sram init
at91: add arch specific ioremap support
arch/arm/mach-at91/Makefile | 2 +- arch/arm/mach-at91/at572d940hf.c | 46 +--- arch/arm/mach-at91/at91cap9.c | 45 +--- arch/arm/mach-at91/at91rm9200.c | 44 +--- arch/arm/mach-at91/at91sam9260.c | 100 ++------- arch/arm/mach-at91/at91sam9261.c | 62 +----- arch/arm/mach-at91/at91sam9263.c | 51 +---- arch/arm/mach-at91/at91sam9g45.c | 45 +--- arch/arm/mach-at91/at91sam9rl.c | 59 +---- arch/arm/mach-at91/board-1arm.c | 15 +- arch/arm/mach-at91/board-afeb-9260v1.c | 12 +- arch/arm/mach-at91/board-at572d940hf_ek.c | 12 +- arch/arm/mach-at91/board-cam60.c | 12 +- arch/arm/mach-at91/board-cap9adk.c | 12 +- arch/arm/mach-at91/board-carmeva.c | 11 +- arch/arm/mach-at91/board-cpu9krea.c | 11 +- arch/arm/mach-at91/board-cpuat91.c | 15 +- arch/arm/mach-at91/board-csb337.c | 11 +- arch/arm/mach-at91/board-csb637.c | 11 +- arch/arm/mach-at91/board-eb9200.c | 11 +- arch/arm/mach-at91/board-ecbat91.c | 15 +- arch/arm/mach-at91/board-eco920.c | 16 +- arch/arm/mach-at91/board-flexibity.c | 11 +- arch/arm/mach-at91/board-foxg20.c | 12 +- arch/arm/mach-at91/board-gsia18s.c | 7 +- arch/arm/mach-at91/board-kafa.c | 15 +- arch/arm/mach-at91/board-kb9202.c | 16 +- arch/arm/mach-at91/board-neocore926.c | 12 +- arch/arm/mach-at91/board-pcontrol-g20.c | 9 +- arch/arm/mach-at91/board-picotux200.c | 11 +- arch/arm/mach-at91/board-qil-a9260.c | 12 +- arch/arm/mach-at91/board-rm9200dk.c | 11 +- arch/arm/mach-at91/board-rm9200ek.c | 11 +- arch/arm/mach-at91/board-sam9-l9260.c | 12 +- arch/arm/mach-at91/board-sam9260ek.c | 12 +- arch/arm/mach-at91/board-sam9261ek.c | 12 +- arch/arm/mach-at91/board-sam9263ek.c | 12 +- arch/arm/mach-at91/board-sam9g20ek.c | 16 +- arch/arm/mach-at91/board-sam9m10g45ek.c | 12 +- arch/arm/mach-at91/board-sam9rlek.c | 12 +- arch/arm/mach-at91/board-snapper9260.c | 11 +- arch/arm/mach-at91/board-stamp9g20.c | 12 +- arch/arm/mach-at91/board-usb-a9260.c | 12 +- arch/arm/mach-at91/board-usb-a9263.c | 12 +- arch/arm/mach-at91/board-yl-9200.c | 16 +- arch/arm/mach-at91/generic.h | 36 +-- arch/arm/mach-at91/include/mach/at572d940hf.h | 1 - arch/arm/mach-at91/include/mach/at91_dbgu.h | 27 ++- 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/cpu.h | 162 ++++++++------ arch/arm/mach-at91/include/mach/debug-macro.S | 14 +- arch/arm/mach-at91/include/mach/hardware.h | 14 ++ arch/arm/mach-at91/include/mach/io.h | 16 ++- arch/arm/mach-at91/setup.c | 301 +++++++++++++++++++++++++ arch/arm/mach-at91/soc.h | 61 +++++ 61 files changed, 752 insertions(+), 783 deletions(-) create mode 100644 arch/arm/mach-at91/setup.c create mode 100644 arch/arm/mach-at91/soc.h
Best Regards,
J.
PATCH 1/9 at91rm9200: introduce at91rm9200_set_type to specficy cpu package
as we can not detect it
by defaut the type will be bga
introduce cpu_is_at91rm9200_bga and cpu_is_at91rm9200_pqfp
--- arch/arm/mach-at91/at91rm9200.c | 13 +++++++++++-- arch/arm/mach-at91/board-1arm.c | 6 +++++- arch/arm/mach-at91/board-carmeva.c | 2 +- arch/arm/mach-at91/board-cpuat91.c | 6 +++++- arch/arm/mach-at91/board-csb337.c | 2 +- arch/arm/mach-at91/board-csb637.c | 2 +- arch/arm/mach-at91/board-eb9200.c | 2 +- arch/arm/mach-at91/board-ecbat91.c | 6 +++++- arch/arm/mach-at91/board-eco920.c | 7 ++++++- arch/arm/mach-at91/board-kafa.c | 6 +++++- arch/arm/mach-at91/board-kb9202.c | 7 +++++-- arch/arm/mach-at91/board-picotux200.c | 2 +- arch/arm/mach-at91/board-rm9200dk.c | 2 +- arch/arm/mach-at91/board-rm9200ek.c | 2 +- arch/arm/mach-at91/board-yl-9200.c | 6 +++++- arch/arm/mach-at91/generic.h | 3 ++- arch/arm/mach-at91/include/mach/cpu.h | 7 +++++++ 17 files changed, 63 insertions(+), 18 deletions(-)
arch/arm/mach-at91/at91rm9200.c +11 -2
@@ -18,6 +18,7 @@#include <mach/at91rm9200.h> #include <mach/at91_pmc.h> #include <mach/at91_st.h> +#include <mach/cpu.h> #include "generic.h" #include "clock.h"
@@ -316,6 +317,13 @@ 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
@@ -326,7 +334,7 @@ void __init at91rm9200_map_io(void)iotable_init (at91rm9200_io_desc,ARRAY_SIZE (at91rm9200_io_desc)); } -void __init at91rm9200_initialize (unsigned long main_clock,unsigned short banks) +void __init at91rm9200_initialize (unsigned long main_clock) { at91_arch_reset = at91rm9200_reset; at91_extern_irq = (1 <<AT91RM9200_ID_IRQ0 ) | (1 <<AT91RM9200_ID_IRQ1 )
@@ -341,7 +349,8 @@ void __init at91rm9200_initialize(unsigned long main_clock, unsigned short banksat91rm9200_register_clocks ();/* Initialize GPIO subsystem */ -at91_gpio_init (at91rm9200_gpio, banks); +at91_gpio_init (at91rm9200_gpio, +cpu_is_at91rm9200_bga () ?AT91RM9200_BGA :AT91RM9200_PQFP ); }
arch/arm/mach-at91/board-1arm.c +5 -1
@@ -35,14 +35,18 @@#include <mach/board.h> #include <mach/gpio.h> +#include <mach/cpu.h> #include "generic.h" static void __init onearm_init_early (void ) { +/* Set cpu type: PQFP */ +at91rm9200_set_type (ARCH_REVISON_9200_PQFP ); +/* Initialize processor: 18.432 MHz crystal */ -at91rm9200_initialize (18432000 ,AT91RM9200_PQFP ); +at91rm9200_initialize (18432000 );/* DBGU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
arch/arm/mach-at91/board-carmeva.c +1 -1
@@ -43,7 +43,7 @@static void __init carmeva_init_early (void ) {/* Initialize processor: 20.000 MHz crystal */ -at91rm9200_initialize (20000000 ,AT91RM9200_BGA ); +at91rm9200_initialize (20000000 );/* DBGU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
arch/arm/mach-at91/board-cpuat91.c +5 -1
@@ -38,6 +38,7 @@#include <mach/board.h> #include <mach/gpio.h> #include <mach/at91rm9200_mc.h> +#include <mach/cpu.h> #include "generic.h"
@@ -52,8 +53,11 @@ static struct gpio_led cpuat91_leds[] = {static void __init cpuat91_init_early (void ) { +/* Set cpu type: PQFP */ +at91rm9200_set_type (ARCH_REVISON_9200_PQFP ); +/* Initialize processor: 18.432 MHz crystal */ -at91rm9200_initialize (18432000 ,AT91RM9200_PQFP ); +at91rm9200_initialize (18432000 );/* DBGU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
arch/arm/mach-at91/board-csb337.c +1 -1
@@ -46,7 +46,7 @@static void __init csb337_init_early (void ) {/* Initialize processor: 3.6864 MHz crystal */ -at91rm9200_initialize (3686400 ,AT91RM9200_BGA ); +at91rm9200_initialize (3686400 );/* Setup the LEDs */ at91_init_leds (AT91_PIN_PB0 ,AT91_PIN_PB1 );
arch/arm/mach-at91/board-csb637.c +1 -1
@@ -43,7 +43,7 @@static void __init csb637_init_early (void ) {/* Initialize processor: 3.6864 MHz crystal */ -at91rm9200_initialize (3686400 ,AT91RM9200_BGA ); +at91rm9200_initialize (3686400 );/* DBGU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
arch/arm/mach-at91/board-eb9200.c +1 -1
@@ -43,7 +43,7 @@static void __init eb9200_init_early (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91rm9200_initialize (18432000 ,AT91RM9200_BGA ); +at91rm9200_initialize (18432000 );/* DBGU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
arch/arm/mach-at91/board-ecbat91.c +5 -1
@@ -38,14 +38,18 @@#include <mach/board.h> #include <mach/gpio.h> +#include <mach/cpu.h> #include "generic.h" static void __init ecb_at91init_early (void ) { +/* Set cpu type: PQFP */ +at91rm9200_set_type (ARCH_REVISON_9200_PQFP ); +/* Initialize processor: 18.432 MHz crystal */ -at91rm9200_initialize (18432000 ,AT91RM9200_PQFP ); +at91rm9200_initialize (18432000 );/* Setup the LEDs */ at91_init_leds (AT91_PIN_PC7 ,AT91_PIN_PC7 );
arch/arm/mach-at91/board-eco920.c +6 -1
@@ -26,11 +26,16 @@#include <mach/board.h> #include <mach/at91rm9200_mc.h> +#include <mach/cpu.h> +#include "generic.h" static void __init eco920_init_early (void ) { -at91rm9200_initialize (18432000 ,AT91RM9200_PQFP ); +/* Set cpu type: PQFP */ +at91rm9200_set_type (ARCH_REVISON_9200_PQFP ); + +at91rm9200_initialize (18432000 );/* Setup the LEDs */ at91_init_leds (AT91_PIN_PB0 ,AT91_PIN_PB1 );
arch/arm/mach-at91/board-kafa.c +5 -1
@@ -35,14 +35,18 @@#include <mach/board.h> #include <mach/gpio.h> +#include <mach/cpu.h> #include "generic.h" static void __init kafa_init_early (void ) { +/* Set cpu type: PQFP */ +at91rm9200_set_type (ARCH_REVISON_9200_PQFP ); +/* Initialize processor: 18.432 MHz crystal */ -at91rm9200_initialize (18432000 ,AT91RM9200_PQFP ); +at91rm9200_initialize (18432000 );/* Set up the LEDs */ at91_init_leds (AT91_PIN_PB4 ,AT91_PIN_PB4 );
arch/arm/mach-at91/board-kb9202.c +5 -2
@@ -36,7 +36,7 @@#include <mach/board.h> #include <mach/gpio.h> - +#include <mach/cpu.h> #include <mach/at91rm9200_mc.h> #include "generic.h"
@@ -44,8 +44,11 @@static void __init kb9202_init_early (void ) { +/* Set cpu type: PQFP */ +at91rm9200_set_type (ARCH_REVISON_9200_PQFP ); +/* Initialize processor: 10 MHz crystal */ -at91rm9200_initialize (10000000 ,AT91RM9200_PQFP ); +at91rm9200_initialize (10000000 );/* Set up the LEDs */ at91_init_leds (AT91_PIN_PC19 ,AT91_PIN_PC18 );
arch/arm/mach-at91/board-picotux200.c +1 -1
@@ -46,7 +46,7 @@static void __init picotux200_init_early (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91rm9200_initialize (18432000 ,AT91RM9200_BGA ); +at91rm9200_initialize (18432000 );/* DBGU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
arch/arm/mach-at91/board-rm9200dk.c +1 -1
@@ -48,7 +48,7 @@static void __init dk_init_early (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91rm9200_initialize (18432000 ,AT91RM9200_BGA ); +at91rm9200_initialize (18432000 );/* Setup the LEDs */ at91_init_leds (AT91_PIN_PB2 ,AT91_PIN_PB2 );
arch/arm/mach-at91/board-rm9200ek.c +1 -1
@@ -48,7 +48,7 @@static void __init ek_init_early (void ) {/* Initialize processor: 18.432 MHz crystal */ -at91rm9200_initialize (18432000 ,AT91RM9200_BGA ); +at91rm9200_initialize (18432000 );/* Setup the LEDs */ at91_init_leds (AT91_PIN_PB1 ,AT91_PIN_PB2 );
arch/arm/mach-at91/board-yl-9200.c +5 -1
@@ -45,14 +45,18 @@#include <mach/board.h> #include <mach/gpio.h> #include <mach/at91rm9200_mc.h> +#include <mach/cpu.h> #include "generic.h" static void __init yl9200_init_early (void ) { +/* Set cpu type: PQFP */ +at91rm9200_set_type (ARCH_REVISON_9200_PQFP ); +/* Initialize processor: 18.432 MHz crystal */ -at91rm9200_initialize (18432000 ,AT91RM9200_PQFP ); +at91rm9200_initialize (18432000 );/* Setup the LEDs D2=PB17 (timer), D3=PB16 (cpu) */ at91_init_leds (AT91_PIN_PB16 ,AT91_PIN_PB17 );
arch/arm/mach-at91/generic.h +2 -1
@@ -22,7 +22,8 @@ extern void __init at91cap9_map_io(void);extern void __init at572d940hf_map_io (void );/* Processors */ -extern void __init at91rm9200_initialize (unsigned long main_clock,unsigned short banks); +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);
arch/arm/mach-at91/include/mach/cpu.h +7 -0
@@ -90,9 +90,16 @@ static inline unsigned long at91cap9_rev_identify(void)#endif #ifdef CONFIG_ARCH_AT91RM9200 +extern int rm9200_type; +#define ARCH_REVISON_9200_BGA (0 << 0) +#define ARCH_REVISON_9200_PQFP (1 << 0)#define cpu_is_at91rm9200 () (at91_cpu_identify() == ARCH_ID_AT91RM9200) +#define cpu_is_at91rm9200_bga () (!cpu_is_at91rm9200_pqfp()) +#define cpu_is_at91rm9200_pqfp () (cpu_is_at91rm9200() && rm9200_type & ARCH_REVISON_9200_PQFP)#else #define cpu_is_at91rm9200 () (0) +#define cpu_is_at91rm9200_bga () (0) +#define cpu_is_at91rm9200_pqfp () (0)#endif #ifdef CONFIG_ARCH_AT91SAM9260
Signature · 1 line
1.7.4.1
PATCH 2/9 at91: introduce commom AT91_BASE_SYS
In reply to Jean-Christophe PLAGNIOL-VILLARDOn 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/at572d940hf.c | 19 ++++---- 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-at572d940hf_ek.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 | 19 +------- arch/arm/mach-at91/include/mach/at572d940hf.h | 1 - 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 | 65 +++++++++++++++++++++++++ arch/arm/mach-at91/soc.h | 21 ++++++++ 57 files changed, 246 insertions(+), 188 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/at572d940hf.c +9 -10
@@ -31,16 +31,12 @@#include <mach/at91_pmc.h> #include <mach/at91_rstc.h> +#include "soc.h" #include "generic.h" #include "clock.h" -static struct map_desc at572d940hf_io_desc[]__initdata = { +static struct map_desc at572d940hf_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 -AT572D940HF_SRAM_SIZE , .pfn =__phys_to_pfn (AT572D940HF_SRAM_BASE ), .length =AT572D940HF_SRAM_SIZE ,
@@ -366,13 +362,12 @@ static void at572d940hf_reset(void)* AT572D940HF processor initialization * -------------------------------------------------------------------- */ -void __init at572d940hf_map_io (void ) +static void __init at572d940hf_map_io (void ) { -/* Map peripherals */ -iotable_init (at572d940hf_io_desc,ARRAY_SIZE (at572d940hf_io_desc)); +iotable_init (at572d940hf_sram_desc,ARRAY_SIZE (at572d940hf_sram_desc)); } -void __init at572d940hf_initialize (unsigned long main_clock) +static void __init at572d940hf_initialize (unsigned long main_clock) { at91_arch_reset = at572d940hf_reset; at91_extern_irq = (1 <<AT572D940HF_ID_IRQ0 ) | (1 <<AT572D940HF_ID_IRQ1 )
@@ -442,3 +437,7 @@ void __init at572d940hf_init_interrupts(unsigned int priority[NR_AIC_IRQS])at91_gpio_irq_setup (); } +struct at91_soc __initdata at572d940hf_soc = { + .map_io = at572d940hf_map_io, + .init = at572d940hf_initialize, +};
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 ,
@@ -361,14 +357,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 );
@@ -442,3 +436,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 ,
@@ -328,13 +324,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 )
@@ -407,3 +403,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 ,
@@ -361,11 +353,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 ())
@@ -374,7 +363,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;
@@ -444,3 +433,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 ,
@@ -322,18 +314,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;
@@ -403,3 +392,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 ,
@@ -333,13 +329,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;
@@ -408,3 +403,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 ,
@@ -352,13 +348,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;
@@ -427,3 +422,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 ),
@@ -303,13 +295,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 ) {
@@ -328,7 +317,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;
@@ -397,3 +386,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-at572d940hf_ek.c +2 -2
@@ -50,7 +50,7 @@static void __init eb_init_early (void ) {/* Initialize processor: 12.500 MHz crystal */ -at572d940hf_initialize (12000000 ); +at91_initialize (12000000 );/* DBGU on ttyS0. (Rx & Tx only) */ at91_register_uart (0 ,0 ,0 );
@@ -316,7 +316,7 @@ static void __init eb_board_init(void)MACHINE_START (AT572D940HFEB ,"Atmel AT91D940HF-EB" )/* Maintainer: Atmel <[email protected]> */ .timer = &at91sam926x_timer, - .map_io = at572d940hf_map_io, + .map_io = at91_map_io, .init_early = eb_init_early, .init_irq = eb_init_irq, .init_machine = eb_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 -17
@@ -11,27 +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 at572d940hf_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); -extern void __init at572d940hf_initialize (unsigned long main_clock);/* Interrupts */ extern void __init at91rm9200_init_interrupts (unsigned int priority[]);
arch/arm/mach-at91/include/mach/at572d940hf.h +0 -1
@@ -81,7 +81,6 @@#define AT572D940HF_BASE_EMAC 0xfffd8000#define AT572D940HF_BASE_CAN0 0xfffdc000#define AT572D940HF_BASE_CAN1 0xfffe0000 -#define AT91_BASE_SYS 0xffffea00/*
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
@@ -38,6 +38,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 +65 -0
65 lines not on this page · raw message
arch/arm/mach-at91/soc.h new file +21 -0
@@ -0,0 +1,21 @@ +/* +* 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 at572d940hf_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 3/9 at91: factorize at91 interrupts init to soc
In reply to Jean-Christophe PLAGNIOL-VILLARDthey are the same except the default priority
--- arch/arm/mach-at91/at572d940hf.c | 13 +------------ 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-at572d940hf_ek.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 | 10 ++-------- arch/arm/mach-at91/setup.c | 14 ++++++++++++++ arch/arm/mach-at91/soc.h | 1 + 47 files changed, 59 insertions(+), 338 deletions(-)
arch/arm/mach-at91/at572d940hf.c +1 -12
@@ -425,19 +425,8 @@ static unsigned int at572d940hf_default_irq_priority[NR_AIC_IRQS] __initdata = { 0, /* Advanced Interrupt Controller */ }; -void __init at572d940hf_init_interrupts (unsigned int priority[NR_AIC_IRQS ]) -{ -if (!priority) - priority = at572d940hf_default_irq_priority; - -/* Initialize the AIC interrupt controller */ -at91_aic_init (priority); - -/* Enable GPIO interrupts */ -at91_gpio_irq_setup (); -} -struct at91_soc __initdata at572d940hf_soc = { .map_io = at572d940hf_map_io, + .default_irq_priority = at572d940hf_default_irq_priority, .init = at572d940hf_initialize, };
arch/arm/mach-at91/at91cap9.c +1 -12
@@ -425,19 +425,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
@@ -392,19 +392,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
@@ -422,19 +422,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
@@ -381,19 +381,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
@@ -392,19 +392,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
@@ -411,19 +411,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
@@ -375,19 +375,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-at572d940hf_ek.c +1 -7
@@ -68,12 +68,6 @@ static void __init eb_init_early(void)at91_set_serial_console (0 ); } -static void __init eb_init_irq (void ) -{ -at572d940hf_init_interrupts (NULL ); -} - -/* * USB Host Port */
@@ -318,6 +312,6 @@ MACHINE_START(AT572D940HFEB, "Atmel AT91D940HF-EB") .timer = &at91sam926x_timer, .map_io = at91_map_io, .init_early = eb_init_early, - .init_irq = eb_init_irq, + .init_irq = at91_init_irq_default, .init_machine = eb_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 -8
@@ -19,15 +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 at572d940hf_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 (current_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 4/9 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
@@ -336,7 +336,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
@@ -299,7 +299,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_DBUG_ ## 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
@@ -43,12 +43,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
@@ -64,7 +64,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 ); }
@@ -74,7 +74,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 5/9 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/at91rm9200.c | 8 - arch/arm/mach-at91/at91sam9260.c | 7 +- arch/arm/mach-at91/at91sam9rl.c | 7 +- arch/arm/mach-at91/include/mach/cpu.h | 165 +++++++++++++----------- arch/arm/mach-at91/setup.c | 227 +++++++++++++++++++++++++++++---- arch/arm/mach-at91/soc.h | 38 ++++++ 6 files changed, 337 insertions(+), 115 deletions(-)
arch/arm/mach-at91/at91rm9200.c +0 -8
@@ -313,14 +313,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 * -------------------------------------------------------------------- */
arch/arm/mach-at91/at91sam9260.c +3 -4
@@ -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>
@@ -334,11 +335,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_data.cidr &AT91_CIDR_SRAMSIZ ) {case AT91_CIDR_SRAMSIZ_32K : sram_size =2 *SZ_16K ;break ;
arch/arm/mach-at91/at91sam9rl.c +3 -4
@@ -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>
@@ -297,11 +298,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_data.cidr &AT91_CIDR_SRAMSIZ ) {case AT91_CIDR_SRAMSIZ_32K : sram_size =2 *SZ_16K ;break ;
arch/arm/mach-at91/include/mach/cpu.h +91 -74
257 lines not on this page · raw message
arch/arm/mach-at91/setup.c +202 -25
252 lines not on this page · raw message
arch/arm/mach-at91/soc.h +38 -0
@@ -20,3 +20,41 @@ extern struct at91_soc at91sam9263_soc;extern struct at91_soc at91sam9g45_soc;extern struct at91_soc at91sam9rl_soc;extern struct at91_soc at91sam9x5_soc; + +#define set_at91_boot_soc (c) do { at91_boot_soc = c; } while(0) + +#if !defined(CONFIG_ARCH_AT572D940HF ) +#define at572d940hf_soc at91_boot_soc +#endif + +#if !defined(CONFIG_ARCH_AT91CAP9 ) +#define at91cap9_soc at91_boot_soc +#endif + +#if !defined(CONFIG_ARCH_AT91RM9200 ) +#define at91rm9200_soc at91_boot_soc +#endif + +#if !(defined(CONFIG_ARCH_AT91SAM9260 ) && defined(CONFIG_ARCH_AT91SAM9G20 )) +#define at91sam9260_soc at91_boot_soc +#endif + +#if !(defined(CONFIG_ARCH_AT91SAM9261 ) && defined(CONFIG_ARCH_AT91SAM9G10 )) +#define at91sam9261_soc at91_boot_soc +#endif + +#if !defined(CONFIG_ARCH_AT91SAM9263 ) +#define at91sam9263_soc at91_boot_soc +#endif + +#if !defined(CONFIG_ARCH_AT91SAM9G45 ) +#define at91sam9g45_soc at91_boot_soc +#endif + +#if !defined(CONFIG_ARCH_AT91SAM9RL ) +#define at91sam9rl_soc at91_boot_soc +#endif + +#if !defined(CONFIG_ARCH_AT91SAM9X5 ) +#define at91sam9x5_soc at91_boot_soc +#endif
Signature · 1 line
1.7.4.1
PATCH 5/9 at91: use structure to store the current soc
Quoted 20 lines · Jean-Christophe PLAGNIOL-VILLARD
instead 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 (viacpu_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.
Quoted 5 lines
this implementation is inspired by the SH cpu detection support
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc Nicolas Ferre <[email protected]>Cc Patrice Vilchez <[email protected]>
Hi Jean,
This approach looks a lot more sane. Some comments below. I will try and test these patches on my boards some time this week.
Also Cc'ed Andrew Victor who is the current at91 maintainer. Can you please include me on the Cc list for any further postings.
Thanks,
~Ryan
Quoted 385 lines
--- arch/arm/mach-at91/at91rm9200.c | 8 - arch/arm/mach-at91/at91sam9260.c | 7 +- arch/arm/mach-at91/at91sam9rl.c | 7 +- arch/arm/mach-at91/include/mach/cpu.h | 165 +++++++++++++----------- arch/arm/mach-at91/setup.c | 227 +++++++++++++++++++++++++++++---- arch/arm/mach-at91/soc.h | 38 ++++++ 6 files changed, 337 insertions(+), 115 deletions(-)arch/arm/mach-at91/at91rm9200.c +0
-8@@ -313,14 +313,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 * -------------------------------------------------------------------- */ arch/arm/mach-at91/at91sam9260.c +3
-4@@ -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> @@ -334,11 +335,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_data.cidr &AT91_CIDR_SRAMSIZ ) {case AT91_CIDR_SRAMSIZ_32K : sram_size =2 *SZ_16K ;break ;arch/arm/mach-at91/at91sam9rl.c +3
-4@@ -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> @@ -297,11 +298,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_data.cidr &AT91_CIDR_SRAMSIZ ) {case AT91_CIDR_SRAMSIZ_32K : sram_size =2 *SZ_16K ;break ;arch/arm/mach-at91/include/mach/cpu.h +91
-74@@ -1,7 +1,8 @@/* * arch/arm/mach-at91/include/mach/cpu.h * -* Copyright (C) 2006 SAN People +* Copyright (C) 2006 SAN People +* Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -10,12 +11,8 @@* */ -#ifndef __ASM_ARCH_CPU_H -#define __ASM_ARCH_CPU_H - -#include <mach/hardware.h> -#include <mach/at91_dbgu.h> - +#ifndef __MACH_CPU_H__ +#define __MACH_CPU_H__#define ARCH_ID_AT91RM9200 0x09290780#define ARCH_ID_AT91SAM9260 0x019803a0@@ -41,16 +38,6 @@#define ARCH_ID_AT91M40807 0x14080745#define ARCH_ID_AT91R40008 0x44000840 -static inline unsigned long at91_cpu_identify (void ) -{ -return (dbgu_readl (AT91_DBGU ,CIDR ) & ~AT91_CIDR_VERSION ); -} - -static inline unsigned long at91_cpu_fully_identify (void ) -{ -return dbgu_readl (AT91_DBGU ,CIDR ); -} -#define ARCH_EXID_AT91SAM9M11 0x00000001#define ARCH_EXID_AT91SAM9M10 0x00000002#define ARCH_EXID_AT91SAM9G46 0x00000003@@ -62,40 +49,78 @@ static inline unsigned long at91_cpu_fully_identify(void)#define ARCH_EXID_AT91SAM9G25 0x00000003#define ARCH_EXID_AT91SAM9X25 0x00000004 -static inline unsigned long at91_exid_identify (void ) -{ -return dbgu_readl (AT91_DBGU ,EXID ); -} - -#define ARCH_FAMILY_AT91X92 0x09200000#define ARCH_FAMILY_AT91SAM9 0x01900000#define ARCH_FAMILY_AT91SAM9XE 0x02900000 -static inline unsigned long at91_arch_identify (void ) -{ -return (dbgu_readl (AT91_DBGU ,CIDR ) &AT91_CIDR_ARCH ); -} - -#ifdef CONFIG_ARCH_AT91CAP9 -#include <mach/at91_pmc.h> - +/* PMC revision */ #define ARCH_REVISION_CAP9_B 0x399#define ARCH_REVISION_CAP9_C 0x601 -static inline unsigned long at91cap9_rev_identify (void ) -{ -return (at91_sys_read (AT91_PMC_VER )); -} -#endif - -#ifdef CONFIG_ARCH_AT91RM9200 -extern int rm9200_type; +/* RM9200 type */ #define ARCH_REVISON_9200_BGA (0 << 0)#define ARCH_REVISON_9200_PQFP (1 << 0) -#define cpu_is_at91rm9200 () (at91_cpu_identify() == ARCH_ID_AT91RM9200) -#define cpu_is_at91rm9200_bga () (!cpu_is_at91rm9200_pqfp()) -#define cpu_is_at91rm9200_pqfp () (cpu_is_at91rm9200() && rm9200_type & ARCH_REVISON_9200_PQFP) + +enum soc_type { +/* 920T */ +SOC_RM9200 , + +/* DIPSIS */ +SOC_572D940HF , + +/* CAP */ +SOC_CAP9 , + +/* SAM92xx */ +SOC_SAM9260 ,SOC_SAM9261 ,SOC_SAM9263 , + +/* SAM9Gxx */ +SOC_SAM9G10 ,SOC_SAM9G20 ,SOC_SAM9G45 , + +/* SAM9RL */ +SOC_SAM9RL , + +/* SAM9X5 */ +SOC_SAM9X5 , + +/* Unknown type */ +SOC_AT91_NONE +}; + +enum soc_sub_type { +/* RM9200 */ +SOC_RM9200_BGA ,SOC_RM9200_PQFP , + +/* CAP9 */ +SOC_CAP9_REV_B ,SOC_CAP9_REV_C , + +/* SAM9260 */ +SOC_SAM9XE , + +/* SAM9G45 */ +SOC_SAM9G45ES ,SOC_SAM9M10 ,SOC_SAM9G46 ,SOC_SAM9M11 , + +/* SAM9X5 */ +SOC_SAM9G15 ,SOC_SAM9G35 ,SOC_SAM9X35 , +SOC_SAM9G25 ,SOC_SAM9X25 , + +/* Unknown subtype */ +SOC_AT91_SUBTYPE_NONE +}; + +struct at91_socinfo { +unsigned int type, subtype; +unsigned int cidr, exid; +}; + +extern struct at91_socinfo at91_soc_data; +const char *get_at91_soc_type (struct at91_socinfo *c); +const char *get_at91_soc_subtype (struct at91_socinfo *c); + +#ifdef CONFIG_ARCH_AT91RM9200 +#define cpu_is_at91rm9200 () (at91_soc_data.type == SOC_RM9200) +#define cpu_is_at91rm9200_bga () (at91_soc_data.subtype == SOC_RM9200_BGA) +#define cpu_is_at91rm9200_pqfp () (at91_soc_data.subtype == SOC_RM9200_PQFP)#else #define cpu_is_at91rm9200 () (0)#define cpu_is_at91rm9200_bga () (0)@@ -103,52 +128,49 @@ extern int rm9200_type;#endif #ifdef CONFIG_ARCH_AT91SAM9260 -#define cpu_is_at91sam9xe () (at91_arch_identify() == ARCH_FAMILY_AT91SAM9XE) -#define cpu_is_at91sam9260 () ((at91_cpu_identify() == ARCH_ID_AT91SAM9260) || cpu_is_at91sam9xe()) +#define cpu_is_at91sam9xe () (at91_soc_data.subtype == SOC_SAM9XE) +#define cpu_is_at91sam9260 () (at91_soc_data.type == SOC_SAM9260)#else #define cpu_is_at91sam9xe () (0)#define cpu_is_at91sam9260 () (0)#endif #ifdef CONFIG_ARCH_AT91SAM9G20 -#define cpu_is_at91sam9g20 () (at91_cpu_identify() == ARCH_ID_AT91SAM9G20) +#define cpu_is_at91sam9g20 () (at91_soc_data.type == SOC_SAM9G20)#else #define cpu_is_at91sam9g20 () (0)#endif #ifdef CONFIG_ARCH_AT91SAM9261 -#define cpu_is_at91sam9261 () (at91_cpu_identify() == ARCH_ID_AT91SAM9261) +#define cpu_is_at91sam9261 () (at91_soc_data.type == SOC_SAM9261)#else #define cpu_is_at91sam9261 () (0)#endif #ifdef CONFIG_ARCH_AT91SAM9G10 -#define cpu_is_at91sam9g10 () ((at91_cpu_identify() & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) +#define cpu_is_at91sam9g10 () (at91_soc_data.type == SOC_SAM9G10)#else #define cpu_is_at91sam9g10 () (0)#endif #ifdef CONFIG_ARCH_AT91SAM9263 -#define cpu_is_at91sam9263 () (at91_cpu_identify() == ARCH_ID_AT91SAM9263) +#define cpu_is_at91sam9263 () (at91_soc_data.type == SOC_SAM9263)#else #define cpu_is_at91sam9263 () (0)#endif #ifdef CONFIG_ARCH_AT91SAM9RL -#define cpu_is_at91sam9rl () (at91_cpu_identify() == ARCH_ID_AT91SAM9RL64) +#define cpu_is_at91sam9rl () (at91_soc_data.type == SOC_SAM9RL)#else #define cpu_is_at91sam9rl () (0)#endif #ifdef CONFIG_ARCH_AT91SAM9G45 -#define cpu_is_at91sam9g45 () (at91_cpu_identify() == ARCH_ID_AT91SAM9G45) -#define cpu_is_at91sam9g45es () (at91_cpu_fully_identify() == ARCH_ID_AT91SAM9G45ES) -#define cpu_is_at91sam9m10 () (cpu_is_at91sam9g45() && \ - (at91_exid_identify() == ARCH_EXID_AT91SAM9M10)) -#define cpu_is_at91sam9m46 () (cpu_is_at91sam9g45() && \ - (at91_exid_identify() == ARCH_EXID_AT91SAM9G46)) -#define cpu_is_at91sam9m11 () (cpu_is_at91sam9g45() && \ - (at91_exid_identify() == ARCH_EXID_AT91SAM9M11)) +#define cpu_is_at91sam9g45 () (at91_soc_data.type == SOC_SAM9G45) +#define cpu_is_at91sam9g45es () (at91_soc_data.subtype == SOC_SAM9G45ES) +#define cpu_is_at91sam9m10 () (at91_soc_data.subtype == SOC_SAM9M10) +#define cpu_is_at91sam9g46 () (at91_soc_data.subtype == SOC_SAM9G46) +#define cpu_is_at91sam9m11 () (at91_soc_data.subtype == SOC_SAM9M11)#else #define cpu_is_at91sam9g45 () (0)#define cpu_is_at91sam9g45es () (0)@@ -158,17 +180,12 @@ extern int rm9200_type;#endif #ifdef CONFIG_ARCH_AT91SAM9X5 -#define cpu_is_at91sam9x5 () (at91_cpu_identify() == ARCH_ID_AT91SAM9X5) -#define cpu_is_at91sam9g15 () (cpu_is_at91sam9x5() && \ - (at91_exid_identify() == ARCH_EXID_AT91SAM9G15)) -#define cpu_is_at91sam9g35 () (cpu_is_at91sam9x5() && \ - (at91_exid_identify() == ARCH_EXID_AT91SAM9G35)) -#define cpu_is_at91sam9x35 () (cpu_is_at91sam9x5() && \ - (at91_exid_identify() == ARCH_EXID_AT91SAM9X35)) -#define cpu_is_at91sam9g25 () (cpu_is_at91sam9x5() && \ - (at91_exid_identify() == ARCH_EXID_AT91SAM9G25)) -#define cpu_is_at91sam9x25 () (cpu_is_at91sam9x5() && \ - (at91_exid_identify() == ARCH_EXID_AT91SAM9X25)) +#define cpu_is_at91sam9x5 () (at91_soc_data.type == SOC_SAM9X5) +#define cpu_is_at91sam9g15 () (at91_soc_data.subtype == SOC_SAM9G15) +#define cpu_is_at91sam9g35 () (at91_soc_data.subtype == SOC_SAM9G35) +#define cpu_is_at91sam9x35 () (at91_soc_data.subtype == SOC_SAM9X35) +#define cpu_is_at91sam9g25 () (at91_soc_data.subtype == SOC_SAM9G25) +#define cpu_is_at91sam9x25 () (at91_soc_data.subtype == SOC_SAM9X25)#else #define cpu_is_at91sam9x5 () (0)#define cpu_is_at91sam9g15 () (0)@@ -179,9 +196,9 @@ extern int rm9200_type;#endif #ifdef CONFIG_ARCH_AT91CAP9 -#define cpu_is_at91cap9 () (at91_cpu_identify() == ARCH_ID_AT91CAP9) -#define cpu_is_at91cap9_revB () (at91cap9_rev_identify() == ARCH_REVISION_CAP9_B) -#define cpu_is_at91cap9_revC () (at91cap9_rev_identify() == ARCH_REVISION_CAP9_C) +#define cpu_is_at91cap9 () (at91_soc_data.type == SOC_CAP9) +#define cpu_is_at91cap9_revB () (at91_soc_data.subtype == SOC_CAP9_REV_B) +#define cpu_is_at91cap9_revC () (at91_soc_data.subtype == SOC_CAP9_REV_C)#else #define cpu_is_at91cap9 () (0)#define cpu_is_at91cap9_revB () (0)@@ -189,9 +206,9 @@ extern int rm9200_type;#endif #ifdef CONFIG_ARCH_AT572D940HF -#define cpu_is_at572d940hf () (at91_cpu_identify() == ARCH_ID_AT572D940HF) +#define cpu_is_at572d940hf () (at91_soc_data.type == SOC_572D940HF)#else -#define cpu_is_at572d940hf () (0) +#define cpu_is_at572d940hf () (0)#endif /* @@ -200,4 +217,4 @@ extern int rm9200_type;*/ #define cpu_is_at32ap7000 () (0) -#endif +#endif /* __MACH_CPU_H__ */ arch/arm/mach-at91/setup.c +14
-1@@ -12,15 +12,28 @@#include <mach/hardware.h> #include <mach/cpu.h> +#include <mach/at91_dbgu.h> +#include <mach/at91_pmc.h> #include "soc.h" #include "generic.h" struct at91_soc __initdata at91_boot_soc; +struct at91_socinfo at91_soc_data; +EXPORT_SYMBOL (at91_soc_data); + +void __init at91rm9200_set_type (int type) +{ +if (type ==ARCH_REVISON_9200_PQFP ) + at91_soc_data.subtype =SOC_RM9200_BGA ; +else + at91_soc_data.subtype =SOC_RM9200_PQFP ; +} +void __init at91_init_irq_default (void ) { -at91_init_interrupts (current_soc.default_irq_priority); +at91_init_interrupts (at91_boot_soc.default_irq_priority); }void __init at91_init_interrupts (unsigned int *priority)
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 56
Quoted 5 lines
arch/arm/mach-at91/setup.c +2
-0@@ -39,35 +52,199 @@ static struct map_desc at91_io_desc __initdata = { .type = MT_DEVICE, }; +#define AT91_DBGU0 0xfffff200 +#define AT91_DBGU1 0xffffee00
This needs a comment explaining what the two bases are for, probably with a list of platforms which have the dbgu at each base.
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 59
Quoted 3 lines
arch/arm/mach-at91/setup.c +3
-0+ +static void soc_detect (u32 dbgu_base) +{
This looks far better than your previous patch, and is how I suggested it should have been done :-).
I think possibly that this function should return an boolean indicating whether or not it was able to detect the cpu, rather than the calling function checking the internals of the at91_soc_data structure.
Quoted 74 lines
arch/arm/mach-at91/setup.c +73
-0+u32 cidr, socid; + + cidr =__raw_readl (AT91_IO_P2V (dbgu_base) +AT91_DBGU_CIDR ); + socid = cidr & ~AT91_CIDR_VERSION ; +switch (socid) { +case ARCH_ID_AT572D940HF : + at91_soc_data.type =SOC_572D940HF ; +set_at91_boot_soc (at572d940hf_soc); +break ; + +case ARCH_ID_AT91CAP9 : { +#ifdef CONFIG_AT91_PMC_UNIT +u32 pmc_ver =at91_sys_read (AT91_PMC_VER ); + +if (pmc_ver ==ARCH_REVISION_CAP9_B ) + at91_soc_data.subtype =SOC_CAP9_REV_B ; +else if (pmc_ver ==ARCH_REVISION_CAP9_C ) + at91_soc_data.subtype =SOC_CAP9_REV_C ; +#endif + at91_soc_data.type =SOC_CAP9 ; +set_at91_boot_soc (at91cap9_soc); +break ; + } + +case ARCH_ID_AT91RM9200 : + at91_soc_data.type =SOC_RM9200 ; +set_at91_boot_soc (at91rm9200_soc); +break ; + +case ARCH_ID_AT91SAM9260 : + at91_soc_data.type =SOC_SAM9260 ; +set_at91_boot_soc (at91sam9260_soc); +break ; + +case ARCH_ID_AT91SAM9261 : + at91_soc_data.type =SOC_SAM9261 ; +set_at91_boot_soc (at91sam9261_soc); +break ; + +case ARCH_ID_AT91SAM9263 : + at91_soc_data.type =SOC_SAM9263 ; +set_at91_boot_soc (at91sam9263_soc); +break ; + +case ARCH_ID_AT91SAM9G20 : + at91_soc_data.type =SOC_SAM9G20 ; +set_at91_boot_soc (at91sam9260_soc); +break ; + +case ARCH_ID_AT91SAM9G45 : + at91_soc_data.type =SOC_SAM9G45 ; +if (cidr ==ARCH_ID_AT91SAM9G45ES ) + at91_soc_data.subtype =SOC_SAM9G45ES ; +set_at91_boot_soc (at91sam9g45_soc); +break ; + +case ARCH_ID_AT91SAM9RL64 : + at91_soc_data.type =SOC_SAM9RL ; +set_at91_boot_soc (at91sam9rl_soc); +break ; + +case ARCH_ID_AT91SAM9X5 : + at91_soc_data.type =SOC_SAM9X5 ; +set_at91_boot_soc (at91sam9x5_soc); +break ; + } + +/* at91sam9g10 */ +if ((cidr & ~AT91_CIDR_EXT ) ==ARCH_ID_AT91SAM9G10 ) { + at91_soc_data.type =SOC_SAM9G10 ; +set_at91_boot_soc (at91sam9261_soc); + } +/* at91sam9xe */
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 143
Quoted 10 lines
arch/arm/mach-at91/setup.c +10
-0+else if ((cidr &AT91_CIDR_ARCH ) ==ARCH_FAMILY_AT91SAM9XE ) { + at91_soc_data.type =SOC_SAM9260 ; + at91_soc_data.subtype =SOC_SAM9XE ; +set_at91_boot_soc (at91sam9260_soc); + } + +if (at91_soc_data.type ==SOC_AT91_NONE ) +return ; + + at91_soc_data.cidr = cidr;
Why not directly assign this to at91_soc_data.cidr above and remove the cidr local variable?
Quoted 6 lines
arch/arm/mach-at91/setup.c +6
-0+ +/* sub version of soc */ + at91_soc_data.exid =__raw_readl (AT91_IO_P2V (dbgu_base) +AT91_DBGU_EXID ); + +if (at91_soc_data.type ==SOC_SAM9G45 ) { +switch (at91_soc_data.exid) {
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 159
Quoted 10 lines
arch/arm/mach-at91/setup.c +10
-0+case ARCH_EXID_AT91SAM9M10 : + at91_soc_data.subtype =SOC_SAM9M10 ; +break ; +case ARCH_EXID_AT91SAM9G46 : + at91_soc_data.subtype =SOC_SAM9G46 ; +break ; +case ARCH_EXID_AT91SAM9M11 : + at91_soc_data.subtype =SOC_SAM9M11 ; +break ; + }
If we reused the ARCH_EXID_ defines, then the above could become:
at91_soc_data.subtype = at91_soc_data.exid;
Quoted 9 lines
arch/arm/mach-at91/setup.c +9
-0+ } + +if (at91_soc_data.type ==SOC_SAM9X5 ) { +switch (at91_soc_data.exid) { +case ARCH_EXID_AT91SAM9G15 : + at91_soc_data.subtype =SOC_SAM9G15 ; +break ; +case ARCH_EXID_AT91SAM9G35 : + at91_soc_data.subtype =SOC_SAM9G35 ;
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 178
Quoted 10 lines
arch/arm/mach-at91/setup.c +10
-0+break ; +case ARCH_EXID_AT91SAM9X35 : + at91_soc_data.subtype =SOC_SAM9X35 ; +break ; +case ARCH_EXID_AT91SAM9G25 : + at91_soc_data.subtype =SOC_SAM9G25 ; +break ; +case ARCH_EXID_AT91SAM9X25 : + at91_soc_data.subtype =SOC_SAM9X25 ; +break ;
and same here.
Quoted 11 lines
arch/arm/mach-at91/setup.c +11
-0+ } + } +} + +static const char *soc_name[] = { + [SOC_RM9200 ] ="at91rm9200" , + [SOC_572D940HF ] ="at572d940hf" , + [SOC_CAP9 ] ="at91cap9" , + [SOC_SAM9260 ] ="at91sam9260" , + [SOC_SAM9261 ] ="at91sam9261" , + [SOC_SAM9263 ] ="at91sam9263" ,
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 199
Quoted 10 lines
arch/arm/mach-at91/setup.c +10
-0+ [SOC_SAM9G10] = "at91sam9g10", + [SOC_SAM9G20] = "at91sam9g20", + [SOC_SAM9G45] = "at91sam9g45", + [SOC_SAM9RL] = "at91sam9rl", + [SOC_SAM9X5] = "at91sam9x5", + [SOC_AT91_NONE] = "Unknown" +}; + +const char *get_at91_soc_type (struct at91_socinfo *c) +{
Should probably be called at91_get_soc_type_name. Get get_type implies it will return the enum type value. I think the at91 prefix belongs at the start also.
Also, since at91_boot_soc is __initdata, the soc_name array should also be __initdata and this function should be __init.
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 204
Quoted 5 lines
arch/arm/mach-at91/setup.c +5
-0+return soc_name[c->type]; +} +EXPORT_SYMBOL (get_at91_soc_type); + +static const char *soc_subtype_name[] = {
__initdata
Quoted 9 lines
arch/arm/mach-at91/setup.c +9
-0+ [SOC_RM9200_BGA] = "at91rm9200 BGA", + [SOC_RM9200_PQFP] = "at91rm9200 PQFP", + [SOC_CAP9_REV_B] = "at91cap9 revB", + [SOC_CAP9_REV_C] = "at91cap9 revC", + [SOC_SAM9XE] = "at91sam9xe", + [SOC_SAM9G45ES] = "at91sam9g45es", + [SOC_SAM9M10] = "at91sam9m10", + [SOC_SAM9G46] = "at91sam9g46", + [SOC_SAM9M11] = "at91sam9m11",
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 223
Quoted 10 lines
arch/arm/mach-at91/setup.c +10
-0+ [SOC_SAM9G15] = "at91sam9g15", + [SOC_SAM9G35] = "at91sam9g35", + [SOC_SAM9X35] = "at91sam9x35", + [SOC_SAM9G25] = "at91sam9g25", + [SOC_SAM9X25] = "at91sam9x25", + [SOC_AT91_SUBTYPE_NONE] = "Unknown" +}; + +const char *get_at91_soc_subtype (struct at91_socinfo *c) +{
__init at91_get_soc_subtype_name
Quoted 29 lines
arch/arm/mach-at91/setup.c +4
-20+return soc_subtype_name[c->subtype]; +} +EXPORT_SYMBOL (get_at91_soc_subtype); +void __init at91_map_io (void ) {/* Map peripherals */ iotable_init (&at91_io_desc,1 ); -if (cpu_is_at572d940hf ()) - at91_boot_soc = at572d940hf_soc; -else 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; -else if (cpu_is_at91sam9rl ()) - at91_boot_soc = at91sam9rl_soc;
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 238
Quoted 10 lines
arch/arm/mach-at91/setup.c +6
-4-else if (cpu_is_at91sam9x5 ()) - at91_boot_soc = at91sam9x5_soc; -else -panic ("Impossible to detect the SOC type" ); + at91_soc_data.type =SOC_AT91_NONE ; + at91_soc_data.subtype =SOC_AT91_SUBTYPE_NONE ; + +soc_detect (AT91_DBGU0 ); +if (at91_soc_data.type ==SOC_AT91_NONE ) +soc_detect (AT91_DBGU1 );
This also needs a comment explaning why you are detecting the soc at two different addresses.
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 247
Quoted 9 lines
arch/arm/mach-at91/setup.c +9
-0+ +if (at91_soc_data.type ==SOC_AT91_NONE ) +panic ("AT91: Impossible to detect the SOC type" ); + +pr_info ("AT91: Detected soc type: %s\n" ,get_at91_soc_type (&at91_soc_data)); +pr_info ("AT91: Detected soc subtype: %s\n" ,get_at91_soc_subtype (&at91_soc_data)); + +if (!at91_boot_soc.init) +panic ("AT91: Soc not enabled" );
I would still like to see if it is possible to reorder these patches so that this intermediate rewrite is not needed.
arch/arm/mach-at91/soc.h extern struct at91_soc at91sam9263_soc; · line 24
Quoted 13 lines
arch/arm/mach-at91/setup.c +0
-0if (at91_boot_soc.map_io) at91_boot_soc.map_io ();arch/arm/mach-at91/soc.h +2
-0@@ -20,3 +20,41 @@ extern struct at91_soc at91sam9263_soc;extern struct at91_soc at91sam9g45_soc;extern struct at91_soc at91sam9rl_soc;extern struct at91_soc at91sam9x5_soc; + +#define set_at91_boot_soc (c) do { at91_boot_soc = c; } while(0)
Should be a static inline function.
arch/arm/mach-at91/soc.h extern struct at91_soc at91sam9263_soc; · line 28
Quoted 4 lines
arch/arm/mach-at91/soc.h +4
-0+ +#if !defined(CONFIG_ARCH_AT572D940HF ) +#define at572d940hf_soc at91_boot_soc +#endif
Possibly this needs to be reworked a little so that the user gets an informative if the soc type is detected correctly, but support for the soc is not included in the kernel?
~Ryan
Signature · 7 lines
Bluewater Systems Ltd - ARM Technology Solution Centre Ryan Mallon 5 Amuri Park, 404 Barbadoes St ryan at bluewatersys.com PO Box 13 889, Christchurch 8013 http://www.bluewatersys.com New Zealand Phone: +64 3 3779127 Freecall: Australia 1800 148 751 Fax: +64 3 3779135 USA 1800 261 2934
PATCH 5/9 at91: use structure to store the current soc
Quoted 11 lines
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 59
Quoted 4 lines
arch/arm/mach-at91/setup.c +3
-0+ +static void soc_detect (u32 dbgu_base) +{This looks far better than your previous patch, and is how I suggested it should have been done :-).
I think possibly that this function should return an boolean indicating whether or not it was able to detect the cpu, rather than the calling function checking the internals of the
at91_soc_datastructure.
no need as at91_soc_data.type is init to SOC_AT91_NONE first this ways we use less code
Quoted 40 lines
Quoted 29 lines
arch/arm/mach-at91/setup.c +27
-0+u32 cidr, socid; + + cidr =__raw_readl (AT91_IO_P2V (dbgu_base) +AT91_DBGU_CIDR ); + socid = cidr & ~AT91_CIDR_VERSION ; +switch (socid) { +case ARCH_ID_AT572D940HF : + at91_soc_data.type =SOC_572D940HF ; +set_at91_boot_soc (at572d940hf_soc); +break ; + +case ARCH_ID_AT91CAP9 : { +#ifdef CONFIG_AT91_PMC_UNIT +u32 pmc_ver =at91_sys_read (AT91_PMC_VER ); + +if (pmc_ver ==ARCH_REVISION_CAP9_B ) + at91_soc_data.subtype =SOC_CAP9_REV_B ; +else if (pmc_ver ==ARCH_REVISION_CAP9_C ) + at91_soc_data.subtype =SOC_CAP9_REV_C ; +#endif + at91_soc_data.type =SOC_CAP9 ; +set_at91_boot_soc (at91cap9_soc); +break ; + } + +case ARCH_ID_AT91RM9200 : + at91_soc_data.type =SOC_RM9200 ; +set_at91_boot_soc (at91rm9200_soc);arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 97
Quoted 10 lines
arch/arm/mach-at91/setup.c +10
-0+break ; + +case ARCH_ID_AT91SAM9260 : + at91_soc_data.type =SOC_SAM9260 ; +set_at91_boot_soc (at91sam9260_soc); +break ; + +case ARCH_ID_AT91SAM9261 : + at91_soc_data.type =SOC_SAM9261 ; +set_at91_boot_soc (at91sam9261_soc);+
Quoted 7 lines
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 143
Quoted 4 lines
arch/arm/mach-at91/setup.c +4
-0+if (at91_soc_data.type ==SOC_AT91_NONE ) +return ; + + at91_soc_data.cidr = cidr;Why not directly assign this to at91_soc_data.cidr above and remove the cidr local variable?
because I prefer to udpate the global struct only if we detect the soc
Quoted 6 lines
Quoted 5 lines
arch/arm/mach-at91/setup.c +4
-0+ +/* sub version of soc */ + at91_soc_data.exid =__raw_readl (AT91_IO_P2V (dbgu_base) +AT91_DBGU_EXID ); +
Quoted 8 lines
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 159
Quoted 4 lines
arch/arm/mach-at91/setup.c +4
-0+case ARCH_EXID_AT91SAM9M11 : + at91_soc_data.subtype =SOC_SAM9M11 ; +break ; + }If we reused the
ARCH_EXID_defines, then the above could become:at91_soc_data.subtype = at91_soc_data.exid;
as sais in the commint comment to have a uniq subtype accross soc as example g35 and 9m11 have the same exid
Quoted 10 lines
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 199
Quoted 5 lines
arch/arm/mach-at91/setup.c +3
-0+ +const char *get_at91_soc_type (struct at91_socinfo *c) +{Should probably be called
at91_get_soc_type_name. Getget_typeimplies it will return the enum type value. I think the at91 prefix belongs at the start also.
Quoted 2 lines
Also, since
at91_boot_socis__initdata, thesoc_namearray should also be__initdataand this function should be__init.
no this data will be use for sysfs export later
and at91_soc_data is not __initdata
Quoted 13 lines
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 247
Quoted 10 lines
arch/arm/mach-at91/setup.c +9
-0+ +if (at91_soc_data.type ==SOC_AT91_NONE ) +panic ("AT91: Impossible to detect the SOC type" ); + +pr_info ("AT91: Detected soc type: %s\n" ,get_at91_soc_type (&at91_soc_data)); +pr_info ("AT91: Detected soc subtype: %s\n" ,get_at91_soc_subtype (&at91_soc_data)); + +if (!at91_boot_soc.init) +panic ("AT91: Soc not enabled" );I would still like to see if it is possible to reorder these patches so that this intermediate rewrite is not needed.
there is none intermedaite write
Quoted 16 lines
Quoted 9 lines
arch/arm/mach-at91/setup.c +0
-0if (at91_boot_soc.map_io) at91_boot_soc.map_io ();arch/arm/mach-at91/soc.h +0
-0arch/arm/mach-at91/soc.h extern struct at91_soc at91sam9263_soc; · line 24
Quoted 5 lines
arch/arm/mach-at91/soc.h +2
-0@@ -20,3 +20,41 @@ extern struct at91_soc at91sam9263_soc;extern struct at91_soc at91sam9g45_soc;extern struct at91_soc at91sam9rl_soc;extern struct at91_soc at91sam9x5_soc; + +#define set_at91_boot_soc (c) do { at91_boot_soc = c; } while(0)Should be a static inline function.
a macro is fine here
Quoted 9 lines
arch/arm/mach-at91/soc.h extern struct at91_soc at91sam9263_soc; · line 28
Quoted 5 lines
arch/arm/mach-at91/soc.h +4
-0+ +#if !defined(CONFIG_ARCH_AT572D940HF ) +#define at572d940hf_soc at91_boot_soc +#endif Possibly this needs to be reworked a little so that the user gets an informative if the soc type is detected correctly, but support for the soc is not included in the kernel?
it's already the case
Best Regards,
J.
PATCH 5/9 at91: use structure to store the current soc
Quoted 8 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 8 lines
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 59
Quoted 4 lines
arch/arm/mach-at91/setup.c +3
-0+ +static void soc_detect (u32 dbgu_base) +{This looks far better than your previous patch, and is how I suggested it should have been done :-).
Quoted 5 lines
Quoted 3 lines
I think possibly that this function should return an boolean indicating whether or not it was able to detect the cpu, rather than the calling function checking the internals of the
at91_soc_datastructure.no need as at91_soc_data.type is init to
SOC_AT91_NONEfirst this ways we use less code
Read the second part of my sentence. I think it is clearer/cleaner to have a return value specifying that the soc detection failed rather than checking the internals of the structure.
Quoted 40 lines
Quoted 40 lines
Quoted 29 lines
arch/arm/mach-at91/setup.c +27
-0+u32 cidr, socid; + + cidr =__raw_readl (AT91_IO_P2V (dbgu_base) +AT91_DBGU_CIDR ); + socid = cidr & ~AT91_CIDR_VERSION ; +switch (socid) { +case ARCH_ID_AT572D940HF : + at91_soc_data.type =SOC_572D940HF ; +set_at91_boot_soc (at572d940hf_soc); +break ; + +case ARCH_ID_AT91CAP9 : { +#ifdef CONFIG_AT91_PMC_UNIT +u32 pmc_ver =at91_sys_read (AT91_PMC_VER ); + +if (pmc_ver ==ARCH_REVISION_CAP9_B ) + at91_soc_data.subtype =SOC_CAP9_REV_B ; +else if (pmc_ver ==ARCH_REVISION_CAP9_C ) + at91_soc_data.subtype =SOC_CAP9_REV_C ; +#endif + at91_soc_data.type =SOC_CAP9 ; +set_at91_boot_soc (at91cap9_soc); +break ; + } + +case ARCH_ID_AT91RM9200 : + at91_soc_data.type =SOC_RM9200 ; +set_at91_boot_soc (at91rm9200_soc);arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 97
Quoted 10 lines
arch/arm/mach-at91/setup.c +10
-0+break ; + +case ARCH_ID_AT91SAM9260 : + at91_soc_data.type =SOC_SAM9260 ; +set_at91_boot_soc (at91sam9260_soc); +break ; + +case ARCH_ID_AT91SAM9261 : + at91_soc_data.type =SOC_SAM9261 ; +set_at91_boot_soc (at91sam9261_soc);+
Quoted 8 lines
Quoted 7 lines
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 143
Quoted 4 lines
arch/arm/mach-at91/setup.c +4
-0+if (at91_soc_data.type ==SOC_AT91_NONE ) +return ; + + at91_soc_data.cidr = cidr;Why not directly assign this to at91_soc_data.cidr above and remove the cidr local variable?
because I prefer to udpate the global struct only if we detect the soc
Okay.
Quoted 13 lines
Quoted 13 lines
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 159
Quoted 10 lines
arch/arm/mach-at91/setup.c +8
-0+ +/* sub version of soc */ + at91_soc_data.exid =__raw_readl (AT91_IO_P2V (dbgu_base) +AT91_DBGU_EXID ); + +case ARCH_EXID_AT91SAM9M11 : + at91_soc_data.subtype =SOC_SAM9M11 ; +break ; + }If we reused the
ARCH_EXID_defines, then the above could become:
Quoted 3 lines
Quoted 1 line
at91_soc_data.subtype = at91_soc_data.exid;as sais in the commint comment to have a uniq subtype accross soc as example g35 and 9m11 have the same exid
Why is this necessary? The cpu_is_macros, which are the _only_ way that the cpu/soc type should ever be checked, can do this. For example:
#define cpu_is_at91sam9m11() \ (at91_soc_data.type == ARCH_ID_AT91SAM9G45 && at91_soc_data.subtype == ARCH_EXID_AT91SAM9M11)
This way you don't need any extra #defines, and the switch statements for the exid in soc_detect can be removed.
This would also result in a smaller impact change since the cpu_is macros would still work exactly the same, just the method used to read the id and exid change.
Quoted 8 lines
Quoted 8 lines
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 199
Quoted 3 lines
arch/arm/mach-at91/setup.c +3
-0+ +const char *get_at91_soc_type (struct at91_socinfo *c) +{Should probably be called
at91_get_soc_type_name. Getget_typeimplies it will return the enum type value. I think the at91 prefix belongs at the start also.
Quoted 4 lines
Quoted 2 lines
Also, since
at91_boot_socis__initdata, thesoc_namearray should also be__initdataand this function should be__init.no this data will be use for sysfs export later
andat91_soc_datais not__initdata
Okay. I still think the function names should be changed.
Quoted 13 lines
Quoted 13 lines
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 247
Quoted 10 lines
arch/arm/mach-at91/setup.c +9
-0+ +if (at91_soc_data.type ==SOC_AT91_NONE ) +panic ("AT91: Impossible to detect the SOC type" ); + +pr_info ("AT91: Detected soc type: %s\n" ,get_at91_soc_type (&at91_soc_data)); +pr_info ("AT91: Detected soc subtype: %s\n" ,get_at91_soc_subtype (&at91_soc_data)); + +if (!at91_boot_soc.init) +panic ("AT91: Soc not enabled" );I would still like to see if it is possible to reorder these patches so that this intermediate rewrite is not needed.
Quoted 1 line
there is none intermedaite write
You snipped it out in the reply :-). Patch 2/9 adds soc detection in at91_map_io via a series of 'if (cpu_is_xxx)' statements. This patch then removes that method and replaces it with the switch statement in soc_detect. It would be nice to try and avoid the intermediate step in at91_map_io since it only exists for three commits.
Quoted 15 lines
Quoted 15 lines
arch/arm/mach-at91/soc.h extern struct at91_soc at91sam9263_soc; · line 24
Quoted 13 lines
arch/arm/mach-at91/setup.c +0
-0if (at91_boot_soc.map_io) at91_boot_soc.map_io ();arch/arm/mach-at91/soc.h +2
-0@@ -20,3 +20,41 @@ extern struct at91_soc at91sam9263_soc;extern struct at91_soc at91sam9g45_soc;extern struct at91_soc at91sam9rl_soc;extern struct at91_soc at91sam9x5_soc; + +#define set_at91_boot_soc (c) do { at91_boot_soc = c; } while(0)Should be a static inline function.
Quoted 1 line
a macro is fine here
Static inlines are the preferred method wherever possible.
Quoted 10 lines
Quoted 9 lines
arch/arm/mach-at91/soc.h extern struct at91_soc at91sam9263_soc; · line 28
Quoted 5 lines
arch/arm/mach-at91/soc.h +4
-0+ +#if !defined(CONFIG_ARCH_AT572D940HF ) +#define at572d940hf_soc at91_boot_soc +#endif Possibly this needs to be reworked a little so that the user gets an informative if the soc type is detected correctly, but support for the soc is not included in the kernel?
it's already the case
Okay.
Thanks,
~Ryan
Signature · 7 lines
Bluewater Systems Ltd - ARM Technology Solution Centre Ryan Mallon 5 Amuri Park, 404 Barbadoes St ryan at bluewatersys.com PO Box 13 889, Christchurch 8013 http://www.bluewatersys.com New Zealand Phone: +64 3 3779127 Freecall: Australia 1800 148 751 Fax: +64 3 3779135 USA 1800 261 2934
PATCH 5/9 at91: use structure to store the current soc
Quoted 12 lines · Ryan Mallon
Quoted 11 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 11 lines
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 59
Quoted 4 lines
arch/arm/mach-at91/setup.c +3
-0+ +static void soc_detect (u32 dbgu_base) +{This looks far better than your previous patch, and is how I suggested it should have been done :-).
I think possibly that this function should return an boolean indicating whether or not it was able to detect the cpu, rather than the calling function checking the internals of the
at91_soc_datastructure.
Quoted 6 lines
Quoted 2 lines
no need as at91_soc_data.type is init to
SOC_AT91_NONEfirst this ways we use less codeRead the second part of my sentence. I think it is clearer/cleaner to have a return value specifying that the soc detection failed rather than checking the internals of the structure.
no the init of the struct is done on purpose to mach with the string table and set as not detectd for type and subtype first
add a return to the soc detection just increase the code where the information si already present in the structure
Quoted 20 lines
Quoted 9 lines
Quoted 9 lines
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 159
Quoted 6 lines
arch/arm/mach-at91/setup.c +4
-0+case ARCH_EXID_AT91SAM9M11 : + at91_soc_data.subtype =SOC_SAM9M11 ; +break ; + }If we reused the
ARCH_EXID_defines, then the above could become:Quoted 3 lines
Quoted 1 line
at91_soc_data.subtype = at91_soc_data.exid;as sais in the commint comment to have a uniq subtype accross soc as example g35 and 9m11 have the same exid
Why is this necessary? The
cpu_is_macros, which are the _only_ way that the cpu/soc type should ever be checked, can do this. For example:#define cpu_is_at91sam9m11() \ (at91_soc_data.type == ARCH_ID_AT91SAM9G45 && at91_soc_data.subtype == ARCH_EXID_AT91SAM9M11)
Quoted 6 lines
This way you don't need any extra #defines, and the switch statements for the exid in
soc_detectcan be removed.This would also result in a smaller impact change since the
cpu_ismacros would still work exactly the same, just the method used to read the id and exid change.
no more code and more assembly
furthermore we associate the subtype with the subtype name where each entry are uniq
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 199
Quoted 4 lines
arch/arm/mach-at91/setup.c +3
-0+ +const char *get_at91_soc_type (struct at91_socinfo *c) +{Should probably be called
at91_get_soc_type_name. Getget_typeimplies it will return the enum type value. I think the at91 prefix belongs at the start also.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Also, since
at91_boot_socis__initdata, thesoc_namearray should also be__initdataand this function should be__init.no this data will be use for sysfs export later
andat91_soc_datais not__initdataOkay. I still think the function names should be changed.
we use the same convention on sh and it's clear for me
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 247
Quoted 11 lines
arch/arm/mach-at91/setup.c +9
-0+ +if (at91_soc_data.type ==SOC_AT91_NONE ) +panic ("AT91: Impossible to detect the SOC type" ); + +pr_info ("AT91: Detected soc type: %s\n" ,get_at91_soc_type (&at91_soc_data)); +pr_info ("AT91: Detected soc subtype: %s\n" ,get_at91_soc_subtype (&at91_soc_data)); + +if (!at91_boot_soc.init) +panic ("AT91: Soc not enabled" );I would still like to see if it is possible to reorder these patches so that this intermediate rewrite is not needed.
Quoted 7 lines
Quoted 1 line
there is none intermedaite write
You snipped it out in the reply :-). Patch 2/9 adds soc detection in
at91_map_iovia a series of 'if (cpu_is_xxx)' statements. This patch then removes that method and replaces it with the switch statement insoc_detect. It would be nice to try and avoid the intermediate step inat91_map_iosince it only exists for three commits.
no this two different changes with huge impact first one factorize the map_io and change the AT91_BASE_SYS
so I do prefer to keep them seperated and bre able to bisect them
Best Resgards,
J.
PATCH 5/9 at91: use structure to store the current soc
Quoted 16 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 15 lines · Ryan Mallon
Quoted 13 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 11 lines
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 59
Quoted 4 lines
arch/arm/mach-at91/setup.c +3
-0+ +static void soc_detect (u32 dbgu_base) +{This looks far better than your previous patch, and is how I suggested it should have been done :-).
I think possibly that this function should return an boolean indicating whether or not it was able to detect the cpu, rather than the calling function checking the internals of the
at91_soc_datastructure.no need as at91_soc_data.type is init to
SOC_AT91_NONEfirst this ways we use less code
Quoted 7 lines
Quoted 3 lines
Read the second part of my sentence. I think it is clearer/cleaner to have a return value specifying that the soc detection failed rather than checking the internals of the structure.
no the init of the struct is done on purpose to mach with the string table and set as not detectd for type and subtype first
add a return to the soc detection just increase the code where the information si already present in the structure
You are missing the point. You have a function called soc_detect which returns void. It modifies a structure called at91_soc_data (this is not obvious from looking just at the function declaration) and returns information via that same structure (which again, is not clear to the casual observe looking just at the prototype or usage). If you have:
bool at91_soc_detect(struct at91_soc *soc);
Then it becomes more clear that the passed in soc pointer is what gets filled in, and the return value will be true or false depending on whether the soc was detected or not. It's not worth saving lines of code to make something less clear.
Quoted 20 lines
Quoted 20 lines
Quoted 9 lines
Quoted 9 lines
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 159
Quoted 6 lines
arch/arm/mach-at91/setup.c +4
-0+case ARCH_EXID_AT91SAM9M11 : + at91_soc_data.subtype =SOC_SAM9M11 ; +break ; + }If we reused the
ARCH_EXID_defines, then the above could become:Quoted 3 lines
Quoted 1 line
at91_soc_data.subtype = at91_soc_data.exid;as sais in the commint comment to have a uniq subtype accross soc as example g35 and 9m11 have the same exid
Why is this necessary? The
cpu_is_macros, which are the _only_ way that the cpu/soc type should ever be checked, can do this. For example:#define cpu_is_at91sam9m11() \ (at91_soc_data.type == ARCH_ID_AT91SAM9G45 && at91_soc_data.subtype == ARCH_EXID_AT91SAM9M11)
Quoted 8 lines
Quoted 6 lines
This way you don't need any extra #defines, and the switch statements for the exid in
soc_detectcan be removed.This would also result in a smaller impact change since the
cpu_ismacros would still work exactly the same, just the method used to read the id and exid change.no more code and more assembly
Why?
Quoted 2 lines
furthermore we associate the subtype with the subtype name where each entry are uniq
You could add:
const char *name; char *subtype_name;
To at91_soc_data. The name field can be directly assigned in the at91xxx.c files and the subtype name can be assigned when it is detected (which is why it can't be const). The removes the need for the type/subtype lookup tables.
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 199
Quoted 5 lines
arch/arm/mach-at91/setup.c +3
-0+ +const char *get_at91_soc_type (struct at91_socinfo *c) +{Should probably be called
at91_get_soc_type_name. Getget_typeimplies it will return the enum type value. I think the at91 prefix belongs at the start also.
Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Also, since
at91_boot_socis__initdata, thesoc_namearray should also be__initdataand this function should be__init.no this data will be use for sysfs export later
andat91_soc_datais not__initdataOkay. I still think the function names should be changed.
we use the same convention on sh and it's clear for me
It is common for exported functions to be prefixed with the subsystem they belong to, in this case at91. Just because some other subsystem does it a different way doesn't mean we should repeat the mistake.
If you replace the type/subtype name lookup as I described above then it's moot anyway since you can just read at91_soc_data.name/subtype directly.
Quoted 21 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 247
Quoted 11 lines
arch/arm/mach-at91/setup.c +9
-0+ +if (at91_soc_data.type ==SOC_AT91_NONE ) +panic ("AT91: Impossible to detect the SOC type" ); + +pr_info ("AT91: Detected soc type: %s\n" ,get_at91_soc_type (&at91_soc_data)); +pr_info ("AT91: Detected soc subtype: %s\n" ,get_at91_soc_subtype (&at91_soc_data)); + +if (!at91_boot_soc.init) +panic ("AT91: Soc not enabled" );I would still like to see if it is possible to reorder these patches so that this intermediate rewrite is not needed.
Quoted 7 lines
Quoted 1 line
there is none intermedaite write
You snipped it out in the reply :-). Patch 2/9 adds soc detection in
at91_map_iovia a series of 'if (cpu_is_xxx)' statements. This patch then removes that method and replaces it with the switch statement insoc_detect. It would be nice to try and avoid the intermediate step inat91_map_iosince it only exists for three commits.
Quoted 4 lines
no this two different changes with huge impact first one factorize the
map_ioand change theAT91_BASE_SYSso I do prefer to keep them seperated and bre able to bisect them
This patch could be made the first patch in the series since it doesn't (AFAICT) depend on AT91_BASE_SYS being generic since it uses internal defines for the two DBGU bases. So this patch would introduce an (possibly unused) soc_detection function, which can be put into use by the subsequent patches.
This would make the patch series easier to review since the change to move to soc detection only gets made once, not twice as it is now.
~Ryan
Signature · 7 lines
Bluewater Systems Ltd - ARM Technology Solution Centre Ryan Mallon 5 Amuri Park, 404 Barbadoes St ryan at bluewatersys.com PO Box 13 889, Christchurch 8013 http://www.bluewatersys.com New Zealand Phone: +64 3 3779127 Freecall: Australia 1800 148 751 Fax: +64 3 3779135 USA 1800 261 2934
PATCH 5/9 at91: use structure to store the current soc
Quoted 20 lines · Ryan Mallon
Quoted 19 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 18 lines · Ryan Mallon
Quoted 8 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 8 lines
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 59
Quoted 4 lines
arch/arm/mach-at91/setup.c +3
-0+ +static void soc_detect (u32 dbgu_base) +{This looks far better than your previous patch, and is how I suggested it should have been done :-).
Quoted 5 lines
Quoted 3 lines
I think possibly that this function should return an boolean indicating whether or not it was able to detect the cpu, rather than the calling function checking the internals of the
at91_soc_datastructure.no need as at91_soc_data.type is init to
SOC_AT91_NONEfirst this ways we use less codeRead the second part of my sentence. I think it is clearer/cleaner to have a return value specifying that the soc detection failed rather than checking the internals of the structure.
Quoted 8 lines
Quoted 4 lines
no the init of the struct is done on purpose to mach with the string table and set as not detectd for type and subtype first
add a return to the soc detection just increase the code where the information si already present in the structureYou are missing the point. You have a function called
soc_detectwhich returns void. It modifies a structure calledat91_soc_data(this is not obvious from looking just at the function declaration) and returns
no sorry it's very clear
at91 for the archsoc_data data related to the soc
you can see 1000 times of time in the kernelgic_datacpu_data etc....
Quoted 9 lines
information via that same structure (which again, is not clear to the casual observe looking just at the prototype or usage). If you have:
bool at91_soc_detect(struct at91_soc *soc);Then it becomes more clear that the passed in soc pointer is what gets filled in, and the return value will be true or false depending on whether the soc was detected or not. It's not worth saving lines of code to make something less clear.
we have one soc no need to pass a pointer it's not a cpu where you can have multiple one in a soc
Quoted 24 lines
Quoted 24 lines
Quoted 24 lines
Quoted 10 lines
Quoted 10 lines
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 159
Quoted 7 lines
arch/arm/mach-at91/setup.c +4
-0+case ARCH_EXID_AT91SAM9M11 : + at91_soc_data.subtype =SOC_SAM9M11 ; +break ; + }If we reused the
ARCH_EXID_defines, then the above could become:Quoted 3 lines
Quoted 1 line
at91_soc_data.subtype = at91_soc_data.exid;as sais in the commint comment to have a uniq subtype accross soc as example g35 and 9m11 have the same exid
Why is this necessary? The
cpu_is_macros, which are the _only_ way that the cpu/soc type should ever be checked, can do this. For example:#define cpu_is_at91sam9m11() \ (at91_soc_data.type == ARCH_ID_AT91SAM9G45 && at91_soc_data.subtype == ARCH_EXID_AT91SAM9M11)This way you don't need any extra #defines, and the switch statements for the exid in
soc_detectcan be removed.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
This would also result in a smaller impact change since the
cpu_ismacros would still work exactly the same, just the method used to read the id and exid change.no more code and more assembly
Why?
two test to do everytime simple
compare to one
Quoted 6 lines
Quoted 3 lines
furthermore we associate the subtype with the subtype name where each entry are uniq
You could add:
Quoted 7 lines
const char *name; char *subtype_name;To
at91_soc_data. The name field can be directly assigned in theat91xxx.cfiles and the subtype name can be assigned when it is detected (which is why it can't be const). The removes the need for the type/subtype lookup tables.
no as we need to stock all the soc name here and it much more clear to get them together and link to the enum type
and if the soc is not enable you can not have the name so impossible to inform the user about which we detect and this will add too much ifdef
so no
Quoted 20 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 199
Quoted 7 lines
arch/arm/mach-at91/setup.c +3
-0+ +const char *get_at91_soc_type (struct at91_socinfo *c) +{Should probably be called
at91_get_soc_type_name. Getget_typeimplies it will return the enum type value. I think the at91 prefix belongs at the start also.Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Also, since
at91_boot_socis__initdata, thesoc_namearray should also be__initdataand this function should be__init.no this data will be use for sysfs export later
andat91_soc_datais not__initdataOkay. I still think the function names should be changed.
we use the same convention on sh and it's clear for me
Quoted 7 lines
It is common for exported functions to be prefixed with the subsystem they belong to, in this case at91. Just because some other subsystem does it a different way doesn't mean we should repeat the mistake.
If you replace the type/subtype name lookup as I described above then it's moot anyway since you can just read at91_soc_data.name/subtype directly.
sorry I still not convince and keep the current naming convention and replace the lookup will not work
Quoted 27 lines
Quoted 22 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
arch/arm/mach-at91/setup.c static struct map_desc at91_io_desc __initdata = { · line 247
Quoted 12 lines
arch/arm/mach-at91/setup.c +9
-0+ +if (at91_soc_data.type ==SOC_AT91_NONE ) +panic ("AT91: Impossible to detect the SOC type" ); + +pr_info ("AT91: Detected soc type: %s\n" ,get_at91_soc_type (&at91_soc_data)); +pr_info ("AT91: Detected soc subtype: %s\n" ,get_at91_soc_subtype (&at91_soc_data)); + +if (!at91_boot_soc.init) +panic ("AT91: Soc not enabled" );I would still like to see if it is possible to reorder these patches so that this intermediate rewrite is not needed.
Quoted 7 lines
Quoted 1 line
there is none intermedaite write
You snipped it out in the reply :-). Patch 2/9 adds soc detection in
at91_map_iovia a series of 'if (cpu_is_xxx)' statements. This patch then removes that method and replaces it with the switch statement insoc_detect. It would be nice to try and avoid the intermediate step inat91_map_iosince it only exists for three commits.Quoted 4 lines
no this two different changes with huge impact first one factorize the
map_ioand change theAT91_BASE_SYSso I do prefer to keep them seperated and bre able to bisect them
Quoted 8 lines
This patch could be made the first patch in the series since it doesn't (AFAICT) depend on
AT91_BASE_SYSbeing generic since it uses internal defines for the two DBGU bases. So this patch would introduce an (possibly unused)soc_detectionfunction, which can be put into use by the subsequent patches.This would make the patch series easier to review since the change to move to soc detection only gets made once, not twice as it is now.
no I prefer to change the AT91_BASE_SYS first and touch the board then add the real soc detection
The change of the memory must be first and it's impact alot of code
Best Regards,
J.
PATCH 5/9 at91: use structure to store the current soc
hi,
Quoted 4 lines
Quoted 3 lines
You are missing the point. You have a function called
soc_detectwhich returns void. It modifies a structure calledat91_soc_data(this is not obvious from looking just at the function declaration) and returnsno sorry it's very clear
Even better would be:
struct at91_soc* at91_soc_detect();
It returns NULL if the AT91 is not detected or not supported in the kernel image.
Quoted 6 lines
at91 for the arch
soc_datadata related to the socyou can see 1000 times of time in the kernel
gic_datacpu_dataetc....
If it's a shared with other ARM processors (ie, OMAP, PXA, etc), then soc_data. If it's only used on AT91 processors, then it gets prefixed with at91_.
Regards,
Andrew Victor
PATCH 5/9 at91: use structure to store the current soc
Quoted 5 lines · Andrew Victor
hi,
Quoted 3 lines
Quoted 3 lines
You are missing the point. You have a function called
soc_detectwhich returns void. It modifies a structure calledat91_soc_data(this is not obvious from looking just at the function declaration) and returns
Quoted 7 lines
Quoted 1 line
no sorry it's very clear
Even better would be:
struct at91_soc* at91_soc_detect();It returns NULL if the AT91 is not detected or not supported in the kernel image.
no NULL we not allow to distingish both
the current implementation allow it already
Quoted 11 lines
Quoted 8 lines
at91 for the arch
soc_datadata related to the socyou can see 1000 times of time in the kernel
gic_datacpu_dataetc....If it's a shared with other ARM processors (ie, OMAP, PXA, etc), then
soc_data. If it's only used on AT91 processors, then it gets prefixed withat91_.
this is already the case
Best Regards,
J.
PATCH 5/9 at91: use structure to store the current soc
In reply to Jean-Christophe PLAGNIOL-VILLARDHi all,
Le 11/05/2011 06:19, Jean-Christophe PLAGNIOL-VILLARD :
Quoted 41 lines · Ryan Mallon
Quoted 20 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 19 lines · Ryan Mallon
Quoted 18 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 8 lines
Quoted 8 lines
Review
Quoted 4 lines
(quoted diff) +3
-0+ +static void soc_detect(u32 dbgu_base) +{This looks far better than your previous patch, and is how I suggested it should have been done :-).
Quoted 5 lines
Quoted 3 lines
I think possibly that this function should return an boolean indicating whether or not it was able to detect the cpu, rather than the calling function checking the internals of the
at91_soc_datastructure.no need as at91_soc_data.type is init to
SOC_AT91_NONEfirst this ways we use less codeRead the second part of my sentence. I think it is clearer/cleaner to have a return value specifying that the soc detection failed rather than checking the internals of the structure.
Quoted 8 lines
Quoted 4 lines
no the init of the struct is done on purpose to mach with the string table and set as not detectd for type and subtype first
add a return to the soc detection just increase the code where the information si already present in the structureYou are missing the point. You have a function called
soc_detectwhich returns void. It modifies a structure calledat91_soc_data(this is not obvious from looking just at the function declaration) and returnsno sorry it's very clear
at91 for the arch
soc_datadata related to the socyou can see 1000 times of time in the kernel
gic_datacpu_dataetc....Quoted 3 lines
information via that same structure (which again, is not clear to the casual observe looking just at the prototype or usage). If you have:
Quoted 8 lines
Quoted 6 lines
bool at91_soc_detect(struct at91_soc *soc);Then it becomes more clear that the passed in soc pointer is what gets filled in, and the return value will be true or false depending on whether the soc was detected or not. It's not worth saving lines of code to make something less clear.
we have one soc no need to pass a pointer it's not a cpu where you can have multiple one in a soc
It is true that having some feedback form the function is a common habit. I like the proposition form Andew:
struct at91_soc* at91_soc_detect(xxx);
But on the other hand it tends to make you thing that this functions is internally allocating the structure... So it seems that we need to reach another consensus on this ;-)
[..]
Quoted 12 lines
Quoted 5 lines
Quoted 2 lines
furthermore we associate the subtype with the subtype name where each entry are uniq
You could add:
Quoted 7 lines
const char *name; char *subtype_name;To
at91_soc_data. The name field can be directly assigned in theat91xxx.cfiles and the subtype name can be assigned when it is detected (which is why it can't be const). The removes the need for the type/subtype lookup tables.
Quoted 5 lines
no as we need to stock all the soc name here and it much more clear to get them together and link to the enum type
and if the soc is not enable you can not have the name so impossible to inform the user about which we detect and this will add too much ifdef
Yes, the main argument here is that we should tell the use which chips is actually detected even if its support is not included in the kernel configuration.
[..]
Quoted 15 lines
Quoted 15 lines
Quoted 14 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+const char *get_at91_soc_type(struct at91_socinfo *c) +{Should probably be called
at91_get_soc_type_name. Getget_typeimplies it will return the enum type value. I think the at91 prefix belongs at the start also.Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Also, since
at91_boot_socis__initdata, thesoc_namearray should also be__initdataand this function should be__init.no this data will be use for sysfs export later
andat91_soc_datais not__initdataOkay. I still think the function names should be changed.
we use the same convention on sh and it's clear for me
Quoted 8 lines
Quoted 7 lines
It is common for exported functions to be prefixed with the subsystem they belong to, in this case at91. Just because some other subsystem does it a different way doesn't mean we should repeat the mistake.
If you replace the type/subtype name lookup as I described above then it's moot anyway since you can just read at91_soc_data.name/subtype directly.
sorry I still not convince and keep the current naming convention
I also like the at91_ prefix for everything that belongs to the machine subsystem. I agree with Ryan: if it returns a string, it should be called at91_get_type_name().
One more comment: your enum is called "sub_type" and the function is called "subtype". I would have unified the names: => enum soc_subtype {}
Quoted 1 line
and replace the lookup will not work
Ok with that.
[..]
Quoted 20 lines
Quoted 20 lines
Quoted 9 lines
Quoted 9 lines
Quoted 3 lines
Quoted 2 lines
I would still like to see if it is possible to reorder these patches so that this intermediate rewrite is not needed.
there is none intermedaite write
You snipped it out in the reply :-). Patch 2/9 adds soc detection in
at91_map_iovia a series of 'if (cpu_is_xxx)' statements. This patch then removes that method and replaces it with the switch statement insoc_detect. It would be nice to try and avoid the intermediate step inat91_map_iosince it only exists for three commits.Quoted 4 lines
no this two different changes with huge impact first one factorize the
map_ioand change theAT91_BASE_SYSso I do prefer to keep them seperated and bre able to bisect them
This patch could be made the first patch in the series since it doesn't (AFAICT) depend on
AT91_BASE_SYSbeing generic since it uses internal defines for the two DBGU bases. So this patch would introduce an (possibly unused)soc_detectionfunction, which can be put into use by the subsequent patches.
Quoted 7 lines
Quoted 2 lines
This would make the patch series easier to review since the change to move to soc detection only gets made once, not twice as it is now.
no I prefer to change the
AT91_BASE_SYSfirst and touch the board then add the real soc detectionThe change of the memory must be first and it's impact alot of code
I think that there is no big requirement in relation with patches order. As long as the "bisect" is possible and that it has a reasonable order, I tend to think that it is ok.
Best regards,
Signature · 1 line
Nicolas Ferre
PATCH 5/9 at91: use structure to store the current soc
Le 11/05/2011 10:30, Nicolas Ferre :
[..]
Quoted 1 line
But on the other hand it tends to make you thing that this functions is
s/thing/think/
sorry ;-)
(It also could have been "make you sing" but it is not the purpose of this patch series :-))
Bye,
Signature · 1 line
Nicolas Ferre
PATCH 5/9 at91: use structure to store the current soc
In reply to Nicolas FerreQuoted 7 lines · Nicolas Ferre
Hi all,
Le 11/05/2011 06:19, Jean-Christophe PLAGNIOL-VILLARD :
Quoted 4 lines · Ryan Mallon
Quoted 3 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 2 lines · Ryan Mallon
Quoted 1 line · Jean-Christophe PLAGNIOL-VILLARD
<snip>
Quoted 15 lines
Quoted 15 lines
Quoted 5 lines
Quoted 2 lines
furthermore we associate the subtype with the subtype name where each entry are uniq
You could add:
Quoted 7 lines
const char *name; char *subtype_name;To
at91_soc_data. The name field can be directly assigned in theat91xxx.cfiles and the subtype name can be assigned when it is detected (which is why it can't be const). The removes the need for the type/subtype lookup tables.no as we need to stock all the soc name here and it much more clear to get them together and link to the enum type
Quoted 8 lines
Quoted 2 lines
and if the soc is not enable you can not have the name so impossible to inform the user about which we detect and this will add too much ifdef
Yes, the main argument here is that we should tell the use which chips is actually detected even if its support is not included in the kernel configuration.
[..]
Yes, I didn't think of that. However, it should still be possible to mark the name lookup tables as __initdata and then copy the correct strings into the at91_soc_data struct. This means that we have the ability to print the name of the detected soc at init time (in case the soc is not compiled in), but also means that we can free the lookup tables up once we know the correct soc, and the functions for getting the names become direct pointer accesses.
<snip>
Quoted 23 lines
Quoted 23 lines
Quoted 22 lines
Quoted 9 lines
Quoted 9 lines
Quoted 3 lines
Quoted 2 lines
I would still like to see if it is possible to reorder these patches so that this intermediate rewrite is not needed.
there is none intermedaite write
You snipped it out in the reply :-). Patch 2/9 adds soc detection in
at91_map_iovia a series of 'if (cpu_is_xxx)' statements. This patch then removes that method and replaces it with the switch statement insoc_detect. It would be nice to try and avoid the intermediate step inat91_map_iosince it only exists for three commits.Quoted 4 lines
no this two different changes with huge impact first one factorize the
map_ioand change theAT91_BASE_SYSso I do prefer to keep them seperated and bre able to bisect them
This patch could be made the first patch in the series since it doesn't (AFAICT) depend on
AT91_BASE_SYSbeing generic since it uses internal defines for the two DBGU bases. So this patch would introduce an (possibly unused)soc_detectionfunction, which can be put into use by the subsequent patches.This would make the patch series easier to review since the change to move to soc detection only gets made once, not twice as it is now.
Quoted 8 lines
Quoted 4 lines
no I prefer to change the
AT91_BASE_SYSfirst and touch the board then add the real soc detectionThe change of the memory must be first and it's impact alot of code
I think that there is no big requirement in relation with patches order. As long as the "bisect" is possible and that it has a reasonable order, I tend to think that it is ok.
The reason I would like to see the order change is that I think it will reduce the size of each patch since the intermediate having the soc detection in at91_map_io will not need to exist. This makes it easier to review patches and means that there is no need to worry about bugs in the intermediate steps which get fixed in the later steps. Bisecting would still be possible.
~Ryan
Signature · 7 lines
Bluewater Systems Ltd - ARM Technology Solution Centre Ryan Mallon 5 Amuri Park, 404 Barbadoes St ryan at bluewatersys.com PO Box 13 889, Christchurch 8013 http://www.bluewatersys.com New Zealand Phone: +64 3 3779127 Freecall: Australia 1800 148 751 Fax: +64 3 3779135 USA 1800 261 2934
PATCH 6/9 at91: move clock subsystem init to soc generic init
In reply to Jean-Christophe PLAGNIOL-VILLARD--- arch/arm/mach-at91/at572d940hf.c | 5 +---- 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 | 4 ++++ arch/arm/mach-at91/setup.c | 5 ++++- arch/arm/mach-at91/soc.h | 2 +- 11 files changed, 18 insertions(+), 34 deletions(-)
arch/arm/mach-at91/at572d940hf.c +1 -4
@@ -367,15 +367,12 @@ static void __init at572d940hf_map_io(void)iotable_init (at572d940hf_sram_desc,ARRAY_SIZE (at572d940hf_sram_desc)); } -static void __init at572d940hf_initialize (unsigned long main_clock) +static void __init at572d940hf_initialize (void ) { at91_arch_reset = at572d940hf_reset; at91_extern_irq = (1 <<AT572D940HF_ID_IRQ0 ) | (1 <<AT572D940HF_ID_IRQ1 ) | (1 <<AT572D940HF_ID_IRQ2 ); -/* Init clock subsystem */ -at91_clock_init (main_clock); -/* Register the processor-specific clocks */ at572d940hf_register_clocks ();
arch/arm/mach-at91/at91cap9.c +2 -4
@@ -362,14 +362,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
@@ -322,7 +322,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 )
@@ -330,9 +330,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
@@ -362,16 +362,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
@@ -322,16 +322,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
@@ -334,15 +334,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
@@ -353,15 +353,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
@@ -316,15 +316,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 +4 -0
@@ -31,7 +31,11 @@ extern struct sys_timer at91sam926x_timer;extern struct sys_timer at91x40_timer;/* Clocks */ +#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 extern struct clk *__init at91rm9200_get_uart_clock (int id);extern struct clk *__init at91sam9260_get_uart_clock (int id);extern struct clk *__init at91sam9261_get_uart_clock (int id);
arch/arm/mach-at91/setup.c +4 -1
@@ -252,5 +252,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_soc {unsigned int *default_irq_priority;void (*map_io)(void ); -void (*init)(unsigned long main_clock); +void (*init)(void ); };extern struct at91_soc at91_boot_soc;
Signature · 1 line
1.7.4.1
PATCH 7/9 at91: move register clocks to soc generic init
In reply to Jean-Christophe PLAGNIOL-VILLARD--- arch/arm/mach-at91/at572d940hf.c | 4 +--- 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 + 10 files changed, 12 insertions(+), 24 deletions(-)
arch/arm/mach-at91/at572d940hf.c +1 -3
@@ -373,9 +373,6 @@ static void __init at572d940hf_initialize(void) at91_extern_irq = (1 <<AT572D940HF_ID_IRQ0 ) | (1 <<AT572D940HF_ID_IRQ1 ) | (1 <<AT572D940HF_ID_IRQ2 ); -/* Register the processor-specific clocks */ -at572d940hf_register_clocks (); -/* Register GPIO subsystem */ at91_gpio_init (at572d940hf_gpio,3 ); }
@@ -425,5 +422,6 @@ static unsigned int at572d940hf_default_irq_priority[NR_AIC_IRQS] __initdata = {struct at91_soc __initdata at572d940hf_soc = { .map_io = at572d940hf_map_io, .default_irq_priority = at572d940hf_default_irq_priority, + .register_clocks = at572d940hf_register_clocks, .init = at572d940hf_initialize, };
arch/arm/mach-at91/at91cap9.c +1 -3
@@ -368,9 +368,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 );
@@ -426,5 +423,6 @@ static unsigned int at91cap9_default_irq_priority[NR_AIC_IRQS] __initdata = {struct at91_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
@@ -330,9 +330,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 );
@@ -384,5 +381,6 @@ static unsigned int at91rm9200_default_irq_priority[NR_AIC_IRQS] __initdata = {struct at91_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
@@ -369,9 +369,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 ); }
@@ -421,5 +418,6 @@ static unsigned int at91sam9260_default_irq_priority[NR_AIC_IRQS] __initdata = {struct at91_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
@@ -329,9 +329,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 ); }
@@ -381,5 +378,6 @@ static unsigned int at91sam9261_default_irq_priority[NR_AIC_IRQS] __initdata = {struct at91_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
@@ -340,9 +340,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 ); }
@@ -392,5 +389,6 @@ static unsigned int at91sam9263_default_irq_priority[NR_AIC_IRQS] __initdata = {struct at91_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
@@ -359,9 +359,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 ); }
@@ -411,5 +408,6 @@ static unsigned int at91sam9g45_default_irq_priority[NR_AIC_IRQS] __initdata = {struct at91_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
@@ -322,9 +322,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 ); }
@@ -374,5 +371,6 @@ static unsigned int at91sam9rl_default_irq_priority[NR_AIC_IRQS] __initdata = {struct at91_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
@@ -255,5 +255,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_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 8/9 at91: factorize sram init
In reply to Jean-Christophe PLAGNIOL-VILLARD--- arch/arm/mach-at91/at572d940hf.c | 11 +------- 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 ++++++++++++++ 10 files changed, 40 insertions(+), 125 deletions(-)
arch/arm/mach-at91/at572d940hf.c +1 -10
@@ -35,15 +35,6 @@#include "generic.h" #include "clock.h" -static struct map_desc at572d940hf_sram_desc[]__initdata = { - { - .virtual =AT91_IO_VIRT_BASE -AT572D940HF_SRAM_SIZE , - .pfn =__phys_to_pfn (AT572D940HF_SRAM_BASE ), - .length =AT572D940HF_SRAM_SIZE , - .type =MT_DEVICE , - }, -}; -/* -------------------------------------------------------------------- * Clocks * -------------------------------------------------------------------- */
@@ -364,7 +355,7 @@ static void at572d940hf_reset(void)static void __init at572d940hf_map_io (void ) { -iotable_init (at572d940hf_sram_desc,ARRAY_SIZE (at572d940hf_sram_desc)); +at91_init_sram (0 ,AT572D940HF_SRAM_BASE ,AT572D940HF_SRAM_SIZE ); }static void __init at572d940hf_initialize (void )
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 * -------------------------------------------------------------------- */
@@ -359,7 +350,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, }, };
@@ -319,6 +314,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 * -------------------------------------------------------------------- */
@@ -317,9 +299,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 * -------------------------------------------------------------------- */
@@ -331,7 +317,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 * -------------------------------------------------------------------- */
@@ -350,7 +341,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 * -------------------------------------------------------------------- */
@@ -309,11 +302,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/9 at91: factorize sram init
In reply to Jean-Christophe PLAGNIOL-VILLARD--- arch/arm/mach-at91/at572d940hf.c | 11 +------- 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 ++++++++++++++ 10 files changed, 40 insertions(+), 125 deletions(-)
arch/arm/mach-at91/at572d940hf.c +1 -10
@@ -35,15 +35,6 @@#include "generic.h" #include "clock.h" -static struct map_desc at572d940hf_sram_desc[]__initdata = { - { - .virtual =AT91_IO_VIRT_BASE -AT572D940HF_SRAM_SIZE , - .pfn =__phys_to_pfn (AT572D940HF_SRAM_BASE ), - .length =AT572D940HF_SRAM_SIZE , - .type =MT_DEVICE , - }, -}; -/* -------------------------------------------------------------------- * Clocks * -------------------------------------------------------------------- */
@@ -364,7 +355,7 @@ static void at572d940hf_reset(void)static void __init at572d940hf_map_io (void ) { -iotable_init (at572d940hf_sram_desc,ARRAY_SIZE (at572d940hf_sram_desc)); +at91_init_sram (0 ,AT572D940HF_SRAM_BASE ,AT572D940HF_SRAM_SIZE ); }static void __init at572d940hf_initialize (void )
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 * -------------------------------------------------------------------- */
@@ -359,7 +350,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, }, };
@@ -319,6 +314,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 * -------------------------------------------------------------------- */
@@ -317,9 +299,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 * -------------------------------------------------------------------- */
@@ -331,7 +317,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 * -------------------------------------------------------------------- */
@@ -350,7 +341,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 * -------------------------------------------------------------------- */
@@ -309,11 +302,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 9/9 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