]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
hwmon: (peci/dimmtemp) add Intel Emerald Rapids platform support
authorIvan Mikhaylov <fr0st61te@gmail.com>
Mon, 6 Oct 2025 21:53:20 +0000 (00:53 +0300)
committerGuenter Roeck <linux@roeck-us.net>
Wed, 15 Oct 2025 18:02:42 +0000 (11:02 -0700)
Extend the functionality of hwmon (peci/dimmtemp) for Emerald Rapids
platform.

The patch has been tested on a 5S system with 16 DIMMs installed.
Verified read of DIMM temperature thresholds & temperature.

Using Sapphire's callbacks about getting thresholds because it's same
platform/socket.

Signed-off-by: Ivan Mikhaylov <fr0st61te@gmail.com>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Link: https://lore.kernel.org/r/20251006215321.5036-3-fr0st61te@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/peci/dimmtemp.c

index fbe82d9852e0178f7fdc29242cd8d15fc9b73135..a281476c7a31f211b1838f2a92dd6bd660f7f337 100644 (file)
@@ -32,6 +32,8 @@
 #define DIMM_IDX_MAX_ON_ICXD   2
 #define CHAN_RANK_MAX_ON_SPR   8
 #define DIMM_IDX_MAX_ON_SPR    2
+#define CHAN_RANK_MAX_ON_EMR   8
+#define DIMM_IDX_MAX_ON_EMR    2
 
 #define CHAN_RANK_MAX          CHAN_RANK_MAX_ON_HSX
 #define DIMM_IDX_MAX           DIMM_IDX_MAX_ON_HSX
@@ -571,6 +573,12 @@ read_thresholds_spr(struct peci_dimmtemp *priv, int dimm_order, int chan_rank, u
        return 0;
 }
 
+static int read_thresholds_emr(struct peci_dimmtemp *priv, int dimm_order,
+                              int chan_rank, u32 *data)
+{
+       return read_thresholds_spr(priv, dimm_order, chan_rank, data);
+}
+
 static const struct dimm_info dimm_hsx = {
        .chan_rank_max  = CHAN_RANK_MAX_ON_HSX,
        .dimm_idx_max   = DIMM_IDX_MAX_ON_HSX,
@@ -620,6 +628,13 @@ static const struct dimm_info dimm_spr = {
        .read_thresholds = &read_thresholds_spr,
 };
 
+static const struct dimm_info dimm_emr = {
+       .chan_rank_max  = CHAN_RANK_MAX_ON_EMR,
+       .dimm_idx_max  = DIMM_IDX_MAX_ON_EMR,
+       .min_peci_revision = 0x40,
+       .read_thresholds = &read_thresholds_emr,
+};
+
 static const struct auxiliary_device_id peci_dimmtemp_ids[] = {
        {
                .name = "peci_cpu.dimmtemp.hsx",
@@ -649,6 +664,10 @@ static const struct auxiliary_device_id peci_dimmtemp_ids[] = {
                .name = "peci_cpu.dimmtemp.spr",
                .driver_data = (kernel_ulong_t)&dimm_spr,
        },
+       {
+               .name = "peci_cpu.dimmtemp.emr",
+               .driver_data = (kernel_ulong_t)&dimm_emr,
+       },
        { }
 };
 MODULE_DEVICE_TABLE(auxiliary, peci_dimmtemp_ids);