Hi, Thanks for responses, some more info: - imx8mp based system, 1Gb LPDDR, uses same PMIC as other boards (PCA9450) - barebox master - u-boot is NXP fork - kernel is NXP fork, 5.15.31 > > I'm trying to get barebox going for a new imx8mp based board. I can > > successfully power on and get to a barebox prompt etc and fiddle with > > gpios, files on sd, memtest etc, but when booting to kernel it will hang. > > Note though that the board boots ok with u-boot (using exact same kernel > > image). > Do you have an example crash dump? Does the kernel crash reproducibly or > randomly? It always hangs at the same point in the kernel boot sequence (see "startup- log-barebox.txt"). You can also see "startup-log-u-boot.txt" for the output of a complete boot. If i change some kernel config options the boot progresses further, and when CONFIG_ARM_IMX_CPUFREQ_DT=n and CONFIG_IMX_SDMA=n then it will get to systemd starting. > > > > I'm trying to figure out what is different between booting via uboot and > > barebox, I'm new to imx8 so have been going down a few rabbit holes... > > > > Disabling various drivers (eg imx-cpufreq-dt) in the kernel will get past > > the hang, but result in a crash later on in the boot sequence. Disabling > > that may get further but will result in a crash somewhere else. > > My instinct is that its something to do with sdma, but a lot of this is > > still a black box to me. > > SDMA is only used in few devices like UART, I2C, SPI and sound. Apart from > sound all devices should work without SDMA, so you could disable the > driver. I was getting (after disabling some things in kernel) crash traces in sdma_transfer_init etc, which is what made me suspect it. (see startup-log- barebox-after-kernel-change1.txt) Disabling the driver does indeed avoid this crash. > PMIC comes to my mind. Does it need some configuration? The PMIC has the same register/value writes as in the u-boot version. > Is the amount of memory detected correctly by barebox? Barebox detects 1Gb, correct I did a compare of the startup logs (The cuts are to remove the timestamps) ```kompare <(diff <(cut -c 15- startup-log-u-boot.txt) <(cut -c 15- startup- log-barebox.txt))``` I noticed some differences in the 'reserved mem' at the start and the 'NUMA' early memory node ranges. When booting from u-boot I get: [ 0.000000] Reserved memory: created CMA memory pool at 0x0000000060000000, size 512 MiB [ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool But when booting from barebox: [ 0.000000] OF: reserved mem: failed to allocate memory for node 'linux,cma' [ 0.000000] Reserved memory: created DMA memory pool at 0x0000000055400000, size 1 MiB For the early node ranges: from u-boot: [ 0.000000] NUMA: NODE_DATA [mem 0x5fdba800-0x5fdbcfff] [ 0.000000] Zone ranges: [ 0.000000] DMA [mem 0x0000000040000000-0x000000007fffffff] [ 0.000000] DMA32 empty [ 0.000000] Normal empty [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000040000000-0x0000000054ffffff] [ 0.000000] node 0: [mem 0x0000000055000000-0x000000005500ffff] [ 0.000000] node 0: [mem 0x0000000055010000-0x00000000550fefff] [ 0.000000] node 0: [mem 0x00000000550ff000-0x00000000550fffff] [ 0.000000] node 0: [mem 0x0000000055100000-0x00000000553fffff] [ 0.000000] node 0: [mem 0x0000000055400000-0x00000000554fffff] [ 0.000000] node 0: [mem 0x0000000055500000-0x0000000055ffffff] [ 0.000000] node 0: [mem 0x0000000058000000-0x000000007fffffff] and from barebox: [ 0.000000] NUMA: NODE_DATA [mem 0x7fdaa800-0x7fdacfff] [ 0.000000] Zone ranges: [ 0.000000] DMA [mem 0x0000000040000000-0x000000007fffffff] [ 0.000000] DMA32 empty [ 0.000000] Normal empty [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000040000000-0x0000000054ffffff] [ 0.000000] node 0: [mem 0x0000000055000000-0x000000005500ffff] [ 0.000000] node 0: [mem 0x0000000055010000-0x00000000550fefff] [ 0.000000] node 0: [mem 0x00000000550ff000-0x00000000550fffff] [ 0.000000] node 0: [mem 0x0000000055100000-0x00000000553fffff] [ 0.000000] node 0: [mem 0x0000000055400000-0x00000000554fffff] [ 0.000000] node 0: [mem 0x0000000055500000-0x000000007fffffff] Notably there is an range in the u-boot ranges which creates a gap from 0x56000000 to 0x57ffffff (32Mb). I'm wondering how this difference comes about when both bootloaders are booting the same devicetree and kernel image? Cheers Marc