linux-gbmc: aspeed-g7: espi: Fix eDAF memory mapping in HW mode
This is not in SDK v09.07. But we need this for eSPI eDAF
Ref:
https://github.com/AspeedTech-BMC/linux/commit/50a07db86b2f1316cebcc608d1a6050a699da5f7
Tested:
TO-DO
Google-Bug-Id: 413566800
Change-Id: I71401ac8cfbf902ca3a46fa0feea64859231bc7a
Signed-off-by: Alan Hung <yung-sheng.huang@fii-na.corp-partner.google.com>
diff --git a/recipes-kernel/linux/files/0029-soc-aspeed-ast2700-epsi-Fix-eDAF-memory-mapping-in-H.patch b/recipes-kernel/linux/files/0029-soc-aspeed-ast2700-epsi-Fix-eDAF-memory-mapping-in-H.patch
new file mode 100644
index 0000000..996266f
--- /dev/null
+++ b/recipes-kernel/linux/files/0029-soc-aspeed-ast2700-epsi-Fix-eDAF-memory-mapping-in-H.patch
@@ -0,0 +1,48 @@
+From edcf45d10f34544a250cb55ba5784fba513934ea Mon Sep 17 00:00:00 2001
+From: Alan Hung <yung-sheng.huang@fii-na.corp-partner.google.com>
+Date: Thu, 10 Jul 2025 20:01:50 +0800
+Subject: [PATCH] soc/aspeed: ast2700-epsi: Fix eDAF memory mapping in HW mode
+
+From:
+https://github.com/AspeedTech-BMC/linux/commit/50a07db86b2f1316cebcc608d1a6050a699da5f7
+
+Adjusts the memory mapping logic for eDAF in the AST2700 eSPI driver.
+Moves the `devm_ioremap_resource()` call inside the conditional block
+to ensure proper handling of eDAF resources and updates the error
+message for clarity. Prevents potential issues with incorrect memory
+mapping and error reporting.
+
+The error message like the following:
+ [ 2.322747] ast2700-espi 14c06000.espi: invalid resource
+ [??? 0xffffff8003882010-0xffffffc081fdbbb0 flags 0xffffff8003882010]
+
+Signed-off-by: Alan Hung <yung-sheng.huang@fii-na.corp-partner.google.com>
+---
+ drivers/soc/aspeed/ast2700-espi.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/soc/aspeed/ast2700-espi.c b/drivers/soc/aspeed/ast2700-espi.c
+index c5dd2c093..3495bf792 100644
+--- a/drivers/soc/aspeed/ast2700-espi.c
++++ b/drivers/soc/aspeed/ast2700-espi.c
+@@ -1980,12 +1980,12 @@ static int ast2700_espi_flash_probe(struct ast2700_espi *espi)
+ flash->edaf.size = resource_size(&res);
+ dev_err(dev, "eDAF address: 0x%llx\n", flash->edaf.taddr);
+ dev_err(dev, "eDAF size: 0x%llx\n", flash->edaf.size);
+- }
+
+- virt = devm_ioremap_resource(dev, &res);
+- if (!virt) {
+- dev_err(dev, "cannot map MMBI memory region\n");
+- return -ENOMEM;
++ virt = devm_ioremap_resource(dev, &res);
++ if (!virt) {
++ dev_err(dev, "cannot map eDAF memory region\n");
++ return -ENOMEM;
++ }
+ }
+
+ flash->dma.enable = of_property_read_bool(dev->of_node, "flash-dma-mode");
+--
+2.34.1
+
diff --git a/recipes-kernel/linux/linux-gbmc_aspeedg7.bb b/recipes-kernel/linux/linux-gbmc_aspeedg7.bb
index 6932b18..6b1f827 100644
--- a/recipes-kernel/linux/linux-gbmc_aspeedg7.bb
+++ b/recipes-kernel/linux/linux-gbmc_aspeedg7.bb
@@ -60,6 +60,7 @@
file://0026-Add-LTPI-GPIO-driver-for-ast2700.patch \
file://0027-Add-DRAM-EDAC-driver-for-ast2700.patch \
file://0028-mctp-i3c-MCTP-I3C-driver.patch \
+ file://0029-soc-aspeed-ast2700-epsi-Fix-eDAF-memory-mapping-in-H.patch \
"
SRC_URI:append:aspeed-g7 = " \