iMX8M Plus Falcon Boot Support

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX8M Plus Falcon Boot Support

Jump to solution
3,774 Views
evanwilliams
Contributor II

I’m implementing Falcon Mode using NXP’s app note AN13709.

However, this app note is for the imx8mn, not the imx8mp.

The issue is this implementation is not able to execute the uImage kernel entry point.

The issue is this implementation does not print anything to the UART and is hung after jumping into the uImage kernal. (despite doing kernel patching for virtual addressing)

I verified the image data on the SD card has sufficient space for each image (SPL, FDT, uImage, ATF) and matches regions outlined in the app note.

I verified I’m able to initialize DDR and read/write to it during both SPL and ATF execution.

When bl31_main finishes, I verified el3_exit sets registers x30 and x0 to correct PC and FDT addresses. (0x40400000 and 0x43000000)

However, after calling the assembly macro "exception_return" CPU execution appears stopped only when using the 0x40400000 pc address.

Using ATF's address 0x970000 instead of 0x40400000 re-runs the ATF binary.

Loading the ATF binary into 0x40400000 and using the 0x40400000 address does not allow execution.

I’m able to read and print the instructions at DDR 0x40400000 and they match the uImage data’s entry point on the SD card.

I also tried setting the DDR region containing 0x40400000 to allow execution permissions for EL3 so that the ATF could directly jump into the DDR address without exiting EL3, but found this did not change behavior.

Maybe the SPL code is missing a step so when the "exception_return" assembly macro is called in ATF's el3_exit, there's a CPU exception when jumping to the RAM address?


Any tips/help would be greatly appreciated!

0 Kudos
1 Solution
3,371 Views
evanwilliams
Contributor II

Thanks so much for posting your logs, I found that I was missing an arg from the initial u-boot preventing early kernel UART prints!

I did this to get logs:

u-boot=> edit mmcargs
edit: setenv bootargs ${jh_clk} ${mcore_clk} console=${console} root=${mmcroot} earlycon=ec_imx6q,0x30890000,115200

I can now clearly see the issue:

 

 

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.15.71+g95448dd0dc9b (oe-user@oe-host) (aarch64-poky-linux-gcc (GCC) 11.3.0, GNU ld (GNU Binutils) 2.38.20220708) #1 SMP PREEMPT Wed Feb 8 03:38:28 UTC 2023
[    0.000000] Machine model: NXP i.MX8MPlus EVK board
[    0.000000] earlycon: ec_imx6q0 at MMIO 0x0000000030890000 (options '115200')
[    0.000000] printk: bootconsole [ec_imx6q0] enabled
[    0.000000] efi: UEFI not found.
[    0.000000] Memory doesn't fit in the linear mapping, VA_BITS too small
[    0.000000] Reserved memory: created CMA memory pool at 0x00000000c4000000, size 960 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] Reserved memory: created DMA memory pool at 0x0000000094300000, size 1 MiB
[    0.000000] OF: reserved mem: initialized node vdev0buffer@94300000, compatible id shared-dma-pool
[    0.000000] Unhandled fault at 0xfffffbfffda37000
[    0.000000] Mem abort info:
[    0.000000]   ESR = 0x96000043
[    0.000000]   EC = 0x25: DABT (current EL), IL = 32 bits
[    0.000000]   SET = 0, FnV = 0
[    0.000000]   EA = 0, S1PTW = 0
[    0.000000]   FSC = 0x03: level 3 address size fault
[    0.000000] Data abort info:
[    0.000000]   ISV = 0, ISS = 0x00000043
[    0.000000]   CM = 0, WnR = 1
[    0.000000] swapper pgtable: 4k pages, 48-bit VAs, pgdp=000000004222c000
[    0.000000] [fffffbfffda37000] pgd=00000000421a6003, p4d=00000000421a6003
[    0.000000] Unable to handle kernel paging request at virtual address ffff0000021a6ff8
[    0.000000] Mem abort info:
[    0.000000]   ESR = 0x96000004
[    0.000000]   EC = 0x25: DABT (current EL), IL = 32 bits
[    0.000000]   SET = 0, FnV = 0
[    0.000000]   EA = 0, S1PTW = 0
[    0.000000]   FSC = 0x04: level 0 translation fault
[    0.000000] Data abort info:
[    0.000000]   ISV = 0, ISS = 0x00000004
[    0.000000]   CM = 0, WnR = 0
[    0.000000] swapper pgtable: 4k pages, 48-bit VAs, pgdp=000000004222c000
[    0.000000] [ffff0000021a6ff8] pgd=0000000000000000, p4d=0000000000000000
[    0.000000] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 5.15.71+g95448dd0dc9b #1
[    0.000000] Hardware name: NXP i.MX8MPlus EVK board (DT)
[    0.000000] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    0.000000] pc : show_pte+0x18c/0x238
[    0.000000] lr : show_pte+0x15c/0x238
[    0.000000] sp : ffff800009c239a0
[    0.000000] x29: ffff800009c239a0 x28: ffff800009c32500 x27: ffff800009230000
[    0.000000] x26: 0000000000000000 x25: ffff800009daa000 x24: ffff800009947520
[    0.000000] x23: ffff80000983f000 x22: ffff800009e2c000 x21: 0000000000000ff8
[    0.000000] x20: ffff0000021a6000 x19: fffffbfffda37000 x18: ffffffffffffffff
[    0.000000] x17: 697461706d6f6320 x16: 2c30303030303334 x15: ffff800009db8820
[    0.000000] x14: 0000000000000010 x13: ffff800009c41f78 x12: 0000000000000042
[    0.000000] x11: 0000000000000016 x10: ffff800009c41f78 x9 : ffff800009c41f78
[    0.000000] x8 : 00000000ffffefff x7 : ffff800009c99f78 x6 : ffff800009c99f78
[    0.000000] x5 : 000000000000bff4 x4 : 40000000fffff016 x3 : 0000000000000000
[    0.000000] x2 : 0000000000000000 x1 : 0000000040000000 x0 : ffff8000096caeb0
[    0.000000] Call trace:
[    0.000000]  show_pte+0x18c/0x238
[    0.000000]  do_mem_abort+0xa8/0xb0
[    0.000000]  el1_abort+0x40/0x6c
[    0.000000]  el1h_64_sync_handler+0xa4/0xd0
[    0.000000]  el1h_64_sync+0x78/0x7c
[    0.000000]  __memset+0x16c/0x188
[    0.000000]  __create_pgd_mapping+0x3a8/0x6a4
[    0.000000]  map_kernel_segment+0x74/0xdc
[    0.000000]  paging_init+0x104/0x538
[    0.000000]  setup_arch+0x274/0x5f0
[    0.000000]  start_kernel+0x84/0x650
[    0.000000]  __primary_switched+0xbc/0xc4
[    0.000000] Code: d0002700 913ac000 cb010294 b2503e94 (f8756a96)
[    0.000000] ---[ end trace 9139d3c3772f20bd ]---
[    0.000000] Kernel panic - not syncing: Attempted to kill the idle task!
[    0.000000] ---[ end Kernel panic - not syncing: Attempted to kill the idle task! ]---

 

 

