Other Parts Discussed in Thread: TPS62362, AM4372, AM4379, TPS62360
We have a target board with multiple AM4376 SOCs and I am trying to get zImage to boot on at least one of the SOCs using u-boot. The following observations and debugging steps have been performed and the result is described below.
1) I am using an AM437x IDK EVM as the base for my target u0boot and zImage.
u-boot is built, with modifications for the target, using board-support release version ===> u-boot-2018.01+gitAUTOINC+313dcd69c2-g313dcd69c2
zImage is built, using the default configuration for the AM437x, tisdk_am437x-evm_defconfig, using board-support release version =====> linux-4.14.79+gitAUTOINC+bde58ab01e-gbde58ab01e
The only modification to the zImage is to add debug print statements in main.c and setup.c (suggestions from other E2E and open source forums)
main.c/ start_kernel function looks like this:
asmlinkage __visible void __init start_kernel(void)
{
char *command_line;
char *after_dashes;
pr_info("start_kernel() 00\n");
set_task_stack_end_magic(&init_task);
pr_info("start_kernel() 01\n");
smp_setup_processor_id();
pr_info("start_kernel() 02\n");
debug_objects_early_init();
pr_info("start_kernel() 03\n");
cgroup_init_early();
pr_info("start_kernel() 04\n");
local_irq_disable();
early_boot_irqs_disabled = true;
/*
* Interrupts are still disabled. Do necessary setups, then
* enable them.
*/
boot_cpu_init();
page_address_init();
pr_notice("%s", linux_banner);
setup_arch(&command_line);
...
and setup.c / smp_setup_processor_id() looks like this:
void __init smp_setup_processor_id(void)
{
int i;
u32 mpidr = is_smp() ? read_cpuid_mpidr() & MPIDR_HWID_BITMASK : 0;
u32 cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
pr_info("smp_setup_processor_id Start\n");
cpu_logical_map(0) = cpu;
for (i = 1; i < nr_cpu_ids; ++i)
cpu_logical_map(i) = i == cpu ? 0 : i;
/*sm
* clear __my_cpu_offset on boot CPU to avoid hang caused by
* using percpu variable early, for example, lockdep will
* access percpu variable inside lock_release
*/
set_my_cpu_offset(0);
pr_info("Booting Linux on physical CPU 0x%x\n", mpidr);
}
2) Booting zImage on the AM437x_IDK_EVM board boots as expected and outputs the debug messages as expected, here is the console output of the startups from u-boot.
U-Boot SPL 2018.01-00558-g8617e02-dirty (Jul 26 2019 - 15:03:35)
Trying to boot from eth device
Card did not respond to voltage select!
** Bad device mmc 0 **
Using default environment
<ethaddr> not set. Validating first E-fuse MAC
<ethaddr> set to CoreACE CPU A
CoreACE eth_env_set_enetaddr()
<ethaddr> set to CoreACE CPU A
CoreACE eth_env_set_enetaddr()
Could not get PHY for cpsw: addr 7
CoreACE eth_env_set_enetaddr()
cpsw, usb_ether
Error: usb_ether address not set.
Trying cpsw
FAIL
Trying usb_ether
using dwc3-gadget, OUT ep2out IN ep1in STATUS ep3in
MAC 00:00:00:0d:00:0a
HOST MAC de:ad:be:ef:00:00
RNDIS ready
The remote end did not respond in time.FAIL
Problem booting with BOOTP
SPL: RJP failed to boot from all boot devices
### ERROR ### Please RESET the board ###
U-Boot SPL 2018.01-00558-g8617e02-dirty (Jul 26 2019 - 14:56:16)
Trying to boot from eth device
Card did not respond to voltage select!
** Bad device mmc 0 **
Using default environment
<ethaddr> not set. Validating first E-fuse MAC
<ethaddr> set to CoreACE CPU A
CoreACE eth_env_set_enetaddr()
<ethaddr> set to CoreACE CPU A
CoreACE eth_env_set_enetaddr()
CoreACE eth_env_set_enetaddr()
cpsw, usb_ether
Error: usb_ether address not set.
Trying cpsw
cpsw Waiting for PHY auto negotiation to complete... done
link up on port 0, speed 100, full duplex
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
DHCP client bound to address 192.168.1.21 (1270 ms)
Using cpsw device
TFTP from server 192.168.1.9; our IP address is 192.168.1.21
Filename 'u-boot.img'.
Load address: 0x82000000
Loading: #################################################################
#######################################################
840.8 KiB/s
done
Bytes transferred = 611400 (95448 hex)
U-Boot 2018.01-00558-g8617e02-dirty (Jul 26 2019 - 14:56:16 -0400)
CPU : AM437X-GP rev 1.2
Model: TI AM437x CoreACE Rev 0.00
DRAM: 1 GiB
PMIC: TPS62362
NAND: 0 MiB
MMC: OMAP SD/MMC: 0
MMC: no card present
** Bad device mmc 0 **
Using default environment
Net: <ethaddr> not set. Validating first E-fuse MAC
<ethaddr> set to CoreACE CPU A
CoreACE eth_env_set_enetaddr()
<ethaddr> set to CoreACE CPU A
CoreACE eth_env_set_enetaddr()
<ethaddr> set to CoreACE CPU A
CoreACE eth_env_set_enetaddr()
CoreACE eth_env_set_enetaddr()
cpsw, usb_ether
Hit any key to stop autoboot: 0
MMC: no card present
MMC: no card present
MMC: no card present
MMC: no card present
Booting from network ...
Trying cpsw
link up on port 0, speed 100, full duplex
BOOTP broadcast 1
DHCP client bound to address 192.168.1.21 (5 ms)
Trying cpsw
link up on port 0, speed 100, full duplex
Using cpsw device
TFTP from server 192.168.1.9; our IP address is 192.168.1.21
Filename 'zImage'.
Load address: 0x82000000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
############################################
854.5 KiB/s
done
Bytes transferred = 3883520 (3b4200 hex)
Trying cpsw
link up on port 0, speed 100, full duplex
Using cpsw device
TFTP from server 192.168.1.9; our IP address is 192.168.1.21
Filename 'am437x-idk-evm.dtb'. <============ Using am437x-idk-evm devicetree
Load address: 0x88000000
Loading: ##########
899.4 KiB/s
done
Bytes transferred = 46974 (b77e hex)
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Loading Device Tree to 8fff1000, end 8ffff77d ... OK
Starting kernel ...
[ 0.000000] start_kernel() 00 <============ Debug pr_info() in start_kernel()
[ 0.000000] start_kernel() 01 <============ Debug pr_info() in start_kernel()
[ 0.000000] smp_setup_processor_id Start <============ Debug pr_info() in smp_setup_processor_id()
[ 0.000000] Booting Linux on physical CPU 0x0 <============ Standard pr_info() in smp_setup_processor_id()
[ 0.000000] start_kernel() 02 <============ Debug pr_info() in start_kernel()
[ 0.000000] start_kernel() 03 <============ Debug pr_info() in start_kernel()
[ 0.000000] start_kernel() 04 <============ Debug pr_info() in start_kernel()
[ 0.000000] Linux version 4.14.79-gbde58ab01e (root@dev-vbox) (gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11)) #17 PREEMPT Fri Jul 26 15:53:41 EDT 2019
[ 0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: TI AM437x Industrial Development Kit
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] efi: Getting EFI parameters from FDT:
[ 0.000000] efi: UEFI not found.
3) Booting zImage on our Target SOC u-boot loads zImage to RAM but not debug messages are output, here is the console output of the startup from u-boot on the target:
U-Boot SPL 2018.01-00558-g8617e02-dirty (Jul 26 2019 - 15:03:35)
Trying to boot from eth device
** No partition table - mmc 0 **
Using default environment
<ethaddr> not set. Validating first E-fuse MAC
<ethaddr> set to CoreACE CPU A
CoreACE eth_env_set_enetaddr()
<ethaddr> set to CoreACE CPU A
CoreACE eth_env_set_enetaddr()
CoreACE eth_env_set_enetaddr()
cpsw, usb_ether
Error: usb_ether address not set.
Trying cpsw
cpsw Waiting for PHY auto negotiation to complete.... done
link up on port 0, speed 100, half duplex
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
DHCP client bound to address 192.168.1.21 (1058 ms)
Using cpsw device
TFTP from server 192.168.1.9; our IP address is 192.168.1.21
Filename 'u-boot.img'.
Load address: 0x82000000
Loading: #################################################################
#######################################################
727.5 KiB/s
done
Bytes transferred = 611400 (95448 hex)
U-Boot 2018.01-00558-g8617e02-dirty (Jul 26 2019 - 15:03:35 -0400)
CPU : AM437X-GP rev 1.2
Model: TI AM437x CoreACE Rev 0.00
DRAM: 1 GiB
Can't find PMIC:TPS62362
NAND: 0 MiB
MMC: OMAP SD/MMC: 0
MMC: no card present
** Bad device mmc 0 **
Using default environment
Net: <ethaddr> not set. Validating first E-fuse MAC
<ethaddr> set to CoreACE CPU A
CoreACE eth_env_set_enetaddr()
<ethaddr> set to CoreACE CPU A
CoreACE eth_env_set_enetaddr()
<ethaddr> set to CoreACE CPU A
CoreACE eth_env_set_enetaddr()
CoreACE eth_env_set_enetaddr()
cpsw, usb_ether
Hit any key to stop autoboot: 0
MMC: no card present
MMC: no card present
MMC: no card present
MMC: no card present
Booting from network ...
Trying cpsw
cpsw Waiting for PHY auto negotiation to complete. done
link up on port 0, speed 100, half duplex
BOOTP broadcast 1
DHCP client bound to address 192.168.1.21 (6 ms)
Trying cpsw
link up on port 0, speed 100, full duplex
Using cpsw device
TFTP from server 192.168.1.9; our IP address is 192.168.1.21
Filename 'zImage'.
Load address: 0x82000000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
############################################
724.6 KiB/s
done
Bytes transferred = 3883520 (3b4200 hex)
Trying cpsw
link up on port 0, speed 100, half duplex
Using cpsw device
TFTP from server 192.168.1.9; our IP address is 192.168.1.21
Filename 'am437x-idk-evm.dtb'.
Load address: 0x88000000
Loading: ##########
705.1 KiB/s
done
Bytes transferred = 46974 (b77e hex)
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Loading Device Tree to 8fff1000, end 8ffff77d ... OK
Starting kernel ... <============= Last message printed by U-boot
<============= Target board does not get to start_kernel()?????
I think our target is having issue at a much lower point in the boot process than main.c, perhaps in Init.S or at the _start vector? I do have an XDS560 emulator connected to the target using CCS, when I am connected to the CortexA9 and pause debugging I stop in the address range 0xC01023C0, but I have not been able to load symbols for zImage to see what function/tag this is in the source? Perhaps, help with loading symbols may reveal more details?
Also, it is not clear what could be different from the EVM to the our Target? The EVM uses an AM4379 while our target is AM4376. The devicetree for the am437x-idk-evem is referencing targets in the AM437x and AM4372 family so I am not sure is need to make an update there?
Any direction you can give in debugging this boot issue is most welcome, I continue to look for samples on what to debug before Linux enters main.c and have not found anything yet.
Thanks in advance,
Rob






