Skip to contentSkip to conversation

x86: Fix member check in intel_gnvs

PATCH New Simon Glass 2 participants 9 messages Feb 23, 2021 – Feb 25, 2021 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 x86: Fix member check in intel_gnvs

When CONFIG_CHROMEOS is not enabled this currently does not build. Fix it.

---

 arch/x86/include/asm/intel_gnvs.h | 4 ++++
 1 file changed, 4 insertions(+)
arch/x86/include/asm/intel_gnvs.h +4 -0
index 69a20812e5e..fc743dc9285 100644
@@ -107,6 +107,10 @@ struct __packed acpi_global_nvs {
 	u8	unused2[0x1000 - 0x100];	/* Pad out to 4096 bytes */
 #endif
 };
+#ifdef CONFIG_CHROMEOS
 check_member(acpi_global_nvs, chromeos, GNVS_CHROMEOS_ACPI_OFFSET);
+#else
+check_member(acpi_global_nvs, unused2, GNVS_CHROMEOS_ACPI_OFFSET);
+#endif
 
 #endif /* _INTEL_GNVS_H_ */
Signature · 1 line
2.30.0.617.g56c4b15f3c-goog
#1 lore raw

PATCH 2/3 x86: Move INTEL_ACPIGEN to arch/x86

This option is better placed in the x86 code since it is not generic enough to be in the core code. Move it.

---

 arch/x86/Kconfig     | 9 +++++++++
 drivers/core/Kconfig | 9 ---------
 2 files changed, 9 insertions(+), 9 deletions(-)
arch/x86/Kconfig +9 -0
index eddf2a774ef..c8ce2fcb88d 100644
@@ -1001,6 +1001,15 @@ config PCIEX_LENGTH_128MB
 config PCIEX_LENGTH_64MB
 	bool
 
+config INTEL_ACPIGEN
+	bool "Support ACPI table generation for Intel SoCs"
+	depends on ACPIGEN
+	help
+	  This option adds some functions used for programatic generation of
+	  ACPI tables on Intel SoCs. This provides features for writing CPU
+	  information such as P states and T stages. Also included is a way
+	  to create a GNVS table and set it up.
+
 config INTEL_GMA_ACPI
 	bool "Generate ACPI table for Intel GMA graphics"
 	help
drivers/core/Kconfig +0 -9
index 00554af4995..1eccac28c62 100644
@@ -329,15 +329,6 @@ config ACPIGEN
 	  things like generating device-specific tables and returning the ACPI
 	  name of a device.
 
-config INTEL_ACPIGEN
-	bool "Support ACPI table generation for Intel SoCs"
-	depends on ACPIGEN
-	help
-	  This option adds some functions used for programatic generation of
-	  ACPI tables on Intel SoCs. This provides features for writing CPU
-	  information such as P states and T stages. Also included is a way
-	  to create a GNVS table and set it up.
-
 config BOUNCE_BUFFER
 	bool "Include bounce buffer API"
 	help
Signature · 1 line
2.30.0.617.g56c4b15f3c-goog
#2 lore raw

PATCH 2/3 x86: Move INTEL_ACPIGEN to arch/x86

Quoted 17 lines · Simon Glass

This option is better placed in the x86 code since it is not generic enough to be in the core code. Move it.

---

 arch/x86/Kconfig     | 9 +++++++++
 drivers/core/Kconfig | 9 ---------
 2 files changed, 9 insertions(+), 9 deletions(-)
arch/x86/Kconfig +0 -0
index eddf2a774ef..c8ce2fcb88d 100644

arch/x86/Kconfig config PCIEX_LENGTH_128MB · line 1008

Quoted 8 lines
arch/x86/Kconfig +5 -0
@@ -1001,6 +1001,15 @@ config PCIEX_LENGTH_128MB
 config PCIEX_LENGTH_64MB
        bool
 
+config INTEL_ACPIGEN
+       bool "Support ACPI table generation for Intel SoCs"
+       depends on ACPIGEN
+       help
+         This option adds some functions used for programatic generation of

typo: programmatic

Will fix when applying

arch/x86/Kconfig config PCIEX_LENGTH_128MB · line 1015

Quoted 7 lines
arch/x86/Kconfig +4 -0
+         ACPI tables on Intel SoCs. This provides features for writing CPU
+         information such as P states and T stages. Also included is a way
+         to create a GNVS table and set it up.
+
 config INTEL_GMA_ACPI
        bool "Generate ACPI table for Intel GMA graphics"
        help
#3 lore raw

PATCH 2/3 x86: Move INTEL_ACPIGEN to arch/x86

Quoted 30 lines · Bin Meng
Quoted 17 lines · Simon Glass

This option is better placed in the x86 code since it is not generic enough to be in the core code. Move it.

---

 arch/x86/Kconfig     | 9 +++++++++
 drivers/core/Kconfig | 9 ---------
 2 files changed, 9 insertions(+), 9 deletions(-)
arch/x86/Kconfig +0 -0
index eddf2a774ef..c8ce2fcb88d 100644

arch/x86/Kconfig config PCIEX_LENGTH_128MB · line 1008

Quoted 8 lines
arch/x86/Kconfig +5 -0
@@ -1001,6 +1001,15 @@ config PCIEX_LENGTH_128MB
 config PCIEX_LENGTH_64MB
        bool
 
+config INTEL_ACPIGEN
+       bool "Support ACPI table generation for Intel SoCs"
+       depends on ACPIGEN
+       help
+         This option adds some functions used for programatic generation of

typo: programmatic

Quoted 1 line

Will fix when applying

Fixed the typo, and

Quoted 10 lines

arch/x86/Kconfig config PCIEX_LENGTH_128MB · line 1015

Quoted 8 lines
arch/x86/Kconfig +4 -0
+         ACPI tables on Intel SoCs. This provides features for writing CPU
+         information such as P states and T stages. Also included is a way
+         to create a GNVS table and set it up.
+
 config INTEL_GMA_ACPI
        bool "Generate ACPI table for Intel GMA graphics"
        help

applied to u-boot-x86, thanks!

#4 lore raw

PATCH 3/3 x86: Select advanced Intel code only if allowed

In reply to Simon Glass

At present most of the Intel-specific code is built on all devices, even those which don't have software support for the features provided there.

This means that any board can enable CONFIG_INTEL_ACPIGEN even if it does not have the required features.

Add a new INTEL_SOC option to control this access. This must be selected by SoCs that can support the required features.

---

 arch/x86/Kconfig                | 15 +++++++++++++++
 arch/x86/cpu/apollolake/Kconfig |  1 +
 2 files changed, 16 insertions(+)
arch/x86/Kconfig +15 -0
index c8ce2fcb88d..b4a86f8fa05 100644
@@ -1001,6 +1001,19 @@ config PCIEX_LENGTH_128MB
 config PCIEX_LENGTH_64MB
 	bool
 
+config INTEL_SOC
+	bool
+	help
+	  This is enabled on Intel SoCs that can support various advanced
+	  features such as power management (requiring asm/arch/pm.h), system
+	  agent (asm/arch/systemagent.h) and an I/O map for ACPI
+	  (asm/arch/iomap.h).
+
+	  This cannot be seleted in a defconfig file. It must be enabled by a
+	  'select' in the SoC's Kconfig.
+
+if INTEL_SOC
+
 config INTEL_ACPIGEN
 	bool "Support ACPI table generation for Intel SoCs"
 	depends on ACPIGEN
@@ -1032,4 +1045,6 @@ config INTEL_GMA_SWSMISCI
 	  Select this option for Atom-based platforms which use the SWSMISCI
 	  register (0xe0) rather than the SWSCI register (0xe8).
 
+endif # INTEL_SOC
+
 endmenu
arch/x86/cpu/apollolake/Kconfig +1 -0
index f5dbd6cbd34..590fe31dc4b 100644
@@ -9,6 +9,7 @@ config INTEL_APOLLOLAKE
 	select HAVE_FSP
 	select ARCH_MISC_INIT
 	select USE_CAR
+	select INTEL_SOC
 	select INTEL_PMC
 	select TPL_X86_TSC_TIMER_NATIVE
 	select SPL_PCH_SUPPORT
Signature · 1 line
2.30.0.617.g56c4b15f3c-goog
#5 lore raw

PATCH 3/3 x86: Select advanced Intel code only if allowed

Quoted 25 lines · Simon Glass

At present most of the Intel-specific code is built on all devices, even those which don't have software support for the features provided there.

This means that any board can enable CONFIG_INTEL_ACPIGEN even if it does not have the required features.

Add a new INTEL_SOC option to control this access. This must be selected by SoCs that can support the required features.

---

 arch/x86/Kconfig                | 15 +++++++++++++++
 arch/x86/cpu/apollolake/Kconfig |  1 +
 2 files changed, 16 insertions(+)
arch/x86/Kconfig +0 -0
index c8ce2fcb88d..b4a86f8fa05 100644
@@ -1001,6 +1001,19 @@ config PCIEX_LENGTH_128MB
 config PCIEX_LENGTH_64MB
        bool

arch/x86/Kconfig config PCIEX_LENGTH_128MB · line 1012

Quoted 10 lines
arch/x86/Kconfig +9 -0
 
+config INTEL_SOC
+       bool
+       help
+         This is enabled on Intel SoCs that can support various advanced
+         features such as power management (requiring asm/arch/pm.h), system
+         agent (asm/arch/systemagent.h) and an I/O map for ACPI
+         (asm/arch/iomap.h).
+
+         This cannot be seleted in a defconfig file. It must be enabled by a

typo: selected

Will fix when applying

Quoted 19 lines
arch/x86/Kconfig +6 -0
+         'select' in the SoC's Kconfig.
+
+if INTEL_SOC
+
 config INTEL_ACPIGEN
        bool "Support ACPI table generation for Intel SoCs"
        depends on ACPIGEN
@@ -1032,4 +1045,6 @@ config INTEL_GMA_SWSMISCI
          Select this option for Atom-based platforms which use the SWSMISCI
          register (0xe0) rather than the SWSCI register (0xe8).
 
+endif # INTEL_SOC
+
 endmenu
arch/x86/cpu/apollolake/Kconfig +0 -0
index f5dbd6cbd34..590fe31dc4b 100644

arch/x86/cpu/apollolake/Kconfig config INTEL_APOLLOLAKE

Quoted 8 lines
arch/x86/cpu/apollolake/Kconfig +1 -1
@@ -9,6 +9,7 @@ config INTEL_APOLLOLAKE
        select HAVE_FSP
        select ARCH_MISC_INIT
        select USE_CAR
+       select INTEL_SOC
        select INTEL_PMC
        select TPL_X86_TSC_TIMER_NATIVE
        select SPL_PCH_SUPPORT
--
#6 lore raw

PATCH 3/3 x86: Select advanced Intel code only if allowed

Quoted 40 lines · Bin Meng
Quoted 25 lines · Simon Glass

At present most of the Intel-specific code is built on all devices, even those which don't have software support for the features provided there.

This means that any board can enable CONFIG_INTEL_ACPIGEN even if it does not have the required features.

Add a new INTEL_SOC option to control this access. This must be selected by SoCs that can support the required features.

---

 arch/x86/Kconfig                | 15 +++++++++++++++
 arch/x86/cpu/apollolake/Kconfig |  1 +
 2 files changed, 16 insertions(+)
arch/x86/Kconfig +0 -0
index c8ce2fcb88d..b4a86f8fa05 100644
@@ -1001,6 +1001,19 @@ config PCIEX_LENGTH_128MB
 config PCIEX_LENGTH_64MB
        bool

arch/x86/Kconfig config PCIEX_LENGTH_128MB · line 1012

Quoted 10 lines
arch/x86/Kconfig +9 -0
 
+config INTEL_SOC
+       bool
+       help
+         This is enabled on Intel SoCs that can support various advanced
+         features such as power management (requiring asm/arch/pm.h), system
+         agent (asm/arch/systemagent.h) and an I/O map for ACPI
+         (asm/arch/iomap.h).
+
+         This cannot be seleted in a defconfig file. It must be enabled by a

typo: selected

Quoted 1 line

Will fix when applying

Fixed the typo, and

Quoted 22 lines
Quoted 22 lines
arch/x86/Kconfig +6 -0
+         'select' in the SoC's Kconfig.
+
+if INTEL_SOC
+
 config INTEL_ACPIGEN
        bool "Support ACPI table generation for Intel SoCs"
        depends on ACPIGEN
@@ -1032,4 +1045,6 @@ config INTEL_GMA_SWSMISCI
          Select this option for Atom-based platforms which use the SWSMISCI
          register (0xe0) rather than the SWSCI register (0xe8).
 
+endif # INTEL_SOC
+
 endmenu
arch/x86/cpu/apollolake/Kconfig +0 -0
index f5dbd6cbd34..590fe31dc4b 100644
@@ -9,6 +9,7 @@ config INTEL_APOLLOLAKE
        select HAVE_FSP
        select ARCH_MISC_INIT
Quoted 8 lines

arch/x86/cpu/apollolake/Kconfig config INTEL_APOLLOLAKE

Quoted 6 lines
arch/x86/cpu/apollolake/Kconfig +1 -1
        select USE_CAR
+       select INTEL_SOC
        select INTEL_PMC
        select TPL_X86_TSC_TIMER_NATIVE
        select SPL_PCH_SUPPORT
--

applied to u-boot-x86, thanks!