BeagleBoardPkg: Set paddings following the BeagleBoard revision (A, B, xM, etc)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12431 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -18,10 +18,11 @@
|
||||
#include <Library/PcdLib.h>
|
||||
|
||||
#include <Omap3530/Omap3530.h>
|
||||
#include <BeagleBoard.h>
|
||||
|
||||
VOID
|
||||
PadConfiguration (
|
||||
VOID
|
||||
BEAGLEBOARD_REVISION Revision
|
||||
);
|
||||
|
||||
VOID
|
||||
@@ -29,6 +30,30 @@ ClockInit (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Detect board revision
|
||||
|
||||
@return Board revision
|
||||
**/
|
||||
BEAGLEBOARD_REVISION
|
||||
BeagleBoardGetRevision (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
UINT32 OldPinDir;
|
||||
UINT32 Revision;
|
||||
|
||||
// Read GPIO 171, 172, 173
|
||||
OldPinDir = MmioRead32 (GPIO6_BASE + GPIO_OE);
|
||||
MmioWrite32(GPIO6_BASE + GPIO_OE, (OldPinDir | BIT11 | BIT12 | BIT13));
|
||||
Revision = MmioRead32 (GPIO6_BASE + GPIO_DATAIN);
|
||||
|
||||
// Restore I/O settings
|
||||
MmioWrite32 (GPIO6_BASE + GPIO_OE, OldPinDir);
|
||||
|
||||
return (BEAGLEBOARD_REVISION)((Revision >> 11) & 0x7);
|
||||
}
|
||||
|
||||
/**
|
||||
Return if Trustzone is supported by your platform
|
||||
|
||||
@@ -105,8 +130,12 @@ ArmPlatformNormalInitialize (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
//Set up Pin muxing.
|
||||
PadConfiguration ();
|
||||
BEAGLEBOARD_REVISION Revision;
|
||||
|
||||
Revision = BeagleBoardGetRevision();
|
||||
|
||||
// Set up Pin muxing.
|
||||
PadConfiguration (Revision);
|
||||
|
||||
// Set up system clocking
|
||||
ClockInit ();
|
||||
|
Reference in New Issue
Block a user