Commit 44cdb5b6a10a7eb2e240866cb842e44ff9999960
Committed by
York Sun
1 parent
cf71338ee7
Exists in
smarc_8mq_lf_v2020.04
and in
17 other branches
armv8: ls1088ardb: support force SDHC mode by hwconfig
The BRDCFG5[SPISDHC] register field of Qixis device is used to control SPI and SDHC signal routing. 10 = Force SDHC Mode - SPI_CS[0] is routed to CPLD for SDHC_VS use. - SPI_CS[1] is unused. - SPI_CS[2:3] are routed to the TDMRiser slot. 11 = Force eMMC Mode - SPI_CS[0:3] are routed to the eMMC card. 0X = Auto Mode - If SDHC_CS_B=0 (SDHC card installed): Use SDHC mode described above. - Else SDHC_CS_B=1 (no SDHC card installed): Use eMMC mode described above. In default the hardware uses auto mode, but sometimes we need to use force SDHC mode to support SD card hotplug, or SD sleep waking up in kernel. This patch is to support force SDHC mode by hwconfig. Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
Showing 3 changed files with 26 additions and 0 deletions Side-by-side Diff
board/freescale/ls1088a/ls1088a.c
... | ... | @@ -18,6 +18,7 @@ |
18 | 18 | #include <environment.h> |
19 | 19 | #include <asm/arch-fsl-layerscape/soc.h> |
20 | 20 | #include <asm/arch/ppa.h> |
21 | +#include <hwconfig.h> | |
21 | 22 | |
22 | 23 | #include "../common/qixis.h" |
23 | 24 | #include "ls1088a_qixis.h" |
... | ... | @@ -295,6 +296,23 @@ |
295 | 296 | /*return the default channel*/ |
296 | 297 | select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT); |
297 | 298 | } |
299 | + | |
300 | +#ifdef CONFIG_MISC_INIT_R | |
301 | +int misc_init_r(void) | |
302 | +{ | |
303 | +#ifdef CONFIG_TARGET_LS1088ARDB | |
304 | + u8 brdcfg5; | |
305 | + | |
306 | + if (hwconfig("esdhc-force-sd")) { | |
307 | + brdcfg5 = QIXIS_READ(brdcfg[5]); | |
308 | + brdcfg5 &= ~BRDCFG5_SPISDHC_MASK; | |
309 | + brdcfg5 |= BRDCFG5_FORCE_SD; | |
310 | + QIXIS_WRITE(brdcfg[5], brdcfg5); | |
311 | + } | |
312 | +#endif | |
313 | + return 0; | |
314 | +} | |
315 | +#endif | |
298 | 316 | |
299 | 317 | int board_init(void) |
300 | 318 | { |
board/freescale/ls1088a/ls1088a_qixis.h
include/configs/ls1088ardb.h