Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-11-05 Thread Alexandr Bochkarev
Hi,

I have tried it, no success

>>U-Boot SPL 2016.11-rc3-1-g9fa5bf3-dirty (Nov 05 2016 - 16:18:14)
>>DRAM: 1024 MiB
>>CPU: 91200Hz, 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 

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_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 

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 




> 5 нояб. 2016 г., в 14:18, Hans de Goede  написал(а):
> 
> 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
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-11-04 Thread Alexandr Bochkarev
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 
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(>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;
}

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


Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-11-03 Thread Alexandr Bochkarev

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: 91200Hz, 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 ###

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


Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-11-03 Thread Alexandr Bochkarev
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 ### 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-11-03 Thread Alexandr Bochkarev

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: 91200Hz, 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.in...@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: 5000
> 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... 0x
> ..MMC_RSP_NONE
> CMD_SEND:8
> ..ARG... 0x01AA
> ..RET... -110
> CMD_SEND:55
> ..ARG... 0x
> ..RET... -110
> CMD_SEND:0
> ..ARG... 0x
> ..MMC_RSP_NONE
> CMD_SEND:1
> ..ARG... 0x
> ..MMC_RSP_R3,4.. 0x00FF8080 
> CMD_SEND:1
> ..ARG... 0x4030
> ..MMC_RSP_R3,4.. 0x00FF8080 
> CMD_SEND:0
> ..ARG... 0x
> ..MMC_RSP_NONE
> CMD_SEND:1
> ..ARG... 0x4030
> ..MMC_RSP_R3,4.. 0x00FF8080 
> CMD_SEND:1
> ..ARG... 0x4030
> ..MMC_RSP_R3,4.. 0xC0FF8080 
> CMD_SEND:2
> ..ARG... 0x
> ..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... 0x0001
> ..MMC_RSP_R1,5,6,7 . 0x0500 
> CMD_SEND:9
> ..ARG... 0x0001
> ..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... 0x0001
> ..MMC_RSP_R1,5,6,7 . 0x0700 
> CURR STATE:3
> CMD_SEND:7
> ..ARG... 0x0001
> ..MMC_RSP_R1,5,6,7 . 0x0700 
> CMD_SEND:8
> ..ARG... 0x
> ..MMC_RSP_R1,5,6,7 . 0x0900 
> CMD_SEND:8
> ..ARG... 0x
> ..MMC_RSP_R1,5,6,7 . 0x0900 
> CMD_SEND:6
> ..ARG... 0x03B90100
> ..MMC_RSP_R1b.. 0x0900 
> CMD_SEND:13
> ..ARG... 0x0001
> ..MMC_RSP_R1,5,6,7 . 0x0900 
> CURR STATE:4
> CMD_SEND:8
> ..ARG... 0x
> ..MMC_RSP_R1,5,6,7 . 0x0900 
> CMD_SEND:6
> ..ARG... 0x03B70100
> ..RET.

Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-11-03 Thread Alexandr Bochkarev

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: 5000
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... 0x
..MMC_RSP_NONE
CMD_SEND:8
..ARG... 0x01AA
..RET... -110
CMD_SEND:55
..ARG... 0x
..RET... -110
CMD_SEND:0
..ARG... 0x
..MMC_RSP_NONE
CMD_SEND:1
..ARG... 0x
..MMC_RSP_R3,4.. 0x00FF8080 
CMD_SEND:1
..ARG... 0x4030
..MMC_RSP_R3,4.. 0x00FF8080 
CMD_SEND:0
..ARG... 0x
..MMC_RSP_NONE
CMD_SEND:1
..ARG... 0x4030
..MMC_RSP_R3,4.. 0x00FF8080 
CMD_SEND:1
..ARG... 0x4030
..MMC_RSP_R3,4.. 0xC0FF8080 
CMD_SEND:2
..ARG... 0x
..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... 0x0001
..MMC_RSP_R1,5,6,7 . 0x0500 
CMD_SEND:9
..ARG... 0x0001
..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... 0x0001
..MMC_RSP_R1,5,6,7 . 0x0700 
CURR STATE:3
CMD_SEND:7
..ARG... 0x0001
..MMC_RSP_R1,5,6,7 . 0x0700 
CMD_SEND:8
..ARG... 0x
..MMC_RSP_R1,5,6,7 . 0x0900 
CMD_SEND:8
..ARG... 0x
..MMC_RSP_R1,5,6,7 . 0x0900 
CMD_SEND:6
..ARG... 0x03B90100
..MMC_RSP_R1b.. 0x0900 
CMD_SEND:13
..ARG... 0x0001
..MMC_RSP_R1,5,6,7 . 0x0900 
CURR STATE:4
CMD_SEND:8
..ARG... 0x
..MMC_RSP_R1,5,6,7 . 0x0900 
CMD_SEND:6
..ARG... 0x03B70100
..RET... -110
CMD_SEND:16
..ARG... 0x0200
..MMC_RSP_R1,5,6,7 . 0x0900 
CMD_SEND:17
..ARG... 0x
..RET... -110
mmc_bread: Failed to read blocks
CMD_SEND:16
..ARG... 0x0200
..MMC_RSP_R1,5,6,7 . 0x0900 
CMD_SEND:17
..ARG... 0x
..RET... -110
mmc_bread: Failed to read blocks
CMD_SEND:16
..ARG... 0x0200
..MMC_RSP_R1,5,6,7 . 0x0900 
CMD_SEND:18
..ARG... 0x0040
..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: 5200
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... 0x
..MMC_RSP_NONE
CMD_SEND:8
..ARG... 0x
..RET... -110
CMD_SEND:55
..ARG... 0x
..RET... -110
CMD_SEND:0
..ARG... 0x
..MMC_RSP_NONE
CMD_SEND:1
..ARG... 0x
..MMC_RSP_R3,4.. 0x 
CMD_SEND:1
..ARG... 0x
..MMC_RSP_R3,4.. 0x 
CMD_SEND:0
..ARG... 0x
..MMC_RSP_NONE
CMD_SEND:1
..ARG... 0x
..MMC_RSP_R3,4.. 0x 
CMD_SEND:1
..ARG... 0x
..MMC_RSP_R3,4.. 0x 
CMD_SEND:2
..ARG... 0x
..MMC_RSP_R2.. 0x 
..  .. 0x 
..  .. 0x 
..  .. 0x 

