public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Przemyslaw Marczak <p.marczak@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] "Writing to MMC(%d)... failed"
Date: Fri, 27 Feb 2015 14:16:41 +0100	[thread overview]
Message-ID: <54F06E39.6090509@samsung.com> (raw)
In-Reply-To: <BLU437-SMTP95124F81BC0A5364289E0CA2140@phx.gbl>

Hi,

On 02/27/2015 12:59 AM, Nathan wrote:
> I think I've been able to narrow down, a bit, where the issue is coming from.
>
> "mmc_set_blocklen" led me to "mmc_send_cmd" which showed that there is
> the "CONFIG_MMC_TRACE" I could use.
>
> A notable difference between hardkernel's u-boot and mainline was the
> "uint flags;" was no longer in the "mmc_cmd" struct.
>
> I did see that this removal was noted as being a problem back in 2012:
> http://lists.denx.de/pipermail/u-boot/2012-September/133409.html
>
> The result from "saveenv":
>

This is too late for debug. The same result I can see when my card is 
not inserted.

> Odroid # saveenv
>
>
> Saving Environment to MMC...
>
>
> Writing to MMC(0)... CMD_SEND:16
>
>
>                  ARG                      0x00000200
>
>
> ret: -19
>
>
>                  MMC_RSP_R1,5,6,7         0x00000000
>
> I added the "printf" for "ret".
>

You should follow the card init sequence with the trace config, because 
it fails at init. This is the trace output from init sequence of my SD card:

MMC:   SAMSUNG SDHCI: 0, EXYNOS DWMMC: 1
CMD_SEND:0
                 ARG                      0x00000000
                 MMC_RSP_NONE
CMD_SEND:8
                 ARG                      0x000001AA
                 MMC_RSP_R1,5,6,7         0x000001AA
CMD_SEND:55
                 ARG                      0x00000000
                 MMC_RSP_R1,5,6,7         0x00000120
CMD_SEND:41
                 ARG                      0x40300000
                 MMC_RSP_R3,4             0x40FF8000
CMD_SEND:55
                 ARG                      0x00000000
                 MMC_RSP_R1,5,6,7         0x00000120
CMD_SEND:41
                 ARG                      0x40300000
                 MMC_RSP_R3,4             0x40FF8000
CMD_SEND:55
                 ARG                      0x00000000
                 MMC_RSP_R1,5,6,7         0x00000120
CMD_SEND:41
                 ARG                      0x40300000
                 MMC_RSP_R3,4             0xC0FF8000
CMD_SEND:2
                 ARG                      0x00000000
                 MMC_RSP_R2               0x03534453
                                          0x55303447
                                          0x80273727
                                          0x6900E700

                                         DUMPING DATA
                                         000 - 03 53 44 53
                                         004 - 55 30 34 47
                                         008 - 80 27 37 27
                                         012 - 69 00 E7 00
CMD_SEND:3
                 ARG                      0x00000000
                 MMC_RSP_R1,5,6,7         0xAAAA0520
CMD_SEND:9
                 ARG                      0xAAAA0000
                 MMC_RSP_R2               0x400E0032
                                          0x5B590000
                                          0x1D8A7F80
                                          0x0A404000

                                         DUMPING DATA
                                         000 - 40 0E 00 32
                                         004 - 5B 59 00 00
                                         008 - 1D 8A 7F 80
                                         012 - 0A 40 40 00
CMD_SEND:13
                 ARG                      0xAAAA0000
                 MMC_RSP_R1,5,6,7         0x00000700
CURR STATE:3
CMD_SEND:7
                 ARG                      0xAAAA0000
                 MMC_RSP_R1,5,6,7         0x00000700
CMD_SEND:55
                 ARG                      0xAAAA0000
                 MMC_RSP_R1,5,6,7         0x00000920
CMD_SEND:51
                 ARG                      0x00000000
                 MMC_RSP_R1,5,6,7         0x00000920
CMD_SEND:6
                 ARG                      0x00FFFFF1
                 MMC_RSP_R1,5,6,7         0x00000900
CMD_SEND:6
                 ARG                      0x80FFFFF1
                 MMC_RSP_R1,5,6,7         0x00000900
CMD_SEND:55
                 ARG                      0xAAAA0000
                 MMC_RSP_R1,5,6,7         0x00000920
CMD_SEND:6
                 ARG                      0x00000002
                 MMC_RSP_R1,5,6,7         0x00000920
CMD_SEND:16
                 ARG                      0x00000200
                 MMC_RSP_R1,5,6,7         0x00000900
CMD_SEND:17
                 ARG                      0x00000000
                 MMC_RSP_R1,5,6,7         0x00000900
CMD_SEND:16
                 ARG                      0x00000200
                 MMC_RSP_R1,5,6,7         0x00000900
CMD_SEND:17
                 ARG                      0x00000000
                 MMC_RSP_R1,5,6,7         0x00000900
CMD_SEND:16
                 ARG                      0x00000200
                 MMC_RSP_R1,5,6,7         0x00000900
CMD_SEND:18
                 ARG                      0x00000A00
                 MMC_RSP_R1,5,6,7         0x00000900
CMD_SEND:12
                 ARG                      0x00000000
                 MMC_RSP_R1b              0x00000900

I hope this will help you to solve this issue.

Best regards,
-- 
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com

  reply	other threads:[~2015-02-27 13:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-25 19:14 [U-Boot] "Writing to MMC(%d)... failed" Nathan Royce
2015-02-26  0:30 ` Nathan
2015-02-26 23:59   ` Nathan
2015-02-27 13:16     ` Przemyslaw Marczak [this message]
2015-02-27 17:21       ` Nathan
2015-03-10 11:30         ` Nathan
     [not found]         ` <BLU437-SMTP105D4C7DA6754615DB4E45DA2180@phx.gbl>
2015-03-10 13:07           ` Przemyslaw Marczak
2015-03-10 13:14             ` Nathan
2015-03-10 15:12               ` Przemyslaw Marczak
2015-03-12 13:22                 ` Nathan
2015-02-27 13:08   ` Przemyslaw Marczak
  -- strict thread matches above, loose matches on Subject: below --
2015-04-28  5:39 Nathan
     [not found] <BLU436-SMTP127C338DB532C3DF004593EA2E80@phx.gbl>
2015-04-28  8:07 ` Przemyslaw Marczak
     [not found]   ` <BLU437-SMTP496E077CBDBF75F343C04FA2E80@phx.gbl>
2015-04-29  9:15     ` Przemyslaw Marczak
2015-04-29 23:34       ` Nathan
2015-04-30  2:44       ` Nathan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54F06E39.6090509@samsung.com \
    --to=p.marczak@samsung.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox