diff options
author | cognet <cognet@FreeBSD.org> | 2010-10-06 22:40:27 +0000 |
---|---|---|
committer | cognet <cognet@FreeBSD.org> | 2010-10-06 22:40:27 +0000 |
commit | 3a67028003520c808580f7ad76332264113ed3a7 (patch) | |
tree | 010ee20a0e63d75a94eab678b3d2218f57017895 /sys/arm/at91/board_sam9g20ek.c | |
parent | 776b19482a8b1aebc00d0c1371eff3d2ed92bcd0 (diff) | |
download | FreeBSD-src-3a67028003520c808580f7ad76332264113ed3a7.zip FreeBSD-src-3a67028003520c808580f7ad76332264113ed3a7.tar.gz |
Add support for the AT91SAM9260
Submitted by: Greg Ansley
Diffstat (limited to 'sys/arm/at91/board_sam9g20ek.c')
-rw-r--r-- | sys/arm/at91/board_sam9g20ek.c | 66 |
1 files changed, 9 insertions, 57 deletions
diff --git a/sys/arm/at91/board_sam9g20ek.c b/sys/arm/at91/board_sam9g20ek.c index 7971e5a..a79a509 100644 --- a/sys/arm/at91/board_sam9g20ek.c +++ b/sys/arm/at91/board_sam9g20ek.c @@ -23,7 +23,14 @@ * SUCH DAMAGE. */ -/* Atmel AT91SAM9G20EK Rev. B Development Card */ +/* + * This board file can be used for both: + * Atmel AT91SAM9260-B Development Card and + * Atmel AT91SAM9G20-EK Rev. B Development Card + * + * Since the AT91SAM9260 and AT91SAM9G20 have identical memory maps and + * pin configurations we can use the same file for both. + */ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); @@ -38,16 +45,9 @@ __FBSDID("$FreeBSD$"); #include <arm/at91/at91_pio_sam9g20.h> //#include <arm/at91/at91_led.h> -#define AT91SAM9G20_LED_BASE AT91SAM9G20_PIOA_BASE -#define AT91SAM9G20_LED_SIZE AT91SAM9G20_PIO_SIZE -#define AT91SAM9G20_IRQ_LED AT91SAM9G20_IRQ_PIOA - long board_init(void) { - - //at91_led_create("power", 0, 9, 0); - /* PIOB's A periph: Turn USART 0's TX/RX pins */ at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB14_DRXD, 0); at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB15_DTXD, 1); @@ -68,16 +68,13 @@ board_init(void) at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB28_RTS1, 1); at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB29_CTS1, 0); -#if 1 /* TWI Two-wire Serial Data */ at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA23_TWD, 1); at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA24_TWCK, 1); -#endif + #if 1 /* * Turn off Clock to DataFlash, conflicts with MCI clock. - * Remove resistor R42 if you need both DataFlash and SD Card - * access at the same time */ at91_pio_use_gpio(AT91SAM9G20_PIOA_BASE,AT91C_PIO_PA2); at91_pio_gpio_input(AT91SAM9G20_PIOA_BASE,AT91C_PIO_PA2); @@ -106,45 +103,6 @@ board_init(void) at91_pio_use_gpio(AT91SAM9G20_PIOA_BASE,AT91C_PIO_PA8); #endif -#if 0 - static int at91_base = AT91SAM9G20_BASE; - volatile uint32_t *PIO = (uint32_t *)(at91_base + AT91SAM9G20_PIOA_BASE); - volatile uint32_t *RST = (uint32_t *)(at91_base + AT91SAM9G20_RSTC_BASE); - /* - * Disable pull-up on: - * ERX0 (PA14) => PHY ADDR0 - * ERX1 (PA15) => PHY ADDR1 - * RXDV (PA17) => PHY normal mode (not Test mode) - * ERX2 (PA25) => PHY ADDR2 - * ERX3 (PA26) => PHY ADDR3 - * ECRS (PA28) => PHY ADDR4 => PHYADDR = 0x0 - * - * PHY has internal pull-down - */ - PIO[PIO_PUDR/4] = - AT91C_PA14_ERX0 | - AT91C_PA15_ERX1 | - AT91C_PA17_ERXDV | - AT91C_PA25_ERX2 | - AT91C_PA26_ERX3 | - AT91C_PA28_ECRS; - - - /* Reset PHY - 500ms */ - RST[2] = 0xA5000D01; - RST[0] = 0xA5000080; - while (!(RST[1] & (1 << 16))) ; - - PIO[PIO_PUER/4] = - AT91C_PA14_ERX0 | - AT91C_PA15_ERX1 | - AT91C_PA17_ERXDV | - AT91C_PA25_ERX2 | - AT91C_PA26_ERX3 | - AT91C_PA28_ECRS; -#endif - - /* EMAC */ at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA12_ETX0 , 0); at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA13_ETX1, 0); @@ -166,11 +124,5 @@ board_init(void) at91_pio_use_periph_b(AT91SAM9G20_PIOA_BASE,AT91C_PA28_ECRS, 0); at91_pio_use_periph_b(AT91SAM9G20_PIOA_BASE,AT91C_PA29_ECOL, 0); -#if 0 - /* Handle Missing ETXER line */ - at91_pio_use_gpio(AT91SAM9G20_PIOA_BASE,AT91C_PA22_ETXER); - at91_pio_gpio_output(AT91SAM9G20_PIOA_BASE,AT91C_PA22_ETXER, 0); - at91_pio_gpio_clear(AT91SAM9G20_PIOA_BASE,AT91C_PA22_ETXER); -#endif return (at91_ramsize()); } |