aboutsummaryrefslogtreecommitdiffstats
path: root/package/boot/uboot-mediatek/patches/100-23-mmc-mtk-sd-add-support-to-display-verbose-error-log.patch
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2022-08-07 12:06:56 +0200
committerDaniel Golle <daniel@makrotopia.org>2022-08-28 20:33:15 +0100
commitd3a337a592bc26be374a70d1aca4aa20080527d4 (patch)
tree10e40ed6084c5e1ad063fbde7e95e5f4d680e067 /package/boot/uboot-mediatek/patches/100-23-mmc-mtk-sd-add-support-to-display-verbose-error-log.patch
parentc09eb08dadae341e7f68d34e9ec3f15afd86e469 (diff)
downloadupstream-d3a337a592bc26be374a70d1aca4aa20080527d4.tar.gz
upstream-d3a337a592bc26be374a70d1aca4aa20080527d4.tar.bz2
upstream-d3a337a592bc26be374a70d1aca4aa20080527d4.zip
uboot-mediatek: additions from MTK SDK
* updated SNAND/SNFI driver brings support for MT7981 * add support for MediaTek NAND Memory bad Block Management (NMBM) (not used for any boards atm, but could be useful in future) * wire up NMBM support for MT7622, MT7629, MT7981 and MT7986 * replace some local patches with updated version from SDK * bring some legacy precompiler symbols which haven't been converted into Kconfig symbols in U-Boot 2022.07, remove when bumbping to U-Boot 2022.10: 100-28-include-configs-mt7986-h-from-SDK.patch Source: https://github.com/mtk-openwrt/u-boot Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'package/boot/uboot-mediatek/patches/100-23-mmc-mtk-sd-add-support-to-display-verbose-error-log.patch')
-rw-r--r--package/boot/uboot-mediatek/patches/100-23-mmc-mtk-sd-add-support-to-display-verbose-error-log.patch78
1 files changed, 78 insertions, 0 deletions
diff --git a/package/boot/uboot-mediatek/patches/100-23-mmc-mtk-sd-add-support-to-display-verbose-error-log.patch b/package/boot/uboot-mediatek/patches/100-23-mmc-mtk-sd-add-support-to-display-verbose-error-log.patch
new file mode 100644
index 0000000000..b6a2229170
--- /dev/null
+++ b/package/boot/uboot-mediatek/patches/100-23-mmc-mtk-sd-add-support-to-display-verbose-error-log.patch
@@ -0,0 +1,78 @@
+From 793bed29e78cc54d989333d756fef51efaca4e56 Mon Sep 17 00:00:00 2001
+From: Weijie Gao <weijie.gao@mediatek.com>
+Date: Tue, 26 Jul 2022 09:29:18 +0800
+Subject: [PATCH 58/71] mmc: mtk-sd: add support to display verbose error log
+
+Add an option to enable debug log, and also display verbose error log for
+both command and data.
+
+Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
+---
+ drivers/mmc/Kconfig | 8 ++++++++
+ drivers/mmc/Makefile | 4 ++++
+ drivers/mmc/mtk-sd.c | 24 +++++++++++++++---------
+ 3 files changed, 27 insertions(+), 9 deletions(-)
+
+--- a/drivers/mmc/Kconfig
++++ b/drivers/mmc/Kconfig
+@@ -789,6 +789,14 @@ config MMC_MTK
+ This is needed if support for any SD/SDIO/MMC devices is required.
+ If unsure, say N.
+
++config MMC_MTK_DEBUG
++ bool "Display verbose error log"
++ default n
++ depends on MMC_MTK
++ help
++ Enable this option to allow verbose error log being displayed for
++ debugging.
++
+ endif
+
+ config FSL_ESDHC
+--- a/drivers/mmc/Makefile
++++ b/drivers/mmc/Makefile
+@@ -84,3 +84,7 @@ obj-$(CONFIG_RENESAS_SDHI) += tmio-comm
+ obj-$(CONFIG_MMC_BCM2835) += bcm2835_sdhost.o
+ obj-$(CONFIG_MMC_MTK) += mtk-sd.o
+ obj-$(CONFIG_MMC_SDHCI_F_SDH30) += f_sdh30.o
++
++ifdef CONFIG_MMC_MTK_DEBUG
++CFLAGS_mtk-sd.o += -DDEBUG
++endif
+--- a/drivers/mmc/mtk-sd.c
++++ b/drivers/mmc/mtk-sd.c
+@@ -778,18 +778,24 @@ static int msdc_ops_send_cmd(struct udev
+ if (cmd_ret &&
+ !(cmd_ret == -EIO &&
+ (cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK ||
+- cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK_HS200)))
++ cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK_HS200))) {
++ dev_dbg(dev, "MSDC start command failure with %d, cmd=%d, arg=0x%x\n",
++ cmd_ret, cmd->cmdidx, cmd->cmdarg);
+ return cmd_ret;
+-
+- if (data) {
+- data_ret = msdc_start_data(host, data);
+- if (cmd_ret)
+- return cmd_ret;
+- else
+- return data_ret;
+ }
+
+- return 0;
++ if (!data)
++ return cmd_ret;
++
++ data_ret = msdc_start_data(host, data);
++ if (cmd_ret)
++ return cmd_ret;
++
++ if (data_ret)
++ dev_dbg(dev, "MSDC start data failure with %d, cmd=%d, arg=0x%x\n",
++ data_ret, cmd->cmdidx, cmd->cmdarg);
++
++ return data_ret;
+ }
+
+ static void msdc_set_timeout(struct msdc_host *host, u32 ns, u32 clks)