Skip to content

Commit 7d40efd

Browse files
author
Ingo Molnar
committed
Merge branch 'x86/platform' into x86/core, to merge dependent commits
Prepare to resolve conflicts with an upstream series of fixes that conflict with pending x86 changes: 6f5bf94 Merge tag 'its-for-linus-20250509' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Signed-off-by: Ingo Molnar <[email protected]>
2 parents d6680b0 + ab81310 commit 7d40efd

File tree

9 files changed

+456
-11
lines changed

9 files changed

+456
-11
lines changed

Documentation/arch/x86/amd-debugging.rst

Lines changed: 368 additions & 0 deletions
Large diffs are not rendered by default.

Documentation/arch/x86/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ x86-specific Documentation
2525
shstk
2626
iommu
2727
intel_txt
28+
amd-debugging
2829
amd-memory-encryption
2930
amd_hsmp
3031
tdx

Documentation/arch/x86/resume.svg

Lines changed: 4 additions & 0 deletions
Loading

Documentation/arch/x86/suspend.svg

Lines changed: 4 additions & 0 deletions
Loading

arch/x86/include/asm/amd/fch.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _ASM_X86_AMD_FCH_H_
3+
#define _ASM_X86_AMD_FCH_H_
4+
5+
#define FCH_PM_BASE 0xFED80300
6+
7+
/* Register offsets from PM base: */
8+
#define FCH_PM_DECODEEN 0x00
9+
#define FCH_PM_DECODEEN_SMBUS0SEL GENMASK(20, 19)
10+
#define FCH_PM_SCRATCH 0x80
11+
#define FCH_PM_S5_RESET_STATUS 0xC0
12+
13+
#endif /* _ASM_X86_AMD_FCH_H_ */

arch/x86/kernel/cpu/amd.c

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <linux/sched/clock.h>
1010
#include <linux/random.h>
1111
#include <linux/topology.h>
12+
#include <asm/amd/fch.h>
1213
#include <asm/processor.h>
1314
#include <asm/apic.h>
1415
#include <asm/cacheinfo.h>
@@ -1238,3 +1239,56 @@ void amd_check_microcode(void)
12381239
if (cpu_feature_enabled(X86_FEATURE_ZEN2))
12391240
on_each_cpu(zenbleed_check_cpu, NULL, 1);
12401241
}
1242+
1243+
static const char * const s5_reset_reason_txt[] = {
1244+
[0] = "thermal pin BP_THERMTRIP_L was tripped",
1245+
[1] = "power button was pressed for 4 seconds",
1246+
[2] = "shutdown pin was tripped",
1247+
[4] = "remote ASF power off command was received",
1248+
[9] = "internal CPU thermal limit was tripped",
1249+
[16] = "system reset pin BP_SYS_RST_L was tripped",
1250+
[17] = "software issued PCI reset",
1251+
[18] = "software wrote 0x4 to reset control register 0xCF9",
1252+
[19] = "software wrote 0x6 to reset control register 0xCF9",
1253+
[20] = "software wrote 0xE to reset control register 0xCF9",
1254+
[21] = "ACPI power state transition occurred",
1255+
[22] = "keyboard reset pin KB_RST_L was tripped",
1256+
[23] = "internal CPU shutdown event occurred",
1257+
[24] = "system failed to boot before failed boot timer expired",
1258+
[25] = "hardware watchdog timer expired",
1259+
[26] = "remote ASF reset command was received",
1260+
[27] = "an uncorrected error caused a data fabric sync flood event",
1261+
[29] = "FCH and MP1 failed warm reset handshake",
1262+
[30] = "a parity error occurred",
1263+
[31] = "a software sync flood event occurred",
1264+
};
1265+
1266+
static __init int print_s5_reset_status_mmio(void)
1267+
{
1268+
unsigned long value;
1269+
void __iomem *addr;
1270+
int i;
1271+
1272+
if (!cpu_feature_enabled(X86_FEATURE_ZEN))
1273+
return 0;
1274+
1275+
addr = ioremap(FCH_PM_BASE + FCH_PM_S5_RESET_STATUS, sizeof(value));
1276+
if (!addr)
1277+
return 0;
1278+
1279+
value = ioread32(addr);
1280+
iounmap(addr);
1281+
1282+
for (i = 0; i < ARRAY_SIZE(s5_reset_reason_txt); i++) {
1283+
if (!(value & BIT(i)))
1284+
continue;
1285+
1286+
if (s5_reset_reason_txt[i]) {
1287+
pr_info("x86/amd: Previous system reset reason [0x%08lx]: %s\n",
1288+
value, s5_reset_reason_txt[i]);
1289+
}
1290+
}
1291+
1292+
return 0;
1293+
}
1294+
late_initcall(print_s5_reset_status_mmio);

drivers/i2c/busses/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ config I2C_ISMT
200200

201201
config I2C_PIIX4
202202
tristate "Intel PIIX4 and compatible (ATI/AMD/Serverworks/Broadcom/SMSC)"
203-
depends on PCI && HAS_IOPORT
203+
depends on PCI && HAS_IOPORT && X86
204204
select I2C_SMBUS
205205
help
206206
If you say yes to this option, support will be included for the Intel

drivers/i2c/busses/i2c-piix4.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <linux/dmi.h>
3535
#include <linux/acpi.h>
3636
#include <linux/io.h>
37+
#include <asm/amd/fch.h>
3738

3839
#include "i2c-piix4.h"
3940

@@ -80,12 +81,11 @@
8081
#define SB800_PIIX4_PORT_IDX_MASK 0x06
8182
#define SB800_PIIX4_PORT_IDX_SHIFT 1
8283

83-
/* On kerncz and Hudson2, SmBus0Sel is at bit 20:19 of PMx00 DecodeEn */
84-
#define SB800_PIIX4_PORT_IDX_KERNCZ 0x02
85-
#define SB800_PIIX4_PORT_IDX_MASK_KERNCZ 0x18
84+
/* SmBus0Sel is at bit 20:19 of PMx00 DecodeEn */
85+
#define SB800_PIIX4_PORT_IDX_KERNCZ (FCH_PM_DECODEEN + 0x02)
86+
#define SB800_PIIX4_PORT_IDX_MASK_KERNCZ (FCH_PM_DECODEEN_SMBUS0SEL >> 16)
8687
#define SB800_PIIX4_PORT_IDX_SHIFT_KERNCZ 3
8788

88-
#define SB800_PIIX4_FCH_PM_ADDR 0xFED80300
8989
#define SB800_PIIX4_FCH_PM_SIZE 8
9090
#define SB800_ASF_ACPI_PATH "\\_SB.ASFC"
9191

@@ -162,19 +162,19 @@ int piix4_sb800_region_request(struct device *dev, struct sb800_mmio_cfg *mmio_c
162162
if (mmio_cfg->use_mmio) {
163163
void __iomem *addr;
164164

165-
if (!request_mem_region_muxed(SB800_PIIX4_FCH_PM_ADDR,
165+
if (!request_mem_region_muxed(FCH_PM_BASE,
166166
SB800_PIIX4_FCH_PM_SIZE,
167167
"sb800_piix4_smb")) {
168168
dev_err(dev,
169169
"SMBus base address memory region 0x%x already in use.\n",
170-
SB800_PIIX4_FCH_PM_ADDR);
170+
FCH_PM_BASE);
171171
return -EBUSY;
172172
}
173173

174-
addr = ioremap(SB800_PIIX4_FCH_PM_ADDR,
174+
addr = ioremap(FCH_PM_BASE,
175175
SB800_PIIX4_FCH_PM_SIZE);
176176
if (!addr) {
177-
release_mem_region(SB800_PIIX4_FCH_PM_ADDR,
177+
release_mem_region(FCH_PM_BASE,
178178
SB800_PIIX4_FCH_PM_SIZE);
179179
dev_err(dev, "SMBus base address mapping failed.\n");
180180
return -ENOMEM;
@@ -201,7 +201,7 @@ void piix4_sb800_region_release(struct device *dev, struct sb800_mmio_cfg *mmio_
201201
{
202202
if (mmio_cfg->use_mmio) {
203203
iounmap(mmio_cfg->addr);
204-
release_mem_region(SB800_PIIX4_FCH_PM_ADDR,
204+
release_mem_region(FCH_PM_BASE,
205205
SB800_PIIX4_FCH_PM_SIZE);
206206
return;
207207
}

drivers/platform/x86/amd/pmc/pmc-quirks.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/dmi.h>
1212
#include <linux/io.h>
1313
#include <linux/ioport.h>
14+
#include <asm/amd/fch.h>
1415

1516
#include "pmc.h"
1617

@@ -20,7 +21,7 @@ struct quirk_entry {
2021
};
2122

2223
static struct quirk_entry quirk_s2idle_bug = {
23-
.s2idle_bug_mmio = 0xfed80380,
24+
.s2idle_bug_mmio = FCH_PM_BASE + FCH_PM_SCRATCH,
2425
};
2526

2627
static struct quirk_entry quirk_spurious_8042 = {

0 commit comments

Comments
 (0)