Add data so we can convert a PIO unit number into a base address.

This commit is contained in:
Warner Losh 2014-01-15 19:53:36 +00:00
parent db9765adeb
commit 7855b0bd68
6 changed files with 51 additions and 5 deletions

View File

@ -88,6 +88,13 @@ static const int at91_irq_prio[32] =
0 /* Advanced Interrupt Controller (IRQ6) */
};
static const uint32_t at91_pio_base[] = {
AT91RM92_PIOA_BASE,
AT91RM92_PIOB_BASE,
AT91RM92_PIOC_BASE,
AT91RM92_PIOD_BASE,
};
#define DEVICE(_name, _id, _unit) \
{ \
_name, _unit, \
@ -195,6 +202,8 @@ static struct at91_soc_data soc_data = {
.soc_clock_init = at91_clock_init,
.soc_irq_prio = at91_irq_prio,
.soc_children = at91_devs,
.soc_pio_base = at91_pio_base,
.soc_pio_count = nitems(at91_pio_base),
};
AT91_SOC(AT91_T_RM9200, &soc_data);

View File

@ -87,6 +87,12 @@ static const int at91_irq_prio[32] =
0, /* Advanced Interrupt Controller IRQ2 */
};
static const uint32_t at91_pio_base[] = {
AT91SAM9260_PIOA_BASE,
AT91SAM9260_PIOB_BASE,
AT91SAM9260_PIOC_BASE,
};
#define DEVICE(_name, _id, _unit) \
{ \
_name, _unit, \
@ -204,6 +210,8 @@ static struct at91_soc_data soc_data = {
.soc_clock_init = at91_clock_init,
.soc_irq_prio = at91_irq_prio,
.soc_children = at91_devs,
.soc_pio_base = at91_pio_base,
.soc_pio_count = nitems(at91_pio_base),
};
AT91_SOC(AT91_T_SAM9260, &soc_data);

View File

@ -87,6 +87,12 @@ static const int at91_irq_prio[32] =
0, /* Advanced Interrupt Controller IRQ2 */
};
static const uint32_t at91_pio_base[] = {
AT91SAM9G20_PIOA_BASE,
AT91SAM9G20_PIOB_BASE,
AT91SAM9G20_PIOC_BASE,
};
#define DEVICE(_name, _id, _unit) \
{ \
_name, _unit, \
@ -169,6 +175,8 @@ static struct at91_soc_data soc_data = {
.soc_clock_init = at91_clock_init,
.soc_irq_prio = at91_irq_prio,
.soc_children = at91_devs,
.soc_pio_base = at91_pio_base,
.soc_pio_count = nitems(at91_pio_base),
};
AT91_SOC(AT91_T_SAM9G20, &soc_data);

View File

@ -88,6 +88,14 @@ static const int at91_irq_prio[32] =
0, /* Advanced Interrupt Controller IRQ0 */
};
static const uint32_t at91_pio_base[] = {
AT91SAM9G45_PIOA_BASE,
AT91SAM9G45_PIOB_BASE,
AT91SAM9G45_PIOC_BASE,
AT91SAM9G45_PIOD_BASE,
AT91SAM9G45_PIOE_BASE,
};
#define DEVICE(_name, _id, _unit) \
{ \
_name, _unit, \
@ -155,6 +163,8 @@ static struct at91_soc_data soc_data = {
.soc_clock_init = at91_clock_init,
.soc_irq_prio = at91_irq_prio,
.soc_children = at91_devs,
.soc_pio_base = at91_pio_base,
.soc_pio_count = nitems(at91_pio_base),
};
AT91_SOC(AT91_T_SAM9G45, &soc_data);

View File

@ -87,6 +87,13 @@ static const int at91_irq_prio[32] =
0, /* Advanced Interrupt Controller (IRQ0) */
};
static const uint32_t at91_pio_base[] = {
AT91SAM9X25_PIOA_BASE,
AT91SAM9X25_PIOB_BASE,
AT91SAM9X25_PIOC_BASE,
AT91SAM9X25_PIOD_BASE,
};
#define DEVICE(_name, _id, _unit) \
{ \
_name, _unit, \
@ -172,6 +179,8 @@ static struct at91_soc_data soc_data = {
.soc_clock_init = at91_clock_init,
.soc_irq_prio = at91_irq_prio,
.soc_children = at91_devs,
.soc_pio_base = at91_pio_base,
.soc_pio_count = nitems(at91_pio_base),
};
AT91_SOC_SUB(AT91_T_SAM9X5, AT91_ST_SAM9X25, &soc_data);

View File

@ -107,11 +107,13 @@ typedef void (*cpu_reset_t)(void);
typedef void (*clk_init_t)(void);
struct at91_soc_data {
DELAY_t soc_delay;
cpu_reset_t soc_reset;
clk_init_t soc_clock_init;
const int *soc_irq_prio;
const struct cpu_devs *soc_children;
DELAY_t soc_delay; /* SoC specific delay function */
cpu_reset_t soc_reset; /* SoC specific reset function */
clk_init_t soc_clock_init; /* SoC specific clock init function */
const int *soc_irq_prio; /* SoC specific IRQ priorities */
const struct cpu_devs *soc_children; /* SoC specific children list */
const uint32_t *soc_pio_base; /* SoC specific PIO base registers */
size_t soc_pio_count; /* Count of PIO units (not pins) in SoC */
};
struct at91_soc_info {