Re: [PATCH v2 22/26] x86: cpu: i386: cpu: only set pci_ram_top if CONFIG_IS_ENABLED(PCI)

2023-02-26 Thread Simon Glass
On Fri, 24 Feb 2023 at 11:11, Troy Kisky  wrote:
>
> This avoids an error when ifdef CONFIG_PCI is changed to
> if CONFIG_IS_ENABLED(PCI)
>
> Signed-off-by: Troy Kisky 
> ---
>
> Changes in v2:
> - use an accessor function gd_set_pci_ram_top
>
>  arch/x86/cpu/i386/cpu.c   | 2 +-
>  include/asm-generic/global_data.h | 6 ++
>  2 files changed, 7 insertions(+), 1 deletion(-)
>

Reviewed-by: Simon Glass 


[PATCH v2 22/26] x86: cpu: i386: cpu: only set pci_ram_top if CONFIG_IS_ENABLED(PCI)

2023-02-24 Thread Troy Kisky
This avoids an error when ifdef CONFIG_PCI is changed to
if CONFIG_IS_ENABLED(PCI)

Signed-off-by: Troy Kisky 
---

Changes in v2:
- use an accessor function gd_set_pci_ram_top

 arch/x86/cpu/i386/cpu.c   | 2 +-
 include/asm-generic/global_data.h | 6 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/x86/cpu/i386/cpu.c b/arch/x86/cpu/i386/cpu.c
index c7f6c5a013e..068670dfc41 100644
--- a/arch/x86/cpu/i386/cpu.c
+++ b/arch/x86/cpu/i386/cpu.c
@@ -415,7 +415,7 @@ int cpu_phys_address_size(void)
 /* Don't allow PCI region 3 to use memory in the 2-4GB memory hole */
 static void setup_pci_ram_top(void)
 {
-   gd->pci_ram_top = 0x8000U;
+   gd_set_pci_ram_top(0x8000U);
 }
 
 static void setup_mtrr(void)
diff --git a/include/asm-generic/global_data.h 
b/include/asm-generic/global_data.h
index 987fb66c17a..952e17b2c13 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -560,6 +560,12 @@ static_assert(sizeof(struct global_data) == GD_SIZE);
 #define gd_event_state()   NULL
 #endif
 
+#if CONFIG_IS_ENABLED(PCI)
+#define gd_set_pci_ram_top(val)gd->pci_ram_top = val
+#else
+#define gd_set_pci_ram_top(val)
+#endif
+
 /**
  * enum gd_flags - global data flags
  *
-- 
2.34.1