3 * Copyright (c) 2011-2012, ARM Limited. All rights reserved.
5 * This program and the accompanying materials
6 * are licensed and made available under the terms and conditions of the BSD License
7 * which accompanies this distribution. The full text of the license may be found at
8 * http://opensource.org/licenses/bsd-license.php
10 * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #include <Library/IoLib.h>
16 #include <Library/ArmPlatformLib.h>
17 #include <Library/DebugLib.h>
18 #include <Library/PcdLib.h>
20 #include <Omap3530/Omap3530.h>
21 #include <BeagleBoard.h>
25 BEAGLEBOARD_REVISION Revision
36 @return Board revision
39 BeagleBoardGetRevision (
46 // Read GPIO 171, 172, 173
47 OldPinDir
= MmioRead32 (GPIO6_BASE
+ GPIO_OE
);
48 MmioWrite32(GPIO6_BASE
+ GPIO_OE
, (OldPinDir
| BIT11
| BIT12
| BIT13
));
49 Revision
= MmioRead32 (GPIO6_BASE
+ GPIO_DATAIN
);
51 // Restore I/O settings
52 MmioWrite32 (GPIO6_BASE
+ GPIO_OE
, OldPinDir
);
54 return (BEAGLEBOARD_REVISION
)((Revision
>> 11) & 0x7);
58 Return the current Boot Mode
60 This function returns the boot reason on the platform
64 ArmPlatformGetBootMode (
68 return BOOT_WITH_FULL_CONFIGURATION
;
72 Initialize controllers that must setup at the early stage
74 Some peripherals must be initialized in Secure World.
75 For example, some L2x0 requires to be initialized in Secure World
79 ArmPlatformInitialize (
83 BEAGLEBOARD_REVISION Revision
;
85 Revision
= BeagleBoardGetRevision();
88 PadConfiguration (Revision
);
90 // Set up system clocking
93 // Turn off the functional clock for Timer 3
94 MmioAnd32 (CM_FCLKEN_PER
, 0xFFFFFFFF ^ CM_ICLKEN_PER_EN_GPT3_ENABLE
);
95 ArmDataSyncronizationBarrier ();
98 MmioWrite32 (INTCPS_CONTROL
, INTCPS_CONTROL_NEWIRQAGR
);
99 ArmDataSyncronizationBarrier ();
101 return RETURN_SUCCESS
;
105 Initialize the system (or sometimes called permanent) memory
107 This memory is generally represented by the DRAM.
111 ArmPlatformInitializeSystemMemory (
115 // We do not need to initialize the System Memory on RTSM
119 ArmPlatformGetPlatformPpiList (
120 OUT UINTN
*PpiListSize
,
121 OUT EFI_PEI_PPI_DESCRIPTOR
**PpiList
129 ArmPlatformGetCorePosition (