diff options
author | Wolfgang Denk <wd@denx.de> | 2007-08-14 18:03:48 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2007-08-14 18:03:48 +0200 |
commit | 3f76451b4a9f52f8c37a0526df217d12175182ea (patch) | |
tree | 0c40d10e755ee3cc71cfce81a1a28f5584eda2a0 /board/at91rm9200dk/mux.c | |
parent | 71d67f43dabe8dd8adbe594b6c61944a2d106efa (diff) | |
parent | e54b970173769307a116bd34028b6d0c2eea2a4e (diff) | |
download | u-boot-imx-3f76451b4a9f52f8c37a0526df217d12175182ea.zip u-boot-imx-3f76451b4a9f52f8c37a0526df217d12175182ea.tar.gz u-boot-imx-3f76451b4a9f52f8c37a0526df217d12175182ea.tar.bz2 |
Merge with /home/wd/git/u-boot/custodian/u-boot-arm
Diffstat (limited to 'board/at91rm9200dk/mux.c')
-rw-r--r-- | board/at91rm9200dk/mux.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/board/at91rm9200dk/mux.c b/board/at91rm9200dk/mux.c new file mode 100644 index 0000000..d573923 --- /dev/null +++ b/board/at91rm9200dk/mux.c @@ -0,0 +1,39 @@ +#include <config.h> +#include <common.h> +#include <asm/hardware.h> +#include <dataflash.h> + +int AT91F_GetMuxStatus(void) { +#ifdef DATAFLASH_MMC_SELECT + AT91C_BASE_PIOB->PIO_PER = DATAFLASH_MMC_SELECT; /* Set in PIO mode */ + AT91C_BASE_PIOB->PIO_OER = DATAFLASH_MMC_SELECT; /* Configure in output */ + + + if(AT91C_BASE_PIOB->PIO_ODSR & DATAFLASH_MMC_SELECT) { + return 1; + } else { + return 0; + } +#endif + return 0; +} + +void AT91F_SelectMMC(void) { +#ifdef DATAFLASH_MMC_SELECT + AT91C_BASE_PIOB->PIO_PER = DATAFLASH_MMC_SELECT; /* Set in PIO mode */ + AT91C_BASE_PIOB->PIO_OER = DATAFLASH_MMC_SELECT; /* Configure in output */ + /* Set Output */ + AT91C_BASE_PIOB->PIO_SODR = DATAFLASH_MMC_SELECT; +#endif +} + +void AT91F_SelectSPI(void) { +#ifdef DATAFLASH_MMC_SELECT + AT91C_BASE_PIOB->PIO_PER = DATAFLASH_MMC_SELECT; /* Set in PIO mode */ + AT91C_BASE_PIOB->PIO_OER = DATAFLASH_MMC_SELECT; /* Configure in output */ + /* Clear Output */ + AT91C_BASE_PIOB->PIO_CODR = DATAFLASH_MMC_SELECT; +#endif +} + + |