After limiting the memory size, the error goes away:
u-boot=> edit mmcargs
edit: setenv bootargs ${jh_clk} ${mcore_clk} console=${console} root=${mmcroot} earlycon=ec_imx6q,0x30890000,115200 mem=5760MB

Then re-flattening the device tree with:
run mmcargs
run loadfdt
fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} uImage
spl export fdt ${loadaddr} - ${fdt_addr_r}
mmc write 0x43000000 0x2FAF080 0xAF

View solution in original post

0 Kudos
15 Replies
3,749 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

It should works on MX8MP please look When CONFIG_SPL_OS_BOOT is defined, SPL calls the
dram_init_banksize() function which causes an error resulting in a CPU reset and also take that you need modify the mx8mp-evk dtb according to the schematics.

regards

0 Kudos
3,733 Views
mengfei
Contributor III

Dear:

I’m implementing Falcon Mode using NXP’s app note AN13709. now i successful achieve spl jump to kernel but have below error messenge. can you read it and tell me how to deal? 

my best wishes for you

 mf

U-Boot SPL 2020.04 (Apr 20 2023 - 11:47:41 +0800)
spl_init
pmic_alloc: new pmic struct: 0x184000
pmic_get: pmic PCA9450 -> 0x184000
Bus: 0 PMIC:PCA9450 probed!
i2c_write_data: chip=0x25, len=0x0
write_data: 
i2c_write_data: chip=0x25, len=0x1
write_data:  0x29
i2c_write_data: chip=0x25, len=0x1
write_data:  0x1c
i2c_write_data: chip=0x25, len=0x1
write_data:  0x14
i2c_write_data: chip=0x25, len=0x1
write_data:  0x59
i2c_write_data: chip=0x25, len=0x1
write_data:  0x1c
i2c_write_data: chip=0x25, len=0x1
write_data:  0xa1
DDRINFO: start DRAM init
DDRINFO: cfg clk
DDRINFO: DRAM rate 4000MTS
DDRINFO: ddrc config start
DDRINFO: ddrc config done
DDRINFO:ddrphy config start
DRAM PHY training for 4000MTS
check ddr_pmu_train_imem code
check ddr_pmu_train_imem code pass
check ddr4_pmu_train_dmem code
check ddr_pmu_train_dmem code pass
[PMU Major message = 0x0000000d]
[PMU Major message = 0x00000000]
[PMU Major message = 0x00000002]
[PMU Major message = 0x00000001]
[PMU Major message = 0x0000000a]
[PMU Major message = 0x000000fd]
[PMU Major message = 0x000000fe]
[PMU Major message = 0x00000004]
[PMU Major message = 0x00000003]
[PMU Major message = 0x00000009]
[PMU Major message = 0x00000007]
Training PASS
DRAM PHY training for 400MTS
check ddr_pmu_train_imem code
check ddr_pmu_train_imem code pass
check ddr4_pmu_train_dmem code
check ddr_pmu_train_dmem code pass
[PMU Major message = 0x0000000d]
[PMU Major message = 0x00000000]
[PMU Major message = 0x00000002]
[PMU Major message = 0x00000001]
[PMU Major message = 0x000000fd]
[PMU Major message = 0x000000fe]
[PMU Major message = 0x00000004]
[PMU Major message = 0x00000003]
[PMU Major message = 0x00000009]
[PMU Major message = 0x00000007]
Training PASS
DRAM PHY training for 100MTS
check ddr_pmu_train_imem code
check ddr_pmu_train_imem code pass
check ddr4_pmu_train_dmem code
check ddr_pmu_train_dmem code pass
[PMU Major message = 0x0000000d]
[PMU Major message = 0x00000000]
[PMU Major message = 0x00000002]
[PMU Major message = 0x00000001]
[PMU Major message = 0x000000fd]
[PMU Major message = 0x000000fe]
[PMU Major message = 0x00000004]
[PMU Major message = 0x00000003]
[PMU Major message = 0x00000009]
[PMU Major message = 0x00000007]
Training PASS
DRAM PHY training for 4000MTS
check ddr_pmu_train_imem code
check ddr_pmu_train_imem code pass
check ddr4_pmu_train_dmem code
check ddr_pmu_train_dmem code pass
[PMU Major message = 0x00000000]
[PMU Major message = 0x00000005]
[PMU Major message = 0x00000005]
[PMU Major message = 0x00000006]
[PMU Major message = 0x00000006]
[PMU Major message = 0x00000007]
Training PASS
DDRINFO: ddrphy config done
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
>>SPL: board_init_r()
using memory lx-lx for malloc()
Normal Boot
Trying to boot from MMC1
clock is disabled (0Hz)
clock is enabled (400000Hz)
clock is enabled (400000Hz)
clock is enabled (50000000Hz)
spl: mmc boot mode: raw
spl_start_uboot retval :0 1:set define fault
load FDT file to RAM
hdr read sector ebf584, count=1
entry mmc_load_legacy function
SPL: payload image:                     Linux kernel load addr: 0x4047ffc0 size: 28013120
read d5ba sectors from 0xebf584 to 0x4047ffc0
ATF:read 0x60 sectors from 0xECDF80 to 0x970000
FDT-args:read 3d sectors from ebf520 to 43000000
Jumping to atf then linux
NOTICE:  BL31: v2.2(release):
NOTICE:  BL31: Built : 03:43:09, Apr 18 2023
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.4.70 (mengfei@ubuntu2004-17) (gcc version 9.2.0 (GCC)) #1 SMP PREEMPT Fri Apr 7 17:08:53 HKT 2023
[    0.000000] Machine model: NXP i.MX8MPlus LPDDR4 EVK board
[    0.000000] earlycon: ec_imx6q0 at MMIO 0x0000000030890000 (options '115200')
[    0.000000] printk: bootconsole [ec_imx6q0] enabled
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 320 MiB at 0x00000000ec000000
[    0.000000] NUMA: No NUMA configuration found
[    0.000000] NUMA: Faking a node at [mem 0x0000000040000000-0x00000001bfffffff]
[    0.000000] NUMA: NODE_DATA [mem 0x1bf3d6500-0x1bf3d7fff]
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000040000000-0x00000000ffffffff]
[    0.000000]   Normal   [mem 0x0000000100000000-0x00000001bfffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000040000000-0x00000001bfffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x00000001bfffffff]
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.1 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.1
[    0.000000] percpu: Embedded 24 pages/cpu s58904 r8192 d31208 u98304
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: detected: ARM erratum 845719
[    0.000000] CPU features: detected: GIC system register CPU interface
[    0.000000] Speculative Store Bypass Disable mitigation not required
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 1548288
[    0.000000] Policy zone: Normal
[    0.000000] Kernel command line: console=ttymxc1,115200 earlycon=ec_imx6q,0x30890000,115200
[    0.000000] Dentry cache hash table entries: 1048576 (order: 11, 8388608 bytes, linear)
[    0.000000] Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] software IO TLB: mapped [mem 0xe8000000-0xec000000] (64MB)
[    0.000000] Memory: 5745992K/6291456K available (16636K kernel code, 1244K rwdata, 6556K rodata, 2880K init, 1017K bss, 217784K reserved, 327680K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=4.
[    0.000000]  Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] GICv3: GIC: Using split EOI/Deactivate mode
[    0.000000] GICv3: 160 SPIs implemented
[    0.000000] GICv3: 0 Extended SPIs implemented
[    0.000000] GICv3: Distributor has no Range Selector support
[    0.000000] GICv3: 16 PPIs implemented
[    0.000000] GICv3: no VLPI support, no direct LPI support
[    0.000000] GICv3: CPU0: found redistributor 0 region 0:0x0000000038880000
[    0.000000] ITS: No ITS available, not enabling LPIs
[    0.000000] random: get_random_bytes called from start_kernel+0x2b8/0x44c with crng_init=0
[    0.000000] irq: no irq domain found for gpc@303a0000 !
[    0.000000] irq: no irq domain found for gpc@303a0000 !
[    0.000000] irq: no irq domain found for gpc@303a0000 !
[    0.000000] irq: no irq domain found for gpc@303a0000 !
[    0.000000] arch_timer: No interrupt available, giving up
[    0.000000] Failed to initialize '/timer': -22
[    0.000000] irq: no irq domain found for gpc@303a0000 !
[    0.000000] Failed to map interrupt for /soc@0/bus@30400000/timer@306a0000
[    0.000000] Failed to initialize '/soc@0/bus@30400000/timer@306a0000': -22
[    0.000000] timer_probe: no matching timers found
[    0.000000] Console: colour dummy device 80x25
[    0.000000] sched_clock: 64 bits at 250 Hz, resolution 4000000ns, wraps every 9007199254000000ns
[    0.000000] Calibrating delay loop (skipped), value calculated using timer frequency.. 16.00 BogoMIPS (lpj=32000)
[    0.000000] pid_max: default: 32768 minimum: 301
[    0.000000] LSM: Security Framework initializing
[    0.000000] Mount-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.000000] Mountpoint-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.000000] ASID allocator initialised with 32768 entries
[    0.000000] rcu: Hierarchical SRCU implementation.
[    0.000000] EFI services will not be available.
[    0.000000] smp: Bringing up secondary CPUs ...
[    0.000000] Detected VIPT I-cache on CPU1
[    0.000000] GICv3: CPU1: found redistributor 1 region 0:0x00000000388a0000
[    0.000000] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.000000] Detected VIPT I-cache on CPU2
[    0.000000] GICv3: CPU2: found redistributor 2 region 0:0x00000000388c0000
[    0.000000] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[    0.000000] Detected VIPT I-cache on CPU3
[    0.000000] GICv3: CPU3: found redistributor 3 region 0:0x00000000388e0000
[    0.000000] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[    0.000000] smp: Brought up 1 node, 4 CPUs
[    0.000000] SMP: Total of 4 processors activated.
[    0.000000] CPU features: detected: 32-bit EL0 Support
[    0.000000] CPU features: detected: CRC32 instructions
[    0.000000] CPU: All CPU(s) started at EL2
[    0.000000] alternatives: patching kernel code
[    0.000000] devtmpfs: initialized
[    0.000000] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.000000] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.000000] pinctrl core: initialized pinctrl subsystem
[    0.000000] DMI not present or invalid.
[    0.000000] NET: Registered protocol family 16
[    0.000000] DMA: preallocated 256 KiB pool for atomic allocations
[    0.000000] audit: initializing netlink subsys (disabled)
[    0.000000] audit: type=2000 audit(0.000:1): state=initialized audit_enabled=0 res=1
[    0.000000] cpuidle: using governor menu
[    0.000000] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.000000] Serial: AMBA PL011 UART driver
[    0.000000] imx mu driver is registered.
[    0.000000] imx rpmsg driver is registered.
[    0.000000] imx8mp-pinctrl 30330000.pinctrl: initialized IMX pinctrl driver
[    0.000000] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
[    0.000000] HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
[    0.000000] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.000000] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
[    0.000000] cryptd: max_cpu_qlen set to 1000
[    0.000000] ACPI: Interpreter disabled.
[    0.000000] iommu: Default domain type: Translated 
[    0.000000] vgaarb: loaded
[    0.000000] SCSI subsystem initialized
[    0.000000] usbcore: registered new interface driver usbfs
[    0.000000] usbcore: registered new interface driver hub
[    0.000000] usbcore: registered new device driver usb
[    0.000000] imx-i2c 30a20000.i2c: can't get irq number
[    0.000000] imx-i2c 30a30000.i2c: can't get irq number
[    0.000000] imx-i2c 30a40000.i2c: can't get irq number
[    0.000000] mc: Linux media interface: v0.10
[    0.000000] videodev: Linux video capture interface: v2.00
[    0.000000] pps_core: LinuxPPS API ver. 1 registered
[    0.000000] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.000000] PTP clock support registered
[    0.000000] EDAC MC: Ver: 3.0.0
[    0.000000] No BMan portals available!
[    0.000000] QMan: Allocated lookup table at (____ptrval____), entry count 65537
[    0.000000] No QMan portals available!
[    0.000000] No USDPAA memory, no 'fsl,usdpaa-mem' in device-tree
[    0.000000] FPGA manager framework
[    0.000000] Advanced Linux Sound Architecture Driver Initialized.
[    0.000000] Bluetooth: Core ver 2.22
[    0.000000] NET: Registered protocol family 31
[    0.000000] Bluetooth: HCI device and connection manager initialized
[    0.000000] Bluetooth: HCI socket layer initialized
[    0.000000] Bluetooth: L2CAP socket layer initialized
[    0.000000] Bluetooth: SCO socket layer initialized
[    0.000000] VFS: Disk quotas dquot_6.6.0
[    0.000000] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.000000] pnp: PnP ACPI: disabled
[    0.000000] thermal_sys: Registered thermal governor 'step_wise'
[    0.000000] thermal_sys: Registered thermal governor 'power_allocator'
[    0.000000] NET: Registered protocol family 2
[    0.000000] tcp_listen_portaddr_hash hash table entries: 4096 (order: 4, 65536 bytes, linear)
[    0.000000] TCP established hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.000000] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes, linear)
[    0.000000] TCP: Hash tables configured (established 65536 bind 65536)
[    0.000000] UDP hash table entries: 4096 (order: 5, 131072 bytes, linear)
[    0.000000] UDP-Lite hash table entries: 4096 (order: 5, 131072 bytes, linear)
[    0.000000] NET: Registered protocol family 1
[    0.000000] RPC: Registered named UNIX socket transport module.
[    0.000000] RPC: Registered udp transport module.
[    0.000000] RPC: Registered tcp transport module.
[    0.000000] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.000000] PCI: CLS 0 bytes, default 64
[    0.000000] kvm [1]: IPA Size Limit: 40bits
[    0.000000] kvm [1]: GICv3: no GICV resource entry
[    0.000000] kvm [1]: disabling GICv2 emulation
[    0.000000] kvm [1]: GIC system register CPU interface enabled
[    0.000000] kvm [1]: vgic interrupt IRQ1
[    0.000000] kvm [1]: kvm_arch_timer: uninitialized timecounter
[    0.000000] Initialise system trusted keyrings
[    0.000000] workingset: timestamp_bits=44 max_order=21 bucket_order=0
[    0.000000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.000000] NFS: Registering the id_resolver key type
[    0.000000] Key type id_resolver registered
[    0.000000] Key type id_legacy registered
[    0.000000] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.000000] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[    0.000000] 9p: Installing v9fs 9p2000 file system support
[    0.000000] Key type asymmetric registered
[    0.000000] Asymmetric key parser 'x509' registered
[    0.000000] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 244)
[    0.000000] io scheduler mq-deadline registered
[    0.000000] io scheduler kyber registered
[    0.000000] imx8mq-usb-phy 381f0040.usb-phy: failed to get imx8mq usb phy clock
[    0.000000] imx8mq-usb-phy: probe of 381f0040.usb-phy failed with error -2
[    0.000000] imx8mq-usb-phy 382f0040.usb-phy: failed to get imx8mq usb phy clock
[    0.000000] imx8mq-usb-phy: probe of 382f0040.usb-phy failed with error -2
[    0.000000] EINJ: ACPI disabled.
[    0.000000] i.MX8MP clock driver probe done
[    0.000000] mxs-dma 33000000.dma-apbh: initialized
[    0.000000] Bus freq driver module loaded
[    0.000000] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.000000] imx-uart 30890000.serial: failed to request irq: -22
[    0.000000] imx-uart: probe of 30890000.serial failed with error -22
[    0.000000] imx-lcdifv3 32e80000.lcd-controller: No irq get
[    0.000000] loop: module loaded
[    0.000000] imx ahci driver is registered.
[    0.000000] libphy: Fixed MDIO Bus: probed
[    0.000000] tun: Universal TUN/TAP device driver, 1.6
[    0.000000] thunder_xcv, ver 1.0
[    0.000000] thunder_bgx, ver 1.0
[    0.000000] nicpf, ver 1.0
[    0.000000] pps pps0: new PPS source ptp0
[    0.000000] fec 30be0000.ethernet: Invalid MAC address: 00:00:00:00:00:00
[    0.000000] fec 30be0000.ethernet: Using random MAC address: b6:a7:7b:fd:49:54
[    0.000000] Freescale FM module, FMD API version 21.1.0
[    0.000000] Freescale FM Ports module
[    0.000000] fsl_mac: fsl_mac: FSL FMan MAC API based driver
[    0.000000] fsl_dpa: FSL DPAA Ethernet driver
[    0.000000] fsl_advanced: FSL DPAA Advanced drivers:
[    0.000000] fsl_proxy: FSL DPAA Proxy initialization driver
[    0.000000] fsl_oh: FSL FMan Offline Parsing port driver
[    0.000000] hclge is initializing
[    0.000000] hns3: Hisilicon Ethernet Network Driver for Hip08 Family - version
[    0.000000] hns3: Copyright (c) 2017 Huawei Corporation.
[    0.000000] e1000: Intel(R) PRO/1000 Network Driver - version 7.3.21-k8-NAPI
[    0.000000] e1000: Copyright (c) 1999-2006 Intel Corporation.
[    0.000000] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
[    0.000000] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[    0.000000] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.6.0-k
[    0.000000] igb: Copyright (c) 2007-2014 Intel Corporation.
[    0.000000] igbvf: Intel(R) Gigabit Virtual Function Network Driver - version 2.4.0-k
[    0.000000] igbvf: Copyright (c) 2009 - 2012 Intel Corporation.
[    0.000000] sky2: driver version 1.30
[    0.000000] VFIO - User Level meta-driver version: 0.3
[    0.000000] dwc3 38100000.usb: Failed to get clk 'ref': -2
[    0.000000] dwc3 38200000.usb: Failed to get clk 'ref': -2
[    0.000000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.000000] ehci-pci: EHCI PCI platform driver
[    0.000000] ehci-platform: EHCI generic platform driver
[    0.000000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.000000] ohci-pci: OHCI PCI platform driver
[    0.000000] ohci-platform: OHCI generic platform driver
[    0.000000] usbcore: registered new interface driver uas
[    0.000000] usbcore: registered new interface driver usb-storage
[    0.000000] usbcore: registered new interface driver usbserial_generic
[    0.000000] usbserial: USB Serial support registered for generic
[    0.000000] usbcore: registered new interface driver ftdi_sio
[    0.000000] usbserial: USB Serial support registered for FTDI USB Serial Device
[    0.000000] usbcore: registered new interface driver usb_serial_simple
[    0.000000] usbserial: USB Serial support registered for carelink
[    0.000000] usbserial: USB Serial support registered for zio
[    0.000000] usbserial: USB Serial support registered for funsoft
[    0.000000] usbserial: USB Serial support registered for flashloader
[    0.000000] usbserial: USB Serial support registered for google
[    0.000000] usbserial: USB Serial support registered for libtransistor
[    0.000000] usbserial: USB Serial support registered for vivopay
[    0.000000] usbserial: USB Serial support registered for moto_modem
[    0.000000] usbserial: USB Serial support registered for motorola_tetra
[    0.000000] usbserial: USB Serial support registered for novatel_gps
[    0.000000] usbserial: USB Serial support registered for hp4x
[    0.000000] usbserial: USB Serial support registered for suunto
[    0.000000] usbserial: USB Serial support registered for siemens_mpi
[    0.000000] usbcore: registered new interface driver usb_ehset_test
[    0.000000] snvs_pwrkey: probe of 30370000.snvs:snvs-powerkey failed with error -22
[    0.000000] i2c /dev entries driver

 

