From 889d76e36b3f012d3782a1c5e1587c32e4d1ed11 Mon Sep 17 00:00:00 2001 From: msiddare <84937930+msiddare@users.noreply.github.com> Date: Thu, 23 Sep 2021 02:29:56 -0700 Subject: [PATCH] mtd: m25p80 spi driver update to support ACPI table match (#234) Current m25p80 spi nor driver does not support ACPI table match. Configuration done through ACPI tables is not recognized by driver. Cisco 8000 platform cofigures NOR flash partition information through APCI table which is not recognized by m25p80. Added support in m25p80 to perform ACPI table match. Signed-off-by: Madhava Reddy Siddareddygari --- patch/cisco-acpi-spi-nor.patch | 54 ++++++++++++++++++++++++++++++++++ patch/series | 4 ++- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 patch/cisco-acpi-spi-nor.patch diff --git a/patch/cisco-acpi-spi-nor.patch b/patch/cisco-acpi-spi-nor.patch new file mode 100644 index 000000000000..59444583b4e4 --- /dev/null +++ b/patch/cisco-acpi-spi-nor.patch @@ -0,0 +1,54 @@ +From cac7ee957753518f366b7afa4afa13f528af71f5 Mon Sep 17 00:00:00 2001 +From: Madhava Reddy Siddareddygari +Date: Tue, 7 Sep 2021 15:57:12 -0700 +Subject: [PATCH] mtd: m25p80 spi driver update to support ACPI table match + +Current m25p80 spi nor driver does not support ACPI table match. +Configuration done through ACPI tables is not recognized by driver. +Cisco 8000 platform configures NOR flash partition information +through ACPI table which is not recognized by m25p80. + +Added support in m25p80 to perform ACPI table match. + +Signed-off-by: Madhava Reddy Siddareddygari +--- + drivers/mtd/devices/m25p80.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c +index c4a1d04b8..df21dd79f 100644 +--- a/drivers/mtd/devices/m25p80.c ++++ b/drivers/mtd/devices/m25p80.c +@@ -22,6 +22,7 @@ + + #include + #include ++#include + + #include + #include +@@ -319,11 +320,21 @@ static const struct of_device_id m25p_of_table[] = { + }; + MODULE_DEVICE_TABLE(of, m25p_of_table); + ++#ifdef CONFIG_ACPI ++static const struct acpi_device_id m25p_acpi_table[] = { ++ { "JEDEC,SPI-NOR", 0 }, ++ { "ACPI0000", 0 }, ++ {} ++}; ++MODULE_DEVICE_TABLE(acpi, m25p_acpi_table); ++#endif ++ + static struct spi_mem_driver m25p80_driver = { + .spidrv = { + .driver = { + .name = "m25p80", + .of_match_table = m25p_of_table, ++ .acpi_match_table = ACPI_PTR(m25p_acpi_table), + }, + .id_table = m25p_ids, + }, +-- +2.26.2 + diff --git a/patch/series b/patch/series index 648aaef1278f..6ffd65490108 100755 --- a/patch/series +++ b/patch/series @@ -85,16 +85,18 @@ net-sch_generic-fix-the-missing-new-qdisc-assignment.patch 0031-backport-nvme-Add-hardware-monitoring-support.patch 0032-platform-mellanox-mlxreg-hotplug-Use-capability-regi.patch - # Cisco patches for 4.19 kernel cisco-mtd-part.patch cisco-mdio-mux-support-acpi.patch cisco-x86-gpio-config.patch +cisco-acpi-spi-nor.patch + # # Marvell platform patches for 4.19 armhf_secondary_boot_online.patch # # + ############################################################ # # Internal patches will be added below (placeholder)