From ffe6d597d9e3d4407cf8062b5d6505a80ce08f41 Mon Sep 17 00:00:00 2001 From: "Jason M. Bills" Date: Tue, 28 Sep 2021 12:04:51 -0700 Subject: Update to internal 0.75 Signed-off-by: Jason M. Bills --- .../linux-aspeed/0005-128MB-flashmap-for-PFR.patch | 45 ----- ...05-Die_CPU-filter-first-zero-from-GetTemp.patch | 61 ++++++ ...CPU-filter-first-zero-from-RdPkgConfig-10.patch | 66 +++++++ ...p-filter-the-first-zero-from-RdPkgConfig-.patch | 70 +++++++ ...-vegman-kernel-add-RTC-driver-for-PCHC620.patch | 205 +++++++++++++++++++++ ...-rtc-pch-node-into-aspeed-bmc-intel-ast2x.patch | 49 +++++ .../linux-aspeed/1000-128MB-flashmap-for-PFR.patch | 45 +++++ ...03-Die_CPU-filter-first-zero-from-GetTemp.patch | 60 ------ ...CPU-filter-first-zero-from-RdPkgConfig-10.patch | 64 ------- .../recipes-kernel/linux/linux-aspeed/intel.cfg | 5 +- .../recipes-kernel/linux/linux-aspeed_%.bbappend | 17 +- 11 files changed, 510 insertions(+), 177 deletions(-) delete mode 100755 meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0005-128MB-flashmap-for-PFR.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0005-Die_CPU-filter-first-zero-from-GetTemp.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0006-DTS_CPU-filter-first-zero-from-RdPkgConfig-10.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0007-peci-cputemp-filter-the-first-zero-from-RdPkgConfig-.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0008-vegman-kernel-add-RTC-driver-for-PCHC620.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0009-ARM-dts-add-rtc-pch-node-into-aspeed-bmc-intel-ast2x.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/1000-128MB-flashmap-for-PFR.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/1003-Die_CPU-filter-first-zero-from-GetTemp.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/1004-DTS_CPU-filter-first-zero-from-RdPkgConfig-10.patch (limited to 'meta-openbmc-mods/meta-common/recipes-kernel') diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0005-128MB-flashmap-for-PFR.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0005-128MB-flashmap-for-PFR.patch deleted file mode 100755 index 7dd9990a9..000000000 --- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0005-128MB-flashmap-for-PFR.patch +++ /dev/null @@ -1,45 +0,0 @@ -From ca0fa975d066b15637188e8fe37dd6d12e0e2bc4 Mon Sep 17 00:00:00 2001 -From: Kuiying Wang -Date: Tue, 28 Apr 2020 22:32:41 +0800 -Subject: [PATCH] Selecting 128MB for PFR - -PFR platforms requires 128MB flash mapping. -This will override the existing 64MB flash map -and loads 128MB flash map. - -Signed-off-by: Vikram Bodireddy -Signed-off-by: Kuiying Wang ---- - arch/arm/boot/dts/aspeed-bmc-intel-ast2500.dts | 2 +- - arch/arm/boot/dts/aspeed-bmc-intel-ast2600.dts | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/arch/arm/boot/dts/aspeed-bmc-intel-ast2500.dts b/arch/arm/boot/dts/aspeed-bmc-intel-ast2500.dts -index 13b94bdf5d62..2cab5fb38d4f 100644 ---- a/arch/arm/boot/dts/aspeed-bmc-intel-ast2500.dts -+++ b/arch/arm/boot/dts/aspeed-bmc-intel-ast2500.dts -@@ -96,7 +96,7 @@ - flash@0 { - status = "okay"; - m25p,fast-read; --#include "openbmc-flash-layout-intel-64MB.dtsi" -+#include "openbmc-flash-layout-intel-128MB.dtsi" - }; - }; - -diff --git a/arch/arm/boot/dts/aspeed-bmc-intel-ast2600.dts b/arch/arm/boot/dts/aspeed-bmc-intel-ast2600.dts -index a95b5ac828b3..bf66e1b6c0fd 100644 ---- a/arch/arm/boot/dts/aspeed-bmc-intel-ast2600.dts -+++ b/arch/arm/boot/dts/aspeed-bmc-intel-ast2600.dts -@@ -94,7 +94,7 @@ - spi-max-frequency = <40000000>; - spi-tx-bus-width = <4>; - m25p,fast-read; --#include "openbmc-flash-layout-intel-64MB.dtsi" -+#include "openbmc-flash-layout-intel-128MB.dtsi" - }; - }; - --- -2.17.1 - diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0005-Die_CPU-filter-first-zero-from-GetTemp.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0005-Die_CPU-filter-first-zero-from-GetTemp.patch new file mode 100644 index 000000000..54dced64f --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0005-Die_CPU-filter-first-zero-from-GetTemp.patch @@ -0,0 +1,61 @@ +From b0740cbafa468ece35d26a797e7cf80f04fb5102 Mon Sep 17 00:00:00 2001 +From: Zhikui Ren +Date: Mon, 11 Jan 2021 16:31:36 -0800 +Subject: [PATCH] Die_CPU: filter first zero from GetTemp + +Peci command GetTemp can return 0 during CPU reset. +It does not have a have completion code either. +Discard the first zero reading and return -ENODATA. +Consecutive zeros will be returned so that real hot +condition will still be detected and logged but possibly delayed +by the sensor polling period, which is normally 500ms-1s. + +Signed-off-by: Zhikui Ren +--- + drivers/hwmon/peci-cputemp.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/drivers/hwmon/peci-cputemp.c b/drivers/hwmon/peci-cputemp.c +index c5d92d1d2c25..49670bc80530 100644 +--- a/drivers/hwmon/peci-cputemp.c ++++ b/drivers/hwmon/peci-cputemp.c +@@ -15,6 +15,7 @@ + + struct temp_group { + struct peci_sensor_data die; ++ u32 die_raw_prev; + struct peci_sensor_data dts; + struct peci_sensor_data tcontrol; + struct peci_sensor_data tthrottle; +@@ -119,6 +120,7 @@ static int get_die_temp(struct peci_cputemp *priv) + { + struct peci_get_temp_msg msg; + int ret; ++ bool discard = false; + + if (!peci_sensor_need_update(&priv->temp.die)) + return 0; +@@ -129,6 +131,20 @@ static int get_die_temp(struct peci_cputemp *priv) + if (ret) + return ret; + ++ /* ++ * GET_TEMP command does not have cc and can return zero during ++ * cpu reset. Treat the first zero reading as data not available. ++ * Consecutive zeros will be returned so true hot condition ++ * is not be missed. ++ */ ++ if (msg.temp_raw == 0 && priv->temp.die_raw_prev != 0) { ++ dev_err(priv->dev, "discard first 0 reading from GetTemp\n"); ++ discard = true; ++ } ++ priv->temp.die_raw_prev = msg.temp_raw; ++ if (discard) ++ return -ENODATA; ++ + /* Note that the tjmax should be available before calling it */ + priv->temp.die.value = priv->temp.tjmax.value + + (msg.temp_raw * 1000 / 64); +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0006-DTS_CPU-filter-first-zero-from-RdPkgConfig-10.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0006-DTS_CPU-filter-first-zero-from-RdPkgConfig-10.patch new file mode 100644 index 000000000..a498f9c19 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0006-DTS_CPU-filter-first-zero-from-RdPkgConfig-10.patch @@ -0,0 +1,66 @@ +From 4d4e68e0eed7ccf899bc1b3799a93ed8eb44270d Mon Sep 17 00:00:00 2001 +From: Zhikui Ren +Date: Tue, 2 Feb 2021 14:49:28 -0800 +Subject: [PATCH] DTS_CPU: filter first zero from RdPkgConfig 10 + +Peci command GetPkgConfig 10 can return 0 (hot) with cc 0x40 +after cpu reset. Once pcode run time image is loaded +and it returns 0x8000 as DTS margin data not ready +Discard the first zero reading and return -ENODATA. +Consecutive zeros will be returned so that real hot +condition will still be detected and logged but possibly delayed +by the sensor polling period, which is normally one second. + +Signed-off-by: Zhikui Ren +--- + drivers/hwmon/peci-cputemp.c | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/drivers/hwmon/peci-cputemp.c b/drivers/hwmon/peci-cputemp.c +index 49670bc80530..af1c09741120 100644 +--- a/drivers/hwmon/peci-cputemp.c ++++ b/drivers/hwmon/peci-cputemp.c +@@ -17,6 +17,7 @@ struct temp_group { + struct peci_sensor_data die; + u32 die_raw_prev; + struct peci_sensor_data dts; ++ u32 dts_raw_prev; + struct peci_sensor_data tcontrol; + struct peci_sensor_data tthrottle; + struct peci_sensor_data tjmax; +@@ -159,6 +160,7 @@ static int get_dts(struct peci_cputemp *priv) + s32 dts_margin; + u8 pkg_cfg[4]; + int ret; ++ bool discard = false; + + if (!peci_sensor_need_update(&priv->temp.dts)) + return 0; +@@ -172,6 +174,24 @@ static int get_dts(struct peci_cputemp *priv) + + dts_margin = le16_to_cpup((__le16 *)pkg_cfg); + ++ /* ++ * There is a small window (500us) for read dts_margin (RdPkgConfig 10) ++ * to return cc 0x40, and dts_margin of 0 after cpu reset, before ++ * runtime image is loaded to set it to 0x8000 (dts reading not ready). ++ * DTS sensor is polled by user application at a slower rate than this ++ * window. Treat the first zero reading as data not available. ++ * Consecutive zeros will be returned so true hot condition is not be ++ * missed. ++ */ ++ if (dts_margin == 0 && priv->temp.dts_raw_prev != 0) { ++ dev_err(priv->dev, ++ "discard first 0 reading from RdPkgConfig 10\n"); ++ discard = true; ++ } ++ priv->temp.dts_raw_prev = dts_margin; ++ if (discard) ++ return -ENODATA; ++ + /** + * Processors return a value of DTS reading in 10.6 format + * (10 bits signed decimal, 6 bits fractional). +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0007-peci-cputemp-filter-the-first-zero-from-RdPkgConfig-.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0007-peci-cputemp-filter-the-first-zero-from-RdPkgConfig-.patch new file mode 100644 index 000000000..1ee3be689 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0007-peci-cputemp-filter-the-first-zero-from-RdPkgConfig-.patch @@ -0,0 +1,70 @@ +From d622c220351def5c8b3fa5540473a4d3ca685233 Mon Sep 17 00:00:00 2001 +From: Jae Hyun Yoo +Date: Thu, 29 Jul 2021 11:07:31 -0700 +Subject: [PATCH] peci: cputemp: filter the first zero from RdPkgConfig 16 + +Peci command GetPkgConfig 16 can return 0 with cc 0x40 after a CPU +reset. Once pcode run time image is loaded and it returns 0x8000 +as a data not ready. This commit makes it discard the first zero +reading and return -ENODATA. Consecutive zeros will be returned +so that real invalid temperature target setting condition will +still be detected and logged but possibly delayed by the sensor +polling period which is one second (UPDATE_INTERVAL_DEFAULT). + +Signed-off-by: Zhikui Ren +Signed-off-by: Jae Hyun Yoo +--- + drivers/hwmon/peci-cputemp.c | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +diff --git a/drivers/hwmon/peci-cputemp.c b/drivers/hwmon/peci-cputemp.c +index af1c09741120..8d5d579ccb1a 100644 +--- a/drivers/hwmon/peci-cputemp.c ++++ b/drivers/hwmon/peci-cputemp.c +@@ -21,6 +21,7 @@ struct temp_group { + struct peci_sensor_data tcontrol; + struct peci_sensor_data tthrottle; + struct peci_sensor_data tjmax; ++ u32 temp_target_raw_prev; + struct peci_sensor_data module[MODTEMP_CHANNEL_NUMS]; + }; + +@@ -89,6 +90,8 @@ static int get_temp_targets(struct peci_cputemp *priv) + s32 tcontrol_margin; + u8 pkg_cfg[4]; + int ret; ++ bool discard = false; ++ u32 temp_target_raw; + + /* + * Just use only the tcontrol marker to determine if target values need +@@ -103,6 +106,26 @@ static int get_temp_targets(struct peci_cputemp *priv) + if (ret) + return ret; + ++ /* ++ * There is a small window (500us) for read temperature target ++ * (RdPkgConfig 16) to return cc 0x40, and temperature target of 0 after ++ * cpu reset, before runtime image is loaded to set it to 0x8000 ++ * Since update interval of the temperature target value is slower than ++ * this window, treat the first zero reading as data not available. ++ * Consecutive zeros will be returned so true invalid temperature target ++ * setting condition will not be missed. ++ */ ++ temp_target_raw = le32_to_cpup((__le32 *)pkg_cfg); ++ if (temp_target_raw == 0 && ++ priv->temp.temp_target_raw_prev != 0) { ++ dev_err(priv->dev, ++ "discard first 0 reading from RdPkgConfig 16\n"); ++ discard = true; ++ } ++ priv->temp.temp_target_raw_prev = temp_target_raw; ++ if (discard) ++ return -ENODATA; ++ + priv->temp.tjmax.value = pkg_cfg[2] * 1000; + + tcontrol_margin = pkg_cfg[1]; +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0008-vegman-kernel-add-RTC-driver-for-PCHC620.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0008-vegman-kernel-add-RTC-driver-for-PCHC620.patch new file mode 100644 index 000000000..1622a01e5 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0008-vegman-kernel-add-RTC-driver-for-PCHC620.patch @@ -0,0 +1,205 @@ +From b80e1dea7595519edbabf3e12b6d31f0e128f901 Mon Sep 17 00:00:00 2001 +From: Ivan Mikhaylov +Date: Mon, 12 Jul 2021 10:46:22 +0300 +Subject: [PATCH] vegman: kernel: add RTC driver for PCHC620 + +Signed-off-by: Ivan Mikhaylov +--- + drivers/rtc/Kconfig | 10 +++ + drivers/rtc/Makefile | 1 + + drivers/rtc/rtc-pchc620.c | 150 ++++++++++++++++++++++++++++++++++++++ + 3 files changed, 161 insertions(+) + create mode 100644 drivers/rtc/rtc-pchc620.c + +diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig +index 1adf9f815652..79aba84dd19f 100644 +--- a/drivers/rtc/Kconfig ++++ b/drivers/rtc/Kconfig +@@ -564,6 +564,16 @@ config RTC_DRV_PALMAS + This driver can also be built as a module. If so, the module + will be called rtc-palma. + ++config RTC_DRV_PCHC620 ++ tristate "PCH C620 RTC driver" ++ help ++ If you say yes here you get support for the Intel C620 Series PCH ++ built-in read-only RTC. This driver is not for in-system use on x86, ++ but rather is for external access over I2C from a BMC. ++ ++ This driver can also be built as a module. If so, the module ++ will be called rtc-pchc620. ++ + config RTC_DRV_TPS6586X + tristate "TI TPS6586X RTC driver" + depends on MFD_TPS6586X +diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile +index 4ac8f19fb631..87ab76563a59 100644 +--- a/drivers/rtc/Makefile ++++ b/drivers/rtc/Makefile +@@ -118,6 +118,7 @@ obj-$(CONFIG_RTC_DRV_MXC_V2) += rtc-mxc_v2.o + obj-$(CONFIG_RTC_DRV_OMAP) += rtc-omap.o + obj-$(CONFIG_RTC_DRV_OPAL) += rtc-opal.o + obj-$(CONFIG_RTC_DRV_PALMAS) += rtc-palmas.o ++obj-$(CONFIG_RTC_DRV_PCHC620) += rtc-pchc620.o + obj-$(CONFIG_RTC_DRV_PCAP) += rtc-pcap.o + obj-$(CONFIG_RTC_DRV_PCF2123) += rtc-pcf2123.o + obj-$(CONFIG_RTC_DRV_PCF2127) += rtc-pcf2127.o +diff --git a/drivers/rtc/rtc-pchc620.c b/drivers/rtc/rtc-pchc620.c +new file mode 100644 +index 000000000000..a944b327ca67 +--- /dev/null ++++ b/drivers/rtc/rtc-pchc620.c +@@ -0,0 +1,150 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * RTC driver for PCHC620 ++ * Copyright (C) 2021 YADRO ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define PCH_REG_FORCE_OFF 0x00 ++#define PCH_REG_SC 0x09 ++#define PCH_REG_MN 0x0a ++#define PCH_REG_HR 0x0b ++#define PCH_REG_DW 0x0c ++#define PCH_REG_DM 0x0d ++#define PCH_REG_MO 0x0e ++#define PCH_REG_YR 0x0f ++ ++#define NUM_TIME_REGS (PCH_REG_YR - PCH_REG_SC + 1) ++ ++struct pch { ++ struct rtc_device *rtc; ++ struct regmap *regmap; ++}; ++ ++static int pchc620_rtc_read_time(struct device *dev, struct rtc_time *tm) ++{ ++ struct i2c_client *client = to_i2c_client(dev); ++ struct pch *pch = i2c_get_clientdata(client); ++ unsigned char rtc_data[NUM_TIME_REGS] = {0}; ++ int rc; ++ ++ rc = regmap_bulk_read(pch->regmap, PCH_REG_SC, rtc_data, NUM_TIME_REGS); ++ if (rc < 0) { ++ dev_err(dev, "Fail to read time reg(%d)\n", rc); ++ return rc; ++ } ++ ++ tm->tm_sec = bcd2bin(rtc_data[0]); ++ tm->tm_min = bcd2bin(rtc_data[1]); ++ tm->tm_hour = bcd2bin(rtc_data[2]); ++ tm->tm_wday = rtc_data[3]; ++ tm->tm_mday = bcd2bin(rtc_data[4]); ++ tm->tm_mon = bcd2bin(rtc_data[5]) - 1; ++ tm->tm_year = bcd2bin(rtc_data[6]) + 100; ++ ++ return 0; ++} ++ ++static ssize_t pch_force_off(struct device *dev, ++ struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct i2c_client *client = to_i2c_client(dev); ++ struct pch *pch = i2c_get_clientdata(client); ++ unsigned long val; ++ int rc; ++ ++ if (kstrtoul(buf, 10, &val)) ++ return -EINVAL; ++ ++ if (val) { ++ /* 0x02 host force off */ ++ rc = regmap_write(pch->regmap, PCH_REG_FORCE_OFF, 0x2); ++ if (rc < 0) { ++ dev_err(dev, "Fail to read time reg(%d)\n", rc); ++ return rc; ++ } ++ } ++ ++ return 0; ++} ++static DEVICE_ATTR(force_off, S_IWUSR | S_IWGRP, NULL, pch_force_off); ++ ++static const struct rtc_class_ops pchc620_rtc_ops = { ++ .read_time = pchc620_rtc_read_time, ++}; ++ ++static const struct regmap_config pchc620_rtc_regmap_config = { ++ .reg_bits = 8, ++ .val_bits = 8, ++ .use_single_read = true, ++}; ++ ++static int pchc620_rtc_probe(struct i2c_client *client, ++ const struct i2c_device_id *id) ++{ ++ struct pch *pch; ++ int rc; ++ ++ pch = devm_kzalloc(&client->dev, sizeof(*pch), GFP_KERNEL); ++ if (!pch) ++ return -ENOMEM; ++ ++ pch->regmap = devm_regmap_init_i2c(client, &pchc620_rtc_regmap_config); ++ if (IS_ERR(pch->regmap)) { ++ dev_err(&client->dev, "regmap_init failed\n"); ++ return PTR_ERR(pch->regmap); ++ } ++ ++ i2c_set_clientdata(client, pch); ++ ++ pch->rtc = devm_rtc_device_register(&client->dev, "pch-rtc", ++ &pchc620_rtc_ops, THIS_MODULE); ++ if (IS_ERR(pch->rtc)) ++ return PTR_ERR(pch->rtc); ++ ++ rc = sysfs_create_file(&client->dev.kobj, &dev_attr_force_off.attr); ++ if (rc) ++ return rc; ++ ++ return 0; ++} ++ ++static int pchc620_rtc_remove(struct i2c_client *client) ++{ ++ sysfs_remove_file(&client->dev.kobj, &dev_attr_force_off.attr); ++ return 0; ++} ++ ++static const struct i2c_device_id pchc620_rtc_id[] = { ++ { "pchc620-rtc", 0 }, ++ { } ++}; ++MODULE_DEVICE_TABLE(i2c, pchc620_rtc_id); ++ ++static const struct of_device_id pchc620_rtc_of_match[] = { ++ { .compatible = "rtc,pchc620", }, ++ { } ++}; ++MODULE_DEVICE_TABLE(of, pchc620_rtc_of_match); ++ ++static struct i2c_driver pchc620_rtc_driver = { ++ .driver = { ++ .name = "pchc620-rtc", ++ .of_match_table = pchc620_rtc_of_match, ++ }, ++ .probe = pchc620_rtc_probe, ++ .remove = pchc620_rtc_remove, ++ .id_table = pchc620_rtc_id, ++}; ++module_i2c_driver(pchc620_rtc_driver); ++ ++MODULE_DESCRIPTION("RTC PCHC620 driver"); ++MODULE_AUTHOR("Ivan Mikhaylov "); ++MODULE_LICENSE("GPL"); +-- +2.31.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0009-ARM-dts-add-rtc-pch-node-into-aspeed-bmc-intel-ast2x.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0009-ARM-dts-add-rtc-pch-node-into-aspeed-bmc-intel-ast2x.patch new file mode 100644 index 000000000..4b84c831f --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0009-ARM-dts-add-rtc-pch-node-into-aspeed-bmc-intel-ast2x.patch @@ -0,0 +1,49 @@ +From dbd6feacb11dbcd81fb3586dd62170d3d5900c1c Mon Sep 17 00:00:00 2001 +From: Jae Hyun Yoo +Date: Fri, 30 Jul 2021 14:17:24 -0700 +Subject: [PATCH] ARM: dts: add rtc-pch node into aspeed-bmc-intel-ast2xxx + +This commit adds rtc-pch node into aspeed-bmc-intel-ast2500 and +aspeed-bmc-intel-ast2600 to enable PCH RTC driver. + +Signed-off-by: Jae Hyun Yoo +--- + arch/arm/boot/dts/aspeed-bmc-intel-ast2500.dts | 5 +++++ + arch/arm/boot/dts/aspeed-bmc-intel-ast2600.dts | 5 +++++ + 2 files changed, 10 insertions(+) + +diff --git a/arch/arm/boot/dts/aspeed-bmc-intel-ast2500.dts b/arch/arm/boot/dts/aspeed-bmc-intel-ast2500.dts +index 27f2febdb8e5..48e6029bcafc 100644 +--- a/arch/arm/boot/dts/aspeed-bmc-intel-ast2500.dts ++++ b/arch/arm/boot/dts/aspeed-bmc-intel-ast2500.dts +@@ -399,6 +399,11 @@ + aspeed,dma-buf-size = <4095>; + aspeed,hw-timeout-ms = <300>; + status = "okay"; ++ ++ rtc-pch@44 { ++ compatible = "rtc,pchc620"; ++ reg = <0x44>; ++ }; + }; + + &i2c4 { +diff --git a/arch/arm/boot/dts/aspeed-bmc-intel-ast2600.dts b/arch/arm/boot/dts/aspeed-bmc-intel-ast2600.dts +index 766496340b3c..8b2c20d200e1 100644 +--- a/arch/arm/boot/dts/aspeed-bmc-intel-ast2600.dts ++++ b/arch/arm/boot/dts/aspeed-bmc-intel-ast2600.dts +@@ -478,6 +478,11 @@ + /* SMB_HOST_STBY_BMC_LVC3_R */ + multi-master; + status = "okay"; ++ ++ rtc-pch@44 { ++ compatible = "rtc,pchc620"; ++ reg = <0x44>; ++ }; + }; + + &i2c12 { +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/1000-128MB-flashmap-for-PFR.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/1000-128MB-flashmap-for-PFR.patch new file mode 100644 index 000000000..7dd9990a9 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/1000-128MB-flashmap-for-PFR.patch @@ -0,0 +1,45 @@ +From ca0fa975d066b15637188e8fe37dd6d12e0e2bc4 Mon Sep 17 00:00:00 2001 +From: Kuiying Wang +Date: Tue, 28 Apr 2020 22:32:41 +0800 +Subject: [PATCH] Selecting 128MB for PFR + +PFR platforms requires 128MB flash mapping. +This will override the existing 64MB flash map +and loads 128MB flash map. + +Signed-off-by: Vikram Bodireddy +Signed-off-by: Kuiying Wang +--- + arch/arm/boot/dts/aspeed-bmc-intel-ast2500.dts | 2 +- + arch/arm/boot/dts/aspeed-bmc-intel-ast2600.dts | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/boot/dts/aspeed-bmc-intel-ast2500.dts b/arch/arm/boot/dts/aspeed-bmc-intel-ast2500.dts +index 13b94bdf5d62..2cab5fb38d4f 100644 +--- a/arch/arm/boot/dts/aspeed-bmc-intel-ast2500.dts ++++ b/arch/arm/boot/dts/aspeed-bmc-intel-ast2500.dts +@@ -96,7 +96,7 @@ + flash@0 { + status = "okay"; + m25p,fast-read; +-#include "openbmc-flash-layout-intel-64MB.dtsi" ++#include "openbmc-flash-layout-intel-128MB.dtsi" + }; + }; + +diff --git a/arch/arm/boot/dts/aspeed-bmc-intel-ast2600.dts b/arch/arm/boot/dts/aspeed-bmc-intel-ast2600.dts +index a95b5ac828b3..bf66e1b6c0fd 100644 +--- a/arch/arm/boot/dts/aspeed-bmc-intel-ast2600.dts ++++ b/arch/arm/boot/dts/aspeed-bmc-intel-ast2600.dts +@@ -94,7 +94,7 @@ + spi-max-frequency = <40000000>; + spi-tx-bus-width = <4>; + m25p,fast-read; +-#include "openbmc-flash-layout-intel-64MB.dtsi" ++#include "openbmc-flash-layout-intel-128MB.dtsi" + }; + }; + +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/1003-Die_CPU-filter-first-zero-from-GetTemp.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/1003-Die_CPU-filter-first-zero-from-GetTemp.patch deleted file mode 100644 index b7823ce14..000000000 --- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/1003-Die_CPU-filter-first-zero-from-GetTemp.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 0d202fb06b873c5e258658462ac4fc01a673fd83 Mon Sep 17 00:00:00 2001 -From: Zhikui Ren -Date: Mon, 11 Jan 2021 16:31:36 -0800 -Subject: [PATCH] Die_CPU: filter first zero from GetTemp - -Peci command GetTemp can return 0 during CPU reset. -It does not have a have completion code either. -Discard the first zero reading and return -ENODATA. -Consecutive zeros will be returned so that real hot -condition will still be detected and logged but possibly delayed -by the sensor polling period, which is normally 500ms-1s. - -Signed-off-by: Zhikui Ren ---- - drivers/hwmon/peci-cputemp.c | 15 +++++++++++++++ - 1 file changed, 15 insertions(+) - -diff --git a/drivers/hwmon/peci-cputemp.c b/drivers/hwmon/peci-cputemp.c -index b633ea545644..19002f02bd91 100644 ---- a/drivers/hwmon/peci-cputemp.c -+++ b/drivers/hwmon/peci-cputemp.c -@@ -15,6 +15,7 @@ - - struct temp_group { - struct peci_sensor_data die; -+ u32 die_raw_prev; - struct peci_sensor_data dts; - struct peci_sensor_data tcontrol; - struct peci_sensor_data tthrottle; -@@ -129,6 +130,7 @@ static int get_die_temp(struct peci_cputemp *priv) - { - struct peci_get_temp_msg msg; - int ret; -+ bool discard = false; - - if (!peci_sensor_need_update(&priv->temp.die)) - return 0; -@@ -139,6 +141,19 @@ static int get_die_temp(struct peci_cputemp *priv) - if (ret) - return ret; - -+ /* GET_TEMP command does not have cc and can return zero during -+ * cpu reset. Treat the first zero reading as data not available. -+ * Consecutive zeros will be returned so true hot condition -+ * is not be missed. -+ */ -+ if (msg.temp_raw == 0 && priv->temp.die_raw_prev != 0) { -+ pr_err("peci-cputemp_die: discard first 0 reading from GetTemp\n"); -+ discard = true; -+ } -+ priv->temp.die_raw_prev = msg.temp_raw; -+ if (discard) -+ return -ENODATA; -+ - /* Note that the tjmax should be available before calling it */ - priv->temp.die.value = priv->temp.tjmax.value + - (msg.temp_raw * 1000 / 64); --- -2.17.1 - diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/1004-DTS_CPU-filter-first-zero-from-RdPkgConfig-10.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/1004-DTS_CPU-filter-first-zero-from-RdPkgConfig-10.patch deleted file mode 100644 index aab6c3cea..000000000 --- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/1004-DTS_CPU-filter-first-zero-from-RdPkgConfig-10.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 68db4c74c43d4042b0b32bcd133121ab39b9b310 Mon Sep 17 00:00:00 2001 -From: Zhikui Ren -Date: Tue, 2 Feb 2021 14:49:28 -0800 -Subject: [PATCH] DTS_CPU: filter first zero from RdPkgConfig 10 - -Peci command GetPkgConfig 10 can return 0 (hot) with cc 0x40 -after cpu reset. Once pcode run time image is loaded -and it returns 0x8000 as DTS margin data not ready -Discard the first zero reading and return -ENODATA. -Consecutive zeros will be returned so that real hot -condition will still be detected and logged but possibly delayed -by the sensor polling period, which is normally one second. - -Signed-off-by: Zhikui Ren ---- - drivers/hwmon/peci-cputemp.c | 18 ++++++++++++++++++ - 1 file changed, 18 insertions(+) - -diff --git a/drivers/hwmon/peci-cputemp.c b/drivers/hwmon/peci-cputemp.c -index 19002f02bd91..e1860779aa66 100644 ---- a/drivers/hwmon/peci-cputemp.c -+++ b/drivers/hwmon/peci-cputemp.c -@@ -17,6 +17,7 @@ struct temp_group { - struct peci_sensor_data die; - u32 die_raw_prev; - struct peci_sensor_data dts; -+ u32 dts_raw_prev; - struct peci_sensor_data tcontrol; - struct peci_sensor_data tthrottle; - struct peci_sensor_data tjmax; -@@ -168,6 +169,7 @@ static int get_dts(struct peci_cputemp *priv) - s32 dts_margin; - u8 pkg_cfg[4]; - int ret; -+ bool discard = false; - - if (!peci_sensor_need_update(&priv->temp.dts)) - return 0; -@@ -181,6 +183,22 @@ static int get_dts(struct peci_cputemp *priv) - - dts_margin = le16_to_cpup((__le16 *)pkg_cfg); - -+ /* There is a small window (500us) for read dts_margin (RdPkgConfig 10) -+ * to return cc 0x40, and dts_margin of 0 after cpu reset, before runtime -+ * image is loaded to set it to 0x8000 (dts reading not ready). -+ * DTS sensor is polled by user application at a slower rate than this window. -+ * Treat the first zero reading as data not available. -+ * Consecutive zeros will be returned so true hot condition -+ * is not be missed. -+ */ -+ if (dts_margin == 0 && priv->temp.dts_raw_prev != 0) { -+ pr_err("peci-cputemp_dts: discard first 0 reading from RdPkgConfig 10\n"); -+ discard = true; -+ } -+ priv->temp.dts_raw_prev = dts_margin; -+ if (discard) -+ return -ENODATA; -+ - /** - * Processors return a value of DTS reading in 10.6 format - * (10 bits signed decimal, 6 bits fractional). --- -2.17.1 - diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/intel.cfg b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/intel.cfg index 21bfcf792..c33020874 100644 --- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/intel.cfg +++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/intel.cfg @@ -5,7 +5,7 @@ CONFIG_SPI_MASTER=y CONFIG_IIO=y CONFIG_SENSORS_IIO_HWMON=y CONFIG_ASPEED_ADC=y -CONFIG_SGPIO_ASPEED=y +CONFIG_GPIO_ASPEED_SGPIO=y CONFIG_CRC8=y CONFIG_PECI=y CONFIG_PECI_CHARDEV=y @@ -91,3 +91,6 @@ CONFIG_USB_EHCI_HCD_PLATFORM=n CONFIG_IPMB_DEVICE_INTERFACE=y CONFIG_BPF_SYSCALL=n CONFIG_IPV6_SIT=n +CONFIG_RTC_DRV_PCHC620=y +CONFIG_RTC_HCTOSYS=y +CONFIG_RTC_HCTOSYS_DEVICE="rtc0" \ No newline at end of file diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed_%.bbappend b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed_%.bbappend index 8c35e6c07..da5b88bb0 100644 --- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed_%.bbappend @@ -1,14 +1,14 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" -LINUX_VERSION = "5.10.53" +LINUX_VERSION = "5.10.60" KBRANCH = "dev-5.10-intel" KSRC = "git://github.com/Intel-BMC/linux;protocol=ssh;branch=${KBRANCH}" # Include this as a comment only for downstream auto-bump # SRC_URI = "git://github.com/Intel-BMC/linux;protocol=ssh;branch=dev-5.10-intel" -SRCREV="978d545ce0c53bd45c80a224b56141bcc3389828" +SRCREV="9c808fc8b3ad7c030fe546b1b5c6c38556fa784a" -do_compile_prepend(){ +do_compile:prepend(){ # device tree compiler flags export DTC_FLAGS=-@ } @@ -19,9 +19,12 @@ SRC_URI += " \ file://0002-soc-aspeed-add-AST2600-A0-specific-fix-into-mbox-dri.patch \ file://0003-Fix-libmctp-build-error.patch \ file://0004-Add-a-quick-fix-to-resolve-USB-gadget-DMA-issue.patch \ - file://1003-Die_CPU-filter-first-zero-from-GetTemp.patch \ - file://1004-DTS_CPU-filter-first-zero-from-RdPkgConfig-10.patch \ + file://0005-Die_CPU-filter-first-zero-from-GetTemp.patch \ + file://0006-DTS_CPU-filter-first-zero-from-RdPkgConfig-10.patch \ + file://0007-peci-cputemp-filter-the-first-zero-from-RdPkgConfig-.patch \ + file://0008-vegman-kernel-add-RTC-driver-for-PCHC620.patch \ + file://0009-ARM-dts-add-rtc-pch-node-into-aspeed-bmc-intel-ast2x.patch \ " -SRC_URI += "${@bb.utils.contains('IMAGE_FSTYPES', 'intel-pfr', 'file://0005-128MB-flashmap-for-PFR.patch', '', d)}" +SRC_URI += "${@bb.utils.contains('IMAGE_FSTYPES', 'intel-pfr', 'file://1000-128MB-flashmap-for-PFR.patch', '', d)}" SRC_URI += "${@bb.utils.contains('EXTRA_IMAGE_FEATURES', 'debug-tweaks', 'file://debug.cfg', '', d)}" -- cgit v1.2.3