[U-Boot] [PATCH] armv8: ls1088ardb: support force SDHC mode by hwconfig

York Sun york.sun at nxp.com
Wed Nov 29 19:42:37 UTC 2017


On 11/26/2017 11:59 PM, Yangbo Lu wrote:
> 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.


Help me understand this. When you eject the SD card, does the CPLD logic
detect the SDHC_CS_B and change the signal routing? Are you trying to
fix the signal routing by forcing the mode?

> 
> Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
> ---
>  board/freescale/ls1088a/ls1088a.c       | 18 ++++++++++++++++++
>  board/freescale/ls1088a/ls1088a_qixis.h |  6 ++++++
>  include/configs/ls1088ardb.h            |  2 ++
>  3 files changed, 26 insertions(+)
> 
> diff --git a/board/freescale/ls1088a/ls1088a.c b/board/freescale/ls1088a/ls1088a.c
> index 96d9ae7f1d..60f40edb5a 100644
> --- a/board/freescale/ls1088a/ls1088a.c
> +++ b/board/freescale/ls1088a/ls1088a.c
> @@ -18,6 +18,7 @@
>  #include <environment.h>
>  #include <asm/arch-fsl-layerscape/soc.h>
>  #include <asm/arch/ppa.h>
> +#include <hwconfig.h>
>  
>  #include "../common/qixis.h"
>  #include "ls1088a_qixis.h"
> @@ -296,6 +297,23 @@ void board_retimer_init(void)
>  	select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
>  }
>  
> +#ifdef CONFIG_MISC_INIT_R
> +int misc_init_r(void)
> +{
> +#ifdef CONFIG_TARGET_LS1088ARDB
> +	u8 brdcfg5;
> +
> +	if (hwconfig("esdhc-force-sd")) {
> +		brdcfg5 = QIXIS_READ(brdcfg[5]);
> +		brdcfg5 &= ~BRDCFG5_SPISDHC_MASK;
> +		brdcfg5 |= BRDCFG5_FORCE_SD;
> +		QIXIS_WRITE(brdcfg[5], brdcfg5);
> +	}
> +#endif

Would it be appropriate to check if eMMC is used before taking the
forced value?

York


More information about the U-Boot mailing list