Skip to contentSkip to conversation

platform/x86: p2sb: Move out of X86_PLATFORM_DEVICES dependency

PATCH In review Andy Shevchenko 3 participants 5 messages Jul 18, 2022 – Aug 1, 2022 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 platform/x86: p2sb: Move out of X86_PLATFORM_DEVICES dependency

The P2SB library is used for various drivers, including server platforms. That's why the dependency on X86_PLATFORM_DEVICES seems superfluous.

---
v2: added X86 to the dependencies of P2SB (Hans), added Rb tag (Hans)

 drivers/platform/x86/Kconfig            | 12 ++++++++++++
 drivers/platform/x86/Makefile           |  4 ++++
 drivers/platform/x86/intel/Kconfig      | 12 ------------
 drivers/platform/x86/intel/Makefile     |  2 --
 drivers/platform/x86/{intel => }/p2sb.c |  0
 5 files changed, 16 insertions(+), 14 deletions(-)
 rename drivers/platform/x86/{intel => }/p2sb.c (100%)
drivers/platform/x86/Kconfig +12 -0
index bc4013e950ed..21e03bb901d2 100644
@@ -1164,6 +1164,18 @@ config WINMATE_FM07_KEYS
 
 endif # X86_PLATFORM_DEVICES
 
+config P2SB
+	bool "Primary to Sideband (P2SB) bridge access support"
+	depends on PCI && X86
+	help
+	  The Primary to Sideband (P2SB) bridge is an interface to some
+	  PCI devices connected through it. In particular, SPI NOR controller
+	  in Intel Apollo Lake SoC is one of such devices.
+
+	  The main purpose of this library is to unhide P2SB device in case
+	  firmware kept it hidden on some platforms in order to access devices
+	  behind it.
+
 config PMC_ATOM
        def_bool y
        depends on PCI
drivers/platform/x86/Makefile +4 -0
index 4a59f47a46e2..f04001431c91 100644
@@ -120,6 +120,10 @@ obj-$(CONFIG_X86_ANDROID_TABLETS)	+= x86-android-tablets.o
 # Intel uncore drivers
 obj-$(CONFIG_INTEL_IPS)				+= intel_ips.o
 
+# Intel miscellaneous drivers
+intel_p2sb-y				:= p2sb.o
+obj-$(CONFIG_P2SB)			+= intel_p2sb.o
+
 # Intel PMIC / PMC / P-Unit devices
 obj-$(CONFIG_INTEL_SCU_IPC)		+= intel_scu_ipc.o
 obj-$(CONFIG_INTEL_SCU_PCI)		+= intel_scu_pcidrv.o
drivers/platform/x86/intel/Kconfig +0 -12
index c9cfbaae436b..794968bda115 100644
@@ -70,18 +70,6 @@ config INTEL_OAKTRAIL
 	  enable/disable the Camera, WiFi, BT etc. devices. If in doubt, say Y
 	  here; it will only load on supported platforms.
 
-config P2SB
-	bool "Primary to Sideband (P2SB) bridge access support"
-	depends on PCI
-	help
-	  The Primary to Sideband (P2SB) bridge is an interface to some
-	  PCI devices connected through it. In particular, SPI NOR controller
-	  in Intel Apollo Lake SoC is one of such devices.
-
-	  The main purpose of this library is to unhide P2SB device in case
-	  firmware kept it hidden on some platforms in order to access devices
-	  behind it.
-
 config INTEL_BXTWC_PMIC_TMU
 	tristate "Intel Broxton Whiskey Cove TMU Driver"
 	depends on INTEL_SOC_PMIC_BXTWC
drivers/platform/x86/intel/Makefile +0 -2
index 741a9404db98..717933dd0cfd 100644
@@ -28,8 +28,6 @@ intel_int0002_vgpio-y			:= int0002_vgpio.o
 obj-$(CONFIG_INTEL_INT0002_VGPIO)	+= intel_int0002_vgpio.o
 intel_oaktrail-y			:= oaktrail.o
 obj-$(CONFIG_INTEL_OAKTRAIL)		+= intel_oaktrail.o
-intel_p2sb-y				:= p2sb.o
-obj-$(CONFIG_P2SB)			+= intel_p2sb.o
 intel_sdsi-y				:= sdsi.o
 obj-$(CONFIG_INTEL_SDSI)		+= intel_sdsi.o
 intel_vsec-y				:= vsec.o
drivers/platform/x86/p2sb.c renamed from drivers/platform/x86/intel/p2sb.c +0 -0
similarity index 100%
rename from drivers/platform/x86/intel/p2sb.c
rename to drivers/platform/x86/p2sb.c
Signature · 1 line
2.35.1
#1 lore raw

Hi,

Quoted 9 lines · Andy Shevchenko

The P2SB library is used for various drivers, including server platforms. That's why the dependency on X86_PLATFORM_DEVICES seems superfluous.

---
v2: added X86 to the dependencies of P2SB (Hans), added Rb tag (Hans)

Lee I presume that since you've merged the original series (in your ib-mfd-edac-i2c-leds-pinctrl-platform-watchdog-5.20 branch) that you will take this fix on top ?

This fix is necessary to fix a bunch of randconfig build failures in the current linux-next.

Quoted 21 lines
 drivers/platform/x86/Kconfig            | 12 ++++++++++++
 drivers/platform/x86/Makefile           |  4 ++++
 drivers/platform/x86/intel/Kconfig      | 12 ------------
 drivers/platform/x86/intel/Makefile     |  2 --
 drivers/platform/x86/{intel => }/p2sb.c |  0
 5 files changed, 16 insertions(+), 14 deletions(-)
 rename drivers/platform/x86/{intel => }/p2sb.c (100%)
drivers/platform/x86/Kconfig +5 -0
index bc4013e950ed..21e03bb901d2 100644
@@ -1164,6 +1164,18 @@ config WINMATE_FM07_KEYS
 
 endif # X86_PLATFORM_DEVICES
 
+config P2SB
+	bool "Primary to Sideband (P2SB) bridge access support"
+	depends on PCI && X86
+	help
+	  The Primary to Sideband (P2SB) bridge is an interface to some

drivers/platform/x86/Kconfig config WINMATE_FM07_KEYS · line 1181

Quoted 10 lines
drivers/platform/x86/Kconfig +7 -0
+	  PCI devices connected through it. In particular, SPI NOR controller
+	  in Intel Apollo Lake SoC is one of such devices.
+
+	  The main purpose of this library is to unhide P2SB device in case
+	  firmware kept it hidden on some platforms in order to access devices
+	  behind it.
+
 config PMC_ATOM
        def_bool y
        depends on PCI

Note once this is added to Lee's ib-mfd-edac-i2c-leds-pinctrl-platform-watchdog-5.20 branch there will be a small/trivial conflict between it and my pdx86/for-next branch since commit 3cd8cc98d63 ("platform/x86: Drop the PMC_ATOM Kconfig option") removes the config PMC_ATOM option from the end of drivers/platform/x86/Kconfig .

Not really a problem, but something to be aware of.

Regards,

Hans

Quoted 55 lines
drivers/platform/x86/Makefile +4 -0
index 4a59f47a46e2..f04001431c91 100644
@@ -120,6 +120,10 @@ obj-$(CONFIG_X86_ANDROID_TABLETS)	+= x86-android-tablets.o
 # Intel uncore drivers
 obj-$(CONFIG_INTEL_IPS)				+= intel_ips.o
 
+# Intel miscellaneous drivers
+intel_p2sb-y				:= p2sb.o
+obj-$(CONFIG_P2SB)			+= intel_p2sb.o
+
 # Intel PMIC / PMC / P-Unit devices
 obj-$(CONFIG_INTEL_SCU_IPC)		+= intel_scu_ipc.o
 obj-$(CONFIG_INTEL_SCU_PCI)		+= intel_scu_pcidrv.o
drivers/platform/x86/intel/Kconfig +0 -12
index c9cfbaae436b..794968bda115 100644
@@ -70,18 +70,6 @@ config INTEL_OAKTRAIL
 	  enable/disable the Camera, WiFi, BT etc. devices. If in doubt, say Y
 	  here; it will only load on supported platforms.
 
-config P2SB
-	bool "Primary to Sideband (P2SB) bridge access support"
-	depends on PCI
-	help
-	  The Primary to Sideband (P2SB) bridge is an interface to some
-	  PCI devices connected through it. In particular, SPI NOR controller
-	  in Intel Apollo Lake SoC is one of such devices.
-
-	  The main purpose of this library is to unhide P2SB device in case
-	  firmware kept it hidden on some platforms in order to access devices
-	  behind it.
-
 config INTEL_BXTWC_PMIC_TMU
 	tristate "Intel Broxton Whiskey Cove TMU Driver"
 	depends on INTEL_SOC_PMIC_BXTWC
drivers/platform/x86/intel/Makefile +0 -2
index 741a9404db98..717933dd0cfd 100644
@@ -28,8 +28,6 @@ intel_int0002_vgpio-y			:= int0002_vgpio.o
 obj-$(CONFIG_INTEL_INT0002_VGPIO)	+= intel_int0002_vgpio.o
 intel_oaktrail-y			:= oaktrail.o
 obj-$(CONFIG_INTEL_OAKTRAIL)		+= intel_oaktrail.o
