summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-kernel
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-kernel')
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0001-peci-Add-debug-printing-to-check-caller-PID.patch43
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0002-soc-aspeed-add-AST2600-A0-specific-fix-into-mbox-dri.patch42
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0003-Fix-libmctp-build-error.patch116
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0004-Add-a-quick-fix-to-resolve-USB-gadget-DMA-issue.patch33
-rwxr-xr-xmeta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0005-128MB-flashmap-for-PFR.patch45
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/debug.cfg2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/intel.cfg93
-rw-r--r--meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed_%.bbappend23
8 files changed, 397 insertions, 0 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0001-peci-Add-debug-printing-to-check-caller-PID.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0001-peci-Add-debug-printing-to-check-caller-PID.patch
new file mode 100644
index 000000000..fbd51df7a
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0001-peci-Add-debug-printing-to-check-caller-PID.patch
@@ -0,0 +1,43 @@
+From 7474fe190f770e064a5ce5e939bd713ce2aa1de5 Mon Sep 17 00:00:00 2001
+From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+Date: Wed, 3 Feb 2021 16:18:37 -0800
+Subject: [PATCH] peci: Add debug printing to check caller PID
+
+This commit adds debug printing out to check caller PID for traffic
+profiling.
+
+The printing can be enabled by this command:
+echo -n 'file drivers/peci/peci-core.c line 218 +p' > /sys/kernel/debug/dynamic_debug/control
+echo '8' > /proc/sys/kernel/printk
+
+Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+---
+ drivers/peci/peci-core.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/drivers/peci/peci-core.c b/drivers/peci/peci-core.c
+index 10375e6087a5..02c8502fd846 100644
+--- a/drivers/peci/peci-core.c
++++ b/drivers/peci/peci-core.c
+@@ -194,6 +194,7 @@ static int __peci_xfer(struct peci_adapter *adapter, struct peci_xfer_msg *msg,
+ bool do_retry, bool has_aw_fcs)
+ {
+ uint interval_us = PECI_DEV_RETRY_INTERVAL_MIN_USEC;
++ char task_name[TASK_COMM_LEN];
+ ulong timeout = jiffies;
+ u8 aw_fcs;
+ int ret;
+@@ -214,6 +215,10 @@ static int __peci_xfer(struct peci_adapter *adapter, struct peci_xfer_msg *msg,
+ }
+ }
+
++ get_task_comm(task_name, current);
++ dev_dbg(&adapter->dev, "%s is called by %s(%d) through %s\n",
++ __func__, task_name, current->pid, adapter->name);
++
+ /*
+ * For some commands, the PECI originator may need to retry a command if
+ * the processor PECI client responds with a 0x8x completion code. In
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0002-soc-aspeed-add-AST2600-A0-specific-fix-into-mbox-dri.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0002-soc-aspeed-add-AST2600-A0-specific-fix-into-mbox-dri.patch
new file mode 100644
index 000000000..1e1dac7a8
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0002-soc-aspeed-add-AST2600-A0-specific-fix-into-mbox-dri.patch
@@ -0,0 +1,42 @@
+From ae96ce5f2a5bd76b234cea6fc3f0bf1df74387f3 Mon Sep 17 00:00:00 2001
+From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+Date: Thu, 4 Feb 2021 00:29:55 -0800
+Subject: [PATCH] soc: aspeed: add AST2600 A0 specific fix into mbox driver
+
+AST2600 A0 has the same LPC mbox register structure with AST2500
+but AST2600 A1 and later revision is different so this commit adds
+AST2600 A0 specific fix into the mbox driver.
+
+Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+---
+ drivers/soc/aspeed/aspeed-lpc-mbox.c | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/drivers/soc/aspeed/aspeed-lpc-mbox.c b/drivers/soc/aspeed/aspeed-lpc-mbox.c
+index 8dd3345682c7..12bb436dda78 100644
+--- a/drivers/soc/aspeed/aspeed-lpc-mbox.c
++++ b/drivers/soc/aspeed/aspeed-lpc-mbox.c
+@@ -363,6 +363,20 @@ static int aspeed_mbox_probe(struct platform_device *pdev)
+ return -EINVAL;
+
+ config = match->data;
++
++ if (of_device_is_compatible(pdev->dev.of_node,
++ "aspeed,ast2600-mbox")) {
++ #define REV_ID_IO_OFFSET 0x1e6e2014
++ #define REV_ID_AST2600A0 0x05000303
++ void __iomem *chip_id_base = devm_ioremap(&pdev->dev,
++ REV_ID_IO_OFFSET,
++ sizeof(u32));
++
++ if (!IS_ERR(chip_id_base) &&
++ readl(chip_id_base) == REV_ID_AST2600A0)
++ config = &ast2500_config;
++ }
++
+ memcpy(&mbox->configs, config, sizeof(mbox->configs));
+
+ rc = of_property_read_u32(dev->of_node, "reg", &mbox->base);
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0003-Fix-libmctp-build-error.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0003-Fix-libmctp-build-error.patch
new file mode 100644
index 000000000..b9a6ca527
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0003-Fix-libmctp-build-error.patch
@@ -0,0 +1,116 @@
+From af414e45bade3cf7277215d82b59a31c9b459cea Mon Sep 17 00:00:00 2001
+From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+Date: Mon, 22 Feb 2021 15:27:22 -0800
+Subject: [PATCH] Fix libmctp build error
+
+This is a quick fix for libmctp building which includes staging
+kernel headers. It's a temporary fix until kernel tree fixes the
+rwonce.h including issue.
+
+Note: Do not upstream it.
+
+Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+---
+ include/asm/rwonce.h | 90 ++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 90 insertions(+)
+ create mode 100644 include/asm/rwonce.h
+
+diff --git a/include/asm/rwonce.h b/include/asm/rwonce.h
+new file mode 100644
+index 000000000000..11619bdbebae
+--- /dev/null
++++ b/include/asm/rwonce.h
+@@ -0,0 +1,90 @@
++/* SPDX-License-Identifier: GPL-2.0 */
++/*
++ * Prevent the compiler from merging or refetching reads or writes. The
++ * compiler is also forbidden from reordering successive instances of
++ * READ_ONCE and WRITE_ONCE, but only when the compiler is aware of some
++ * particular ordering. One way to make the compiler aware of ordering is to
++ * put the two invocations of READ_ONCE or WRITE_ONCE in different C
++ * statements.
++ *
++ * These two macros will also work on aggregate data types like structs or
++ * unions.
++ *
++ * Their two major use cases are: (1) Mediating communication between
++ * process-level code and irq/NMI handlers, all running on the same CPU,
++ * and (2) Ensuring that the compiler does not fold, spindle, or otherwise
++ * mutilate accesses that either do not require ordering or that interact
++ * with an explicit memory barrier or atomic instruction that provides the
++ * required ordering.
++ */
++#ifndef __ASM_GENERIC_RWONCE_H
++#define __ASM_GENERIC_RWONCE_H
++
++#ifndef __ASSEMBLY__
++
++#include <linux/compiler_types.h>
++#include <linux/kasan-checks.h>
++#include <linux/kcsan-checks.h>
++
++/*
++ * Yes, this permits 64-bit accesses on 32-bit architectures. These will
++ * actually be atomic in some cases (namely Armv7 + LPAE), but for others we
++ * rely on the access being split into 2x32-bit accesses for a 32-bit quantity
++ * (e.g. a virtual address) and a strong prevailing wind.
++ */
++#define compiletime_assert_rwonce_type(t) \
++ compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
++ "Unsupported access size for {READ,WRITE}_ONCE().")
++
++/*
++ * Use __READ_ONCE() instead of READ_ONCE() if you do not require any
++ * atomicity. Note that this may result in tears!
++ */
++#ifndef __READ_ONCE
++#define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x))
++#endif
++
++#define READ_ONCE(x) \
++({ \
++ compiletime_assert_rwonce_type(x); \
++ __READ_ONCE(x); \
++})
++
++#define __WRITE_ONCE(x, val) \
++do { \
++ *(volatile typeof(x) *)&(x) = (val); \
++} while (0)
++
++#define WRITE_ONCE(x, val) \
++do { \
++ compiletime_assert_rwonce_type(x); \
++ __WRITE_ONCE(x, val); \
++} while (0)
++
++static __always_inline
++unsigned long __read_once_word_nocheck(const void *addr)
++{
++ return __READ_ONCE(*(unsigned long *)addr);
++}
++
++/*
++ * Use READ_ONCE_NOCHECK() instead of READ_ONCE() if you need to load a
++ * word from memory atomically but without telling KASAN/KCSAN. This is
++ * usually used by unwinding code when walking the stack of a running process.
++ */
++#define READ_ONCE_NOCHECK(x) \
++({ \
++ compiletime_assert(sizeof(x) == sizeof(unsigned long), \
++ "Unsupported access size for READ_ONCE_NOCHECK()."); \
++ (typeof(x))__read_once_word_nocheck(&(x)); \
++})
++
++static __always_inline
++unsigned long read_word_at_a_time(const void *addr)
++{
++ kasan_check_read(addr, 1);
++ return *(unsigned long *)addr;
++}
++
++#endif /* __ASSEMBLY__ */
++#endif /* __ASM_GENERIC_RWONCE_H */
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0004-Add-a-quick-fix-to-resolve-USB-gadget-DMA-issue.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0004-Add-a-quick-fix-to-resolve-USB-gadget-DMA-issue.patch
new file mode 100644
index 000000000..2d435c796
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0004-Add-a-quick-fix-to-resolve-USB-gadget-DMA-issue.patch
@@ -0,0 +1,33 @@
+From cdd7104850d34cfe22902c45d69dac6cb506b087 Mon Sep 17 00:00:00 2001
+From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+Date: Fri, 26 Feb 2021 11:00:54 -0800
+Subject: [PATCH] Add a quick fix to resolve USB gadget DMA issue.
+
+This is a quick fix to resolve USB gadget DMA issue and it should
+be removed when a real fix is added.
+
+Tested: Keyboard and mouse in KVM feature worked.
+
+Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
+---
+ kernel/dma/mapping.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c
+index 51bb8fa8eb89..7bcfedeb1e30 100644
+--- a/kernel/dma/mapping.c
++++ b/kernel/dma/mapping.c
+@@ -146,8 +146,10 @@ dma_addr_t dma_map_page_attrs(struct device *dev, struct page *page,
+
+ BUG_ON(!valid_dma_direction(dir));
+
++#if 0 /* Quick fix to resolve USB gadget issue */
+ if (WARN_ON_ONCE(!dev->dma_mask))
+ return DMA_MAPPING_ERROR;
++#endif
+
+ if (dma_map_direct(dev, ops))
+ addr = dma_direct_map_page(dev, page, offset, size, dir, attrs);
+--
+2.17.1
+
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
new file mode 100755
index 000000000..7dd9990a9
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0005-128MB-flashmap-for-PFR.patch
@@ -0,0 +1,45 @@
+From ca0fa975d066b15637188e8fe37dd6d12e0e2bc4 Mon Sep 17 00:00:00 2001
+From: Kuiying Wang <kuiying.wang@intel.com>
+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 <vikram.bodireddy@intel.com>
+Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
+---
+ 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/debug.cfg b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/debug.cfg
new file mode 100644
index 000000000..bbc7fa5b6
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/debug.cfg
@@ -0,0 +1,2 @@
+CONFIG_DEVMEM = y
+CONFIG_DEVMEM_BOOTPARAM = n
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
new file mode 100644
index 000000000..21bfcf792
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/intel.cfg
@@ -0,0 +1,93 @@
+CONFIG_BLK_DEV_RAM=y
+CONFIG_HWMON=y
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+CONFIG_IIO=y
+CONFIG_SENSORS_IIO_HWMON=y
+CONFIG_ASPEED_ADC=y
+CONFIG_SGPIO_ASPEED=y
+CONFIG_CRC8=y
+CONFIG_PECI=y
+CONFIG_PECI_CHARDEV=y
+CONFIG_PECI_ASPEED=y
+CONFIG_SENSORS_PECI_CPUTEMP=y
+CONFIG_SENSORS_PECI_DIMMTEMP=y
+CONFIG_SENSORS_PECI_CPUPOWER=y
+CONFIG_SENSORS_PECI_DIMMPOWER=y
+CONFIG_SENSORS_PECI_PLATFORMPOWER=y
+CONFIG_CONFIGFS_FS=y
+CONFIG_BLK_DEV_RAM_SIZE=49152
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x01
+CONFIG_MAGIC_SYSRQ_SERIAL=y
+CONFIG_ASPEED_ESPI_SLAVE=y
+CONFIG_ASPEED_KCS_IPMI_BMC=y
+CONFIG_I2C_SLAVE=y
+CONFIG_I2C_SLAVE_MQUEUE=y
+CONFIG_I2C_SLAVE_MQUEUE_MESSAGE_SIZE=256
+CONFIG_I2C_SLAVE_MQUEUE_QUEUE_SIZE=32
+CONFIG_ASPEED_BT_IPMI_BMC=n
+CONFIG_ASPEED_LPC_CTRL=n
+CONFIG_ASPEED_LPC_MBOX=y
+CONFIG_ASPEED_LPC_SIO=y
+CONFIG_JTAG=y
+CONFIG_JTAG_ASPEED=y
+CONFIG_FRAME_VECTOR=y
+CONFIG_MEDIA_SUPPORT=y
+CONFIG_MEDIA_CAMERA_SUPPORT=y
+CONFIG_VIDEO_DEV=y
+CONFIG_VIDEO_V4L2=y
+CONFIG_V4L_PLATFORM_DRIVERS=y
+CONFIG_VIDEO_ASPEED=y
+CONFIG_VIDEOBUF2_CORE=y
+CONFIG_VIDEOBUF2_V4L2=y
+CONFIG_VIDEOBUF2_MEMOPS=y
+CONFIG_VIDEOBUF2_DMA_CONTIG=y
+CONFIG_MEDIA_SUBDRV_AUTOSELECT=y
+CONFIG_USB_GADGET_VBUS_DRAW=2
+CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2
+CONFIG_USB_LIBCOMPOSITE=y
+CONFIG_USB_F_HID=y
+CONFIG_USB_GADGET=y
+CONFIG_U_SERIAL_CONSOLE=y
+CONFIG_USB_ASPEED_VHUB=y
+CONFIG_USB_MASS_STORAGE=y
+CONFIG_USB_CONFIGFS=y
+CONFIG_USB_CONFIGFS_MASS_STORAGE=y
+CONFIG_USB_CONFIGFS_F_FS=y
+CONFIG_USB_CONFIGFS_F_HID=y
+CONFIG_ASPEED_UART_ROUTING=y
+CONFIG_ASPEED_VGA_SHAREDMEM=y
+CONFIG_PWM=y
+CONFIG_PWM_FTTMR010=y
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_PWM_BEEPER=y
+CONFIG_VFAT_FS=y
+CONFIG_NLS=y
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_ASCII=y
+CONFIG_NLS_ISO8859_1=y
+CONFIG_NLS_ISO8859_15=y
+CONFIG_NLS_UTF8=y
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_CIFS=y
+CONFIG_CIFS_XATTR=y
+CONFIG_PSTORE=y
+CONFIG_PSTORE_ZLIB_COMPRESS=y
+CONFIG_PSTORE_RAM=y
+CONFIG_FSI=n
+CONFIG_FSI_MASTER_HUB=n
+CONFIG_FSI_MASTER_ASPEED=n
+CONFIG_FSI_SCOM=n
+CONFIG_FSI_SBEFIFO=n
+CONFIG_FSI_OCC=n
+CONFIG_ASPEED_P2A_CTRL=n
+CONFIG_USB=n
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=n
+CONFIG_USB_DYNAMIC_MINORS=n
+CONFIG_USB_EHCI_HCD=n
+CONFIG_USB_EHCI_ROOT_HUB_TT=n
+CONFIG_USB_EHCI_HCD_PLATFORM=n
+CONFIG_IPMB_DEVICE_INTERFACE=y
+CONFIG_BPF_SYSCALL=n
+CONFIG_IPV6_SIT=n
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
new file mode 100644
index 000000000..4af0acc49
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed_%.bbappend
@@ -0,0 +1,23 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+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="807fd9e1636097ca70957a3ff373bd1280737e46"
+
+do_compile_prepend(){
+ # device tree compiler flags
+ export DTC_FLAGS=-@
+}
+
+SRC_URI += " \
+ file://intel.cfg \
+ file://0001-peci-Add-debug-printing-to-check-caller-PID.patch \
+ 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 \
+ "
+
+SRC_URI += "${@bb.utils.contains('IMAGE_FSTYPES', 'intel-pfr', 'file://0005-128MB-flashmap-for-PFR.patch', '', d)}"
+SRC_URI += "${@bb.utils.contains('EXTRA_IMAGE_FEATURES', 'debug-tweaks', 'file://debug.cfg', '', d)}"