LIME 2 not boot from eMMC with my old image

Started by lucacarone, January 25, 2024, 06:19:21 PM

Previous topic - Next topic

lucacarone

Hi all,
last year i do my image of LIME2 -e8G-s16M.
Now i can't buy this board and i'm changing LIME2 with -e16-s16M.

If I copy my image in eMMC with this command:
dd if=XXX.img of=/dev/mmcblk1 bs=1M conv=sync,noerror

When boot from eMMC I have this error:


U-Boot SPL 2021.04+olimex-1-20231103.141125 (Nov 03 2023 - 14:12:28 +0000)
DRAM: 1024 MiB
CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
Loading configuration from EEPROM: OK
Verifying data: OK
Trying to boot from sunxi SPI
 
 
U-Boot 2021.04+olimex-1-20231103.141125 (Nov 03 2023 - 14:12:28 +0000) Allwinner Technology
 
CPU:   Allwinner A20 (SUN7I)
ID:    T2-OLinuXino-LIME2-e16Gs16M-IND Rev.L1
SN:    0002E8EA
MAC:   30:1F:9A:D1:8C:84
I2C:   ready
DRAM:  1 GiB
SF: Detected w25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
MMC:   mmc@1c0f000: 0, mmc@1c11000: 1
Loading Environment from EXT4...
** Unable to use mmc 1:auto for loading the env **
Loading Environment from FAT... ** No device specified **
In:    serial
Out:   serial
Err:   serial
Allwinner mUSB OTG (Peripheral)
Net:   eth0: ethernet@1c50000, eth1: usb_ether
starting USB...
Bus usb@1c14000: USB EHCI 1.00
Bus usb@1c14400: USB OHCI 1.0
Bus usb@1c1c000: USB EHCI 1.00
Bus usb@1c1c400: USB OHCI 1.0
scanning bus usb@1c14000 for devices... 1 USB Device(s) found
scanning bus usb@1c14400 for devices... 1 USB Device(s) found
scanning bus usb@1c1c000 for devices... 1 USB Device(s) found
scanning bus usb@1c1c400 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
Found U-Boot script /boot.scr
358 bytes read in 1 ms (349.6 KiB/s)
## Executing script at 43100000
Card did not respond to voltage select! : -110
Can't set block device
Card did not respond to voltage select! : -110
Can't set block device
Card did not respond to voltage select! : -110
Can't set block device
Card did not respond to voltage select! : -110
Can't set block device
Wrong Image Format for bootm command
ERROR: can't get kernel image!
SCRIPT FAILED: continuing...
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Card did not respond to voltage select! : -110
Scanning disk [email protected]...
Disk [email protected] not ready
Scanning disk [email protected]...
Found 3 disks
No EFI system partition
BootOrder not defined
EFI boot manager: Cannot load any image
Card did not respond to voltage select! : -110
scanning bus for devices...
SATA link 0 timeout.
AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part ccc apst
timeout exit!
 
Device 0: unknown device
 
Device 0: unknown device
Speed: 100, full duplex
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4


LubOlimex

Did you take a look at our scripts on how transferring to eMMC is done?

https://github.com/OLIMEX/olinuxino-tools/blob/master/src/scripts/olinuxino-sd-to-emmc

Maybe first test with the official Olimage image on whether our script works fine for transferring the image to the board - you can find info about Olimage here:

https://github.com/OLIMEX/OLINUXINO/blob/master/DOCUMENTS/OLIMAGE/Olimage-guide.pdf
Technical support and documentation manager at Olimex

lucacarone

Thanks for your support.

We official Image, it Works! But in our image we have preconfigure a lot of software  and We can save a lot of time if works our image.

We don't find the procedure to install U-boot and Kernel compile by us in LIME2.
It is possible to have this procudure?

Ragards, Luca

LubOlimex

Better to just get the script and use it in your image. Let me first explain what changed and why your command "dd if=XXX.img of=/dev/mmcblk1 bs=1M conv=sync,noerror" is not good enough anymore.

Previously we used eMMC 4.x and eMMC 5.0 and these were supported by the A20 chips boot firmware (BROM). Meaning you can directly boot from the EMMC chip. This is why your simple copy paste worked previously.

As time went by such memories were harder to find and eventually no longer available for purchase. Memory manufacturers switched to eMMC 5.1 and better. However, since the A20 chip is more than 10 years old now and the BROM hasn't been updated it has no compatibility with latest eMMC memories and needs extra step of booting from SPI that then redirects to eMMC.
Technical support and documentation manager at Olimex

lucacarone

#4
Hi All,
We have found solution!

So!

Like LubOlimex said it is impossible now install Uboot on eMMC for eMMC 5.1 problem.

WE have rebuilt Uboot from source.

We have clone form git

git clone https://github.com/OLIMEX/u-boot.git

cd u-boot

NoW we add CONFIG_ARMV7_LPAE=n in A20-OLinuXino-Lime2-eMMC_defconfig

This option is mandatory for boot old kernel 3.4. Without this option uboot stop on "Starting Kernel...."

So

nano configs/A20-OLinuXino-Lime2-eMMC_defconfig
add option CONFIG_ARMV7_LPAE=n

And apply this path https://patchwork.ozlabs.org/patch/1058338/

This procedure is described in the official sunxi documentation

https://linux-sunxi.org/U-Boot in Legacy kernel won't start.

make A20-OLinuXino-Lime2-eMMC_defconfig
 make CROSS_COMPILE=arm-linux-gnueabihf-

Aftet Rebuild Uboot, Start Olimex Lime 2 from SD, With Officil Image and you intall UBoot rebuilded in SPI Memory.


# apt-get install mtd-utils
# mtdinfo
# flashcp -v u-boot-sunxi-with-spl.bin /dev/mtd0


We have copy old Image in emmc with command
dd if=XXX.img of=/dev/mmcblk1 bs=1M conv=sync,noerror

mount first partition dev/mmcblk1p1

change script.cmd

setenv bootm_boot_mode sec
setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait panic=10
load mmc 1:1 0x43000000 script.bin || load mmc 1:1 0x43000000 boot/script.bin
load mmc 1:1 0x42000000 uImage || load mmc 1:1 0x42000000 boot/uImage
bootm 0x42000000

rebuild script.cmd

mkimage -C none -A arm -T script -d boot.cmd boot.scr
New Uboot read eMMC internal with mmc 1 not mmc 0

Now Olimex Lime2 boot old image in emmc

Regards, Luca



















LubOlimex

Thank you for explaining the steps Luca, much appreciated. I am sure other people would find it helpful.
Technical support and documentation manager at Olimex