Okay, that took a while and several DDings but I found part of the issue. Our board runs without the 32K RTC clock, and the SPL was freezing while executing this (note the commented lines):
#if defined(CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC)
static void rtc32k_enable(void)
{
struct davinci_rtc *rtc = (struct davinci_rtc *)RTC_BASE;
/*
* Unlock the RTC's registers. For more details please see the
* RTC_SS section of the TRM. In order to unlock we need to
* write these specific values (keys) in this order.
*/
//writel(RTC_KICK0R_WE, &rtc->kick0r); <-- COMMENTED
//writel(RTC_KICK1R_WE, &rtc->kick1r); <-- COMMENTED
/* Enable the RTC 32K OSC by setting bits 3 and 6. */
//writel((1 << 3) | (1 << 6), &rtc->osc); <-- COMMENTED
}
I guess it waits for a sync bit or something like that and just stays there forever. Note I commented the lines because I was unable to deselect this option from the menuconfig, looks like it’s a “standard” option. I don’t know if not initializing the RTC will have other repercussions…
Anyway, from that point on, I was able to properly load the SPL and finally to load u-boot!!! Great news after several days sitting in front of a bunch of “CCCCCCCCCCCCCCCCCC”
My joy lasted for 10-20ms, when an exeption rebooted the board. Narrowing down, it looks like some issue while loading stored variables in some nvs (I have no clue where they are actually stored).
Commenting this lines allowed u-boot to continue doing it’s thing:
‘/common/autoboot.c’
#ifdef CONFIG_BOOTCOUNT_LIMIT //CRASH HERE!!
//bootcount = bootcount_load(); <-- COMMENTED
bootcount = 0; //Patch <-- ADDED
bootcount++;
//bootcount_store(bootcount); <-- COMMENTED
env_set_ulong("bootcount", bootcount);
bootlimit = env_get_ulong("bootlimit", 10, 0);
Now I can get up to the “starting kernel” message, where the board freezes…again…, but I guess it has something to do with not loading the kernel image/fdt ot overlapping kernel image/fdt file. I have attached a full print from the sequence. Any more ideas?
U-Boot SPL 2018.01 - MEDEA NO RTC32K - -dirty (Jun 05 2019 - 17:19:22)
Trying to boot from MMC1
U-Boot 2018.01-dirty (Jun 05 2019 - 17:16:24 +0200)
I2C: ready
DRAM: 512 MiB
No match for driver 'omap_hsmmc'
No match for driver 'omap_hsmmc'
Some drivers were not found
****BOARD INIT****.
Reset Source: Global external warm reset has occurred.
Reset Source: watchdog reset has occurred.
Reset Source: Power-on reset has occurred.
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Using default environment
****LATE INIT****.
Board: BeagleBone Black
<ethaddr> not set. Validating first E-fuse MAC
****LATE INIT DONE****.
Net: eth0: MII MODE
Could not get PHY for cpsw: addr 0
cpsw, usb_ether
****U BOOT MAIN LOOP****.
CLI init
CLI init done
preboot cmd
preboot cmd done
bootdelay_process
bootdelay process done
autoboot cmd
Press SPACE to abort autoboot in 2 seconds
board_name=[A335BNLT] ...
board_rev=[00C0] ...
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
** Bad device 0:2 0x82000000 **
** Bad device 0:2 0x82000000 **
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt ...
Checking for: /boot.scr ...
Checking for: /boot/boot.scr ...
Checking for: /boot/uEnv.txt ...
gpio: pin 55 (gpio 55) value is 1
2099 bytes read in 37 ms (54.7 KiB/s)
Loaded environment from /boot/uEnv.txt
Checking if uname_r is set in /boot/uEnv.txt...
gpio: pin 56 (gpio 56) value is 1
Running uname_boot ...
loading /boot/vmlinuz-4.14.67-ti-r73 ...
10379776 bytes read in 683 ms (14.5 MiB/s)
loading /boot/dtbs/4.14.67-ti-r73/am335x-boneblack.dtb ...
60317 bytes read in 53 ms (1.1 MiB/s)
loading /boot/initrd.img-4.14.67-ti-r73 ...
4530411 bytes read in 321 ms (13.5 MiB/s)
debug: [console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet] ...
debug: [bootz 0x82000000 0x88080000:4520eb 0x88000000] ...
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Loading Ramdisk to 8fbad000, end 8ffff0eb ... OK
Loading Device Tree to 8fb9b000, end 8fbacb9c ... OK
Starting kernel ...