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.

AM6412: Booting Linux From U-boot Prompt

Part Number: AM6412

Hi Experts

I had booted upto u-boot prompt by using usb booting Procedure (dfu).Now i want boot linux from u-boot prompt.so i have tired to combine the initramfs  to kernel image,generate the kernel image with initramfs.

so i tired the following procedures for this 

Step 1:

i have builded the tisdk-tiny-image-am*-evm.cpio.gz.u-boot by adding the following to Yocto's local.conf configuration 

# Generate a cpio archive which is compressed and has a U-Boot header
IMAGE_FSTYPES_append = " cpio.gz.u-boot"

Step 2:

i have followed these steps

Build the cpio-formatted image directly into the Kernel

Using the CONFIG_INITRAMFS_SOURCE Kernel config option (in General Setup in menuconfig) it is possible to point to a folder location on the host system that contains either a single cpio archive with a .cpio suffix or a space-separated list of directories and files for building the initramfs image. When the Kernel is build with the built-in initramfs image it will initialize and use this initramfs directly without requiring any special U-Boot handling (simply pass in '-' as the address for the RAM disk to the booti/bootm command second parameter) or updates needed to the Kernel command line. While this method is easy to deploy / use it requires a complete Kernel re-build each time changes to the rootfs are needed.

After that i have generated the Kernel Image=Image ,Using Image i have generated the fitImage for my hs-fs board.

here is the logs 

U-Boot SPL 2021.01 (Jan 27 2023 - 20:30:05 +0530)
EEPROM not available at 80, trying to read at 81
Reading on-board EEPROM at 0x51 failed -1
Resetting on cold boot to workaround ErrataID:i2331
resetting ...

U-Boot SPL 2021.01 (Jan 27 2023 - 20:30:05 +0530)
EEPROM not available at 80, trying to read at 81
Reading on-board EEPROM at 0x51 failed -1
SYSFW ABI: 3.1 (firmware rev 0x0008 '8.5.3--v08.05.03 (Chill Capybar')
SPL initial stack usage: 13424 bytes
Trying to boot from DFU
############################################DOWNLOAD ... OK
Ctrl+C to exit ...
Authentication passed
Authentication passed
Authentication passed
Authentication passed
init_env from device 10 not supported!
Starting ATF on ARM64 core...

NOTICE: BL31: v2.8(release):v2.8-34-g10f4d1a2d
NOTICE: BL31: Built : 20:24:48, Jan 27 2023
I/TC:
I/TC: OP-TEE version: 08.05.00.007-117-g79243b1f (gcc version 9.2.1 20191025 (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10))) #1 Fri Jan 27 14:57:22 UTC 2023 aarch64
I/TC: WARNING: This OP-TEE configuration might be insecure!
I/TC: WARNING: Please check optee.readthedocs.io/.../porting_guidelines.html
I/TC: Primary CPU initializing
I/TC: SYSFW ABI: 3.1 (firmware rev 0x0008 '8.5.3--v08.05.03 (Chill Capybar')
I/TC: HUK Initialized
I/TC: Activated SA2UL device
I/TC: Enabled firewalls for SA2UL TRNG device
I/TC: SA2UL TRNG initialized
I/TC: SA2UL Drivers initialized
I/TC: Primary CPU switching to normal world boot

U-Boot SPL 2021.01 (Jan 27 2023 - 20:33:30 +0530)
EEPROM not available at 80, trying to read at 81
Reading on-board EEPROM at 0x51 failed -1
SYSFW ABI: 3.1 (firmware rev 0x0008 '8.5.3--v08.05.03 (Chill Capybar')
Trying to boot from DFU
#####DOWNLOAD ... OK
Ctrl+C to exit ...
Authentication passed
Authentication passed


U-Boot 2021.01 (Jan 27 2023 - 20:33:30 +0530)

SoC: AM64X SR2.0 HS-FS
Model: Texas Instruments AM642 EVM
EEPROM not available at 80, trying to read at 81
Reading on-board EEPROM at 0x51 failed -1
DRAM: 2 GiB
NAND: 0 MiB
MMC: mmc@fa10000: 0, mmc@fa00000: 1
Loading Environment from FAT... MMC: no card present
In: serial@2800000
Out: serial@2800000
Err: serial@2800000
EEPROM not available at 80, trying to read at 81
Reading on-board EEPROM at 0x51 failed -1
Net: eth0: ethernet@8000000port@1
Hit any key to stop autoboot: 0
MMC: no card present
SD/MMC found on device 1
MMC: no card present
MMC: no card present
MMC: no card present
MMC: no card present
Wrong Image Format for bootm command
ERROR: can't get kernel image!
=> setenv serverip 192.168.10.1
=> setenv ipaddr 192.168.10.2
=> tftp fitImage
link up on port 1, speed 1000, full duplex
Using ethernet@8000000port@1 device
TFTP from server 192.168.10.1; our IP address is 192.168.10.2
Filename 'fitImage'.
Load address: 0x82000000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
################################################
10.8 MiB/s
done
Bytes transferred = 21689499 (14af49b hex)
=> bootm 0x82000000
## Loading kernel from FIT Image at 82000000 ...
Using 'k3-am642-evm.dtb' configuration
Trying 'kernel@1' kernel subimage
Description: Linux kernel
Type: Kernel Image
Compression: gzip compressed
Data Start: 0x820000f4
Data Size: 21559410 Bytes = 20.6 MiB
Architecture: AArch64
OS: Linux
Load Address: 0x80008000
Entry Point: 0x80008000
Verifying Hash Integrity ... OK
Authentication passed
## Loading fdt from FIT Image at 82000000 ...
Using 'k3-am642-evm.dtb' configuration
Trying 'k3-am642-evm.dtb' fdt subimage
Description: Flattened Device Tree blob
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x8348fa28
Data Size: 57845 Bytes = 56.5 KiB
Architecture: AArch64
Verifying Hash Integrity ... OK
Authentication passed
Booting using the fdt blob at 0x8348fa28
Uncompressing Kernel Image
Error: Bad gzipped data
gzip compressed: uncompress error -1
Must RESET board to recover
resetting ...

Please provide any steps for overcome this error

  • Hi Hong,

    Yes I have followed this thread

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1176944/faq-linux-how-to-boot-sitara-am3x-am4x-am6x-devices-from-initramfs-cpio-archive-ram-disk

    I have tired with option 1 but it won't works for me

    After proceed with option 1 procedure while booting i am getting error like this


    U-Boot 2021.01 (Jan 27 2023 - 20:33:30 +0530)

    SoC: AM64X SR2.0 HS-FS
    Model: Texas Instruments AM642 EVM
    EEPROM not available at 80, trying to read at 81
    Reading on-board EEPROM at 0x51 failed -1
    DRAM: 2 GiB
    NAND: 0 MiB
    MMC: mmc@fa10000: 0, mmc@fa00000: 1
    Loading Environment from FAT... MMC: no card present
    In: serial@2800000
    Out: serial@2800000
    Err: serial@2800000
    EEPROM not available at 80, trying to read at 81
    Reading on-board EEPROM at 0x51 failed -1
    Net: eth0: ethernet@8000000port@1
    Hit any key to stop autoboot: 0
    MMC: no card present
    SD/MMC found on device 1
    MMC: no card present
    MMC: no card present
    MMC: no card present
    MMC: no card present
    Wrong Image Format for bootm command
    ERROR: can't get kernel image!
    => setenv serverip 192.168.10.1
    => setenv ipaddr 192.168.10.2
    => tftp fitImage
    link up on port 1, speed 1000, full duplex
    Using ethernet@8000000port@1 device
    TFTP from server 192.168.10.1; our IP address is 192.168.10.2
    Filename 'fitImage'.
    Load address: 0x82000000
    Loading: #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    ################################################
    10.8 MiB/s
    done
    Bytes transferred = 21689499 (14af49b hex)
    => bootm 0x82000000
    ## Loading kernel from FIT Image at 82000000 ...
    Using 'k3-am642-evm.dtb' configuration
    Trying 'kernel@1' kernel subimage
    Description: Linux kernel
    Type: Kernel Image
    Compression: gzip compressed
    Data Start: 0x820000f4
    Data Size: 21559410 Bytes = 20.6 MiB
    Architecture: AArch64
    OS: Linux
    Load Address: 0x80008000
    Entry Point: 0x80008000
    Verifying Hash Integrity ... OK
    Authentication passed
    ## Loading fdt from FIT Image at 82000000 ...
    Using 'k3-am642-evm.dtb' configuration
    Trying 'k3-am642-evm.dtb' fdt subimage
    Description: Flattened Device Tree blob
    Type: Flat Device Tree
    Compression: uncompressed
    Data Start: 0x8348fa28
    Data Size: 57845 Bytes = 56.5 KiB
    Architecture: AArch64
    Verifying Hash Integrity ... OK
    Authentication passed
    Booting using the fdt blob at 0x8348fa28
    Uncompressing Kernel Image
    Error: Bad gzipped data
    gzip compressed: uncompress error -1
    Must RESET board to recover
    resetting ...

  • Hi,

    looks like you created a FIT image that has compression = "gzip" set in the image tree source file for the Kernel blob? If so this looks like very similar to something I just debugged very recently. There seems to be an error in U-Boot such that it tries to do the gunzip operation in-place, which is not supported. Can you please review & try the attached patch. You might need to increase CONFIG_SYS_MALLOC_LEN as well to make it work.

    Regards, Andreas

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/0008_2D00_gunzip_2D00_Create_2D00_copy_2D00_of_2D00_source_2D00_data_2D00_during_2D00_in_2D00_place_2D00_ex.patch

  • Hi Andreas 

    Thanks for the response

    I had a doubt regarding CONFIG_SYS_MALLOC_LEN configuration, where can i increase the size,can you mention the file or path name.

    i am using am64xx evm. i have applied the patch in u-boot directory.

  • I had a doubt regarding CONFIG_SYS_MALLOC_LEN configuration, where can i increase the size,can you mention the file or path name.

    You can increase the U-Boot (proper) dynamic memory pool size as shown below. Default size for the TI boards is 32MB.

    $ git diff
    diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h
    index 08829781e3..8ba22859ec 100644
    --- a/include/configs/ti_armv7_common.h
    +++ b/include/configs/ti_armv7_common.h
    @@ -101,7 +101,7 @@
      * we are on so we do not need to rely on the command prompt.  We set a
      * console baudrate of 115200 and use the default baud rate table.
      */
    -#define CONFIG_SYS_MALLOC_LEN          SZ_32M
    +#define CONFIG_SYS_MALLOC_LEN          SZ_64M
     #define CONFIG_ENV_OVERWRITE           /* Overwrite ethaddr / serial# */

    So did you the gunzip of your Kernel image to work with the patch I provided?

    Regards, Andreas

  • Hi Andreas 

    Thanks for the response

    My Issue is resolved by generating kernel image in Image.gz format and now i am able to boot kernel Image with Initramfs.

    Thanks for the support.