Date: Sun, 15 Jul 2012 05:41:44 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r238465 - head/sys/arm/at91 Message-ID: <201207150541.q6F5fiGj028883@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: imp Date: Sun Jul 15 05:41:43 2012 New Revision: 238465 URL: http://svn.freebsd.org/changeset/base/238465 Log: Configure the peripheral pins for MCI devices. Eliminate the now-unused at91_pio_rm9200.h. Deleted: head/sys/arm/at91/at91_pio_rm9200.h Modified: head/sys/arm/at91/at91rm9200_devices.c head/sys/arm/at91/at91rm9200var.h head/sys/arm/at91/board_bwct.c head/sys/arm/at91/board_hl200.c head/sys/arm/at91/board_kb920x.c head/sys/arm/at91/board_tsc4370.c Modified: head/sys/arm/at91/at91rm9200_devices.c ============================================================================== --- head/sys/arm/at91/at91rm9200_devices.c Sun Jul 15 05:38:43 2012 (r238464) +++ head/sys/arm/at91/at91rm9200_devices.c Sun Jul 15 05:41:43 2012 (r238465) @@ -80,6 +80,10 @@ at91rm9200_config_uart(unsigned devid, u * to do. */ + /* + * Current boards supported don't need the extras, but they should be + * implemented. But that should wait until the new pin api goes in. + */ switch (devid) { case AT91_ID_DBGU: at91_pio_use_periph_a(AT91RM92_PIOA_BASE, AT91C_PIO_PA30, 0); /* DRXD */ @@ -122,3 +126,17 @@ at91rm9200_config_uart(unsigned devid, u break; } } + +void +at91rm9200_config_mci(int has_4wire) +{ + /* XXX TODO chip changed GPIO, other slots, etc */ + at91_pio_use_periph_a(AT91RM92_PIOA_BASE, AT91C_PIO_PA27, 0); /* MCCK */ + at91_pio_use_periph_a(AT91RM92_PIOA_BASE, AT91C_PIO_PA28, 1); /* MCCDA */ + at91_pio_use_periph_a(AT91RM92_PIOA_BASE, AT91C_PIO_PA29, 1); /* MCDA0 */ + if (has_4wire) { + at91_pio_use_periph_b(AT91RM92_PIOB_BASE, AT91C_PIO_PB3, 1); /* MCDA1 */ + at91_pio_use_periph_b(AT91RM92_PIOB_BASE, AT91C_PIO_PB4, 1); /* MCDA2 */ + at91_pio_use_periph_b(AT91RM92_PIOB_BASE, AT91C_PIO_PB5, 1); /* MCDA3 */ + } +} Modified: head/sys/arm/at91/at91rm9200var.h ============================================================================== --- head/sys/arm/at91/at91rm9200var.h Sun Jul 15 05:38:43 2012 (r238464) +++ head/sys/arm/at91/at91rm9200var.h Sun Jul 15 05:41:43 2012 (r238465) @@ -50,4 +50,9 @@ void at91rm9200_set_subtype(enum at91_so void at91rm9200_config_uart(unsigned devid, unsigned unit, unsigned pinmask); +/* + * MCI (sd/mmc card support) + */ +void at91rm9200_config_mci(int has_4wire); + #endif /* ARM_AT91_AT91RM9200VAR_H */ Modified: head/sys/arm/at91/board_bwct.c ============================================================================== --- head/sys/arm/at91/board_bwct.c Sun Jul 15 05:38:43 2012 (r238464) +++ head/sys/arm/at91/board_bwct.c Sun Jul 15 05:41:43 2012 (r238465) @@ -45,6 +45,9 @@ board_init(void) */ at91rm9200_config_uart(AT91_ID_DBGU, 0, 0); /* DBGU just Tx and Rx */ + at91rm9200_config_mci(0); + /* Configure ethernet */ + return (at91_ramsize()); } Modified: head/sys/arm/at91/board_hl200.c ============================================================================== --- head/sys/arm/at91/board_hl200.c Sun Jul 15 05:38:43 2012 (r238464) +++ head/sys/arm/at91/board_hl200.c Sun Jul 15 05:41:43 2012 (r238465) @@ -34,8 +34,6 @@ __FBSDID("$FreeBSD$"); #include <arm/at91/at91var.h> #include <arm/at91/at91rm92reg.h> #include <arm/at91/at91rm9200var.h> -#include <arm/at91/at91_piovar.h> -#include <arm/at91/at91_pio_rm9200.h> BOARD_INIT long board_init(void) @@ -51,6 +49,16 @@ board_init(void) at91rm9200_config_uart(AT91_ID_DBGU, 0, 0); /* DBGU just Tx and Rx */ at91rm9200_config_uart(AT91RM9200_ID_USART0, 1, 0); /* Tx and Rx */ + at91rm9200_config_mci(0); /* HOTe HL200 unknown 1 vs 4 wire */ + + /* Enable CF card slot */ + /* Enable sound thing */ + /* Enable VGA chip */ + /* Enable ethernet */ + /* Enable TWI + RTC */ + /* Enable USB Host */ + /* Enable USB Device (gadget) */ + return (at91_ramsize()); } Modified: head/sys/arm/at91/board_kb920x.c ============================================================================== --- head/sys/arm/at91/board_kb920x.c Sun Jul 15 05:38:43 2012 (r238464) +++ head/sys/arm/at91/board_kb920x.c Sun Jul 15 05:41:43 2012 (r238465) @@ -32,10 +32,7 @@ __FBSDID("$FreeBSD$"); #include <machine/board.h> #include <arm/at91/at91board.h> #include <arm/at91/at91var.h> -#include <arm/at91/at91rm92reg.h> #include <arm/at91/at91rm9200var.h> -#include <arm/at91/at91_piovar.h> -#include <arm/at91/at91_pio_rm9200.h> BOARD_INIT long board_init(void) @@ -54,13 +51,14 @@ board_init(void) at91rm9200_config_uart(AT91RM9200_ID_USART3, 3, /* Tx, Rx, CTS, RTS - RS485 */ AT91_UART_CTS | AT91_UART_RTS); - /* MMC/SD Interface */ - at91_pio_use_periph_a(AT91RM92_PIOA_BASE,AT91C_PA27_MCCK, 0); - at91_pio_use_periph_a(AT91RM92_PIOA_BASE,AT91C_PA28_MCCDA, 1); - at91_pio_use_periph_a(AT91RM92_PIOA_BASE,AT91C_PA29_MCDA0, 1); - at91_pio_use_periph_b(AT91RM92_PIOB_BASE,AT91C_PB3_MCDA1, 1); - at91_pio_use_periph_b(AT91RM92_PIOB_BASE,AT91C_PB4_MCDA2, 1); - at91_pio_use_periph_b(AT91RM92_PIOB_BASE,AT91C_PB5_MCDA3, 1); + at91rm9200_config_mci(1); + + /* CFE interface */ + /* ethernet interface */ + /* lcd interface */ + /* USB host */ + /* USB device (gadget) */ + /* TWI */ return (at91_ramsize()); } Modified: head/sys/arm/at91/board_tsc4370.c ============================================================================== --- head/sys/arm/at91/board_tsc4370.c Sun Jul 15 05:38:43 2012 (r238464) +++ head/sys/arm/at91/board_tsc4370.c Sun Jul 15 05:41:43 2012 (r238465) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include <arm/at91/at91rm92reg.h> #include <arm/at91/at91rm9200var.h> #include <arm/at91/at91_piovar.h> -#include <arm/at91/at91_pio_rm9200.h> +#include <arm/at91/at91_pioreg.h> BOARD_INIT long board_init(void) @@ -49,6 +49,15 @@ board_init(void) at91rm9200_config_uart(AT91RM9200_ID_USART2, 3, 0); /* Tx and Rx */ at91rm9200_config_uart(AT91RM9200_ID_USART3, 4, 0); /* Tx and Rx */ + at91rm9200_config_mci(0); /* tsc4370 board has only 1 wire */ + /* Newer boards may have 4 wires */ + + /* Configure TWI */ + /* Configure SPI + dataflash */ + /* Configure SSC */ + /* Configure USB Host */ + /* Configure FPGA attached to chip selects */ + /* Pin assignment */ /* Assert PA24 low -- talk to rubidium */ at91_pio_use_gpio(AT91RM92_PIOA_BASE, AT91C_PIO_PA24);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207150541.q6F5fiGj028883>