3 * Copyright (c) 2011-2012, ARM Limited. All rights reserved.
5 * SPDX-License-Identifier: BSD-2-Clause-Patent
9 #include <Library/IoLib.h>
10 #include <Library/ArmPlatformLib.h>
11 #include <Library/DebugLib.h>
12 #include <Library/PcdLib.h>
14 #include <Omap3530/Omap3530.h>
15 #include <BeagleBoard.h>
19 BEAGLEBOARD_REVISION Revision
30 @return Board revision
33 BeagleBoardGetRevision (
40 // Read GPIO 171, 172, 173
41 OldPinDir
= MmioRead32 (GPIO6_BASE
+ GPIO_OE
);
42 MmioWrite32(GPIO6_BASE
+ GPIO_OE
, (OldPinDir
| BIT11
| BIT12
| BIT13
));
43 Revision
= MmioRead32 (GPIO6_BASE
+ GPIO_DATAIN
);
45 // Restore I/O settings
46 MmioWrite32 (GPIO6_BASE
+ GPIO_OE
, OldPinDir
);
48 return (BEAGLEBOARD_REVISION
)((Revision
>> 11) & 0x7);
52 Return the current Boot Mode
54 This function returns the boot reason on the platform
58 ArmPlatformGetBootMode (
62 return BOOT_WITH_FULL_CONFIGURATION
;
66 Initialize controllers that must setup at the early stage
68 Some peripherals must be initialized in Secure World.
69 For example, some L2x0 requires to be initialized in Secure World
73 ArmPlatformInitialize (
77 BEAGLEBOARD_REVISION Revision
;
79 Revision
= BeagleBoardGetRevision();
82 PadConfiguration (Revision
);
84 // Set up system clocking
87 // Turn off the functional clock for Timer 3
88 MmioAnd32 (CM_FCLKEN_PER
, 0xFFFFFFFF ^ CM_ICLKEN_PER_EN_GPT3_ENABLE
);
89 ArmDataSynchronizationBarrier ();
92 MmioWrite32 (INTCPS_CONTROL
, INTCPS_CONTROL_NEWIRQAGR
);
93 ArmDataSynchronizationBarrier ();
95 return RETURN_SUCCESS
;
99 ArmPlatformGetPlatformPpiList (
100 OUT UINTN
*PpiListSize
,
101 OUT EFI_PEI_PPI_DESCRIPTOR
**PpiList
109 ArmPlatformGetCorePosition (