at91rm9200_devices.c (238439) | at91rm9200_devices.c (238465) |
---|---|
1/*- 2 * Copyright (c) 2012 M. Warner Losh. All Rights Reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 10 unchanged lines hidden (view full) --- 19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 * SUCH DAMAGE. 24 */ 25 26#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2012 M. Warner Losh. All Rights Reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 10 unchanged lines hidden (view full) --- 19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 * SUCH DAMAGE. 24 */ 25 26#include <sys/cdefs.h> |
27__FBSDID("$FreeBSD: head/sys/arm/at91/at91rm9200_devices.c 238439 2012-07-14 05:46:52Z imp $"); | 27__FBSDID("$FreeBSD: head/sys/arm/at91/at91rm9200_devices.c 238465 2012-07-15 05:41:43Z imp $"); |
28 29#include <sys/param.h> 30#include <sys/systm.h> 31#include <sys/bus.h> 32#include <sys/kernel.h> 33#include <sys/malloc.h> 34#include <sys/module.h> 35 --- 39 unchanged lines hidden (view full) --- 75 * these pins to float. Instead, they should be pulled up to avoid 76 * mismatches. Linux does something similar when it configures the 77 * TX lines. This implies that we also allow the RX lines to float 78 * rather than be in the state they are left in by the boot loader. 79 * Since they are input pins, I think that this is the right thing 80 * to do. 81 */ 82 | 28 29#include <sys/param.h> 30#include <sys/systm.h> 31#include <sys/bus.h> 32#include <sys/kernel.h> 33#include <sys/malloc.h> 34#include <sys/module.h> 35 --- 39 unchanged lines hidden (view full) --- 75 * these pins to float. Instead, they should be pulled up to avoid 76 * mismatches. Linux does something similar when it configures the 77 * TX lines. This implies that we also allow the RX lines to float 78 * rather than be in the state they are left in by the boot loader. 79 * Since they are input pins, I think that this is the right thing 80 * to do. 81 */ 82 |
83 /* 84 * Current boards supported don't need the extras, but they should be 85 * implemented. But that should wait until the new pin api goes in. 86 */ |
|
83 switch (devid) { 84 case AT91_ID_DBGU: 85 at91_pio_use_periph_a(AT91RM92_PIOA_BASE, AT91C_PIO_PA30, 0); /* DRXD */ 86 at91_pio_use_periph_a(AT91RM92_PIOA_BASE, AT91C_PIO_PA31, 1); /* DTXD */ 87 break; 88 89 case AT91RM9200_ID_USART0: 90 at91_pio_use_periph_a(AT91RM92_PIOA_BASE, AT91C_PIO_PA17, 1); /* TXD0 */ --- 26 unchanged lines hidden (view full) --- 117 /* CTS - PB0 B periph */ 118 /* RTS - PB1 B periph */ 119 break; 120 121 default: 122 break; 123 } 124} | 87 switch (devid) { 88 case AT91_ID_DBGU: 89 at91_pio_use_periph_a(AT91RM92_PIOA_BASE, AT91C_PIO_PA30, 0); /* DRXD */ 90 at91_pio_use_periph_a(AT91RM92_PIOA_BASE, AT91C_PIO_PA31, 1); /* DTXD */ 91 break; 92 93 case AT91RM9200_ID_USART0: 94 at91_pio_use_periph_a(AT91RM92_PIOA_BASE, AT91C_PIO_PA17, 1); /* TXD0 */ --- 26 unchanged lines hidden (view full) --- 121 /* CTS - PB0 B periph */ 122 /* RTS - PB1 B periph */ 123 break; 124 125 default: 126 break; 127 } 128} |
129 130void 131at91rm9200_config_mci(int has_4wire) 132{ 133 /* XXX TODO chip changed GPIO, other slots, etc */ 134 at91_pio_use_periph_a(AT91RM92_PIOA_BASE, AT91C_PIO_PA27, 0); /* MCCK */ 135 at91_pio_use_periph_a(AT91RM92_PIOA_BASE, AT91C_PIO_PA28, 1); /* MCCDA */ 136 at91_pio_use_periph_a(AT91RM92_PIOA_BASE, AT91C_PIO_PA29, 1); /* MCDA0 */ 137 if (has_4wire) { 138 at91_pio_use_periph_b(AT91RM92_PIOB_BASE, AT91C_PIO_PB3, 1); /* MCDA1 */ 139 at91_pio_use_periph_b(AT91RM92_PIOB_BASE, AT91C_PIO_PB4, 1); /* MCDA2 */ 140 at91_pio_use_periph_b(AT91RM92_PIOB_BASE, AT91C_PIO_PB5, 1); /* MCDA3 */ 141 } 142} |
|