-intel_p2sb-y				:= p2sb.o
-obj-$(CONFIG_P2SB)			+= intel_p2sb.o
 intel_sdsi-y				:= sdsi.o
 obj-$(CONFIG_INTEL_SDSI)		+= intel_sdsi.o
 intel_vsec-y				:= vsec.o
drivers/platform/x86/p2sb.c renamed from drivers/platform/x86/intel/p2sb.c +0 -0
similarity index 100%
rename from drivers/platform/x86/intel/p2sb.c
rename to drivers/platform/x86/p2sb.c
#2 lore raw
Quoted 13 lines · Hans de Goede

Hi,

Quoted 9 lines · Andy Shevchenko

The P2SB library is used for various drivers, including server platforms. That's why the dependency on X86_PLATFORM_DEVICES seems superfluous.

---
v2: added X86 to the dependencies of P2SB (Hans), added Rb tag (Hans)

Quoted 3 lines

Lee I presume that since you've merged the original series (in your ib-mfd-edac-i2c-leds-pinctrl-platform-watchdog-5.20 branch) that you will take this fix on top ?

The point of supplying an immutable branch is that whoever maintains this subsystem can pull from it and apply this patch on-top.

Quoted 10 lines

This fix is necessary to fix a bunch of randconfig build failures in the current linux-next.

Quoted 7 lines
 drivers/platform/x86/Kconfig            | 12 ++++++++++++
 drivers/platform/x86/Makefile           |  4 ++++
 drivers/platform/x86/intel/Kconfig      | 12 ------------
 drivers/platform/x86/intel/Makefile     |  2 --
 drivers/platform/x86/{intel => }/p2sb.c |  0
 5 files changed, 16 insertions(+), 14 deletions(-)
 rename drivers/platform/x86/{intel => }/p2sb.c (100%)
Signature · 4 lines
Lee Jones [李琼斯]
Principal Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
#3 lore raw

Hi,

Quoted 15 lines · Lee Jones
Quoted 13 lines · Hans de Goede

Hi,

Quoted 9 lines · Andy Shevchenko

The P2SB library is used for various drivers, including server platforms. That's why the dependency on X86_PLATFORM_DEVICES seems superfluous.

---
v2: added X86 to the dependencies of P2SB (Hans), added Rb tag (Hans)

Quoted 6 lines
Quoted 3 lines

Lee I presume that since you've merged the original series (in your ib-mfd-edac-i2c-leds-pinctrl-platform-watchdog-5.20 branch) that you will take this fix on top ?

The point of supplying an immutable branch is that whoever maintains this subsystem can pull from it and apply this patch on-top.

True, ok I'll merge the branch and add Andy's fix on top.

Regards,

Hans

Quoted 12 lines
Quoted 11 lines

This fix is necessary to fix a bunch of randconfig build failures in the current linux-next.

Quoted 7 lines
 drivers/platform/x86/Kconfig            | 12 ++++++++++++
 drivers/platform/x86/Makefile           |  4 ++++
 drivers/platform/x86/intel/Kconfig      | 12 ------------
 drivers/platform/x86/intel/Makefile     |  2 --
 drivers/platform/x86/{intel => }/p2sb.c |  0
 5 files changed, 16 insertions(+), 14 deletions(-)
 rename drivers/platform/x86/{intel => }/p2sb.c (100%)
#4 lore raw
In reply to Lee Jones

Hi,

Quoted 15 lines · Lee Jones
Quoted 13 lines · Hans de Goede

Hi,

Quoted 9 lines · Andy Shevchenko

The P2SB library is used for various drivers, including server platforms. That's why the dependency on X86_PLATFORM_DEVICES seems superfluous.

---
v2: added X86 to the dependencies of P2SB (Hans), added Rb tag (Hans)

Quoted 6 lines
Quoted 3 lines

Lee I presume that since you've merged the original series (in your ib-mfd-edac-i2c-leds-pinctrl-platform-watchdog-5.20 branch) that you will take this fix on top ?

The point of supplying an immutable branch is that whoever maintains this subsystem can pull from it and apply this patch on-top.

I've added the fix to pdx86/for-next now.

Regards,

Hans

Quoted 12 lines
Quoted 11 lines

This fix is necessary to fix a bunch of randconfig build failures in the current linux-next.

Quoted 7 lines
 drivers/platform/x86/Kconfig            | 12 ++++++++++++
 drivers/platform/x86/Makefile           |  4 ++++
 drivers/platform/x86/intel/Kconfig      | 12 ------------
 drivers/platform/x86/intel/Makefile     |  2 --
 drivers/platform/x86/{intel => }/p2sb.c |  0
 5 files changed, 16 insertions(+), 14 deletions(-)
 rename drivers/platform/x86/{intel => }/p2sb.c (100%)