Skip to content

Commit

Permalink
at91rm9200: introduce at91rm9200_set_type to specficy cpu package
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jean-Christophe PLAGNIOL-VILLARD committed May 25, 2011
1 parent 3d51f25 commit e57556e
Show file tree
Hide file tree
Showing 17 changed files with 63 additions and 18 deletions.
13 changes: 11 additions & 2 deletions arch/arm/mach-at91/at91rm9200.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -303,6 +304,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
Expand All @@ -313,7 +321,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)
Expand All @@ -328,7 +336,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);
}


Expand Down
6 changes: 5 additions & 1 deletion arch/arm/mach-at91/board-1arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-carmeva.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 5 additions & 1 deletion arch/arm/mach-at91/board-cpuat91.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <mach/board.h>
#include <mach/gpio.h>
#include <mach/at91rm9200_mc.h>
#include <mach/cpu.h>

#include "generic.h"

Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-csb337.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-csb637.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-eb9200.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 5 additions & 1 deletion arch/arm/mach-at91/board-ecbat91.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 6 additions & 1 deletion arch/arm/mach-at91/board-eco920.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 5 additions & 1 deletion arch/arm/mach-at91/board-kafa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 5 additions & 2 deletions arch/arm/mach-at91/board-kb9202.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,19 @@

#include <mach/board.h>
#include <mach/gpio.h>

#include <mach/cpu.h>
#include <mach/at91rm9200_mc.h>

#include "generic.h"


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);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-picotux200.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-rm9200dk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-rm9200ek.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 5 additions & 1 deletion arch/arm/mach-at91/board-yl-9200.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-at91/generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 7 additions & 0 deletions arch/arm/mach-at91/include/mach/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e57556e

Please sign in to comment.