diff options
Diffstat (limited to 'board/cmc_pu2/cmc_pu2.c')
-rw-r--r-- | board/cmc_pu2/cmc_pu2.c | 49 |
1 files changed, 44 insertions, 5 deletions
diff --git a/board/cmc_pu2/cmc_pu2.c b/board/cmc_pu2/cmc_pu2.c index 8e0f6d3b73..14168e636b 100644 --- a/board/cmc_pu2/cmc_pu2.c +++ b/board/cmc_pu2/cmc_pu2.c @@ -30,13 +30,16 @@ #include <common.h> #include <asm/mach-types.h> #include <asm/arch/AT91RM9200.h> +#include <at91rm9200_net.h> +#include <dm9161.h> /* ------------------------------------------------------------------------- */ /* * Miscelaneous platform dependent initialisations */ -#define CMC_BASIC 1 +#define CMC_HP_BASIC 1 #define CMC_PU2 2 +#define CMC_BASIC 4 int hw_detect (void); @@ -74,14 +77,14 @@ int board_init (void) /* * On CMC-PU2 board configure PB3-PB6 to input without pull ups to * clear the duo LEDs (the external pull downs assure a proper - * signal). On CMC-BASIC set PB3-PB6 to output and drive it - * high, to configure current meassurement on AINx. + * signal). On CMC-BASIC and CMC-HP-BASIC set PB3-PB6 to output and + * drive it high, to configure current measurement on AINx. */ if (hw_detect() & CMC_PU2) { piob->PIO_ODR = AT91C_PIO_PB3 | AT91C_PIO_PB4 | AT91C_PIO_PB5 | AT91C_PIO_PB6; } - else if (hw_detect() & CMC_BASIC) { + else if ((hw_detect() & CMC_BASIC) || (hw_detect() & CMC_HP_BASIC)) { piob->PIO_SODR = AT91C_PIO_PB3 | AT91C_PIO_PB4 | AT91C_PIO_PB5 | AT91C_PIO_PB6; piob->PIO_OER = AT91C_PIO_PB3 | AT91C_PIO_PB4 | @@ -119,6 +122,8 @@ int checkboard (void) puts ("Board: CMC-PU2 (Rittal GmbH)\n"); else if (hw_detect() & CMC_BASIC) puts ("Board: CMC-BASIC (Rittal GmbH)\n"); + else if (hw_detect() & CMC_HP_BASIC) + puts ("Board: CMC-HP-BASIC (Rittal GmbH)\n"); else puts ("Board: unknown\n"); return 0; @@ -136,6 +141,40 @@ int hw_detect (void) pio->PIO_PPUDR = AT91C_PIO_PB12; pio->PIO_PER = AT91C_PIO_PB12; + /* configure PB13 as input without pull up */ + pio->PIO_ODR = AT91C_PIO_PB13; + pio->PIO_PPUDR = AT91C_PIO_PB13; + pio->PIO_PER = AT91C_PIO_PB13; + /* read board identification pin */ - return ((pio->PIO_PDSR & AT91C_PIO_PB12) ? CMC_PU2 : CMC_BASIC); + if (pio->PIO_PDSR & AT91C_PIO_PB12) + return ((pio->PIO_PDSR & AT91C_PIO_PB13) + ? CMC_PU2 : 0); + else + return ((pio->PIO_PDSR & AT91C_PIO_PB13) + ? CMC_HP_BASIC : CMC_BASIC); } + +#ifdef CONFIG_DRIVER_ETHER +#if (CONFIG_COMMANDS & CFG_CMD_NET) + +/* + * Name: + * at91rm9200_GetPhyInterface + * Description: + * Initialise the interface functions to the PHY + * Arguments: + * None + * Return value: + * None + */ +void at91rm9200_GetPhyInterface(AT91PS_PhyOps p_phyops) +{ + p_phyops->Init = dm9161_InitPhy; + p_phyops->IsPhyConnected = dm9161_IsPhyConnected; + p_phyops->GetLinkSpeed = dm9161_GetLinkSpeed; + p_phyops->AutoNegotiate = dm9161_AutoNegotiate; +} + +#endif /* CONFIG_COMMANDS & CFG_CMD_NET */ +#endif /* CONFIG_DRIVER_ETHER */ |