All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot]  [bug report] sunxi: booting from eMMC
@ 2016-09-12 11:53 Ciprian Manea
  2016-09-12 13:56 ` Maxime Ripard
  0 siblings, 1 reply; 42+ messages in thread
From: Ciprian Manea @ 2016-09-12 11:53 UTC (permalink / raw)
  To: u-boot

Hi,


   I'm using a SinA33 dev board (Allwinner a33 SoC) and at the moment I'm
trying to boot from the eMMC.

But it fails in the following way:


*Got the following error at boot time:*
*U-Boot SPL 2016.09-rc2-00125-g6e8b42f (Sep 08 2016 - 11:00:46) DRAM: 1024
MiB Trying to boot from MMC2 MMC Device 1 not found spl: could not find mmc
device. error: -19 SPL: failed to boot from all boot devices ### ERROR ###
Please RESET the board ###*


More info in the linux-sunxi mailing thread:

https://groups.google.com/forum/#!topic/linux-sunxi/U4t-0VcDxLU?


Thanks

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-09-12 11:53 [U-Boot] [bug report] sunxi: booting from eMMC Ciprian Manea
@ 2016-09-12 13:56 ` Maxime Ripard
  2016-09-12 14:47   ` Hans de Goede
  0 siblings, 1 reply; 42+ messages in thread
From: Maxime Ripard @ 2016-09-12 13:56 UTC (permalink / raw)
  To: u-boot

Hi,

On Mon, Sep 12, 2016 at 01:53:24PM +0200, Ciprian Manea wrote:
> I'm using a SinA33 dev board (Allwinner a33 SoC) and at the moment
> I'm trying to boot from the eMMC.
> 
> But it fails in the following way:
> 
> 
> *Got the following error at boot time:*
> *U-Boot SPL 2016.09-rc2-00125-g6e8b42f (Sep 08 2016 - 11:00:46) DRAM: 1024
> MiB Trying to boot from MMC2 MMC Device 1 not found spl: could not find mmc
> device. error: -19 SPL: failed to boot from all boot devices ### ERROR ###
> Please RESET the board ###*

So I've been on the same issue for the last couple of days.

Since that board is already supported, adding support for the eMMC
basically came down to that patch on top of 2016.09-rc2.

http://code.bulix.org/kcgxri-106037?raw

(Quite hackish, the 8-Bits part being a separate issue that would need
to be addressed somehow).

However, it doesn't work, neither when flashing u-boot on the eMMC
itself (where there's a timeout error in the SPL) nor when trying to
access the eMMC from a U-Boot loaded from the (external) SD.

In the latter case, even mmc dev 1 fails silently.

I traced that down to the mmc_switch here:
http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/mmc.c#l530

Which fails with ETIMEDOUT, and more specifically, it's the call to
mmc_rint_wait here
http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/sunxi_mmc.c#l383
that times out.

Increasing the timeout value (to 10000) doesn't really change
anything. I guess this is also the reason why we had a timeout error
in the SPL.

This eMMC works fine in Linux, with the same muxing (and I guess the
earlier commands wouldn't be successful if the muxing or power was not
set up appropriately). So I'm kind of running out of ideas on what
could be the root cause of this.

Hans, any ideas?

Thanks,
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160912/d9cb2058/attachment.sig>

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-09-12 13:56 ` Maxime Ripard
@ 2016-09-12 14:47   ` Hans de Goede
  2016-09-13 11:50     ` Maxime Ripard
  0 siblings, 1 reply; 42+ messages in thread
From: Hans de Goede @ 2016-09-12 14:47 UTC (permalink / raw)
  To: u-boot

Hi,

On 12-09-16 15:56, Maxime Ripard wrote:
> Hi,
>
> On Mon, Sep 12, 2016 at 01:53:24PM +0200, Ciprian Manea wrote:
>> I'm using a SinA33 dev board (Allwinner a33 SoC) and at the moment
>> I'm trying to boot from the eMMC.
>>
>> But it fails in the following way:
>>
>>
>> *Got the following error at boot time:*
>> *U-Boot SPL 2016.09-rc2-00125-g6e8b42f (Sep 08 2016 - 11:00:46) DRAM: 1024
>> MiB Trying to boot from MMC2 MMC Device 1 not found spl: could not find mmc
>> device. error: -19 SPL: failed to boot from all boot devices ### ERROR ###
>> Please RESET the board ###*
>
> So I've been on the same issue for the last couple of days.
>
> Since that board is already supported, adding support for the eMMC
> basically came down to that patch on top of 2016.09-rc2.
>
> http://code.bulix.org/kcgxri-106037?raw
>
> (Quite hackish, the 8-Bits part being a separate issue that would need
> to be addressed somehow).
>
> However, it doesn't work, neither when flashing u-boot on the eMMC
> itself (where there's a timeout error in the SPL) nor when trying to
> access the eMMC from a U-Boot loaded from the (external) SD.
>
> In the latter case, even mmc dev 1 fails silently.
>
> I traced that down to the mmc_switch here:
> http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/mmc.c#l530
>
> Which fails with ETIMEDOUT, and more specifically, it's the call to
> mmc_rint_wait here
> http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/sunxi_mmc.c#l383
> that times out.
>
> Increasing the timeout value (to 10000) doesn't really change
> anything. I guess this is also the reason why we had a timeout error
> in the SPL.
>
> This eMMC works fine in Linux, with the same muxing (and I guess the
> earlier commands wouldn't be successful if the muxing or power was not
> set up appropriately). So I'm kind of running out of ideas on what
> could be the root cause of this.
>
> Hans, any ideas?

Maybe the emmc needs external pull-ups ? I don't remember if u-boot
always enables those or not ...

I've not tried booting from eMMC on A33 boards (-ENOHARDWARE) but it
does work on A13 and A20 boards (last time I tried).

Regards,

Hans

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-09-12 14:47   ` Hans de Goede
@ 2016-09-13 11:50     ` Maxime Ripard
  2016-09-14 10:05       ` Hans de Goede
  0 siblings, 1 reply; 42+ messages in thread
From: Maxime Ripard @ 2016-09-13 11:50 UTC (permalink / raw)
  To: u-boot

Hi,

On Mon, Sep 12, 2016 at 04:47:49PM +0200, Hans de Goede wrote:
> On 12-09-16 15:56, Maxime Ripard wrote:
> >Hi,
> >
> >On Mon, Sep 12, 2016 at 01:53:24PM +0200, Ciprian Manea wrote:
> >>I'm using a SinA33 dev board (Allwinner a33 SoC) and at the moment
> >>I'm trying to boot from the eMMC.
> >>
> >>But it fails in the following way:
> >>
> >>
> >>*Got the following error at boot time:*
> >>*U-Boot SPL 2016.09-rc2-00125-g6e8b42f (Sep 08 2016 - 11:00:46) DRAM: 1024
> >>MiB Trying to boot from MMC2 MMC Device 1 not found spl: could not find mmc
> >>device. error: -19 SPL: failed to boot from all boot devices ### ERROR ###
> >>Please RESET the board ###*
> >
> >So I've been on the same issue for the last couple of days.
> >
> >Since that board is already supported, adding support for the eMMC
> >basically came down to that patch on top of 2016.09-rc2.
> >
> >http://code.bulix.org/kcgxri-106037?raw
> >
> >(Quite hackish, the 8-Bits part being a separate issue that would need
> >to be addressed somehow).
> >
> >However, it doesn't work, neither when flashing u-boot on the eMMC
> >itself (where there's a timeout error in the SPL) nor when trying to
> >access the eMMC from a U-Boot loaded from the (external) SD.
> >
> >In the latter case, even mmc dev 1 fails silently.
> >
> >I traced that down to the mmc_switch here:
> >http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/mmc.c#l530
> >
> >Which fails with ETIMEDOUT, and more specifically, it's the call to
> >mmc_rint_wait here
> >http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/sunxi_mmc.c#l383
> >that times out.
> >
> >Increasing the timeout value (to 10000) doesn't really change
> >anything. I guess this is also the reason why we had a timeout error
> >in the SPL.
> >
> >This eMMC works fine in Linux, with the same muxing (and I guess the
> >earlier commands wouldn't be successful if the muxing or power was not
> >set up appropriately). So I'm kind of running out of ideas on what
> >could be the root cause of this.
> >
> >Hans, any ideas?
> 
> Maybe the emmc needs external pull-ups ? I don't remember if u-boot
> always enables those or not ...

So I pushed this a bit more, and it seems like commenting the call to
mmc_change_freq makes everything just work.

Reading the JEDEC spec, it looks like when you switch to high speed,
you also need to change the controller clock rate, that u-boot doesn't
seem to do at the moment, which obviously will fail, since the
controller will be stuck at the former rate, while the eMMC would be
switched.

If I comment mmc_change_freq, everything works.

> I've not tried booting from eMMC on A33 boards (-ENOHARDWARE) but it
> does work on A13 and A20 boards (last time I tried).

I'm guessing this is more about what rates and modes are supported,
rather than the actual SoC.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160913/e6567970/attachment.sig>

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-09-13 11:50     ` Maxime Ripard
@ 2016-09-14 10:05       ` Hans de Goede
  2016-09-15 13:32         ` Maxime Ripard
  2016-09-19 13:17         ` Maxime Ripard
  0 siblings, 2 replies; 42+ messages in thread
From: Hans de Goede @ 2016-09-14 10:05 UTC (permalink / raw)
  To: u-boot

Hi,

On 13-09-16 13:50, Maxime Ripard wrote:
> Hi,
>
> On Mon, Sep 12, 2016 at 04:47:49PM +0200, Hans de Goede wrote:
>> On 12-09-16 15:56, Maxime Ripard wrote:
>>> Hi,
>>>
>>> On Mon, Sep 12, 2016 at 01:53:24PM +0200, Ciprian Manea wrote:
>>>> I'm using a SinA33 dev board (Allwinner a33 SoC) and at the moment
>>>> I'm trying to boot from the eMMC.
>>>>
>>>> But it fails in the following way:
>>>>
>>>>
>>>> *Got the following error at boot time:*
>>>> *U-Boot SPL 2016.09-rc2-00125-g6e8b42f (Sep 08 2016 - 11:00:46) DRAM: 1024
>>>> MiB Trying to boot from MMC2 MMC Device 1 not found spl: could not find mmc
>>>> device. error: -19 SPL: failed to boot from all boot devices ### ERROR ###
>>>> Please RESET the board ###*
>>>
>>> So I've been on the same issue for the last couple of days.
>>>
>>> Since that board is already supported, adding support for the eMMC
>>> basically came down to that patch on top of 2016.09-rc2.
>>>
>>> http://code.bulix.org/kcgxri-106037?raw
>>>
>>> (Quite hackish, the 8-Bits part being a separate issue that would need
>>> to be addressed somehow).
>>>
>>> However, it doesn't work, neither when flashing u-boot on the eMMC
>>> itself (where there's a timeout error in the SPL) nor when trying to
>>> access the eMMC from a U-Boot loaded from the (external) SD.
>>>
>>> In the latter case, even mmc dev 1 fails silently.
>>>
>>> I traced that down to the mmc_switch here:
>>> http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/mmc.c#l530
>>>
>>> Which fails with ETIMEDOUT, and more specifically, it's the call to
>>> mmc_rint_wait here
>>> http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/sunxi_mmc.c#l383
>>> that times out.
>>>
>>> Increasing the timeout value (to 10000) doesn't really change
>>> anything. I guess this is also the reason why we had a timeout error
>>> in the SPL.
>>>
>>> This eMMC works fine in Linux, with the same muxing (and I guess the
>>> earlier commands wouldn't be successful if the muxing or power was not
>>> set up appropriately). So I'm kind of running out of ideas on what
>>> could be the root cause of this.
>>>
>>> Hans, any ideas?
>>
>> Maybe the emmc needs external pull-ups ? I don't remember if u-boot
>> always enables those or not ...
>
> So I pushed this a bit more, and it seems like commenting the call to
> mmc_change_freq makes everything just work.
>
> Reading the JEDEC spec, it looks like when you switch to high speed,
> you also need to change the controller clock rate, that u-boot doesn't
> seem to do at the moment, which obviously will fail, since the
> controller will be stuck at the former rate, while the eMMC would be
> switched.
>
> If I comment mmc_change_freq, everything works.

Hmm, I'm pretty sure the u-boot sunxi mmc code
does properly change the clock, see mmc_set_mod_clk() in
drivers/mmc/sunxi_mmc.c

This will switch to the right PLL, etc. So there likely is
something else going on making things not work at higher
speeds. Maybe we need a higher driver strenghts at the
mmc io pins, or maybe we've a completely unrelated issue ?

I'm pretty sure that the eMMC's on A20 devices work fine
in 50MHZ (SDR) mode.

Regards,

Hans

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-09-14 10:05       ` Hans de Goede
@ 2016-09-15 13:32         ` Maxime Ripard
  2016-09-19 13:17         ` Maxime Ripard
  1 sibling, 0 replies; 42+ messages in thread
From: Maxime Ripard @ 2016-09-15 13:32 UTC (permalink / raw)
  To: u-boot

Hi,

On Wed, Sep 14, 2016 at 12:05:19PM +0200, Hans de Goede wrote:
> Hi,
> 
> On 13-09-16 13:50, Maxime Ripard wrote:
> >Hi,
> >
> >On Mon, Sep 12, 2016 at 04:47:49PM +0200, Hans de Goede wrote:
> >>On 12-09-16 15:56, Maxime Ripard wrote:
> >>>Hi,
> >>>
> >>>On Mon, Sep 12, 2016 at 01:53:24PM +0200, Ciprian Manea wrote:
> >>>>I'm using a SinA33 dev board (Allwinner a33 SoC) and at the moment
> >>>>I'm trying to boot from the eMMC.
> >>>>
> >>>>But it fails in the following way:
> >>>>
> >>>>
> >>>>*Got the following error at boot time:*
> >>>>*U-Boot SPL 2016.09-rc2-00125-g6e8b42f (Sep 08 2016 - 11:00:46) DRAM: 1024
> >>>>MiB Trying to boot from MMC2 MMC Device 1 not found spl: could not find mmc
> >>>>device. error: -19 SPL: failed to boot from all boot devices ### ERROR ###
> >>>>Please RESET the board ###*
> >>>
> >>>So I've been on the same issue for the last couple of days.
> >>>
> >>>Since that board is already supported, adding support for the eMMC
> >>>basically came down to that patch on top of 2016.09-rc2.
> >>>
> >>>http://code.bulix.org/kcgxri-106037?raw
> >>>
> >>>(Quite hackish, the 8-Bits part being a separate issue that would need
> >>>to be addressed somehow).
> >>>
> >>>However, it doesn't work, neither when flashing u-boot on the eMMC
> >>>itself (where there's a timeout error in the SPL) nor when trying to
> >>>access the eMMC from a U-Boot loaded from the (external) SD.
> >>>
> >>>In the latter case, even mmc dev 1 fails silently.
> >>>
> >>>I traced that down to the mmc_switch here:
> >>>http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/mmc.c#l530
> >>>
> >>>Which fails with ETIMEDOUT, and more specifically, it's the call to
> >>>mmc_rint_wait here
> >>>http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/sunxi_mmc.c#l383
> >>>that times out.
> >>>
> >>>Increasing the timeout value (to 10000) doesn't really change
> >>>anything. I guess this is also the reason why we had a timeout error
> >>>in the SPL.
> >>>
> >>>This eMMC works fine in Linux, with the same muxing (and I guess the
> >>>earlier commands wouldn't be successful if the muxing or power was not
> >>>set up appropriately). So I'm kind of running out of ideas on what
> >>>could be the root cause of this.
> >>>
> >>>Hans, any ideas?
> >>
> >>Maybe the emmc needs external pull-ups ? I don't remember if u-boot
> >>always enables those or not ...
> >
> >So I pushed this a bit more, and it seems like commenting the call to
> >mmc_change_freq makes everything just work.
> >
> >Reading the JEDEC spec, it looks like when you switch to high speed,
> >you also need to change the controller clock rate, that u-boot doesn't
> >seem to do at the moment, which obviously will fail, since the
> >controller will be stuck at the former rate, while the eMMC would be
> >switched.
> >
> >If I comment mmc_change_freq, everything works.
> 
> Hmm, I'm pretty sure the u-boot sunxi mmc code
> does properly change the clock, see mmc_set_mod_clk() in
> drivers/mmc/sunxi_mmc.c
> 
> This will switch to the right PLL, etc. So there likely is
> something else going on making things not work at higher
> speeds. Maybe we need a higher driver strenghts at the
> mmc io pins, or maybe we've a completely unrelated issue ?
> 
> I'm pretty sure that the eMMC's on A20 devices work fine
> in 50MHZ (SDR) mode.

Yeah, sorry, I was missing the mmc_set_clock call in that function,
that ends up calling mmc_set_mod_clk.

I'll look more into it, it might be just a matter of phases to adjust.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160915/151e48e8/attachment.sig>

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-09-14 10:05       ` Hans de Goede
  2016-09-15 13:32         ` Maxime Ripard
@ 2016-09-19 13:17         ` Maxime Ripard
  2016-09-19 21:42           ` Hans de Goede
  2016-09-19 23:10           ` Jaehoon Chung
  1 sibling, 2 replies; 42+ messages in thread
From: Maxime Ripard @ 2016-09-19 13:17 UTC (permalink / raw)
  To: u-boot

On Wed, Sep 14, 2016 at 12:05:19PM +0200, Hans de Goede wrote:
> Hi,
> 
> On 13-09-16 13:50, Maxime Ripard wrote:
> >Hi,
> >
> >On Mon, Sep 12, 2016 at 04:47:49PM +0200, Hans de Goede wrote:
> >>On 12-09-16 15:56, Maxime Ripard wrote:
> >>>Hi,
> >>>
> >>>On Mon, Sep 12, 2016 at 01:53:24PM +0200, Ciprian Manea wrote:
> >>>>I'm using a SinA33 dev board (Allwinner a33 SoC) and at the moment
> >>>>I'm trying to boot from the eMMC.
> >>>>
> >>>>But it fails in the following way:
> >>>>
> >>>>
> >>>>*Got the following error at boot time:*
> >>>>*U-Boot SPL 2016.09-rc2-00125-g6e8b42f (Sep 08 2016 - 11:00:46) DRAM: 1024
> >>>>MiB Trying to boot from MMC2 MMC Device 1 not found spl: could not find mmc
> >>>>device. error: -19 SPL: failed to boot from all boot devices ### ERROR ###
> >>>>Please RESET the board ###*
> >>>
> >>>So I've been on the same issue for the last couple of days.
> >>>
> >>>Since that board is already supported, adding support for the eMMC
> >>>basically came down to that patch on top of 2016.09-rc2.
> >>>
> >>>http://code.bulix.org/kcgxri-106037?raw
> >>>
> >>>(Quite hackish, the 8-Bits part being a separate issue that would need
> >>>to be addressed somehow).
> >>>
> >>>However, it doesn't work, neither when flashing u-boot on the eMMC
> >>>itself (where there's a timeout error in the SPL) nor when trying to
> >>>access the eMMC from a U-Boot loaded from the (external) SD.
> >>>
> >>>In the latter case, even mmc dev 1 fails silently.
> >>>
> >>>I traced that down to the mmc_switch here:
> >>>http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/mmc.c#l530
> >>>
> >>>Which fails with ETIMEDOUT, and more specifically, it's the call to
> >>>mmc_rint_wait here
> >>>http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/sunxi_mmc.c#l383
> >>>that times out.
> >>>
> >>>Increasing the timeout value (to 10000) doesn't really change
> >>>anything. I guess this is also the reason why we had a timeout error
> >>>in the SPL.
> >>>
> >>>This eMMC works fine in Linux, with the same muxing (and I guess the
> >>>earlier commands wouldn't be successful if the muxing or power was not
> >>>set up appropriately). So I'm kind of running out of ideas on what
> >>>could be the root cause of this.
> >>>
> >>>Hans, any ideas?
> >>
> >>Maybe the emmc needs external pull-ups ? I don't remember if u-boot
> >>always enables those or not ...
> >
> >So I pushed this a bit more, and it seems like commenting the call to
> >mmc_change_freq makes everything just work.
> >
> >Reading the JEDEC spec, it looks like when you switch to high speed,
> >you also need to change the controller clock rate, that u-boot doesn't
> >seem to do at the moment, which obviously will fail, since the
> >controller will be stuck at the former rate, while the eMMC would be
> >switched.
> >
> >If I comment mmc_change_freq, everything works.
> 
> Hmm, I'm pretty sure the u-boot sunxi mmc code
> does properly change the clock, see mmc_set_mod_clk() in
> drivers/mmc/sunxi_mmc.c
>
> This will switch to the right PLL, etc. So there likely is
> something else going on making things not work at higher
> speeds.

Yep, I noticed that. However, what confuses me more is that the
command seems to be sent here:
http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/mmc.c#l530

And set_ios is being called after we check that everything
works. Linux for example calls set_ios right after switching
http://lxr.free-electrons.com/source/drivers/mmc/core/mmc.c#L965

> Maybe we need a higher driver strenghts at the mmc io pins, or maybe
> we've a completely unrelated issue ?

I've tested that already. It doesn't change the outcome.

> I'm pretty sure that the eMMC's on A20 devices work fine in 50MHZ
> (SDR) mode.

What emmc was that? Did it support HS? Was it considered an SD (and
went through sd_change_freq), or an MMC?

Thanks,
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160919/30f2e7cf/attachment.sig>

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-09-19 13:17         ` Maxime Ripard
@ 2016-09-19 21:42           ` Hans de Goede
  2016-09-19 23:10           ` Jaehoon Chung
  1 sibling, 0 replies; 42+ messages in thread
From: Hans de Goede @ 2016-09-19 21:42 UTC (permalink / raw)
  To: u-boot

HI,

On 19-09-16 15:17, Maxime Ripard wrote:
> On Wed, Sep 14, 2016 at 12:05:19PM +0200, Hans de Goede wrote:
>> Hi,
>>
>> On 13-09-16 13:50, Maxime Ripard wrote:
>>> Hi,
>>>
>>> On Mon, Sep 12, 2016 at 04:47:49PM +0200, Hans de Goede wrote:
>>>> On 12-09-16 15:56, Maxime Ripard wrote:
>>>>> Hi,
>>>>>
>>>>> On Mon, Sep 12, 2016 at 01:53:24PM +0200, Ciprian Manea wrote:
>>>>>> I'm using a SinA33 dev board (Allwinner a33 SoC) and at the moment
>>>>>> I'm trying to boot from the eMMC.
>>>>>>
>>>>>> But it fails in the following way:
>>>>>>
>>>>>>
>>>>>> *Got the following error at boot time:*
>>>>>> *U-Boot SPL 2016.09-rc2-00125-g6e8b42f (Sep 08 2016 - 11:00:46) DRAM: 1024
>>>>>> MiB Trying to boot from MMC2 MMC Device 1 not found spl: could not find mmc
>>>>>> device. error: -19 SPL: failed to boot from all boot devices ### ERROR ###
>>>>>> Please RESET the board ###*
>>>>>
>>>>> So I've been on the same issue for the last couple of days.
>>>>>
>>>>> Since that board is already supported, adding support for the eMMC
>>>>> basically came down to that patch on top of 2016.09-rc2.
>>>>>
>>>>> http://code.bulix.org/kcgxri-106037?raw
>>>>>
>>>>> (Quite hackish, the 8-Bits part being a separate issue that would need
>>>>> to be addressed somehow).
>>>>>
>>>>> However, it doesn't work, neither when flashing u-boot on the eMMC
>>>>> itself (where there's a timeout error in the SPL) nor when trying to
>>>>> access the eMMC from a U-Boot loaded from the (external) SD.
>>>>>
>>>>> In the latter case, even mmc dev 1 fails silently.
>>>>>
>>>>> I traced that down to the mmc_switch here:
>>>>> http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/mmc.c#l530
>>>>>
>>>>> Which fails with ETIMEDOUT, and more specifically, it's the call to
>>>>> mmc_rint_wait here
>>>>> http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/sunxi_mmc.c#l383
>>>>> that times out.
>>>>>
>>>>> Increasing the timeout value (to 10000) doesn't really change
>>>>> anything. I guess this is also the reason why we had a timeout error
>>>>> in the SPL.
>>>>>
>>>>> This eMMC works fine in Linux, with the same muxing (and I guess the
>>>>> earlier commands wouldn't be successful if the muxing or power was not
>>>>> set up appropriately). So I'm kind of running out of ideas on what
>>>>> could be the root cause of this.
>>>>>
>>>>> Hans, any ideas?
>>>>
>>>> Maybe the emmc needs external pull-ups ? I don't remember if u-boot
>>>> always enables those or not ...
>>>
>>> So I pushed this a bit more, and it seems like commenting the call to
>>> mmc_change_freq makes everything just work.
>>>
>>> Reading the JEDEC spec, it looks like when you switch to high speed,
>>> you also need to change the controller clock rate, that u-boot doesn't
>>> seem to do at the moment, which obviously will fail, since the
>>> controller will be stuck at the former rate, while the eMMC would be
>>> switched.
>>>
>>> If I comment mmc_change_freq, everything works.
>>
>> Hmm, I'm pretty sure the u-boot sunxi mmc code
>> does properly change the clock, see mmc_set_mod_clk() in
>> drivers/mmc/sunxi_mmc.c
>>
>> This will switch to the right PLL, etc. So there likely is
>> something else going on making things not work at higher
>> speeds.
>
> Yep, I noticed that. However, what confuses me more is that the
> command seems to be sent here:
> http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/mmc.c#l530
>
> And set_ios is being called after we check that everything
> works. Linux for example calls set_ios right after switching
> http://lxr.free-electrons.com/source/drivers/mmc/core/mmc.c#L965
>
>> Maybe we need a higher driver strenghts at the mmc io pins, or maybe
>> we've a completely unrelated issue ?
>
> I've tested that already. It doesn't change the outcome.
>
>> I'm pretty sure that the eMMC's on A20 devices work fine in 50MHZ
>> (SDR) mode.
>
> What emmc was that? Did it support HS? Was it considered an SD (and
> went through sd_change_freq), or an MMC?

Here is what "mmc info" in u-boot says on my UTOO P66 tablet (A13)
with 4G eMMC (manually transcribed, no serial console):

Device: SUNXI SD/MMC
Manufacturer ID: 70
OEM: 100
Name: MMC04
Tran Speed: 52000000
Rd Block Len: 512
MMC version 4.4.1
High Capacity: Yes
Bus-width: 4-bit
<bunch of sizes>

And here is /sys/kernel/debug/mmc1/ios under linux:

clock:          52000000 Hz
vdd:            21 (3.3 ~ 3.4 V)
bus mode:       2 (push-pull)
chip select:    0 (don't care)
power mode:     2 (on)
bus width:      3 (8 bits)
timing spec:    1 (mmc high-speed)
signal voltage: 0 (3.30 V)
driver type:    0 (driver type B)

HTH,

Regards,

Hans

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-09-19 13:17         ` Maxime Ripard
  2016-09-19 21:42           ` Hans de Goede
@ 2016-09-19 23:10           ` Jaehoon Chung
  2016-09-21 13:32             ` Maxime Ripard
  2016-10-03  8:21             ` Maxime Ripard
  1 sibling, 2 replies; 42+ messages in thread
From: Jaehoon Chung @ 2016-09-19 23:10 UTC (permalink / raw)
  To: u-boot

Hi,

On 09/19/2016 10:17 PM, Maxime Ripard wrote:
> On Wed, Sep 14, 2016 at 12:05:19PM +0200, Hans de Goede wrote:
>> Hi,
>>
>> On 13-09-16 13:50, Maxime Ripard wrote:
>>> Hi,
>>>
>>> On Mon, Sep 12, 2016 at 04:47:49PM +0200, Hans de Goede wrote:
>>>> On 12-09-16 15:56, Maxime Ripard wrote:
>>>>> Hi,
>>>>>
>>>>> On Mon, Sep 12, 2016 at 01:53:24PM +0200, Ciprian Manea wrote:
>>>>>> I'm using a SinA33 dev board (Allwinner a33 SoC) and at the moment
>>>>>> I'm trying to boot from the eMMC.
>>>>>>
>>>>>> But it fails in the following way:
>>>>>>
>>>>>>
>>>>>> *Got the following error at boot time:*
>>>>>> *U-Boot SPL 2016.09-rc2-00125-g6e8b42f (Sep 08 2016 - 11:00:46) DRAM: 1024
>>>>>> MiB Trying to boot from MMC2 MMC Device 1 not found spl: could not find mmc
>>>>>> device. error: -19 SPL: failed to boot from all boot devices ### ERROR ###
>>>>>> Please RESET the board ###*
>>>>>
>>>>> So I've been on the same issue for the last couple of days.
>>>>>
>>>>> Since that board is already supported, adding support for the eMMC
>>>>> basically came down to that patch on top of 2016.09-rc2.
>>>>>
>>>>> http://code.bulix.org/kcgxri-106037?raw
>>>>>
>>>>> (Quite hackish, the 8-Bits part being a separate issue that would need
>>>>> to be addressed somehow).
>>>>>
>>>>> However, it doesn't work, neither when flashing u-boot on the eMMC
>>>>> itself (where there's a timeout error in the SPL) nor when trying to
>>>>> access the eMMC from a U-Boot loaded from the (external) SD.
>>>>>
>>>>> In the latter case, even mmc dev 1 fails silently.
>>>>>
>>>>> I traced that down to the mmc_switch here:
>>>>> http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/mmc.c#l530
>>>>>
>>>>> Which fails with ETIMEDOUT, and more specifically, it's the call to
>>>>> mmc_rint_wait here
>>>>> http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/sunxi_mmc.c#l383
>>>>> that times out.
>>>>>
>>>>> Increasing the timeout value (to 10000) doesn't really change
>>>>> anything. I guess this is also the reason why we had a timeout error
>>>>> in the SPL.

timeout_msecs is expired or hit SUNXI_MMC_RINT_INTERRUPT_ERROR_BIT?
If hit ERROR_BIT, did you check which bit is set?

If error is occurred when mmc_change_freq() is running, cid/ext_csd register have already read.
It means the controller read the something from eMMC card.

>>>>>
>>>>> This eMMC works fine in Linux, with the same muxing (and I guess the
>>>>> earlier commands wouldn't be successful if the muxing or power was not
>>>>> set up appropriately). So I'm kind of running out of ideas on what
>>>>> could be the root cause of this.
>>>>>
>>>>> Hans, any ideas?
>>>>
>>>> Maybe the emmc needs external pull-ups ? I don't remember if u-boot
>>>> always enables those or not ...
>>>
>>> So I pushed this a bit more, and it seems like commenting the call to
>>> mmc_change_freq makes everything just work.
>>>
>>> Reading the JEDEC spec, it looks like when you switch to high speed,
>>> you also need to change the controller clock rate, that u-boot doesn't
>>> seem to do at the moment, which obviously will fail, since the
>>> controller will be stuck at the former rate, while the eMMC would be
>>> switched.
>>>
>>> If I comment mmc_change_freq, everything works.
>>
>> Hmm, I'm pretty sure the u-boot sunxi mmc code
>> does properly change the clock, see mmc_set_mod_clk() in
>> drivers/mmc/sunxi_mmc.c
>>
>> This will switch to the right PLL, etc. So there likely is
>> something else going on making things not work at higher
>> speeds.
> 
> Yep, I noticed that. However, what confuses me more is that the
> command seems to be sent here:
> http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/mmc.c#l530

If then..i guess that it's possible to set the initial clock as higher clock than 400KHz.
Did you check this?

Best Regards,
Jaehoon Chung

> 
> And set_ios is being called after we check that everything
> works. Linux for example calls set_ios right after switching
> http://lxr.free-electrons.com/source/drivers/mmc/core/mmc.c#L965
> 
>> Maybe we need a higher driver strenghts at the mmc io pins, or maybe
>> we've a completely unrelated issue ?
> 
> I've tested that already. It doesn't change the outcome.
> 
>> I'm pretty sure that the eMMC's on A20 devices work fine in 50MHZ
>> (SDR) mode.
> 
> What emmc was that? Did it support HS? Was it considered an SD (and
> went through sd_change_freq), or an MMC?
> 
> Thanks,
> Maxime
> 

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-09-19 23:10           ` Jaehoon Chung
@ 2016-09-21 13:32             ` Maxime Ripard
  2016-10-03  8:21             ` Maxime Ripard
  1 sibling, 0 replies; 42+ messages in thread
From: Maxime Ripard @ 2016-09-21 13:32 UTC (permalink / raw)
  To: u-boot

Hi Jaehoon,

On Tue, Sep 20, 2016 at 08:10:52AM +0900, Jaehoon Chung wrote:
> On 09/19/2016 10:17 PM, Maxime Ripard wrote:
> > On Wed, Sep 14, 2016 at 12:05:19PM +0200, Hans de Goede wrote:
> >> Hi,
> >>
> >> On 13-09-16 13:50, Maxime Ripard wrote:
> >>> Hi,
> >>>
> >>> On Mon, Sep 12, 2016 at 04:47:49PM +0200, Hans de Goede wrote:
> >>>> On 12-09-16 15:56, Maxime Ripard wrote:
> >>>>> Hi,
> >>>>>
> >>>>> On Mon, Sep 12, 2016 at 01:53:24PM +0200, Ciprian Manea wrote:
> >>>>>> I'm using a SinA33 dev board (Allwinner a33 SoC) and at the moment
> >>>>>> I'm trying to boot from the eMMC.
> >>>>>>
> >>>>>> But it fails in the following way:
> >>>>>>
> >>>>>>
> >>>>>> *Got the following error at boot time:*
> >>>>>> *U-Boot SPL 2016.09-rc2-00125-g6e8b42f (Sep 08 2016 - 11:00:46) DRAM: 1024
> >>>>>> MiB Trying to boot from MMC2 MMC Device 1 not found spl: could not find mmc
> >>>>>> device. error: -19 SPL: failed to boot from all boot devices ### ERROR ###
> >>>>>> Please RESET the board ###*
> >>>>>
> >>>>> So I've been on the same issue for the last couple of days.
> >>>>>
> >>>>> Since that board is already supported, adding support for the eMMC
> >>>>> basically came down to that patch on top of 2016.09-rc2.
> >>>>>
> >>>>> http://code.bulix.org/kcgxri-106037?raw
> >>>>>
> >>>>> (Quite hackish, the 8-Bits part being a separate issue that would need
> >>>>> to be addressed somehow).
> >>>>>
> >>>>> However, it doesn't work, neither when flashing u-boot on the eMMC
> >>>>> itself (where there's a timeout error in the SPL) nor when trying to
> >>>>> access the eMMC from a U-Boot loaded from the (external) SD.
> >>>>>
> >>>>> In the latter case, even mmc dev 1 fails silently.
> >>>>>
> >>>>> I traced that down to the mmc_switch here:
> >>>>> http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/mmc.c#l530
> >>>>>
> >>>>> Which fails with ETIMEDOUT, and more specifically, it's the call to
> >>>>> mmc_rint_wait here
> >>>>> http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/sunxi_mmc.c#l383
> >>>>> that times out.
> >>>>>
> >>>>> Increasing the timeout value (to 10000) doesn't really change
> >>>>> anything. I guess this is also the reason why we had a timeout error
> >>>>> in the SPL.
> 
> timeout_msecs is expired or hit SUNXI_MMC_RINT_INTERRUPT_ERROR_BIT?
> If hit ERROR_BIT, did you check which bit is set?

I haven't check, I'll look (next week though, I'm at a conference and
away from that board).

> If error is occurred when mmc_change_freq() is running, cid/ext_csd
> register have already read.
>
> It means the controller read the something from eMMC card.

It really is the next command right after the switch that fails, it
really feels like that switch changes the timings of the card without
changing the one from the host.

> 
> >>>>>
> >>>>> This eMMC works fine in Linux, with the same muxing (and I guess the
> >>>>> earlier commands wouldn't be successful if the muxing or power was not
> >>>>> set up appropriately). So I'm kind of running out of ideas on what
> >>>>> could be the root cause of this.
> >>>>>
> >>>>> Hans, any ideas?
> >>>>
> >>>> Maybe the emmc needs external pull-ups ? I don't remember if u-boot
> >>>> always enables those or not ...
> >>>
> >>> So I pushed this a bit more, and it seems like commenting the call to
> >>> mmc_change_freq makes everything just work.
> >>>
> >>> Reading the JEDEC spec, it looks like when you switch to high speed,
> >>> you also need to change the controller clock rate, that u-boot doesn't
> >>> seem to do at the moment, which obviously will fail, since the
> >>> controller will be stuck at the former rate, while the eMMC would be
> >>> switched.
> >>>
> >>> If I comment mmc_change_freq, everything works.
> >>
> >> Hmm, I'm pretty sure the u-boot sunxi mmc code
> >> does properly change the clock, see mmc_set_mod_clk() in
> >> drivers/mmc/sunxi_mmc.c
> >>
> >> This will switch to the right PLL, etc. So there likely is
> >> something else going on making things not work at higher
> >> speeds.
> > 
> > Yep, I noticed that. However, what confuses me more is that the
> > command seems to be sent here:
> > http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/mmc.c#l530
> 
> If then..i guess that it's possible to set the initial clock as
> higher clock than 400KHz.  Did you check this?

I'll try. But wouldn't that introduce some compatibility issues of its
own?

Thanks,
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160921/b98cf0f1/attachment.sig>

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-09-19 23:10           ` Jaehoon Chung
  2016-09-21 13:32             ` Maxime Ripard
@ 2016-10-03  8:21             ` Maxime Ripard
  1 sibling, 0 replies; 42+ messages in thread
From: Maxime Ripard @ 2016-10-03  8:21 UTC (permalink / raw)
  To: u-boot

Hi Jaehoon,

On Tue, Sep 20, 2016 at 08:10:52AM +0900, Jaehoon Chung wrote:
> >>>>> So I've been on the same issue for the last couple of days.
> >>>>>
> >>>>> Since that board is already supported, adding support for the eMMC
> >>>>> basically came down to that patch on top of 2016.09-rc2.
> >>>>>
> >>>>> http://code.bulix.org/kcgxri-106037?raw
> >>>>>
> >>>>> (Quite hackish, the 8-Bits part being a separate issue that would need
> >>>>> to be addressed somehow).
> >>>>>
> >>>>> However, it doesn't work, neither when flashing u-boot on the eMMC
> >>>>> itself (where there's a timeout error in the SPL) nor when trying to
> >>>>> access the eMMC from a U-Boot loaded from the (external) SD.
> >>>>>
> >>>>> In the latter case, even mmc dev 1 fails silently.
> >>>>>
> >>>>> I traced that down to the mmc_switch here:
> >>>>> http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/mmc.c#l530
> >>>>>
> >>>>> Which fails with ETIMEDOUT, and more specifically, it's the call to
> >>>>> mmc_rint_wait here
> >>>>> http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/sunxi_mmc.c#l383
> >>>>> that times out.
> >>>>>
> >>>>> Increasing the timeout value (to 10000) doesn't really change
> >>>>> anything. I guess this is also the reason why we had a timeout error
> >>>>> in the SPL.
> 
> timeout_msecs is expired or hit SUNXI_MMC_RINT_INTERRUPT_ERROR_BIT?
> If hit ERROR_BIT, did you check which bit is set?
> 
> If error is occurred when mmc_change_freq() is running, cid/ext_csd
> register have already read.
> It means the controller read the something from eMMC card.

So I've been able to test this, and we indeed not hit the timeout but
the error bit is set, with 0x40.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161003/943bb34e/attachment.sig>

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-11-05  8:18                                                     ` Hans de Goede
@ 2016-11-05 10:58                                                       ` Alexandr Bochkarev
  0 siblings, 0 replies; 42+ messages in thread
From: Alexandr Bochkarev @ 2016-11-05 10:58 UTC (permalink / raw)
  To: u-boot

Hi,

I have tried it, no success

>>U-Boot SPL 2016.11-rc3-00001-g9fa5bf3-dirty (Nov 05 2016 - 16:18:14)
>>DRAM: 1024 MiB
>>CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
>>Trying to boot from MMC1
>>mmc_load_image_raw_sector: mmc block read error
>>SPL: failed to boot from all boot devices
>>### ERROR ### Please RESET the board ###


In my case, i am sure, that problem not in emmc card.
First MMC_CMD_SWITCH in mmc_change_func works well without patches, but get stuck in second, when change bus width.

I have two almost similar socs, Allwinner A13(sun5i) and A20(sun7i).
They uses same sunxi_mmc.c driver. A13 boots well with master branch, but A20 only with my patch.

Below link shows diff in boot logs, A20 CONFIG_MACH_SUN7I on left, and A13 CONFIG_MACH_SUN5I on right side. A13 works well
https://www.diffchecker.com/XrmlaZfH <https://www.diffchecker.com/XrmlaZfH>

Using logic analyzer, i analyzed all command and all responses. 
Diagrams absolutely the same, from u-boot spl start, on both socs, until mmc_rint_wait return error.

https://dl.dropboxusercontent.com/u/10252748/A20vsA13.png <https://dl.dropboxusercontent.com/u/10252748/A20vsA13.png>
https://dl.dropboxusercontent.com/u/10252748/A20vsA13_ZOMMED.png <https://dl.dropboxusercontent.com/u/10252748/A20vsA13_ZOMMED.png>

at first look, looks like emmc not respond to A20, but if zoom more, 
https://www.dropbox.com/s/80u232i7wod93gf/A20.png?dl=0 <https://www.dropbox.com/s/80u232i7wod93gf/A20.png?dl=0>
we see, that no clocks in some time. If take A13 diagram, no empty clocks!
I have no jtag to debug more. I am not sure, but i think, for some reason, this empty clocks cause card fail.

So, only with this patch, Allwinner A20 soc can boot from emmc https://www.dropbox.com/s/0lfe2xifzbdbokb/emmcFix.patch?dl=0 <https://www.dropbox.com/s/0lfe2xifzbdbokb/emmcFix.patch?dl=0>



> 5 ????. 2016 ?., ? 14:18, Hans de Goede <hdegoede@redhat.com> ???????(?):
> 
> Hi,
> 
> Maxime posted a proper fix for this issue yesterday:
> 
> https://patchwork.ozlabs.org/patch/691284/
> 
> Can you give that one a try and see if it fixes things for you
> as well ?
> 
> Regards,
> 
> Hans
> 

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-11-04 22:57                                                   ` Alexandr Bochkarev
@ 2016-11-05  8:18                                                     ` Hans de Goede
  2016-11-05 10:58                                                       ` Alexandr Bochkarev
  0 siblings, 1 reply; 42+ messages in thread
From: Hans de Goede @ 2016-11-05  8:18 UTC (permalink / raw)
  To: u-boot

Hi,

On 04-11-16 23:57, Alexandr Bochkarev wrote:
> I have found problem place, this patch with hotfix allows to boot Allwinner A20 from eMMC.
> Dont know how to full fix it.

Maxime posted a proper fix for this issue yesterday:

https://patchwork.ozlabs.org/patch/691284/

Can you give that one a try and see if it fixes things for you
as well ?

Regards,

Hans

>
> commit 9fa5bf30e95ead17eb0c50375b305fb8615427a9
> Author: root <aneox.inbox at gmail.com <mailto:aneox.inbox@gmail.com>>
> Date:   Sat Nov 5 04:41:30 2016 +0600
>
>     allow to boot A20 from eMMC, fix
>
> diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
> index 6953acc..87cf964 100644
> --- a/drivers/mmc/sunxi_mmc.c
> +++ b/drivers/mmc/sunxi_mmc.c
> @@ -293,11 +293,17 @@ static int mmc_trans_data_by_cpu(struct mmc *mmc, struct mmc_data *data)
>  }
>
>  static int mmc_rint_wait(struct mmc *mmc, unsigned int timeout_msecs,
> -			 unsigned int done_bit, const char *what)
> +			 unsigned int done_bit, const char *what, struct mmc_cmd *cmd)
>  {
>  	struct sunxi_mmc_host *mmchost = mmc->priv;
>  	unsigned int status;
>
> +	if (cmd->cmdidx == MMC_CMD_SWITCH)
> +	{
> +		printf("mmc_rint_wait: fix me\n");
> +		return 0;
> +	}
> +
>  	do {
>  		status = readl(&mmchost->reg->rint);
>  		if (!timeout_msecs-- ||
> @@ -380,7 +386,7 @@ static int sunxi_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
>  		}
>  	}
>
> -	error = mmc_rint_wait(mmc, 1000, SUNXI_MMC_RINT_COMMAND_DONE, "cmd");
> +	error = mmc_rint_wait(mmc, 1000, SUNXI_MMC_RINT_COMMAND_DONE, "cmd", cmd);
>  	if (error)
>  		goto out;
>
> @@ -391,7 +397,7 @@ static int sunxi_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
>  				      data->blocks > 1 ?
>  				      SUNXI_MMC_RINT_AUTO_COMMAND_DONE :
>  				      SUNXI_MMC_RINT_DATA_OVER,
> -				      "data");
> +				      "data", cmd);
>  		if (error)
>  			goto out;
>  	}
>
>
>

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-11-03 21:39                                                 ` Alexandr Bochkarev
@ 2016-11-04 22:57                                                   ` Alexandr Bochkarev
  2016-11-05  8:18                                                     ` Hans de Goede
  0 siblings, 1 reply; 42+ messages in thread
From: Alexandr Bochkarev @ 2016-11-04 22:57 UTC (permalink / raw)
  To: u-boot

I have found problem place, this patch with hotfix allows to boot Allwinner A20 from eMMC.
Dont know how to full fix it.

commit 9fa5bf30e95ead17eb0c50375b305fb8615427a9
Author: root <aneox.inbox@gmail.com>
Date:   Sat Nov 5 04:41:30 2016 +0600

    allow to boot A20 from eMMC, fix

diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
index 6953acc..87cf964 100644
--- a/drivers/mmc/sunxi_mmc.c
+++ b/drivers/mmc/sunxi_mmc.c
@@ -293,11 +293,17 @@ static int mmc_trans_data_by_cpu(struct mmc *mmc, struct mmc_data *data)
 }
 
 static int mmc_rint_wait(struct mmc *mmc, unsigned int timeout_msecs,
-			 unsigned int done_bit, const char *what)
+			 unsigned int done_bit, const char *what, struct mmc_cmd *cmd)
 {
 	struct sunxi_mmc_host *mmchost = mmc->priv;
 	unsigned int status;
 
+	if (cmd->cmdidx == MMC_CMD_SWITCH)
+	{
+		printf("mmc_rint_wait: fix me\n");
+		return 0;
+	}
+
 	do {
 		status = readl(&mmchost->reg->rint);
 		if (!timeout_msecs-- ||
@@ -380,7 +386,7 @@ static int sunxi_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
 		}
 	}
 
-	error = mmc_rint_wait(mmc, 1000, SUNXI_MMC_RINT_COMMAND_DONE, "cmd");
+	error = mmc_rint_wait(mmc, 1000, SUNXI_MMC_RINT_COMMAND_DONE, "cmd", cmd);
 	if (error)
 		goto out;
 
@@ -391,7 +397,7 @@ static int sunxi_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
 				      data->blocks > 1 ?
 				      SUNXI_MMC_RINT_AUTO_COMMAND_DONE :
 				      SUNXI_MMC_RINT_DATA_OVER,
-				      "data");
+				      "data", cmd);
 		if (error)
 			goto out;
 	}

 

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-11-03 21:23                                               ` Alexandr Bochkarev
@ 2016-11-03 21:39                                                 ` Alexandr Bochkarev
  2016-11-04 22:57                                                   ` Alexandr Bochkarev
  0 siblings, 1 reply; 42+ messages in thread
From: Alexandr Bochkarev @ 2016-11-03 21:39 UTC (permalink / raw)
  To: u-boot


Replace emmc to sd card, on sdc2 lines. Remove sd on sdc0, works like a charm, but with emmc not success((((

>>U-Boot SPL 2016.11-rc1-g4dc34be (Nov 04 2016 - 03:06:54)
>>DRAM: 1024 MiB
>>CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
>>Trying to boot from MMC2

>>U-Boot 2016.11-rc1-g4dc34be (Nov 04 2016 - 03:06:54 +0600) Allwinner Technology

>>CPU:   Allwinner A20 (SUN7I)
>>Model: Cubietech Cubieboard2
>>????...

> 
> 
> Cubieboard2 - A20:
> 
> U-Boot with Cubieboard_defconfig and mmc extra slot config set to 2
> EMMC on sdc2 lines
> EMMC works from linux with 4-bit bus width, if boot from SD card on sdc0 lines
> 
> U-Boot output:
>>> Trying to boot from MMC2 
>>> mmc_load_image_raw_sector: mmc block read error 
>>> SPL: failed to boot from all boot devices 
>>> ### ERROR ### Please RESET the board ###

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-10-12 17:49                                             ` Alexandr Bochkarev
  2016-10-13  1:11                                               ` Jaehoon Chung
@ 2016-11-03 21:23                                               ` Alexandr Bochkarev
  2016-11-03 21:39                                                 ` Alexandr Bochkarev
  1 sibling, 1 reply; 42+ messages in thread
From: Alexandr Bochkarev @ 2016-11-03 21:23 UTC (permalink / raw)
  To: u-boot

To exclude board factor, i get another board, Cubieboard2, desolder nand chip and put emmc on sdc2 lines.
Boot kernel from sd on sdc0 lines, kernel init emmc well, in 4 bit mode

So, some trouble in u-boot is exist, PLEASE HELP! 
U-Boot SPL 2016.11-rc1-g4dc34be

My board - A20:

U-Boot with my config
EMMC on sdc0 lines
	
U-Boot output:
>> Trying to boot from MMC1
>> mmc_load_image_raw_sector: mmc block read error 
>> SPL: failed to boot from all boot devices 
>> ### ERROR ### Please RESET the board ### 


MarsBoard - A20:

U-Boot with my config and mmc extra slot config set to 2
EMMC on sdc2 lines
EMMC works from linux with 4-bit bus width, if boot from SD card on sdc0 lines

U-Boot output:
>> Trying to boot from MMC2 
>> mmc_load_image_raw_sector: mmc block read error 
>> SPL: failed to boot from all boot devices 
>> ### ERROR ### Please RESET the board ### 


Cubieboard2 - A20:

U-Boot with Cubieboard_defconfig and mmc extra slot config set to 2
EMMC on sdc2 lines
EMMC works from linux with 4-bit bus width, if boot from SD card on sdc0 lines

U-Boot output:
>> Trying to boot from MMC2 
>> mmc_load_image_raw_sector: mmc block read error 
>> SPL: failed to boot from all boot devices 
>> ### ERROR ### Please RESET the board ### 

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-11-03 10:10                                                                   ` Alexandr Bochkarev
@ 2016-11-03 19:57                                                                     ` Alexandr Bochkarev
  0 siblings, 0 replies; 42+ messages in thread
From: Alexandr Bochkarev @ 2016-11-03 19:57 UTC (permalink / raw)
  To: u-boot


I have put external pullups on marsboard, boot from sd. Linux kernel init emmc fine, 4-bit width bus, so board works well

Hit any key to stop autoboot:  2 ... 0 
=> mmc list
SUNXI SD/MMC: 0 (SD)
SUNXI SD/MMC: 1
=> mmc dev 0
switch to partitions #0, OK
mmc0 is current device
=> mmc part

Partition Map for MMC device 0  --   Partition Type: DOS

Part.Start Sector.Num Sectors.UUID..Type
  1.2048      .12288     .da1dcf13-01.83
  2.14336     .204800    .da1dcf13-02.83
  3.219136    .204800    .da1dcf13-03.83
  4.423936    .409600    .da1dcf13-04.05 Extd
  5.425984    .204800    .da1dcf13-05.83
  6.632832    .200704    .da1dcf13-06.83

=> mmc dev 1
switch to partitions #0, OK
mmc1(part 0) is current device
=> mmc part
## Unknown partition table type 0


When i try to boot from emmc still has error

U-Boot SPL 2016.11-rc1-g4dc34be (Nov 03 2016 - 17:22:10)
DRAM: 1024 MiB
CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
Trying to boot from MMC2
mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

emmc burned with same image as sd card, with mbr. rootfs, etc..
linux booted from sd card, well works with emmc partitions

> 3 ????. 2016 ?., ? 16:10, Alexandr Bochkarev <aneox.inbox@gmail.com> ???????(?):
> 
> 
> Some summary
> 
> Marsboard by default has nand flash chip on sdc2 lines, but under nand chip, there is emmc bga pads also. 
> So i have desoldered nand, and put emmc chip on it. Maybe there is no required pull ups on data lines to work on 4-bit widh, 
> and when i boot kernel from sdc0 sd card, kernel init sdc2 emmc only in 1-bit mode. but it works well, i can read can and write, get mbr, etc..
> I build u-boot with mmc extra slot config and burn it on emmc, and when i try to boot without sd, directly from emmc, got same errors as on by board.
> When i boot to u-boot, it shows mmc1 mmc2, and mmc info works on both. But it cant read data and even mmc part not working.
> 
> 
> My board has only sdc0 lines routed from soc. If solder emmc on it, not works, if sd card via wires, all ok, 4-bit width.
> 
> 
> 
> U-boot output on marsboard
> 
> => mmc list
> SUNXI SD/MMC: 0 (SD)
> SUNXI SD/MMC: 1
> 
> => mmc info
> Device: SUNXI SD/MMC
> Manufacturer ID: 2
> OEM: 544d
> Name: SA04G 
> Tran Speed: 50000000
> Rd Block Len: 512
> SD version 3.0
> High Capacity: Yes
> Capacity: 3.6 GiB
> Bus Width: 4-bit
> Erase Group Size: 512 Bytes
> 
> => mmc part
> 
> Partition Map for MMC device 0  --   Partition Type: DOS
> 
> Part.Start Sector.Num Sectors.UUID..Type
> 1.2048      .12288     .da1dcf13-01.83
> 2.14336     .204800    .da1dcf13-02.83
> 3.219136    .204800    .da1dcf13-03.83
> 4.423936    .409600    .da1dcf13-04.05 Extd
> 5.425984    .204800    .da1dcf13-05.83
> 6.632832    .200704    .da1dcf13-06.83
> 
> => mmc dev 1
> CMD_SEND:0
> ..ARG... 0x00000000
> ..MMC_RSP_NONE
> CMD_SEND:8
> ..ARG... 0x000001AA
> ..RET... -110
> CMD_SEND:55
> ..ARG... 0x00000000
> ..RET... -110
> CMD_SEND:0
> ..ARG... 0x00000000
> ..MMC_RSP_NONE
> CMD_SEND:1
> ..ARG... 0x00000000
> ..MMC_RSP_R3,4.. 0x00FF8080 
> CMD_SEND:1
> ..ARG... 0x40300000
> ..MMC_RSP_R3,4.. 0x00FF8080 
> CMD_SEND:0
> ..ARG... 0x00000000
> ..MMC_RSP_NONE
> CMD_SEND:1
> ..ARG... 0x40300000
> ..MMC_RSP_R3,4.. 0x00FF8080 
> CMD_SEND:1
> ..ARG... 0x40300000
> ..MMC_RSP_R3,4.. 0xC0FF8080 
> CMD_SEND:2
> ..ARG... 0x00000000
> ..MMC_RSP_R2.. 0x1501004D 
> ..          .. 0x34473146 
> ..          .. 0x42030B01 
> ..          .. 0x7585C009 
> 
> .....DUMPING DATA
> .....000 - 15 01 00 4D 
> .....004 - 34 47 31 46 
> .....008 - 42 03 0B 01 
> .....012 - 75 85 C0 09 
> CMD_SEND:3
> ..ARG... 0x00010000
> ..MMC_RSP_R1,5,6,7 . 0x00000500 
> CMD_SEND:9
> ..ARG... 0x00010000
> ..MMC_RSP_R2.. 0xD0270132 
> ..          .. 0x0F5903FF 
> ..          .. 0xF6DBFFE7 
> ..          .. 0x8A404057 
> 
> .....DUMPING DATA
> .....000 - D0 27 01 32 
> .....004 - 0F 59 03 FF 
> .....008 - F6 DB FF E7 
> .....012 - 8A 40 40 57 
> CMD_SEND:13
> ..ARG... 0x00010000
> ..MMC_RSP_R1,5,6,7 . 0x00000700 
> CURR STATE:3
> CMD_SEND:7
> ..ARG... 0x00010000
> ..MMC_RSP_R1,5,6,7 . 0x00000700 
> CMD_SEND:8
> ..ARG... 0x00000000
> ..MMC_RSP_R1,5,6,7 . 0x00000900 
> CMD_SEND:8
> ..ARG... 0x00000000
> ..MMC_RSP_R1,5,6,7 . 0x00000900 
> CMD_SEND:6
> ..ARG... 0x03B90100
> ..MMC_RSP_R1b.. 0x00000900 
> CMD_SEND:13
> ..ARG... 0x00010000
> ..MMC_RSP_R1,5,6,7 . 0x00000900 
> CURR STATE:4
> CMD_SEND:8
> ..ARG... 0x00000000
> ..MMC_RSP_R1,5,6,7 . 0x00000900 
> CMD_SEND:6
> ..ARG... 0x03B70100
> ..RET... -110
> CMD_SEND:16
> ..ARG... 0x00000200
> ..MMC_RSP_R1,5,6,7 . 0x00000900 
> CMD_SEND:17
> ..ARG... 0x00000000
> ..RET... -110
> mmc_bread: Failed to read blocks
> CMD_SEND:16
> ..ARG... 0x00000200
> ..MMC_RSP_R1,5,6,7 . 0x00000900 
> CMD_SEND:17
> ..ARG... 0x00000000
> ..RET... -110
> mmc_bread: Failed to read blocks
> CMD_SEND:16
> ..ARG... 0x00000200
> ..MMC_RSP_R1,5,6,7 . 0x00000900 
> CMD_SEND:18
> ..ARG... 0x00000040
> ..RET... -110
> mmc_bread: Failed to read blocks
> switch to partitions #0, OK
> mmc1(part 0) is current device
> 
> 
> => mmc info
> Device: SUNXI SD/MMC
> Manufacturer ID: 15
> OEM: 100
> Name: M4G1F 
> Tran Speed: 52000000
> Rd Block Len: 512
> MMC version 4.4.1
> High Capacity: Yes
> Capacity: 3.6 GiB
> Bus Width: 1-bit
> Erase Group Size: 512 KiB
> HC WP Group Size: 4 MiB
> User Capacity: 3.6 GiB WRREL
> Boot Capacity: 1 MiB ENH
> RPMB Capacity: 128 KiB ENH
> 
> => mmc part
> ## Unknown partition table type 0
> 
> 
> 
> 
> U-boot boot log from my board with emmc
> 
> Trying to boot from MMC1
> CMD_SEND:0
> ..ARG... 0x00000000
> ..MMC_RSP_NONE
> CMD_SEND:8
> ..ARG... 0x00000000
> ..RET... -110
> CMD_SEND:55
> ..ARG... 0x00000000
> ..RET... -110
> CMD_SEND:0
> ..ARG... 0x00000000
> ..MMC_RSP_NONE
> CMD_SEND:1
> ..ARG... 0x00000000
> ..MMC_RSP_R3,4.. 0x00000000 
> CMD_SEND:1
> ..ARG... 0x00000000
> ..MMC_RSP_R3,4.. 0x00000000 
> CMD_SEND:0
> ..ARG... 0x00000000
> ..MMC_RSP_NONE
> CMD_SEND:1
> ..ARG... 0x00000000
> ..MMC_RSP_R3,4.. 0x00000000 
> CMD_SEND:1
> ..ARG... 0x00000000
> ..MMC_RSP_R3,4.. 0x00000000 
> CMD_SEND:2
> ..ARG... 0x00000000
> ..MMC_RSP_R2.. 0x00000000 
> ..          .. 0x00000000 
> ..          .. 0x00000000 
> ..          .. 0x00000000 
> 
> .....DUMPING DATA
> .....000 - 00 00 00 00 
> .....004 - 00 00 00 00 
> .....008 - 00 00 00 00 
> .....012 - 00 00 00 00 
> CMD_SEND:3
> ..ARG... 0x00000000
> ..MMC_RSP_R1,5,6,7 . 0x00000000 
> CMD_SEND:9
> ..ARG... 0x00000000
> ..MMC_RSP_R2.. 0x00000000 
> ..          .. 0x00000000 
> ..          .. 0x00000000 
> ..          .. 0x00000000 
> 
> .....DUMPING DATA
> .....000 - 00 00 00 00 
> .....004 - 00 00 00 00 
> .....008 - 00 00 00 00 
> .....012 - 00 00 00 00 
> CMD_SEND:13
> ..ARG... 0x00000000
> ..MMC_RSP_R1,5,6,7 . 0x00000000 
> CURR STATE:3
> CMD_SEND:7
> ..ARG... 0x00000000
> ..MMC_RSP_R1,5,6,7 . 0x00000000 
> CMD_SEND:8
> ..ARG... 0x00000000
> ..MMC_RSP_R1,5,6,7 . 0x00000000 
> CMD_SEND:8
> ..ARG... 0x00000000
> ..MMC_RSP_R1,5,6,7 . 0x00000000 
> CMD_SEND:6
> ..ARG... 0x00000000
> ..MMC_RSP_R1b.. 0x00000000 
> CMD_SEND:13
> ..ARG... 0x00000000
> ..MMC_RSP_R1,5,6,7 . 0x00000000 
> CURR STATE:4
> CMD_SEND:8
> ..ARG... 0x00000000
> ..MMC_RSP_R1,5,6,7 . 0x00000000 
> CMD_SEND:6
> ..ARG... 0x00000000
> ..RET... -110
> CMD_SEND:16
> ..ARG... 0x00000000
> ..MMC_RSP_R1,5,6,7 . 0x00000000 
> CMD_SEND:17
> ..ARG... 0x00000000
> ..RET... -110
> 
> mmc_load_image_raw_sector: mmc block read error
> SPL: failed to boot from all boot devices
> ### ERROR ### Please RESET the board ###
> 

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

* [U-Boot] [bug report] sunxi: booting from eMMC
       [not found]                                                                 ` <073f966f-29be-a35e-8f1c-9ef1c1f2bef7@samsung.com>
@ 2016-11-03 10:10                                                                   ` Alexandr Bochkarev
  2016-11-03 19:57                                                                     ` Alexandr Bochkarev
  0 siblings, 1 reply; 42+ messages in thread
From: Alexandr Bochkarev @ 2016-11-03 10:10 UTC (permalink / raw)
  To: u-boot


Some summary

Marsboard by default has nand flash chip on sdc2 lines, but under nand chip, there is emmc bga pads also. 
So i have desoldered nand, and put emmc chip on it. Maybe there is no required pull ups on data lines to work on 4-bit widh, 
and when i boot kernel from sdc0 sd card, kernel init sdc2 emmc only in 1-bit mode. but it works well, i can read can and write, get mbr, etc..
I build u-boot with mmc extra slot config and burn it on emmc, and when i try to boot without sd, directly from emmc, got same errors as on by board.
When i boot to u-boot, it shows mmc1 mmc2, and mmc info works on both. But it cant read data and even mmc part not working.


My board has only sdc0 lines routed from soc. If solder emmc on it, not works, if sd card via wires, all ok, 4-bit width.



U-boot output on marsboard

=> mmc list
SUNXI SD/MMC: 0 (SD)
SUNXI SD/MMC: 1

=> mmc info
Device: SUNXI SD/MMC
Manufacturer ID: 2
OEM: 544d
Name: SA04G 
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 3.6 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes

=> mmc part

Partition Map for MMC device 0  --   Partition Type: DOS

Part.Start Sector.Num Sectors.UUID..Type
 1.2048      .12288     .da1dcf13-01.83
 2.14336     .204800    .da1dcf13-02.83
 3.219136    .204800    .da1dcf13-03.83
 4.423936    .409600    .da1dcf13-04.05 Extd
 5.425984    .204800    .da1dcf13-05.83
 6.632832    .200704    .da1dcf13-06.83

=> mmc dev 1
CMD_SEND:0
..ARG... 0x00000000
..MMC_RSP_NONE
CMD_SEND:8
..ARG... 0x000001AA
..RET... -110
CMD_SEND:55
..ARG... 0x00000000
..RET... -110
CMD_SEND:0
..ARG... 0x00000000
..MMC_RSP_NONE
CMD_SEND:1
..ARG... 0x00000000
..MMC_RSP_R3,4.. 0x00FF8080 
CMD_SEND:1
..ARG... 0x40300000
..MMC_RSP_R3,4.. 0x00FF8080 
CMD_SEND:0
..ARG... 0x00000000
..MMC_RSP_NONE
CMD_SEND:1
..ARG... 0x40300000
..MMC_RSP_R3,4.. 0x00FF8080 
CMD_SEND:1
..ARG... 0x40300000
..MMC_RSP_R3,4.. 0xC0FF8080 
CMD_SEND:2
..ARG... 0x00000000
..MMC_RSP_R2.. 0x1501004D 
..          .. 0x34473146 
..          .. 0x42030B01 
..          .. 0x7585C009 

.....DUMPING DATA
.....000 - 15 01 00 4D 
.....004 - 34 47 31 46 
.....008 - 42 03 0B 01 
.....012 - 75 85 C0 09 
CMD_SEND:3
..ARG... 0x00010000
..MMC_RSP_R1,5,6,7 . 0x00000500 
CMD_SEND:9
..ARG... 0x00010000
..MMC_RSP_R2.. 0xD0270132 
..          .. 0x0F5903FF 
..          .. 0xF6DBFFE7 
..          .. 0x8A404057 

.....DUMPING DATA
.....000 - D0 27 01 32 
.....004 - 0F 59 03 FF 
.....008 - F6 DB FF E7 
.....012 - 8A 40 40 57 
CMD_SEND:13
..ARG... 0x00010000
..MMC_RSP_R1,5,6,7 . 0x00000700 
CURR STATE:3
CMD_SEND:7
..ARG... 0x00010000
..MMC_RSP_R1,5,6,7 . 0x00000700 
CMD_SEND:8
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000900 
CMD_SEND:8
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000900 
CMD_SEND:6
..ARG... 0x03B90100
..MMC_RSP_R1b.. 0x00000900 
CMD_SEND:13
..ARG... 0x00010000
..MMC_RSP_R1,5,6,7 . 0x00000900 
CURR STATE:4
CMD_SEND:8
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000900 
CMD_SEND:6
..ARG... 0x03B70100
..RET... -110
CMD_SEND:16
..ARG... 0x00000200
..MMC_RSP_R1,5,6,7 . 0x00000900 
CMD_SEND:17
..ARG... 0x00000000
..RET... -110
mmc_bread: Failed to read blocks
CMD_SEND:16
..ARG... 0x00000200
..MMC_RSP_R1,5,6,7 . 0x00000900 
CMD_SEND:17
..ARG... 0x00000000
..RET... -110
mmc_bread: Failed to read blocks
CMD_SEND:16
..ARG... 0x00000200
..MMC_RSP_R1,5,6,7 . 0x00000900 
CMD_SEND:18
..ARG... 0x00000040
..RET... -110
mmc_bread: Failed to read blocks
switch to partitions #0, OK
mmc1(part 0) is current device


=> mmc info
Device: SUNXI SD/MMC
Manufacturer ID: 15
OEM: 100
Name: M4G1F 
Tran Speed: 52000000
Rd Block Len: 512
MMC version 4.4.1
High Capacity: Yes
Capacity: 3.6 GiB
Bus Width: 1-bit
Erase Group Size: 512 KiB
HC WP Group Size: 4 MiB
User Capacity: 3.6 GiB WRREL
Boot Capacity: 1 MiB ENH
RPMB Capacity: 128 KiB ENH

=> mmc part
## Unknown partition table type 0




U-boot boot log from my board with emmc

Trying to boot from MMC1
CMD_SEND:0
..ARG... 0x00000000
..MMC_RSP_NONE
CMD_SEND:8
..ARG... 0x00000000
..RET... -110
CMD_SEND:55
..ARG... 0x00000000
..RET... -110
CMD_SEND:0
..ARG... 0x00000000
..MMC_RSP_NONE
CMD_SEND:1
..ARG... 0x00000000
..MMC_RSP_R3,4.. 0x00000000 
CMD_SEND:1
..ARG... 0x00000000
..MMC_RSP_R3,4.. 0x00000000 
CMD_SEND:0
..ARG... 0x00000000
..MMC_RSP_NONE
CMD_SEND:1
..ARG... 0x00000000
..MMC_RSP_R3,4.. 0x00000000 
CMD_SEND:1
..ARG... 0x00000000
..MMC_RSP_R3,4.. 0x00000000 
CMD_SEND:2
..ARG... 0x00000000
..MMC_RSP_R2.. 0x00000000 
..          .. 0x00000000 
..          .. 0x00000000 
..          .. 0x00000000 

.....DUMPING DATA
.....000 - 00 00 00 00 
.....004 - 00 00 00 00 
.....008 - 00 00 00 00 
.....012 - 00 00 00 00 
CMD_SEND:3
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000000 
CMD_SEND:9
..ARG... 0x00000000
..MMC_RSP_R2.. 0x00000000 
..          .. 0x00000000 
..          .. 0x00000000 
..          .. 0x00000000 

.....DUMPING DATA
.....000 - 00 00 00 00 
.....004 - 00 00 00 00 
.....008 - 00 00 00 00 
.....012 - 00 00 00 00 
CMD_SEND:13
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000000 
CURR STATE:3
CMD_SEND:7
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000000 
CMD_SEND:8
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000000 
CMD_SEND:8
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000000 
CMD_SEND:6
..ARG... 0x00000000
..MMC_RSP_R1b.. 0x00000000 
CMD_SEND:13
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000000 
CURR STATE:4
CMD_SEND:8
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000000 
CMD_SEND:6
..ARG... 0x00000000
..RET... -110
CMD_SEND:16
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000000 
CMD_SEND:17
..ARG... 0x00000000
..RET... -110

mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-10-13  1:12                                             ` Jaehoon Chung
@ 2016-10-13  8:18                                               ` Alexandr Bochkarev
       [not found]                                                 ` <03f26ecf-c130-88d3-b3df-d7c6ed90ed48@samsung.com>
  0 siblings, 1 reply; 42+ messages in thread
From: Alexandr Bochkarev @ 2016-10-13  8:18 UTC (permalink / raw)
  To: u-boot

So, this debug output.

U-Boot SPL 2016.11-rc1-g4dc34be-dirty (Oct 13 2016 - 14:04:10)
DRAM: 1024 MiB
CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
Trying to boot from MMC2
init mmc 0 resource
init mmc 0 clock and io
mmc 0 set mod-clk req 24000000 parent 24000000 n 1 m 1 rate 24000000
init mmc 2 resource
init mmc 2 clock and io
mmc 2 set mod-clk req 24000000 parent 24000000 n 1 m 1 rate 24000000
set ios: bus_width: 1, clock: 0
set ios: bus_width: 1, clock: 400000
mmc 2 set mod-clk req 400000 parent 24000000 n 4 m 15 rate 400000
mmc 2, cmd 0(0x80008000), arg 0x00000000
mmc resp 0x00000000
mmc 2, cmd 8(0x80000148), arg 0x000001aa
cmd timeout 100
mmc 2, cmd 55(0x80000177), arg 0x00000000
cmd timeout 100
mmc 2, cmd 0(0x80008000), arg 0x00000000
mmc resp 0x00000000
mmc 2, cmd 1(0x80000041), arg 0x00000000
mmc resp 0x40ff8080
mmc 2, cmd 1(0x80000041), arg 0x40300000
mmc resp 0x40ff8080
mmc 2, cmd 0(0x80008000), arg 0x00000000
mmc resp 0x40ff8080
mmc 2, cmd 1(0x80000041), arg 0x40300000
mmc resp 0x40ff8080
mmc 2, cmd 1(0x80000041), arg 0x40300000
mmc resp 0xc0ff8080
mmc 2, cmd 2(0x800001c2), arg 0x00000000
mmc resp 0x7585c009 0x42030b01 0x34473146 0x1501004d
mmc 2, cmd 3(0x80000143), arg 0x00010000
mmc resp 0x00000500
mmc 2, cmd 9(0x800001c9), arg 0x00010000
mmc resp 0x8a404057 0xf6dbffe7 0x0f5903ff 0xd0270132
mmc 2, cmd 13(0x8000014d), arg 0x00010000
mmc resp 0x00000700
mmc 2, cmd 7(0x80000147), arg 0x00010000
mmc resp 0x00000700
mmc 2, cmd 8(0x80002348), arg 0x00000000
trans data 512 bytes
cacl timeout 78 msec
mmc resp 0x00000900
mmc 2, cmd 8(0x80002348), arg 0x00000000
trans data 512 bytes
cacl timeout 78 msec
mmc resp 0x00000900
mmc cmd 6 check rsp busy
mmc 2, cmd 6(0x80000146), arg 0x03b90100
mmc resp 0x00000900
mmc 2, cmd 13(0x8000014d), arg 0x00010000
mmc resp 0x00000900
mmc 2, cmd 8(0x80002348), arg 0x00000000
trans data 512 bytes
cacl timeout 78 msec
mmc resp 0x00000900
mmc cmd 6 check rsp busy
mmc 2, cmd 6(0x80000146), arg 0x03b70200
cmd timeout 42
mmc cmd 6 check rsp busy
mmc 2, cmd 6(0x80000146), arg 0x03b70100
cmd timeout 42
set ios: bus_width: 1, clock: 52000000
mmc 2 set mod-clk req 52000000 parent 600000000 n 1 m 12 rate 50000000
mmc 2, cmd 16(0x80000150), arg 0x00000200
mmc resp 0x00000900
mmc 2, cmd 17(0x80002351), arg 0x00000050
trans data 512 bytes
cmd timeout 80
mmc_bread: Failed to read blocks
mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

 Seems u-boot tries bus_width: 1, clock: 52000000, like linux kernel, but fails.

> When i bring up the eMMC/SD/SDIO..I did to check the below sequence.
> 
> 1. Power is supplied correctly.
> 2. Clock is enabled correctly
> 3. GPIO pin is set to correct value. (Function, GPIO value..)
> 4. Which buswidth/busmode is supported..and it's correctly changed.

1. power supply is 3.3v on vcc and vccio
2 & 4. datasheet on eemc says

 Data bus width : 1bit (Default) , 4bit and 8bit
 MMC I/F Clock Frequency : 0 ~ 52MHz 
 MMC I/F Boot Frequency : 0 ~ 52MHz

 3. GPIO seems are correct, because then i solder sd card via wires on emmc pads, its boots correct

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-10-12 14:03                                           ` Alexandr Bochkarev
  2016-10-12 17:49                                             ` Alexandr Bochkarev
@ 2016-10-13  1:12                                             ` Jaehoon Chung
  2016-10-13  8:18                                               ` Alexandr Bochkarev
  1 sibling, 1 reply; 42+ messages in thread
From: Jaehoon Chung @ 2016-10-13  1:12 UTC (permalink / raw)
  To: u-boot

On 10/12/2016 11:03 PM, Alexandr Bochkarev wrote:
> 
>>
>> define debug() in your mmc driver..or enable CONFIG_DEBUG..then you can see all debug message.
>>
> 
> When i define CONFIG_DEGUB, u-boot binary size is to large for a20 sram
> I have tried to disable unused features in config, but its not enough

Just add the debug() into your driver..then it's only displayed your driver debug message.

#define debug() ...

> 
>>
>> If you're setting MMC_MODE_8BIT..try to remove it..
>>
> I am not never set 8 bit mode
> And now found it defines
> 
> #define MMC_MODE_4BIT		(1 << 2)
> #define MMC_MODE_8BIT		(1 << 3)
> 
> and replace with 
> 
> #define MMC_MODE_4BIT		(1 << 2)
> #define MMC_MODE_8BIT		(1 << 2) //(1 << 3)
> 
> The same result.
> 
> 

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-10-12 17:49                                             ` Alexandr Bochkarev
@ 2016-10-13  1:11                                               ` Jaehoon Chung
  2016-11-03 21:23                                               ` Alexandr Bochkarev
  1 sibling, 0 replies; 42+ messages in thread
From: Jaehoon Chung @ 2016-10-13  1:11 UTC (permalink / raw)
  To: u-boot

On 10/13/2016 02:49 AM, Alexandr Bochkarev wrote:
> I decided to check how linux kernel init emmc on marsboard, which i boot from SD card
> And i found, that it inited only in 1-bit mode, is it normal? it works, i can edit files on it

Well, it's not normal.
It's possible to use only 1bit buswidth...but i didn't see the case about using only 1bit buswidth.

> 
> linux set 
> eMMC(sdc2) to mmc0 
> SD(sdc0) to mmc1
> 
> # cat /sys/kernel/debug/mmc0/ios    eMMC
> clock:          52000000 Hz
> vdd:            7 (1.65 - 1.95 V)
> bus mode:       2 (push-pull)
> chip select:    0 (don't care)
> power mode:     2 (on)
> bus width:      0 (1 bits)
> timing spec:    1 (mmc high-speed)
> 
> # cat /sys/kernel/debug/mmc1/ios    SD card
> clock:          50000000 Hz
> vdd:            16 (2.8 ~ 2.9 V)
> bus mode:       2 (push-pull)
> chip select:    0 (don't care)
> power mode:     2 (on)
> bus width:      2 (4 bits)
> timing spec:    2 (sd high-speed)
> 
> # dmesg | grep 'mmc-msg\|mmc-err?
> 
> [    0.167917] [mmc-msg] sw_mci_init
> [    0.168039] [mmc-msg] MMC host used card: 0x5, boot card: 0x4, io_card 0
> [    0.168310] [mmc-msg] sdc2 set round clock 400000, src 24000000
> [    0.168520] [mmc-msg] sdc2 set ios: clk 0Hz bm OD pm OFF vdd 3.3V width 1 timing LEGACY(SDR12) dt B
> [    0.169639] [mmc-msg] sdc2 Probe: base:0xf005e000 irq:66 sg_cpu:f0060000(4fc00000) ret 0.
> [    0.169683] [mmc-msg] sdc2 set ios: clk 0Hz bm PP pm UP vdd 3.3V width 1 timing LEGACY(SDR12) dt B
> [    0.169695] [mmc-msg] sdc2 power on
> [    0.170832] [mmc-msg] sdc0 set round clock 400000, src 24000000
> [    0.171037] [mmc-msg] sdc0 set ios: clk 0Hz bm OD pm OFF vdd 3.3V width 1 timing LEGACY(SDR12) dt B
> [    0.172069] [mmc-msg] sdc0 Probe: base:0xf0062000 irq:64 sg_cpu:f0064000(4fc01000) ret 0.
> [    0.182158] [mmc-msg] sdc2 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
> [    0.182189] [mmc-msg] sdc2 set round clock 400000, src 24000000
> [    0.254447] [mmc-err] smc 2 err, cmd 52,  RTO
> [    0.259631] [mmc-err] smc 2 err, cmd 52,  RTO
> [    0.264001] [mmc-msg] sdc2 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
> [    0.266386] [mmc-msg] sdc2 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
> [    0.268208] [mmc-err] smc 2 err, cmd 8,  RTO
> [    0.273296] [mmc-err] smc 2 err, cmd 5,  RTO
> [    0.278383] [mmc-err] smc 2 err, cmd 5,  RTO
> [    0.283461] [mmc-err] smc 2 err, cmd 5,  RTO
> [    0.288546] [mmc-err] smc 2 err, cmd 5,  RTO
> [    0.293641] [mmc-err] smc 2 err, cmd 55,  RTO
> [    0.298813] [mmc-err] smc 2 err, cmd 55,  RTO
> [    0.303988] [mmc-err] smc 2 err, cmd 55,  RTO
> [    0.309158] [mmc-err] smc 2 err, cmd 55,  RTO
> [    0.313529] [mmc-msg] sdc2 set ios: clk 400000Hz bm OD pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
> [    0.313857] [mmc-msg] sdc2 set ios: clk 400000Hz bm OD pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
> [    0.313874] [mmc-msg] sdc2 set ios: clk 400000Hz bm OD pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
> [    0.313889] [mmc-msg] sdc2 set ios: clk 400000Hz bm OD pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
> [    0.316273] [mmc-msg] sdc2 set ios: clk 400000Hz bm OD pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
> [    0.333276] [mmc-msg] sdc2 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
> [    0.346076] [mmc-msg] sdc2 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing MMC-HS(SDR20) dt B
> [    0.346092] [mmc-msg] sdc2 set ios: clk 52000000Hz bm PP pm ON vdd 3.3V width 1 timing MMC-HS(SDR20) dt B
> [    0.346123] [mmc-msg] sdc2 set round clock 42857143, src 600000000
> [    0.401211] [mmc-msg] sdc2 set ios: clk 52000000Hz bm PP pm ON vdd 3.3V width 8 timing MMC-HS(SDR20) dt B
> [    0.401276] [mmc-err] smc 2 err, cmd 8,  DCE EBE
> [    0.405889] [mmc-err] In data read operation
> [    0.410155] [mmc-msg] found data error, need to send stop command
> [    0.410172] [mmc-err] sdc 2 send stop command failed
> [    0.415209] [mmc-msg] sdc2 set ios: clk 52000000Hz bm PP pm ON vdd 3.3V width 4 timing MMC-HS(SDR20) dt B
> [    0.415284] [mmc-err] smc 2 err, cmd 8,  DCE
> [    0.419553] [mmc-err] In data read operation
> [    0.423818] [mmc-msg] found data error, need to send stop command
> [    0.423834] [mmc-err] sdc 2 send stop command failed

buswidth test are all failed..so it's set to 1bit buswidth..Dose it support 4bit buswidth on hardware?
If my understanding is right, it's used SDR20(?)..how about controlling clk value..?
clock value is set to high value..

When i bring up the eMMC/SD/SDIO..I did to check the below sequence.

1. Power is supplied correctly.
2. Clock is enabled correctly
3. GPIO pin is set to correct value. (Function, GPIO value..)
4. Which buswidth/busmode is supported..and it's correctly changed.

Above checking lists nave to ensure...after that..can be checked mmc core or host controller.

Beset Regards,
Jaehoon Chung

> [    0.428862] [mmc-msg] sdc2 set ios: clk 52000000Hz bm PP pm ON vdd 3.3V width 1 timing MMC-HS(SDR20) dt B
> [    1.167097] [mmc-msg] mmc 0 detect change, present 1
> [    1.662131] [mmc-msg] sdc0 set ios: clk 0Hz bm PP pm UP vdd 3.3V width 1 timing LEGACY(SDR12) dt B
> [    1.662143] [mmc-msg] sdc0 power on
> [    1.682156] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
> [    1.682200] [mmc-msg] sdc0 set round clock 400000, src 24000000
> [    1.754452] [mmc-err] smc 0 err, cmd 52,  RTO
> [    1.759631] [mmc-err] smc 0 err, cmd 52,  RTO
> [    1.764010] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
> [    1.770004] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
> [    1.772136] [mmc-err] smc 0 err, cmd 5,  RTO
> [    1.777223] [mmc-err] smc 0 err, cmd 5,  RTO
> [    1.782306] [mmc-err] smc 0 err, cmd 5,  RTO
> [    1.787390] [mmc-err] smc 0 err, cmd 5,  RTO
> [    1.792296] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
> [    1.792315] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
> [    1.794700] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
> [    1.824841] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing SD-HS(SDR25) dt B
> [    1.824859] [mmc-msg] sdc0 set ios: clk 50000000Hz bm PP pm ON vdd 3.3V width 1 timing SD-HS(SDR25) dt B
> [    1.824901] [mmc-msg] sdc0 set round clock 42857143, src 600000000
> [    1.879993] [mmc-msg] sdc0 set ios: clk 50000000Hz bm PP pm ON vdd 3.3V width 4 timing SD-HS(SDR25) dt B
> 
> 

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-10-12 14:03                                           ` Alexandr Bochkarev
@ 2016-10-12 17:49                                             ` Alexandr Bochkarev
  2016-10-13  1:11                                               ` Jaehoon Chung
  2016-11-03 21:23                                               ` Alexandr Bochkarev
  2016-10-13  1:12                                             ` Jaehoon Chung
  1 sibling, 2 replies; 42+ messages in thread
From: Alexandr Bochkarev @ 2016-10-12 17:49 UTC (permalink / raw)
  To: u-boot

I decided to check how linux kernel init emmc on marsboard, which i boot from SD card
And i found, that it inited only in 1-bit mode, is it normal? it works, i can edit files on it

linux set 
eMMC(sdc2) to mmc0 
SD(sdc0) to mmc1

# cat /sys/kernel/debug/mmc0/ios    eMMC
clock:          52000000 Hz
vdd:            7 (1.65 - 1.95 V)
bus mode:       2 (push-pull)
chip select:    0 (don't care)
power mode:     2 (on)
bus width:      0 (1 bits)
timing spec:    1 (mmc high-speed)

# cat /sys/kernel/debug/mmc1/ios    SD card
clock:          50000000 Hz
vdd:            16 (2.8 ~ 2.9 V)
bus mode:       2 (push-pull)
chip select:    0 (don't care)
power mode:     2 (on)
bus width:      2 (4 bits)
timing spec:    2 (sd high-speed)

# dmesg | grep 'mmc-msg\|mmc-err?

[    0.167917] [mmc-msg] sw_mci_init
[    0.168039] [mmc-msg] MMC host used card: 0x5, boot card: 0x4, io_card 0
[    0.168310] [mmc-msg] sdc2 set round clock 400000, src 24000000
[    0.168520] [mmc-msg] sdc2 set ios: clk 0Hz bm OD pm OFF vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    0.169639] [mmc-msg] sdc2 Probe: base:0xf005e000 irq:66 sg_cpu:f0060000(4fc00000) ret 0.
[    0.169683] [mmc-msg] sdc2 set ios: clk 0Hz bm PP pm UP vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    0.169695] [mmc-msg] sdc2 power on
[    0.170832] [mmc-msg] sdc0 set round clock 400000, src 24000000
[    0.171037] [mmc-msg] sdc0 set ios: clk 0Hz bm OD pm OFF vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    0.172069] [mmc-msg] sdc0 Probe: base:0xf0062000 irq:64 sg_cpu:f0064000(4fc01000) ret 0.
[    0.182158] [mmc-msg] sdc2 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    0.182189] [mmc-msg] sdc2 set round clock 400000, src 24000000
[    0.254447] [mmc-err] smc 2 err, cmd 52,  RTO
[    0.259631] [mmc-err] smc 2 err, cmd 52,  RTO
[    0.264001] [mmc-msg] sdc2 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    0.266386] [mmc-msg] sdc2 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    0.268208] [mmc-err] smc 2 err, cmd 8,  RTO
[    0.273296] [mmc-err] smc 2 err, cmd 5,  RTO
[    0.278383] [mmc-err] smc 2 err, cmd 5,  RTO
[    0.283461] [mmc-err] smc 2 err, cmd 5,  RTO
[    0.288546] [mmc-err] smc 2 err, cmd 5,  RTO
[    0.293641] [mmc-err] smc 2 err, cmd 55,  RTO
[    0.298813] [mmc-err] smc 2 err, cmd 55,  RTO
[    0.303988] [mmc-err] smc 2 err, cmd 55,  RTO
[    0.309158] [mmc-err] smc 2 err, cmd 55,  RTO
[    0.313529] [mmc-msg] sdc2 set ios: clk 400000Hz bm OD pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    0.313857] [mmc-msg] sdc2 set ios: clk 400000Hz bm OD pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    0.313874] [mmc-msg] sdc2 set ios: clk 400000Hz bm OD pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    0.313889] [mmc-msg] sdc2 set ios: clk 400000Hz bm OD pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    0.316273] [mmc-msg] sdc2 set ios: clk 400000Hz bm OD pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    0.333276] [mmc-msg] sdc2 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    0.346076] [mmc-msg] sdc2 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing MMC-HS(SDR20) dt B
[    0.346092] [mmc-msg] sdc2 set ios: clk 52000000Hz bm PP pm ON vdd 3.3V width 1 timing MMC-HS(SDR20) dt B
[    0.346123] [mmc-msg] sdc2 set round clock 42857143, src 600000000
[    0.401211] [mmc-msg] sdc2 set ios: clk 52000000Hz bm PP pm ON vdd 3.3V width 8 timing MMC-HS(SDR20) dt B
[    0.401276] [mmc-err] smc 2 err, cmd 8,  DCE EBE
[    0.405889] [mmc-err] In data read operation
[    0.410155] [mmc-msg] found data error, need to send stop command
[    0.410172] [mmc-err] sdc 2 send stop command failed
[    0.415209] [mmc-msg] sdc2 set ios: clk 52000000Hz bm PP pm ON vdd 3.3V width 4 timing MMC-HS(SDR20) dt B
[    0.415284] [mmc-err] smc 2 err, cmd 8,  DCE
[    0.419553] [mmc-err] In data read operation
[    0.423818] [mmc-msg] found data error, need to send stop command
[    0.423834] [mmc-err] sdc 2 send stop command failed
[    0.428862] [mmc-msg] sdc2 set ios: clk 52000000Hz bm PP pm ON vdd 3.3V width 1 timing MMC-HS(SDR20) dt B
[    1.167097] [mmc-msg] mmc 0 detect change, present 1
[    1.662131] [mmc-msg] sdc0 set ios: clk 0Hz bm PP pm UP vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    1.662143] [mmc-msg] sdc0 power on
[    1.682156] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    1.682200] [mmc-msg] sdc0 set round clock 400000, src 24000000
[    1.754452] [mmc-err] smc 0 err, cmd 52,  RTO
[    1.759631] [mmc-err] smc 0 err, cmd 52,  RTO
[    1.764010] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    1.770004] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    1.772136] [mmc-err] smc 0 err, cmd 5,  RTO
[    1.777223] [mmc-err] smc 0 err, cmd 5,  RTO
[    1.782306] [mmc-err] smc 0 err, cmd 5,  RTO
[    1.787390] [mmc-err] smc 0 err, cmd 5,  RTO
[    1.792296] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    1.792315] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    1.794700] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B
[    1.824841] [mmc-msg] sdc0 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing SD-HS(SDR25) dt B
[    1.824859] [mmc-msg] sdc0 set ios: clk 50000000Hz bm PP pm ON vdd 3.3V width 1 timing SD-HS(SDR25) dt B
[    1.824901] [mmc-msg] sdc0 set round clock 42857143, src 600000000
[    1.879993] [mmc-msg] sdc0 set ios: clk 50000000Hz bm PP pm ON vdd 3.3V width 4 timing SD-HS(SDR25) dt B

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-10-12 13:30                                         ` Jaehoon Chung
@ 2016-10-12 14:03                                           ` Alexandr Bochkarev
  2016-10-12 17:49                                             ` Alexandr Bochkarev
  2016-10-13  1:12                                             ` Jaehoon Chung
  0 siblings, 2 replies; 42+ messages in thread
From: Alexandr Bochkarev @ 2016-10-12 14:03 UTC (permalink / raw)
  To: u-boot


> 
> define debug() in your mmc driver..or enable CONFIG_DEBUG..then you can see all debug message.
> 

When i define CONFIG_DEGUB, u-boot binary size is to large for a20 sram
I have tried to disable unused features in config, but its not enough

> 
> If you're setting MMC_MODE_8BIT..try to remove it..
> 
I am not never set 8 bit mode
And now found it defines

#define MMC_MODE_4BIT		(1 << 2)
#define MMC_MODE_8BIT		(1 << 3)

and replace with 

#define MMC_MODE_4BIT		(1 << 2)
#define MMC_MODE_8BIT		(1 << 2) //(1 << 3)

The same result.

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-10-12 13:11                                       ` Alexandr Bochkarev
@ 2016-10-12 13:30                                         ` Jaehoon Chung
  2016-10-12 14:03                                           ` Alexandr Bochkarev
  0 siblings, 1 reply; 42+ messages in thread
From: Jaehoon Chung @ 2016-10-12 13:30 UTC (permalink / raw)
  To: u-boot

On 10/12/2016 10:11 PM, Alexandr Bochkarev wrote:
> Now i boot marsboard from sd card with new config

Good.

> 
> => mmc list
> SUNXI SD/MMC: 0 (SD)
> SUNXI SD/MMC: 1
> 
> => mmc info
> Device: SUNXI SD/MMC
> Manufacturer ID: 2
> OEM: 544d
> Name: SA04G 
> Tran Speed: 50000000
> Rd Block Len: 512
> SD version 3.0
> High Capacity: Yes
> Capacity: 3.6 GiB
> Bus Width: 4-bit
> Erase Group Size: 512 Bytes
> 
> => mmc part
> 
> Partition Map for MMC device 0  --   Partition Type: DOS
> 
> Part.Start Sector.Num Sectors.UUID..Type
>   1.2048      .12288     .da1dcf13-01.83
>   2.14336     .204800    .da1dcf13-02.83
>   3.219136    .204800    .da1dcf13-03.83
>   4.423936    .409600    .da1dcf13-04.05 Extd
>   5.425984    .204800    .da1dcf13-05.83
>   6.632832    .200704    .da1dcf13-06.83
> 
> => mmc dev 1
> CMD_SEND:0
> ..ARG... 0x00000000
> ..MMC_RSP_NONE
> CMD_SEND:8
> ..ARG... 0x000001AA
> ..RET... -110
> CMD_SEND:55
> ..ARG... 0x00000000
> ..RET... -110
> CMD_SEND:0
> ..ARG... 0x00000000
> ..MMC_RSP_NONE
> CMD_SEND:1
> ..ARG... 0x00000000
> ..MMC_RSP_R3,4.. 0x00FF8080 
> CMD_SEND:1
> ..ARG... 0x40300000
> ..MMC_RSP_R3,4.. 0x00FF8080 
> CMD_SEND:0
> ..ARG... 0x00000000
> ..MMC_RSP_NONE
> CMD_SEND:1
> ..ARG... 0x40300000
> ..MMC_RSP_R3,4.. 0x00FF8080 
> CMD_SEND:1
> ..ARG... 0x40300000
> ..MMC_RSP_R3,4.. 0xC0FF8080 
> CMD_SEND:2
> ..ARG... 0x00000000
> ..MMC_RSP_R2.. 0x1501004D 
> ..          .. 0x34473146 
> ..          .. 0x42030B01 
> ..          .. 0x7585C009 
> 
> .....DUMPING DATA
> .....000 - 15 01 00 4D 
> .....004 - 34 47 31 46 
> .....008 - 42 03 0B 01 
> .....012 - 75 85 C0 09 
> CMD_SEND:3
> ..ARG... 0x00010000
> ..MMC_RSP_R1,5,6,7 . 0x00000500 
> CMD_SEND:9
> ..ARG... 0x00010000
> ..MMC_RSP_R2.. 0xD0270132 
> ..          .. 0x0F5903FF 
> ..          .. 0xF6DBFFE7 
> ..          .. 0x8A404057 
> 
> .....DUMPING DATA
> .....000 - D0 27 01 32 
> .....004 - 0F 59 03 FF 
> .....008 - F6 DB FF E7 
> .....012 - 8A 40 40 57 
> CMD_SEND:13
> ..ARG... 0x00010000
> ..MMC_RSP_R1,5,6,7 . 0x00000700 
> CURR STATE:3
> CMD_SEND:7
> ..ARG... 0x00010000
> ..MMC_RSP_R1,5,6,7 . 0x00000700 
> CMD_SEND:8
> ..ARG... 0x00000000
> ..MMC_RSP_R1,5,6,7 . 0x00000900 
> CMD_SEND:8
> ..ARG... 0x00000000
> ..MMC_RSP_R1,5,6,7 . 0x00000900 
> CMD_SEND:6
> ..ARG... 0x03B90100
> ..MMC_RSP_R1b.. 0x00000900 
> CMD_SEND:13
> ..ARG... 0x00010000
> ..MMC_RSP_R1,5,6,7 . 0x00000900 
> CURR STATE:4
> CMD_SEND:8
> ..ARG... 0x00000000
> ..MMC_RSP_R1,5,6,7 . 0x00000900 
> CMD_SEND:6
> ..ARG... 0x03B70100
> ..RET... -110

Maybe at here..switch to buswidth..but failed.
define debug() in your mmc driver..or enable CONFIG_DEBUG..then you can see all debug message.

> CMD_SEND:16
> ..ARG... 0x00000200
> ..MMC_RSP_R1,5,6,7 . 0x00000900 
> CMD_SEND:17
> ..ARG... 0x00000000
> ..RET... -110
> mmc_bread: Failed to read blocks
> CMD_SEND:16
> ..ARG... 0x00000200
> ..MMC_RSP_R1,5,6,7 . 0x00000900 
> CMD_SEND:17
> ..ARG... 0x00000000
> ..RET... -110
> mmc_bread: Failed to read blocks
> CMD_SEND:16
> ..ARG... 0x00000200
> ..MMC_RSP_R1,5,6,7 . 0x00000900 
> CMD_SEND:18
> ..ARG... 0x00000040
> ..RET... -110
> mmc_bread: Failed to read blocks
> switch to partitions #0, OK
> mmc1(part 0) is current device
> 
> 
> => mmc info
> Device: SUNXI SD/MMC
> Manufacturer ID: 15
> OEM: 100
> Name: M4G1F 
> Tran Speed: 52000000
> Rd Block Len: 512
> MMC version 4.4.1
> High Capacity: Yes
> Capacity: 3.6 GiB
> Bus Width: 1-bit
> Erase Group Size: 512 KiB
> HC WP Group Size: 4 MiB
> User Capacity: 3.6 GiB WRREL
> Boot Capacity: 1 MiB ENH
> RPMB Capacity: 128 KiB ENH
> 
> => mmc part
> ## Unknown partition table type 0
> 
> 
> 
> 
> eMMC burned same image as SD. And seems like it doesnt switched to 4-bit bus width

If you're setting MMC_MODE_8BIT..try to remove it..

> 
> 

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-10-12 12:57                                     ` Alexandr Bochkarev
@ 2016-10-12 13:11                                       ` Alexandr Bochkarev
  2016-10-12 13:30                                         ` Jaehoon Chung
  0 siblings, 1 reply; 42+ messages in thread
From: Alexandr Bochkarev @ 2016-10-12 13:11 UTC (permalink / raw)
  To: u-boot

Now i boot marsboard from sd card with new config

=> mmc list
SUNXI SD/MMC: 0 (SD)
SUNXI SD/MMC: 1

=> mmc info
Device: SUNXI SD/MMC
Manufacturer ID: 2
OEM: 544d
Name: SA04G 
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 3.6 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes

=> mmc part

Partition Map for MMC device 0  --   Partition Type: DOS

Part.Start Sector.Num Sectors.UUID..Type
  1.2048      .12288     .da1dcf13-01.83
  2.14336     .204800    .da1dcf13-02.83
  3.219136    .204800    .da1dcf13-03.83
  4.423936    .409600    .da1dcf13-04.05 Extd
  5.425984    .204800    .da1dcf13-05.83
  6.632832    .200704    .da1dcf13-06.83

=> mmc dev 1
CMD_SEND:0
..ARG... 0x00000000
..MMC_RSP_NONE
CMD_SEND:8
..ARG... 0x000001AA
..RET... -110
CMD_SEND:55
..ARG... 0x00000000
..RET... -110
CMD_SEND:0
..ARG... 0x00000000
..MMC_RSP_NONE
CMD_SEND:1
..ARG... 0x00000000
..MMC_RSP_R3,4.. 0x00FF8080 
CMD_SEND:1
..ARG... 0x40300000
..MMC_RSP_R3,4.. 0x00FF8080 
CMD_SEND:0
..ARG... 0x00000000
..MMC_RSP_NONE
CMD_SEND:1
..ARG... 0x40300000
..MMC_RSP_R3,4.. 0x00FF8080 
CMD_SEND:1
..ARG... 0x40300000
..MMC_RSP_R3,4.. 0xC0FF8080 
CMD_SEND:2
..ARG... 0x00000000
..MMC_RSP_R2.. 0x1501004D 
..          .. 0x34473146 
..          .. 0x42030B01 
..          .. 0x7585C009 

.....DUMPING DATA
.....000 - 15 01 00 4D 
.....004 - 34 47 31 46 
.....008 - 42 03 0B 01 
.....012 - 75 85 C0 09 
CMD_SEND:3
..ARG... 0x00010000
..MMC_RSP_R1,5,6,7 . 0x00000500 
CMD_SEND:9
..ARG... 0x00010000
..MMC_RSP_R2.. 0xD0270132 
..          .. 0x0F5903FF 
..          .. 0xF6DBFFE7 
..          .. 0x8A404057 

.....DUMPING DATA
.....000 - D0 27 01 32 
.....004 - 0F 59 03 FF 
.....008 - F6 DB FF E7 
.....012 - 8A 40 40 57 
CMD_SEND:13
..ARG... 0x00010000
..MMC_RSP_R1,5,6,7 . 0x00000700 
CURR STATE:3
CMD_SEND:7
..ARG... 0x00010000
..MMC_RSP_R1,5,6,7 . 0x00000700 
CMD_SEND:8
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000900 
CMD_SEND:8
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000900 
CMD_SEND:6
..ARG... 0x03B90100
..MMC_RSP_R1b.. 0x00000900 
CMD_SEND:13
..ARG... 0x00010000
..MMC_RSP_R1,5,6,7 . 0x00000900 
CURR STATE:4
CMD_SEND:8
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000900 
CMD_SEND:6
..ARG... 0x03B70100
..RET... -110
CMD_SEND:16
..ARG... 0x00000200
..MMC_RSP_R1,5,6,7 . 0x00000900 
CMD_SEND:17
..ARG... 0x00000000
..RET... -110
mmc_bread: Failed to read blocks
CMD_SEND:16
..ARG... 0x00000200
..MMC_RSP_R1,5,6,7 . 0x00000900 
CMD_SEND:17
..ARG... 0x00000000
..RET... -110
mmc_bread: Failed to read blocks
CMD_SEND:16
..ARG... 0x00000200
..MMC_RSP_R1,5,6,7 . 0x00000900 
CMD_SEND:18
..ARG... 0x00000040
..RET... -110
mmc_bread: Failed to read blocks
switch to partitions #0, OK
mmc1(part 0) is current device


=> mmc info
Device: SUNXI SD/MMC
Manufacturer ID: 15
OEM: 100
Name: M4G1F 
Tran Speed: 52000000
Rd Block Len: 512
MMC version 4.4.1
High Capacity: Yes
Capacity: 3.6 GiB
Bus Width: 1-bit
Erase Group Size: 512 KiB
HC WP Group Size: 4 MiB
User Capacity: 3.6 GiB WRREL
Boot Capacity: 1 MiB ENH
RPMB Capacity: 128 KiB ENH

=> mmc part
## Unknown partition table type 0




eMMC burned same image as SD. And seems like it doesnt switched to 4-bit bus width

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-10-12 12:42                                   ` Alexandr Bochkarev
@ 2016-10-12 12:57                                     ` Alexandr Bochkarev
  2016-10-12 13:11                                       ` Alexandr Bochkarev
  0 siblings, 1 reply; 42+ messages in thread
From: Alexandr Bochkarev @ 2016-10-12 12:57 UTC (permalink / raw)
  To: u-boot

Now i found and add 2 in mmc_extra_slot_number config, compile and burn on marsboard emmc(sdc2)
Got absolutely the same output, as from my board, except mmc number

U-Boot SPL 2016.11-rc1-g4dc34be-dirty (Oct 12 2016 - 18:48:07)
DRAM: 1024 MiB
CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
Trying to boot from MMC2
CMD_SEND:0
..ARG... 0x00000000
..MMC_RSP_NONE
CMD_SEND:8
..ARG... 0x00000000
..RET... -110
CMD_SEND:55
..ARG... 0x00000000
..RET... -110
CMD_SEND:0
..ARG... 0x00000000
..MMC_RSP_NONE
CMD_SEND:1
..ARG... 0x00000000
..MMC_RSP_R3,4.. 0x00000000 
CMD_SEND:1
..ARG... 0x00000000
..MMC_RSP_R3,4.. 0x00000000 
CMD_SEND:0
..ARG... 0x00000000
..MMC_RSP_NONE
CMD_SEND:1
..ARG... 0x00000000
..MMC_RSP_R3,4.. 0x00000000 
CMD_SEND:1
..ARG... 0x00000000
..MMC_RSP_R3,4.. 0x00000000 
CMD_SEND:2
..ARG... 0x00000000
..MMC_RSP_R2.. 0x00000000 
..          .. 0x00000000 
..          .. 0x00000000 
..          .. 0x00000000 

.....DUMPING DATA
.....000 - 00 00 00 00 
.....004 - 00 00 00 00 
.....008 - 00 00 00 00 
.....012 - 00 00 00 00 
CMD_SEND:3
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000000 
CMD_SEND:9
..ARG... 0x00000000
..MMC_RSP_R2.. 0x00000000 
..          .. 0x00000000 
..          .. 0x00000000 
..          .. 0x00000000 

.....DUMPING DATA
.....000 - 00 00 00 00 
.....004 - 00 00 00 00 
.....008 - 00 00 00 00 
.....012 - 00 00 00 00 
CMD_SEND:13
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000000 
CURR STATE:3
CMD_SEND:7
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000000 
CMD_SEND:8
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000000 
CMD_SEND:8
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000000 
CMD_SEND:6
..ARG... 0x00000000
..MMC_RSP_R1b.. 0x00000000 
CMD_SEND:13
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000000 
CURR STATE:4
CMD_SEND:8
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000000 
CMD_SEND:6
..ARG... 0x00000000
..RET... -110
CMD_SEND:16
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000000 
CMD_SEND:17
..ARG... 0x00000000
..RET... -110
test 1 cmdidx: 17 
mmc_bread: Failed to read blocks
mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###


> 12 ???. 2016 ?., ? 18:42, Alexandr Bochkarev <aneox.inbox@gmail.com> ???????(?):
> 
> 
>> I understood more clearly...Your target for using is sdc0(eMMC), right?
> Yes
> 
> Now i have checked det pin on my board. I use standart A20-OLinuXino-Lime_defconfig with my board.
> So PH1 is pull-fown. No changes if just remove det pin
> 
> U-Boot SPL 2016.11-rc1-g4dc34be-dirty (Oct 12 2016 - 18:12:37)
> DRAM: 512 MiB
> Failed to set core voltage! Can't set CPU frequency
> Trying to boot from MMC1
> mmc_bread: Failed to read blocks
> mmc_load_image_raw_sector: mmc block read error
> SPL: failed to boot from all boot devices
> ### ERROR ### Please RESET the board ###
> 
> 
> 
> Then , i removed det pin from config and build again. Burn it to emmc(sdc2) on marsboard and tried to boot this board with mainline u-boot, not 2014 as before and get this.
> 
> U-Boot SPL 2016.11-rc1-g4dc34be-dirty (Oct 12 2016 - 18:24:58)
> DRAM: 1024 MiB
> CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
> Trying to boot from MMC2
> MMC Device 1 not found
> spl: could not find mmc device. error: -19
> SPL: failed to boot from all boot devices
> ### ERROR ### Please RESET the board ###
> 
> Something new, error code is 19 ) Looks like it see that no card on sdc0 and found emmc on sdc2, but fails.
> Same code on my board never tries mmc2, so it part works
> 
>> I will try to check codes relevant to sunxi..
> 
> I hope on your help, thank you very much
> 
> 

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-10-12 12:21                                 ` Jaehoon Chung
@ 2016-10-12 12:42                                   ` Alexandr Bochkarev
  2016-10-12 12:57                                     ` Alexandr Bochkarev
  0 siblings, 1 reply; 42+ messages in thread
From: Alexandr Bochkarev @ 2016-10-12 12:42 UTC (permalink / raw)
  To: u-boot


> I understood more clearly...Your target for using is sdc0(eMMC), right?
Yes

Now i have checked det pin on my board. I use standart A20-OLinuXino-Lime_defconfig with my board.
So PH1 is pull-fown. No changes if just remove det pin

U-Boot SPL 2016.11-rc1-g4dc34be-dirty (Oct 12 2016 - 18:12:37)
DRAM: 512 MiB
Failed to set core voltage! Can't set CPU frequency
Trying to boot from MMC1
mmc_bread: Failed to read blocks
mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###



Then , i removed det pin from config and build again. Burn it to emmc(sdc2) on marsboard and tried to boot this board with mainline u-boot, not 2014 as before and get this.

U-Boot SPL 2016.11-rc1-g4dc34be-dirty (Oct 12 2016 - 18:24:58)
DRAM: 1024 MiB
CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
Trying to boot from MMC2
MMC Device 1 not found
spl: could not find mmc device. error: -19
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

Something new, error code is 19 ) Looks like it see that no card on sdc0 and found emmc on sdc2, but fails.
Same code on my board never tries mmc2, so it part works

> I will try to check codes relevant to sunxi..

I hope on your help, thank you very much

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-10-12 12:11                               ` Alexandr Bochkarev
@ 2016-10-12 12:21                                 ` Jaehoon Chung
  2016-10-12 12:42                                   ` Alexandr Bochkarev
  0 siblings, 1 reply; 42+ messages in thread
From: Jaehoon Chung @ 2016-10-12 12:21 UTC (permalink / raw)
  To: u-boot

On 10/12/2016 09:11 PM, Alexandr Bochkarev wrote:
> On marsboard today i used 2014 u-boot, sd card on sdc0 hardware lines and emmc on sdc2 hardware lines.
> and get error "Card did not respond to voltage select!? , then i tried to boot without sd card, only with emmc on sdc2
> 
> On my board i used mainline u-boot, emmc on sdc0 hardware lines.
> And get block read error, logs below.
> 
> Brom on A20 chip firstly tries sdc0, if fail, then sdc2.

I understood more clearly...Your target for using is sdc0(eMMC), right?
- marsboard for just testing is sdc0 (SD-card)..

> 
> I dont checked only gpio pins, maybe in det pin problem, i will try, thx.

If det-pin problem, it should be fixed too easy. :)
I will try to check codes relevant to sunxi..

Sorry for helping more clearly..

> 
> 
>> 12 ???. 2016 ?., ? 18:05, Jaehoon Chung <jh80.chung@samsung.com> ???????(?):
>>
>> Added Hans (sunxi maintainer)
>>
>> On 10/12/2016 08:25 PM, Alexandr Bochkarev wrote:
>>>> This log means that there is no card on slot..
>>> But then i tried my board with mainline u-boot, emmc was on sdc0 lines.
>>>
>>> Now i tried, boot marsboard from sd, hit button to stop kernel loading.
>>> sun7i# mmc list
>>> SUNXI SD/MMC: 0
>>>
>>> Looks like its doesnt see emmc on sdc2.
>>
>> If i misunderstood something, let me know, plz. :)
>> (Because i don't have targets relevant to sunxi..)
>>
>> U-Boot SPL 2014.04-10685-g4af825f-dirty (Jun 14 2014 - 17:55:48)
>> -> This is right? 2014?
>>
>> What did you mean sdc0/sdc1/sdc2...do you mean the hardware line?
>> If it's hardware line..sdc0 is for eMMC?
>>
>> "Card did not respond to voltage select!"
>> 1. There is no card on slot..
>> 2. Power doesn't supply..
>>
>> Did you check everything? Power, clock, gpio pin..
>>
>>
>> Best Regards,
>> Jaehoon Chung
>>
>>>
>>>
>>> sun7i# printenv
>>> Environment size: 1919/131068 bytes
>>> autoboot=run loadkernel && run setargs && true && bootm 0x48000000
>>> baudrate=115200
>>> boot_ram=saved_stdout=$stdout;setenv stdout nc;if iminfo 0x41000000; then true; setenv stdout $saved_stdout; source 0x41000000;else setenv stdout $saved_stdout;fi
>>> bootcmd=if run loadbootenv; then echo Loaded environment from ${bootenv};env import -t ${scriptaddr} ${filesize};fi;if test -n "${uenvcmd}"; then echo Running uenvcmd ...;run uenvcmd;fi;if run loadbootscr; then echo Jumping to ${bootscr};source ${scriptaddr};fi;run autoboot;
>>> bootdelay=2
>>> bootenv=uEnv.txt
>>> bootm_size=0x10000000
>>> bootscr=boot.scr
>>> console=ttyS0,115200
>>> device=mmc
>>> ethact=dwmac.1c50000
>>> ethaddr=02:d8:09:82:e3:9b
>>> kernel=uImage
>>> loadbootenv=fatload $device $partition $scriptaddr ${bootenv} || ext2load $device $partition $scriptaddr boot/${bootenv} || ext2load $device $partition $scriptaddr ${bootenv}
>>> loadbootscr=fatload $device $partition $scriptaddr ${bootscr} || ext2load $device $partition $scriptaddr boot/${bootscr} ||ext2load $device $partition $scriptaddr ${bootscr}
>>> loadkernel=if bootpath=/boot/ && ext2load $device $partition 0x43000000 ${bootpath}${script} && ext2load $device $partition 0x48000000 ${bootpath}${kernel};then true; elif bootpath=/ && fatload $device $partition 0x43000000 ${script} && fatload $device $partition 0x48000000 ${kernel};then true; elif bootpath=/ && ext2load $device $partition 0x43000000 ${bootpath}${script} && ext2load $device $partition 0x48000000 ${bootpath}${kernel};then true; else false;fi
>>> loglevel=8
>>> panicarg=panic=10
>>> partition=0:1
>>> script=script.bin
>>> scriptaddr=0x44000000
>>> setargs=if test -z \\"$root\\"; then if test \\"$bootpath\\" = "/boot/"; then root="/dev/mmcblk0p1 rootwait"; else root="/dev/mmcblk0p2 rootwait"; fi; fi; setenv bootargs console=${console} root=${root} loglevel=${loglevel} ${panicarg} ${extraargs}
>>> stderr=serial
>>> stdin=serial
>>> stdout=serial
>>>
>>>
>>>> 12 ???. 2016 ?., ? 17:09, Jaehoon Chung <jh80.chung@samsung.com> ???????(?):
>>>>
>>>> On 10/12/2016 07:52 PM, Alexandr Bochkarev wrote:
>>>>> In order to exclude possible errors on my board, i get MarsBoard A20 Lite, desolder nand, and put on emmc pads my emmc flash.
>>>>> So emmc is on sdc2 lines. When iam booting from sd on sdc1, linux kernel can init emmc, and i got /dev/mmcblkp1, works well.
>>>>> But when i eject sd and try to boot from sdc2 emmc, get the same err 17. 
>>>>> In this case i have used some old uboot from marsboard site, because mainline u-boot have not config for a20 marsboard.
>>>>>
>>>>> U-Boot SPL 2014.04-10685-g4af825f-dirty (Jun 14 2014 - 17:55:48)
>>>>> Board: MarsBoard-A20 & MarsPI
>>>>> DRAM: 1024 MiB
>>>>> CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
>>>>> Card did not respond to voltage select!
>>>>
>>>> This log means that there is no card on slot..
>>>> In my case..when i set the wrong mmc boot dev in environment, I had seen the similar log.
>>>> Could you share the environment values?
>>>>
>>>>> spl: mmc init failed: err - -17
>>>>> ### ERROR ### Please RESET the board ###
>>>>>
>>>>> So, the problem with eMMC KLM4G1FE3B-B001 is exists(
>>>>> Maybe you know some cheap emmc, which is 100% works with mainline u-boot?
>>>>
>>>> I'm not sure...100% working card...because we don't ensure 100% what problem there are in mainline u-boot.
>>>>
>>>>>
>>>>>> 7 ???. 2016 ?., ? 14:44, Alexandr Bochkarev <aneox.inbox at gmail.com <mailto:aneox.inbox@gmail.com>> ???????(?):
>>>>>>
>>>>>> Hi!
>>>>>> Very appreciate your help! Hope we will fix it, because my board will be garbage without emmc (
>>>>>> So, my steps:
>>>>>>
>>>>>> git clone git://git.denx.de/u-boot.git --depth 1; cd u-boot;
>>>>>> make CROSS_COMPILE=arm-linux-gnueabihf- A20-OLinuXino-Lime_defconfig
>>>>>> make CROSS_COMPILE=arm-linux-gnueabihf-
>>>>>>
>>>>>> Also turn on CONFIG_MMC_TRACE
>>>>
>>>> the below log seems that is nothing to do..arguments/response data..everything are 0..
>>>> It's strange.
>>>>
>>>>
>>>> Best Regards,
>>>> Jaehoon Chung
>>>>
>>>>>>
>>>>>> After run, got:
>>>>>>
>>>>>> Trying to boot from MMC1
>>>>>> CMD_SEND:0
>>>>>> ..ARG... 0x00000000
>>>>>> ..MMC_RSP_NONE
>>>>>> CMD_SEND:8
>>>>>> ..ARG... 0x00000000
>>>>>> ..RET... -110
>>>>>> CMD_SEND:55
>>>>>> ..ARG... 0x00000000
>>>>>> ..RET... -110
>>>>>> CMD_SEND:0
>>>>>> ..ARG... 0x00000000
>>>>>> ..MMC_RSP_NONE
>>>>>> CMD_SEND:1
>>>>>> ..ARG... 0x00000000
>>>>>> ..MMC_RSP_R3,4.. 0x00000000 
>>>>>> CMD_SEND:1
>>>>>> ..ARG... 0x00000000
>>>>>> ..MMC_RSP_R3,4.. 0x00000000 
>>>>>> CMD_SEND:0
>>>>>> ..ARG... 0x00000000
>>>>>> ..MMC_RSP_NONE
>>>>>> CMD_SEND:1
>>>>>> ..ARG... 0x00000000
>>>>>> ..MMC_RSP_R3,4.. 0x00000000 
>>>>>> CMD_SEND:1
>>>>>> ..ARG... 0x00000000
>>>>>> ..MMC_RSP_R3,4.. 0x00000000 
>>>>>> CMD_SEND:2
>>>>>> ..ARG... 0x00000000
>>>>>> ..MMC_RSP_R2.. 0x00000000 
>>>>>> ..          .. 0x00000000 
>>>>>> ..          .. 0x00000000 
>>>>>> ..          .. 0x00000000 
>>>>>>
>>>>>> .....DUMPING DATA
>>>>>> .....000 - 00 00 00 00 
>>>>>> .....004 - 00 00 00 00 
>>>>>> .....008 - 00 00 00 00 
>>>>>> .....012 - 00 00 00 00 
>>>>>> CMD_SEND:3
>>>>>> ..ARG... 0x00000000
>>>>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>>>>> CMD_SEND:9
>>>>>> ..ARG... 0x00000000
>>>>>> ..MMC_RSP_R2.. 0x00000000 
>>>>>> ..          .. 0x00000000 
>>>>>> ..          .. 0x00000000 
>>>>>> ..          .. 0x00000000 
>>>>>>
>>>>>> .....DUMPING DATA
>>>>>> .....000 - 00 00 00 00 
>>>>>> .....004 - 00 00 00 00 
>>>>>> .....008 - 00 00 00 00 
>>>>>> .....012 - 00 00 00 00 
>>>>>> CMD_SEND:13
>>>>>> ..ARG... 0x00000000
>>>>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>>>>> CURR STATE:3
>>>>>> CMD_SEND:7
>>>>>> ..ARG... 0x00000000
>>>>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>>>>> CMD_SEND:8
>>>>>> ..ARG... 0x00000000
>>>>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>>>>> CMD_SEND:8
>>>>>> ..ARG... 0x00000000
>>>>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>>>>> CMD_SEND:6
>>>>>> ..ARG... 0x00000000
>>>>>> ..MMC_RSP_R1b.. 0x00000000 
>>>>>> CMD_SEND:13
>>>>>> ..ARG... 0x00000000
>>>>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>>>>> CURR STATE:4
>>>>>> CMD_SEND:8
>>>>>> ..ARG... 0x00000000
>>>>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>>>>> CMD_SEND:6
>>>>>> ..ARG... 0x00000000
>>>>>> ..RET... -110
>>>>>> CMD_SEND:16
>>>>>> ..ARG... 0x00000000
>>>>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>>>>> CMD_SEND:17
>>>>>> ..ARG... 0x00000000
>>>>>> ..RET... -110
>>>>>>
>>>>>> hdr read sector 80, count=0
>>>>>> mmc_load_image_raw_sector: mmc block read error
>>>>>> SPL: failed to boot from all boot devices
>>>>>> ### ERROR ### Please RESET the board ###
>>>>>>
>>>>>> So, 
>>>>>> spl_mmc.c on line 66, blk_dread return 0 count
>>>>>> blk.h on line 389, block_dev->block_read(block_dev, start, blkcnt, buffer) return 0
>>>>>> block_dev->block_read is a pointer, seems like it defined in mmc_legacy.c on line 144, bdesc->block_read = mmc_bread;
>>>>>> mmc.c, line 285 mmc_read_blocks return Failed to read blocks
>>>>>> mmc.c, line 223, mmc_send_cmd return 0, cmdidx was 17, like last in mmc trace
>>>>>>
>>>>>>
>>>>>>> 7 ???. 2016 ?., ? 5:48, Jaehoon Chung <jh80.chung at samsung.com <mailto:jh80.chung@samsung.com>> ???????(?):
>>>>>>>
>>>>>>> On 10/03/2016 02:39 AM, AneoX wrote:
>>>>>>>> Emmc Card was the new one, so i just burn a dump of working sd. Previously
>>>>>>>> sd have been wired to board for test.
>>>>>>>>
>>>>>>>> Board is a custom,  like olinuxino lime which with nand and sd slot, 512 mb
>>>>>>>> ram. So i using it defconfig and in case of sd card, it works.
>>>>>>>> Emmc lines has external pullups according to the datasheet.
>>>>>>>
>>>>>>> Well, i needs to get more information..If you guess that seems to return 0 from block_read()..
>>>>>>> then you can find which condition was hit..is it impossible?
>>>>>>>
>>>>>>> If you can share more debug message..then i will help you.
>>>>>>>
>>>>>>> Best Regards,
>>>>>>> Jaehoon Chung
>>>>>>>
>>>>>>>>
>>>>>>>> 2 ???. 2016 ?. 23:28 ???????????? "Jagan Teki" <jagannadh.teki at gmail.com <mailto:jagannadh.teki@gmail.com>>
>>>>>>>> ???????:
>>>>>>>>
>>>>>>>> On Sun, Oct 2, 2016 at 10:45 PM, AneoX <aneox.inbox at gmail.com <mailto:aneox.inbox@gmail.com>> wrote:
>>>>>>>>> Like a sd card. I have emmc to sd adapter, so
>>>>>>>>>
>>>>>>>>> dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8
>>>>>>>>
>>>>>>>> I guess you cleaned[1] the card before doing this?
>>>>>>>>
>>>>>>>>>
>>>>>>>>> and then just solder emmc to my board.
>>>>>>>>
>>>>>>>> OK, which a20 board?
>>>>>>>>
>>>>>>>> [1] http://linux-sunxi.org/Bootable_SD_card
>>>>>>>>
>>>>>>>> thanks!
>>>>>>>> --
>>>>>>>> Jagan Teki
>>>>>>>> Free Software Engineer | www.openedev.com <http://www.openedev.com/>
>>>>>>>> U-Boot, Linux | Upstream Maintainer
>>>>>>>> Hyderabad, India.
>>>>>>>> _______________________________________________
>>>>>>>> U-Boot mailing list
>>>>>>>> U-Boot at lists.denx.de <mailto:U-Boot@lists.denx.de>
>>>>>>>> http://lists.denx.de/mailman/listinfo/u-boot
>>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>>>
>>
> 
> 
> 
> 

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-10-12 12:05                             ` Jaehoon Chung
@ 2016-10-12 12:11                               ` Alexandr Bochkarev
  2016-10-12 12:21                                 ` Jaehoon Chung
  0 siblings, 1 reply; 42+ messages in thread
From: Alexandr Bochkarev @ 2016-10-12 12:11 UTC (permalink / raw)
  To: u-boot

On marsboard today i used 2014 u-boot, sd card on sdc0 hardware lines and emmc on sdc2 hardware lines.
and get error "Card did not respond to voltage select!? , then i tried to boot without sd card, only with emmc on sdc2

On my board i used mainline u-boot, emmc on sdc0 hardware lines.
And get block read error, logs below.

Brom on A20 chip firstly tries sdc0, if fail, then sdc2.

I dont checked only gpio pins, maybe in det pin problem, i will try, thx.


> 12 ???. 2016 ?., ? 18:05, Jaehoon Chung <jh80.chung@samsung.com> ???????(?):
> 
> Added Hans (sunxi maintainer)
> 
> On 10/12/2016 08:25 PM, Alexandr Bochkarev wrote:
>>> This log means that there is no card on slot..
>> But then i tried my board with mainline u-boot, emmc was on sdc0 lines.
>> 
>> Now i tried, boot marsboard from sd, hit button to stop kernel loading.
>> sun7i# mmc list
>> SUNXI SD/MMC: 0
>> 
>> Looks like its doesnt see emmc on sdc2.
> 
> If i misunderstood something, let me know, plz. :)
> (Because i don't have targets relevant to sunxi..)
> 
> U-Boot SPL 2014.04-10685-g4af825f-dirty (Jun 14 2014 - 17:55:48)
> -> This is right? 2014?
> 
> What did you mean sdc0/sdc1/sdc2...do you mean the hardware line?
> If it's hardware line..sdc0 is for eMMC?
> 
> "Card did not respond to voltage select!"
> 1. There is no card on slot..
> 2. Power doesn't supply..
> 
> Did you check everything? Power, clock, gpio pin..
> 
> 
> Best Regards,
> Jaehoon Chung
> 
>> 
>> 
>> sun7i# printenv
>> Environment size: 1919/131068 bytes
>> autoboot=run loadkernel && run setargs && true && bootm 0x48000000
>> baudrate=115200
>> boot_ram=saved_stdout=$stdout;setenv stdout nc;if iminfo 0x41000000; then true; setenv stdout $saved_stdout; source 0x41000000;else setenv stdout $saved_stdout;fi
>> bootcmd=if run loadbootenv; then echo Loaded environment from ${bootenv};env import -t ${scriptaddr} ${filesize};fi;if test -n "${uenvcmd}"; then echo Running uenvcmd ...;run uenvcmd;fi;if run loadbootscr; then echo Jumping to ${bootscr};source ${scriptaddr};fi;run autoboot;
>> bootdelay=2
>> bootenv=uEnv.txt
>> bootm_size=0x10000000
>> bootscr=boot.scr
>> console=ttyS0,115200
>> device=mmc
>> ethact=dwmac.1c50000
>> ethaddr=02:d8:09:82:e3:9b
>> kernel=uImage
>> loadbootenv=fatload $device $partition $scriptaddr ${bootenv} || ext2load $device $partition $scriptaddr boot/${bootenv} || ext2load $device $partition $scriptaddr ${bootenv}
>> loadbootscr=fatload $device $partition $scriptaddr ${bootscr} || ext2load $device $partition $scriptaddr boot/${bootscr} ||ext2load $device $partition $scriptaddr ${bootscr}
>> loadkernel=if bootpath=/boot/ && ext2load $device $partition 0x43000000 ${bootpath}${script} && ext2load $device $partition 0x48000000 ${bootpath}${kernel};then true; elif bootpath=/ && fatload $device $partition 0x43000000 ${script} && fatload $device $partition 0x48000000 ${kernel};then true; elif bootpath=/ && ext2load $device $partition 0x43000000 ${bootpath}${script} && ext2load $device $partition 0x48000000 ${bootpath}${kernel};then true; else false;fi
>> loglevel=8
>> panicarg=panic=10
>> partition=0:1
>> script=script.bin
>> scriptaddr=0x44000000
>> setargs=if test -z \\"$root\\"; then if test \\"$bootpath\\" = "/boot/"; then root="/dev/mmcblk0p1 rootwait"; else root="/dev/mmcblk0p2 rootwait"; fi; fi; setenv bootargs console=${console} root=${root} loglevel=${loglevel} ${panicarg} ${extraargs}
>> stderr=serial
>> stdin=serial
>> stdout=serial
>> 
>> 
>>> 12 ???. 2016 ?., ? 17:09, Jaehoon Chung <jh80.chung@samsung.com> ???????(?):
>>> 
>>> On 10/12/2016 07:52 PM, Alexandr Bochkarev wrote:
>>>> In order to exclude possible errors on my board, i get MarsBoard A20 Lite, desolder nand, and put on emmc pads my emmc flash.
>>>> So emmc is on sdc2 lines. When iam booting from sd on sdc1, linux kernel can init emmc, and i got /dev/mmcblkp1, works well.
>>>> But when i eject sd and try to boot from sdc2 emmc, get the same err 17. 
>>>> In this case i have used some old uboot from marsboard site, because mainline u-boot have not config for a20 marsboard.
>>>> 
>>>> U-Boot SPL 2014.04-10685-g4af825f-dirty (Jun 14 2014 - 17:55:48)
>>>> Board: MarsBoard-A20 & MarsPI
>>>> DRAM: 1024 MiB
>>>> CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
>>>> Card did not respond to voltage select!
>>> 
>>> This log means that there is no card on slot..
>>> In my case..when i set the wrong mmc boot dev in environment, I had seen the similar log.
>>> Could you share the environment values?
>>> 
>>>> spl: mmc init failed: err - -17
>>>> ### ERROR ### Please RESET the board ###
>>>> 
>>>> So, the problem with eMMC KLM4G1FE3B-B001 is exists(
>>>> Maybe you know some cheap emmc, which is 100% works with mainline u-boot?
>>> 
>>> I'm not sure...100% working card...because we don't ensure 100% what problem there are in mainline u-boot.
>>> 
>>>> 
>>>>> 7 ???. 2016 ?., ? 14:44, Alexandr Bochkarev <aneox.inbox at gmail.com <mailto:aneox.inbox@gmail.com>> ???????(?):
>>>>> 
>>>>> Hi!
>>>>> Very appreciate your help! Hope we will fix it, because my board will be garbage without emmc (
>>>>> So, my steps:
>>>>> 
>>>>> git clone git://git.denx.de/u-boot.git --depth 1; cd u-boot;
>>>>> make CROSS_COMPILE=arm-linux-gnueabihf- A20-OLinuXino-Lime_defconfig
>>>>> make CROSS_COMPILE=arm-linux-gnueabihf-
>>>>> 
>>>>> Also turn on CONFIG_MMC_TRACE
>>> 
>>> the below log seems that is nothing to do..arguments/response data..everything are 0..
>>> It's strange.
>>> 
>>> 
>>> Best Regards,
>>> Jaehoon Chung
>>> 
>>>>> 
>>>>> After run, got:
>>>>> 
>>>>> Trying to boot from MMC1
>>>>> CMD_SEND:0
>>>>> ..ARG... 0x00000000
>>>>> ..MMC_RSP_NONE
>>>>> CMD_SEND:8
>>>>> ..ARG... 0x00000000
>>>>> ..RET... -110
>>>>> CMD_SEND:55
>>>>> ..ARG... 0x00000000
>>>>> ..RET... -110
>>>>> CMD_SEND:0
>>>>> ..ARG... 0x00000000
>>>>> ..MMC_RSP_NONE
>>>>> CMD_SEND:1
>>>>> ..ARG... 0x00000000
>>>>> ..MMC_RSP_R3,4.. 0x00000000 
>>>>> CMD_SEND:1
>>>>> ..ARG... 0x00000000
>>>>> ..MMC_RSP_R3,4.. 0x00000000 
>>>>> CMD_SEND:0
>>>>> ..ARG... 0x00000000
>>>>> ..MMC_RSP_NONE
>>>>> CMD_SEND:1
>>>>> ..ARG... 0x00000000
>>>>> ..MMC_RSP_R3,4.. 0x00000000 
>>>>> CMD_SEND:1
>>>>> ..ARG... 0x00000000
>>>>> ..MMC_RSP_R3,4.. 0x00000000 
>>>>> CMD_SEND:2
>>>>> ..ARG... 0x00000000
>>>>> ..MMC_RSP_R2.. 0x00000000 
>>>>> ..          .. 0x00000000 
>>>>> ..          .. 0x00000000 
>>>>> ..          .. 0x00000000 
>>>>> 
>>>>> .....DUMPING DATA
>>>>> .....000 - 00 00 00 00 
>>>>> .....004 - 00 00 00 00 
>>>>> .....008 - 00 00 00 00 
>>>>> .....012 - 00 00 00 00 
>>>>> CMD_SEND:3
>>>>> ..ARG... 0x00000000
>>>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>>>> CMD_SEND:9
>>>>> ..ARG... 0x00000000
>>>>> ..MMC_RSP_R2.. 0x00000000 
>>>>> ..          .. 0x00000000 
>>>>> ..          .. 0x00000000 
>>>>> ..          .. 0x00000000 
>>>>> 
>>>>> .....DUMPING DATA
>>>>> .....000 - 00 00 00 00 
>>>>> .....004 - 00 00 00 00 
>>>>> .....008 - 00 00 00 00 
>>>>> .....012 - 00 00 00 00 
>>>>> CMD_SEND:13
>>>>> ..ARG... 0x00000000
>>>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>>>> CURR STATE:3
>>>>> CMD_SEND:7
>>>>> ..ARG... 0x00000000
>>>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>>>> CMD_SEND:8
>>>>> ..ARG... 0x00000000
>>>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>>>> CMD_SEND:8
>>>>> ..ARG... 0x00000000
>>>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>>>> CMD_SEND:6
>>>>> ..ARG... 0x00000000
>>>>> ..MMC_RSP_R1b.. 0x00000000 
>>>>> CMD_SEND:13
>>>>> ..ARG... 0x00000000
>>>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>>>> CURR STATE:4
>>>>> CMD_SEND:8
>>>>> ..ARG... 0x00000000
>>>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>>>> CMD_SEND:6
>>>>> ..ARG... 0x00000000
>>>>> ..RET... -110
>>>>> CMD_SEND:16
>>>>> ..ARG... 0x00000000
>>>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>>>> CMD_SEND:17
>>>>> ..ARG... 0x00000000
>>>>> ..RET... -110
>>>>> 
>>>>> hdr read sector 80, count=0
>>>>> mmc_load_image_raw_sector: mmc block read error
>>>>> SPL: failed to boot from all boot devices
>>>>> ### ERROR ### Please RESET the board ###
>>>>> 
>>>>> So, 
>>>>> spl_mmc.c on line 66, blk_dread return 0 count
>>>>> blk.h on line 389, block_dev->block_read(block_dev, start, blkcnt, buffer) return 0
>>>>> block_dev->block_read is a pointer, seems like it defined in mmc_legacy.c on line 144, bdesc->block_read = mmc_bread;
>>>>> mmc.c, line 285 mmc_read_blocks return Failed to read blocks
>>>>> mmc.c, line 223, mmc_send_cmd return 0, cmdidx was 17, like last in mmc trace
>>>>> 
>>>>> 
>>>>>> 7 ???. 2016 ?., ? 5:48, Jaehoon Chung <jh80.chung at samsung.com <mailto:jh80.chung@samsung.com>> ???????(?):
>>>>>> 
>>>>>> On 10/03/2016 02:39 AM, AneoX wrote:
>>>>>>> Emmc Card was the new one, so i just burn a dump of working sd. Previously
>>>>>>> sd have been wired to board for test.
>>>>>>> 
>>>>>>> Board is a custom,  like olinuxino lime which with nand and sd slot, 512 mb
>>>>>>> ram. So i using it defconfig and in case of sd card, it works.
>>>>>>> Emmc lines has external pullups according to the datasheet.
>>>>>> 
>>>>>> Well, i needs to get more information..If you guess that seems to return 0 from block_read()..
>>>>>> then you can find which condition was hit..is it impossible?
>>>>>> 
>>>>>> If you can share more debug message..then i will help you.
>>>>>> 
>>>>>> Best Regards,
>>>>>> Jaehoon Chung
>>>>>> 
>>>>>>> 
>>>>>>> 2 ???. 2016 ?. 23:28 ???????????? "Jagan Teki" <jagannadh.teki at gmail.com <mailto:jagannadh.teki@gmail.com>>
>>>>>>> ???????:
>>>>>>> 
>>>>>>> On Sun, Oct 2, 2016 at 10:45 PM, AneoX <aneox.inbox at gmail.com <mailto:aneox.inbox@gmail.com>> wrote:
>>>>>>>> Like a sd card. I have emmc to sd adapter, so
>>>>>>>> 
>>>>>>>> dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8
>>>>>>> 
>>>>>>> I guess you cleaned[1] the card before doing this?
>>>>>>> 
>>>>>>>> 
>>>>>>>> and then just solder emmc to my board.
>>>>>>> 
>>>>>>> OK, which a20 board?
>>>>>>> 
>>>>>>> [1] http://linux-sunxi.org/Bootable_SD_card
>>>>>>> 
>>>>>>> thanks!
>>>>>>> --
>>>>>>> Jagan Teki
>>>>>>> Free Software Engineer | www.openedev.com <http://www.openedev.com/>
>>>>>>> U-Boot, Linux | Upstream Maintainer
>>>>>>> Hyderabad, India.
>>>>>>> _______________________________________________
>>>>>>> U-Boot mailing list
>>>>>>> U-Boot at lists.denx.de <mailto:U-Boot@lists.denx.de>
>>>>>>> http://lists.denx.de/mailman/listinfo/u-boot
>>>>> 
>>>> 
>>> 
>> 
>> 
>> 
>> 
> 

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-10-12 11:25                           ` Alexandr Bochkarev
@ 2016-10-12 12:05                             ` Jaehoon Chung
  2016-10-12 12:11                               ` Alexandr Bochkarev
  0 siblings, 1 reply; 42+ messages in thread
From: Jaehoon Chung @ 2016-10-12 12:05 UTC (permalink / raw)
  To: u-boot

Added Hans (sunxi maintainer)

On 10/12/2016 08:25 PM, Alexandr Bochkarev wrote:
>> This log means that there is no card on slot..
> But then i tried my board with mainline u-boot, emmc was on sdc0 lines.
> 
> Now i tried, boot marsboard from sd, hit button to stop kernel loading.
> sun7i# mmc list
> SUNXI SD/MMC: 0
> 
> Looks like its doesnt see emmc on sdc2.

If i misunderstood something, let me know, plz. :)
(Because i don't have targets relevant to sunxi..)

U-Boot SPL 2014.04-10685-g4af825f-dirty (Jun 14 2014 - 17:55:48)
-> This is right? 2014?

What did you mean sdc0/sdc1/sdc2...do you mean the hardware line?
If it's hardware line..sdc0 is for eMMC?

"Card did not respond to voltage select!"
1. There is no card on slot..
2. Power doesn't supply..

Did you check everything? Power, clock, gpio pin..


Best Regards,
Jaehoon Chung

> 
> 
> sun7i# printenv
> Environment size: 1919/131068 bytes
> autoboot=run loadkernel && run setargs && true && bootm 0x48000000
> baudrate=115200
> boot_ram=saved_stdout=$stdout;setenv stdout nc;if iminfo 0x41000000; then true; setenv stdout $saved_stdout; source 0x41000000;else setenv stdout $saved_stdout;fi
> bootcmd=if run loadbootenv; then echo Loaded environment from ${bootenv};env import -t ${scriptaddr} ${filesize};fi;if test -n "${uenvcmd}"; then echo Running uenvcmd ...;run uenvcmd;fi;if run loadbootscr; then echo Jumping to ${bootscr};source ${scriptaddr};fi;run autoboot;
> bootdelay=2
> bootenv=uEnv.txt
> bootm_size=0x10000000
> bootscr=boot.scr
> console=ttyS0,115200
> device=mmc
> ethact=dwmac.1c50000
> ethaddr=02:d8:09:82:e3:9b
> kernel=uImage
> loadbootenv=fatload $device $partition $scriptaddr ${bootenv} || ext2load $device $partition $scriptaddr boot/${bootenv} || ext2load $device $partition $scriptaddr ${bootenv}
> loadbootscr=fatload $device $partition $scriptaddr ${bootscr} || ext2load $device $partition $scriptaddr boot/${bootscr} ||ext2load $device $partition $scriptaddr ${bootscr}
> loadkernel=if bootpath=/boot/ && ext2load $device $partition 0x43000000 ${bootpath}${script} && ext2load $device $partition 0x48000000 ${bootpath}${kernel};then true; elif bootpath=/ && fatload $device $partition 0x43000000 ${script} && fatload $device $partition 0x48000000 ${kernel};then true; elif bootpath=/ && ext2load $device $partition 0x43000000 ${bootpath}${script} && ext2load $device $partition 0x48000000 ${bootpath}${kernel};then true; else false;fi
> loglevel=8
> panicarg=panic=10
> partition=0:1
> script=script.bin
> scriptaddr=0x44000000
> setargs=if test -z \\"$root\\"; then if test \\"$bootpath\\" = "/boot/"; then root="/dev/mmcblk0p1 rootwait"; else root="/dev/mmcblk0p2 rootwait"; fi; fi; setenv bootargs console=${console} root=${root} loglevel=${loglevel} ${panicarg} ${extraargs}
> stderr=serial
> stdin=serial
> stdout=serial
> 
> 
>> 12 ???. 2016 ?., ? 17:09, Jaehoon Chung <jh80.chung@samsung.com> ???????(?):
>>
>> On 10/12/2016 07:52 PM, Alexandr Bochkarev wrote:
>>> In order to exclude possible errors on my board, i get MarsBoard A20 Lite, desolder nand, and put on emmc pads my emmc flash.
>>> So emmc is on sdc2 lines. When iam booting from sd on sdc1, linux kernel can init emmc, and i got /dev/mmcblkp1, works well.
>>> But when i eject sd and try to boot from sdc2 emmc, get the same err 17. 
>>> In this case i have used some old uboot from marsboard site, because mainline u-boot have not config for a20 marsboard.
>>>
>>> U-Boot SPL 2014.04-10685-g4af825f-dirty (Jun 14 2014 - 17:55:48)
>>> Board: MarsBoard-A20 & MarsPI
>>> DRAM: 1024 MiB
>>> CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
>>> Card did not respond to voltage select!
>>
>> This log means that there is no card on slot..
>> In my case..when i set the wrong mmc boot dev in environment, I had seen the similar log.
>> Could you share the environment values?
>>
>>> spl: mmc init failed: err - -17
>>> ### ERROR ### Please RESET the board ###
>>>
>>> So, the problem with eMMC KLM4G1FE3B-B001 is exists(
>>> Maybe you know some cheap emmc, which is 100% works with mainline u-boot?
>>
>> I'm not sure...100% working card...because we don't ensure 100% what problem there are in mainline u-boot.
>>
>>>
>>>> 7 ???. 2016 ?., ? 14:44, Alexandr Bochkarev <aneox.inbox at gmail.com <mailto:aneox.inbox@gmail.com>> ???????(?):
>>>>
>>>> Hi!
>>>> Very appreciate your help! Hope we will fix it, because my board will be garbage without emmc (
>>>> So, my steps:
>>>>
>>>> git clone git://git.denx.de/u-boot.git --depth 1; cd u-boot;
>>>> make CROSS_COMPILE=arm-linux-gnueabihf- A20-OLinuXino-Lime_defconfig
>>>> make CROSS_COMPILE=arm-linux-gnueabihf-
>>>>
>>>> Also turn on CONFIG_MMC_TRACE
>>
>> the below log seems that is nothing to do..arguments/response data..everything are 0..
>> It's strange.
>>
>>
>> Best Regards,
>> Jaehoon Chung
>>
>>>>
>>>> After run, got:
>>>>
>>>> Trying to boot from MMC1
>>>> CMD_SEND:0
>>>> ..ARG... 0x00000000
>>>> ..MMC_RSP_NONE
>>>> CMD_SEND:8
>>>> ..ARG... 0x00000000
>>>> ..RET... -110
>>>> CMD_SEND:55
>>>> ..ARG... 0x00000000
>>>> ..RET... -110
>>>> CMD_SEND:0
>>>> ..ARG... 0x00000000
>>>> ..MMC_RSP_NONE
>>>> CMD_SEND:1
>>>> ..ARG... 0x00000000
>>>> ..MMC_RSP_R3,4.. 0x00000000 
>>>> CMD_SEND:1
>>>> ..ARG... 0x00000000
>>>> ..MMC_RSP_R3,4.. 0x00000000 
>>>> CMD_SEND:0
>>>> ..ARG... 0x00000000
>>>> ..MMC_RSP_NONE
>>>> CMD_SEND:1
>>>> ..ARG... 0x00000000
>>>> ..MMC_RSP_R3,4.. 0x00000000 
>>>> CMD_SEND:1
>>>> ..ARG... 0x00000000
>>>> ..MMC_RSP_R3,4.. 0x00000000 
>>>> CMD_SEND:2
>>>> ..ARG... 0x00000000
>>>> ..MMC_RSP_R2.. 0x00000000 
>>>> ..          .. 0x00000000 
>>>> ..          .. 0x00000000 
>>>> ..          .. 0x00000000 
>>>>
>>>> .....DUMPING DATA
>>>> .....000 - 00 00 00 00 
>>>> .....004 - 00 00 00 00 
>>>> .....008 - 00 00 00 00 
>>>> .....012 - 00 00 00 00 
>>>> CMD_SEND:3
>>>> ..ARG... 0x00000000
>>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>>> CMD_SEND:9
>>>> ..ARG... 0x00000000
>>>> ..MMC_RSP_R2.. 0x00000000 
>>>> ..          .. 0x00000000 
>>>> ..          .. 0x00000000 
>>>> ..          .. 0x00000000 
>>>>
>>>> .....DUMPING DATA
>>>> .....000 - 00 00 00 00 
>>>> .....004 - 00 00 00 00 
>>>> .....008 - 00 00 00 00 
>>>> .....012 - 00 00 00 00 
>>>> CMD_SEND:13
>>>> ..ARG... 0x00000000
>>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>>> CURR STATE:3
>>>> CMD_SEND:7
>>>> ..ARG... 0x00000000
>>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>>> CMD_SEND:8
>>>> ..ARG... 0x00000000
>>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>>> CMD_SEND:8
>>>> ..ARG... 0x00000000
>>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>>> CMD_SEND:6
>>>> ..ARG... 0x00000000
>>>> ..MMC_RSP_R1b.. 0x00000000 
>>>> CMD_SEND:13
>>>> ..ARG... 0x00000000
>>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>>> CURR STATE:4
>>>> CMD_SEND:8
>>>> ..ARG... 0x00000000
>>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>>> CMD_SEND:6
>>>> ..ARG... 0x00000000
>>>> ..RET... -110
>>>> CMD_SEND:16
>>>> ..ARG... 0x00000000
>>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>>> CMD_SEND:17
>>>> ..ARG... 0x00000000
>>>> ..RET... -110
>>>>
>>>> hdr read sector 80, count=0
>>>> mmc_load_image_raw_sector: mmc block read error
>>>> SPL: failed to boot from all boot devices
>>>> ### ERROR ### Please RESET the board ###
>>>>
>>>> So, 
>>>> spl_mmc.c on line 66, blk_dread return 0 count
>>>> blk.h on line 389, block_dev->block_read(block_dev, start, blkcnt, buffer) return 0
>>>> block_dev->block_read is a pointer, seems like it defined in mmc_legacy.c on line 144, bdesc->block_read = mmc_bread;
>>>> mmc.c, line 285 mmc_read_blocks return Failed to read blocks
>>>> mmc.c, line 223, mmc_send_cmd return 0, cmdidx was 17, like last in mmc trace
>>>>
>>>>
>>>>> 7 ???. 2016 ?., ? 5:48, Jaehoon Chung <jh80.chung at samsung.com <mailto:jh80.chung@samsung.com>> ???????(?):
>>>>>
>>>>> On 10/03/2016 02:39 AM, AneoX wrote:
>>>>>> Emmc Card was the new one, so i just burn a dump of working sd. Previously
>>>>>> sd have been wired to board for test.
>>>>>>
>>>>>> Board is a custom,  like olinuxino lime which with nand and sd slot, 512 mb
>>>>>> ram. So i using it defconfig and in case of sd card, it works.
>>>>>> Emmc lines has external pullups according to the datasheet.
>>>>>
>>>>> Well, i needs to get more information..If you guess that seems to return 0 from block_read()..
>>>>> then you can find which condition was hit..is it impossible?
>>>>>
>>>>> If you can share more debug message..then i will help you.
>>>>>
>>>>> Best Regards,
>>>>> Jaehoon Chung
>>>>>
>>>>>>
>>>>>> 2 ???. 2016 ?. 23:28 ???????????? "Jagan Teki" <jagannadh.teki at gmail.com <mailto:jagannadh.teki@gmail.com>>
>>>>>> ???????:
>>>>>>
>>>>>> On Sun, Oct 2, 2016 at 10:45 PM, AneoX <aneox.inbox at gmail.com <mailto:aneox.inbox@gmail.com>> wrote:
>>>>>>> Like a sd card. I have emmc to sd adapter, so
>>>>>>>
>>>>>>> dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8
>>>>>>
>>>>>> I guess you cleaned[1] the card before doing this?
>>>>>>
>>>>>>>
>>>>>>> and then just solder emmc to my board.
>>>>>>
>>>>>> OK, which a20 board?
>>>>>>
>>>>>> [1] http://linux-sunxi.org/Bootable_SD_card
>>>>>>
>>>>>> thanks!
>>>>>> --
>>>>>> Jagan Teki
>>>>>> Free Software Engineer | www.openedev.com <http://www.openedev.com/>
>>>>>> U-Boot, Linux | Upstream Maintainer
>>>>>> Hyderabad, India.
>>>>>> _______________________________________________
>>>>>> U-Boot mailing list
>>>>>> U-Boot at lists.denx.de <mailto:U-Boot@lists.denx.de>
>>>>>> http://lists.denx.de/mailman/listinfo/u-boot
>>>>
>>>
>>
> 
> 
> 
> 

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-10-12 11:09                         ` Jaehoon Chung
@ 2016-10-12 11:25                           ` Alexandr Bochkarev
  2016-10-12 12:05                             ` Jaehoon Chung
  0 siblings, 1 reply; 42+ messages in thread
From: Alexandr Bochkarev @ 2016-10-12 11:25 UTC (permalink / raw)
  To: u-boot

> This log means that there is no card on slot..
But then i tried my board with mainline u-boot, emmc was on sdc0 lines.

Now i tried, boot marsboard from sd, hit button to stop kernel loading.
sun7i# mmc list
SUNXI SD/MMC: 0

Looks like its doesnt see emmc on sdc2.


sun7i# printenv
Environment size: 1919/131068 bytes
autoboot=run loadkernel && run setargs && true && bootm 0x48000000
baudrate=115200
boot_ram=saved_stdout=$stdout;setenv stdout nc;if iminfo 0x41000000; then true; setenv stdout $saved_stdout; source 0x41000000;else setenv stdout $saved_stdout;fi
bootcmd=if run loadbootenv; then echo Loaded environment from ${bootenv};env import -t ${scriptaddr} ${filesize};fi;if test -n "${uenvcmd}"; then echo Running uenvcmd ...;run uenvcmd;fi;if run loadbootscr; then echo Jumping to ${bootscr};source ${scriptaddr};fi;run autoboot;
bootdelay=2
bootenv=uEnv.txt
bootm_size=0x10000000
bootscr=boot.scr
console=ttyS0,115200
device=mmc
ethact=dwmac.1c50000
ethaddr=02:d8:09:82:e3:9b
kernel=uImage
loadbootenv=fatload $device $partition $scriptaddr ${bootenv} || ext2load $device $partition $scriptaddr boot/${bootenv} || ext2load $device $partition $scriptaddr ${bootenv}
loadbootscr=fatload $device $partition $scriptaddr ${bootscr} || ext2load $device $partition $scriptaddr boot/${bootscr} ||ext2load $device $partition $scriptaddr ${bootscr}
loadkernel=if bootpath=/boot/ && ext2load $device $partition 0x43000000 ${bootpath}${script} && ext2load $device $partition 0x48000000 ${bootpath}${kernel};then true; elif bootpath=/ && fatload $device $partition 0x43000000 ${script} && fatload $device $partition 0x48000000 ${kernel};then true; elif bootpath=/ && ext2load $device $partition 0x43000000 ${bootpath}${script} && ext2load $device $partition 0x48000000 ${bootpath}${kernel};then true; else false;fi
loglevel=8
panicarg=panic=10
partition=0:1
script=script.bin
scriptaddr=0x44000000
setargs=if test -z \\"$root\\"; then if test \\"$bootpath\\" = "/boot/"; then root="/dev/mmcblk0p1 rootwait"; else root="/dev/mmcblk0p2 rootwait"; fi; fi; setenv bootargs console=${console} root=${root} loglevel=${loglevel} ${panicarg} ${extraargs}
stderr=serial
stdin=serial
stdout=serial


> 12 ???. 2016 ?., ? 17:09, Jaehoon Chung <jh80.chung@samsung.com> ???????(?):
> 
> On 10/12/2016 07:52 PM, Alexandr Bochkarev wrote:
>> In order to exclude possible errors on my board, i get MarsBoard A20 Lite, desolder nand, and put on emmc pads my emmc flash.
>> So emmc is on sdc2 lines. When iam booting from sd on sdc1, linux kernel can init emmc, and i got /dev/mmcblkp1, works well.
>> But when i eject sd and try to boot from sdc2 emmc, get the same err 17. 
>> In this case i have used some old uboot from marsboard site, because mainline u-boot have not config for a20 marsboard.
>> 
>> U-Boot SPL 2014.04-10685-g4af825f-dirty (Jun 14 2014 - 17:55:48)
>> Board: MarsBoard-A20 & MarsPI
>> DRAM: 1024 MiB
>> CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
>> Card did not respond to voltage select!
> 
> This log means that there is no card on slot..
> In my case..when i set the wrong mmc boot dev in environment, I had seen the similar log.
> Could you share the environment values?
> 
>> spl: mmc init failed: err - -17
>> ### ERROR ### Please RESET the board ###
>> 
>> So, the problem with eMMC KLM4G1FE3B-B001 is exists(
>> Maybe you know some cheap emmc, which is 100% works with mainline u-boot?
> 
> I'm not sure...100% working card...because we don't ensure 100% what problem there are in mainline u-boot.
> 
>> 
>>> 7 ???. 2016 ?., ? 14:44, Alexandr Bochkarev <aneox.inbox at gmail.com <mailto:aneox.inbox@gmail.com>> ???????(?):
>>> 
>>> Hi!
>>> Very appreciate your help! Hope we will fix it, because my board will be garbage without emmc (
>>> So, my steps:
>>> 
>>> git clone git://git.denx.de/u-boot.git --depth 1; cd u-boot;
>>> make CROSS_COMPILE=arm-linux-gnueabihf- A20-OLinuXino-Lime_defconfig
>>> make CROSS_COMPILE=arm-linux-gnueabihf-
>>> 
>>> Also turn on CONFIG_MMC_TRACE
> 
> the below log seems that is nothing to do..arguments/response data..everything are 0..
> It's strange.
> 
> 
> Best Regards,
> Jaehoon Chung
> 
>>> 
>>> After run, got:
>>> 
>>> Trying to boot from MMC1
>>> CMD_SEND:0
>>> ..ARG... 0x00000000
>>> ..MMC_RSP_NONE
>>> CMD_SEND:8
>>> ..ARG... 0x00000000
>>> ..RET... -110
>>> CMD_SEND:55
>>> ..ARG... 0x00000000
>>> ..RET... -110
>>> CMD_SEND:0
>>> ..ARG... 0x00000000
>>> ..MMC_RSP_NONE
>>> CMD_SEND:1
>>> ..ARG... 0x00000000
>>> ..MMC_RSP_R3,4.. 0x00000000 
>>> CMD_SEND:1
>>> ..ARG... 0x00000000
>>> ..MMC_RSP_R3,4.. 0x00000000 
>>> CMD_SEND:0
>>> ..ARG... 0x00000000
>>> ..MMC_RSP_NONE
>>> CMD_SEND:1
>>> ..ARG... 0x00000000
>>> ..MMC_RSP_R3,4.. 0x00000000 
>>> CMD_SEND:1
>>> ..ARG... 0x00000000
>>> ..MMC_RSP_R3,4.. 0x00000000 
>>> CMD_SEND:2
>>> ..ARG... 0x00000000
>>> ..MMC_RSP_R2.. 0x00000000 
>>> ..          .. 0x00000000 
>>> ..          .. 0x00000000 
>>> ..          .. 0x00000000 
>>> 
>>> .....DUMPING DATA
>>> .....000 - 00 00 00 00 
>>> .....004 - 00 00 00 00 
>>> .....008 - 00 00 00 00 
>>> .....012 - 00 00 00 00 
>>> CMD_SEND:3
>>> ..ARG... 0x00000000
>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>> CMD_SEND:9
>>> ..ARG... 0x00000000
>>> ..MMC_RSP_R2.. 0x00000000 
>>> ..          .. 0x00000000 
>>> ..          .. 0x00000000 
>>> ..          .. 0x00000000 
>>> 
>>> .....DUMPING DATA
>>> .....000 - 00 00 00 00 
>>> .....004 - 00 00 00 00 
>>> .....008 - 00 00 00 00 
>>> .....012 - 00 00 00 00 
>>> CMD_SEND:13
>>> ..ARG... 0x00000000
>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>> CURR STATE:3
>>> CMD_SEND:7
>>> ..ARG... 0x00000000
>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>> CMD_SEND:8
>>> ..ARG... 0x00000000
>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>> CMD_SEND:8
>>> ..ARG... 0x00000000
>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>> CMD_SEND:6
>>> ..ARG... 0x00000000
>>> ..MMC_RSP_R1b.. 0x00000000 
>>> CMD_SEND:13
>>> ..ARG... 0x00000000
>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>> CURR STATE:4
>>> CMD_SEND:8
>>> ..ARG... 0x00000000
>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>> CMD_SEND:6
>>> ..ARG... 0x00000000
>>> ..RET... -110
>>> CMD_SEND:16
>>> ..ARG... 0x00000000
>>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>>> CMD_SEND:17
>>> ..ARG... 0x00000000
>>> ..RET... -110
>>> 
>>> hdr read sector 80, count=0
>>> mmc_load_image_raw_sector: mmc block read error
>>> SPL: failed to boot from all boot devices
>>> ### ERROR ### Please RESET the board ###
>>> 
>>> So, 
>>> spl_mmc.c on line 66, blk_dread return 0 count
>>> blk.h on line 389, block_dev->block_read(block_dev, start, blkcnt, buffer) return 0
>>> block_dev->block_read is a pointer, seems like it defined in mmc_legacy.c on line 144, bdesc->block_read = mmc_bread;
>>> mmc.c, line 285 mmc_read_blocks return Failed to read blocks
>>> mmc.c, line 223, mmc_send_cmd return 0, cmdidx was 17, like last in mmc trace
>>> 
>>> 
>>>> 7 ???. 2016 ?., ? 5:48, Jaehoon Chung <jh80.chung at samsung.com <mailto:jh80.chung@samsung.com>> ???????(?):
>>>> 
>>>> On 10/03/2016 02:39 AM, AneoX wrote:
>>>>> Emmc Card was the new one, so i just burn a dump of working sd. Previously
>>>>> sd have been wired to board for test.
>>>>> 
>>>>> Board is a custom,  like olinuxino lime which with nand and sd slot, 512 mb
>>>>> ram. So i using it defconfig and in case of sd card, it works.
>>>>> Emmc lines has external pullups according to the datasheet.
>>>> 
>>>> Well, i needs to get more information..If you guess that seems to return 0 from block_read()..
>>>> then you can find which condition was hit..is it impossible?
>>>> 
>>>> If you can share more debug message..then i will help you.
>>>> 
>>>> Best Regards,
>>>> Jaehoon Chung
>>>> 
>>>>> 
>>>>> 2 ???. 2016 ?. 23:28 ???????????? "Jagan Teki" <jagannadh.teki at gmail.com <mailto:jagannadh.teki@gmail.com>>
>>>>> ???????:
>>>>> 
>>>>> On Sun, Oct 2, 2016 at 10:45 PM, AneoX <aneox.inbox at gmail.com <mailto:aneox.inbox@gmail.com>> wrote:
>>>>>> Like a sd card. I have emmc to sd adapter, so
>>>>>> 
>>>>>> dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8
>>>>> 
>>>>> I guess you cleaned[1] the card before doing this?
>>>>> 
>>>>>> 
>>>>>> and then just solder emmc to my board.
>>>>> 
>>>>> OK, which a20 board?
>>>>> 
>>>>> [1] http://linux-sunxi.org/Bootable_SD_card
>>>>> 
>>>>> thanks!
>>>>> --
>>>>> Jagan Teki
>>>>> Free Software Engineer | www.openedev.com <http://www.openedev.com/>
>>>>> U-Boot, Linux | Upstream Maintainer
>>>>> Hyderabad, India.
>>>>> _______________________________________________
>>>>> U-Boot mailing list
>>>>> U-Boot at lists.denx.de <mailto:U-Boot@lists.denx.de>
>>>>> http://lists.denx.de/mailman/listinfo/u-boot
>>> 
>> 
> 

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-10-12 10:52                       ` Alexandr Bochkarev
@ 2016-10-12 11:09                         ` Jaehoon Chung
  2016-10-12 11:25                           ` Alexandr Bochkarev
  0 siblings, 1 reply; 42+ messages in thread
From: Jaehoon Chung @ 2016-10-12 11:09 UTC (permalink / raw)
  To: u-boot

On 10/12/2016 07:52 PM, Alexandr Bochkarev wrote:
> In order to exclude possible errors on my board, i get MarsBoard A20 Lite, desolder nand, and put on emmc pads my emmc flash.
> So emmc is on sdc2 lines. When iam booting from sd on sdc1, linux kernel can init emmc, and i got /dev/mmcblkp1, works well.
> But when i eject sd and try to boot from sdc2 emmc, get the same err 17. 
> In this case i have used some old uboot from marsboard site, because mainline u-boot have not config for a20 marsboard.
> 
> U-Boot SPL 2014.04-10685-g4af825f-dirty (Jun 14 2014 - 17:55:48)
> Board: MarsBoard-A20 & MarsPI
> DRAM: 1024 MiB
> CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
> Card did not respond to voltage select!

This log means that there is no card on slot..
In my case..when i set the wrong mmc boot dev in environment, I had seen the similar log.
Could you share the environment values?

> spl: mmc init failed: err - -17
> ### ERROR ### Please RESET the board ###
> 
> So, the problem with eMMC KLM4G1FE3B-B001 is exists(
> Maybe you know some cheap emmc, which is 100% works with mainline u-boot?

I'm not sure...100% working card...because we don't ensure 100% what problem there are in mainline u-boot.

> 
>> 7 ???. 2016 ?., ? 14:44, Alexandr Bochkarev <aneox.inbox at gmail.com <mailto:aneox.inbox@gmail.com>> ???????(?):
>>
>> Hi!
>> Very appreciate your help! Hope we will fix it, because my board will be garbage without emmc (
>> So, my steps:
>>
>> git clone git://git.denx.de/u-boot.git --depth 1; cd u-boot;
>> make CROSS_COMPILE=arm-linux-gnueabihf- A20-OLinuXino-Lime_defconfig
>> make CROSS_COMPILE=arm-linux-gnueabihf-
>>
>> Also turn on CONFIG_MMC_TRACE

the below log seems that is nothing to do..arguments/response data..everything are 0..
It's strange.


Best Regards,
Jaehoon Chung

>>
>> After run, got:
>>
>> Trying to boot from MMC1
>> CMD_SEND:0
>> ..ARG... 0x00000000
>> ..MMC_RSP_NONE
>> CMD_SEND:8
>> ..ARG... 0x00000000
>> ..RET... -110
>> CMD_SEND:55
>> ..ARG... 0x00000000
>> ..RET... -110
>> CMD_SEND:0
>> ..ARG... 0x00000000
>> ..MMC_RSP_NONE
>> CMD_SEND:1
>> ..ARG... 0x00000000
>> ..MMC_RSP_R3,4.. 0x00000000 
>> CMD_SEND:1
>> ..ARG... 0x00000000
>> ..MMC_RSP_R3,4.. 0x00000000 
>> CMD_SEND:0
>> ..ARG... 0x00000000
>> ..MMC_RSP_NONE
>> CMD_SEND:1
>> ..ARG... 0x00000000
>> ..MMC_RSP_R3,4.. 0x00000000 
>> CMD_SEND:1
>> ..ARG... 0x00000000
>> ..MMC_RSP_R3,4.. 0x00000000 
>> CMD_SEND:2
>> ..ARG... 0x00000000
>> ..MMC_RSP_R2.. 0x00000000 
>> ..          .. 0x00000000 
>> ..          .. 0x00000000 
>> ..          .. 0x00000000 
>>
>> .....DUMPING DATA
>> .....000 - 00 00 00 00 
>> .....004 - 00 00 00 00 
>> .....008 - 00 00 00 00 
>> .....012 - 00 00 00 00 
>> CMD_SEND:3
>> ..ARG... 0x00000000
>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>> CMD_SEND:9
>> ..ARG... 0x00000000
>> ..MMC_RSP_R2.. 0x00000000 
>> ..          .. 0x00000000 
>> ..          .. 0x00000000 
>> ..          .. 0x00000000 
>>
>> .....DUMPING DATA
>> .....000 - 00 00 00 00 
>> .....004 - 00 00 00 00 
>> .....008 - 00 00 00 00 
>> .....012 - 00 00 00 00 
>> CMD_SEND:13
>> ..ARG... 0x00000000
>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>> CURR STATE:3
>> CMD_SEND:7
>> ..ARG... 0x00000000
>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>> CMD_SEND:8
>> ..ARG... 0x00000000
>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>> CMD_SEND:8
>> ..ARG... 0x00000000
>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>> CMD_SEND:6
>> ..ARG... 0x00000000
>> ..MMC_RSP_R1b.. 0x00000000 
>> CMD_SEND:13
>> ..ARG... 0x00000000
>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>> CURR STATE:4
>> CMD_SEND:8
>> ..ARG... 0x00000000
>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>> CMD_SEND:6
>> ..ARG... 0x00000000
>> ..RET... -110
>> CMD_SEND:16
>> ..ARG... 0x00000000
>> ..MMC_RSP_R1,5,6,7 . 0x00000000 
>> CMD_SEND:17
>> ..ARG... 0x00000000
>> ..RET... -110
>>
>> hdr read sector 80, count=0
>> mmc_load_image_raw_sector: mmc block read error
>> SPL: failed to boot from all boot devices
>> ### ERROR ### Please RESET the board ###
>>
>> So, 
>> spl_mmc.c on line 66, blk_dread return 0 count
>> blk.h on line 389, block_dev->block_read(block_dev, start, blkcnt, buffer) return 0
>> block_dev->block_read is a pointer, seems like it defined in mmc_legacy.c on line 144, bdesc->block_read = mmc_bread;
>> mmc.c, line 285 mmc_read_blocks return Failed to read blocks
>> mmc.c, line 223, mmc_send_cmd return 0, cmdidx was 17, like last in mmc trace
>>
>>
>>> 7 ???. 2016 ?., ? 5:48, Jaehoon Chung <jh80.chung at samsung.com <mailto:jh80.chung@samsung.com>> ???????(?):
>>>
>>> On 10/03/2016 02:39 AM, AneoX wrote:
>>>> Emmc Card was the new one, so i just burn a dump of working sd. Previously
>>>> sd have been wired to board for test.
>>>>
>>>> Board is a custom,  like olinuxino lime which with nand and sd slot, 512 mb
>>>> ram. So i using it defconfig and in case of sd card, it works.
>>>> Emmc lines has external pullups according to the datasheet.
>>>
>>> Well, i needs to get more information..If you guess that seems to return 0 from block_read()..
>>> then you can find which condition was hit..is it impossible?
>>>
>>> If you can share more debug message..then i will help you.
>>>
>>> Best Regards,
>>> Jaehoon Chung
>>>
>>>>
>>>> 2 ???. 2016 ?. 23:28 ???????????? "Jagan Teki" <jagannadh.teki at gmail.com <mailto:jagannadh.teki@gmail.com>>
>>>> ???????:
>>>>
>>>> On Sun, Oct 2, 2016 at 10:45 PM, AneoX <aneox.inbox at gmail.com <mailto:aneox.inbox@gmail.com>> wrote:
>>>>> Like a sd card. I have emmc to sd adapter, so
>>>>>
>>>>> dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8
>>>>
>>>> I guess you cleaned[1] the card before doing this?
>>>>
>>>>>
>>>>> and then just solder emmc to my board.
>>>>
>>>> OK, which a20 board?
>>>>
>>>> [1] http://linux-sunxi.org/Bootable_SD_card
>>>>
>>>> thanks!
>>>> --
>>>> Jagan Teki
>>>> Free Software Engineer | www.openedev.com <http://www.openedev.com/>
>>>> U-Boot, Linux | Upstream Maintainer
>>>> Hyderabad, India.
>>>> _______________________________________________
>>>> U-Boot mailing list
>>>> U-Boot at lists.denx.de <mailto:U-Boot@lists.denx.de>
>>>> http://lists.denx.de/mailman/listinfo/u-boot
>>
> 

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-10-07  8:44                     ` Alexandr Bochkarev
@ 2016-10-12 10:52                       ` Alexandr Bochkarev
  2016-10-12 11:09                         ` Jaehoon Chung
  0 siblings, 1 reply; 42+ messages in thread
From: Alexandr Bochkarev @ 2016-10-12 10:52 UTC (permalink / raw)
  To: u-boot

In order to exclude possible errors on my board, i get MarsBoard A20 Lite, desolder nand, and put on emmc pads my emmc flash.
So emmc is on sdc2 lines. When iam booting from sd on sdc1, linux kernel can init emmc, and i got /dev/mmcblkp1, works well.
But when i eject sd and try to boot from sdc2 emmc, get the same err 17. 
In this case i have used some old uboot from marsboard site, because mainline u-boot have not config for a20 marsboard.

U-Boot SPL 2014.04-10685-g4af825f-dirty (Jun 14 2014 - 17:55:48)
Board: MarsBoard-A20 & MarsPI
DRAM: 1024 MiB
CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
Card did not respond to voltage select!
spl: mmc init failed: err - -17
### ERROR ### Please RESET the board ###

So, the problem with eMMC KLM4G1FE3B-B001 is exists(
Maybe you know some cheap emmc, which is 100% works with mainline u-boot?

> 7 ???. 2016 ?., ? 14:44, Alexandr Bochkarev <aneox.inbox@gmail.com> ???????(?):
> 
> Hi!
> Very appreciate your help! Hope we will fix it, because my board will be garbage without emmc (
> So, my steps:
> 
> git clone git://git.denx.de/u-boot.git <git://git.denx.de/u-boot.git> --depth 1; cd u-boot;
> make CROSS_COMPILE=arm-linux-gnueabihf- A20-OLinuXino-Lime_defconfig
> make CROSS_COMPILE=arm-linux-gnueabihf-
> 
> Also turn on CONFIG_MMC_TRACE
> 
> After run, got:
> 
> Trying to boot from MMC1
> CMD_SEND:0
> ..ARG... 0x00000000
> ..MMC_RSP_NONE
> CMD_SEND:8
> ..ARG... 0x00000000
> ..RET... -110
> CMD_SEND:55
> ..ARG... 0x00000000
> ..RET... -110
> CMD_SEND:0
> ..ARG... 0x00000000
> ..MMC_RSP_NONE
> CMD_SEND:1
> ..ARG... 0x00000000
> ..MMC_RSP_R3,4.. 0x00000000 
> CMD_SEND:1
> ..ARG... 0x00000000
> ..MMC_RSP_R3,4.. 0x00000000 
> CMD_SEND:0
> ..ARG... 0x00000000
> ..MMC_RSP_NONE
> CMD_SEND:1
> ..ARG... 0x00000000
> ..MMC_RSP_R3,4.. 0x00000000 
> CMD_SEND:1
> ..ARG... 0x00000000
> ..MMC_RSP_R3,4.. 0x00000000 
> CMD_SEND:2
> ..ARG... 0x00000000
> ..MMC_RSP_R2.. 0x00000000 
> ..          .. 0x00000000 
> ..          .. 0x00000000 
> ..          .. 0x00000000 
> 
> .....DUMPING DATA
> .....000 - 00 00 00 00 
> .....004 - 00 00 00 00 
> .....008 - 00 00 00 00 
> .....012 - 00 00 00 00 
> CMD_SEND:3
> ..ARG... 0x00000000
> ..MMC_RSP_R1,5,6,7 . 0x00000000 
> CMD_SEND:9
> ..ARG... 0x00000000
> ..MMC_RSP_R2.. 0x00000000 
> ..          .. 0x00000000 
> ..          .. 0x00000000 
> ..          .. 0x00000000 
> 
> .....DUMPING DATA
> .....000 - 00 00 00 00 
> .....004 - 00 00 00 00 
> .....008 - 00 00 00 00 
> .....012 - 00 00 00 00 
> CMD_SEND:13
> ..ARG... 0x00000000
> ..MMC_RSP_R1,5,6,7 . 0x00000000 
> CURR STATE:3
> CMD_SEND:7
> ..ARG... 0x00000000
> ..MMC_RSP_R1,5,6,7 . 0x00000000 
> CMD_SEND:8
> ..ARG... 0x00000000
> ..MMC_RSP_R1,5,6,7 . 0x00000000 
> CMD_SEND:8
> ..ARG... 0x00000000
> ..MMC_RSP_R1,5,6,7 . 0x00000000 
> CMD_SEND:6
> ..ARG... 0x00000000
> ..MMC_RSP_R1b.. 0x00000000 
> CMD_SEND:13
> ..ARG... 0x00000000
> ..MMC_RSP_R1,5,6,7 . 0x00000000 
> CURR STATE:4
> CMD_SEND:8
> ..ARG... 0x00000000
> ..MMC_RSP_R1,5,6,7 . 0x00000000 
> CMD_SEND:6
> ..ARG... 0x00000000
> ..RET... -110
> CMD_SEND:16
> ..ARG... 0x00000000
> ..MMC_RSP_R1,5,6,7 . 0x00000000 
> CMD_SEND:17
> ..ARG... 0x00000000
> ..RET... -110
> 
> hdr read sector 80, count=0
> mmc_load_image_raw_sector: mmc block read error
> SPL: failed to boot from all boot devices
> ### ERROR ### Please RESET the board ###
> 
> So, 
> spl_mmc.c on line 66, blk_dread return 0 count
> blk.h on line 389, block_dev->block_read(block_dev, start, blkcnt, buffer) return 0
> block_dev->block_read is a pointer, seems like it defined in mmc_legacy.c on line 144, bdesc->block_read = mmc_bread;
> mmc.c, line 285 mmc_read_blocks return Failed to read blocks
> mmc.c, line 223, mmc_send_cmd return 0, cmdidx was 17, like last in mmc trace
> 
> 
>> 7 ???. 2016 ?., ? 5:48, Jaehoon Chung <jh80.chung at samsung.com <mailto:jh80.chung@samsung.com>> ???????(?):
>> 
>> On 10/03/2016 02:39 AM, AneoX wrote:
>>> Emmc Card was the new one, so i just burn a dump of working sd. Previously
>>> sd have been wired to board for test.
>>> 
>>> Board is a custom,  like olinuxino lime which with nand and sd slot, 512 mb
>>> ram. So i using it defconfig and in case of sd card, it works.
>>> Emmc lines has external pullups according to the datasheet.
>> 
>> Well, i needs to get more information..If you guess that seems to return 0 from block_read()..
>> then you can find which condition was hit..is it impossible?
>> 
>> If you can share more debug message..then i will help you.
>> 
>> Best Regards,
>> Jaehoon Chung
>> 
>>> 
>>> 2 ???. 2016 ?. 23:28 ???????????? "Jagan Teki" <jagannadh.teki at gmail.com <mailto:jagannadh.teki@gmail.com>>
>>> ???????:
>>> 
>>> On Sun, Oct 2, 2016 at 10:45 PM, AneoX <aneox.inbox at gmail.com <mailto:aneox.inbox@gmail.com>> wrote:
>>>> Like a sd card. I have emmc to sd adapter, so
>>>> 
>>>> dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8
>>> 
>>> I guess you cleaned[1] the card before doing this?
>>> 
>>>> 
>>>> and then just solder emmc to my board.
>>> 
>>> OK, which a20 board?
>>> 
>>> [1] http://linux-sunxi.org/Bootable_SD_card <http://linux-sunxi.org/Bootable_SD_card>
>>> 
>>> thanks!
>>> --
>>> Jagan Teki
>>> Free Software Engineer | www.openedev.com <http://www.openedev.com/>
>>> U-Boot, Linux | Upstream Maintainer
>>> Hyderabad, India.
>>> _______________________________________________
>>> U-Boot mailing list
>>> U-Boot at lists.denx.de <mailto:U-Boot@lists.denx.de>
>>> http://lists.denx.de/mailman/listinfo/u-boot <http://lists.denx.de/mailman/listinfo/u-boot>

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-10-06 23:48                   ` Jaehoon Chung
@ 2016-10-07  8:44                     ` Alexandr Bochkarev
  2016-10-12 10:52                       ` Alexandr Bochkarev
  0 siblings, 1 reply; 42+ messages in thread
From: Alexandr Bochkarev @ 2016-10-07  8:44 UTC (permalink / raw)
  To: u-boot

Hi!
Very appreciate your help! Hope we will fix it, because my board will be garbage without emmc (
So, my steps:

git clone git://git.denx.de/u-boot.git --depth 1; cd u-boot;
make CROSS_COMPILE=arm-linux-gnueabihf- A20-OLinuXino-Lime_defconfig
make CROSS_COMPILE=arm-linux-gnueabihf-

Also turn on CONFIG_MMC_TRACE

After run, got:

Trying to boot from MMC1
CMD_SEND:0
..ARG... 0x00000000
..MMC_RSP_NONE
CMD_SEND:8
..ARG... 0x00000000
..RET... -110
CMD_SEND:55
..ARG... 0x00000000
..RET... -110
CMD_SEND:0
..ARG... 0x00000000
..MMC_RSP_NONE
CMD_SEND:1
..ARG... 0x00000000
..MMC_RSP_R3,4.. 0x00000000 
CMD_SEND:1
..ARG... 0x00000000
..MMC_RSP_R3,4.. 0x00000000 
CMD_SEND:0
..ARG... 0x00000000
..MMC_RSP_NONE
CMD_SEND:1
..ARG... 0x00000000
..MMC_RSP_R3,4.. 0x00000000 
CMD_SEND:1
..ARG... 0x00000000
..MMC_RSP_R3,4.. 0x00000000 
CMD_SEND:2
..ARG... 0x00000000
..MMC_RSP_R2.. 0x00000000 
..          .. 0x00000000 
..          .. 0x00000000 
..          .. 0x00000000 

.....DUMPING DATA
.....000 - 00 00 00 00 
.....004 - 00 00 00 00 
.....008 - 00 00 00 00 
.....012 - 00 00 00 00 
CMD_SEND:3
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000000 
CMD_SEND:9
..ARG... 0x00000000
..MMC_RSP_R2.. 0x00000000 
..          .. 0x00000000 
..          .. 0x00000000 
..          .. 0x00000000 

.....DUMPING DATA
.....000 - 00 00 00 00 
.....004 - 00 00 00 00 
.....008 - 00 00 00 00 
.....012 - 00 00 00 00 
CMD_SEND:13
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000000 
CURR STATE:3
CMD_SEND:7
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000000 
CMD_SEND:8
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000000 
CMD_SEND:8
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000000 
CMD_SEND:6
..ARG... 0x00000000
..MMC_RSP_R1b.. 0x00000000 
CMD_SEND:13
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000000 
CURR STATE:4
CMD_SEND:8
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000000 
CMD_SEND:6
..ARG... 0x00000000
..RET... -110
CMD_SEND:16
..ARG... 0x00000000
..MMC_RSP_R1,5,6,7 . 0x00000000 
CMD_SEND:17
..ARG... 0x00000000
..RET... -110

hdr read sector 80, count=0
mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

So, 
spl_mmc.c on line 66, blk_dread return 0 count
blk.h on line 389, block_dev->block_read(block_dev, start, blkcnt, buffer) return 0
block_dev->block_read is a pointer, seems like it defined in mmc_legacy.c on line 144, bdesc->block_read = mmc_bread;
mmc.c, line 285 mmc_read_blocks return Failed to read blocks
mmc.c, line 223, mmc_send_cmd return 0, cmdidx was 17, like last in mmc trace


> 7 ???. 2016 ?., ? 5:48, Jaehoon Chung <jh80.chung@samsung.com> ???????(?):
> 
> On 10/03/2016 02:39 AM, AneoX wrote:
>> Emmc Card was the new one, so i just burn a dump of working sd. Previously
>> sd have been wired to board for test.
>> 
>> Board is a custom,  like olinuxino lime which with nand and sd slot, 512 mb
>> ram. So i using it defconfig and in case of sd card, it works.
>> Emmc lines has external pullups according to the datasheet.
> 
> Well, i needs to get more information..If you guess that seems to return 0 from block_read()..
> then you can find which condition was hit..is it impossible?
> 
> If you can share more debug message..then i will help you.
> 
> Best Regards,
> Jaehoon Chung
> 
>> 
>> 2 ???. 2016 ?. 23:28 ???????????? "Jagan Teki" <jagannadh.teki@gmail.com>
>> ???????:
>> 
>> On Sun, Oct 2, 2016 at 10:45 PM, AneoX <aneox.inbox@gmail.com> wrote:
>>> Like a sd card. I have emmc to sd adapter, so
>>> 
>>> dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8
>> 
>> I guess you cleaned[1] the card before doing this?
>> 
>>> 
>>> and then just solder emmc to my board.
>> 
>> OK, which a20 board?
>> 
>> [1] http://linux-sunxi.org/Bootable_SD_card
>> 
>> thanks!
>> --
>> Jagan Teki
>> Free Software Engineer | www.openedev.com
>> U-Boot, Linux | Upstream Maintainer
>> Hyderabad, India.
>> _______________________________________________
>> U-Boot mailing list
>> U-Boot at lists.denx.de <mailto:U-Boot@lists.denx.de>
>> http://lists.denx.de/mailman/listinfo/u-boot <http://lists.denx.de/mailman/listinfo/u-boot>

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-10-02 17:39                 ` AneoX
@ 2016-10-06 23:48                   ` Jaehoon Chung
  2016-10-07  8:44                     ` Alexandr Bochkarev
  0 siblings, 1 reply; 42+ messages in thread
From: Jaehoon Chung @ 2016-10-06 23:48 UTC (permalink / raw)
  To: u-boot

On 10/03/2016 02:39 AM, AneoX wrote:
> Emmc Card was the new one, so i just burn a dump of working sd. Previously
> sd have been wired to board for test.
> 
> Board is a custom,  like olinuxino lime which with nand and sd slot, 512 mb
> ram. So i using it defconfig and in case of sd card, it works.
> Emmc lines has external pullups according to the datasheet.

Well, i needs to get more information..If you guess that seems to return 0 from block_read()..
then you can find which condition was hit..is it impossible?

If you can share more debug message..then i will help you.

Best Regards,
Jaehoon Chung

> 
> 2 ???. 2016 ?. 23:28 ???????????? "Jagan Teki" <jagannadh.teki@gmail.com>
> ???????:
> 
> On Sun, Oct 2, 2016 at 10:45 PM, AneoX <aneox.inbox@gmail.com> wrote:
>> Like a sd card. I have emmc to sd adapter, so
>>
>> dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8
> 
> I guess you cleaned[1] the card before doing this?
> 
>>
>> and then just solder emmc to my board.
> 
> OK, which a20 board?
> 
> [1] http://linux-sunxi.org/Bootable_SD_card
> 
> thanks!
> --
> Jagan Teki
> Free Software Engineer | www.openedev.com
> U-Boot, Linux | Upstream Maintainer
> Hyderabad, India.
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
> 

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

* [U-Boot] [bug report] sunxi: booting from eMMC
       [not found]               ` <CAC2Q4vY0mpHLO82qN=xecvy9gjKESWd_FzP-esaC9zcyH0dqcg@mail.gmail.com>
@ 2016-10-02 17:39                 ` AneoX
  2016-10-06 23:48                   ` Jaehoon Chung
  0 siblings, 1 reply; 42+ messages in thread
From: AneoX @ 2016-10-02 17:39 UTC (permalink / raw)
  To: u-boot

Emmc Card was the new one, so i just burn a dump of working sd. Previously
sd have been wired to board for test.

Board is a custom,  like olinuxino lime which with nand and sd slot, 512 mb
ram. So i using it defconfig and in case of sd card, it works.
Emmc lines has external pullups according to the datasheet.

2 ???. 2016 ?. 23:28 ???????????? "Jagan Teki" <jagannadh.teki@gmail.com>
???????:

On Sun, Oct 2, 2016 at 10:45 PM, AneoX <aneox.inbox@gmail.com> wrote:
> Like a sd card. I have emmc to sd adapter, so
>
> dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8

I guess you cleaned[1] the card before doing this?

>
> and then just solder emmc to my board.

OK, which a20 board?

[1] http://linux-sunxi.org/Bootable_SD_card

thanks!
--
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-10-02 17:15           ` AneoX
@ 2016-10-02 17:28             ` Jagan Teki
       [not found]               ` <CAC2Q4vY0mpHLO82qN=xecvy9gjKESWd_FzP-esaC9zcyH0dqcg@mail.gmail.com>
  0 siblings, 1 reply; 42+ messages in thread
From: Jagan Teki @ 2016-10-02 17:28 UTC (permalink / raw)
  To: u-boot

On Sun, Oct 2, 2016 at 10:45 PM, AneoX <aneox.inbox@gmail.com> wrote:
> Like a sd card. I have emmc to sd adapter, so
>
> dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8

I guess you cleaned[1] the card before doing this?

>
> and then just solder emmc to my board.

OK, which a20 board?

[1] http://linux-sunxi.org/Bootable_SD_card

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.

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

* [U-Boot] [bug report] sunxi: booting from eMMC
       [not found]         ` <CAC2Q4vY8vnaM5XrZKNp84J0AmYKWSGQKK_DQOKLERUCQyGM=nA@mail.gmail.com>
@ 2016-10-02 17:15           ` AneoX
  2016-10-02 17:28             ` Jagan Teki
  0 siblings, 1 reply; 42+ messages in thread
From: AneoX @ 2016-10-02 17:15 UTC (permalink / raw)
  To: u-boot

Like a sd card. I have emmc to sd adapter, so

dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8

and then just solder emmc to my board.

2 ???. 2016 ?. 23:08 ???????????? "Jagan Teki" <jagannadh.teki@gmail.com>
???????:

On Sun, Oct 2, 2016 at 7:13 PM, Alexandr Bochkarev
<aneox.inbox@gmail.com> wrote:
> Already tried. The same output:
>
> mmc_load_image_raw_sector: mmc block read error
> SPL: failed to boot from all boot devices
> ### ERROR ### Please RESET the board ###

Need few more info, how exactly you wrote SPL on emmc, could you provide
that.


--
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-10-02 13:43   ` Alexandr Bochkarev
@ 2016-10-02 17:08     ` Jagan Teki
       [not found]       ` <CAC2Q4vbD0Eh++cfvKfbSxK_m0KLqUh5GGJ4ur6K6AFSp2so39w@mail.gmail.com>
  0 siblings, 1 reply; 42+ messages in thread
From: Jagan Teki @ 2016-10-02 17:08 UTC (permalink / raw)
  To: u-boot

On Sun, Oct 2, 2016 at 7:13 PM, Alexandr Bochkarev
<aneox.inbox@gmail.com> wrote:
> Already tried. The same output:
>
> mmc_load_image_raw_sector: mmc block read error
> SPL: failed to boot from all boot devices
> ### ERROR ### Please RESET the board ###

Need few more info, how exactly you wrote SPL on emmc, could you provide that.


-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-10-02 13:38 ` Jagan Teki
@ 2016-10-02 13:43   ` Alexandr Bochkarev
  2016-10-02 17:08     ` Jagan Teki
  0 siblings, 1 reply; 42+ messages in thread
From: Alexandr Bochkarev @ 2016-10-02 13:43 UTC (permalink / raw)
  To: u-boot

Already tried. The same output:

> mmc_load_image_raw_sector: mmc block read error
> SPL: failed to boot from all boot devices
> ### ERROR ### Please RESET the board ###





> 2 ???. 2016 ?., ? 19:38, Jagan Teki <jagannadh.teki@gmail.com> ???????(?):
> 
> On Sun, Oct 2, 2016 at 1:07 PM, Alexandr Bochkarev
> <aneox.inbox@gmail.com> wrote:
>> Hi!
>> 
>> I am trying to boot my A20 board from eMMC KLM4G1FE3B-B001, but has no success.
>> Commenting mmc_change_freq has no effect.
>> U-Boot 2016.03 just says Could not determine boot source
>> 
>> I have found, that it stucks in sunxi_mmc_has_egon_boot_signature.
>> 
>> int sunxi_mmc_has_egon_boot_signature(struct mmc *mmc)
>> {
>>        char *buf = malloc(512);
>>        int valid_signature = 0;
>> 
>>        if (buf == NULL)
>>                panic("Failed to allocate memory\n");
>> 
>>        if (mmc_getcd(mmc) && mmc_init(mmc) == 0 &&
>>            mmc->block_dev.block_read(&mmc->block_dev, 16, 1, buf) == 1 &&
>>            strncmp(&buf[4], "eGON.BT0", 8) == 0)
>>                valid_signature = 1;
>> 
>>        free(buf);
>>        return valid_signature;
>> }
>> 
>> mmc_init(mmc) return no errors, seems good, but
>> block_read returns 0, seems it cant read emmc.
>> 
>> 
>> U-Boot 2016.09 says:
>> 
>> mmc_load_image_raw_sector: mmc block read error
>> SPL: failed to boot from all boot devices
>> ### ERROR ### Please RESET the board ###
> 
> Can you try it on master once?
> 
> -- 
> Jagan Teki
> Free Software Engineer | www.openedev.com
> U-Boot, Linux | Upstream Maintainer
> Hyderabad, India.

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

* [U-Boot] [bug report] sunxi: booting from eMMC
  2016-10-02  7:37 Alexandr Bochkarev
@ 2016-10-02 13:38 ` Jagan Teki
  2016-10-02 13:43   ` Alexandr Bochkarev
  0 siblings, 1 reply; 42+ messages in thread
From: Jagan Teki @ 2016-10-02 13:38 UTC (permalink / raw)
  To: u-boot

On Sun, Oct 2, 2016 at 1:07 PM, Alexandr Bochkarev
<aneox.inbox@gmail.com> wrote:
> Hi!
>
> I am trying to boot my A20 board from eMMC KLM4G1FE3B-B001, but has no success.
> Commenting mmc_change_freq has no effect.
> U-Boot 2016.03 just says Could not determine boot source
>
> I have found, that it stucks in sunxi_mmc_has_egon_boot_signature.
>
> int sunxi_mmc_has_egon_boot_signature(struct mmc *mmc)
> {
>         char *buf = malloc(512);
>         int valid_signature = 0;
>
>         if (buf == NULL)
>                 panic("Failed to allocate memory\n");
>
>         if (mmc_getcd(mmc) && mmc_init(mmc) == 0 &&
>             mmc->block_dev.block_read(&mmc->block_dev, 16, 1, buf) == 1 &&
>             strncmp(&buf[4], "eGON.BT0", 8) == 0)
>                 valid_signature = 1;
>
>         free(buf);
>         return valid_signature;
> }
>
> mmc_init(mmc) return no errors, seems good, but
> block_read returns 0, seems it cant read emmc.
>
>
> U-Boot 2016.09 says:
>
> mmc_load_image_raw_sector: mmc block read error
> SPL: failed to boot from all boot devices
> ### ERROR ### Please RESET the board ###

Can you try it on master once?

-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.

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

* [U-Boot] [bug report] sunxi: booting from eMMC
@ 2016-10-02  7:37 Alexandr Bochkarev
  2016-10-02 13:38 ` Jagan Teki
  0 siblings, 1 reply; 42+ messages in thread
From: Alexandr Bochkarev @ 2016-10-02  7:37 UTC (permalink / raw)
  To: u-boot

Hi!

I am trying to boot my A20 board from eMMC KLM4G1FE3B-B001, but has no success. 
Commenting mmc_change_freq has no effect. 
U-Boot 2016.03 just says Could not determine boot source

I have found, that it stucks in sunxi_mmc_has_egon_boot_signature. 

int sunxi_mmc_has_egon_boot_signature(struct mmc *mmc)
{
	char *buf = malloc(512);
	int valid_signature = 0;

	if (buf == NULL)
		panic("Failed to allocate memory\n");

	if (mmc_getcd(mmc) && mmc_init(mmc) == 0 &&
	    mmc->block_dev.block_read(&mmc->block_dev, 16, 1, buf) == 1 &&
	    strncmp(&buf[4], "eGON.BT0", 8) == 0)
		valid_signature = 1;

	free(buf);
	return valid_signature;
}

mmc_init(mmc) return no errors, seems good, but
block_read returns 0, seems it cant read emmc.


U-Boot 2016.09 says:

mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

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

end of thread, other threads:[~2016-11-05 10:58 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-12 11:53 [U-Boot] [bug report] sunxi: booting from eMMC Ciprian Manea
2016-09-12 13:56 ` Maxime Ripard
2016-09-12 14:47   ` Hans de Goede
2016-09-13 11:50     ` Maxime Ripard
2016-09-14 10:05       ` Hans de Goede
2016-09-15 13:32         ` Maxime Ripard
2016-09-19 13:17         ` Maxime Ripard
2016-09-19 21:42           ` Hans de Goede
2016-09-19 23:10           ` Jaehoon Chung
2016-09-21 13:32             ` Maxime Ripard
2016-10-03  8:21             ` Maxime Ripard
2016-10-02  7:37 Alexandr Bochkarev
2016-10-02 13:38 ` Jagan Teki
2016-10-02 13:43   ` Alexandr Bochkarev
2016-10-02 17:08     ` Jagan Teki
     [not found]       ` <CAC2Q4vbD0Eh++cfvKfbSxK_m0KLqUh5GGJ4ur6K6AFSp2so39w@mail.gmail.com>
     [not found]         ` <CAC2Q4vY8vnaM5XrZKNp84J0AmYKWSGQKK_DQOKLERUCQyGM=nA@mail.gmail.com>
2016-10-02 17:15           ` AneoX
2016-10-02 17:28             ` Jagan Teki
     [not found]               ` <CAC2Q4vY0mpHLO82qN=xecvy9gjKESWd_FzP-esaC9zcyH0dqcg@mail.gmail.com>
2016-10-02 17:39                 ` AneoX
2016-10-06 23:48                   ` Jaehoon Chung
2016-10-07  8:44                     ` Alexandr Bochkarev
2016-10-12 10:52                       ` Alexandr Bochkarev
2016-10-12 11:09                         ` Jaehoon Chung
2016-10-12 11:25                           ` Alexandr Bochkarev
2016-10-12 12:05                             ` Jaehoon Chung
2016-10-12 12:11                               ` Alexandr Bochkarev
2016-10-12 12:21                                 ` Jaehoon Chung
2016-10-12 12:42                                   ` Alexandr Bochkarev
2016-10-12 12:57                                     ` Alexandr Bochkarev
2016-10-12 13:11                                       ` Alexandr Bochkarev
2016-10-12 13:30                                         ` Jaehoon Chung
2016-10-12 14:03                                           ` Alexandr Bochkarev
2016-10-12 17:49                                             ` Alexandr Bochkarev
2016-10-13  1:11                                               ` Jaehoon Chung
2016-11-03 21:23                                               ` Alexandr Bochkarev
2016-11-03 21:39                                                 ` Alexandr Bochkarev
2016-11-04 22:57                                                   ` Alexandr Bochkarev
2016-11-05  8:18                                                     ` Hans de Goede
2016-11-05 10:58                                                       ` Alexandr Bochkarev
2016-10-13  1:12                                             ` Jaehoon Chung
2016-10-13  8:18                                               ` Alexandr Bochkarev
     [not found]                                                 ` <03f26ecf-c130-88d3-b3df-d7c6ed90ed48@samsung.com>
     [not found]                                                   ` <CB1DA1DA-F8C8-4F21-8201-F008E306FA72@gmail.com>
     [not found]                                                     ` <4b856cc3-68e4-371e-9f9e-df0264769843@samsung.com>
     [not found]                                                       ` <5191BB28-1F97-4B43-8048-85EDFCD52E64@gmail.com>
     [not found]                                                         ` <CGME20161102111524epcas3p1a851f9aeb4b21316065be54bb52b15d4@epcas3p1.samsung.com>
     [not found]                                                           ` <4A365F64-DFAF-477A-B844-6FE397773553@gmail.com>
     [not found]                                                             ` <b1ca97e7-9094-d7f7-d7a8-db3d5b8e9c75@samsung.com>
     [not found]                                                               ` <CAC2Q4vZM7_yhgtR0sd3N-w0ZeeOUQG5RgToz+oNhK5jnKSmcyw@mail.gmail.com>
     [not found]                                                                 ` <073f966f-29be-a35e-8f1c-9ef1c1f2bef7@samsung.com>
2016-11-03 10:10                                                                   ` Alexandr Bochkarev
2016-11-03 19:57                                                                     ` Alexandr Bochkarev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.