aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2011-04-23 23:40:22 -0400
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2011-05-25 11:04:35 -0400
commite57556e3b6dcbf9b459cd503b061457b6ed1758f (patch)
tree460d002f98a81a3c53983c3129f7455d011afdc8 /arch/arm
parent3d51f259e819b49b3f88b594afcb044d1ffcda8a (diff)
at91rm9200: introduce at91rm9200_set_type to specficy cpu package
as we can not detect it by defaut the type will be bga introduce cpu_is_at91rm9200_bga and cpu_is_at91rm9200_pqfp Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-at91/at91rm9200.c13
-rw-r--r--arch/arm/mach-at91/board-1arm.c6
-rw-r--r--arch/arm/mach-at91/board-carmeva.c2
-rw-r--r--arch/arm/mach-at91/board-cpuat91.c6
-rw-r--r--arch/arm/mach-at91/board-csb337.c2
-rw-r--r--arch/arm/mach-at91/board-csb637.c2
-rw-r--r--arch/arm/mach-at91/board-eb9200.c2
-rw-r--r--arch/arm/mach-at91/board-ecbat91.c6
-rw-r--r--arch/arm/mach-at91/board-eco920.c7
-rw-r--r--arch/arm/mach-at91/board-kafa.c6
-rw-r--r--arch/arm/mach-at91/board-kb9202.c7
-rw-r--r--arch/arm/mach-at91/board-picotux200.c2
-rw-r--r--arch/arm/mach-at91/board-rm9200dk.c2
-rw-r--r--arch/arm/mach-at91/board-rm9200ek.c2
-rw-r--r--arch/arm/mach-at91/board-yl-9200.c6
-rw-r--r--arch/arm/mach-at91/generic.h3
-rw-r--r--arch/arm/mach-at91/include/mach/cpu.h7
17 files changed, 63 insertions, 18 deletions
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index d3638bd994da..b228ce9e21a1 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -18,6 +18,7 @@
18#include <mach/at91rm9200.h> 18#include <mach/at91rm9200.h>
19#include <mach/at91_pmc.h> 19#include <mach/at91_pmc.h>
20#include <mach/at91_st.h> 20#include <mach/at91_st.h>
21#include <mach/cpu.h>
21 22
22#include "generic.h" 23#include "generic.h"
23#include "clock.h" 24#include "clock.h"
@@ -303,6 +304,13 @@ static void at91rm9200_reset(void)
303 at91_sys_write(AT91_ST_CR, AT91_ST_WDRST); 304 at91_sys_write(AT91_ST_CR, AT91_ST_WDRST);
304} 305}
305 306
307int rm9200_type;
308EXPORT_SYMBOL(rm9200_type);
309
310void __init at91rm9200_set_type(int type)
311{
312 rm9200_type = type;
313}
306 314
307/* -------------------------------------------------------------------- 315/* --------------------------------------------------------------------
308 * AT91RM9200 processor initialization 316 * AT91RM9200 processor initialization
@@ -313,7 +321,7 @@ void __init at91rm9200_map_io(void)
313 iotable_init(at91rm9200_io_desc, ARRAY_SIZE(at91rm9200_io_desc)); 321 iotable_init(at91rm9200_io_desc, ARRAY_SIZE(at91rm9200_io_desc));
314} 322}
315 323
316void __init at91rm9200_initialize(unsigned long main_clock, unsigned short banks) 324void __init at91rm9200_initialize(unsigned long main_clock)
317{ 325{
318 at91_arch_reset = at91rm9200_reset; 326 at91_arch_reset = at91rm9200_reset;
319 at91_extern_irq = (1 << AT91RM9200_ID_IRQ0) | (1 << AT91RM9200_ID_IRQ1) 327 at91_extern_irq = (1 << AT91RM9200_ID_IRQ0) | (1 << AT91RM9200_ID_IRQ1)
@@ -328,7 +336,8 @@ void __init at91rm9200_initialize(unsigned long main_clock, unsigned short banks
328 at91rm9200_register_clocks(); 336 at91rm9200_register_clocks();
329 337
330 /* Initialize GPIO subsystem */ 338 /* Initialize GPIO subsystem */
331 at91_gpio_init(at91rm9200_gpio, banks); 339 at91_gpio_init(at91rm9200_gpio,
340 cpu_is_at91rm9200_bga() ? AT91RM9200_BGA : AT91RM9200_PQFP);
332} 341}
333 342
334 343
diff --git a/arch/arm/mach-at91/board-1arm.c b/arch/arm/mach-at91/board-1arm.c
index 73372ca868de..ab1d463aa47d 100644
--- a/arch/arm/mach-at91/board-1arm.c
+++ b/arch/arm/mach-at91/board-1arm.c
@@ -35,14 +35,18 @@
35 35
36#include <mach/board.h> 36#include <mach/board.h>
37#include <mach/gpio.h> 37#include <mach/gpio.h>
38#include <mach/cpu.h>
38 39
39#include "generic.h" 40#include "generic.h"
40 41
41 42
42static void __init onearm_init_early(void) 43static void __init onearm_init_early(void)
43{ 44{
45 /* Set cpu type: PQFP */
46 at91rm9200_set_type(ARCH_REVISON_9200_PQFP);
47
44 /* Initialize processor: 18.432 MHz crystal */ 48 /* Initialize processor: 18.432 MHz crystal */
45 at91rm9200_initialize(18432000, AT91RM9200_PQFP); 49 at91rm9200_initialize(18432000);
46 50
47 /* DBGU on ttyS0. (Rx & Tx only) */ 51 /* DBGU on ttyS0. (Rx & Tx only) */
48 at91_register_uart(0, 0, 0); 52 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 3929b1172067..f36b18687494 100644
--- a/arch/arm/mach-at91/board-carmeva.c
+++ b/arch/arm/mach-at91/board-carmeva.c
@@ -43,7 +43,7 @@
43static void __init carmeva_init_early(void) 43static void __init carmeva_init_early(void)
44{ 44{
45 /* Initialize processor: 20.000 MHz crystal */ 45 /* Initialize processor: 20.000 MHz crystal */
46 at91rm9200_initialize(20000000, AT91RM9200_BGA); 46 at91rm9200_initialize(20000000);
47 47
48 /* DBGU on ttyS0. (Rx & Tx only) */ 48 /* DBGU on ttyS0. (Rx & Tx only) */
49 at91_register_uart(0, 0, 0); 49 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 620a36ae79c4..6daabe3907a1 100644
--- a/arch/arm/mach-at91/board-cpuat91.c
+++ b/arch/arm/mach-at91/board-cpuat91.c
@@ -38,6 +38,7 @@
38#include <mach/board.h> 38#include <mach/board.h>
39#include <mach/gpio.h> 39#include <mach/gpio.h>
40#include <mach/at91rm9200_mc.h> 40#include <mach/at91rm9200_mc.h>
41#include <mach/cpu.h>
41 42
42#include "generic.h" 43#include "generic.h"
43 44
@@ -52,8 +53,11 @@ static struct gpio_led cpuat91_leds[] = {
52 53
53static void __init cpuat91_init_early(void) 54static void __init cpuat91_init_early(void)
54{ 55{
56 /* Set cpu type: PQFP */
57 at91rm9200_set_type(ARCH_REVISON_9200_PQFP);
58
55 /* Initialize processor: 18.432 MHz crystal */ 59 /* Initialize processor: 18.432 MHz crystal */
56 at91rm9200_initialize(18432000, AT91RM9200_PQFP); 60 at91rm9200_initialize(18432000);
57 61
58 /* DBGU on ttyS0. (Rx & Tx only) */ 62 /* DBGU on ttyS0. (Rx & Tx only) */
59 at91_register_uart(0, 0, 0); 63 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 a7be81e8b910..d98bcec1dfe0 100644
--- a/arch/arm/mach-at91/board-csb337.c
+++ b/arch/arm/mach-at91/board-csb337.c
@@ -46,7 +46,7 @@
46static void __init csb337_init_early(void) 46static void __init csb337_init_early(void)
47{ 47{
48 /* Initialize processor: 3.6864 MHz crystal */ 48 /* Initialize processor: 3.6864 MHz crystal */
49 at91rm9200_initialize(3686400, AT91RM9200_BGA); 49 at91rm9200_initialize(3686400);
50 50
51 /* Setup the LEDs */ 51 /* Setup the LEDs */
52 at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1); 52 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 58a80c368652..019aab4e20b0 100644
--- a/arch/arm/mach-at91/board-csb637.c
+++ b/arch/arm/mach-at91/board-csb637.c
@@ -43,7 +43,7 @@
43static void __init csb637_init_early(void) 43static void __init csb637_init_early(void)
44{ 44{
45 /* Initialize processor: 3.6864 MHz crystal */ 45 /* Initialize processor: 3.6864 MHz crystal */
46 at91rm9200_initialize(3686400, AT91RM9200_BGA); 46 at91rm9200_initialize(3686400);
47 47
48 /* DBGU on ttyS0. (Rx & Tx only) */ 48 /* DBGU on ttyS0. (Rx & Tx only) */
49 at91_register_uart(0, 0, 0); 49 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 e9fff8030293..e9484535cbc8 100644
--- a/arch/arm/mach-at91/board-eb9200.c
+++ b/arch/arm/mach-at91/board-eb9200.c
@@ -43,7 +43,7 @@
43static void __init eb9200_init_early(void) 43static void __init eb9200_init_early(void)
44{ 44{
45 /* Initialize processor: 18.432 MHz crystal */ 45 /* Initialize processor: 18.432 MHz crystal */
46 at91rm9200_initialize(18432000, AT91RM9200_BGA); 46 at91rm9200_initialize(18432000);
47 47
48 /* DBGU on ttyS0. (Rx & Tx only) */ 48 /* DBGU on ttyS0. (Rx & Tx only) */
49 at91_register_uart(0, 0, 0); 49 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 eea65eaf062a..a6f57faa10a7 100644
--- a/arch/arm/mach-at91/board-ecbat91.c
+++ b/arch/arm/mach-at91/board-ecbat91.c
@@ -38,14 +38,18 @@
38 38
39#include <mach/board.h> 39#include <mach/board.h>
40#include <mach/gpio.h> 40#include <mach/gpio.h>
41#include <mach/cpu.h>
41 42
42#include "generic.h" 43#include "generic.h"
43 44
44 45
45static void __init ecb_at91init_early(void) 46static void __init ecb_at91init_early(void)
46{ 47{
48 /* Set cpu type: PQFP */
49 at91rm9200_set_type(ARCH_REVISON_9200_PQFP);
50
47 /* Initialize processor: 18.432 MHz crystal */ 51 /* Initialize processor: 18.432 MHz crystal */
48 at91rm9200_initialize(18432000, AT91RM9200_PQFP); 52 at91rm9200_initialize(18432000);
49 53
50 /* Setup the LEDs */ 54 /* Setup the LEDs */
51 at91_init_leds(AT91_PIN_PC7, AT91_PIN_PC7); 55 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 90a44e5c6391..bfc0062d1483 100644
--- a/arch/arm/mach-at91/board-eco920.c
+++ b/arch/arm/mach-at91/board-eco920.c
@@ -26,11 +26,16 @@
26 26
27#include <mach/board.h> 27#include <mach/board.h>
28#include <mach/at91rm9200_mc.h> 28#include <mach/at91rm9200_mc.h>
29#include <mach/cpu.h>
30
29#include "generic.h" 31#include "generic.h"
30 32
31static void __init eco920_init_early(void) 33static void __init eco920_init_early(void)
32{ 34{
33 at91rm9200_initialize(18432000, AT91RM9200_PQFP); 35 /* Set cpu type: PQFP */
36 at91rm9200_set_type(ARCH_REVISON_9200_PQFP);
37
38 at91rm9200_initialize(18432000);
34 39
35 /* Setup the LEDs */ 40 /* Setup the LEDs */
36 at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1); 41 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 4f17a1c98f2e..9b003ff744ba 100644
--- a/arch/arm/mach-at91/board-kafa.c
+++ b/arch/arm/mach-at91/board-kafa.c
@@ -35,14 +35,18 @@
35 35
36#include <mach/board.h> 36#include <mach/board.h>
37#include <mach/gpio.h> 37#include <mach/gpio.h>
38#include <mach/cpu.h>
38 39
39#include "generic.h" 40#include "generic.h"
40 41
41 42
42static void __init kafa_init_early(void) 43static void __init kafa_init_early(void)
43{ 44{
45 /* Set cpu type: PQFP */
46 at91rm9200_set_type(ARCH_REVISON_9200_PQFP);
47
44 /* Initialize processor: 18.432 MHz crystal */ 48 /* Initialize processor: 18.432 MHz crystal */
45 at91rm9200_initialize(18432000, AT91RM9200_PQFP); 49 at91rm9200_initialize(18432000);
46 50
47 /* Set up the LEDs */ 51 /* Set up the LEDs */
48 at91_init_leds(AT91_PIN_PB4, AT91_PIN_PB4); 52 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 39247fae5171..a813a74b65f9 100644
--- a/arch/arm/mach-at91/board-kb9202.c
+++ b/arch/arm/mach-at91/board-kb9202.c
@@ -36,7 +36,7 @@
36 36
37#include <mach/board.h> 37#include <mach/board.h>
38#include <mach/gpio.h> 38#include <mach/gpio.h>
39 39#include <mach/cpu.h>
40#include <mach/at91rm9200_mc.h> 40#include <mach/at91rm9200_mc.h>
41 41
42#include "generic.h" 42#include "generic.h"
@@ -44,8 +44,11 @@
44 44
45static void __init kb9202_init_early(void) 45static void __init kb9202_init_early(void)
46{ 46{
47 /* Set cpu type: PQFP */
48 at91rm9200_set_type(ARCH_REVISON_9200_PQFP);
49
47 /* Initialize processor: 10 MHz crystal */ 50 /* Initialize processor: 10 MHz crystal */
48 at91rm9200_initialize(10000000, AT91RM9200_PQFP); 51 at91rm9200_initialize(10000000);
49 52
50 /* Set up the LEDs */ 53 /* Set up the LEDs */
51 at91_init_leds(AT91_PIN_PC19, AT91_PIN_PC18); 54 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 8294eae1e664..756cc2a745dd 100644
--- a/arch/arm/mach-at91/board-picotux200.c
+++ b/arch/arm/mach-at91/board-picotux200.c
@@ -46,7 +46,7 @@
46static void __init picotux200_init_early(void) 46static void __init picotux200_init_early(void)
47{ 47{
48 /* Initialize processor: 18.432 MHz crystal */ 48 /* Initialize processor: 18.432 MHz crystal */
49 at91rm9200_initialize(18432000, AT91RM9200_BGA); 49 at91rm9200_initialize(18432000);
50 50
51 /* DBGU on ttyS0. (Rx & Tx only) */ 51 /* DBGU on ttyS0. (Rx & Tx only) */
52 at91_register_uart(0, 0, 0); 52 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 b90d0f9ade32..aef9627710b0 100644
--- a/arch/arm/mach-at91/board-rm9200dk.c
+++ b/arch/arm/mach-at91/board-rm9200dk.c
@@ -48,7 +48,7 @@
48static void __init dk_init_early(void) 48static void __init dk_init_early(void)
49{ 49{
50 /* Initialize processor: 18.432 MHz crystal */ 50 /* Initialize processor: 18.432 MHz crystal */
51 at91rm9200_initialize(18432000, AT91RM9200_BGA); 51 at91rm9200_initialize(18432000);
52 52
53 /* Setup the LEDs */ 53 /* Setup the LEDs */
54 at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2); 54 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 51c266807b1e..015a02183080 100644
--- a/arch/arm/mach-at91/board-rm9200ek.c
+++ b/arch/arm/mach-at91/board-rm9200ek.c
@@ -48,7 +48,7 @@
48static void __init ek_init_early(void) 48static void __init ek_init_early(void)
49{ 49{
50 /* Initialize processor: 18.432 MHz crystal */ 50 /* Initialize processor: 18.432 MHz crystal */
51 at91rm9200_initialize(18432000, AT91RM9200_BGA); 51 at91rm9200_initialize(18432000);
52 52
53 /* Setup the LEDs */ 53 /* Setup the LEDs */
54 at91_init_leds(AT91_PIN_PB1, AT91_PIN_PB2); 54 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 167337ff79c8..c208cc334d7d 100644
--- a/arch/arm/mach-at91/board-yl-9200.c
+++ b/arch/arm/mach-at91/board-yl-9200.c
@@ -45,14 +45,18 @@
45#include <mach/board.h> 45#include <mach/board.h>
46#include <mach/gpio.h> 46#include <mach/gpio.h>
47#include <mach/at91rm9200_mc.h> 47#include <mach/at91rm9200_mc.h>
48#include <mach/cpu.h>
48 49
49#include "generic.h" 50#include "generic.h"
50 51
51 52
52static void __init yl9200_init_early(void) 53static void __init yl9200_init_early(void)
53{ 54{
55 /* Set cpu type: PQFP */
56 at91rm9200_set_type(ARCH_REVISON_9200_PQFP);
57
54 /* Initialize processor: 18.432 MHz crystal */ 58 /* Initialize processor: 18.432 MHz crystal */
55 at91rm9200_initialize(18432000, AT91RM9200_PQFP); 59 at91rm9200_initialize(18432000);
56 60
57 /* Setup the LEDs D2=PB17 (timer), D3=PB16 (cpu) */ 61 /* Setup the LEDs D2=PB17 (timer), D3=PB16 (cpu) */
58 at91_init_leds(AT91_PIN_PB16, AT91_PIN_PB17); 62 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 ecba94ee520b..5783bd1b6c40 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);
22extern void __init at572d940hf_map_io(void); 22extern void __init at572d940hf_map_io(void);
23 23
24 /* Processors */ 24 /* Processors */
25extern void __init at91rm9200_initialize(unsigned long main_clock, unsigned short banks); 25extern void __init at91rm9200_set_type(int type);
26extern void __init at91rm9200_initialize(unsigned long main_clock);
26extern void __init at91sam9260_initialize(unsigned long main_clock); 27extern void __init at91sam9260_initialize(unsigned long main_clock);
27extern void __init at91sam9261_initialize(unsigned long main_clock); 28extern void __init at91sam9261_initialize(unsigned long main_clock);
28extern void __init at91sam9263_initialize(unsigned long main_clock); 29extern 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 0700f2125305..ab00372ca045 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)
90#endif 90#endif
91 91
92#ifdef CONFIG_ARCH_AT91RM9200 92#ifdef CONFIG_ARCH_AT91RM9200
93extern int rm9200_type;
94#define ARCH_REVISON_9200_BGA (0 << 0)
95#define ARCH_REVISON_9200_PQFP (1 << 0)
93#define cpu_is_at91rm9200() (at91_cpu_identify() == ARCH_ID_AT91RM9200) 96#define cpu_is_at91rm9200() (at91_cpu_identify() == ARCH_ID_AT91RM9200)
97#define cpu_is_at91rm9200_bga() (!cpu_is_at91rm9200_pqfp())
98#define cpu_is_at91rm9200_pqfp() (cpu_is_at91rm9200() && rm9200_type & ARCH_REVISON_9200_PQFP)
94#else 99#else
95#define cpu_is_at91rm9200() (0) 100#define cpu_is_at91rm9200() (0)
101#define cpu_is_at91rm9200_bga() (0)
102#define cpu_is_at91rm9200_pqfp() (0)
96#endif 103#endif
97 104
98#ifdef CONFIG_ARCH_AT91SAM9260 105#ifdef CONFIG_ARCH_AT91SAM9260