Tags (1)
0 Kudos
3,745 Views
evanwilliams
Contributor II

Thanks for the reply!

I have prevented the CPU exception in dram_init_banksize().

I am at the end of the ATF in el3_exit, so the board is past SPL and is at the ATF->Kernel handoff. Usually this is to u-boot, but for Falcon mode, it's directly to the Kernel.

I have also validated the device tree file and that it is loaded into RAM correctly.

I can print the kernel entry point information at 0x40400000 and it matches the branch instruction that I expect for the first kernel instruction.
I also have dumped the device tree information at 0x43000000 and it matches what I expect too.

It's also worth noting that I'm using almost the latest source:
U-Boot SPL 2022.04 and ATF BL31 v2.6: lf-5.15.71-2.2.0-0g3c1583ba0

I'm going to try using an older version that matches the document: 5.10.72-2.2.0

0 Kudos
3,702 Views
mengfei
Contributor III
hello,
May I ask how your progress is now? Did you succeed in replacing the BSP version?
best wishes
0 Kudos
3,697 Views
evanwilliams
Contributor II

Hi mengfei,

Yes, but it was not successful.

See attached logs.

I noticed you're using a much older version than listed in the document.

Did you have to make any extra patches to ATF to get it to jump?

(The most obvious error in the 2021.04 logs is the "built" date of the ATF, however, it's correct since it's adjusted in the bb file and I did not do a manual build with this BSP version. The entry point would not have been adjusted without the patch being applied.)

I'm also attaching my "fixed up device tree" would you be able to attach yours?

I converted it to dts by using the command:
dtc -I dtb imx8mp-evk.dtb -O dts > imx8mp-evk.dts

0 Kudos
3,639 Views
mengfei
Contributor III

Dear,

I use lf-5.10.72-2.2.0 version.Now the log is below(too much messenges is because #define DEBUG)

image.png

to be honest,i feel that compared to 5.10.72, 5.4.70 is better 

Tags (1)
0 Kudos
3,646 Views
mengfei
Contributor III

hi evanwilliams,

In my country, github is restricted from accessing, When using yocto, the download speed of resource packages is very slow, so I manually compile them directly in the source code. When modifying the uboot source code of I.MX8MPlus according to the documentation provided by NXP, it is necessary to pay attention to the following modifications:

1. in uboot souce code path: /common/spl/spl. c ,the board_ init_ r() function, where case IH_ OS_ LINUX: section, modify the source code of the jump to kernel section, which must be changed to first jump to ATF

2. Modify bl31_early_platform_setup2() function in imx8mp_bl31_setup.c ,This function determines which ATF will jump to after startup. If your goal is to SPL ->ATF ->kernel, modify bl33_ image_ ep_ info.pc = 0x40480000; // RAM Kernel address, in this way, after executing atf, it will jump to address 0x40480000

Note: After compiling the kernel image to generate an Image, when creating a uImage using the mkimage image, the two parameters need to be 0x4047FFC0 and 0x40480000 I hope you can succeed in modifying according to the content I mentioned above. If you have any further questions, you can directly contact me at mengfei.work@outlook.com. If you have any progress, you can directly contact me. I am currently stuck in the subsequent kernel startup section and hope to work together to resolve any errors in the subsequent kernel startup section after I can help you enter the kernel

0 Kudos
3,654 Views
mengfei
Contributor III
The ATF part of the code determines whether you can successfully enter the kernel, so please ensure that this part of the code is successfully compiled and written according to the content you modified, otherwise it will not be possible to enter the kernel. It is recommended that you directly modify it in the source code and compile it into the TF card。I
Note:
I haven't modified any code in the device tree section. Are you sure you need to modify that
0 Kudos
3,372 Views
evanwilliams
Contributor II

Thanks so much for posting your logs, I found that I was missing an arg from the initial u-boot preventing early kernel UART prints!

I did this to get logs:

u-boot=> edit mmcargs
edit: setenv bootargs ${jh_clk} ${mcore_clk} console=${console} root=${mmcroot} earlycon=ec_imx6q,0x30890000,115200

I can now clearly see the issue:

 

 

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.15.71+g95448dd0dc9b (oe-user@oe-host) (aarch64-poky-linux-gcc (GCC) 11.3.0, GNU ld (GNU Binutils) 2.38.20220708) #1 SMP PREEMPT Wed Feb 8 03:38:28 UTC 2023
[    0.000000] Machine model: NXP i.MX8MPlus EVK board
[    0.000000] earlycon: ec_imx6q0 at MMIO 0x0000000030890000 (options '115200')
[    0.000000] printk: bootconsole [ec_imx6q0] enabled
[    0.000000] efi: UEFI not found.
[    0.000000] Memory doesn't fit in the linear mapping, VA_BITS too small
[    0.000000] Reserved memory: created CMA memory pool at 0x00000000c4000000, size 960 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] Reserved memory: created DMA memory pool at 0x0000000094300000, size 1 MiB
[    0.000000] OF: reserved mem: initialized node vdev0buffer@94300000, compatible id shared-dma-pool
[    0.000000] Unhandled fault at 0xfffffbfffda37000
[    0.000000] Mem abort info:
[    0.000000]   ESR = 0x96000043
[    0.000000]   EC = 0x25: DABT (current EL), IL = 32 bits
[    0.000000]   SET = 0, FnV = 0
[    0.000000]   EA = 0, S1PTW = 0
[    0.000000]   FSC = 0x03: level 3 address size fault
[    0.000000] Data abort info:
[    0.000000]   ISV = 0, ISS = 0x00000043
[    0.000000]   CM = 0, WnR = 1
[    0.000000] swapper pgtable: 4k pages, 48-bit VAs, pgdp=000000004222c000
[    0.000000] [fffffbfffda37000] pgd=00000000421a6003, p4d=00000000421a6003
[    0.000000] Unable to handle kernel paging request at virtual address ffff0000021a6ff8
[    0.000000] Mem abort info:
[    0.000000]   ESR = 0x96000004
[    0.000000]   EC = 0x25: DABT (current EL), IL = 32 bits
[    0.000000]   SET = 0, FnV = 0
[    0.000000]   EA = 0, S1PTW = 0
[    0.000000]   FSC = 0x04: level 0 translation fault
[    0.000000] Data abort info:
[    0.000000]   ISV = 0, ISS = 0x00000004
[    0.000000]   CM = 0, WnR = 0
[    0.000000] swapper pgtable: 4k pages, 48-bit VAs, pgdp=000000004222c000
[    0.000000] [ffff0000021a6ff8] pgd=0000000000000000, p4d=0000000000000000
[    0.000000] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 5.15.71+g95448dd0dc9b #1
[    0.000000] Hardware name: NXP i.MX8MPlus EVK board (DT)
[    0.000000] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    0.000000] pc : show_pte+0x18c/0x238
[    0.000000] lr : show_pte+0x15c/0x238
[    0.000000] sp : ffff800009c239a0
[    0.000000] x29: ffff800009c239a0 x28: ffff800009c32500 x27: ffff800009230000
[    0.000000] x26: 0000000000000000 x25: ffff800009daa000 x24: ffff800009947520
[    0.000000] x23: ffff80000983f000 x22: ffff800009e2c000 x21: 0000000000000ff8
[    0.000000] x20: ffff0000021a6000 x19: fffffbfffda37000 x18: ffffffffffffffff
[    0.000000] x17: 697461706d6f6320 x16: 2c30303030303334 x15: ffff800009db8820
[    0.000000] x14: 0000000000000010 x13: ffff800009c41f78 x12: 0000000000000042
[    0.000000] x11: 0000000000000016 x10: ffff800009c41f78 x9 : ffff800009c41f78
[    0.000000] x8 : 00000000ffffefff x7 : ffff800009c99f78 x6 : ffff800009c99f78
[    0.000000] x5 : 000000000000bff4 x4 : 40000000fffff016 x3 : 0000000000000000
[    0.000000] x2 : 0000000000000000 x1 : 0000000040000000 x0 : ffff8000096caeb0
[    0.000000] Call trace:
[    0.000000]  show_pte+0x18c/0x238
[    0.000000]  do_mem_abort+0xa8/0xb0
[    0.000000]  el1_abort+0x40/0x6c
[    0.000000]  el1h_64_sync_handler+0xa4/0xd0
[    0.000000]  el1h_64_sync+0x78/0x7c
[    0.000000]  __memset+0x16c/0x188
[    0.000000]  __create_pgd_mapping+0x3a8/0x6a4
[    0.000000]  map_kernel_segment+0x74/0xdc
[    0.000000]  paging_init+0x104/0x538
[    0.000000]  setup_arch+0x274/0x5f0
[    0.000000]  start_kernel+0x84/0x650
[    0.000000]  __primary_switched+0xbc/0xc4
[    0.000000] Code: d0002700 913ac000 cb010294 b2503e94 (f8756a96)
[    0.000000] ---[ end trace 9139d3c3772f20bd ]---
[    0.000000] Kernel panic - not syncing: Attempted to kill the idle task!
[    0.000000] ---[ end Kernel panic - not syncing: Attempted to kill the idle task! ]---

 

 

