Message ID | 1481168538-29963-2-git-send-email-yangbo.lu@nxp.com |
---|---|
State | Superseded |
Delegated to: | York Sun |
Headers | show |
On 12/07/2016 07:42 PM, Yangbo Lu wrote: > The LS1012AQDS board has a hardware issue. When there is no eMMC > adapter card inserted in SDHC2 adapter slot, the command inhibit > bits of eSDHC2_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 for QDS to > disable SDHC2 status if no eMMC adapter card is detected. > > Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> > --- > Changes for v2: > - Added annotation in code > - Added return value > - Modified commit message > Changes for v3: > - None > --- > board/freescale/ls1012aqds/ls1012aqds.c | 28 ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > > diff --git a/board/freescale/ls1012aqds/ls1012aqds.c b/board/freescale/ls1012aqds/ls1012aqds.c > index 94440b3..88fb4ce 100644 > --- a/board/freescale/ls1012aqds/ls1012aqds.c > +++ b/board/freescale/ls1012aqds/ls1012aqds.c > @@ -121,6 +121,34 @@ 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); Don't you need to search it by compatible? Is the path always correct? I guess it is always "okay" for esdhc0? This new function doesn't check hwconfig. Do you need to check? > + > + /* > + * The Presence Detect 2 register detects the installation > + * of cards in various PCI Express or SGMII slots. > + * > + * STAT_PRS2[7:5]: Specifies the type of card installed in the > + * SDHC2 Adapter slot. 0b111 indicates no adapter is installed. > + */ > + card_id = (QIXIS_READ(present2) & 0xe0) >> 5; > + > + /* If no adapter is installed in SDHC2, disable SDHC2 */ > + 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); > + return 0; > +} > + > #ifdef CONFIG_OF_BOARD_SETUP > int ft_board_setup(void *blob, bd_t *bd) > { > York
> -----Original Message----- > From: york sun > Sent: Friday, January 13, 2017 1:09 AM > To: Y.B. Lu; u-boot@lists.denx.de > Subject: Re: [U-Boot, v3, 2/3] armv8: ls1012a: define esdhc_status_fixup > for QDS board > > On 12/07/2016 07:42 PM, Yangbo Lu wrote: > > The LS1012AQDS board has a hardware issue. When there is no eMMC > > adapter card inserted in SDHC2 adapter slot, the command inhibit bits > > of eSDHC2_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 for QDS to disable > > SDHC2 status if no eMMC adapter card is detected. > > > > Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> > > --- > > Changes for v2: > > - Added annotation in code > > - Added return value > > - Modified commit message > > Changes for v3: > > - None > > --- > > board/freescale/ls1012aqds/ls1012aqds.c | 28 > > ++++++++++++++++++++++++++++ > > 1 file changed, 28 insertions(+) > > > > diff --git a/board/freescale/ls1012aqds/ls1012aqds.c > > b/board/freescale/ls1012aqds/ls1012aqds.c > > index 94440b3..88fb4ce 100644 > > --- a/board/freescale/ls1012aqds/ls1012aqds.c > > +++ b/board/freescale/ls1012aqds/ls1012aqds.c > > @@ -121,6 +121,34 @@ 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); > > Don't you need to search it by compatible? Is the path always correct? [Lu Yangbo-B47093] Both eSDHC controllers of ls1012a have below compatibles. 'fsl,esdhc' 'fsl,ls1012a-esdhc' Different compatibles for the two eSDHC controllers are not rejected since they are the same IP. The path will always be correct for ls1012a. > > I guess it is always "okay" for esdhc0? > This new function doesn't check hwconfig. Do you need to check? > [Lu Yangbo-B47093] Yes. Because this function is for ls1012aqds board. I removed hwconfig checking which it doesn't need. > > + > > + /* > > + * The Presence Detect 2 register detects the installation > > + * of cards in various PCI Express or SGMII slots. > > + * > > + * STAT_PRS2[7:5]: Specifies the type of card installed in the > > + * SDHC2 Adapter slot. 0b111 indicates no adapter is installed. > > + */ > > + card_id = (QIXIS_READ(present2) & 0xe0) >> 5; > > + > > + /* If no adapter is installed in SDHC2, disable SDHC2 */ > > + 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); > > + return 0; > > +} > > + > > #ifdef CONFIG_OF_BOARD_SETUP > > int ft_board_setup(void *blob, bd_t *bd) { > > > > York
diff --git a/board/freescale/ls1012aqds/ls1012aqds.c b/board/freescale/ls1012aqds/ls1012aqds.c index 94440b3..88fb4ce 100644 --- a/board/freescale/ls1012aqds/ls1012aqds.c +++ b/board/freescale/ls1012aqds/ls1012aqds.c @@ -121,6 +121,34 @@ 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); + + /* + * The Presence Detect 2 register detects the installation + * of cards in various PCI Express or SGMII slots. + * + * STAT_PRS2[7:5]: Specifies the type of card installed in the + * SDHC2 Adapter slot. 0b111 indicates no adapter is installed. + */ + card_id = (QIXIS_READ(present2) & 0xe0) >> 5; + + /* If no adapter is installed in SDHC2, disable SDHC2 */ + 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); + return 0; +} + #ifdef CONFIG_OF_BOARD_SETUP int ft_board_setup(void *blob, bd_t *bd) {
The LS1012AQDS board has a hardware issue. When there is no eMMC adapter card inserted in SDHC2 adapter slot, the command inhibit bits of eSDHC2_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 for QDS to disable SDHC2 status if no eMMC adapter card is detected. Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> --- Changes for v2: - Added annotation in code - Added return value - Modified commit message Changes for v3: - None --- board/freescale/ls1012aqds/ls1012aqds.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)