Skip to content

Commit

Permalink
[ARM] 4143/1: AT91: Prepare for AT91SAM9263 support
Browse files Browse the repository at this point in the history
The Atmel AT91SAM9263 processor includes many more integrated
peripherals than Atmel's previous ARM9-based AT91 processors, so this
has necessitated a few changes to the core AT91 support.

These changes are:
      * The system peripheral I/O region we remap has increased from
        0xFFFA0000..0xFFFFFFFF to 0xFFF78000..0xFFFFFFFF.
      * The increased I/O region forces changes to entry-macro.S and
        debug-macro.S due to ARM's limited immediate offset addressing
        modes.
      * Maximum number of GPIO banks increases to 5.
      * 2 MMC controllers so the board-setup code needs to specify which
        controller it wishes to use when calling at91_add_device_mmc().

Original patch from Nicolas Ferre.

Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Andrew Victor authored and Russell King committed Feb 8, 2007
1 parent 9d04126 commit d0760b3
Show file tree
Hide file tree
Showing 18 changed files with 72 additions and 62 deletions.
4 changes: 2 additions & 2 deletions arch/arm/mach-at91/at91rm9200_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ static struct platform_device at91rm9200_mmc_device = {
.num_resources = ARRAY_SIZE(mmc_resources),
};

void __init at91_add_device_mmc(struct at91_mmc_data *data)
void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
{
if (!data)
return;
Expand Down Expand Up @@ -361,7 +361,7 @@ void __init at91_add_device_mmc(struct at91_mmc_data *data)
platform_device_register(&at91rm9200_mmc_device);
}
#else
void __init at91_add_device_mmc(struct at91_mmc_data *data) {}
void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
#endif


Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-at91/at91sam9260_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ static struct platform_device at91sam9260_mmc_device = {
.num_resources = ARRAY_SIZE(mmc_resources),
};

void __init at91_add_device_mmc(struct at91_mmc_data *data)
void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
{
if (!data)
return;
Expand Down Expand Up @@ -275,7 +275,7 @@ void __init at91_add_device_mmc(struct at91_mmc_data *data)
platform_device_register(&at91sam9260_mmc_device);
}
#else
void __init at91_add_device_mmc(struct at91_mmc_data *data) {}
void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
#endif


Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-at91/at91sam9261_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static struct platform_device at91sam9261_mmc_device = {
.num_resources = ARRAY_SIZE(mmc_resources),
};

void __init at91_add_device_mmc(struct at91_mmc_data *data)
void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
{
if (!data)
return;
Expand Down Expand Up @@ -192,7 +192,7 @@ void __init at91_add_device_mmc(struct at91_mmc_data *data)
platform_device_register(&at91sam9261_mmc_device);
}
#else
void __init at91_add_device_mmc(struct at91_mmc_data *data) {}
void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
#endif


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 @@ -134,7 +134,7 @@ static void __init carmeva_board_init(void)
/* Compact Flash */
// at91_add_device_cf(&carmeva_cf_data);
/* MMC */
at91_add_device_mmc(&carmeva_mmc_data);
at91_add_device_mmc(0, &carmeva_mmc_data);
}

MACHINE_START(CARMEVA, "Carmeva")
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 @@ -130,7 +130,7 @@ static void __init csb337_board_init(void)
/* SPI */
at91_add_device_spi(csb337_spi_devices, ARRAY_SIZE(csb337_spi_devices));
/* MMC */
at91_add_device_mmc(&csb337_mmc_data);
at91_add_device_mmc(0, &csb337_mmc_data);
}

MACHINE_START(CSB337, "Cogent CSB337")
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-dk.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ static void __init dk_board_init(void)
#else
/* MMC */
at91_set_gpio_output(AT91_PIN_PB7, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
at91_add_device_mmc(&dk_mmc_data);
at91_add_device_mmc(0, &dk_mmc_data);
#endif
/* NAND */
at91_add_device_nand(&dk_nand_data);
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 @@ -109,7 +109,7 @@ static void __init eb9200_board_init(void)
at91_add_device_spi(NULL, 0);
/* MMC */
/* only supports 1 or 4 bit interface, not wired through to SPI */
at91_add_device_mmc(&eb9200_mmc_data);
at91_add_device_mmc(0, &eb9200_mmc_data);
}

MACHINE_START(ATEB9200, "Embest ATEB9200")
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-ek.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ static void __init ek_board_init(void)
#else
/* MMC */
at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
at91_add_device_mmc(&ek_mmc_data);
at91_add_device_mmc(0, &ek_mmc_data);
#endif
/* NOR Flash */
platform_device_register(&ek_flash);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/board-kb9202.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ static void __init kb9202_board_init(void)
/* USB Device */
at91_add_device_udc(&kb9202_udc_data);
/* MMC */
at91_add_device_mmc(&kb9202_mmc_data);
at91_add_device_mmc(0, &kb9202_mmc_data);
/* I2C */
at91_add_device_i2c();
/* SPI */
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-at91/board-sam9260ek.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* linux/arch/arm/mach-at91/board-ek.c
* linux/arch/arm/mach-at91/board-sam9260ek.c
*
* Copyright (C) 2005 SAN People
* Copyright (C) 2006 Atmel
Expand Down Expand Up @@ -187,7 +187,7 @@ static void __init ek_board_init(void)
/* Ethernet */
at91_add_device_eth(&ek_macb_data);
/* MMC */
at91_add_device_mmc(&ek_mmc_data);
at91_add_device_mmc(0, &ek_mmc_data);
}

MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK")
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-at91/board-sam9261ek.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* linux/arch/arm/mach-at91/board-ek.c
* linux/arch/arm/mach-at91/board-sam9261ek.c
*
* Copyright (C) 2005 SAN People
* Copyright (C) 2006 Atmel
Expand Down Expand Up @@ -243,7 +243,7 @@ static void __init ek_board_init(void)
at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
#else
/* MMC */
at91_add_device_mmc(&ek_mmc_data);
at91_add_device_mmc(0, &ek_mmc_data);
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion include/asm-arm/arch-at91/at91sam9260_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#define AT91_MATRIX_MCFG2 (AT91_MATRIX + 0x08) /* Master Configuration Register 2 */
#define AT91_MATRIX_MCFG3 (AT91_MATRIX + 0x0C) /* Master Configuration Register 3 */
#define AT91_MATRIX_MCFG4 (AT91_MATRIX + 0x10) /* Master Configuration Register 4 */
#define AT91_MATRIX_MCFG5 (AT91_MATRIX + 0x04) /* Master Configuration Register 5 */
#define AT91_MATRIX_MCFG5 (AT91_MATRIX + 0x14) /* Master Configuration Register 5 */
#define AT91_MATRIX_ULBT (7 << 0) /* Undefined Length Burst Type */
#define AT91_MATRIX_ULBT_INFINITE (0 << 0)
#define AT91_MATRIX_ULBT_SINGLE (1 << 0)
Expand Down
3 changes: 2 additions & 1 deletion include/asm-arm/arch-at91/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct at91_mmc_data {
u8 wp_pin; /* (SD) writeprotect detect */
u8 vcc_pin; /* power switching (high == on) */
};
extern void __init at91_add_device_mmc(struct at91_mmc_data *data);
extern void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data);

/* Ethernet */
struct at91_eth_data {
Expand All @@ -76,6 +76,7 @@ extern void __init at91_add_device_eth(struct at91_eth_data *data);
/* USB Host */
struct at91_usbh_data {
u8 ports; /* number of ports on root hub */
u8 vbus_pin[]; /* port power-control pin */
};
extern void __init at91_add_device_usbh(struct at91_usbh_data *data);

Expand Down
16 changes: 8 additions & 8 deletions include/asm-arm/arch-at91/debug-macro.S
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@

.macro addruart,rx
mrc p15, 0, \rx, c1, c0
tst \rx, #1 @ MMU enabled?
ldreq \rx, =AT91_BASE_SYS @ System peripherals (phys address)
ldrne \rx, =AT91_VA_BASE_SYS @ System peripherals (virt address)
tst \rx, #1 @ MMU enabled?
ldreq \rx, =(AT91_BASE_SYS + AT91_DBGU) @ System peripherals (phys address)
ldrne \rx, =(AT91_VA_BASE_SYS + AT91_DBGU) @ System peripherals (virt address)
.endm

.macro senduart,rd,rx
strb \rd, [\rx, #AT91_DBGU_THR] @ Write to Transmitter Holding Register
strb \rd, [\rx, #(AT91_DBGU_THR - AT91_DBGU)] @ Write to Transmitter Holding Register
.endm

.macro waituart,rd,rx
1001: ldr \rd, [\rx, #AT91_DBGU_SR] @ Read Status Register
tst \rd, #AT91_DBGU_TXRDY @ DBGU_TXRDY = 1 when ready to transmit
1001: ldr \rd, [\rx, #(AT91_DBGU_SR - AT91_DBGU)] @ 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] @ Read Status Register
tst \rd, #AT91_DBGU_TXEMPTY @ DBGU_TXEMPTY = 1 when transmission complete
1001: ldr \rd, [\rx, #(AT91_DBGU_SR - AT91_DBGU)] @ Read Status Register
tst \rd, #AT91_DBGU_TXEMPTY @ DBGU_TXEMPTY = 1 when transmission complete
beq 1001b
.endm

10 changes: 5 additions & 5 deletions include/asm-arm/arch-at91/entry-macro.S
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
.endm

.macro get_irqnr_and_base, irqnr, irqstat, base, tmp
ldr \base, =(AT91_VA_BASE_SYS) @ base virtual address of SYS peripherals
ldr \irqnr, [\base, #AT91_AIC_IVR] @ read IRQ vector register: de-asserts nIRQ to processor (and clears interrupt)
ldr \irqstat, [\base, #AT91_AIC_ISR] @ read interrupt source number
teq \irqstat, #0 @ ISR is 0 when no current interrupt, or spurious interrupt
streq \tmp, [\base, #AT91_AIC_EOICR] @ not going to be handled further, then ACK it now.
ldr \base, =(AT91_VA_BASE_SYS + AT91_AIC) @ base virtual address of AIC peripheral
ldr \irqnr, [\base, #(AT91_AIC_IVR - AT91_AIC)] @ read IRQ vector register: de-asserts nIRQ to processor (and clears interrupt)
ldr \irqstat, [\base, #(AT91_AIC_ISR - AT91_AIC)] @ read interrupt source number
teq \irqstat, #0 @ ISR is 0 when no current interrupt, or spurious interrupt
streq \tmp, [\base, #(AT91_AIC_EOICR - AT91_AIC)] @ not going to be handled further, then ACK it now.
.endm

Loading

0 comments on commit d0760b3

Please sign in to comment.