00001
00041 #include <board/dataflash.h>
00042 #include <board/init.h>
00043 #include <board/sdmmc.h>
00044 #include <chip/portmux.h>
00045 #include <spi/spi.h>
00046
00047 void board_init(void)
00048 {
00049
00050 portmux_select_gpio(PORTMUX_PORT_C, 1 << 3,
00051 PORTMUX_DIR_OUTPUT | PORTMUX_INIT_HIGH);
00052 portmux_select_gpio(PORTMUX_PORT_X0, 1 << 5 | 1 << 6 | 1 << 9,
00053 PORTMUX_DIR_OUTPUT | PORTMUX_INIT_HIGH);
00054
00055
00056 portmux_enable_usart(1, PORTMUX_USART_TX | PORTMUX_USART_RX, 0);
00057
00058
00059 portmux_enable_twi(0, 0);
00060
00061
00062 portmux_enable_spi(BOARD_DATAFLASH_SPI_PORT, PORTMUX_DRIVE_MIN);
00063 portmux_enable_spi_cs(BOARD_DATAFLASH_CS_PIN);
00064
00065
00066 portmux_enable_mmci(0, 0, PORTMUX_MMCI_8BIT | PORTMUX_MMCI_EXT_PULLUP,
00067 PORTMUX_DRIVE_LOW);
00068 portmux_select_gpio_pin(BOARD_MCISLOT_A_CD,
00069 PORTMUX_DIR_INPUT | PORTMUX_PULL_UP);
00070 portmux_select_gpio_pin(BOARD_MCISLOT_A_WP,
00071 PORTMUX_DIR_INPUT | PORTMUX_PULL_UP);
00072
00073
00074 #ifdef CONFIG_SDMMC_MCIHOST_SLOT_B
00075 portmux_enable_mmci(0, 1, PORTMUX_MMCI_4BIT | PORTMUX_MMCI_EXT_PULLUP,
00076 PORTMUX_DRIVE_LOW);
00077 portmux_select_gpio_pin(BOARD_MCISLOT_B_CD,
00078 PORTMUX_DIR_INPUT | PORTMUX_PULL_UP);
00079 portmux_select_gpio_pin(BOARD_MCISLOT_B_WP,
00080 PORTMUX_DIR_INPUT | PORTMUX_PULL_UP);
00081 #endif
00082 }