[6.6] Add support for Hygon family 18h model 18h#1629
[6.6] Add support for Hygon family 18h model 18h#1629opsiff merged 11 commits intodeepin-community:linux-6.6.yfrom
Conversation
commit 41369fd13d4c2193c8ecb92a8072b705e38aabac anolis ANBZ: #30343 Replaces a chain of if-else statements with a switch statement for handling Hygon family 18h models processors. Hygon-SIG: commit none hygon anolis: EDAC/amd64: Convert Hygon family 18h model checks to switch-case Hygon-SIG: commit 41369fd13d4c anolis anolis: EDAC/amd64: Convert Hygon family 18h model checks to switch-case Backport from anolis to support Hygon family 18h model 18h Signed-off-by: Liao Xuan <liaoxuan@hygon.cn> Cc: hygon-arch@list.openanolis.cn Reviewed-by: Xiaochen Shen <shenxiaochen@hygon.cn> Reviewed-by: Ruidong Tian <tianruidong@linux.alibaba.com> Reviewed-by: Guixin Liu <kanie@linux.alibaba.com> Link: https://gitee.com/anolis/cloud-kernel/pulls/6454 [ YuntongJin : amend commit log ] Signed-off-by: YuntongJin <jinyuntong@hygon.cn>
commit eb162a81e5007122e42bab182a9807dbe34fc029 anolis. ANBZ: #30343 Add Hygon family 18h model 18h processor support for amd64_edac. For Hygon family 18h model 0x18h-0x1fh processors, the UMC base are identical, so modify them uniformly. Meanwhile, code for Hygon UMC base calculations has been moved to a dedicated function. Hygon-SIG: commit none hygon anolis: EDAC/amd64: Add support for Hygon family 18h model 18h Hygon-SIG: commit eb162a81e500 anolis anolis: EDAC/amd64: Add support for Hygon family 18h model 18h Backport from anolis to support Hygon family 18h model 18h Signed-off-by: Liao Xuan <liaoxuan@hygon.cn> Cc: hygon-arch@list.openanolis.cn Reviewed-by: Xiaochen Shen <shenxiaochen@hygon.cn> Reviewed-by: Ruidong Tian <tianruidong@linux.alibaba.com> Reviewed-by: Guixin Liu <kanie@linux.alibaba.com> Link: https://gitee.com/anolis/cloud-kernel/pulls/6454 [ YuntongJin : amend commit log, fix conflict ] Signed-off-by: YuntongJin <jinyuntong@hygon.cn>
…to 1 for Hygon family 18h model 18h commit 301061b5a9bf685af46b38f3ec512ae690d22f9e anolis. ANBZ: #31970 Adjust max_mcs for Hygon Family 18h Model 18h processors to reflect the correct number of memory controllers per node. Set to 1 as this CPU model hasa single memory controller per node. Hygon-SIG: commit none hygon anolis: EDAC/amd64: Adjust the maximum number of memory controllers per node to 1 for Hygon family 18h model 18h Hygon-SIG: commit 301061b5a9bf anolis anolis: EDAC/amd64: Adjust the maximum number of memory controllers per node to 1 for Hygon family 18h model 18h Backport from anolis to support Hygon family 18h model 18h Signed-off-by: Liao Xuan <liaoxuan@hygon.cn> Cc: hygon-arch@list.openanolis.cn Reviewed-by: Xiaochen Shen <shenxiaochen@hygon.cn> Reviewed-by: Yuanhe Shu <xiangzao@linux.alibaba.com> Reviewed-by: Ruidong Tian <tianruidong@linux.alibaba.com> Reviewed-by: Shuai Xue <xueshuai@linux.alibaba.com> Link: https://gitee.com/anolis/cloud-kernel/pulls/6671 [ YuntongJin : amend commit log,fix conflict ] Signed-off-by: YuntongJin <jinyuntong@hygon.cn>
commit f8f6147fddc76fe44c4ca6a82241b5772afc0860 anolis. ANBZ: #30096 Add the new PCI ID 0x1d94 0x2007 for Hygon family 18h model 18h HDA controller. Hygon-SIG: commit none hygon anolis: ALSA: hda: Add support for Hygon family 18h model 18h HD-Audio Hygon-SIG: commit f8f6147fddc7 anolis anolis: ALSA: hda: Add support for Hygon family 18h model 18h HD-Audio Backport from anolis to support Hygon family 18h model 18h Signed-off-by: Liao Xuan <liaoxuan@hygon.cn> Cc: hygon-arch@list.openanolis.cn Reviewed-by Xiaochen Shen <shenxiaochen@hygon.cn> Reviewed-by Guixin Liu <kanie@linux.alibaba.com> Reviewed-by: Xunlei Pang <xlpang@linux.alibaba.com> Link: https://gitee.com/anolis/cloud-kernel/pulls/6459 [ YuntongJin : amend commit log and add PCI_DEVICE_ID_HYGON_18H_M18H_HDA in pci_ids.h ] Signed-off-by: YuntongJin <jinyuntong@hygon.cn>
commit 903e3d7834e2c901fe6371d79d45493c9ca23f9a anolis. ANBZ: #30093 Add the PCI device IDs for Hygon family 18h model 18h processors. Hygon-SIG: commit none hygon anolis: x86/amd_nb: Add Hygon family 18h model 18h PCI IDs Hygon-SIG: commit 903e3d7834e2 anolis anolis: x86/amd_nb: Add Hygon family 18h model 18h PCI IDs Backport from anolis to support Hygon family 18h model 18h Signed-off-by: Liao Xuan <liaoxuan@hygon.cn> Cc: hygon-arch@list.openanolis.cn Reviewed-by Guixin Liu <kanie@linux.alibaba.com> Link: https://gitee.com/anolis/cloud-kernel/pulls/6456 [ YuntongJin : amend commit log ] Signed-off-by: YuntongJin <jinyuntong@hygon.cn>
commit 017d6e72deb966de1cbc6b608f1386a07f26ae2d anolis. ANBZ: #30094 Add 18H_M18H DF F3 device ID to get the temperature for Hygon family 18h model 18h processor. Hygon-SIG: commit none hygon anolis: hwmon/k10temp: Add support for Hygon family 18h model 18h Hygon-SIG: commit 017d6e72deb9 anolis anolis: hwmon/k10temp: Add support for Hygon family 18h model 18h Backport from anolis to support Hygon family 18h model 18h Signed-off-by: Liao Xuan <liaoxuan@hygon.cn> Cc: hygon-arch@list.openanolis.cn Reviewed-by Guixin Liu <kanie@linux.alibaba.com> Reviewed-by Xiaochen Shen <shenxiaochen@hygon.cn> Link: https://gitee.com/anolis/cloud-kernel/pulls/6457 [ YuntongJin: amend commit log ] Signed-off-by: YuntongJin <jinyuntong@hygon.cn>
commit ec8b426005d02f1cff53e599d9a5aa1f7a85f920 anolis. ANBZ: #30095 The SB IOAPIC for Hygon family 18h model 18h processors is also on the device 0xb. Hygon-SIG: commit none hygon anolis: iommu/hygon: Add support for Hygon family 18h model 18h IOAPIC Hygon-SIG: commit ec8b426005d0 anolis anolis: iommu/hygon: Add support for Hygon family 18h model 18h IOAPIC Backport from anolis to support Hygon family 18h model 18h Signed-off-by: Liao Xuan <liaoxuan@hygon.cn> Cc: hygon-arch@list.openanolis.cn Reviewed-by Guixin Liu <kanie@linux.alibaba.com> Link: https://gitee.com/anolis/cloud-kernel/pulls/6458 [ YuntongJin : amend commit log ] Signed-off-by: YuntongJin <jinyuntong@hygon.cn>
commit 42c9284c729ea71b3d363c8c4160b796b738c9f7 anolis. ANBZ: #30151 Add HID HYGO0040 to support Hygon eMMC controller. Hygon-SIG: commit none hygon anolis: mmc: sdhci-acpi: Add device HID for Hygon eMMC controller Hygon-SIG: commit 42c9284c729e anolis anolis: mmc: sdhci-acpi: Add device HID for Hygon eMMC controller Backport from anolis to support Hygon family 18h model 18h Signed-off-by: Liao Xuan <liaoxuan@hygon.cn> Cc: hygon-arch@list.openanolis.cn Reviewed-by Guixin Liu <kanie@linux.alibaba.com> Link: https://gitee.com/anolis/cloud-kernel/pulls/6462 [ YuntongJin : amend commit log,fix conflict ] Signed-off-by: YuntongJin <jinyuntong@hygon.cn>
commit 40cf687b108d607faea96aa28265a77d7b9aa38a anolis. ANBZ: #30151 Add PCI ID for Hygon SD controller. Hygon-SIG: commit none hygon anolis: mmc: sdhci-pci: Add support for Hygon SD controller Hygon-SIG: commit 40cf687b108d anolis anolis: mmc: sdhci-pci: Add support for Hygon SD controller Backport from anolis to support Hygon family 18h model 18h Signed-off-by: Liao Xuan <liaoxuan@hygon.cn> Cc: hygon-arch@list.openanolis.cn Reviewed-by Guixin Liu <kanie@linux.alibaba.com> Link: https://gitee.com/anolis/cloud-kernel/pulls/6465 [ YuntongJin: amend commit log and fix conflict ] Signed-off-by: YuntongJin <jinyuntong@hygon.cn>
commit 4bf4507e1cf3c59031c12d2b7c5e93043dd11c69 anolis. ANBZ: #30152 Add HID HYGO0062 to support Hygon SPI controller. Hygon-SIG: commit none hygon anolis: spi: dw: Add device HID for Hygon SPI controller Hygon-SIG: commit 4bf4507e1cf3 anolis anolis: spi: dw: Add device HID for Hygon SPI controller Backport from anolis to support Hygon family 18h model 18h Signed-off-by: Liao Xuan <liaoxuan@hygon.cn> Cc: hygon-arch@list.openanolis.cn Reviewed-by Guixin Liu <kanie@linux.alibaba.com> Link: https://gitee.com/anolis/cloud-kernel/pulls/6463 [ YuntongJin : amend commit log, fix conflict ] Signed-off-by: YuntongJin <jinyuntong@hygon.cn>
commit dbab1265fda0034466e3d7b1d7c4e1877fbf84d2 anolis. ANBZ: #30150 Adjust the DF PMU event and umask for Hygon family 18h model 18h processor. Hygon-SIG: commit none hygon anolis: perf/x86/uncore: Add DF PMU support for Hygon family 18h model 18h Hygon-SIG: commit dbab1265fda0 anolis anolis: perf/x86/uncore: Add DF PMU support for Hygon family 18h model 18h Backport from anolis to support Hygon family 18h model 18h Signed-off-by: Liao Xuan <liaoxuan@hygon.cn> Cc: hygon-arch@list.openanolis.cn Reviewed-by Guixin Liu <kanie@linux.alibaba.com> Link: https://gitee.com/anolis/cloud-kernel/pulls/6464 [ YuntongJin: amend commit log, fix conflict ] Signed-off-by: YuntongJin <jinyuntong@hygon.cn>
Reviewer's GuideAdds Hygon family 18h model 0x18 support across EDAC, uncore perf, Northbridge, IOMMU, MMC/SDHCI, HDA audio, hwmon k10temp, PCI IDs, and SPI drivers, refactoring Hygon UMC base handling and wiring in new PCI/ACPI IDs so the new CPU/model is correctly detected and configured. Sequence diagram for PCI-based driver initialization on Hygon F18h M18hsequenceDiagram
actor Firmware
participant PCI_Core
participant amd_nb as amd_nb_driver
participant hda as hda_intel_driver
participant hwmon as k10temp_driver
participant sdhci_pci as sdhci_pci_core_driver
Firmware->>PCI_Core: Enumerate PCI bus
PCI_Core->>amd_nb: Probe HYGON_18H_M18H_ROOT
amd_nb-->>PCI_Core: Device matched (hygon_root_ids)
PCI_Core->>amd_nb: Probe HYGON_18H_M18H_DF_F4
amd_nb-->>PCI_Core: Device matched (hygon_nb_link_ids)
PCI_Core->>hwmon: Probe HYGON_18H_M18H_DF_F3
hwmon-->>PCI_Core: Device matched (k10temp_id_table)
PCI_Core->>hda: Probe HYGON_18H_M18H_HDA
hda-->>PCI_Core: Device matched (azx_ids)
PCI_Core->>sdhci_pci: Probe HYGON SYSTEM_SDHCI class
sdhci_pci-->>PCI_Core: Device matched (pci_ids)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
hygon_get_umc_base()the new block uses space-based indentation instead of tabs, which is inconsistent with the surrounding kernel coding style and should be adjusted. - The new Hygon HDA entry in
azx_idsusesPCI_DEVICEwhile the neighboring Hygon entries usePCI_VDEVICE(HYGON, ...); consider switching toPCI_VDEVICEfor consistency with the rest of the table.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `hygon_get_umc_base()` the new block uses space-based indentation instead of tabs, which is inconsistent with the surrounding kernel coding style and should be adjusted.
- The new Hygon HDA entry in `azx_ids` uses `PCI_DEVICE` while the neighboring Hygon entries use `PCI_VDEVICE(HYGON, ...)`; consider switching to `PCI_VDEVICE` for consistency with the rest of the table.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Pull request overview
Adds kernel device- and model-specific handling so Hygon family 0x18 model 0x18 systems bind the right drivers and use correct per-model register/MMIO layouts (EDAC UMC base selection, uncore perf formats, IOAPIC/IOMMU quirks, and PCI/ACPI IDs).
Changes:
- Extend multiple PCI/ACPI match tables to recognize Hygon F18h M18h devices (HDA, SDHCI, SPI, hwmon).
- Update AMD IOMMU IOAPIC detection logic to include Hygon model 0x18.
- Refine AMD64 EDAC Hygon UMC base selection and add per-model naming for F18h M18h; broaden Hygon uncore format selection to include model 0x18.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| sound/pci/hda/hda_intel.c | Add PCI ID match for Hygon F18h M18h HD-audio controller. |
| include/linux/pci_ids.h | Introduce new Hygon PCI device IDs for M18h (HDA + DF F3). |
| drivers/spi/spi-dw-mmio.c | Add ACPI HID to bind DW SPI MMIO to Hygon platforms. |
| drivers/mmc/host/sdhci-pci-core.c | Add Hygon vendor-class match for SDHCI using existing AMD handler. |
| drivers/mmc/host/sdhci-acpi.c | Add Hygon ACPI HID to reuse AMD eMMC slot handling. |
| drivers/iommu/amd/init.c | Extend Hygon model range for SB IOAPIC detection. |
| drivers/hwmon/k10temp.c | Add DF F3 PCI ID match for Hygon F18h M18h temperature driver binding. |
| drivers/edac/amd64_edac.c | Add Hygon UMC base selection helper for newer models; add F18h M18h per-model EDAC naming. |
| arch/x86/kernel/amd_nb.c | Add northbridge/root/DF IDs for Hygon F18h M18h enumeration. |
| arch/x86/events/amd/uncore.c | Extend Hygon F18h uncore DF umask format selection to include model 0x18. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #define PCI_DEVICE_ID_HYGON_18H_M05H_ROOT 0x14a0 | ||
| #define PCI_DEVICE_ID_HYGON_18H_M10H_ROOT 0x14c0 | ||
| #define PCI_DEVICE_ID_HYGON_18H_M18H_ROOT 0x2000 | ||
| #define PCI_DEVICE_ID_HYGON_18H_M04H_DF_F1 0x1491 | ||
| #define PCI_DEVICE_ID_HYGON_18H_M05H_DF_F1 0x14b1 | ||
| #define PCI_DEVICE_ID_HYGON_18H_M05H_DF_F4 0x14b4 | ||
| #define PCI_DEVICE_ID_HYGON_18H_M10H_DF_F4 0x14d4 | ||
| #define PCI_DEVICE_ID_HYGON_18H_M18H_DF_F4 0x2014 | ||
| #define PCI_DEVICE_ID_HYGON_18H_M06H_DF_F5 0x14b5 |
There was a problem hiding this comment.
These new #define lines introduce stray whitespace before the tab/value alignment (visible trailing spaces). Please align with surrounding defines using a single tab after the macro name and avoid trailing spaces so checkpatch/style tools don't flag it.
| (boot_cpu_data.x86_vendor == X86_VENDOR_HYGON && | ||
| boot_cpu_data.x86 == 0x18 && | ||
| boot_cpu_data.x86_model >= 0x4 && | ||
| boot_cpu_data.x86_model <= 0x10 && | ||
| boot_cpu_data.x86_model <= 0x18 && | ||
| devid == IOAPIC_SB_DEVID_FAM18H_M4H)) { |
There was a problem hiding this comment.
The condition now applies the IOAPIC_SB_DEVID_FAM18H_M4H workaround up to model 0x18, but the surrounding comment/identifier still says it's specific to model 4h. Please update the comment (and/or the constant name) so the code and documentation match the broadened model range.
| u32 umc_base; | ||
|
|
||
| if (hygon_f18h_m4h()) | ||
| umc_base = get_umc_base_f18h_m4h(pvt->mc_node_id, channel); | ||
| /* | ||
| * For Hygon family 18h model 0x18h-0x1fh processors, the UMC base | ||
| * are identical. | ||
| */ | ||
| else if (hygon_f18h_m10h() && boot_cpu_data.x86_model >= 0x18) | ||
| umc_base = get_umc_base_f18h_m18h(channel); | ||
| else | ||
| umc_base = get_umc_base(channel); | ||
|
|
||
| return umc_base; |
There was a problem hiding this comment.
New hygon_get_umc_base() block uses space indentation instead of kernel-style tabs, and the comment has grammar issues ("UMC base are"). Also, the new Hygon UMC base selection is only wired into umc_read_base_mask()/umc_read_mc_regs(); umc_dump_misc_regs() still uses the old m4h-only special case and would read wrong registers on F18h M18h (and any other Hygon models that need a non-default base). Consider switching umc_dump_misc_regs() to use the same helper so all UMC register reads stay consistent.
| u32 umc_base; | |
| if (hygon_f18h_m4h()) | |
| umc_base = get_umc_base_f18h_m4h(pvt->mc_node_id, channel); | |
| /* | |
| * For Hygon family 18h model 0x18h-0x1fh processors, the UMC base | |
| * are identical. | |
| */ | |
| else if (hygon_f18h_m10h() && boot_cpu_data.x86_model >= 0x18) | |
| umc_base = get_umc_base_f18h_m18h(channel); | |
| else | |
| umc_base = get_umc_base(channel); | |
| return umc_base; | |
| if (hygon_f18h_m4h()) | |
| return get_umc_base_f18h_m4h(pvt->mc_node_id, channel); | |
| /* | |
| * For Hygon family 18h model 0x18-0x1f processors, the UMC base | |
| * addresses are identical. | |
| */ | |
| if (hygon_f18h_m10h() && boot_cpu_data.x86_model >= 0x18) | |
| return get_umc_base_f18h_m18h(channel); | |
| return get_umc_base(channel); |
Link: https://gitcode.com/deepin-community/kernel/pull/15
Summary by Sourcery
Add kernel support for Hygon family 18h model 0x18 processors across memory controller, uncore, IOMMU, MMC/SD, audio, thermal, SPI, and PCI ID handling.
New Features:
Enhancements: