Re: [U-Boot] [PATCH 1/3 V3] esdhc: Workaround for card can't be detected on T4240QDS

2014-01-22 Thread Pantelis Antoniou
Hi Haijun,

On Jan 10, 2014, at 7:52 AM, Haijun Zhang wrote:

 Card detection pin is ineffective on T4240QDS Rev1.0.
 There are two cards can be connected to board.
 1. eMMC card is built-in board, can not be removed. so
   For eMMC card it is always there.
 2. Card detecting pin is functional for SDHC card in Rev2.0.
 
 This workaround force sdhc driver scan and initialize the card
 regardless of whether the card is inserted or not in case Rev1.0.
 
 Signed-off-by: Haijun Zhang haijun.zh...@freescale.com
 ---
 changes for V3:
   - Define quirk in board specific file instead of code in driver
 changes for V2:
   - Add the judgement condition for this broken card
 
 drivers/mmc/fsl_esdhc.c| 4 
 include/configs/T4240QDS.h | 5 +
 2 files changed, 9 insertions(+)
 
 diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
 index e522a70..2ee93cd 100644
 --- a/drivers/mmc/fsl_esdhc.c
 +++ b/drivers/mmc/fsl_esdhc.c
 @@ -548,6 +548,10 @@ static int esdhc_getcd(struct mmc *mmc)
   struct fsl_esdhc *regs = (struct fsl_esdhc *)cfg-esdhc_base;
   int timeout = 1000;
 
 +#ifdef CONFIG_ESDHC_DETECT_QUIRK
 + if (CONFIG_ESDHC_DETECT_QUIRK)
 + return 1;
 +#endif
   while (!(esdhc_read32(regs-prsstat)  PRSSTAT_CINS)  --timeout)
   udelay(1000);
 
 diff --git a/include/configs/T4240QDS.h b/include/configs/T4240QDS.h
 index c96df54..0e0b346 100644
 --- a/include/configs/T4240QDS.h
 +++ b/include/configs/T4240QDS.h
 @@ -165,6 +165,8 @@ unsigned long get_board_ddr_clk(void);
 #define QIXIS_RCFG_CTL_RECONFIG_IDLE  0x20
 #define QIXIS_RCFG_CTL_RECONFIG_START 0x21
 #define QIXIS_RCFG_CTL_WATCHDOG_ENBLE 0x08
 +#define QIXIS_BRDCFG50x55
 +#define QIXIS_MUX_SDHC   2
 #define QIXIS_BASE_PHYS   (0xfull | QIXIS_BASE)
 
 #define CONFIG_SYS_CSPR3_EXT  (0xf)
 @@ -466,6 +468,9 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_CMD_FAT
 #define CONFIG_DOS_PARTITION
 #define CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33
 +#define CONFIG_ESDHC_DETECT_QUIRK \
 + (!(readb(QIXIS_BASE + QIXIS_BRDCFG5)  QIXIS_MUX_SDHC) || \
 + IS_SVR_REV(get_svr(), 1, 0))
 #endif
 
 #define CONFIG_BOOTDELAY  10  /* -1 disables auto-boot */
 -- 
 1.8.4.1
 
 

Acked-by: Pantelis Antoniou pa...@antoniou-consulting.com

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/3 V3] esdhc: Workaround for card can't be detected on T4240QDS

2014-01-22 Thread Pantelis Antoniou
Hi York,

On Jan 22, 2014, at 12:01 AM, York Sun wrote:

 Pantelis,
 
 On 01/09/2014 09:52 PM, Haijun Zhang wrote:
 Card detection pin is ineffective on T4240QDS Rev1.0.
 There are two cards can be connected to board.
 1. eMMC card is built-in board, can not be removed. so
   For eMMC card it is always there.
 2. Card detecting pin is functional for SDHC card in Rev2.0.
 
 This workaround force sdhc driver scan and initialize the card
 regardless of whether the card is inserted or not in case Rev1.0.
 
 Signed-off-by: Haijun Zhang haijun.zh...@freescale.com
 ---
 changes for V3:
  - Define quirk in board specific file instead of code in driver
 changes for V2:
  - Add the judgement condition for this broken card
 
 
 I think this set of patches are in your backyard. If you ack them, I can apply
 them to mpc85xx.
 

Go ahead please.

 http://patchwork.ozlabs.org/patch/309168/
 http://patchwork.ozlabs.org/patch/309167/
 http://patchwork.ozlabs.org/patch/309170/
 
 York
 

Regards

-- Pantelis

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/3 V3] esdhc: Workaround for card can't be detected on T4240QDS

2014-01-22 Thread Zhang Haijun

Many thanks.

Pantelis and York

How about below patch?

http://patchwork.ozlabs.org/patch/283002/

It's about esdhc, but is in york's backyard.


Regards

Haijun

On 01/22/2014 08:01 PM, Pantelis Antoniou wrote:

Hi York,

On Jan 22, 2014, at 12:01 AM, York Sun wrote:


Pantelis,

On 01/09/2014 09:52 PM, Haijun Zhang wrote:

Card detection pin is ineffective on T4240QDS Rev1.0.
There are two cards can be connected to board.
1. eMMC card is built-in board, can not be removed. so
   For eMMC card it is always there.
2. Card detecting pin is functional for SDHC card in Rev2.0.

This workaround force sdhc driver scan and initialize the card
regardless of whether the card is inserted or not in case Rev1.0.

Signed-off-by: Haijun Zhang haijun.zh...@freescale.com
---
changes for V3:
- Define quirk in board specific file instead of code in driver
changes for V2:
- Add the judgement condition for this broken card


I think this set of patches are in your backyard. If you ack them, I can apply
them to mpc85xx.


Go ahead please.


http://patchwork.ozlabs.org/patch/309168/
http://patchwork.ozlabs.org/patch/309167/
http://patchwork.ozlabs.org/patch/309170/

York


Regards

-- Pantelis





___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/3 V3] esdhc: Workaround for card can't be detected on T4240QDS

2014-01-21 Thread York Sun
Pantelis,

On 01/09/2014 09:52 PM, Haijun Zhang wrote:
 Card detection pin is ineffective on T4240QDS Rev1.0.
 There are two cards can be connected to board.
 1. eMMC card is built-in board, can not be removed. so
For eMMC card it is always there.
 2. Card detecting pin is functional for SDHC card in Rev2.0.
 
 This workaround force sdhc driver scan and initialize the card
 regardless of whether the card is inserted or not in case Rev1.0.
 
 Signed-off-by: Haijun Zhang haijun.zh...@freescale.com
 ---
 changes for V3:
   - Define quirk in board specific file instead of code in driver
 changes for V2:
   - Add the judgement condition for this broken card
 

I think this set of patches are in your backyard. If you ack them, I can apply
them to mpc85xx.

http://patchwork.ozlabs.org/patch/309168/
http://patchwork.ozlabs.org/patch/309167/
http://patchwork.ozlabs.org/patch/309170/

York

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/3 V3] esdhc: Workaround for card can't be detected on T4240QDS

2014-01-09 Thread Haijun Zhang
Card detection pin is ineffective on T4240QDS Rev1.0.
There are two cards can be connected to board.
1. eMMC card is built-in board, can not be removed. so
   For eMMC card it is always there.
2. Card detecting pin is functional for SDHC card in Rev2.0.

This workaround force sdhc driver scan and initialize the card
regardless of whether the card is inserted or not in case Rev1.0.

Signed-off-by: Haijun Zhang haijun.zh...@freescale.com
---
changes for V3:
- Define quirk in board specific file instead of code in driver
changes for V2:
- Add the judgement condition for this broken card

 drivers/mmc/fsl_esdhc.c| 4 
 include/configs/T4240QDS.h | 5 +
 2 files changed, 9 insertions(+)

diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index e522a70..2ee93cd 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -548,6 +548,10 @@ static int esdhc_getcd(struct mmc *mmc)
struct fsl_esdhc *regs = (struct fsl_esdhc *)cfg-esdhc_base;
int timeout = 1000;
 
+#ifdef CONFIG_ESDHC_DETECT_QUIRK
+   if (CONFIG_ESDHC_DETECT_QUIRK)
+   return 1;
+#endif
while (!(esdhc_read32(regs-prsstat)  PRSSTAT_CINS)  --timeout)
udelay(1000);
 
diff --git a/include/configs/T4240QDS.h b/include/configs/T4240QDS.h
index c96df54..0e0b346 100644
--- a/include/configs/T4240QDS.h
+++ b/include/configs/T4240QDS.h
@@ -165,6 +165,8 @@ unsigned long get_board_ddr_clk(void);
 #define QIXIS_RCFG_CTL_RECONFIG_IDLE   0x20
 #define QIXIS_RCFG_CTL_RECONFIG_START  0x21
 #define QIXIS_RCFG_CTL_WATCHDOG_ENBLE  0x08
+#define QIXIS_BRDCFG5  0x55
+#define QIXIS_MUX_SDHC 2
 #define QIXIS_BASE_PHYS(0xfull | QIXIS_BASE)
 
 #define CONFIG_SYS_CSPR3_EXT   (0xf)
@@ -466,6 +468,9 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_CMD_FAT
 #define CONFIG_DOS_PARTITION
 #define CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33
+#define CONFIG_ESDHC_DETECT_QUIRK \
+   (!(readb(QIXIS_BASE + QIXIS_BRDCFG5)  QIXIS_MUX_SDHC) || \
+   IS_SVR_REV(get_svr(), 1, 0))
 #endif
 
 #define CONFIG_BOOTDELAY   10  /* -1 disables auto-boot */
-- 
1.8.4.1


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot