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.

Linux/AM5716: Booting kernel via UART

Part Number: AM5716
Other Parts Discussed in Thread: TPD12S015

Tool/software: Linux

Hello,

             I am using a custom board with Sitara AM5716. I have loaded the SPL and U-Boot binaries via UART successfully. Now I need to load kernel too using UART . Can you guide me how I can achieve this? My board doesn't have ethernet or USB interface. Also no SD card interface. My boot does have an eMMC  and a QSPI flash memory. But how will I copy kernel image to these memory from outside via UART.

I have followed the steps in http://processors.wiki.ti.com/index.php/Linux_Kernel_Users_Guide   and successfully compiled the zImage. But how will sent the file via uart to boot the kernel. ??

  • Nithin,

    You should use the same approach as u-boot binary. Load kernel image binary through UART into DDR memory (same as u-boot binary) then flash kernel image from DDR memory to eMMC/QSPI at the correct offset.

    Regards,
    Pavel
  • Okay. I tried the 'loadb' command to download the 'zImage' file and then executed the bootz command to boot the kernel. The terminal screen just freezed after that. I am trying to run on custom board with AM5716. For Uboot , I modified the pin mux file and emif configuration to make it boot on Custom boot. Similarly for linux kernel, where all should I modify to make it work? 

    Kindly help

  • Nithin Prasanth KP said:
    Okay. I tried the 'loadb' command to download the 'zImage' file and then executed the bootz command to boot the kernel. The terminal screen just freezed after that.

    Please provide full console log. Check also the below wiki page:

    http://processors.wiki.ti.com/index.php/Linux_Core_U-Boot_User's_Guide#Using_UART

    Nithin Prasanth KP said:
    For Uboot , I modified the pin mux file and emif configuration to make it boot on Custom boot. Similarly for linux kernel, where all should I modify to make it work? 

    Besides MMC, there is no other pinmux that should be done in kernel, all the pinmux is done in SPL. Also there are no EMIF configurations in kernel, only in u-boot.

    Regards,
    Pavel

  • I am loading the spl using the perl script as mentioned in  "AM57_UART_Boot_SOP_By_TI_Rio_Final.pdf"  in https://e2e.ti.com/support/arm/sitara_arm/f/791/t/549800 and send the U-boot binary via Y-modem using Teraterm to get the U-boot boot screen.

    The kernel build using  kernel source in "ti-processor-sdk-linux-am57xx-evm-04.02.00.09-Linux" using 'tisdk_am57xx-evm_defconfig. and then the compiled zImage is loaded in U-Boot boot using the following commands ::

    => loadb 0x90000000
    ## Ready for binary (kermit) download to 0x90000000 at 115200 bps...  

    Then I will send the zImage via kermit protocol using teraterm and when it finishes I use the bootz command

    CACHE: Misaligned operation at range [90000000, 90394258]
    ## Total Size = 0x00394258 = 3752536 Bytes
    ## Start Addr = 0x90000000

    => bootz 0x90000000

    Starting kernel ...

    Screen freezes after this.

    So is my steps correct and also should I separately load 'dtb' file too. ??

    Kindly help

  • => loadb 91000000

    ## Ready for binary (kermit) download to 0x91000000 at 115200 bps...

    CACHE: Misaligned operation at range [91000000, 9101a04a]

    ## Total Size      = 0x0001a04a = 106570 Bytes

    ## Start Addr      = 0x91000000

    => bootz 90000000 - 91000000

    ## Flattened Device Tree blob at 91000000

      Booting using the fdt blob at 0x91000000

      Loading Device Tree to 8ffe2000, end 8ffff049 ... OK

    Starting kernel ...

     

    After loading the device tree also, I am facing the same issue. what's the boot arguments (bootargs) , I need for this boot. 

    Kindly help

  • Nithin,

    First of all, why you need to boot kernel from UART? Note that even when you succeed, then you will face the rootfs issue.

    At your first post, I though that your main purpose is to flash kernel in QSPI/eMMC from UART. For this purpose you do not need to boot kernel from UART. You need to load kernel in DDR3 memory from UART, then you can flash the kernel from DDR3 memory to QSPI/eMMC in u-boot stage.

    Regards,
    Pavel
  • Pavel,
    My task is to test all the hardware peripherals in the custom board like QSPI, mmc, DDR, I2C etc. I tested all these in U-boot itself. Now I need to test PCIe interface . For this peripheral , I thought , I will load kernel and test it.

    Hence I prefer to load the kernel via UART and test the PCIe interface. Now if loading kernel using QSPI is easier, could guide me the steps.


    Regards,
    Nithin
  • Nithin,

    Regarding UART boot, you can also load kernel/dtb, but then rootfs should be loaded over ethernet/nfs. Refer to the below pointers for details, bootargs are also explained.

    e2e.ti.com/.../1849972
    processors.wiki.ti.com/.../DRA7xx_GLSDK_Software_Developers_Guide

    Regarding PCIe module testing from user space, the easiest way is to boot from MMC/SD card, which should be created with the create-sdcard.sh script.

    processors.wiki.ti.com/.../Processor_SDK_Linux_create_SD_card_script

    Regards,
    Pavel

  • Pavel,
    I don't have SD card in my board. can I use the same script for eMMC card in my board. I don't feel so. And also, there is no ethernet interface too in my board for loading rootfs via ethernet. Hope you now undestood my hardship to boot kernel since there is no sd card/ethernet/usb interface.
    Also can you guide me how to create rootfs in ram(reamdisk) itself and pass it in bootargs.


    Regards,
    Nithin
  • Nithin,

    Nithin Prasanth KP said:
    I don't have SD card in my board. can I use the same script for eMMC card in my board. I don't feel so. And also, there is no ethernet interface too in my board for loading rootfs via ethernet.

    For how to boot from eMMC or QSPI, refer the below wiki pages:

    Nithin Prasanth KP said:
    Also can you guide me how to create rootfs in ram(reamdisk) itself and pass it in bootargs.

    I will check and come back to you.

    Regards,
    Pavel

  • Pavel,
    Thanks for your inputs. But I am still stuck at this during kernel booting via UART ::

    => bootz 0x80300000 - 0x825f0000
    ## Flattened Device Tree blob at 825f0000
    Booting using the fdt blob at 0x825f0000
    Loading Device Tree to 83fe2000, end 83fff049 ... OK

    Starting kernel ...


    Why do you think the kernel boot hangs at this point. ??
  • Pavel,

     My current status of Linux kernel loading via UART in my custom board is without rootfs is  :;

    [ 67.349133] Registering SWP/SWPB emulation handler
    [ 67.366089] dmm 4e000000.dmm: workaround for errata i878 in use
    [ 67.373708] dmm 4e000000.dmm: initialized all PAT entries
    [ 67.380596] omapdss_dss 58000000.dss: master bind failed: -517
    [ 67.386747] tpd12s015 encoder@0: failed to find video source
    [ 67.392751] connector-hdmi connector@0: failed to find video source
    [ 67.399968] omap_hsmmc 4809c000.mmc: Got CD GPIO
    [ 67.405916] omap_hsmmc 480b4000.mmc: no pinctrl state for sdr25 mode
    [ 67.412359] omap_hsmmc 480b4000.mmc: no pinctrl state for sdr12 mode
    [ 67.419581] hctosys: unable to open rtc device (rtc0)
    [ 67.425374] pbias_mmc_omap5: disabling
    [ 67.429239] ALSA device list:
    [ 67.432217] No soundcards found.
    [ 67.436863] List of all partitions:
    [ 67.440431] 0100 8192 ram0 [ 67.444018] (driver?)
    [ 67.446398] 1f00 256 mtdblock0 [ 67.450510] (driver?)
    [ 67.452886] 1f01 1024 mtdblock1 [ 67.456908] (driver?)
    [ 67.459410] 1f02 512 mtdblock2 [ 67.463433] (driver?)
    [ 67.465806] 1f03 64 mtdblock3 [ 67.469881] (driver?)
    [ 67.472256] 1f04 64 mtdblock4 [ 67.476278] (driver?)
    [ 67.478667] 1f05 8192 mtdblock5 [ 67.482689] (driver?)
    [ 67.485061] 1f06 22656 mtdblock6 [ 67.489098] (driver?)
    [ 67.491468] No filesystem could mount root, tried: [ 67.496188] ext3
    ext2[ 67.498582] ext4
    squashfs[ 67.501308] vfat
    msdos[ 67.503772] ntfs
    [ 67.505703]
    [ 67.507216] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
    [ 67.515525] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)

     

    So I tried the links you have mentioned above for creating RAMDISK. I copied the file system provided with the latest SDK ( "arago-base-tisdk-image-am57xx-evm.tar.xz" ) into the RAMDISK. Now my rootfs is of size 80MB. It takes almost 5 hours for me to load it it RAM via UART using kermit protocol. Do you have any small sized RAMdisk image which I can directly load for booting kernel. I tried some files and I am getting the wrong image error. Please see the console logs::

    => pri bootargs
    bootargs=console=ttyS2,115200n8 root=/dev/ram0 rw initrd=0xc1180000,128M
    => setenv bootargs 'console=ttyS2,115200n8 root=/dev/ram0 rw'
    => bootm 0x82000000 0x88080000 0x88000000
    ## Booting kernel from Legacy Image at 82000000 ...
    Image Name: Linux-4.9.59-ga75d8e9305
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 3752872 Bytes = 3.6 MiB
    Load Address: 80008000
    Entry Point: 80008000
    Verifying Checksum ... OK
    Wrong Ramdisk Image Format
    Ramdisk image is corrupt or invalid
    => setenv bootargs 'console=ttyS2,115200n8 root=/dev/ram0 rw initrd=0x88080000,128M'
    => bootm 0x82000000 0x88080000 0x88000000
    ## Booting kernel from Legacy Image at 82000000 ...
    Image Name: Linux-4.9.59-ga75d8e9305
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 3752872 Bytes = 3.6 MiB
    Load Address: 80008000
    Entry Point: 80008000
    Verifying Checksum ... OK
    Wrong Ramdisk Image Format
    Ramdisk image is corrupt or invalid
    => setenv bootargs 'mem=256M console=ttyS2,115200n8 root=/dev/ram0 rw initrd=0x88080000,128M'
    => bootm 0x82000000 0x88080000 0x88000000
    ## Booting kernel from Legacy Image at 82000000 ...
    Image Name: Linux-4.9.59-ga75d8e9305
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 3752872 Bytes = 3.6 MiB
    Load Address: 80008000
    Entry Point: 80008000
    Verifying Checksum ... OK
    Wrong Ramdisk Image Format
    Ramdisk image is corrupt or invalid

     

     

    Also can you verify the bootargs .?? 

     

  • Nithin Prasanth KP said:
    => setenv bootargs 'console=ttyS2,115200n8 root=/dev/ram0 rw initrd=0x88080000,128M'

    At which DDR addr exactly you load the ramdisk image? Is it 0x88080000?

    Please refer to the below e2e threads:

    Regards,
    Pavel

  • Address of each binaries loaded into RAM and bootargs set are as follows :

    Kernel
    loadb 0x82000000

    DTB
    loadb 0x88000000

    Ramdisk
    loadb 0x88080000

    bootm 0x82000000 0x88080000 0x88000000

    setenv bootargs 'console=ttyS2,115200n8 root=/dev/ram0 rw initrd=0x88080000,8M'

    Is my steps correct ??

    Also is it possible to get gforge.ti.com/.../sitara_flasher_initramfs_v1.1.tar.gz . The link seems dead. Will this file system help ??

  • Nithin Prasanth KP said:
    setenv bootargs 'console=ttyS2,115200n8 root=/dev/ram0 rw initrd=0x88080000,8M'

    You can add "ramdisk_size" parameter.

    linux-4.9.59/Documentation/kernel-parameters.txt

    linux-4.9.59/Documentation/blockdev/ramdisk.txt

    Nithin Prasanth KP said:
    bootm 0x82000000 0x88080000 0x88000000

    Can you try with the below order. Is there any difference?

    bootm 0x82000000 0x88000000 0x88080000

    Note also that with zImage, bootz (not bootm) should be used. Please try the below format:

    U-Boot # bootz ${loadaddr} - ${fdtaddr}

    where loadaddr=0x82000000, fdtaddr=0x88000000

    For creating the ramdisk image, make sure you are using mkimage tool, see below e2e thread:

    https://e2e.ti.com/support/arm/sitara_arm/f/791/t/276731

  • Hi Pavel,
    Steps we used for loading kernel on the board are ::
    I was able to boot my custom board using ROOTFS 'initramfs.cpio.gz' from the link : images.validation.linaro.org/.../
    After loading the Kernel image, DTB and RootFS to RAM using loadb commands. Now bootm command is send to boot the board . For eg :
    => bootm 0x92000000 0xA8080000:0x00BDA164 0x98000000
    where 0x92000000 - Linux kernel location

    0xA8080000 - RootFs location
    0x00BDA164 - RootFS size

    0x98000000 - Device Tree Blob Location

    No where in the documentation of TI,I noticed the field ramdisk_size in the bootm command
    : => bootm ${kernel_addr} ${ramdisk_addr} :${ramdisk_size} ${fdt_addr}
     Can you include it in your documentation? I found this by browsing the u-boot code.


    Now  during linux boot in my console log , I am getting the following error ::

    [64.211207] irq 219: nobody cared (try booting with the "irqpoll" option)
    [ 64.211222] CPU: 0 PID: 23 Comm: irq/219-palmas Not tainted 4.9.59-ga75d8e9305 #24
    [ 64.211230] Hardware name: Generic DRA72X (Flattened Device Tree)
    [ 64.211237] Backtrace:
    [ 64.211261] [<c020b29c>] (dump_backtrace) from [<c020b558>] (show_stack+0x18/0x1c)
    [ 64.211272] r7:000000db r6:20000193 r5:00000000 r4:c1022728
    [ 64.211289] [<c020b540>] (show_stack) from [<c04dd980>] (dump_stack+0x8c/0xa0)
    [ 64.211304] [<c04dd8f4>] (dump_stack) from [<c0282728>] (__report_bad_irq+0x30/0xd4)
    [ 64.211314] r7:000000db r6:ef22e810 r5:00000000 r4:ef22e800
    [ 64.211327] [<c02826f8>] (__report_bad_irq) from [<c0282b40>] (note_interrupt+0x294/0x2e4)
    [ 64.211338] r9:20000193 r8:00000001 r7:000000db r6:ef22e810 r5:00000000 r4:ef22e800
    [ 64.211350] [<c02828ac>] (note_interrupt) from [<c027fdcc>] (handle_irq_event_percpu+0x54/0x60)
    [ 64.211360] r10:00000000 r9:20000193 r8:00000001 r7:ef22b210 r6:ef22e810 r5:ef22e800
    [ 64.211367] r4:00000002 r3:00000000
    [ 64.211378] [<c027fd78>] (handle_irq_event_percpu) from [<c027fe18>] (handle_irq_event+0x40/0x64)
    [ 64.211386] r5:ef22e860 r4:ef22e800
    [ 64.211397] [<c027fdd8>] (handle_irq_event) from [<c0283384>] (handle_level_irq+0xb4/0x138)
    [ 64.211405] r7:ef22b210 r6:ef22e810 r5:ef22e860 r4:ef22e800
    [ 64.211417] [<c02832d0>] (handle_level_irq) from [<c027ef30>] (generic_handle_irq+0x2c/0x3c)
    [ 64.211425] r7:ef22b210 r6:ef22b268 r5:ef22b264 r4:00000010
    [ 64.211439] [<c027ef04>] (generic_handle_irq) from [<c0521bd8>] (omap_gpio_irq_handler+0x134/0x174)
    [ 64.211451] [<c0521aa4>] (omap_gpio_irq_handler) from [<c027fcf4>] (__handle_irq_event_percpu+0xb4/0x138)
    [ 64.211461] r10:c104deae r9:ef228700 r8:000000ca r7:ef343dbc r6:00000000 r5:ef228700
    [ 64.211467] r4:ef2317c0
    [ 64.211478] [<c027fc40>] (__handle_irq_event_percpu) from [<c027fd9c>] (handle_irq_event_percpu+0x24/0x60)
    [ 64.211488] r10:c0280e68 r9:ef342000 r8:ef006000 r7:00000000 r6:c10228f0 r5:ef228700
    [ 64.211494] r4:ef228700
    [ 64.211504] [<c027fd78>] (handle_irq_event_percpu) from [<c027fe18>] (handle_irq_event+0x40/0x64)
    [ 64.211511] r5:ef228760 r4:ef228700
    [ 64.211522] [<c027fdd8>] (handle_irq_event) from [<c02834c8>] (handle_fasteoi_irq+0xc0/0x190)
    [ 64.211531] r7:00000000 r6:c10228f0 r5:ef228760 r4:ef228700
    [ 64.211541] [<c0283408>] (handle_fasteoi_irq) from [<c027ef30>] (generic_handle_irq+0x2c/0x3c)
    [ 64.211549] r7:00000000 r6:00000000 r5:000000ca r4:c0e5cde0
    [ 64.211559] [<c027ef04>] (generic_handle_irq) from [<c027f4a4>] (__handle_domain_irq+0x64/0xbc)
    [ 64.211570] [<c027f440>] (__handle_domain_irq) from [<c02014a0>] (gic_handle_irq+0x40/0x7c)
    [ 64.211579] r9:ef342000 r8:fa213000 r7:fa212000 r6:ef343e78 r5:fa21200c r4:c1003424
    [ 64.211589] [<c0201460>] (gic_handle_irq) from [<c020c0f8>] (__irq_svc+0x58/0x8c)
    [ 64.211596] Exception stack(0xef343e78 to 0xef343ec0)
    [ 64.211603] 3e60: ef22e860 a0000093
    [ 64.211613] 3e80: ef22e800 000093e9 ef22e800 ef22e860 ef333580 ef22e810 ef22e800 ef333580
    [ 64.211622] 3ea0: c0280e68 ef343ed4 ef343ed8 ef343ec8 c0280d88 c08e4218 20000013 ffffffff
    [ 64.211631] r9:ef342000 r8:ef22e800 r7:ef343eac r6:ffffffff r5:20000013 r4:c08e4218
    [ 64.211646] [<c08e41f0>] (_raw_spin_unlock_irq) from [<c0280d88>] (irq_finalize_oneshot.part.1+0x84/0xe0)
    [ 64.211657] [<c0280d04>] (irq_finalize_oneshot.part.1) from [<c0280ebc>] (irq_thread_fn+0x54/0x5c)
    [ 64.211665] r7:00000001 r6:00000000 r5:ef22e800 r4:ef333580
    [ 64.211676] [<c0280e68>] (irq_thread_fn) from [<c0281198>] (irq_thread+0x140/0x1f8)
    [ 64.211684] r7:00000001 r6:00000000 r5:ef3335a4 r4:ef342000
    [ 64.211696] [<c0281058>] (irq_thread) from [<c024adb0>] (kthread+0x100/0x118)
    [ 64.211706] r10:00000000 r9:00000000 r8:c0281058 r7:ef333580 r6:ef342000 r5:ef3335c0
    [ 64.211712] r4:00000000
    [ 64.211723] [<c024acb0>] (kthread) from [<c0207c88>] (ret_from_fork+0x14/0x2c)
    [ 64.211732] r8:00000000 r7:00000000 r6:00000000 r5:c024acb0 r4:ef3335c0
    [ 64.211738] handlers:
    [ 64.211745] [<c027fe90>] irq_default_primary_handler threaded [<c0653594>] regmap_irq_thread
    [ 64.211762] Disabling IRQ #219
    [ 64.212704] palmas 0-0058: Muxing GPIO 2b, PWM 0, LED 0
    [ 64.215891] SMPS3: supplied by VMAIN
    [ 64.219245] SMPS6: supplied by VMAIN
    [ 64.220936] SMPS7: supplied by VMAIN
    [ 64.222770] SMPS8: supplied by VMAIN
    [ 64.224069] SMPS9: supplied by VMAIN
    [ 64.224407] smps9: Bringing 0uV into 3300000-3300000uV
    [ 64.224718] smps9: failed to apply 3300000-3300000uV constraint(-22)
    [ 64.224732] palmas-pmic 48070000.i2c:tps659038@58:tps659038_pmic: failed to register 48070000.i2c:tps659038@58:tps659038_pmic regulator
    [ 64.225687] palmas-pmic: probe of 48070000.i2c:tps659038@58:tps659038_pmic failed with error -22


    Could you help me identify the issue ? I am using the DTB file 'am571x-idk.dtb' provided with TI's SDK for booting kernel. Can you provide a DTB file for AM5716 or guide me how to modify the DTS file for my custom board with AM5716 SoC ?

  • Nithin Prasanth KP said:
    No where in the documentation of TI,I noticed the field ramdisk_size in the bootm command
    : => bootm ${kernel_addr} ${ramdisk_addr} :${ramdisk_size} ${fdt_addr}
     Can you include it in your documentation? I found this by browsing the u-boot code.

    This is general parameter, not TI specific. That is why missing from TI specific documentation.

    Nithin Prasanth KP said:
    Now  during linux boot in my console log , I am getting the following error ::

    Nithin Prasanth KP said:
    [ 64.225687] palmas-pmic: probe of 48070000.i2c:tps659038@58:tps659038_pmic failed with error -22

    From what I understand, this issue is not related to UART boot. If yes, please close/resolve/verify that thread and open new one regarding your AM571x custom board PMIC issue.

    Regards,
    Pavel

  • Hi Pavel,
    I thought device tree file is also part of UART boot. Hence raised it in the same thread. Anyway thanks a lot for your support.
    Regards,
    Nithin
  • Nithin,

    I see your new post:

    e2e.ti.com/.../675783

    I will investigate and reply there.

    Regards,
    Pavel