This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM5728: What does the u-boot do more than running Linux

Part Number: AM5728
Other Parts Discussed in Thread: BEAGLEBOARD-X15

Hello, all.

Till today I was sure that the u-boot MINIMAL job is to bring up cpu and DDR, load DTB and Linux and run Linux telling to it where the DTB is.
I know that it can do much more services, but the most essential, minimal is the mentioned above.

It appears I am wrong!

I generated the u-boot which has no extra components except NAND, which is my case in my custom board. I do not need MMC, SPI, PCI, any of display options, etc.
My case is VERY simple - boot Linux from NANDs - that's it.

It appears that such a "minimalist" u-boot does not allow even the pre-built Linux images to start!!!
In short:
(my u-boot) + (pre-built DTB) + (pre-built kernel)  -> does not start kernel (nothing after "Starting kernel...")
(pre-built u-boot) + (pre-built DTB) + (pre-built kernel)  -> runs fine everything.

So, my question is: what should u-boot do for Linux to guarantee Linux to be fully functional?
Where can I find something explaining these aspects in details?

Many many thanks ahead.

  • Hi,

    Is your custom MLO and U-Boot coming to prompt? You will need UART initialisation, pinmux, pmic initialisation. So I would say start with working bootloader and then optimize.

    Best Regards,

    Keerthy

  • Thank you, Kerrthy.
    But as I stated in my post, I do come to prompt and I am able to load kernel via TFTP. But the kernel does not even starts.
    Please, note(!) my question: what should u-boot do for Linux to guarantee Linux to be FULLY functional?
    The kernel I compiled runs, but some features (for example - DSS) not appear although I configured them in '.config'. They appear only when I run pre-built u-boot!
    That's why is my question - what u-boot does for kernel more than just running it?

  • Leon,

    I would say try your custom u-boot with the prebuilt kernel. Does that have all the functionality? Have you tried that combination?

    Please attach the complete logs as a text file.

    Best Regards,

    Keerthy 

  • Dear Keerthy,

    Please, read my post!!!!

    I would say try your custom u-boot with the prebuilt kernel. Does that have all the functionality? Have you tried that combination?

    This is EXACTLY what I wrote at the question post!:

    (my u-boot) + (pre-built DTB) + (pre-built kernel)  -> does not start kernel (nothing after "Starting kernel...")


    Please, please, please - just answer the question if you can  - what u-boot needs provide to kernel, except RAM and UART?
    We see that kernel relies on some initializations done by u-boot (otherwise the kernel should start) - what are they, these initializations?

  • Leon,

    Apologies. Can you share the bootargs that you are using to boot Linux kernel?

    You need to convey the u-boot where to pick the kernel and dtb. You said you are using the tftp to load but could you please share the complete bootlogs? Also in your bootargs you could add earlycon to get some early prints.

    If you have fundamental U-boot questions I recommend checking in the mailing list: u-boot-bounces@lists.denx.de

    Best Regards,

    Keerthy

  • Thank you, Keerthy.

    Bootargs do not change. Nothing changes between tests, except u-boot.
    Kernel command line: console=ttyS2,115200n8 root=/dev/nfs ip=192.168.1.1:192.168.1.57:192.168.1.254:255.255.255.0::eth0:off nfsroot=192.168.1.57:/opt/FS_AM5728 rw noinitrd

    !!! Adding "earlycon" really provided some result, although I don't understand it....:-)

    So, again - pre-built u-boot works fine. Now I change pre-built to my u-boot only. This is the only change!
    Here is the log file of my u-boot with pre-built dtb and kernel:

    ================================================

    <13:45:55.901> U-Boot 2021.01.PLR (Aug 07 2022 - 16:01:49 +0300)eHDVR

    <13:45:55.901> Model: am5728-eHDVR
    <13:45:55.902> Board: eHDVR REV 1
    <13:45:55.902> DRAM: 1 GiB
    <13:45:55.952> NAND: 0 MiB
    <13:45:55.952> Loading Environment from NAND... *** Warning - readenv() failed, using default environment

    <13:45:55.953> No need in EEPROM
    <13:45:56.000> Net: eth2: ethernet@48484000
    <13:45:56.031> u-boot-eHDVR=>set ipaddr 192.168.1.1
    <13:45:56.111> u-boot-eHDVR=>PROJECT is 10516
    set ipNFS 192.168.1.57
    <13:45:58.521> u-boot-eHDVR=>set ipaddr 192.168.1.1
    <13:45:58.776> u-boot-eHDVR=>set netargs 'setenv bootargs console=ttyS2,115200n8 root=/dev/nfs ip=$ipaddr:$ipNFS:192.168.1.254:255.255.255.0::eth0:off n
    fsroot=$ipNFS:/opt/FS_AM5728 rw noinitrd earlycon'
    <13:45:59.493> u-boot-eHDVR=>set serverip $ipNFS
    <13:45:59.621> u-boot-eHDVR=>set netmask 255.255.255.0
    <13:45:59.828> u-boot-eHDVR=>set autoload no
    <13:46:00.022> u-boot-eHDVR=>set bootdelay 3
    <13:46:00.227> u-boot-eHDVR=>set uenvcmd 'setenv autoload no;tftp 0x82000000 am5728_zImage.bin;tftp 0x88000000 am5728_eHDVR.dtb;run netargs;bootz 0x8200
    0000 - 0x88000000'
    <13:46:00.865> u-boot-eHDVR=>run uenvcmd
    <13:46:01.204> link up on port 0, speed 1000, full duplex
    <13:46:01.204> Using ethernet@48484000 device
    <13:46:01.205> TFTP from server 192.168.1.57; our IP address is 192.168.1.1
    <13:46:01.205> Filename 'am5728_zImage.bin'.
    <13:46:01.219> Load address: 0x82000000
    <13:46:01.219> Loading: #################################################################
    <13:46:01.299> #################################################################
    <13:46:01.379> #################################################################
    <13:46:01.459> #################################################################
    <13:46:01.538> #######################################
    <13:46:01.570> 11.5 MiB/s
    <13:46:01.605> done
    <13:46:01.605> Bytes transferred = 4375040 (42c200 hex)
    <13:46:01.605> link up on port 0, speed 1000, full duplex
    <13:46:01.607> Using ethernet@48484000 device
    <13:46:01.607> TFTP from server 192.168.1.57; our IP address is 192.168.1.1
    <13:46:01.609> Filename 'am5728_eHDVR.dtb'.
    <13:46:01.609> Load address: 0x88000000
    <13:46:01.639> Loading: #######
    <13:46:01.639> 9.6 MiB/s
    <13:46:01.639> done
    <13:46:01.639> Bytes transferred = 90792 (162a8 hex)
    <13:46:01.641> ## Flattened Device Tree blob at 88000000
    <13:46:01.641> Booting using the fdt blob at 0x88000000
    <13:46:01.642> Loading Device Tree to bdf27000, end bdf402a7 ... OK

    <13:46:01.661> Starting kernel ...

    <13:46:03.591> [ 0.000000] Booting Linux on physical CPU 0x0
    <13:46:03.657> [ 0.000000] Linux version 4.19.94-rt39-ga242ccf3f1 (oe-user@oe-host) (gcc version 8.3.0 (GNU Toolchain for the A-profile Architecture
    8.3-2019.03 (arm-rel-8.36))) #1 SMP PREEMPT RT Sun Apr 19 02:32:36 UTC 2020
    <13:46:03.662> [ 0.000000] CPU: ARMv7 Processor [412fc0f2] revision 2 (ARMv7), cr=30c5387d
    <13:46:03.665> [ 0.000000] CPU: div instructions available: patching division code
    <13:46:03.667> [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
    <13:46:03.670> [ 0.000000] OF: fdt: Machine model: TI AM5728 BeagleBoard-X15
    <13:46:03.671> [ 0.000000] earlycon: omap8250 at MMIO 0x0000000048020000 (options '')
    <13:46:04.023> [ 0.000000] bootconsole [omap8250] enabled
    <13:46:04.023> [ 0.000000] Memory policy: Data cache writealloc
    <13:46:04.028> [ 0.000000] efi: Getting EFI parameters from FDT:
    <13:46:04.028> [ 0.000000] efi: UEFI not found.
    <13:46:04.032> [ 0.000000] Reserved memory: created CMA memory pool at 0x0000000095800000, size 56 MiB
    <13:46:04.035> [ 0.000000] OF: reserved mem: initialized node ipu2-memory@95800000, compatible id shared-dma-pool
    <13:46:04.041> [ 0.000000] Reserved memory: created CMA memory pool at 0x0000000099000000, size 64 MiB
    <13:46:04.047> [ 0.000000] OF: reserved mem: initialized node dsp1-memory@99000000, compatible id shared-dma-pool
    <13:46:04.055> [ 0.000000] Reserved memory: created DMA memory pool at 0x000000009d000000, size 32 MiB
    <13:46:04.058> [ 0.000000] OF: reserved mem: initialized node ipu1-memory@9d000000, compatible id shared-dma-pool
    <13:46:04.070> [ 0.000000] Reserved memory: created CMA memory pool at 0x000000009f000000, size 8 MiB
    <13:46:04.073> [ 0.000000] OF: reserved mem: initialized node dsp2-memory@9f000000, compatible id shared-dma-pool
    <13:46:04.076> [ 0.000000] cma: Reserved 24 MiB at 0x00000000be400000
    <13:46:04.076> [ 0.000000] OMAP4: Map 0x00000000bfd00000 to (ptrval) for dram barrier
    <13:46:04.078> [ 0.000000] On node 0 totalpages: 203776
    <13:46:04.080> [ 0.000000] DMA zone: 1728 pages used for memmap
    <13:46:04.081> [ 0.000000] DMA zone: 0 pages reserved
    <13:46:04.081> [ 0.000000] DMA zone: 139008 pages, LIFO batch:31
    <13:46:04.083> [ 0.000000] HighMem zone: 64768 pages, LIFO batch:15
    <13:46:04.084> [ 0.000000] Unable to handle kernel paging request at virtual address fdf27000
    <13:46:04.086> [ 0.000000] pgd = (ptrval)
    <13:46:04.086> [ 0.000000] [fdf27000] *pgd=80000080007003, *pmd=00000000
    <13:46:04.088> [ 0.000000] Internal error: Oops: 206 [#1] PREEMPT SMP ARM
    <13:46:04.089> [ 0.000000] Modules linked in:
    <13:46:04.089> [ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 4.19.94-rt39-ga242ccf3f1 #1
    <13:46:04.091> [ 0.000000] Hardware name: Generic DRA74X (Flattened Device Tree)
    <13:46:04.092> [ 0.000000] PC is at fdt_check_header+0xc/0x80
    <13:46:04.093> [ 0.000000] LR is at __unflatten_device_tree+0x28/0x10c
    <13:46:04.093> [ 0.000000] pc : [<c09f2640>] lr : [<c083892c>] psr: a00000d3
    <13:46:04.094> [ 0.000000] sp : c1201ea8 ip : c1201eb8 fp : c1201eb4
    <13:46:04.095> [ 0.000000] r10: c1293b90 r9 : 00000000 r8 : fdf27000
    <13:46:04.096> [ 0.000000] r7 : 00000000 r6 : 00000000 r5 : c1032380 r4 : c1032380
    <13:46:04.097> [ 0.000000] r3 : c1032380 r2 : c1293b90 r1 : 00000000 r0 : fdf27000
    <13:46:04.097> [ 0.000000] Flags: NzCv IRQs off FIQs off Mode SVC_32 ISA ARM Segment user
    <13:46:04.098> [ 0.000000] Control: 30c5387d Table: 80003000 DAC: fffffffd
    <13:46:04.098> [ 0.000000] Process swapper (pid: 0, stack limit = 0x(ptrval))
    <13:46:04.099> [ 0.000000] Stack: (0xc1201ea8 to 0xc1202000)
    <13:46:04.100> [ 0.000000] 1ea0: c1201ee4 c1201eb8 c083892c c09f2640 c1032380 c1032380
    <13:46:04.100> [ 0.000000] 1ec0: bfd00000 00000000 c120b7b8 c1284300 c1255f00 c1042120 c1201f04 c1201ee8
    <13:46:04.101> [ 0.000000] 1ee0: c1033458 c0838910 00000000 c1201ef8 c0233e54 c120a100 c1201f94 c1201f08
    <13:46:04.102> [ 0.000000] 1f00: c1004c38 c1033428 00000000 00000000 00000000 00000000 ffffffff c0286a7c
    <13:46:04.103> [ 0.000000] 1f20: c0dbfd0c c1042120 00000000 fffff000 c1220568 bfcfffff c1201f94 c1201f48
    <13:46:04.104> [ 0.000000] 1f40: c1014afc c0a011c0 c1207488 00000000 30c0387d c1207480 c1201f84 c1201f68
    <13:46:04.105> [ 0.000000] 1f60: c02871fc 00000000 c1201f8c 00000000 00000000 30c0387d c1207480 00000000
    <13:46:04.105> [ 0.000000] 1f80: 412fc0f2 c1207488 c1201ff4 c1201f98 c1000a28 c100423c 00000000 00000000
    <13:46:04.106> [ 0.000000] 1fa0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 c104aa38
    <13:46:04.107> [ 0.000000] 1fc0: 00000000 00000000 00000000 c1000330 00000000 30c0387d 00000000 bdf27000
    <13:46:04.108> [ 0.000000] 1fe0: 412fc0f2 30c5387d 00000000 c1201ff8 00000000 c10009c0 00000000 00000000
    <13:46:04.109> [ 0.000000] Backtrace:
    <13:46:04.109> [ 0.000000] [<c09f2634>] (fdt_check_header) from [<c083892c>] (__unflatten_device_tree+0x28/0x10c)
    <13:46:04.110> [ 0.000000] [<c0838904>] (__unflatten_device_tree) from [<c1033458>] (unflatten_device_tree+0x3c/0x4c)
    <13:46:04.111> [ 0.000000] r10:c1042120 r9:c1255f00 r8:c1284300 r7:c120b7b8 r6:00000000 r5:bfd00000
    <13:46:04.111> [ 0.000000] r4:c1032380 r3:c1032380
    <13:46:04.111> [ 0.000000] [<c103341c>] (unflatten_device_tree) from [<c1004c38>] (setup_arch+0xa08/0xc30)
    <13:46:04.113> [ 0.000000] r4:c120a100
    <13:46:04.113> [ 0.000000] [<c1004230>] (setup_arch) from [<c1000a28>] (start_kernel+0x74/0x488)
    <13:46:04.113> [ 0.000000] r10:c1207488 r9:412fc0f2 r8:00000000 r7:c1207480 r6:30c0387d r5:00000000
    <13:46:04.114> [ 0.000000] r4:00000000
    <13:46:04.115> [ 0.000000] [<c10009b4>] (start_kernel) from [<00000000>] ( (null))
    <13:46:04.115> [ 0.000000] r10:30c5387d r9:412fc0f2 r8:bdf27000 r7:00000000 r6:30c0387d r5:00000000
    <13:46:04.116> [ 0.000000] r4:c1000330
    <13:46:04.116> [ 0.000000] Code: e89da800 e1a0c00d e92dd800 e24cb004 (e5903000)
    <13:46:04.117> [ 0.000000] ---[ end trace 0000000000000001 ]---
    <13:46:04.118> [ 0.000000] Kernel panic - not syncing: Attempted to kill the idle task!

    ==================================================================

    Please, what does it says to you? Why it fails on unflatten device tree? All the addresses in both cases are the same - no change anywhere!
    It will be really great from your side to explain!

    Many many thanks!

  • Thank you, Keerthy.
    It seems I have found the solution although I do not understand how it works.
    I found in the internet, that setting "set fdt_high 0xffffffffffffffff" in u-boot may help.
    AND IT REALLY HELPED!
    Now, my u-boot loads any kernel.
    THANK YOU VERY MUCH!!!!!