After limiting the memory size, the error goes away:
u-boot=> edit mmcargs
edit: setenv bootargs ${jh_clk} ${mcore_clk} console=${console} root=${mmcroot} earlycon=ec_imx6q,0x30890000,115200 mem=5760MB

Then re-flattening the device tree with:
run mmcargs
run loadfdt
fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} uImage
spl export fdt ${loadaddr} - ${fdt_addr_r}
mmc write 0x43000000 0x2FAF080 0xAF

0 Kudos
3,333 Views
mengfei
Contributor III

dear,

thank you very much for your reply. now i have also entry the kernel.

besh wishes 

3,347 Views
mengfei
Contributor III

how to go to the uboot? After compiling the uboot source code, the entire flash.bin image is only over 200 KB. How to go to uboot? by boot from emmc?

0 Kudos
3,332 Views
evanwilliams
Contributor II

The steps in the document compile in/out the CONFIG_SPL_OS_BOOT flag to switch in/out of u-boot console. I have two flash.bin that I flash to switch between u-boot console and falcon mode.

To run the FDT fixup commands, you must compile and flash without

include/configs/imx8mp_evk.h

#define CONFIG_SPL_OS_BOOT 1

Notice, because we are different versions, my "mem=" argument solution may not fix your issue.

0 Kudos
3,723 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

Please take a look at the i2C it must be something connected to PMIC that cause conflicts and you are right you must change the kernel version to see if that works as the appnote.

Regards

0 Kudos
3,393 Views
evanwilliams
Contributor II

Hi, using a JTAG, I found that the processor does appear to be jumping into the uImage kernel address.

Dumping the RAM, I can see the pointers in the uImage kernal RAM location are updated with the virtual address offset, KERNEL_RAM_VADDR.
The first one is swapper_pg_dir: 0xffff800008010800


Perhaps the UART is not initializing because the device tree is incorrect?
Is there anything else I can look at?

It appears I am past the ATF and am in uImage before getting UART output or mounting the rootfs.

I suspect I'm missing the device tree args. I have a flattened device tree, but no args?

0 Kudos
3,680 Views
evanwilliams
Contributor II

Please find the logs attached with i2c communications.
This is using 5.15.71-2.2.0
I was unsuccessful with the version listed in the document.

0 Kudos