openwrtv3/package/boot/uboot-layerscape/patches/0056-mmc-fsl_esdhc-disable-sdhc2-when-no-card-inserted-fo.patch
Yutang Jiang 15a14cf166 layerscape: add 64b/32b target for ls1012ardb device
The QorIQ LS1012A processor, optimized for battery-backed or
USB-powered, integrates a single ARM Cortex-A53 core with a hardware
packet forwarding engine and high-speed interfaces to deliver
line-rate networking performance.
QorIQ LS1012A Reference Design System (LS1012ARDB) is a high-performance
development platform, with a complete debugging environment.
The LS1012ARDB board supports the QorIQ LS1012A processor and is
optimized to support the high-bandwidth DDR3L memory and
a full complement of high-speed SerDes ports.

LEDE/OPENWRT will auto strip executable program file while make. So we
need select CONFIG_NO_STRIP=y while make menuconfig to avoid the ppfe network
fiemware be destroyed, then run make to build ls1012ardb firmware.

The fsl-quadspi flash with jffs2 fs is unstable and arise some failed message.
This issue have noticed the IP owner for investigate, hope he can solve it
earlier. So the ls1012ardb now also provide a xx-firmware.ext4.bin as default
firmware, and the uboot bootcmd will run wrtboot_ext4rfs for "rootfstype=ext4"
bootargs.

Signed-off-by: Yutang Jiang <yutang.jiang@nxp.com>
2016-10-31 17:00:10 +01:00

93 lines
2.6 KiB
Diff

From 22424b4b25faefec704556d47751ad54c811ee09 Mon Sep 17 00:00:00 2001
From: Yangbo Lu <yangbo.lu@nxp.com>
Date: Wed, 15 Jun 2016 15:45:12 +0800
Subject: [PATCH 56/93] mmc: fsl_esdhc: disable sdhc2 when no card inserted
for ls1012aqds
This is a temporary workaround patch for ls1012aqds becasue there
was host controller hardware issue found on some QDS boards when
there was no eMMC adapter card inserted. This would cause below
continious error messages in linux. So this patch is to disable
sdhc2 when finding there isn't card inserted.
"mmc1: Controller never released inhibit bit(s)."
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
board/freescale/ls1012aqds/ls1012aqds.c | 11 +++++++++++
drivers/mmc/fsl_esdhc.c | 9 +++++++++
include/fdt_support.h | 4 +++-
3 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/board/freescale/ls1012aqds/ls1012aqds.c b/board/freescale/ls1012aqds/ls1012aqds.c
index b7365e8..56004ea 100644
--- a/board/freescale/ls1012aqds/ls1012aqds.c
+++ b/board/freescale/ls1012aqds/ls1012aqds.c
@@ -161,6 +161,17 @@ int select_i2c_ch_pca9547(u8 ch)
return 0;
}
+int mmc_check_sdhc2_card(void)
+{
+ u8 card_id;
+
+ card_id = (QIXIS_READ(present2) & 0xe0) >> 5;
+ if (card_id == 0x7)
+ return 0;
+ else
+ return 1;
+}
+
int dram_init(void)
{
mmdc_init();
diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index 2c6e175..98f3cca 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -774,6 +774,11 @@ int fsl_esdhc_mmc_init(bd_t *bis)
#endif
}
+__weak int mmc_check_sdhc2_card(void)
+{
+ return 1;
+}
+
#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT
void mmc_adapter_card_type_ident(void)
{
@@ -817,6 +822,7 @@ void mmc_adapter_card_type_ident(void)
void fdt_fixup_esdhc(void *blob, bd_t *bd)
{
const char *compat = "fsl,esdhc";
+ const char *compat1 = "fsl,ls1012a-esdhc1";
#ifdef CONFIG_FSL_ESDHC_PIN_MUX
if (!hwconfig("esdhc")) {
@@ -839,5 +845,8 @@ void fdt_fixup_esdhc(void *blob, bd_t *bd)
#endif
do_fixup_by_compat(blob, compat, "status", "okay",
4 + 1, 1);
+ if (!mmc_check_sdhc2_card())
+ do_fixup_by_compat(blob, compat1, "status", "disabled",
+ 4 + 1, 1);
}
#endif
diff --git a/include/fdt_support.h b/include/fdt_support.h
index 296add0..2e66eb1 100644
--- a/include/fdt_support.h
+++ b/include/fdt_support.h
@@ -240,7 +240,9 @@ int arch_fixup_memory_node(void *blob);
int fdt_setup_simplefb_node(void *fdt, int node, u64 base_address, u32 width,
u32 height, u32 stride, const char *format);
-
+#ifdef CONFIG_FSL_ESDHC
+int mmc_check_sdhc2_card(void);
+#endif
#endif /* ifdef CONFIG_OF_LIBFDT */
#ifdef USE_HOSTCC
--
1.7.9.5