* [PATCH edk2-platforms 0/2] SbsaQemu: make GIC base address Pcds dynamic
@ 2023-05-12 17:57 Leif Lindholm
2023-05-12 17:57 ` [PATCH edk2-platforms 1/2] Silicon/Qemu: use 64-bit Pcds for SbsaQemu GIC addresses Leif Lindholm
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Leif Lindholm @ 2023-05-12 17:57 UTC (permalink / raw)
To: devel
Cc: Ard Biesheuvel, Graeme Gregory, Radoslaw Biernacki,
Marcin Juszkiewicz
Currently, the GIC and redistributors base addresses are defined using
FixedPcds.
In order to enable the QEMU platform to evolve to provide ITS frames,
as well as newer versions of the GIC, convert these accesses to Dynamic.
Firtsly, this requires fixing the bug of the addresses being read as 32-bit
Pcds, and then moving the declarations and calls to the dynamic form.
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Graeme Gregory <graeme@xora.org.uk>
Cc: Radoslaw Biernacki <rad@semihalf.com>
Cc: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Leif Lindholm (2):
Silicon/Qemu: use 64-bit Pcds for SbsaQemu GIC addresses
Silicon/Qemu: use dynamic Pcds for SbsaQemu GIC addresses
Platform/Qemu/SbsaQemu/SbsaQemu.dsc | 12 ++++++------
Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf | 7 ++++---
.../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf | 5 +++--
.../SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h | 2 +-
.../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c | 2 +-
5 files changed, 15 insertions(+), 13 deletions(-)
--
2.30.2
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH edk2-platforms 1/2] Silicon/Qemu: use 64-bit Pcds for SbsaQemu GIC addresses
2023-05-12 17:57 [PATCH edk2-platforms 0/2] SbsaQemu: make GIC base address Pcds dynamic Leif Lindholm
@ 2023-05-12 17:57 ` Leif Lindholm
2023-05-16 10:45 ` [edk2-devel] " Sami Mujawar
2023-05-12 17:57 ` [PATCH edk2-platforms 2/2] Silicon/Qemu: use dynamic " Leif Lindholm
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Leif Lindholm @ 2023-05-12 17:57 UTC (permalink / raw)
To: devel
Cc: Ard Biesheuvel, Graeme Gregory, Radoslaw Biernacki,
Marcin Juszkiewicz
gArmTokenSpaceGuid.PcdGicDistributorBase and
gArmTokenSpaceGuid.PcdGicRedistributorsBase are both defined as UINT64 in
ArmPkg.dec, but SbsaQemuAcpiDxe and its exported header file use
PcdGet32. While this currently works, it will break once these Pcds are
made dynamic - so fix.
Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Graeme Gregory <graeme@xora.org.uk>
Cc: Radoslaw Biernacki <rad@semihalf.com>
Cc: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
---
Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h | 2 +-
Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h
index 4d5b05ba17c6..dcafcbca5a48 100644
--- a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h
+++ b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h
@@ -33,7 +33,7 @@
EFI_ACPI_6_0_GICR, /* Type */ \
sizeof (EFI_ACPI_6_0_GICR_STRUCTURE), /* Length */ \
EFI_ACPI_RESERVED_WORD, /* Reserved */ \
- FixedPcdGet32 (PcdGicRedistributorsBase), /* DiscoveryRangeBaseAddress */ \
+ FixedPcdGet64 (PcdGicRedistributorsBase), /* DiscoveryRangeBaseAddress */ \
SBSAQEMU_MADT_GICR_SIZE /* DiscoveryRangeLength */ \
}
diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c
index 7ba9e8e9deeb..58330a3e7005 100644
--- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c
+++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c
@@ -83,7 +83,7 @@ AddMadtTable (
EFI_ACPI_6_0_GIC_DISTRIBUTOR_STRUCTURE Gicd =
EFI_ACPI_6_0_GIC_DISTRIBUTOR_INIT (
0,
- FixedPcdGet32 (PcdGicDistributorBase),
+ FixedPcdGet64 (PcdGicDistributorBase),
0,
3 /* GicVersion */
);
--
2.30.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH edk2-platforms 2/2] Silicon/Qemu: use dynamic Pcds for SbsaQemu GIC addresses
2023-05-12 17:57 [PATCH edk2-platforms 0/2] SbsaQemu: make GIC base address Pcds dynamic Leif Lindholm
2023-05-12 17:57 ` [PATCH edk2-platforms 1/2] Silicon/Qemu: use 64-bit Pcds for SbsaQemu GIC addresses Leif Lindholm
@ 2023-05-12 17:57 ` Leif Lindholm
2023-05-16 10:45 ` [edk2-devel] " Sami Mujawar
2023-05-16 10:18 ` [edk2-devel] [PATCH edk2-platforms 0/2] SbsaQemu: make GIC base address Pcds dynamic Graeme Gregory
2023-05-30 16:43 ` Marcin Juszkiewicz
3 siblings, 1 reply; 8+ messages in thread
From: Leif Lindholm @ 2023-05-12 17:57 UTC (permalink / raw)
To: devel
Cc: Ard Biesheuvel, Graeme Gregory, Radoslaw Biernacki,
Marcin Juszkiewicz
The GIC addresses as currently declared as FixedPcd for SbsaQemu.
Change them to dynamic, to enable future patches to support these
being determined at runtime.
Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Graeme Gregory <graeme@xora.org.uk>
Cc: Radoslaw Biernacki <rad@semihalf.com>
Cc: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
---
Platform/Qemu/SbsaQemu/SbsaQemu.dsc | 12 ++++++------
Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf | 7 ++++---
.../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf | 5 +++--
.../SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h | 2 +-
.../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c | 2 +-
5 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
index 9ca030cfe9a7..0bd0df4f0239 100644
--- a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
+++ b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
@@ -406,12 +406,6 @@ [PcdsFixedAtBuild.common]
# Size of the region used by UEFI in permanent memory (Reserved 64MB)
gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x04000000
- #
- # ARM General Interrupt Controller
- #
- gArmTokenSpaceGuid.PcdGicDistributorBase|0x40060000
- gArmTokenSpaceGuid.PcdGicRedistributorsBase|0x40080000
-
## Default Terminal Type
## 0-PCANSI, 1-VT100, 2-VT00+, 3-UTF8, 4-TTYTERM
gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|4
@@ -523,6 +517,12 @@ [PcdsDynamicDefault.common]
# TODO as no DT will be used we should pass this by some other method
gArmTokenSpaceGuid.PcdSystemMemorySize|0x08000000
+ #
+ # ARM General Interrupt Controller
+ #
+ gArmTokenSpaceGuid.PcdGicDistributorBase|0x40060000
+ gArmTokenSpaceGuid.PcdGicRedistributorsBase|0x40080000
+
#
# Set video resolution for boot options
# PlatformDxe can set the former at runtime.
diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf b/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf
index 176d8fab835b..0501c670d565 100644
--- a/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf
+++ b/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf
@@ -32,9 +32,6 @@ [Packages]
Silicon/Qemu/SbsaQemu/SbsaQemu.dec
[FixedPcd]
- gArmTokenSpaceGuid.PcdGicDistributorBase
- gArmTokenSpaceGuid.PcdGicRedistributorsBase
-
gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum
gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum
@@ -74,3 +71,7 @@ [FixedPcd]
gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformAhciSize
gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformEhciBase
gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformEhciSize
+
+[Pcd]
+ gArmTokenSpaceGuid.PcdGicDistributorBase
+ gArmTokenSpaceGuid.PcdGicRedistributorsBase
diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf
index c6de685bd2c4..c1c33788567d 100644
--- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf
+++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf
@@ -46,6 +46,9 @@ [Pcd]
gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdCoreCount
gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdClusterCount
+ gArmTokenSpaceGuid.PcdGicDistributorBase
+ gArmTokenSpaceGuid.PcdGicRedistributorsBase
+
[Depex]
gEfiAcpiTableProtocolGuid ## CONSUMES
@@ -57,8 +60,6 @@ [Protocols]
[FixedPcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision
- gArmTokenSpaceGuid.PcdGicDistributorBase
- gArmTokenSpaceGuid.PcdGicRedistributorsBase
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision
diff --git a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h
index dcafcbca5a48..853b81b34df5 100644
--- a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h
+++ b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h
@@ -33,7 +33,7 @@
EFI_ACPI_6_0_GICR, /* Type */ \
sizeof (EFI_ACPI_6_0_GICR_STRUCTURE), /* Length */ \
EFI_ACPI_RESERVED_WORD, /* Reserved */ \
- FixedPcdGet64 (PcdGicRedistributorsBase), /* DiscoveryRangeBaseAddress */ \
+ PcdGet64 (PcdGicRedistributorsBase), /* DiscoveryRangeBaseAddress */ \
SBSAQEMU_MADT_GICR_SIZE /* DiscoveryRangeLength */ \
}
diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c
index 58330a3e7005..ae5397bab768 100644
--- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c
+++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c
@@ -83,7 +83,7 @@ AddMadtTable (
EFI_ACPI_6_0_GIC_DISTRIBUTOR_STRUCTURE Gicd =
EFI_ACPI_6_0_GIC_DISTRIBUTOR_INIT (
0,
- FixedPcdGet64 (PcdGicDistributorBase),
+ PcdGet64 (PcdGicDistributorBase),
0,
3 /* GicVersion */
);
--
2.30.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [edk2-devel] [PATCH edk2-platforms 0/2] SbsaQemu: make GIC base address Pcds dynamic
2023-05-12 17:57 [PATCH edk2-platforms 0/2] SbsaQemu: make GIC base address Pcds dynamic Leif Lindholm
2023-05-12 17:57 ` [PATCH edk2-platforms 1/2] Silicon/Qemu: use 64-bit Pcds for SbsaQemu GIC addresses Leif Lindholm
2023-05-12 17:57 ` [PATCH edk2-platforms 2/2] Silicon/Qemu: use dynamic " Leif Lindholm
@ 2023-05-16 10:18 ` Graeme Gregory
2023-06-01 18:34 ` Leif Lindholm
2023-05-30 16:43 ` Marcin Juszkiewicz
3 siblings, 1 reply; 8+ messages in thread
From: Graeme Gregory @ 2023-05-16 10:18 UTC (permalink / raw)
To: devel, quic_llindhol
Cc: Ard Biesheuvel, Radoslaw Biernacki, Marcin Juszkiewicz
On Fri, May 12, 2023 at 06:57:51PM +0100, Leif Lindholm wrote:
> Currently, the GIC and redistributors base addresses are defined using
> FixedPcds.
>
> In order to enable the QEMU platform to evolve to provide ITS frames,
> as well as newer versions of the GIC, convert these accesses to Dynamic.
>
> Firtsly, this requires fixing the bug of the addresses being read as 32-bit
> Pcds, and then moving the declarations and calls to the dynamic form.
>
Messed this up first time, so...
All patches look good to me.
Reviewed-by: Graeme Gregory <graeme@xora.org.uk>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Graeme Gregory <graeme@xora.org.uk>
> Cc: Radoslaw Biernacki <rad@semihalf.com>
> Cc: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
>
> Leif Lindholm (2):
> Silicon/Qemu: use 64-bit Pcds for SbsaQemu GIC addresses
> Silicon/Qemu: use dynamic Pcds for SbsaQemu GIC addresses
>
> Platform/Qemu/SbsaQemu/SbsaQemu.dsc | 12 ++++++------
> Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf | 7 ++++---
> .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf | 5 +++--
> .../SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h | 2 +-
> .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c | 2 +-
> 5 files changed, 15 insertions(+), 13 deletions(-)
>
> --
> 2.30.2
>
>
>
>
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [edk2-devel] [PATCH edk2-platforms 1/2] Silicon/Qemu: use 64-bit Pcds for SbsaQemu GIC addresses
2023-05-12 17:57 ` [PATCH edk2-platforms 1/2] Silicon/Qemu: use 64-bit Pcds for SbsaQemu GIC addresses Leif Lindholm
@ 2023-05-16 10:45 ` Sami Mujawar
0 siblings, 0 replies; 8+ messages in thread
From: Sami Mujawar @ 2023-05-16 10:45 UTC (permalink / raw)
To: devel, quic_llindhol
Cc: Ard Biesheuvel, Graeme Gregory, Radoslaw Biernacki,
Marcin Juszkiewicz, nd@arm.com
Hi Leif,
Thank you for this patch.
These changes look good to me.
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Regards,
Sami Mujawar
On 12/05/2023 06:57 pm, Leif Lindholm via groups.io wrote:
> gArmTokenSpaceGuid.PcdGicDistributorBase and
> gArmTokenSpaceGuid.PcdGicRedistributorsBase are both defined as UINT64 in
> ArmPkg.dec, but SbsaQemuAcpiDxe and its exported header file use
> PcdGet32. While this currently works, it will break once these Pcds are
> made dynamic - so fix.
>
> Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Graeme Gregory <graeme@xora.org.uk>
> Cc: Radoslaw Biernacki <rad@semihalf.com>
> Cc: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
> ---
> Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h | 2 +-
> Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h
> index 4d5b05ba17c6..dcafcbca5a48 100644
> --- a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h
> +++ b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h
> @@ -33,7 +33,7 @@
> EFI_ACPI_6_0_GICR, /* Type */ \
> sizeof (EFI_ACPI_6_0_GICR_STRUCTURE), /* Length */ \
> EFI_ACPI_RESERVED_WORD, /* Reserved */ \
> - FixedPcdGet32 (PcdGicRedistributorsBase), /* DiscoveryRangeBaseAddress */ \
> + FixedPcdGet64 (PcdGicRedistributorsBase), /* DiscoveryRangeBaseAddress */ \
> SBSAQEMU_MADT_GICR_SIZE /* DiscoveryRangeLength */ \
> }
>
> diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c
> index 7ba9e8e9deeb..58330a3e7005 100644
> --- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c
> +++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c
> @@ -83,7 +83,7 @@ AddMadtTable (
> EFI_ACPI_6_0_GIC_DISTRIBUTOR_STRUCTURE Gicd =
> EFI_ACPI_6_0_GIC_DISTRIBUTOR_INIT (
> 0,
> - FixedPcdGet32 (PcdGicDistributorBase),
> + FixedPcdGet64 (PcdGicDistributorBase),
> 0,
> 3 /* GicVersion */
> );
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [edk2-devel] [PATCH edk2-platforms 2/2] Silicon/Qemu: use dynamic Pcds for SbsaQemu GIC addresses
2023-05-12 17:57 ` [PATCH edk2-platforms 2/2] Silicon/Qemu: use dynamic " Leif Lindholm
@ 2023-05-16 10:45 ` Sami Mujawar
0 siblings, 0 replies; 8+ messages in thread
From: Sami Mujawar @ 2023-05-16 10:45 UTC (permalink / raw)
To: devel, quic_llindhol
Cc: Ard Biesheuvel, Graeme Gregory, Radoslaw Biernacki,
Marcin Juszkiewicz, nd@arm.com
Hi Leif,
Thank you for this patch.
These changes look good to me.
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Regards,
Sami Mujawar
On 12/05/2023 06:57 pm, Leif Lindholm via groups.io wrote:
> The GIC addresses as currently declared as FixedPcd for SbsaQemu.
> Change them to dynamic, to enable future patches to support these
> being determined at runtime.
>
> Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Graeme Gregory <graeme@xora.org.uk>
> Cc: Radoslaw Biernacki <rad@semihalf.com>
> Cc: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
> ---
> Platform/Qemu/SbsaQemu/SbsaQemu.dsc | 12 ++++++------
> Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf | 7 ++++---
> .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf | 5 +++--
> .../SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h | 2 +-
> .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c | 2 +-
> 5 files changed, 15 insertions(+), 13 deletions(-)
>
> diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
> index 9ca030cfe9a7..0bd0df4f0239 100644
> --- a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
> +++ b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
> @@ -406,12 +406,6 @@ [PcdsFixedAtBuild.common]
> # Size of the region used by UEFI in permanent memory (Reserved 64MB)
> gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x04000000
>
> - #
> - # ARM General Interrupt Controller
> - #
> - gArmTokenSpaceGuid.PcdGicDistributorBase|0x40060000
> - gArmTokenSpaceGuid.PcdGicRedistributorsBase|0x40080000
> -
> ## Default Terminal Type
> ## 0-PCANSI, 1-VT100, 2-VT00+, 3-UTF8, 4-TTYTERM
> gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|4
> @@ -523,6 +517,12 @@ [PcdsDynamicDefault.common]
> # TODO as no DT will be used we should pass this by some other method
> gArmTokenSpaceGuid.PcdSystemMemorySize|0x08000000
>
> + #
> + # ARM General Interrupt Controller
> + #
> + gArmTokenSpaceGuid.PcdGicDistributorBase|0x40060000
> + gArmTokenSpaceGuid.PcdGicRedistributorsBase|0x40080000
> +
> #
> # Set video resolution for boot options
> # PlatformDxe can set the former at runtime.
> diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf b/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf
> index 176d8fab835b..0501c670d565 100644
> --- a/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf
> +++ b/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf
> @@ -32,9 +32,6 @@ [Packages]
> Silicon/Qemu/SbsaQemu/SbsaQemu.dec
>
> [FixedPcd]
> - gArmTokenSpaceGuid.PcdGicDistributorBase
> - gArmTokenSpaceGuid.PcdGicRedistributorsBase
> -
> gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum
> gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
> gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum
> @@ -74,3 +71,7 @@ [FixedPcd]
> gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformAhciSize
> gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformEhciBase
> gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformEhciSize
> +
> +[Pcd]
> + gArmTokenSpaceGuid.PcdGicDistributorBase
> + gArmTokenSpaceGuid.PcdGicRedistributorsBase
> diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf
> index c6de685bd2c4..c1c33788567d 100644
> --- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf
> +++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf
> @@ -46,6 +46,9 @@ [Pcd]
> gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdCoreCount
> gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdClusterCount
>
> + gArmTokenSpaceGuid.PcdGicDistributorBase
> + gArmTokenSpaceGuid.PcdGicRedistributorsBase
> +
> [Depex]
> gEfiAcpiTableProtocolGuid ## CONSUMES
>
> @@ -57,8 +60,6 @@ [Protocols]
>
> [FixedPcd]
> gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision
> - gArmTokenSpaceGuid.PcdGicDistributorBase
> - gArmTokenSpaceGuid.PcdGicRedistributorsBase
>
> gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId
> gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision
> diff --git a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h
> index dcafcbca5a48..853b81b34df5 100644
> --- a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h
> +++ b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h
> @@ -33,7 +33,7 @@
> EFI_ACPI_6_0_GICR, /* Type */ \
> sizeof (EFI_ACPI_6_0_GICR_STRUCTURE), /* Length */ \
> EFI_ACPI_RESERVED_WORD, /* Reserved */ \
> - FixedPcdGet64 (PcdGicRedistributorsBase), /* DiscoveryRangeBaseAddress */ \
> + PcdGet64 (PcdGicRedistributorsBase), /* DiscoveryRangeBaseAddress */ \
> SBSAQEMU_MADT_GICR_SIZE /* DiscoveryRangeLength */ \
> }
>
> diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c
> index 58330a3e7005..ae5397bab768 100644
> --- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c
> +++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c
> @@ -83,7 +83,7 @@ AddMadtTable (
> EFI_ACPI_6_0_GIC_DISTRIBUTOR_STRUCTURE Gicd =
> EFI_ACPI_6_0_GIC_DISTRIBUTOR_INIT (
> 0,
> - FixedPcdGet64 (PcdGicDistributorBase),
> + PcdGet64 (PcdGicDistributorBase),
> 0,
> 3 /* GicVersion */
> );
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [edk2-devel] [PATCH edk2-platforms 0/2] SbsaQemu: make GIC base address Pcds dynamic
2023-05-12 17:57 [PATCH edk2-platforms 0/2] SbsaQemu: make GIC base address Pcds dynamic Leif Lindholm
` (2 preceding siblings ...)
2023-05-16 10:18 ` [edk2-devel] [PATCH edk2-platforms 0/2] SbsaQemu: make GIC base address Pcds dynamic Graeme Gregory
@ 2023-05-30 16:43 ` Marcin Juszkiewicz
3 siblings, 0 replies; 8+ messages in thread
From: Marcin Juszkiewicz @ 2023-05-30 16:43 UTC (permalink / raw)
To: devel, quic_llindhol; +Cc: Ard Biesheuvel, Graeme Gregory, Radoslaw Biernacki
W dniu 12.05.2023 o 19:57, Leif Lindholm pisze:
> Currently, the GIC and redistributors base addresses are defined using
> FixedPcds.
>
> In order to enable the QEMU platform to evolve to provide ITS frames,
> as well as newer versions of the GIC, convert these accesses to Dynamic.
>
> Firtsly, this requires fixing the bug of the addresses being read as 32-bit
> Pcds, and then moving the declarations and calls to the dynamic form.
>
> Cc: Ard Biesheuvel<ardb+tianocore@kernel.org>
> Cc: Graeme Gregory<graeme@xora.org.uk>
> Cc: Radoslaw Biernacki<rad@semihalf.com>
> Cc: Marcin Juszkiewicz<marcin.juszkiewicz@linaro.org>
>
> Leif Lindholm (2):
> Silicon/Qemu: use 64-bit Pcds for SbsaQemu GIC addresses
> Silicon/Qemu: use dynamic Pcds for SbsaQemu GIC addresses
Tested-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [edk2-devel] [PATCH edk2-platforms 0/2] SbsaQemu: make GIC base address Pcds dynamic
2023-05-16 10:18 ` [edk2-devel] [PATCH edk2-platforms 0/2] SbsaQemu: make GIC base address Pcds dynamic Graeme Gregory
@ 2023-06-01 18:34 ` Leif Lindholm
0 siblings, 0 replies; 8+ messages in thread
From: Leif Lindholm @ 2023-06-01 18:34 UTC (permalink / raw)
To: Graeme Gregory
Cc: devel, Ard Biesheuvel, Radoslaw Biernacki, Marcin Juszkiewicz,
Sami Mujawar
Thanks,
Pushed as ce9ea07a8b56..4303f7782c08.
On Tue, May 16, 2023 at 11:18:28 +0100, Graeme Gregory wrote:
> On Fri, May 12, 2023 at 06:57:51PM +0100, Leif Lindholm wrote:
> > Currently, the GIC and redistributors base addresses are defined using
> > FixedPcds.
> >
> > In order to enable the QEMU platform to evolve to provide ITS frames,
> > as well as newer versions of the GIC, convert these accesses to Dynamic.
> >
> > Firtsly, this requires fixing the bug of the addresses being read as 32-bit
> > Pcds, and then moving the declarations and calls to the dynamic form.
> >
>
> Messed this up first time, so...
>
> All patches look good to me.
>
> Reviewed-by: Graeme Gregory <graeme@xora.org.uk>
>
> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > Cc: Graeme Gregory <graeme@xora.org.uk>
> > Cc: Radoslaw Biernacki <rad@semihalf.com>
> > Cc: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
> >
> > Leif Lindholm (2):
> > Silicon/Qemu: use 64-bit Pcds for SbsaQemu GIC addresses
> > Silicon/Qemu: use dynamic Pcds for SbsaQemu GIC addresses
> >
> > Platform/Qemu/SbsaQemu/SbsaQemu.dsc | 12 ++++++------
> > Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf | 7 ++++---
> > .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf | 5 +++--
> > .../SbsaQemu/Include/IndustryStandard/SbsaQemuAcpi.h | 2 +-
> > .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c | 2 +-
> > 5 files changed, 15 insertions(+), 13 deletions(-)
> >
> > --
> > 2.30.2
> >
> >
> >
> >
> >
> >
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-06-01 18:34 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-12 17:57 [PATCH edk2-platforms 0/2] SbsaQemu: make GIC base address Pcds dynamic Leif Lindholm
2023-05-12 17:57 ` [PATCH edk2-platforms 1/2] Silicon/Qemu: use 64-bit Pcds for SbsaQemu GIC addresses Leif Lindholm
2023-05-16 10:45 ` [edk2-devel] " Sami Mujawar
2023-05-12 17:57 ` [PATCH edk2-platforms 2/2] Silicon/Qemu: use dynamic " Leif Lindholm
2023-05-16 10:45 ` [edk2-devel] " Sami Mujawar
2023-05-16 10:18 ` [edk2-devel] [PATCH edk2-platforms 0/2] SbsaQemu: make GIC base address Pcds dynamic Graeme Gregory
2023-06-01 18:34 ` Leif Lindholm
2023-05-30 16:43 ` Marcin Juszkiewicz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox