]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - board/atmel/at91rm9200dk/mux.c
imported Ka-Ro specific additions to U-Boot 2009.08 for TX28
[karo-tx-uboot.git] / board / atmel / at91rm9200dk / mux.c
1 #include <config.h>
2 #include <common.h>
3 #include <asm/hardware.h>
4 #include <dataflash.h>
5
6 int AT91F_GetMuxStatus(void) {
7         AT91C_BASE_PIOB->PIO_PER = CONFIG_SYS_DATAFLASH_MMC_PIO; /* Set in PIO mode */
8         AT91C_BASE_PIOB->PIO_OER = CONFIG_SYS_DATAFLASH_MMC_PIO; /* Configure in output */
9
10
11         if(AT91C_BASE_PIOB->PIO_ODSR & CONFIG_SYS_DATAFLASH_MMC_PIO)
12                 return 1;
13
14         return 0;
15 }
16
17 void AT91F_SelectMMC(void) {
18         AT91C_BASE_PIOB->PIO_PER = CONFIG_SYS_DATAFLASH_MMC_PIO; /* Set in PIO mode */
19         AT91C_BASE_PIOB->PIO_OER = CONFIG_SYS_DATAFLASH_MMC_PIO; /* Configure in output */
20         /* Set Output */
21         AT91C_BASE_PIOB->PIO_SODR = CONFIG_SYS_DATAFLASH_MMC_PIO;
22 }
23
24 void AT91F_SelectSPI(void) {
25         AT91C_BASE_PIOB->PIO_PER = CONFIG_SYS_DATAFLASH_MMC_PIO; /* Set in PIO mode */
26         AT91C_BASE_PIOB->PIO_OER = CONFIG_SYS_DATAFLASH_MMC_PIO; /* Configure in output */
27         /* Clear Output */
28         AT91C_BASE_PIOB->PIO_CODR = CONFIG_SYS_DATAFLASH_MMC_PIO;
29 }