diff mbox

[U-Boot,2/2] armv8: ls1012a: define esdhc_status_fixup for QDS board

Message ID 1481098837-1248-2-git-send-email-yangbo.lu@nxp.com
State Superseded
Delegated to: York Sun
Headers show

Commit Message

Yangbo Lu Dec. 7, 2016, 8:20 a.m. UTC
The LS1012AQDS board has a hardware issue. When there is no eMMC
adapter card inserted, the command inhibit bits of eSDHC_PRSSTAT
register will never release. This would cause below continious
error messages in linux since it uses polling mode to detect card.
"mmc1: Controller never released inhibit bit(s)."
"mmc1: Controller never released inhibit bit(s)."
"mmc1: Controller never released inhibit bit(s)."
This patch is to define esdhc_status_fixup function to disable eSDHC2
status if no eMMC adapter card is detected.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
 board/freescale/ls1012aqds/ls1012aqds.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

Comments

York Sun Dec. 7, 2016, 4:03 p.m. UTC | #1
On 12/07/2016 12:34 AM, Yangbo Lu wrote:
> The LS1012AQDS board has a hardware issue. When there is no eMMC
> adapter card inserted, the command inhibit bits of eSDHC_PRSSTAT
> register will never release. This would cause below continious
> error messages in linux since it uses polling mode to detect card.
> "mmc1: Controller never released inhibit bit(s)."
> "mmc1: Controller never released inhibit bit(s)."
> "mmc1: Controller never released inhibit bit(s)."
> This patch is to define esdhc_status_fixup function to disable eSDHC2
> status if no eMMC adapter card is detected.
>
> Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
> ---
>  board/freescale/ls1012aqds/ls1012aqds.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
>
> diff --git a/board/freescale/ls1012aqds/ls1012aqds.c b/board/freescale/ls1012aqds/ls1012aqds.c
> index 94440b3..a3229f7 100644
> --- a/board/freescale/ls1012aqds/ls1012aqds.c
> +++ b/board/freescale/ls1012aqds/ls1012aqds.c
> @@ -121,6 +121,25 @@ int board_eth_init(bd_t *bis)
>  	return pci_eth_init(bis);
>  }
>
> +int esdhc_status_fixup(void *blob, const char *compat)
> +{
> +	char esdhc0_path[] = "/soc/esdhc@1560000";
> +	char esdhc1_path[] = "/soc/esdhc@1580000";
> +	u8 card_id;
> +
> +	do_fixup_by_path(blob, esdhc0_path, "status", "okay",
> +			 sizeof("okay"), 1);
> +

This controller is always "okay", isn't it?

> +	card_id = (QIXIS_READ(present2) & 0xe0) >> 5;
> +
> +	if (card_id == 0x7)

Please put a comment here to explain what present2 has and what 0x7 is.

> +		do_fixup_by_path(blob, esdhc1_path, "status", "disabled",
> +				 sizeof("disabled"), 1);
> +	else
> +		do_fixup_by_path(blob, esdhc1_path, "status", "okay",
> +				 sizeof("okay"), 1);
> +}
> +

York
Yangbo Lu Dec. 8, 2016, 3:49 a.m. UTC | #2
> -----Original Message-----
> From: york sun
> Sent: Thursday, December 08, 2016 12:03 AM
> To: Y.B. Lu; u-boot@lists.denx.de
> Subject: Re: [PATCH 2/2] armv8: ls1012a: define esdhc_status_fixup for
> QDS board
> 
> On 12/07/2016 12:34 AM, Yangbo Lu wrote:
> > The LS1012AQDS board has a hardware issue. When there is no eMMC
> > adapter card inserted, the command inhibit bits of eSDHC_PRSSTAT
> > register will never release. This would cause below continious error
> > messages in linux since it uses polling mode to detect card.
> > "mmc1: Controller never released inhibit bit(s)."
> > "mmc1: Controller never released inhibit bit(s)."
> > "mmc1: Controller never released inhibit bit(s)."
> > This patch is to define esdhc_status_fixup function to disable eSDHC2
> > status if no eMMC adapter card is detected.
> >
> > Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
> > ---
> >  board/freescale/ls1012aqds/ls1012aqds.c | 19 +++++++++++++++++++
> >  1 file changed, 19 insertions(+)
> >
> > diff --git a/board/freescale/ls1012aqds/ls1012aqds.c
> > b/board/freescale/ls1012aqds/ls1012aqds.c
> > index 94440b3..a3229f7 100644
> > --- a/board/freescale/ls1012aqds/ls1012aqds.c
> > +++ b/board/freescale/ls1012aqds/ls1012aqds.c
> > @@ -121,6 +121,25 @@ int board_eth_init(bd_t *bis)
> >  	return pci_eth_init(bis);
> >  }
> >
> > +int esdhc_status_fixup(void *blob, const char *compat) {
> > +	char esdhc0_path[] = "/soc/esdhc@1560000";
> > +	char esdhc1_path[] = "/soc/esdhc@1580000";
> > +	u8 card_id;
> > +
> > +	do_fixup_by_path(blob, esdhc0_path, "status", "okay",
> > +			 sizeof("okay"), 1);
> > +
> 
> This controller is always "okay", isn't it?

[Lu Yangbo-B47093] Yes. Only sdhc2 has issue. I will emphasize it's sdhc2 in commit message.

> 
> > +	card_id = (QIXIS_READ(present2) & 0xe0) >> 5;
> > +
> > +	if (card_id == 0x7)
> 
> Please put a comment here to explain what present2 has and what 0x7 is.

[Lu Yangbo-B47093] No problem, thanks. Will send the v2.

> 
> > +		do_fixup_by_path(blob, esdhc1_path, "status", "disabled",
> > +				 sizeof("disabled"), 1);
> > +	else
> > +		do_fixup_by_path(blob, esdhc1_path, "status", "okay",
> > +				 sizeof("okay"), 1);
> > +}
> > +
> 
> York
diff mbox

Patch

diff --git a/board/freescale/ls1012aqds/ls1012aqds.c b/board/freescale/ls1012aqds/ls1012aqds.c
index 94440b3..a3229f7 100644
--- a/board/freescale/ls1012aqds/ls1012aqds.c
+++ b/board/freescale/ls1012aqds/ls1012aqds.c
@@ -121,6 +121,25 @@  int board_eth_init(bd_t *bis)
 	return pci_eth_init(bis);
 }
 
+int esdhc_status_fixup(void *blob, const char *compat)
+{
+	char esdhc0_path[] = "/soc/esdhc@1560000";
+	char esdhc1_path[] = "/soc/esdhc@1580000";
+	u8 card_id;
+
+	do_fixup_by_path(blob, esdhc0_path, "status", "okay",
+			 sizeof("okay"), 1);
+
+	card_id = (QIXIS_READ(present2) & 0xe0) >> 5;
+
+	if (card_id == 0x7)
+		do_fixup_by_path(blob, esdhc1_path, "status", "disabled",
+				 sizeof("disabled"), 1);
+	else
+		do_fixup_by_path(blob, esdhc1_path, "status", "okay",
+				 sizeof("okay"), 1);
+}
+
 #ifdef CONFIG_OF_BOARD_SETUP
 int ft_board_setup(void *blob, bd_t *bd)
 {