Skip to contentSkip to conversation

Move FCH header to a location accessible by all archs

PATCH In review Mario Limonciello 4 participants 7 messages Jun 10, 2025 – Jun 30, 2025

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Move FCH header to a location accessible by all archs

From: Mario Limonciello <[email protected]>

A new header fch.h was created to store registers used by different AMD drivers. This header was included by i2c-piix4 in
commit 624b0d5696a8 ("i2c: piix4, x86/platform: Move the SB800 PIIX4 FCH definitions to <asm/amd/fch.h>"). To prevent compile failures on non-x86 archs i2c-piix4 was set to only compile on x86 by commit 7e173eb82ae9717 ("i2c: piix4: Make CONFIG_I2C_PIIX4 dependent on CONFIG_X86"). This was not a good decision because loongarch and mips both actually support i2c-piix4 and set it enabled in the defconfig.

Move the header to a location accessible by all architectures.

Fixes 624b0d5696a89 ("i2c: piix4, x86/platform: Move the SB800 PIIX4 FCH definitions to <asm/amd/fch.h>")
---
 arch/x86/kernel/cpu/amd.c                                       | 2 +-
 drivers/i2c/busses/i2c-piix4.c                                  | 2 +-
 drivers/platform/x86/amd/pmc/pmc-quirks.c                       | 2 +-
 .../asm/amd/fch.h => include/linux/platform_data/x86/amd-fch.h  | 0
 4 files changed, 3 insertions(+), 3 deletions(-)
 rename arch/x86/include/asm/amd/fch.h => include/linux/platform_data/x86/amd-fch.h (100%)
arch/x86/kernel/cpu/amd.c +1 -1
index 93da466dfe2cb..9543d5de4e7d6 100644
@@ -9,7 +9,7 @@
 #include <linux/sched/clock.h>
 #include <linux/random.h>
 #include <linux/topology.h>
-#include <asm/amd/fch.h>
+#include <linux/platform_data/x86/amd-fch.h>
 #include <asm/processor.h>
 #include <asm/apic.h>
 #include <asm/cacheinfo.h>
drivers/i2c/busses/i2c-piix4.c +1 -1
index 9d3a4dc2bd60c..ac3bb550303fe 100644
@@ -34,7 +34,7 @@
 #include <linux/dmi.h>
 #include <linux/acpi.h>
 #include <linux/io.h>
-#include <asm/amd/fch.h>
+#include <linux/platform_data/x86/amd-fch.h>
 
 #include "i2c-piix4.h"
 
drivers/platform/x86/amd/pmc/pmc-quirks.c +1 -1
index 5c7c01f66cde0..6648fe0dce537 100644
@@ -11,7 +11,7 @@
 #include <linux/dmi.h>
 #include <linux/io.h>
 #include <linux/ioport.h>
-#include <asm/amd/fch.h>
+#include <linux/platform_data/x86/amd-fch.h>
 
 #include "pmc.h"
 
include/linux/platform_data/x86/amd-fch.h renamed from arch/x86/include/asm/amd/fch.h +0 -0
similarity index 100%
rename from arch/x86/include/asm/amd/fch.h
rename to include/linux/platform_data/x86/amd-fch.h
Signature · 1 line
2.43.0
#1 lore raw

PATCH 2/2 i2c: Re-enable piix4 driver on non-x86

From: Mario Limonciello <[email protected]>

loongarch and mips both support hardware that uses the i2c-piix4 driver. It should not be restricted to x86, so drop the x86 dependency.

---
 drivers/i2c/busses/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/Kconfig +1 -1
index 48c5ab8320090..3be623735ca8a 100644
@@ -200,7 +200,7 @@ config I2C_ISMT
 
 config I2C_PIIX4
 	tristate "Intel PIIX4 and compatible (ATI/AMD/Serverworks/Broadcom/SMSC)"
-	depends on PCI && HAS_IOPORT && X86
+	depends on PCI && HAS_IOPORT
 	select I2C_SMBUS
 	help
 	  If you say yes to this option, support will be included for the Intel
Signature · 1 line
2.43.0
maintainer Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] i2c: Re-enable piix4 driver on non-x86

Hi Mario,

Quoted 18 lines · Mario Limonciello

From: Mario Limonciello <[email protected]>

loongarch and mips both support hardware that uses the i2c-piix4 driver. It should not be restricted to x86, so drop the x86 dependency.

---
 drivers/i2c/busses/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/Kconfig +0 -0
index 48c5ab8320090..3be623735ca8a 100644

drivers/i2c/busses/Kconfig config I2C_ISMT · line 203

Quoted 5 lines
drivers/i2c/busses/Kconfig +1 -1
@@ -200,7 +200,7 @@ config I2C_ISMT
 
 config I2C_PIIX4
 	tristate "Intel PIIX4 and compatible (ATI/AMD/Serverworks/Broadcom/SMSC)"
-	depends on PCI && HAS_IOPORT && X86
+	depends on PCI && HAS_IOPORT

mmmhhh... OK.

Andi

Quoted 6 lines
drivers/i2c/busses/Kconfig +0 -0
 	select I2C_SMBUS
 	help
 	  If you say yes to this option, support will be included for the Intel
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 2/2
#3 lore raw

Re: [PATCH 2/2] i2c: Re-enable piix4 driver on non-x86

In reply to Mario Limonciello

Hi,

Quoted 9 lines · Mario Limonciello

From: Mario Limonciello <[email protected]>

loongarch and mips both support hardware that uses the i2c-piix4 driver. It should not be restricted to x86, so drop the x86 dependency.

Thanks, patch looks good to me:

Regards,

Hans

Quoted 17 lines
---
 drivers/i2c/busses/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/Kconfig +1 -1
index 48c5ab8320090..3be623735ca8a 100644
@@ -200,7 +200,7 @@ config I2C_ISMT
 
 config I2C_PIIX4
 	tristate "Intel PIIX4 and compatible (ATI/AMD/Serverworks/Broadcom/SMSC)"
-	depends on PCI && HAS_IOPORT && X86
+	depends on PCI && HAS_IOPORT
 	select I2C_SMBUS
 	help
 	  If you say yes to this option, support will be included for the Intel
maintainer Reviewed-by on v1 1/2
#4 lore raw
In reply to Mario Limonciello

Hi,

Quoted 11 lines · Mario Limonciello

From: Mario Limonciello <[email protected]>

A new header fch.h was created to store registers used by different AMD drivers. This header was included by i2c-piix4 in
commit 624b0d5696a8 ("i2c: piix4, x86/platform: Move the SB800 PIIX4 FCH definitions to <asm/amd/fch.h>"). To prevent compile failures on non-x86 archs i2c-piix4 was set to only compile on x86 by commit 7e173eb82ae9717 ("i2c: piix4: Make CONFIG_I2C_PIIX4 dependent on CONFIG_X86"). This was not a good decision because loongarch and mips both actually support i2c-piix4 and set it enabled in the defconfig.

Quoted 5 lines

Move the header to a location accessible by all architectures.

Fixes 624b0d5696a89 ("i2c: piix4, x86/platform: Move the SB800 PIIX4 FCH definitions to <asm/amd/fch.h>")

Thanks, patch looks good to me:

Regards,

Hans

Quoted 51 lines
---
 arch/x86/kernel/cpu/amd.c                                       | 2 +-
 drivers/i2c/busses/i2c-piix4.c                                  | 2 +-
 drivers/platform/x86/amd/pmc/pmc-quirks.c                       | 2 +-
 .../asm/amd/fch.h => include/linux/platform_data/x86/amd-fch.h  | 0
 4 files changed, 3 insertions(+), 3 deletions(-)
 rename arch/x86/include/asm/amd/fch.h => include/linux/platform_data/x86/amd-fch.h (100%)
arch/x86/kernel/cpu/amd.c +1 -1
index 93da466dfe2cb..9543d5de4e7d6 100644
@@ -9,7 +9,7 @@
 #include <linux/sched/clock.h>
 #include <linux/random.h>
 #include <linux/topology.h>
-#include <asm/amd/fch.h>
+#include <linux/platform_data/x86/amd-fch.h>
 #include <asm/processor.h>
 #include <asm/apic.h>
 #include <asm/cacheinfo.h>
drivers/i2c/busses/i2c-piix4.c +1 -1
index 9d3a4dc2bd60c..ac3bb550303fe 100644
@@ -34,7 +34,7 @@
 #include <linux/dmi.h>
 #include <linux/acpi.h>
 #include <linux/io.h>
-#include <asm/amd/fch.h>
+#include <linux/platform_data/x86/amd-fch.h>
 
 #include "i2c-piix4.h"
 
drivers/platform/x86/amd/pmc/pmc-quirks.c +1 -1
index 5c7c01f66cde0..6648fe0dce537 100644
@@ -11,7 +11,7 @@
 #include <linux/dmi.h>
 #include <linux/io.h>
 #include <linux/ioport.h>
-#include <asm/amd/fch.h>
+#include <linux/platform_data/x86/amd-fch.h>
 
 #include "pmc.h"
 
include/linux/platform_data/x86/amd-fch.h renamed from arch/x86/include/asm/amd/fch.h +0 -0
similarity index 100%
rename from arch/x86/include/asm/amd/fch.h
rename to include/linux/platform_data/x86/amd-fch.h
maintainer
#5 lore raw

Hi,

Quoted 16 lines · Hans de Goede

Hi,

Quoted 13 lines · Mario Limonciello

From: Mario Limonciello <[email protected]>

A new header fch.h was created to store registers used by different AMD drivers. This header was included by i2c-piix4 in
commit 624b0d5696a8 ("i2c: piix4, x86/platform: Move the SB800 PIIX4 FCH definitions to <asm/amd/fch.h>"). To prevent compile failures on non-x86 archs i2c-piix4 was set to only compile on x86 by commit 7e173eb82ae9717 ("i2c: piix4: Make CONFIG_I2C_PIIX4 dependent on CONFIG_X86"). This was not a good decision because loongarch and mips both actually support i2c-piix4 and set it enabled in the defconfig.

Move the header to a location accessible by all architectures.

Quoted 7 lines
Quoted 3 lines
Fixes 624b0d5696a89 ("i2c: piix4, x86/platform: Move the SB800 PIIX4 FCH definitions to <asm/amd/fch.h>")

Thanks, patch looks good to me:

I don't see this series in yet. I thought you were taking it, shall I take it through i2c?

Andi

maintainer
#6 lore raw
Quoted 23 lines · Andi Shyti

Hi,

Quoted 20 lines · Hans de Goede

Hi,

Quoted 16 lines · Mario Limonciello

From: Mario Limonciello <[email protected]>

A new header fch.h was created to store registers used by different AMD drivers. This header was included by i2c-piix4 in
commit 624b0d5696a8 ("i2c: piix4, x86/platform: Move the SB800 PIIX4 FCH definitions to <asm/amd/fch.h>"). To prevent compile failures on non-x86 archs i2c-piix4 was set to only compile on x86 by commit 7e173eb82ae9717 ("i2c: piix4: Make CONFIG_I2C_PIIX4 dependent on CONFIG_X86"). This was not a good decision because loongarch and mips both actually support i2c-piix4 and set it enabled in the defconfig.

Move the header to a location accessible by all architectures.

Fixes 624b0d5696a89 ("i2c: piix4, x86/platform: Move the SB800 PIIX4 FCH definitions to <asm/amd/fch.h>")
Quoted 6 lines
Quoted 3 lines

Thanks, patch looks good to me:

I don't see this series in yet. I thought you were taking it, shall I take it through i2c?

I'm sorry I seem to have missed this inquiry until now. I thought x86 would handle it this but apparently they haven't.

(I'm the primary person handling pdx86 patches, not Hans any more).

I can take this now.

Signature · 1 line
 i.