public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v0] mmc: forced sector mode when accessing OCR register
@ 2012-11-29 11:05 Davide Bonfanti
  2012-11-29 15:10 ` Jae hoon Chung
  0 siblings, 1 reply; 3+ messages in thread
From: Davide Bonfanti @ 2012-11-29 11:05 UTC (permalink / raw)
  To: u-boot

Some eMMC require this setting to work properly.
Tested on:
 - Toshiba THGBM2G8D8FBAIB (the one giving the problem)
 - Toshiba THGBM4G4D1HBAR
 - Micron MTFC4GMVEA
 - Hynix H26M64002BNR
 - SanDisk SDIN5E1-32G


Signed-off-by: Davide Bonfanti <davide.bonfanti@bticino.it>
---
 drivers/mmc/mmc.c |    3 ++-
 include/mmc.h     |    1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 5ffd8c5..cf66811 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -530,7 +530,8 @@ static int mmc_send_op_cond(struct mmc *mmc)
   cmd.cmdarg = (mmc_host_is_spi(mmc) ? 0 :
     (mmc->voltages &
     (cmd.response[0] & OCR_VOLTAGE_MASK)) |
-    (cmd.response[0] & OCR_ACCESS_MODE));
+    (cmd.response[0] & OCR_ACCESS_MODE)) |
+    OCR_ACCESS_SECTOR_MODE;
 
   if (mmc->host_caps & MMC_MODE_HC)
    cmd.cmdarg |= OCR_HCS;
diff --git a/include/mmc.h b/include/mmc.h
index a13e2bd..f1314d8 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -108,6 +108,7 @@
 #define OCR_HCS   0x40000000
 #define OCR_VOLTAGE_MASK 0x007FFF80
 #define OCR_ACCESS_MODE  0x60000000
+#define OCR_ACCESS_SECTOR_MODE  (1 << 30)
 
 #define SECURE_ERASE  0x80000000
 
-- 
1.7.9.5



Ce message, ainsi que tous les fichiers joints ? ce message,
peuvent contenir des informations sensibles et/ ou confidentielles
ne devant pas ?tre divulgu?es. Si vous n'?tes pas le destinataire
de ce message (ou que vous recevez ce message par erreur), nous
vous remercions de le notifier imm?diatement ? son exp?diteur, et
de d?truire ce message. Toute copie, divulgation, modification,
utilisation ou diffusion, non autoris?e, directe ou indirecte, de
tout ou partie de ce message, est strictement interdite.

This e-mail, and any document attached hereby, may contain
confidential and/or privileged information. If you are not the
intended recipient (or have received this e-mail in error) please
notify the sender immediately and destroy this e-mail. Any
unauthorized, direct or indirect, copying, disclosure, distribution
or other use of the material or parts thereof is strictly
forbidden.

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH v0] mmc: forced sector mode when accessing OCR register
  2012-11-29 11:05 [U-Boot] [PATCH v0] mmc: forced sector mode when accessing OCR register Davide Bonfanti
@ 2012-11-29 15:10 ` Jae hoon Chung
  2012-11-29 16:13   ` davide.bonfanti at bticino.it
  0 siblings, 1 reply; 3+ messages in thread
From: Jae hoon Chung @ 2012-11-29 15:10 UTC (permalink / raw)
  To: u-boot

Hi,

i didn't understand why need to set by force?

Best Regards,
Jaehoon Chung

2012/11/29 Davide Bonfanti <davide.bonfanti@bticino.it>:
> Some eMMC require this setting to work properly.
> Tested on:
>  - Toshiba THGBM2G8D8FBAIB (the one giving the problem)
>  - Toshiba THGBM4G4D1HBAR
>  - Micron MTFC4GMVEA
>  - Hynix H26M64002BNR
>  - SanDisk SDIN5E1-32G
>
>
> Signed-off-by: Davide Bonfanti <davide.bonfanti@bticino.it>
> ---
>  drivers/mmc/mmc.c |    3 ++-
>  include/mmc.h     |    1 +
>  2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index 5ffd8c5..cf66811 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -530,7 +530,8 @@ static int mmc_send_op_cond(struct mmc *mmc)
>    cmd.cmdarg = (mmc_host_is_spi(mmc) ? 0 :
>      (mmc->voltages &
>      (cmd.response[0] & OCR_VOLTAGE_MASK)) |
> -    (cmd.response[0] & OCR_ACCESS_MODE));
> +    (cmd.response[0] & OCR_ACCESS_MODE)) |
> +    OCR_ACCESS_SECTOR_MODE;
>
>    if (mmc->host_caps & MMC_MODE_HC)
>     cmd.cmdarg |= OCR_HCS;
> diff --git a/include/mmc.h b/include/mmc.h
> index a13e2bd..f1314d8 100644
> --- a/include/mmc.h
> +++ b/include/mmc.h
> @@ -108,6 +108,7 @@
>  #define OCR_HCS   0x40000000
>  #define OCR_VOLTAGE_MASK 0x007FFF80
>  #define OCR_ACCESS_MODE  0x60000000
> +#define OCR_ACCESS_SECTOR_MODE  (1 << 30)
>
>  #define SECURE_ERASE  0x80000000
>
> --
> 1.7.9.5
>
>
>
> Ce message, ainsi que tous les fichiers joints ? ce message,
> peuvent contenir des informations sensibles et/ ou confidentielles
> ne devant pas ?tre divulgu?es. Si vous n'?tes pas le destinataire
> de ce message (ou que vous recevez ce message par erreur), nous
> vous remercions de le notifier imm?diatement ? son exp?diteur, et
> de d?truire ce message. Toute copie, divulgation, modification,
> utilisation ou diffusion, non autoris?e, directe ou indirecte, de
> tout ou partie de ce message, est strictement interdite.
>
> This e-mail, and any document attached hereby, may contain
> confidential and/or privileged information. If you are not the
> intended recipient (or have received this e-mail in error) please
> notify the sender immediately and destroy this e-mail. Any
> unauthorized, direct or indirect, copying, disclosure, distribution
> or other use of the material or parts thereof is strictly
> forbidden.
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH v0] mmc: forced sector mode when accessing OCR register
  2012-11-29 15:10 ` Jae hoon Chung
@ 2012-11-29 16:13   ` davide.bonfanti at bticino.it
  0 siblings, 0 replies; 3+ messages in thread
From: davide.bonfanti at bticino.it @ 2012-11-29 16:13 UTC (permalink / raw)
  To: u-boot

It seems to me a bug of the specific mmc like if that it declares byte-mode, but supports only sector mode.

Sincerely I don't know if it is a good idea to accept a workaround like this, but this is the only way I found to have my board working.

Best Regards,
Davide Bonfanti

-----Jae hoon Chung <jh80.chung@gmail.com> ha scritto: -----Per: Davide Bonfanti <davide.bonfanti@bticino.it>
Da: Jae hoon Chung <jh80.chung@gmail.com>
Data: 29/11/2012 16:10
Cc: u-boot at lists.denx.de, afleming at gmail.com, Jaehoon Chung <jh80.chung@samsung.com>
Oggetto: Re: [U-Boot] [PATCH v0] mmc: forced sector mode when accessing OCR register

Hi,

i didn't understand why need to set by force?

Best Regards,
Jaehoon Chung

2012/11/29 Davide Bonfanti <davide.bonfanti@bticino.it>:
> Some eMMC require this setting to work properly.
> Tested on:
> ?- Toshiba THGBM2G8D8FBAIB (the one giving the problem)
> ?- Toshiba THGBM4G4D1HBAR
> ?- Micron MTFC4GMVEA
> ?- Hynix H26M64002BNR
> ?- SanDisk SDIN5E1-32G
>
>
> Signed-off-by: Davide Bonfanti <davide.bonfanti@bticino.it>
> ---
> ?drivers/mmc/mmc.c | ? ?3 ++-
> ?include/mmc.h ? ? | ? ?1 +
> ?2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index 5ffd8c5..cf66811 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -530,7 +530,8 @@ static int mmc_send_op_cond(struct mmc *mmc)
> ? ?cmd.cmdarg = (mmc_host_is_spi(mmc) ? 0 :
> ? ? ?(mmc->voltages &
> ? ? ?(cmd.response[0] & OCR_VOLTAGE_MASK)) |
> - ? ?(cmd.response[0] & OCR_ACCESS_MODE));
> + ? ?(cmd.response[0] & OCR_ACCESS_MODE)) |
> + ? ?OCR_ACCESS_SECTOR_MODE;
>
> ? ?if (mmc->host_caps & MMC_MODE_HC)
> ? ? cmd.cmdarg |= OCR_HCS;
> diff --git a/include/mmc.h b/include/mmc.h
> index a13e2bd..f1314d8 100644
> --- a/include/mmc.h
> +++ b/include/mmc.h
> @@ -108,6 +108,7 @@
> ?#define OCR_HCS ? 0x40000000
> ?#define OCR_VOLTAGE_MASK 0x007FFF80
> ?#define OCR_ACCESS_MODE ?0x60000000
> +#define OCR_ACCESS_SECTOR_MODE ?(1 << 30)
>
> ?#define SECURE_ERASE ?0x80000000
>
> --
> 1.7.9.5
>
>
>
> Ce message, ainsi que tous les fichiers joints ? ce message,
> peuvent contenir des informations sensibles et/ ou confidentielles
> ne devant pas ?tre divulgu?es. Si vous n'?tes pas le destinataire
> de ce message (ou que vous recevez ce message par erreur), nous
> vous remercions de le notifier imm?diatement ? son exp?diteur, et
> de d?truire ce message. Toute copie, divulgation, modification,
> utilisation ou diffusion, non autoris?e, directe ou indirecte, de
> tout ou partie de ce message, est strictement interdite.
>
> This e-mail, and any document attached hereby, may contain
> confidential and/or privileged information. If you are not the
> intended recipient (or have received this e-mail in error) please
> notify the sender immediately and destroy this e-mail. Any
> unauthorized, direct or indirect, copying, disclosure, distribution
> or other use of the material or parts thereof is strictly
> forbidden.
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-29 16:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-29 11:05 [U-Boot] [PATCH v0] mmc: forced sector mode when accessing OCR register Davide Bonfanti
2012-11-29 15:10 ` Jae hoon Chung
2012-11-29 16:13   ` davide.bonfanti at bticino.it

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox