source: SVN/rincon/u-boot/board/atmel/at91rm9200dk/mux.c @ 55

Last change on this file since 55 was 55, checked in by Tim Harvey, 2 years ago

rincon: added latest u-boot source

restored form server backup

Signed-off-by: Tim Harvey <tharvey@…>

File size: 982 bytes
Line 
1#include <config.h>
2#include <common.h>
3#include <asm/hardware.h>
4#include <dataflash.h>
5
6int AT91F_GetMuxStatus(void) {
7#ifdef  DATAFLASH_MMC_SELECT
8        AT91C_BASE_PIOB->PIO_PER = DATAFLASH_MMC_SELECT; /* Set in PIO mode */
9        AT91C_BASE_PIOB->PIO_OER = DATAFLASH_MMC_SELECT; /* Configure in output */
10
11
12        if(AT91C_BASE_PIOB->PIO_ODSR & DATAFLASH_MMC_SELECT) {
13                return 1;
14        } else {
15                return 0;
16        }
17#endif
18        return 0;
19}
20
21void AT91F_SelectMMC(void) {
22#ifdef  DATAFLASH_MMC_SELECT
23        AT91C_BASE_PIOB->PIO_PER = DATAFLASH_MMC_SELECT;        /* Set in PIO mode */
24        AT91C_BASE_PIOB->PIO_OER = DATAFLASH_MMC_SELECT;        /* Configure in output */
25        /* Set Output */
26        AT91C_BASE_PIOB->PIO_SODR = DATAFLASH_MMC_SELECT;
27#endif
28}
29
30void AT91F_SelectSPI(void) {
31#ifdef  DATAFLASH_MMC_SELECT
32        AT91C_BASE_PIOB->PIO_PER = DATAFLASH_MMC_SELECT;        /* Set in PIO mode */
33        AT91C_BASE_PIOB->PIO_OER = DATAFLASH_MMC_SELECT;        /* Configure in output */
34        /* Clear Output */
35        AT91C_BASE_PIOB->PIO_CODR = DATAFLASH_MMC_SELECT;
36#endif
37}
Note: See TracBrowser for help on using the repository browser.