From owner-svn-src-all@FreeBSD.ORG Sun Jul 15 05:41:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 650011065670; Sun, 15 Jul 2012 05:41:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F2608FC1A; Sun, 15 Jul 2012 05:41:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6F5fiiX028890; Sun, 15 Jul 2012 05:41:44 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6F5fiGj028883; Sun, 15 Jul 2012 05:41:44 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207150541.q6F5fiGj028883@svn.freebsd.org> From: Warner Losh Date: Sun, 15 Jul 2012 05:41:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238465 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 05:41:44 -0000 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 #include #include -#include -#include 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 #include #include -#include #include -#include -#include 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 #include #include -#include +#include 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);