Move FCH header to a location accessible by all archs
authorMario Limonciello <mario.limonciello@amd.com>
Tue, 10 Jun 2025 20:58:16 +0000 (15:58 -0500)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 30 Jun 2025 10:42:11 +0000 (13:42 +0300)
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>")
Suggested-by: Hans de Goede <hansg@kernel.org>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Hans de Goede <hansg@kernel.org>
Link: https://lore.kernel.org/r/20250610205817.3912944-1-superm1@kernel.org
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
arch/x86/include/asm/amd/fch.h [deleted file]
arch/x86/kernel/cpu/amd.c
drivers/i2c/busses/i2c-piix4.c
drivers/platform/x86/amd/pmc/pmc-quirks.c
include/linux/platform_data/x86/amd-fch.h [new file with mode: 0644]

diff --git a/arch/x86/include/asm/amd/fch.h b/arch/x86/include/asm/amd/fch.h
deleted file mode 100644 (file)
index 2cf5153..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _ASM_X86_AMD_FCH_H_
-#define _ASM_X86_AMD_FCH_H_
-
-#define FCH_PM_BASE                    0xFED80300
-
-/* Register offsets from PM base: */
-#define FCH_PM_DECODEEN                        0x00
-#define FCH_PM_DECODEEN_SMBUS0SEL      GENMASK(20, 19)
-#define FCH_PM_SCRATCH                 0x80
-#define FCH_PM_S5_RESET_STATUS         0xC0
-
-#endif /* _ASM_X86_AMD_FCH_H_ */
index 93da466dfe2cb5b057291c1e3cc29b7706a29f79..9543d5de4e7d619fe4a4241afec1e74e64ca30a4 100644 (file)
@@ -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>
index 9d3a4dc2bd60c591dc03528e2a703f593d1bcfc2..ac3bb550303fe5893822af50c385004c9292e695 100644 (file)
@@ -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"
 
index f292111bd065c148a619d55844ef61abf7cf8c44..131f10b683088539e09d171ed72bc95a53c3cdcf 100644 (file)
@@ -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"
 
diff --git a/include/linux/platform_data/x86/amd-fch.h b/include/linux/platform_data/x86/amd-fch.h
new file mode 100644 (file)
index 0000000..2cf5153
--- /dev/null
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_X86_AMD_FCH_H_
+#define _ASM_X86_AMD_FCH_H_
+
+#define FCH_PM_BASE                    0xFED80300
+
+/* Register offsets from PM base: */
+#define FCH_PM_DECODEEN                        0x00
+#define FCH_PM_DECODEEN_SMBUS0SEL      GENMASK(20, 19)
+#define FCH_PM_SCRATCH                 0x80
+#define FCH_PM_S5_RESET_STATUS         0xC0
+
+#endif /* _ASM_X86_AMD_FCH_H_ */