LIME2-EMMC custom board not boot from emmc

Started by alr2, February 14, 2017, 04:48:09 PM

Previous topic - Next topic

alr2

Hi!
I look for this topic in every place at the internet but all of the topics are not related with my problem.

I have a custom board based on the Lime2-emmc.
It can boot from SD, but when I tried to copy the same u-boot-sunxi-with-spl.bin to the emmc  and try to boot, nothing happends, the screen is empty.
dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk1 bs=1024 seek=8
boot from SD

http://imgur.com/a/OHxzm



When it boots from SD the u-boot shows both (SD on MMC0 and EMMC on MMC1)
I´m using the A20-OLinuXino-Lime2-eMMC_defconfig with some mods to my board.
My emmc is unit is  KLM8G1GEME-B041 and is connected to the board like the emmc unit is connected to A20-OLinuXino-Lime2_Rev_G

http://imgur.com/a/GIY3W

I did a hexdump on the SD and MMC and it looks the same with the "eGON.BT0" tag in the right position.
sd
http://imgur.com/a/AL6lv
MMC
http://imgur.com/a/bM5v3





alr2

Hi again,
A funny thing. :-[
When it boots from the SD card, and the u-boot prompt appears, if I remove the SD card and send the reset command, the board starts from the EMMC without problems.


U-Boot SPL 2017.03-rc2-dirty (Feb 15 2017 - 10:37:04)
DRAM: 1024 MiB
CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
Trying to boot from MMC1

U-Boot 2017.03-rc2-dirty (Feb 15 2017 - 10:37:04 +0100) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)                                                   
Model: Olimex A20-OLinuXino-LIME2-eMMC                                         
I2C:   ready                                                                   
DRAM:  1 GiB                                                                   
MMC:   SUNXI SD/MMC: 0, SUNXI SD/MMC: 1                                                                                                                                       
In:    serial                                                                   
Out:   serial                                                                   
Err:   serial                                                                   
SCSI:  AHCI PHY power up failed.                                               
Net:   No ethernet found.                                                       
starting USB...                                                                 
USB0:   USB EHCI 1.00                                                           
USB1:   USB OHCI 1.0                                                           
USB2:   USB EHCI 1.00                                                           
USB3:   USB OHCI 1.0                                                           
scanning bus 0 for devices... 1 USB Device(s) found                             
scanning bus 2 for devices... 1 USB Device(s) found                             
       scanning usb for storage devices... 0 Storage Device(s) found           
Hit any key to stop autoboot:  0                                                                                           
=> reset 
resetting ...                                                                   
                                                                               
U-Boot SPL 2017.01-armbian (Feb 09 2017 - 14:44:38)                             
DRAM: 1024 MiB                                                                 
CPU: 912000000Hz, AXI/AHB/APB: 3/2/2                                           
Trying to boot from MMC2                                                       
                                                                               
U-Boot 2017.01-armbian (Feb 09 2017 - 14:44:38 +0100) Allwinner Technology     
                                                                               
CPU:   Allwinner A20 (SUN7I)                                                   
Model: Olimex A20-OLinuXino-LIME2-eMMC                                         
I2C:   ready                                                                   
DRAM:  1 GiB                                                                   
MMC:   SUNXI SD/MMC: 1, SUNXI SD/MMC: 0                                         
*** Warning - bad CRC, using default environment                               
                                                                               
In:    serial                                                                   
Out:   serial                                                                   
Err:   serial                                                                   
SCSI:  AHCI PHY power up failed.                                               
Net:   No ethernet found.                                                       
Hit any key to stop autoboot:  0                                               
6944 bytes read in 150 ms (44.9 KiB/s)                                         
switch to partitions #0, OK                                                     
mmc0(part 0) is current device

Any hints?


marc_c

Check power supply?

My Lime2 eMMC doesn't boot from eMMC when powered solely by USB. Have to connect a battery pack or just use the DC plug for it to boot from eMMC.

alr2

Quote from: marc_c on February 27, 2017, 01:38:56 PM
Check power supply?

My Lime2 eMMC doesn't boot from eMMC when powered solely by USB. Have to connect a battery pack or just use the DC plug for it to boot from eMMC.
Hi marc_c,
Yes I did check that part also. Our custom board has POE, the usb and the DC plug, and with any of that isn´t booting from the EMMC unless we are rebooting, As you can see in the previous message.

alr2

#4
 With the SD loaded with U-Boot 2017.01-armbian

I can boot and manage the board. I did a nand-sata-install and now the content of the SD and MMC is the same (checked with hexdump) but the board is not booting from the EMMC.

The config is one based on A20-OLinuXino-Lime2-eMMC_defconfig, but modified for my board:

CONFIG_ARM=y
CONFIG_ARCH_SUNXI=y
CONFIG_SPL_I2C_SUPPORT=y
CONFIG_MACH_SUN7I=y
CONFIG_DRAM_CLK=360
CONFIG_DRAM_MBUS_CLK=400
CONFIG_DRAM_ZQ=91
CONFIG_DRAM_ODT_EN=y
CONFIG_DRAM_TPR3=0x041111
CONFIG_DRAM_DQS_GATING_DELAY=0x04040404
# CONFIG_DRAM_TIMINGS_VENDOR_MAGIC is not set
CONFIG_DRAM_TIMINGS_DDR3_1066F_1333H=y
CONFIG_USB0_VBUS_PIN=""
CONFIG_USB0_VBUS_DET=""
CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-lime2-emmc"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPC(3)"
CONFIG_SPL=y
CONFIG_MMC0_CD_PIN="PH15"
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set
CONFIG_CMD_DFU=y
CONFIG_CMD_USB_MASS_STORAGE=y
# CONFIG_CMD_FPGA is not set
CONFIG_DFU_RAM=y
CONFIG_RTL8211X_PHY_FORCE_MASTER=y
CONFIG_ETH_DESIGNWARE=y
CONFIG_AXP_ALDO3_VOLT=2800
CONFIG_AXP_ALDO4_VOLT=2800
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_MUSB_GADGET=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_DOWNLOAD=y
CONFIG_G_DNL_MANUFACTURER="Allwinner Technology"
CONFIG_G_DNL_VENDOR_NUM=0x1f3a
CONFIG_G_DNL_PRODUCT_NUM=0x1010


this is my fdisk -l output

Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk0p1       2048 15213343 15211296  7.3G 83 Linux

Disk /dev/mmcblk1: 7.3 GiB, 7818182656 bytes, 15269888 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x8a6be3e2

Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk1p1       2048 15117183 15115136  7.2G 83 Linux

Disk /dev/mmcblk1boot1: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xeb695f6b

Device              Boot Start   End Sectors Size Id Type
/dev/mmcblk1boot1p1          1  8191    8191   4M 83 Linux

Disk /dev/mmcblk1boot0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xaf98e9b7


Any hints?

alr2

 I just realized that the boot and boot1 sectors of the emmc on the LIme2-emmc board are 16Mb each. And the boot sectors on my EMMC of my custom board are 4MB each. is this related with the SPL?

Can I configure armbian u-boot to change this?