.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... 0x
..MMC_RSP_R1,5,6,7 . 0x 
CMD_SEND:9
..ARG... 0x
..MMC_RSP_R2.. 0x 
..  .. 0x 
..  .. 0x 
..  .. 0x 

.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

Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-10-13 Thread Alexandr Bochkarev
So, this debug output.

U-Boot SPL 2016.11-rc1-g4dc34be-dirty (Oct 13 2016 - 14:04:10)
DRAM: 1024 MiB
CPU: 91200Hz, 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 2400 parent 2400 n 1 m 1 rate 2400
init mmc 2 resource
init mmc 2 clock and io
mmc 2 set mod-clk req 2400 parent 2400 n 1 m 1 rate 2400
set ios: bus_width: 1, clock: 0
set ios: bus_width: 1, clock: 40
mmc 2 set mod-clk req 40 parent 2400 n 4 m 15 rate 40
mmc 2, cmd 0(0x80008000), arg 0x
mmc resp 0x
mmc 2, cmd 8(0x8148), arg 0x01aa
cmd timeout 100
mmc 2, cmd 55(0x8177), arg 0x
cmd timeout 100
mmc 2, cmd 0(0x80008000), arg 0x
mmc resp 0x
mmc 2, cmd 1(0x8041), arg 0x
mmc resp 0x40ff8080
mmc 2, cmd 1(0x8041), arg 0x4030
mmc resp 0x40ff8080
mmc 2, cmd 0(0x80008000), arg 0x
mmc resp 0x40ff8080
mmc 2, cmd 1(0x8041), arg 0x4030
mmc resp 0x40ff8080
mmc 2, cmd 1(0x8041), arg 0x4030
mmc resp 0xc0ff8080
mmc 2, cmd 2(0x81c2), arg 0x
mmc resp 0x7585c009 0x42030b01 0x34473146 0x1501004d
mmc 2, cmd 3(0x8143), arg 0x0001
mmc resp 0x0500
mmc 2, cmd 9(0x81c9), arg 0x0001
mmc resp 0x8a404057 0xf6dbffe7 0x0f5903ff 0xd0270132
mmc 2, cmd 13(0x814d), arg 0x0001
mmc resp 0x0700
mmc 2, cmd 7(0x8147), arg 0x0001
mmc resp 0x0700
mmc 2, cmd 8(0x80002348), arg 0x
trans data 512 bytes
cacl timeout 78 msec
mmc resp 0x0900
mmc 2, cmd 8(0x80002348), arg 0x
trans data 512 bytes
cacl timeout 78 msec
mmc resp 0x0900
mmc cmd 6 check rsp busy
mmc 2, cmd 6(0x8146), arg 0x03b90100
mmc resp 0x0900
mmc 2, cmd 13(0x814d), arg 0x0001
mmc resp 0x0900
mmc 2, cmd 8(0x80002348), arg 0x
trans data 512 bytes
cacl timeout 78 msec
mmc resp 0x0900
mmc cmd 6 check rsp busy
mmc 2, cmd 6(0x8146), arg 0x03b70200
cmd timeout 42
mmc cmd 6 check rsp busy
mmc 2, cmd 6(0x8146), arg 0x03b70100
cmd timeout 42
set ios: bus_width: 1, clock: 5200
mmc 2 set mod-clk req 5200 parent 6 n 1 m 12 rate 5000
mmc 2, cmd 16(0x8150), arg 0x0200
mmc resp 0x0900
mmc 2, cmd 17(0x80002351), arg 0x0050
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: 5200, 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

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


Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-10-12 Thread Alexandr Bochkarev
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/ioseMMC
clock:  5200 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/iosSD card
clock:  5000 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 40, src 2400
[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:f006(4fc0) 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 40, src 2400
[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 40Hz bm PP pm ON vdd 3.3V width 
1 timing LEGACY(SDR12) dt B
[0.182189] [mmc-msg] sdc2 set round clock 40, src 2400
[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 40Hz bm PP pm ON vdd 3.3V width 
1 timing LEGACY(SDR12) dt B
[0.266386] [mmc-msg] sdc2 set ios: clk 40Hz 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 40Hz bm OD pm ON vdd 3.3V width 
1 timing LEGACY(SDR12) dt B
[0.313857] [mmc-msg] sdc2 set ios: clk 40Hz bm OD pm ON vdd 3.3V width 
1 timing LEGACY(SDR12) dt B
[0.313874] [mmc-msg] sdc2 set ios: clk 40Hz bm OD pm ON vdd 3.3V width 
1 timing LEGACY(SDR12) dt B
[0.313889] [mmc-msg] sdc2 set ios: clk 40Hz bm OD pm ON vdd 3.3V width 
1 timing LEGACY(SDR12) dt B
[0.316273] [mmc-msg] sdc2 set ios: clk 40Hz bm OD pm ON vdd 3.3V width 
1 timing LEGACY(SDR12) dt B
[0.333276] [mmc-msg] sdc2 set ios: clk 40Hz bm PP pm ON vdd 3.3V width 
1 timing LEGACY(SDR12) dt B
[0.346076] [mmc-msg] sdc2 set ios: clk 40Hz bm PP pm ON vdd 3.3V width 
1 timing MMC-HS(SDR20) dt B
[0.346092] [mmc-msg] sdc2 set ios: clk 5200Hz 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 6
[0.401211] [mmc-msg] sdc2 set ios: clk 5200Hz 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 5200Hz 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 5200Hz 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 40Hz bm PP pm ON vdd 3.3V width 
1 timing LEGACY(SDR12) dt B
[1.682200] [mmc-msg] sdc0 set round clock 40, src 2400
[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 40Hz bm PP pm ON vdd 3.3V width 
1 timing LEGACY(SDR12) dt B
[1.770004] [mmc-msg] sdc0 set ios: clk 40Hz 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] 

Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-10-12 Thread Alexandr Bochkarev

> 
> 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.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-10-12 Thread Alexandr Bochkarev
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: 5000
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... 0x
..MMC_RSP_NONE
CMD_SEND:8
..ARG... 0x01AA
..RET... -110
CMD_SEND:55
..ARG... 0x
..RET... -110
CMD_SEND:0
..ARG... 0x
..MMC_RSP_NONE
CMD_SEND:1
..ARG... 0x
..MMC_RSP_R3,4.. 0x00FF8080 
CMD_SEND:1
..ARG... 0x4030
..MMC_RSP_R3,4.. 0x00FF8080 
CMD_SEND:0
..ARG... 0x
..MMC_RSP_NONE
CMD_SEND:1
..ARG... 0x4030
..MMC_RSP_R3,4.. 0x00FF8080 
CMD_SEND:1
..ARG... 0x4030
..MMC_RSP_R3,4.. 0xC0FF8080 
CMD_SEND:2
..ARG... 0x
..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... 0x0001
..MMC_RSP_R1,5,6,7 . 0x0500 
CMD_SEND:9
..ARG... 0x0001
..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... 0x0001
..MMC_RSP_R1,5,6,7 . 0x0700 
CURR STATE:3
CMD_SEND:7
..ARG... 0x0001
..MMC_RSP_R1,5,6,7 . 0x0700 
CMD_SEND:8
..ARG... 0x
..MMC_RSP_R1,5,6,7 . 0x0900 
CMD_SEND:8
..ARG... 0x
..MMC_RSP_R1,5,6,7 . 0x0900 
CMD_SEND:6
..ARG... 0x03B90100
..MMC_RSP_R1b.. 0x0900 
CMD_SEND:13
..ARG... 0x0001
..MMC_RSP_R1,5,6,7 . 0x0900 
CURR STATE:4
CMD_SEND:8
..ARG... 0x
..MMC_RSP_R1,5,6,7 . 0x0900 
CMD_SEND:6
..ARG... 0x03B70100
..RET... -110
CMD_SEND:16
..ARG... 0x0200
..MMC_RSP_R1,5,6,7 . 0x0900 
CMD_SEND:17
..ARG... 0x
..RET... -110
mmc_bread: Failed to read blocks
CMD_SEND:16
..ARG... 0x0200
..MMC_RSP_R1,5,6,7 . 0x0900 
CMD_SEND:17
..ARG... 0x
..RET... -110
mmc_bread: Failed to read blocks
CMD_SEND:16
..ARG... 0x0200
..MMC_RSP_R1,5,6,7 . 0x0900 
CMD_SEND:18
..ARG... 0x0040
..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: 5200
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
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-10-12 Thread Alexandr Bochkarev
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: 91200Hz, AXI/AHB/APB: 3/2/2
Trying to boot from MMC2
CMD_SEND:0
..ARG... 0x
..MMC_RSP_NONE
CMD_SEND:8
..ARG... 0x
..RET... -110
CMD_SEND:55
..ARG... 0x
..RET... -110
CMD_SEND:0
..ARG... 0x
..MMC_RSP_NONE
CMD_SEND:1
..ARG... 0x
..MMC_RSP_R3,4.. 0x 
CMD_SEND:1
..ARG... 0x
..MMC_RSP_R3,4.. 0x 
CMD_SEND:0
..ARG... 0x
..MMC_RSP_NONE
CMD_SEND:1
..ARG... 0x
..MMC_RSP_R3,4.. 0x 
CMD_SEND:1
..ARG... 0x
..MMC_RSP_R3,4.. 0x 
CMD_SEND:2
..ARG... 0x
..MMC_RSP_R2.. 0x 
..  .. 0x 
..  .. 0x 
..  .. 0x 

.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... 0x
..MMC_RSP_R1,5,6,7 . 0x 
CMD_SEND:9
..ARG... 0x
..MMC_RSP_R2.. 0x 
..  .. 0x 
..  .. 0x 
..  .. 0x 

.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... 0x
..MMC_RSP_R1,5,6,7 . 0x 
CURR STATE:3
CMD_SEND:7
..ARG... 0x
..MMC_RSP_R1,5,6,7 . 0x 
CMD_SEND:8
..ARG... 0x
..MMC_RSP_R1,5,6,7 . 0x 
CMD_SEND:8
..ARG... 0x
..MMC_RSP_R1,5,6,7 . 0x 
CMD_SEND:6
..ARG... 0x
..MMC_RSP_R1b.. 0x 
CMD_SEND:13
..ARG... 0x
..MMC_RSP_R1,5,6,7 . 0x 
CURR STATE:4
CMD_SEND:8
..ARG... 0x
..MMC_RSP_R1,5,6,7 . 0x 
CMD_SEND:6
..ARG... 0x
..RET... -110
CMD_SEND:16
..ARG... 0x
..MMC_RSP_R1,5,6,7 . 0x 
CMD_SEND:17
..ARG... 0x
..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.in...@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: 91200Hz, 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
> 
> 

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


Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-10-12 Thread Alexandr Bochkarev

> 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: 91200Hz, 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


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


Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-10-12 Thread Alexandr Bochkarev
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.ch...@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 0x4800
>> baudrate=115200
>> boot_ram=saved_stdout=$stdout;setenv stdout nc;if iminfo 0x4100; then 
>> true; setenv stdout $saved_stdout; source 0x4100;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=0x1000
>> bootscr=boot.scr
>> console=ttyS0,115200
>> device=mmc
>> ethact=dwmac.1c5
>> 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 0x4300 
>> ${bootpath}${script} && ext2load $device $partition 0x4800 
>> ${bootpath}${kernel};then true; elif bootpath=/ && fatload $device 
>> $partition 0x4300 ${script} && fatload $device $partition 0x4800 
>> ${kernel};then true; elif bootpath=/ && ext2load $device $partition 
>> 0x4300 ${bootpath}${script} && ext2load $device $partition 0x4800 
>> ${bootpath}${kernel};then true; else false;fi
>> loglevel=8
>> panicarg=panic=10
>> partition=0:1
>> script=script.bin
>> scriptaddr=0x4400
>> 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.ch...@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 & Ma

Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-10-12 Thread Alexandr Bochkarev
> 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 0x4800
baudrate=115200
boot_ram=saved_stdout=$stdout;setenv stdout nc;if iminfo 0x4100; then true; 
setenv stdout $saved_stdout; source 0x4100;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=0x1000
bootscr=boot.scr
console=ttyS0,115200
device=mmc
ethact=dwmac.1c5
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 0x4300 
${bootpath}${script} && ext2load $device $partition 0x4800 
${bootpath}${kernel};then true; elif bootpath=/ && fatload $device $partition 
0x4300 ${script} && fatload $device $partition 0x4800 ${kernel};then 
true; elif bootpath=/ && ext2load $device $partition 0x4300 
${bootpath}${script} && ext2load $device $partition 0x4800 
${bootpath}${kernel};then true; else false;fi
loglevel=8
panicarg=panic=10
partition=0:1
script=script.bin
scriptaddr=0x4400
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.ch...@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: 96000Hz, 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.in...@gmail.com 
>>> <mailto:aneox.in...@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... 0x
>>> ..MMC_RSP_NONE
>>> CMD_SEND:8
>>> ..ARG... 0x
>>> ..RET... -110
>>> CMD_SEND:55
>>> ..ARG... 0x
>>> ..RET...

Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-10-12 Thread Alexandr Bochkarev
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: 96000Hz, 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.in...@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
> 
> After run, got:
> 
> Trying to boot from MMC1
> CMD_SEND:0
> ..ARG... 0x
> ..MMC_RSP_NONE
> CMD_SEND:8
> ..ARG... 0x
> ..RET... -110
> CMD_SEND:55
> ..ARG... 0x
> ..RET... -110
> CMD_SEND:0
> ..ARG... 0x
> ..MMC_RSP_NONE
> CMD_SEND:1
> ..ARG... 0x
> ..MMC_RSP_R3,4.. 0x 
> CMD_SEND:1
> ..ARG... 0x
> ..MMC_RSP_R3,4.. 0x 
> CMD_SEND:0
> ..ARG... 0x
> ..MMC_RSP_NONE
> CMD_SEND:1
> ..ARG... 0x
> ..MMC_RSP_R3,4.. 0x 
> CMD_SEND:1
> ..ARG... 0x
> ..MMC_RSP_R3,4.. 0x 
> CMD_SEND:2
> ..ARG... 0x
> ..MMC_RSP_R2.. 0x 
> ..  .. 0x 
> ..  .. 0x 
> ..  .. 0x 
> 
> .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... 0x
> ..MMC_RSP_R1,5,6,7 . 0x 
> CMD_SEND:9
> ..ARG... 0x
> ..MMC_RSP_R2.. 0x 
> ..  .. 0x 
> ..  .. 0x 
> ..  .. 0x 
> 
> .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... 0x
> ..MMC_RSP_R1,5,6,7 . 0x 
> CURR STATE:3
> CMD_SEND:7
> ..ARG... 0x
> ..MMC_RSP_R1,5,6,7 . 0x 
> CMD_SEND:8
> ..ARG... 0x
> ..MMC_RSP_R1,5,6,7 . 0x 
> CMD_SEND:8
> ..ARG... 0x
> ..MMC_RSP_R1,5,6,7 . 0x 
> CMD_SEND:6
> ..ARG... 0x
> ..MMC_RSP_R1b.. 0x 
> CMD_SEND:13
> ..ARG... 0x
> ..MMC_RSP_R1,5,6,7 . 0x 
> CURR STATE:4
> CMD_SEND:8
> ..ARG... 0x
> ..MMC_RSP_R1,5,6,7 . 0x 
> CMD_SEND:6
> ..ARG... 0x
> ..RET... -110
> CMD_SEND:16
> ..ARG... 0x
> ..MMC_RSP_R1,5,6,7 . 0x 
> CMD_SEND:17
> ..ARG... 0x
> ..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.ch...@samsung.com 
>> <mailto:jh80.ch...@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.
>> 

Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-10-07 Thread Alexandr Bochkarev
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... 0x
..MMC_RSP_NONE
CMD_SEND:8
..ARG... 0x
..RET... -110
CMD_SEND:55
..ARG... 0x
..RET... -110
CMD_SEND:0
..ARG... 0x
..MMC_RSP_NONE
CMD_SEND:1
..ARG... 0x
..MMC_RSP_R3,4.. 0x 
CMD_SEND:1
..ARG... 0x
..MMC_RSP_R3,4.. 0x 
CMD_SEND:0
..ARG... 0x
..MMC_RSP_NONE
CMD_SEND:1
..ARG... 0x
..MMC_RSP_R3,4.. 0x 
CMD_SEND:1
..ARG... 0x
..MMC_RSP_R3,4.. 0x 
CMD_SEND:2
..ARG... 0x
..MMC_RSP_R2.. 0x 
..  .. 0x 
..  .. 0x 
..  .. 0x 

.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... 0x
..MMC_RSP_R1,5,6,7 . 0x 
CMD_SEND:9
..ARG... 0x
..MMC_RSP_R2.. 0x 
..  .. 0x 
..  .. 0x 
..  .. 0x 

.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... 0x
..MMC_RSP_R1,5,6,7 . 0x 
CURR STATE:3
CMD_SEND:7
..ARG... 0x
..MMC_RSP_R1,5,6,7 . 0x 
CMD_SEND:8
..ARG... 0x
..MMC_RSP_R1,5,6,7 . 0x 
CMD_SEND:8
..ARG... 0x
..MMC_RSP_R1,5,6,7 . 0x 
CMD_SEND:6
..ARG... 0x
..MMC_RSP_R1b.. 0x 
CMD_SEND:13
..ARG... 0x
..MMC_RSP_R1,5,6,7 . 0x 
CURR STATE:4
CMD_SEND:8
..ARG... 0x
..MMC_RSP_R1,5,6,7 . 0x 
CMD_SEND:6
..ARG... 0x
..RET... -110
CMD_SEND:16
..ARG... 0x
..MMC_RSP_R1,5,6,7 . 0x 
CMD_SEND:17
..ARG... 0x
..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  написал(а):
> 
> 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" 
>> написал:
>> 
>> On Sun, Oct 2, 2016 at 10:45 PM, AneoX  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@lists.denx.de 
>> http://lists.denx.de/mailman/listinfo/u-boot 
>> 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-10-02 Thread Alexandr Bochkarev
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.t...@gmail.com> написал(а):
> 
> On Sun, Oct 2, 2016 at 1:07 PM, Alexandr Bochkarev
> <aneox.in...@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(>block_dev, 16, 1, buf) == 1 &&
>>strncmp([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.

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


Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-10-02 Thread Alexandr Bochkarev
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(>block_dev, 16, 1, buf) == 1 &&
strncmp([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 ###
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot