U-Boot Verifying data: Error for A20-SOM rev.D

Started by 3ksolutions, July 22, 2021, 12:24:12 am

Previous topic - Next topic

3ksolutions

I am not able to properly boot image A20-OLinuXino-buster-base-20210707-172415.img. Every time there is error in U-Boot. I have tried to configure board info many times with no success.

boot log:
U-Boot SPL 2021.04+olimex-1-20210707.070354 (Jul 07 2021 - 07:05:22 +0000)
DRAM: 1024 MiB
CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
Loading configuration from EEPROM: Error
Loading configuration from MMC: OK
Verifying data: Error
Error

WARNING: The board cannot be detected!
Please run:
        'olinuxino config list' - Select your board
        'olinuxino config write' - Store the board configuration
        'reset' - Reset the board and load the configuration

Using 'A20-OLinuXino-LIME' as fallback configuration.

Trying to boot from MMC1


U-Boot 2021.04+olimex-1-20210707.070354 (Jul 07 2021 - 07:05:22 +0000) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
ID:    A20-OLinuXino-LIME Rev.A
SN:    00000000
MAC:   FF:FF:FF:FF:FF:FF
I2C:   ready
DRAM:  1 GiB
MMC:   mmc@1c0f000: 0
Loading Environment from EXT4... OK
Setting up a 1024x600 lcd console (overscan 0x0)
In:    serial
Out:   vga
Err:   vga
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
=>

I have tried this commands to set board configuration:
olinuxino config write 4673 d
saveenv
reset

and

olinuxino config write 7664 d
saveenv
reset

3ksolutions

I find out that there is bug in u-boot code.

FILE: u-boot-olinuxino/board/olimex/a20_olinuxino/board.c
LINES: 42-47
       /* If booted from eMMC/MMC try loading configuration */
        bootdev = spl_boot_device();
        if (bootdev == BOOT_DEVICE_MMC1 || bootdev == BOOT_DEVICE_MMC2) {
                printf("Loading configuration from MMC: ");
                if (!olinuxino_mmc_eeprom_read()) {
                        printf("OK\n");
                        printf("Verifying data: ");

                        if (olinuxino_eeprom_is_valid()) {
                                printf("OK\n");
                                return;
                        }
                        printf("Error\n");
                }
                printf("Error\n");
        }

On line 50 there is called function olinuxino_eeprom_is_valid() but probably should be olinuxino_mmc_eeprom_is_valid().

LubOlimex

I think the problem comes because A20-SOM revision D has no EEPROM to save the values that you set with olinuxino config write.

As you can see even after you set it manually on next boot, no config is recognized and wrong script gets loaded.

In cases where the board has no EEPROM, the config should be written to the card instead, but I am not sure if that happens.
Technical support and documentation manager at Olimex

3ksolutions

Config is probably written to card but it is not properly validated. There is an bug in U-Boot which is validating eeprom twice. It should validate eeprom and then sd card.