mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-07-06 22:42:27 +00:00
Add automatic HW detection for another CMC_PU2 variant
Patch by Martin Krause, 20 Apr 2005
This commit is contained in:
parent
dbc5819098
commit
601aed1e8f
2 changed files with 23 additions and 7 deletions
|
@ -2,14 +2,17 @@
|
||||||
Changes for U-Boot 1.1.4:
|
Changes for U-Boot 1.1.4:
|
||||||
======================================================================
|
======================================================================
|
||||||
|
|
||||||
|
* Add automatic HW detection for another CMC_PU2 variant
|
||||||
|
Patch by Martin Krause, 20 Apr 2005
|
||||||
|
|
||||||
* Remove CONFIG_AT91RM9200DK in CMC-PU2 configuration
|
* Remove CONFIG_AT91RM9200DK in CMC-PU2 configuration
|
||||||
Patch by Martin Krause, 19 Apr 2005
|
Patch by Martin Krause, 19 Apr 2005
|
||||||
|
|
||||||
* Fix initialization problem on TQM5200 without SM501
|
* Fix initialization problem on TQM5200 without SM501
|
||||||
Patch by Martin Krause, 8 Apr. 2005
|
Patch by Martin Krause, 08 Apr 2005
|
||||||
|
|
||||||
* Add RTC support for STK52XX.200
|
* Add RTC support for STK52XX.200
|
||||||
Patch by Martin Krause, 7 Apr. 2005
|
Patch by Martin Krause, 07 Apr 2005
|
||||||
|
|
||||||
* Add support for IFM o2dnt board
|
* Add support for IFM o2dnt board
|
||||||
|
|
||||||
|
|
|
@ -35,8 +35,9 @@
|
||||||
/*
|
/*
|
||||||
* Miscelaneous platform dependent initialisations
|
* Miscelaneous platform dependent initialisations
|
||||||
*/
|
*/
|
||||||
#define CMC_BASIC 1
|
#define CMC_HP_BASIC 1
|
||||||
#define CMC_PU2 2
|
#define CMC_PU2 2
|
||||||
|
#define CMC_BASIC 4
|
||||||
|
|
||||||
int hw_detect (void);
|
int hw_detect (void);
|
||||||
|
|
||||||
|
@ -74,14 +75,14 @@ int board_init (void)
|
||||||
/*
|
/*
|
||||||
* On CMC-PU2 board configure PB3-PB6 to input without pull ups to
|
* On CMC-PU2 board configure PB3-PB6 to input without pull ups to
|
||||||
* clear the duo LEDs (the external pull downs assure a proper
|
* clear the duo LEDs (the external pull downs assure a proper
|
||||||
* signal). On CMC-BASIC set PB3-PB6 to output and drive it
|
* signal). On CMC-BASIC and CMC-HP-BASIC set PB3-PB6 to output and
|
||||||
* high, to configure current meassurement on AINx.
|
* drive it high, to configure current measurement on AINx.
|
||||||
*/
|
*/
|
||||||
if (hw_detect() & CMC_PU2) {
|
if (hw_detect() & CMC_PU2) {
|
||||||
piob->PIO_ODR = AT91C_PIO_PB3 | AT91C_PIO_PB4 |
|
piob->PIO_ODR = AT91C_PIO_PB3 | AT91C_PIO_PB4 |
|
||||||
AT91C_PIO_PB5 | AT91C_PIO_PB6;
|
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 |
|
piob->PIO_SODR = AT91C_PIO_PB3 | AT91C_PIO_PB4 |
|
||||||
AT91C_PIO_PB5 | AT91C_PIO_PB6;
|
AT91C_PIO_PB5 | AT91C_PIO_PB6;
|
||||||
piob->PIO_OER = AT91C_PIO_PB3 | AT91C_PIO_PB4 |
|
piob->PIO_OER = AT91C_PIO_PB3 | AT91C_PIO_PB4 |
|
||||||
|
@ -119,6 +120,8 @@ int checkboard (void)
|
||||||
puts ("Board: CMC-PU2 (Rittal GmbH)\n");
|
puts ("Board: CMC-PU2 (Rittal GmbH)\n");
|
||||||
else if (hw_detect() & CMC_BASIC)
|
else if (hw_detect() & CMC_BASIC)
|
||||||
puts ("Board: CMC-BASIC (Rittal GmbH)\n");
|
puts ("Board: CMC-BASIC (Rittal GmbH)\n");
|
||||||
|
else if (hw_detect() & CMC_HP_BASIC)
|
||||||
|
puts ("Board: CMC-HP-BASIC (Rittal GmbH)\n");
|
||||||
else
|
else
|
||||||
puts ("Board: unknown\n");
|
puts ("Board: unknown\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -135,7 +138,17 @@ int hw_detect (void)
|
||||||
pio->PIO_ODR = AT91C_PIO_PB12;
|
pio->PIO_ODR = AT91C_PIO_PB12;
|
||||||
pio->PIO_PPUDR = AT91C_PIO_PB12;
|
pio->PIO_PPUDR = AT91C_PIO_PB12;
|
||||||
pio->PIO_PER = 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 */
|
/* 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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue