Last change
on this file since 101291 was 101291, checked in by vboxsync, 14 months ago |
EFI/FirmwareNew: Make edk2-stable202308 build on all supported platforms (using gcc at least, msvc not tested yet), bugref:4643
|
-
Property svn:eol-style
set to
native
|
File size:
944 bytes
|
Line | |
---|
1 | /** @file
|
---|
2 | *
|
---|
3 | * Copyright (c) 2011-2023, Arm Limited. All rights reserved.
|
---|
4 | *
|
---|
5 | * SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
6 | *
|
---|
7 | **/
|
---|
8 |
|
---|
9 | #include <Uefi.h>
|
---|
10 | #include <Library/IoLib.h>
|
---|
11 | #include <Library/ArmGicLib.h>
|
---|
12 |
|
---|
13 | VOID
|
---|
14 | EFIAPI
|
---|
15 | ArmGicEnableDistributor (
|
---|
16 | IN UINTN GicDistributorBase
|
---|
17 | )
|
---|
18 | {
|
---|
19 | ARM_GIC_ARCH_REVISION Revision;
|
---|
20 | UINT32 GicDistributorCtl;
|
---|
21 |
|
---|
22 | /*
|
---|
23 | * Enable GIC distributor in Non-Secure world.
|
---|
24 | * Note: The ICDDCR register is banked when Security extensions are implemented
|
---|
25 | */
|
---|
26 | Revision = ArmGicGetSupportedArchRevision ();
|
---|
27 | if (Revision == ARM_GIC_ARCH_REVISION_2) {
|
---|
28 | MmioWrite32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x1);
|
---|
29 | } else {
|
---|
30 | GicDistributorCtl = MmioRead32 (GicDistributorBase + ARM_GIC_ICDDCR);
|
---|
31 | if ((GicDistributorCtl & ARM_GIC_ICDDCR_ARE) != 0) {
|
---|
32 | MmioOr32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x2);
|
---|
33 | } else {
|
---|
34 | MmioOr32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x1);
|
---|
35 | }
|
---|
36 | }
|
---|
37 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.