* AT91: soc init factorisation and fix
@ 2011-05-10 16:27 Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 16:34 ` [PATCH 1/9] at91rm9200: introduce at91rm9200_set_type to specficy cpu package Jean-Christophe PLAGNIOL-VILLARD
` (9 more replies)
0 siblings, 10 replies; 22+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-05-10 16:27 UTC (permalink / raw)
To: linux-arm-kernel
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.
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 1/9] at91rm9200: introduce at91rm9200_set_type to specficy cpu package
2011-05-10 16:27 AT91: soc init factorisation and fix Jean-Christophe PLAGNIOL-VILLARD
@ 2011-05-10 16:34 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 16:34 ` [PATCH 2/9] at91: introduce commom AT91_BASE_SYS Jean-Christophe PLAGNIOL-VILLARD
` (8 subsequent siblings)
9 siblings, 0 replies; 22+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-05-10 16:34 UTC (permalink / raw)
To: linux-arm-kernel
as we can not detect it
by defaut the type will be bga
introduce cpu_is_at91rm9200_bga and cpu_is_at91rm9200_pqfp
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
---
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(-)
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 47d99a4..a67143a 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -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 banks
at91rm9200_register_clocks();
/* Initialize GPIO subsystem */
- at91_gpio_init(at91rm9200_gpio, banks);
+ at91_gpio_init(at91rm9200_gpio,
+ cpu_is_at91rm9200_bga() ? AT91RM9200_BGA : AT91RM9200_PQFP);
}
diff --git a/arch/arm/mach-at91/board-1arm.c b/arch/arm/mach-at91/board-1arm.c
index 73372ca..ab1d463 100644
--- a/arch/arm/mach-at91/board-1arm.c
+++ b/arch/arm/mach-at91/board-1arm.c
@@ -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);
diff --git a/arch/arm/mach-at91/board-carmeva.c b/arch/arm/mach-at91/board-carmeva.c
index 3929b11..f36b186 100644
--- a/arch/arm/mach-at91/board-carmeva.c
+++ b/arch/arm/mach-at91/board-carmeva.c
@@ -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);
diff --git a/arch/arm/mach-at91/board-cpuat91.c b/arch/arm/mach-at91/board-cpuat91.c
index 620a36a..6daabe3 100644
--- a/arch/arm/mach-at91/board-cpuat91.c
+++ b/arch/arm/mach-at91/board-cpuat91.c
@@ -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);
diff --git a/arch/arm/mach-at91/board-csb337.c b/arch/arm/mach-at91/board-csb337.c
index a7be81e..d98bcec 100644
--- a/arch/arm/mach-at91/board-csb337.c
+++ b/arch/arm/mach-at91/board-csb337.c
@@ -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);
diff --git a/arch/arm/mach-at91/board-csb637.c b/arch/arm/mach-at91/board-csb637.c
index 58a80c3..019aab4 100644
--- a/arch/arm/mach-at91/board-csb637.c
+++ b/arch/arm/mach-at91/board-csb637.c
@@ -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);
diff --git a/arch/arm/mach-at91/board-eb9200.c b/arch/arm/mach-at91/board-eb9200.c
index e9fff80..e948453 100644
--- a/arch/arm/mach-at91/board-eb9200.c
+++ b/arch/arm/mach-at91/board-eb9200.c
@@ -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);
diff --git a/arch/arm/mach-at91/board-ecbat91.c b/arch/arm/mach-at91/board-ecbat91.c
index eea65ea..a6f57fa 100644
--- a/arch/arm/mach-at91/board-ecbat91.c
+++ b/arch/arm/mach-at91/board-ecbat91.c
@@ -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);
diff --git a/arch/arm/mach-at91/board-eco920.c b/arch/arm/mach-at91/board-eco920.c
index 90a44e5..bfc0062 100644
--- a/arch/arm/mach-at91/board-eco920.c
+++ b/arch/arm/mach-at91/board-eco920.c
@@ -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);
diff --git a/arch/arm/mach-at91/board-kafa.c b/arch/arm/mach-at91/board-kafa.c
index 4f17a1c..9b003ff 100644
--- a/arch/arm/mach-at91/board-kafa.c
+++ b/arch/arm/mach-at91/board-kafa.c
@@ -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);
diff --git a/arch/arm/mach-at91/board-kb9202.c b/arch/arm/mach-at91/board-kb9202.c
index 39247fa..a813a74 100644
--- a/arch/arm/mach-at91/board-kb9202.c
+++ b/arch/arm/mach-at91/board-kb9202.c
@@ -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);
diff --git a/arch/arm/mach-at91/board-picotux200.c b/arch/arm/mach-at91/board-picotux200.c
index 8294eae..756cc2a 100644
--- a/arch/arm/mach-at91/board-picotux200.c
+++ b/arch/arm/mach-at91/board-picotux200.c
@@ -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);
diff --git a/arch/arm/mach-at91/board-rm9200dk.c b/arch/arm/mach-at91/board-rm9200dk.c
index b90d0f9..aef9627 100644
--- a/arch/arm/mach-at91/board-rm9200dk.c
+++ b/arch/arm/mach-at91/board-rm9200dk.c
@@ -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);
diff --git a/arch/arm/mach-at91/board-rm9200ek.c b/arch/arm/mach-at91/board-rm9200ek.c
index 51c2668..015a021 100644
--- a/arch/arm/mach-at91/board-rm9200ek.c
+++ b/arch/arm/mach-at91/board-rm9200ek.c
@@ -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);
diff --git a/arch/arm/mach-at91/board-yl-9200.c b/arch/arm/mach-at91/board-yl-9200.c
index 167337f..c208cc3 100644
--- a/arch/arm/mach-at91/board-yl-9200.c
+++ b/arch/arm/mach-at91/board-yl-9200.c
@@ -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);
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index 109f13e..46721996 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -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);
diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h
index 0700f21..ab00372 100644
--- a/arch/arm/mach-at91/include/mach/cpu.h
+++ b/arch/arm/mach-at91/include/mach/cpu.h
@@ -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
--
1.7.4.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 2/9] at91: introduce commom AT91_BASE_SYS
2011-05-10 16:27 AT91: soc init factorisation and fix Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 16:34 ` [PATCH 1/9] at91rm9200: introduce at91rm9200_set_type to specficy cpu package Jean-Christophe PLAGNIOL-VILLARD
@ 2011-05-10 16:34 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 16:34 ` [PATCH 3/9] at91: factorize at91 interrupts init to soc Jean-Christophe PLAGNIOL-VILLARD
` (7 subsequent siblings)
9 siblings, 0 replies; 22+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-05-10 16:34 UTC (permalink / raw)
To: linux-arm-kernel
On all at91 except rm9200 and x40 have the System Controller starts
at address 0xffffc000 and has a size of 16KiB.
On rm9200 it's start at 0xfffe4000 of 111KiB with non reserved data starting
at 0xfffff000
This patch removes the individual definitions of AT91_BASE_SYS and
replaces them with a common version at base 0xfffffc000 and size 16KiB
and map the same memory space
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
---
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
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index a83835e..311b7d1 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -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- :=
diff --git a/arch/arm/mach-at91/at572d940hf.c b/arch/arm/mach-at91/at572d940hf.c
index 5c6af40..1b5b320 100644
--- a/arch/arm/mach-at91/at572d940hf.c
+++ b/arch/arm/mach-at91/at572d940hf.c
@@ -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,
+};
diff --git a/arch/arm/mach-at91/at91cap9.c b/arch/arm/mach-at91/at91cap9.c
index 794e036..cc32ac8 100644
--- a/arch/arm/mach-at91/at91cap9.c
+++ b/arch/arm/mach-at91/at91cap9.c
@@ -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,
+};
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index a67143a..382354f 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -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,
+};
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index edaec71..11b73e0 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -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,
+};
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index d2e5fee..42eca26 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -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,
+};
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 9502bfd..6515897 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -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,
+};
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index 3db8132..a5f1473 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -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,
+};
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index d2f521e..77a20ef 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -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,
+};
diff --git a/arch/arm/mach-at91/board-1arm.c b/arch/arm/mach-at91/board-1arm.c
index ab1d463..e588a9e 100644
--- a/arch/arm/mach-at91/board-1arm.c
+++ b/arch/arm/mach-at91/board-1arm.c
@@ -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 <buytenh@wantstofly.org> */
.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,
diff --git a/arch/arm/mach-at91/board-afeb-9260v1.c b/arch/arm/mach-at91/board-afeb-9260v1.c
index a4924de..7cd1cb2 100644
--- a/arch/arm/mach-at91/board-afeb-9260v1.c
+++ b/arch/arm/mach-at91/board-afeb-9260v1.c
@@ -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 <slapin@ossfans.org> */
.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,
diff --git a/arch/arm/mach-at91/board-at572d940hf_ek.c b/arch/arm/mach-at91/board-at572d940hf_ek.c
index dfa896d..f263aa8 100644
--- a/arch/arm/mach-at91/board-at572d940hf_ek.c
+++ b/arch/arm/mach-at91/board-at572d940hf_ek.c
@@ -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 <costa.antonior@gmail.com> */
.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,
diff --git a/arch/arm/mach-at91/board-cam60.c b/arch/arm/mach-at91/board-cam60.c
index 148fccb..bdc52e6 100644
--- a/arch/arm/mach-at91/board-cam60.c
+++ b/arch/arm/mach-at91/board-cam60.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-cap9adk.c b/arch/arm/mach-at91/board-cap9adk.c
index 1904fdf..dfafdf9 100644
--- a/arch/arm/mach-at91/board-cap9adk.c
+++ b/arch/arm/mach-at91/board-cap9adk.c
@@ -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 <stelian.pop@leadtechdesign.com> */
.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,
diff --git a/arch/arm/mach-at91/board-carmeva.c b/arch/arm/mach-at91/board-carmeva.c
index f36b186..0a92b7a 100644
--- a/arch/arm/mach-at91/board-carmeva.c
+++ b/arch/arm/mach-at91/board-carmeva.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-cpu9krea.c b/arch/arm/mach-at91/board-cpu9krea.c
index 9805110..01128f9 100644
--- a/arch/arm/mach-at91/board-cpu9krea.c
+++ b/arch/arm/mach-at91/board-cpu9krea.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-cpuat91.c b/arch/arm/mach-at91/board-cpuat91.c
index 6daabe3..0692606 100644
--- a/arch/arm/mach-at91/board-cpuat91.c
+++ b/arch/arm/mach-at91/board-cpuat91.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-csb337.c b/arch/arm/mach-at91/board-csb337.c
index d98bcec..923cccb 100644
--- a/arch/arm/mach-at91/board-csb337.c
+++ b/arch/arm/mach-at91/board-csb337.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-csb637.c b/arch/arm/mach-at91/board-csb637.c
index 019aab4..51131ca 100644
--- a/arch/arm/mach-at91/board-csb637.c
+++ b/arch/arm/mach-at91/board-csb637.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-eb9200.c b/arch/arm/mach-at91/board-eb9200.c
index e948453..705071c 100644
--- a/arch/arm/mach-at91/board-eb9200.c
+++ b/arch/arm/mach-at91/board-eb9200.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-ecbat91.c b/arch/arm/mach-at91/board-ecbat91.c
index a6f57fa..a9f106a 100644
--- a/arch/arm/mach-at91/board-ecbat91.c
+++ b/arch/arm/mach-at91/board-ecbat91.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-eco920.c b/arch/arm/mach-at91/board-eco920.c
index bfc0062..8639fbd 100644
--- a/arch/arm/mach-at91/board-eco920.c
+++ b/arch/arm/mach-at91/board-eco920.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-flexibity.c b/arch/arm/mach-at91/board-flexibity.c
index 466c063..f45583e 100644
--- a/arch/arm/mach-at91/board-flexibity.c
+++ b/arch/arm/mach-at91/board-flexibity.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-foxg20.c b/arch/arm/mach-at91/board-foxg20.c
index e2d1dc9..b78442b 100644
--- a/arch/arm/mach-at91/board-foxg20.c
+++ b/arch/arm/mach-at91/board-foxg20.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-gsia18s.c b/arch/arm/mach-at91/board-gsia18s.c
index 1d4f36b..6588143 100644
--- a/arch/arm/mach-at91/board-gsia18s.c
+++ b/arch/arm/mach-at91/board-gsia18s.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-kafa.c b/arch/arm/mach-at91/board-kafa.c
index 9b003ff..d26b960 100644
--- a/arch/arm/mach-at91/board-kafa.c
+++ b/arch/arm/mach-at91/board-kafa.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-kb9202.c b/arch/arm/mach-at91/board-kb9202.c
index a813a74..a4d8153 100644
--- a/arch/arm/mach-at91/board-kb9202.c
+++ b/arch/arm/mach-at91/board-kb9202.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c
index 961e805..26a4c63 100644
--- a/arch/arm/mach-at91/board-neocore926.c
+++ b/arch/arm/mach-at91/board-neocore926.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-pcontrol-g20.c b/arch/arm/mach-at91/board-pcontrol-g20.c
index 21a21af..7651e7f 100644
--- a/arch/arm/mach-at91/board-pcontrol-g20.c
+++ b/arch/arm/mach-at91/board-pcontrol-g20.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-picotux200.c b/arch/arm/mach-at91/board-picotux200.c
index 756cc2a..c7294f8 100644
--- a/arch/arm/mach-at91/board-picotux200.c
+++ b/arch/arm/mach-at91/board-picotux200.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-qil-a9260.c b/arch/arm/mach-at91/board-qil-a9260.c
index d1a6001..68e31a9 100644
--- a/arch/arm/mach-at91/board-qil-a9260.c
+++ b/arch/arm/mach-at91/board-qil-a9260.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-rm9200dk.c b/arch/arm/mach-at91/board-rm9200dk.c
index aef9627..97c6f21 100644
--- a/arch/arm/mach-at91/board-rm9200dk.c
+++ b/arch/arm/mach-at91/board-rm9200dk.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-rm9200ek.c b/arch/arm/mach-at91/board-rm9200ek.c
index 015a021..72aa8bf 100644
--- a/arch/arm/mach-at91/board-rm9200ek.c
+++ b/arch/arm/mach-at91/board-rm9200ek.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-sam9-l9260.c b/arch/arm/mach-at91/board-sam9-l9260.c
index aaf1bf0..93c36bd 100644
--- a/arch/arm/mach-at91/board-sam9-l9260.c
+++ b/arch/arm/mach-at91/board-sam9-l9260.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c
index d600dc1..0330db3 100644
--- a/arch/arm/mach-at91/board-sam9260ek.c
+++ b/arch/arm/mach-at91/board-sam9260ek.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c
index f897f84..65ab1cd 100644
--- a/arch/arm/mach-at91/board-sam9261ek.c
+++ b/arch/arm/mach-at91/board-sam9261ek.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c
index 605b26f..5b07981 100644
--- a/arch/arm/mach-at91/board-sam9263ek.c
+++ b/arch/arm/mach-at91/board-sam9263ek.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c
index 7624cf0..8e7327a 100644
--- a/arch/arm/mach-at91/board-sam9g20ek.c
+++ b/arch/arm/mach-at91/board-sam9g20ek.c
@@ -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_END
MACHINE_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,
diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c
index 063c95d..f112ad9 100644
--- a/arch/arm/mach-at91/board-sam9m10g45ek.c
+++ b/arch/arm/mach-at91/board-sam9m10g45ek.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c
index effb399..defbca4 100644
--- a/arch/arm/mach-at91/board-sam9rlek.c
+++ b/arch/arm/mach-at91/board-sam9rlek.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-snapper9260.c b/arch/arm/mach-at91/board-snapper9260.c
index 3eb0a11..c600b14 100644
--- a/arch/arm/mach-at91/board-snapper9260.c
+++ b/arch/arm/mach-at91/board-snapper9260.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-stamp9g20.c b/arch/arm/mach-at91/board-stamp9g20.c
index 5e5c856..e65efda 100644
--- a/arch/arm/mach-at91/board-stamp9g20.c
+++ b/arch/arm/mach-at91/board-stamp9g20.c
@@ -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_END
MACHINE_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,
diff --git a/arch/arm/mach-at91/board-usb-a9260.c b/arch/arm/mach-at91/board-usb-a9260.c
index 0e784e6..afc3b04 100644
--- a/arch/arm/mach-at91/board-usb-a9260.c
+++ b/arch/arm/mach-at91/board-usb-a9260.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-usb-a9263.c b/arch/arm/mach-at91/board-usb-a9263.c
index cf626dd..25357e0 100644
--- a/arch/arm/mach-at91/board-usb-a9263.c
+++ b/arch/arm/mach-at91/board-usb-a9263.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-yl-9200.c b/arch/arm/mach-at91/board-yl-9200.c
index c208cc3..e8a8ab9 100644
--- a/arch/arm/mach-at91/board-yl-9200.c
+++ b/arch/arm/mach-at91/board-yl-9200.c
@@ -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,
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index 46721996..84e5b1d 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -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[]);
diff --git a/arch/arm/mach-at91/include/mach/at572d940hf.h b/arch/arm/mach-at91/include/mach/at572d940hf.h
index a738dc7..80c3df2 100644
--- a/arch/arm/mach-at91/include/mach/at572d940hf.h
+++ b/arch/arm/mach-at91/include/mach/at572d940hf.h
@@ -81,7 +81,6 @@
#define AT572D940HF_BASE_EMAC 0xfffd8000
#define AT572D940HF_BASE_CAN0 0xfffdc000
#define AT572D940HF_BASE_CAN1 0xfffe0000
-#define AT91_BASE_SYS 0xffffea00
/*
diff --git a/arch/arm/mach-at91/include/mach/at91cap9.h b/arch/arm/mach-at91/include/mach/at91cap9.h
index 6659938..c5df1e8 100644
--- a/arch/arm/mach-at91/include/mach/at91cap9.h
+++ b/arch/arm/mach-at91/include/mach/at91cap9.h
@@ -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)
diff --git a/arch/arm/mach-at91/include/mach/at91rm9200.h b/arch/arm/mach-at91/include/mach/at91rm9200.h
index 99e0f8d..e4037b5 100644
--- a/arch/arm/mach-at91/include/mach/at91rm9200.h
+++ b/arch/arm/mach-at91/include/mach/at91rm9200.h
@@ -74,7 +74,6 @@
#define AT91RM9200_BASE_SSC1 0xfffd4000
#define AT91RM9200_BASE_SSC2 0xfffd8000
#define AT91RM9200_BASE_SPI 0xfffe0000
-#define AT91_BASE_SYS 0xfffff000
/*
diff --git a/arch/arm/mach-at91/include/mach/at91sam9260.h b/arch/arm/mach-at91/include/mach/at91sam9260.h
index 8b6bf83..9a79116 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9260.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9260.h
@@ -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)
diff --git a/arch/arm/mach-at91/include/mach/at91sam9261.h b/arch/arm/mach-at91/include/mach/at91sam9261.h
index eafbdda..ce59620 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9261.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9261.h
@@ -60,7 +60,6 @@
#define AT91SAM9261_BASE_SSC2 0xfffc4000
#define AT91SAM9261_BASE_SPI0 0xfffc8000
#define AT91SAM9261_BASE_SPI1 0xfffcc000
-#define AT91_BASE_SYS 0xffffea00
/*
diff --git a/arch/arm/mach-at91/include/mach/at91sam9263.h b/arch/arm/mach-at91/include/mach/at91sam9263.h
index e2d3482..f1b9296 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9263.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9263.h
@@ -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)
diff --git a/arch/arm/mach-at91/include/mach/at91sam9g45.h b/arch/arm/mach-at91/include/mach/at91sam9g45.h
index 659304a..2c611b9 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9g45.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9g45.h
@@ -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)
diff --git a/arch/arm/mach-at91/include/mach/at91sam9rl.h b/arch/arm/mach-at91/include/mach/at91sam9rl.h
index 41dbbe6..1aabacd 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9rl.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9rl.h
@@ -64,7 +64,6 @@
#define AT91SAM9RL_BASE_TSC 0xfffd0000
#define AT91SAM9RL_BASE_UDPHS 0xfffd4000
#define AT91SAM9RL_BASE_AC97C 0xfffd8000
-#define AT91_BASE_SYS 0xffffc000
/*
diff --git a/arch/arm/mach-at91/include/mach/hardware.h b/arch/arm/mach-at91/include/mach/hardware.h
index 469d3af..e820c96 100644
--- a/arch/arm/mach-at91/include/mach/hardware.h
+++ b/arch/arm/mach-at91/include/mach/hardware.h
@@ -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.
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
new file mode 100644
index 0000000..dd62c46
--- /dev/null
+++ b/arch/arm/mach-at91/setup.c
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2007 Atmel Corporation.
+ * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+ *
+ * Under GPLv2
+ */
+
+#include <linux/module.h>
+#include <linux/io.h>
+
+#include <asm/mach/map.h>
+
+#include <mach/hardware.h>
+#include <mach/cpu.h>
+
+#include "soc.h"
+#include "generic.h"
+
+struct at91_soc __initdata at91_boot_soc;
+
+static struct map_desc at91_io_desc __initdata = {
+ .virtual = AT91_VA_BASE_SYS,
+ .pfn = __phys_to_pfn(AT91_BASE_SYS),
+ .length = SZ_16K,
+ .type = MT_DEVICE,
+};
+
+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;
+ else if (cpu_is_at91sam9x5())
+ at91_boot_soc = at91sam9x5_soc;
+ else
+ panic("Impossible to detect the SOC type");
+
+ if (at91_boot_soc.map_io)
+ at91_boot_soc.map_io();
+}
+
+void __init at91_initialize(unsigned long main_clock)
+{
+ at91_boot_soc.init(main_clock);
+}
diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h
new file mode 100644
index 0000000..917f610
--- /dev/null
+++ b/arch/arm/mach-at91/soc.h
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+ *
+ * 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;
--
1.7.4.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 3/9] at91: factorize at91 interrupts init to soc
2011-05-10 16:27 AT91: soc init factorisation and fix Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 16:34 ` [PATCH 1/9] at91rm9200: introduce at91rm9200_set_type to specficy cpu package Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 16:34 ` [PATCH 2/9] at91: introduce commom AT91_BASE_SYS Jean-Christophe PLAGNIOL-VILLARD
@ 2011-05-10 16:34 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 16:34 ` [PATCH 4/9] at91: remove AT91_DBGU offset from dbgu register macro Jean-Christophe PLAGNIOL-VILLARD
` (6 subsequent siblings)
9 siblings, 0 replies; 22+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-05-10 16:34 UTC (permalink / raw)
To: linux-arm-kernel
they are the same except the default priority
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
---
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(-)
diff --git a/arch/arm/mach-at91/at572d940hf.c b/arch/arm/mach-at91/at572d940hf.c
index 1b5b320..39827ebc 100644
--- a/arch/arm/mach-at91/at572d940hf.c
+++ b/arch/arm/mach-at91/at572d940hf.c
@@ -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,
};
diff --git a/arch/arm/mach-at91/at91cap9.c b/arch/arm/mach-at91/at91cap9.c
index cc32ac8..238b6a0 100644
--- a/arch/arm/mach-at91/at91cap9.c
+++ b/arch/arm/mach-at91/at91cap9.c
@@ -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,
};
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 382354f..89e4807 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -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,
};
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index 11b73e0..1f3abb4 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -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,
};
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 42eca26..69bc26f 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -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,
};
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 6515897..3da9103 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -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,
};
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index a5f1473..ecca942 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -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,
};
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index 77a20ef..c8de47f 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -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,
};
diff --git a/arch/arm/mach-at91/board-1arm.c b/arch/arm/mach-at91/board-1arm.c
index e588a9e..5aa5885 100644
--- a/arch/arm/mach-at91/board-1arm.c
+++ b/arch/arm/mach-at91/board-1arm.c
@@ -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
diff --git a/arch/arm/mach-at91/board-afeb-9260v1.c b/arch/arm/mach-at91/board-afeb-9260v1.c
index 7cd1cb2..b0c796d 100644
--- a/arch/arm/mach-at91/board-afeb-9260v1.c
+++ b/arch/arm/mach-at91/board-afeb-9260v1.c
@@ -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
diff --git a/arch/arm/mach-at91/board-at572d940hf_ek.c b/arch/arm/mach-at91/board-at572d940hf_ek.c
index f263aa8..da79a6e 100644
--- a/arch/arm/mach-at91/board-at572d940hf_ek.c
+++ b/arch/arm/mach-at91/board-at572d940hf_ek.c
@@ -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
diff --git a/arch/arm/mach-at91/board-cam60.c b/arch/arm/mach-at91/board-cam60.c
index bdc52e6..d1abd58 100644
--- a/arch/arm/mach-at91/board-cam60.c
+++ b/arch/arm/mach-at91/board-cam60.c
@@ -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
diff --git a/arch/arm/mach-at91/board-cap9adk.c b/arch/arm/mach-at91/board-cap9adk.c
index dfafdf9..b78c4a3 100644
--- a/arch/arm/mach-at91/board-cap9adk.c
+++ b/arch/arm/mach-at91/board-cap9adk.c
@@ -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
diff --git a/arch/arm/mach-at91/board-carmeva.c b/arch/arm/mach-at91/board-carmeva.c
index 0a92b7a..c578c5d 100644
--- a/arch/arm/mach-at91/board-carmeva.c
+++ b/arch/arm/mach-at91/board-carmeva.c
@@ -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
diff --git a/arch/arm/mach-at91/board-cpu9krea.c b/arch/arm/mach-at91/board-cpu9krea.c
index 01128f9..f4da8a1 100644
--- a/arch/arm/mach-at91/board-cpu9krea.c
+++ b/arch/arm/mach-at91/board-cpu9krea.c
@@ -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
diff --git a/arch/arm/mach-at91/board-cpuat91.c b/arch/arm/mach-at91/board-cpuat91.c
index 0692606..2d919f5 100644
--- a/arch/arm/mach-at91/board-cpuat91.c
+++ b/arch/arm/mach-at91/board-cpuat91.c
@@ -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
diff --git a/arch/arm/mach-at91/board-csb337.c b/arch/arm/mach-at91/board-csb337.c
index 923cccb..17654d5 100644
--- a/arch/arm/mach-at91/board-csb337.c
+++ b/arch/arm/mach-at91/board-csb337.c
@@ -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
diff --git a/arch/arm/mach-at91/board-csb637.c b/arch/arm/mach-at91/board-csb637.c
index 51131ca..72b5567 100644
--- a/arch/arm/mach-at91/board-csb637.c
+++ b/arch/arm/mach-at91/board-csb637.c
@@ -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
diff --git a/arch/arm/mach-at91/board-eb9200.c b/arch/arm/mach-at91/board-eb9200.c
index 705071c..01170a2 100644
--- a/arch/arm/mach-at91/board-eb9200.c
+++ b/arch/arm/mach-at91/board-eb9200.c
@@ -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
diff --git a/arch/arm/mach-at91/board-ecbat91.c b/arch/arm/mach-at91/board-ecbat91.c
index a9f106a..7c0313c 100644
--- a/arch/arm/mach-at91/board-ecbat91.c
+++ b/arch/arm/mach-at91/board-ecbat91.c
@@ -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
diff --git a/arch/arm/mach-at91/board-eco920.c b/arch/arm/mach-at91/board-eco920.c
index 8639fbd..8252c72 100644
--- a/arch/arm/mach-at91/board-eco920.c
+++ b/arch/arm/mach-at91/board-eco920.c
@@ -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
diff --git a/arch/arm/mach-at91/board-flexibity.c b/arch/arm/mach-at91/board-flexibity.c
index f45583e..4c3f65d 100644
--- a/arch/arm/mach-at91/board-flexibity.c
+++ b/arch/arm/mach-at91/board-flexibity.c
@@ -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
diff --git a/arch/arm/mach-at91/board-foxg20.c b/arch/arm/mach-at91/board-foxg20.c
index b78442b..f27d1a7 100644
--- a/arch/arm/mach-at91/board-foxg20.c
+++ b/arch/arm/mach-at91/board-foxg20.c
@@ -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
diff --git a/arch/arm/mach-at91/board-gsia18s.c b/arch/arm/mach-at91/board-gsia18s.c
index 6588143..34d2712 100644
--- a/arch/arm/mach-at91/board-gsia18s.c
+++ b/arch/arm/mach-at91/board-gsia18s.c
@@ -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
*/
diff --git a/arch/arm/mach-at91/board-kafa.c b/arch/arm/mach-at91/board-kafa.c
index d26b960..4a17089 100644
--- a/arch/arm/mach-at91/board-kafa.c
+++ b/arch/arm/mach-at91/board-kafa.c
@@ -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
diff --git a/arch/arm/mach-at91/board-kb9202.c b/arch/arm/mach-at91/board-kb9202.c
index a4d8153..9dc8d49 100644
--- a/arch/arm/mach-at91/board-kb9202.c
+++ b/arch/arm/mach-at91/board-kb9202.c
@@ -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
diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c
index 26a4c63..9bc6ab3 100644
--- a/arch/arm/mach-at91/board-neocore926.c
+++ b/arch/arm/mach-at91/board-neocore926.c
@@ -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
diff --git a/arch/arm/mach-at91/board-pcontrol-g20.c b/arch/arm/mach-at91/board-pcontrol-g20.c
index 7651e7f..23785e2 100644
--- a/arch/arm/mach-at91/board-pcontrol-g20.c
+++ b/arch/arm/mach-at91/board-pcontrol-g20.c
@@ -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,
diff --git a/arch/arm/mach-at91/board-picotux200.c b/arch/arm/mach-at91/board-picotux200.c
index c7294f8..b7b8390 100644
--- a/arch/arm/mach-at91/board-picotux200.c
+++ b/arch/arm/mach-at91/board-picotux200.c
@@ -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
diff --git a/arch/arm/mach-at91/board-qil-a9260.c b/arch/arm/mach-at91/board-qil-a9260.c
index 68e31a9..81f9110 100644
--- a/arch/arm/mach-at91/board-qil-a9260.c
+++ b/arch/arm/mach-at91/board-qil-a9260.c
@@ -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
diff --git a/arch/arm/mach-at91/board-rm9200dk.c b/arch/arm/mach-at91/board-rm9200dk.c
index 97c6f21..6f08faa 100644
--- a/arch/arm/mach-at91/board-rm9200dk.c
+++ b/arch/arm/mach-at91/board-rm9200dk.c
@@ -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
diff --git a/arch/arm/mach-at91/board-rm9200ek.c b/arch/arm/mach-at91/board-rm9200ek.c
index 72aa8bf..85bcccd 100644
--- a/arch/arm/mach-at91/board-rm9200ek.c
+++ b/arch/arm/mach-at91/board-rm9200ek.c
@@ -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
diff --git a/arch/arm/mach-at91/board-sam9-l9260.c b/arch/arm/mach-at91/board-sam9-l9260.c
index 93c36bd..4d3a02f 100644
--- a/arch/arm/mach-at91/board-sam9-l9260.c
+++ b/arch/arm/mach-at91/board-sam9-l9260.c
@@ -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
diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c
index 0330db3..12f75a3 100644
--- a/arch/arm/mach-at91/board-sam9260ek.c
+++ b/arch/arm/mach-at91/board-sam9260ek.c
@@ -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
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c
index 65ab1cd..785b484 100644
--- a/arch/arm/mach-at91/board-sam9261ek.c
+++ b/arch/arm/mach-at91/board-sam9261ek.c
@@ -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
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c
index 5b07981..70e5646 100644
--- a/arch/arm/mach-at91/board-sam9263ek.c
+++ b/arch/arm/mach-at91/board-sam9263ek.c
@@ -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
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c
index 8e7327a..c08a1e7 100644
--- a/arch/arm/mach-at91/board-sam9g20ek.c
+++ b/arch/arm/mach-at91/board-sam9g20ek.c
@@ -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
diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c
index f112ad9..7851efd 100644
--- a/arch/arm/mach-at91/board-sam9m10g45ek.c
+++ b/arch/arm/mach-at91/board-sam9m10g45ek.c
@@ -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
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c
index defbca4..4f14b54 100644
--- a/arch/arm/mach-at91/board-sam9rlek.c
+++ b/arch/arm/mach-at91/board-sam9rlek.c
@@ -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
diff --git a/arch/arm/mach-at91/board-snapper9260.c b/arch/arm/mach-at91/board-snapper9260.c
index c600b14..25cd3ff 100644
--- a/arch/arm/mach-at91/board-snapper9260.c
+++ b/arch/arm/mach-at91/board-snapper9260.c
@@ -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
diff --git a/arch/arm/mach-at91/board-stamp9g20.c b/arch/arm/mach-at91/board-stamp9g20.c
index e65efda..9821be2 100644
--- a/arch/arm/mach-at91/board-stamp9g20.c
+++ b/arch/arm/mach-at91/board-stamp9g20.c
@@ -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
*/
diff --git a/arch/arm/mach-at91/board-usb-a9260.c b/arch/arm/mach-at91/board-usb-a9260.c
index afc3b04..8c4c1a0 100644
--- a/arch/arm/mach-at91/board-usb-a9260.c
+++ b/arch/arm/mach-at91/board-usb-a9260.c
@@ -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
diff --git a/arch/arm/mach-at91/board-usb-a9263.c b/arch/arm/mach-at91/board-usb-a9263.c
index 25357e0..25e7937 100644
--- a/arch/arm/mach-at91/board-usb-a9263.c
+++ b/arch/arm/mach-at91/board-usb-a9263.c
@@ -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
diff --git a/arch/arm/mach-at91/board-yl-9200.c b/arch/arm/mach-at91/board-yl-9200.c
index e8a8ab9..95edcbd 100644
--- a/arch/arm/mach-at91/board-yl-9200.c
+++ b/arch/arm/mach-at91/board-yl-9200.c
@@ -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
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index 84e5b1d..e807520 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -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 */
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index dd62c46..c8f23ae 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -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),
diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h
index 917f610..d847565 100644
--- a/arch/arm/mach-at91/soc.h
+++ b/arch/arm/mach-at91/soc.h
@@ -5,6 +5,7 @@
*/
struct at91_soc {
+ unsigned int *default_irq_priority;
void (*map_io)(void);
void (*init)(unsigned long main_clock);
};
--
1.7.4.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 4/9] at91: remove AT91_DBGU offset from dbgu register macro
2011-05-10 16:27 AT91: soc init factorisation and fix Jean-Christophe PLAGNIOL-VILLARD
` (2 preceding siblings ...)
2011-05-10 16:34 ` [PATCH 3/9] at91: factorize at91 interrupts init to soc Jean-Christophe PLAGNIOL-VILLARD
@ 2011-05-10 16:34 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 16:34 ` [PATCH 5/9] at91: use structure to store the current soc Jean-Christophe PLAGNIOL-VILLARD
` (5 subsequent siblings)
9 siblings, 0 replies; 22+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-05-10 16:34 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
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(-)
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index 1f3abb4..291beb7 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -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:
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index c8de47f..86fc31c 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -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:
diff --git a/arch/arm/mach-at91/include/mach/at91_dbgu.h b/arch/arm/mach-at91/include/mach/at91_dbgu.h
index 6dcaa77..bacf3e8 100644
--- a/arch/arm/mach-at91/include/mach/at91_dbgu.h
+++ b/arch/arm/mach-at91/include/mach/at91_dbgu.h
@@ -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 */
diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h
index ab00372..0d81087 100644
--- a/arch/arm/mach-at91/include/mach/cpu.h
+++ b/arch/arm/mach-at91/include/mach/cpu.h
@@ -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
diff --git a/arch/arm/mach-at91/include/mach/debug-macro.S b/arch/arm/mach-at91/include/mach/debug-macro.S
index 0f959fa..bc1e0b2 100644
--- a/arch/arm/mach-at91/include/mach/debug-macro.S
+++ b/arch/arm/mach-at91/include/mach/debug-macro.S
@@ -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
--
1.7.4.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 5/9] at91: use structure to store the current soc
2011-05-10 16:27 AT91: soc init factorisation and fix Jean-Christophe PLAGNIOL-VILLARD
` (3 preceding siblings ...)
2011-05-10 16:34 ` [PATCH 4/9] at91: remove AT91_DBGU offset from dbgu register macro Jean-Christophe PLAGNIOL-VILLARD
@ 2011-05-10 16:34 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 21:54 ` Ryan Mallon
2011-05-10 16:34 ` [PATCH 6/9] at91: move clock subsystem init to soc generic init Jean-Christophe PLAGNIOL-VILLARD
` (4 subsequent siblings)
9 siblings, 1 reply; 22+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-05-10 16:34 UTC (permalink / raw)
To: linux-arm-kernel
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
(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
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
---
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(-)
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 89e4807..9c8c8ce 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -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
* -------------------------------------------------------------------- */
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index 291beb7..cac454e 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -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;
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index 86fc31c..c25c173 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -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;
diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h
index 0d81087..66b27a9f 100644
--- a/arch/arm/mach-at91/include/mach/cpu.h
+++ b/arch/arm/mach-at91/include/mach/cpu.h
@@ -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 <plagnioj@jcrosoft.com>
*
* 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__ */
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index c8f23ae..df6ee4f 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -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)
@@ -39,35 +52,199 @@ static struct map_desc at91_io_desc __initdata = {
.type = MT_DEVICE,
};
+#define AT91_DBGU0 0xfffff200
+#define AT91_DBGU1 0xffffee00
+
+static void soc_detect(u32 dbgu_base)
+{
+ 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 */
+ 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;
+
+ /* 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) {
+ 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 (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;
+ 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;
+ }
+ }
+}
+
+static const char *soc_name[] = {
+ [SOC_RM9200] = "at91rm9200",
+ [SOC_572D940HF] = "at572d940hf",
+ [SOC_CAP9] = "at91cap9",
+ [SOC_SAM9260] = "at91sam9260",
+ [SOC_SAM9261] = "at91sam9261",
+ [SOC_SAM9263] = "at91sam9263",
+ [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)
+{
+ return soc_name[c->type];
+}
+EXPORT_SYMBOL(get_at91_soc_type);
+
+static const char *soc_subtype_name[] = {
+ [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",
+ [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)
+{
+ 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;
- 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);
+
+ 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");
if (at91_boot_soc.map_io)
at91_boot_soc.map_io();
diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h
index d847565..1125671 100644
--- a/arch/arm/mach-at91/soc.h
+++ b/arch/arm/mach-at91/soc.h
@@ -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
--
1.7.4.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 6/9] at91: move clock subsystem init to soc generic init
2011-05-10 16:27 AT91: soc init factorisation and fix Jean-Christophe PLAGNIOL-VILLARD
` (4 preceding siblings ...)
2011-05-10 16:34 ` [PATCH 5/9] at91: use structure to store the current soc Jean-Christophe PLAGNIOL-VILLARD
@ 2011-05-10 16:34 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 16:34 ` [PATCH 7/9] at91: move register clocks " Jean-Christophe PLAGNIOL-VILLARD
` (3 subsequent siblings)
9 siblings, 0 replies; 22+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-05-10 16:34 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
---
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(-)
diff --git a/arch/arm/mach-at91/at572d940hf.c b/arch/arm/mach-at91/at572d940hf.c
index 39827ebc..8c9ad21 100644
--- a/arch/arm/mach-at91/at572d940hf.c
+++ b/arch/arm/mach-at91/at572d940hf.c
@@ -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();
diff --git a/arch/arm/mach-at91/at91cap9.c b/arch/arm/mach-at91/at91cap9.c
index 238b6a0..f4219a8 100644
--- a/arch/arm/mach-at91/at91cap9.c
+++ b/arch/arm/mach-at91/at91cap9.c
@@ -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();
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 9c8c8ce..80e624e 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -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();
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index cac454e..47ead44 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -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();
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 69bc26f..50506c2 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -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();
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 3da9103..038b3d7 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -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();
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index ecca942..294126f 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -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();
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index c25c173..5b23536 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -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();
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index e807520..9fd0fa3 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -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);
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index df6ee4f..d65cfe7 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -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();
}
diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h
index 1125671..a62baf8 100644
--- a/arch/arm/mach-at91/soc.h
+++ b/arch/arm/mach-at91/soc.h
@@ -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;
--
1.7.4.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 7/9] at91: move register clocks to soc generic init
2011-05-10 16:27 AT91: soc init factorisation and fix Jean-Christophe PLAGNIOL-VILLARD
` (5 preceding siblings ...)
2011-05-10 16:34 ` [PATCH 6/9] at91: move clock subsystem init to soc generic init Jean-Christophe PLAGNIOL-VILLARD
@ 2011-05-10 16:34 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 16:34 ` [PATCH 8/9] at91: factorize sram init Jean-Christophe PLAGNIOL-VILLARD
` (2 subsequent siblings)
9 siblings, 0 replies; 22+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-05-10 16:34 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
---
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(-)
diff --git a/arch/arm/mach-at91/at572d940hf.c b/arch/arm/mach-at91/at572d940hf.c
index 8c9ad21..f3e2c65 100644
--- a/arch/arm/mach-at91/at572d940hf.c
+++ b/arch/arm/mach-at91/at572d940hf.c
@@ -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,
};
diff --git a/arch/arm/mach-at91/at91cap9.c b/arch/arm/mach-at91/at91cap9.c
index f4219a8..23790b9 100644
--- a/arch/arm/mach-at91/at91cap9.c
+++ b/arch/arm/mach-at91/at91cap9.c
@@ -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,
};
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 80e624e..0b512a3 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -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,
};
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index 47ead44..7da4f2a 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -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,
};
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 50506c2..bbaf72b 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -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,
};
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 038b3d7..88de596 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -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,
};
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index 294126f..0e5dace 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -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,
};
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index 5b23536..adad00d 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -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,
};
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index d65cfe7..9aaca5f 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -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();
}
diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h
index a62baf8..ea6c3e4 100644
--- a/arch/arm/mach-at91/soc.h
+++ b/arch/arm/mach-at91/soc.h
@@ -7,6 +7,7 @@
struct at91_soc {
unsigned int *default_irq_priority;
void (*map_io)(void);
+ void (*register_clocks)(void);
void (*init)(void);
};
--
1.7.4.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 8/9] at91: factorize sram init
2011-05-10 16:27 AT91: soc init factorisation and fix Jean-Christophe PLAGNIOL-VILLARD
` (6 preceding siblings ...)
2011-05-10 16:34 ` [PATCH 7/9] at91: move register clocks " Jean-Christophe PLAGNIOL-VILLARD
@ 2011-05-10 16:34 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 23:29 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 23:29 ` [PATCH 9/9] at91: add arch specific ioremap support Jean-Christophe PLAGNIOL-VILLARD
9 siblings, 0 replies; 22+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-05-10 16:34 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
---
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(-)
diff --git a/arch/arm/mach-at91/at572d940hf.c b/arch/arm/mach-at91/at572d940hf.c
index f3e2c65..4a26877 100644
--- a/arch/arm/mach-at91/at572d940hf.c
+++ b/arch/arm/mach-at91/at572d940hf.c
@@ -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)
diff --git a/arch/arm/mach-at91/at91cap9.c b/arch/arm/mach-at91/at91cap9.c
index 23790b9..18745ae 100644
--- a/arch/arm/mach-at91/at91cap9.c
+++ b/arch/arm/mach-at91/at91cap9.c
@@ -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)
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 0b512a3..68088fa4f 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -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));
}
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index 7da4f2a..6133f30 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -27,41 +27,6 @@
#include "generic.h"
#include "clock.h"
-static struct map_desc at91sam9260_sram_desc[] __initdata = {
- {
- .virtual = AT91_IO_VIRT_BASE - AT91SAM9260_SRAM0_SIZE,
- .pfn = __phys_to_pfn(AT91SAM9260_SRAM0_BASE),
- .length = AT91SAM9260_SRAM0_SIZE,
- .type = MT_DEVICE,
- }, {
- .virtual = AT91_IO_VIRT_BASE - AT91SAM9260_SRAM0_SIZE - AT91SAM9260_SRAM1_SIZE,
- .pfn = __phys_to_pfn(AT91SAM9260_SRAM1_BASE),
- .length = AT91SAM9260_SRAM1_SIZE,
- .type = MT_DEVICE,
- }
-};
-
-static struct map_desc at91sam9g20_sram_desc[] __initdata = {
- {
- .virtual = AT91_IO_VIRT_BASE - AT91SAM9G20_SRAM0_SIZE,
- .pfn = __phys_to_pfn(AT91SAM9G20_SRAM0_BASE),
- .length = AT91SAM9G20_SRAM0_SIZE,
- .type = MT_DEVICE,
- }, {
- .virtual = AT91_IO_VIRT_BASE - AT91SAM9G20_SRAM0_SIZE - AT91SAM9G20_SRAM1_SIZE,
- .pfn = __phys_to_pfn(AT91SAM9G20_SRAM1_BASE),
- .length = AT91SAM9G20_SRAM1_SIZE,
- .type = MT_DEVICE,
- }
-};
-
-static struct map_desc at91sam9xe_sram_desc[] __initdata = {
- {
- .pfn = __phys_to_pfn(AT91SAM9XE_SRAM_BASE),
- .type = MT_DEVICE,
- }
-};
-
/* --------------------------------------------------------------------
* Clocks
* -------------------------------------------------------------------- */
@@ -346,20 +311,20 @@ static void __init at91sam9xe_map_io(void)
sram_size = SZ_16K;
}
- at91sam9xe_sram_desc->virtual = AT91_IO_VIRT_BASE - sram_size;
- at91sam9xe_sram_desc->length = sram_size;
-
- iotable_init(at91sam9xe_sram_desc, ARRAY_SIZE(at91sam9xe_sram_desc));
+ at91_init_sram(0, AT91SAM9XE_SRAM_BASE, sram_size);
}
static void __init at91sam9260_map_io(void)
{
- if (cpu_is_at91sam9xe())
+ if (cpu_is_at91sam9xe()) {
at91sam9xe_map_io();
- else if (cpu_is_at91sam9g20())
- iotable_init(at91sam9g20_sram_desc, ARRAY_SIZE(at91sam9g20_sram_desc));
- else
- iotable_init(at91sam9260_sram_desc, ARRAY_SIZE(at91sam9260_sram_desc));
+ } else if (cpu_is_at91sam9g20()) {
+ at91_init_sram(0, AT91SAM9G20_SRAM0_BASE, AT91SAM9G20_SRAM0_SIZE);
+ at91_init_sram(1, AT91SAM9G20_SRAM1_BASE, AT91SAM9G20_SRAM1_SIZE);
+ } else {
+ at91_init_sram(0, AT91SAM9260_SRAM0_BASE, AT91SAM9260_SRAM0_SIZE);
+ at91_init_sram(1, AT91SAM9260_SRAM1_BASE, AT91SAM9260_SRAM1_SIZE);
+ }
}
static void __init at91sam9260_initialize(void)
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index bbaf72b..07e0dff 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -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)
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 88de596..a8ab580 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -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)
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index 0e5dace..11f59d6 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -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)
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index adad00d..6c411f6 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -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)
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index 9fd0fa3..cf83f8b 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -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);
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index 9aaca5f..d2b1a06 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -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),
--
1.7.4.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 5/9] at91: use structure to store the current soc
2011-05-10 16:34 ` [PATCH 5/9] at91: use structure to store the current soc Jean-Christophe PLAGNIOL-VILLARD
@ 2011-05-10 21:54 ` Ryan Mallon
2011-05-10 23:40 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 1 reply; 22+ messages in thread
From: Ryan Mallon @ 2011-05-10 21:54 UTC (permalink / raw)
To: linux-arm-kernel
On 05/11/2011 04:34 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> 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
> (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
>
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
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
> ---
> 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(-)
>
> diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
> index 89e4807..9c8c8ce 100644
> --- a/arch/arm/mach-at91/at91rm9200.c
> +++ b/arch/arm/mach-at91/at91rm9200.c
> @@ -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
> * -------------------------------------------------------------------- */
> diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
> index 291beb7..cac454e 100644
> --- a/arch/arm/mach-at91/at91sam9260.c
> +++ b/arch/arm/mach-at91/at91sam9260.c
> @@ -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;
> diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
> index 86fc31c..c25c173 100644
> --- a/arch/arm/mach-at91/at91sam9rl.c
> +++ b/arch/arm/mach-at91/at91sam9rl.c
> @@ -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;
> diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h
> index 0d81087..66b27a9f 100644
> --- a/arch/arm/mach-at91/include/mach/cpu.h
> +++ b/arch/arm/mach-at91/include/mach/cpu.h
> @@ -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 <plagnioj@jcrosoft.com>
> *
> * 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__ */
> diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
> index c8f23ae..df6ee4f 100644
> --- a/arch/arm/mach-at91/setup.c
> +++ b/arch/arm/mach-at91/setup.c
> @@ -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)
> @@ -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.
> +
> +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.
> + 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 */
> + 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?
> +
> + /* 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) {
> + 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;
> + }
> +
> + 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;
> + 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.
> + }
> + }
> +}
> +
> +static const char *soc_name[] = {
> + [SOC_RM9200] = "at91rm9200",
> + [SOC_572D940HF] = "at572d940hf",
> + [SOC_CAP9] = "at91cap9",
> + [SOC_SAM9260] = "at91sam9260",
> + [SOC_SAM9261] = "at91sam9261",
> + [SOC_SAM9263] = "at91sam9263",
> + [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.
> + return soc_name[c->type];
> +}
> +EXPORT_SYMBOL(get_at91_soc_type);
> +
> +static const char *soc_subtype_name[] = {
__initdata
> + [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",
> + [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
> + 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;
> - 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.
> +
> + 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.
>
> if (at91_boot_soc.map_io)
> at91_boot_soc.map_io();
> diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h
> index d847565..1125671 100644
> --- a/arch/arm/mach-at91/soc.h
> +++ b/arch/arm/mach-at91/soc.h
> @@ -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.
> +
> +#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
--
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
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 8/9] at91: factorize sram init
2011-05-10 16:27 AT91: soc init factorisation and fix Jean-Christophe PLAGNIOL-VILLARD
` (7 preceding siblings ...)
2011-05-10 16:34 ` [PATCH 8/9] at91: factorize sram init Jean-Christophe PLAGNIOL-VILLARD
@ 2011-05-10 23:29 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 23:29 ` [PATCH 9/9] at91: add arch specific ioremap support Jean-Christophe PLAGNIOL-VILLARD
9 siblings, 0 replies; 22+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-05-10 23:29 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
---
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(-)
diff --git a/arch/arm/mach-at91/at572d940hf.c b/arch/arm/mach-at91/at572d940hf.c
index f3e2c65..4a26877 100644
--- a/arch/arm/mach-at91/at572d940hf.c
+++ b/arch/arm/mach-at91/at572d940hf.c
@@ -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)
diff --git a/arch/arm/mach-at91/at91cap9.c b/arch/arm/mach-at91/at91cap9.c
index 23790b9..18745ae 100644
--- a/arch/arm/mach-at91/at91cap9.c
+++ b/arch/arm/mach-at91/at91cap9.c
@@ -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)
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 0b512a3..68088fa4f 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -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));
}
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index 7da4f2a..6133f30 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -27,41 +27,6 @@
#include "generic.h"
#include "clock.h"
-static struct map_desc at91sam9260_sram_desc[] __initdata = {
- {
- .virtual = AT91_IO_VIRT_BASE - AT91SAM9260_SRAM0_SIZE,
- .pfn = __phys_to_pfn(AT91SAM9260_SRAM0_BASE),
- .length = AT91SAM9260_SRAM0_SIZE,
- .type = MT_DEVICE,
- }, {
- .virtual = AT91_IO_VIRT_BASE - AT91SAM9260_SRAM0_SIZE - AT91SAM9260_SRAM1_SIZE,
- .pfn = __phys_to_pfn(AT91SAM9260_SRAM1_BASE),
- .length = AT91SAM9260_SRAM1_SIZE,
- .type = MT_DEVICE,
- }
-};
-
-static struct map_desc at91sam9g20_sram_desc[] __initdata = {
- {
- .virtual = AT91_IO_VIRT_BASE - AT91SAM9G20_SRAM0_SIZE,
- .pfn = __phys_to_pfn(AT91SAM9G20_SRAM0_BASE),
- .length = AT91SAM9G20_SRAM0_SIZE,
- .type = MT_DEVICE,
- }, {
- .virtual = AT91_IO_VIRT_BASE - AT91SAM9G20_SRAM0_SIZE - AT91SAM9G20_SRAM1_SIZE,
- .pfn = __phys_to_pfn(AT91SAM9G20_SRAM1_BASE),
- .length = AT91SAM9G20_SRAM1_SIZE,
- .type = MT_DEVICE,
- }
-};
-
-static struct map_desc at91sam9xe_sram_desc[] __initdata = {
- {
- .pfn = __phys_to_pfn(AT91SAM9XE_SRAM_BASE),
- .type = MT_DEVICE,
- }
-};
-
/* --------------------------------------------------------------------
* Clocks
* -------------------------------------------------------------------- */
@@ -346,20 +311,20 @@ static void __init at91sam9xe_map_io(void)
sram_size = SZ_16K;
}
- at91sam9xe_sram_desc->virtual = AT91_IO_VIRT_BASE - sram_size;
- at91sam9xe_sram_desc->length = sram_size;
-
- iotable_init(at91sam9xe_sram_desc, ARRAY_SIZE(at91sam9xe_sram_desc));
+ at91_init_sram(0, AT91SAM9XE_SRAM_BASE, sram_size);
}
static void __init at91sam9260_map_io(void)
{
- if (cpu_is_at91sam9xe())
+ if (cpu_is_at91sam9xe()) {
at91sam9xe_map_io();
- else if (cpu_is_at91sam9g20())
- iotable_init(at91sam9g20_sram_desc, ARRAY_SIZE(at91sam9g20_sram_desc));
- else
- iotable_init(at91sam9260_sram_desc, ARRAY_SIZE(at91sam9260_sram_desc));
+ } else if (cpu_is_at91sam9g20()) {
+ at91_init_sram(0, AT91SAM9G20_SRAM0_BASE, AT91SAM9G20_SRAM0_SIZE);
+ at91_init_sram(1, AT91SAM9G20_SRAM1_BASE, AT91SAM9G20_SRAM1_SIZE);
+ } else {
+ at91_init_sram(0, AT91SAM9260_SRAM0_BASE, AT91SAM9260_SRAM0_SIZE);
+ at91_init_sram(1, AT91SAM9260_SRAM1_BASE, AT91SAM9260_SRAM1_SIZE);
+ }
}
static void __init at91sam9260_initialize(void)
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index bbaf72b..07e0dff 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -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)
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 88de596..a8ab580 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -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)
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index 0e5dace..11f59d6 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -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)
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index adad00d..6c411f6 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -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)
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index 9fd0fa3..cf83f8b 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -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);
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index 9aaca5f..d2b1a06 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -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),
--
1.7.4.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 9/9] at91: add arch specific ioremap support
2011-05-10 16:27 AT91: soc init factorisation and fix Jean-Christophe PLAGNIOL-VILLARD
` (8 preceding siblings ...)
2011-05-10 23:29 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2011-05-10 23:29 ` Jean-Christophe PLAGNIOL-VILLARD
9 siblings, 0 replies; 22+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-05-10 23:29 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
---
arch/arm/mach-at91/include/mach/io.h | 16 +++++++++++++++-
arch/arm/mach-at91/setup.c | 19 +++++++++++++++++++
2 files changed, 34 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-at91/include/mach/io.h b/arch/arm/mach-at91/include/mach/io.h
index 0b0cccc..6ffc53b 100644
--- a/arch/arm/mach-at91/include/mach/io.h
+++ b/arch/arm/mach-at91/include/mach/io.h
@@ -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;
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index d2b1a06..308794d 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -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
--
1.7.4.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 5/9] at91: use structure to store the current soc
2011-05-10 21:54 ` Ryan Mallon
@ 2011-05-10 23:40 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-11 0:39 ` Ryan Mallon
0 siblings, 1 reply; 22+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-05-10 23:40 UTC (permalink / raw)
To: linux-arm-kernel
> > +
> > +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.
no need as at91_soc_data.type is init to SOC_AT91_NONE first
this ways we use less code
>
> > + 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);
> +
> > + 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
>
> > +
> > + /* 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:
>
> 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
>
> > +
> > +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.
no this data will be use for sysfs export later
and at91_soc_data is not __initdata
>
> > +
> > + 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
>
> >
> > if (at91_boot_soc.map_io)
> > at91_boot_soc.map_io();
> > diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h
> > index d847565..1125671 100644
> > --- a/arch/arm/mach-at91/soc.h
> > +++ b/arch/arm/mach-at91/soc.h
> > @@ -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
>
> > +
> > +#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.
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 5/9] at91: use structure to store the current soc
2011-05-10 23:40 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2011-05-11 0:39 ` Ryan Mallon
2011-05-11 3:26 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 1 reply; 22+ messages in thread
From: Ryan Mallon @ 2011-05-11 0:39 UTC (permalink / raw)
To: linux-arm-kernel
On 05/11/2011 11:40 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
>
>>> +
>>> +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.
> no need as at91_soc_data.type is init to SOC_AT91_NONE first
> 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.
>>
>>> + 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);
> > +
>>> + 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.
>>
>>> +
>>> + /* 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:
>>
>> 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.
>>> +
>>> +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.
> no this data will be use for sysfs export later
> and at91_soc_data is not __initdata
Okay. I still think the function names should be changed.
>>
>>> +
>>> + 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
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.
>>>
>>> if (at91_boot_soc.map_io)
>>> at91_boot_soc.map_io();
>>> diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h
>>> index d847565..1125671 100644
>>> --- a/arch/arm/mach-at91/soc.h
>>> +++ b/arch/arm/mach-at91/soc.h
>>> @@ -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
Static inlines are the preferred method wherever possible.
>>
>>> +
>>> +#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
--
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
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 5/9] at91: use structure to store the current soc
2011-05-11 0:39 ` Ryan Mallon
@ 2011-05-11 3:26 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-11 4:12 ` Ryan Mallon
0 siblings, 1 reply; 22+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-05-11 3:26 UTC (permalink / raw)
To: linux-arm-kernel
On 12:39 Wed 11 May , Ryan Mallon wrote:
> On 05/11/2011 11:40 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> >
> >>> +
> >>> +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.
> > no need as at91_soc_data.type is init to SOC_AT91_NONE first
> > 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.
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
>
> >>
> >>> + 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
>
> 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.
no more code and more assembly
furthermore we associate the subtype with the subtype name where each entry
are uniq
>
> >>> +
> >>> +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.
> > no this data will be use for sysfs export later
> > and at91_soc_data is not __initdata
>
> Okay. I still think the function names should be changed.
we use the same convention on sh and it's clear for me
>
> >>
> >>> +
> >>> + 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
>
> 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.
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.
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 5/9] at91: use structure to store the current soc
2011-05-11 3:26 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2011-05-11 4:12 ` Ryan Mallon
2011-05-11 4:19 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 1 reply; 22+ messages in thread
From: Ryan Mallon @ 2011-05-11 4:12 UTC (permalink / raw)
To: linux-arm-kernel
On 05/11/2011 03:26 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 12:39 Wed 11 May , Ryan Mallon wrote:
>> On 05/11/2011 11:40 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
>>>
>>>>> +
>>>>> +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.
>>> no need as at91_soc_data.type is init to SOC_AT91_NONE first
>>> 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.
> 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.
>>
>>>>
>>>>> + 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
>>
>> 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.
> no more code and more assembly
Why?
> 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.
>
>>
>>>>> +
>>>>> +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.
>>> no this data will be use for sysfs export later
>>> and at91_soc_data is not __initdata
>>
>> Okay. 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.
>>
>>>>
>>>>> +
>>>>> + 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
>>
>> 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.
> 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
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
--
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
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 5/9] at91: use structure to store the current soc
2011-05-11 4:12 ` Ryan Mallon
@ 2011-05-11 4:19 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-11 7:30 ` Andrew Victor
2011-05-11 8:30 ` Nicolas Ferre
0 siblings, 2 replies; 22+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-05-11 4:19 UTC (permalink / raw)
To: linux-arm-kernel
On 16:12 Wed 11 May , Ryan Mallon wrote:
> On 05/11/2011 03:26 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > On 12:39 Wed 11 May , Ryan Mallon wrote:
> >> On 05/11/2011 11:40 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> >>>
> >>>>> +
> >>>>> +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.
> >>> no need as at91_soc_data.type is init to SOC_AT91_NONE first
> >>> 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.
> > 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
no sorry it's very clear
at91 for the arch
soc_data data related to the soc
you can see 1000 times of time in the kernel
gic_data
cpu_data etc....
> 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
>
> >>
> >>>>
> >>>>> + 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
> >>
> >> 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.
>
> > no more code and more assembly
>
> Why?
two test to do everytime simple
compare to one
>
> > 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.
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
>
>
> >
> >>
> >>>>> +
> >>>>> +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.
> >>> no this data will be use for sysfs export later
> >>> and at91_soc_data is not __initdata
> >>
> >> Okay. 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.
sorry I still not convince and keep the current naming convention
and replace the lookup will not work
>
> >>
> >>>>
> >>>>> +
> >>>>> + 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
> >>
> >> 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.
> > 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
>
> 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.
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.
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 5/9] at91: use structure to store the current soc
2011-05-11 4:19 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2011-05-11 7:30 ` Andrew Victor
2011-05-11 8:03 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-11 8:30 ` Nicolas Ferre
1 sibling, 1 reply; 22+ messages in thread
From: Andrew Victor @ 2011-05-11 7:30 UTC (permalink / raw)
To: linux-arm-kernel
hi,
>> 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
> 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.
> at91 for the arch
> soc_data data related to the soc
>
> you can see 1000 times of time in the kernel
> gic_data
> cpu_data etc....
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
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 5/9] at91: use structure to store the current soc
2011-05-11 7:30 ` Andrew Victor
@ 2011-05-11 8:03 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 0 replies; 22+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-05-11 8:03 UTC (permalink / raw)
To: linux-arm-kernel
On 09:30 Wed 11 May , Andrew Victor wrote:
> hi,
>
> >> 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
> > 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
>
>
> > at91 for the arch
> > soc_data data related to the soc
> >
> > you can see 1000 times of time in the kernel
> > gic_data
> > cpu_data etc....
>
> 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_.
this is already the case
Best Regards,
J.
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 5/9] at91: use structure to store the current soc
2011-05-11 4:19 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-11 7:30 ` Andrew Victor
@ 2011-05-11 8:30 ` Nicolas Ferre
2011-05-11 8:41 ` Nicolas Ferre
2011-05-11 21:42 ` Ryan Mallon
1 sibling, 2 replies; 22+ messages in thread
From: Nicolas Ferre @ 2011-05-11 8:30 UTC (permalink / raw)
To: linux-arm-kernel
Hi all,
Le 11/05/2011 06:19, Jean-Christophe PLAGNIOL-VILLARD :
> On 16:12 Wed 11 May , Ryan Mallon wrote:
>> On 05/11/2011 03:26 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
>>> On 12:39 Wed 11 May , Ryan Mallon wrote:
>>>> On 05/11/2011 11:40 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
>>>>>
>>>>>>> +
>>>>>>> +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.
>>>>> no need as at91_soc_data.type is init to SOC_AT91_NONE first
>>>>> 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.
>>> 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
> no sorry it's very clear
>
> at91 for the arch
> soc_data data related to the soc
>
> you can see 1000 times of time in the kernel
> gic_data
> cpu_data etc....
>
>> 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
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 ;-)
[..]
>>> 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.
> 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.
[..]
>>>>>>> +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.
>>>>> no this data will be use for sysfs export later
>>>>> and at91_soc_data is not __initdata
>>>>
>>>> Okay. 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.
> 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 {}
> and replace the lookup will not work
Ok with that.
[..]
>>>>>> 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_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.
>>> 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
>>
>> 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.
>
> 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
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,
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 5/9] at91: use structure to store the current soc
2011-05-11 8:30 ` Nicolas Ferre
@ 2011-05-11 8:41 ` Nicolas Ferre
2011-05-11 21:42 ` Ryan Mallon
1 sibling, 0 replies; 22+ messages in thread
From: Nicolas Ferre @ 2011-05-11 8:41 UTC (permalink / raw)
To: linux-arm-kernel
Le 11/05/2011 10:30, Nicolas Ferre :
[..]
> 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,
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 5/9] at91: use structure to store the current soc
2011-05-11 8:30 ` Nicolas Ferre
2011-05-11 8:41 ` Nicolas Ferre
@ 2011-05-11 21:42 ` Ryan Mallon
1 sibling, 0 replies; 22+ messages in thread
From: Ryan Mallon @ 2011-05-11 21:42 UTC (permalink / raw)
To: linux-arm-kernel
On 05/11/2011 08:30 PM, Nicolas Ferre wrote:
> Hi all,
>
> Le 11/05/2011 06:19, Jean-Christophe PLAGNIOL-VILLARD :
>> On 16:12 Wed 11 May , Ryan Mallon wrote:
>>> On 05/11/2011 03:26 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
>>>> On 12:39 Wed 11 May , Ryan Mallon wrote:
>>>>> On 05/11/2011 11:40 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
<snip>
>>>> 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.
>> 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.
>
> [..]
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>
>>>>>>> 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_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.
>>>> 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
>>>
>>> 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.
>>
>> 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
>
> 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
--
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
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2011-05-11 21:42 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-10 16:27 AT91: soc init factorisation and fix Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 16:34 ` [PATCH 1/9] at91rm9200: introduce at91rm9200_set_type to specficy cpu package Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 16:34 ` [PATCH 2/9] at91: introduce commom AT91_BASE_SYS Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 16:34 ` [PATCH 3/9] at91: factorize at91 interrupts init to soc Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 16:34 ` [PATCH 4/9] at91: remove AT91_DBGU offset from dbgu register macro Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 16:34 ` [PATCH 5/9] at91: use structure to store the current soc Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 21:54 ` Ryan Mallon
2011-05-10 23:40 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-11 0:39 ` Ryan Mallon
2011-05-11 3:26 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-11 4:12 ` Ryan Mallon
2011-05-11 4:19 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-11 7:30 ` Andrew Victor
2011-05-11 8:03 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-11 8:30 ` Nicolas Ferre
2011-05-11 8:41 ` Nicolas Ferre
2011-05-11 21:42 ` Ryan Mallon
2011-05-10 16:34 ` [PATCH 6/9] at91: move clock subsystem init to soc generic init Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 16:34 ` [PATCH 7/9] at91: move register clocks " Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 16:34 ` [PATCH 8/9] at91: factorize sram init Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 23:29 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 23:29 ` [PATCH 9/9] at91: add arch specific ioremap support Jean-Christophe PLAGNIOL-VILLARD
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).