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/PROCESSOR-SDK-AM335X: Kernel boot hangs on custom board

Part Number: PROCESSOR-SDK-AM335X
Other Parts Discussed in Thread: AM3352, TPS65910, TPS51200

Tool/software: Linux

Hi,

We are trying to run u-boot and kernel on the custom board with AM3352 processor.   We are using u-boot and Linux available in the latest TI-SDK (TI-SDK-5.03.00.07).

For u-boot, we have modified the board configuration as per our board and u-boot is working i.e) we are able to see the u-boot prompt.

 

We have compiled the kernel with default configuration for “tisdk_am335x-evm_defconfig”

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- tisdk_am335x-evm_defconfig

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage

We are trying to boot the kernel from u-boot prompt manually with below commands, but the kernel is not coming up.

fatload mmc 0:1 0x88000000 am335x-evm.dtb

fatload mmc 0:1 0x82000000 zImage

setenv bootargs console=ttyS0, 115200

bootz 0x82000000 - 0x88000000

Kernel is not booting below is the message:

U-Boot 2018.01-00569-g7b4e473842-dirty (Jun 26 2019 - 17:34:38 +0530)

CPU : AM335X-GP rev 2.1

Model: TI AM335x EVM

DRAM: 256 MiB

NAND: 0 MiB

MMC:   OMAP SD/MMC: 0

Net:   No ethernet found.

Hit any key to stop autoboot: 0

=> fatload mmc 0:1 0x88000000 am335x-evm.dtb

41323 bytes read in 6 ms (6.6 MiB/s)

=> fatload mmc 0:1 0x82000000 zImage

3912192 bytes read in 332 ms (11.2 MiB/s)

=> setenv bootargs console=ttyS0, 115200

=> bootz 0x82000000 - 0x88000000

## Flattened Device Tree blob at 88000000

   Booting using the fdt blob at 0x88000000

   Loading Device Tree to 8df08000, end 8df1516a ... OK

 

Starting kernel ...We again re-compiled the kernel to generate uImage from below command:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- LOADADDR=0x82000000 uImage

and tried to boot the kernel with below commands, but still we could not.

U-Boot 2018.01-00569-g7b4e473842-dirty (Jun 26 2019 - 17:34:38 +0530)

CPU : AM335X-GP rev 2.1

Model: TI AM335x EVM

DRAM: 256 MiB

NAND: 0 MiB

MMC:   OMAP SD/MMC: 0

Net:   No ethernet found.

Hit any key to stop autoboot: 0

=>

=>

=> fatload mmc 0:1 0x88000000 am335x-evm.dtb

41323 bytes read in 6 ms (6.6 MiB/s)

=> fatload mmc 0:1 0x82000000 uImage

3912256 bytes read in 332 ms (11.2 MiB/s)

=> setenv bootargs console=ttyS0, 115200

=> bootm 0x82000000 - 0x88000000

## Booting kernel from Legacy Image at 82000000 ...

   Image Name:   Linux-4.14.79-ge669d52447

   Created:     2019-06-28   6:51:48 UTC

   Image Type:   ARM Linux Kernel Image (uncompressed)

   Data Size:   3912192 Bytes = 3.7 MiB

   Load Address: 82000000

   Entry Point: 82000000

   Verifying Checksum ... OK

## Flattened Device Tree blob at 88000000

   Booting using the fdt blob at 0x88000000

   Loading Kernel Image ... OK

   Loading Device Tree to 8df08000, end 8df1516a ... OK

 Starting kernel ...

 

Bootloader can read the Kernel and DTB file from SD-Card but control is not being passed to kernel. (that is what we are presuming). We have refered to below link and looks like that our problem is like Problem #1 explained in below link.

http://processors.wiki.ti.com/index.php/Kernel_-_Common_Problems_Booting_Linux#Problem_.232_-_No_more_output_is_seen_on_the_console_after_.22booting_the_kernel.22.

 

Since our is custom board and is somewhat similar to am335x-evmsk board. We are now suspecting that there may be some problem with respect to .DTB file and now we are looking up generating .DTB file for our board.

From the TI PinMux Tool we have generated below files:

  1. Am335x_pinmux.h
  2. Am335x_pinmux_data.c
  3. Devicetree.dtsi

From the above generated files, I have below questions:

  • Which are the .h and .c files in the U-boot and Linux needs to be updated using above files?
  • Do I need to update/modify .dts files both in U-boot and Linux also? If yes, please let us know the most nearby/closest file which can be used as reference for this?
  • I am noticing that .dtb file is generated by both both in u-boot and Linux. Which is the file I need to copy to the BOOT folder of the SD-card?

 

Please let us know the steps for creating/modifying the DTS and DTSI file. Also steps to copy the files with details on <FROM> and <TO> folders.

 

Regards

Srinivasa

  • Hello Srinivasa,

    Since your board is am335x-evmsk based. Can you try to boot with am335x-evmsk.dtb?

    Best regards,
    Kemal

  • Hi Kemal,

    Thanks for very quick response.

    We tried with both am335x-evm.dtb and am335x-evmsk.dtb.  Still the same result.

    Regards

    Srinivasa

  • Can you enter this command in U-Boot console and retry?

    => setenv fdt_high 0x8c000000

  • Tried the below command as below, still the same result.

     

    setenv fdt_high 0x8c000000

    fatload mmc 0:1 0x88000000 am335x-evm.dtb
    fatload mmc 0:1 0x82000000 uImage
    setenv bootargs console=ttyS0, 115200
    bootm 0x82000000 - 0x88000000

    Last message displayed is "Starting Kernel ...".  No further output.

    Regards

    Srinivasa

  • Can you remove everything from the device tree except UART, I2C, MMC, and PMIC nodes then try to boot in that way?

  • We have created a minimum dts file with UART0 node only. 

    Still the Kernel is not coming up and no console logs observed.  

    Same built zImage and dtb we run on Beaglebone black which worked but zImage doesnt run on our custom board.

    Please find the dts file attached.

    Regards,

    Srinivashttps://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/am335x_2D00_evmsk.7z

  • Just few updates:

    1. Hardware is working fine, because old U-boot and old kernel is working fine.
    2. We are using u-boot and Linux kernel from TI-SDK 5.03.
    3. In u-boot we have modified few  things and I have attached the patch file for reference.  After attaching the path file only u-boot was working.

    Considerin this, I have looked at the patch file and in my opion there are no similar changes required for  Kernel.  

    Can you please look at the patch file and let us know if there is any modification to be done for kernel also?

    Regards

    Srinivasahttps://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/8182.u_2D00_booth_5F00_patch.7z

  • I can boot my board with your patch applied, with the prebuilt kernel. Can you revert your changes and apply the patch from this post to hardcode the board name to "A335X_SK" and check whether the board boots?

  • Hi Kemal,

    I just referred to the patch file.  We don't have EEPROM on our target board and we have commented EEPROM section in our code (in do_board_detect()  as below:

    #ifdef CONFIG_TI_I2C_BOARD_DETECT
    void do_board_detect(void)
    {


    enable_i2c0_pin_mux();
    i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);


    //OFFSET(usb1_drvvbus)
    // printf("Srini usb1_drvbus 0x%x %ld\n",OFFSET(usb1_drvvbus));

    #if(0)


    if (ti_i2c_eeprom_am_get(CONFIG_EEPROM_BUS_ADDRESS,
    CONFIG_EEPROM_CHIP_ADDRESS))
    printf("ti_i2c_eeprom_init failed\n");


    #endif


    }
    #endif

    We are manually loading the dtb and kernel to SDRAM and booting form 0x80000000 using below commands:

    load mmc 0:1 0x88000000 am335x-evm.dtb
    load mmc 0:1 0x82000000 zImage
    setenv bootargs console=ttyS0,115200
    bootz 0x82000000 - 0x88000000

    Regards

    Srinivasa

  • Even this patch is applied, with your previously attached kernel device tree, I can successfully boot my board. Have you tried to boot with your old device tree?

  • I am able to book the kernel on beagblebone black with our build TI-SDK kernel but not on our customized target board.


    We are porting from Kervel 3.2 to latest available kernel available in TI SDK. Old u-boot and kernel are working fine on target board.
    We don't have .dts files in our old linux or u-boot tree. Now we need to modify dts file as per our target board (which is similar to EVMSK).

    Regards
    Srinivasa

  • Can you check whether your custom board will boot with these attached images?

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/AM335x_5F00_boot_5F00_part_5F00_with_5F00_hardcoded_5F00_A335X_5F00_SK_5F00_board_5F00_name_5F00_dtb_5F00_and_5F00_kernel_5F00_images.tar.xz

  • Extracted above attached file

     

    Step 1:

    Copied “am335x-evmsk.dts” to the ti-sdk linux tree i.e) arch/arm/boot/dts and compiled the dts file using below command.

    make CROSS_COMPILE=arm-criticallink-linux-gnueabi- am335x-evmsk.dtb.

    Copied the generated am335x-evmsk.dtb file to the boot partition of SD card.

    Copied u-boot.img, MLO, and zImage-am335x-evm.bin to boot partition of SD card.

    Result:

    No messages on console and u-boot did not come up.

     

    Step 2:

    Copied our u-boot files to boot partition of SD card. Our u-boot files are generated from TI-SDK u-boot with path applied which I have shared earlier.

    U-boot did come up and performed below steps:

    load mmc 0:1 0x88000000 am335x-evmsk.dtb

    load mmc 0:1 0x82000000 zImage-am335x-evm.bin

    setenv bootargs console=ttyS0,115200

    bootz 0x82000000 - 0x88000000

     

    Result is as below:

    => load mmc 0:1 0x88000000 am335x-evmsk.dtb

    30545 bytes read in 6 ms (4.9 MiB/s)

    => load mmc 0:1 0x82000000 zImage-am335x-evm.bin

    3871232 bytes read in 329 ms (11.2 MiB/s)

    => setenv bootargs console=ttyS0,115200

    => bootz 0x82000000 - 0x88000000

    ## Flattened Device Tree blob at 88000000

       Booting using the fdt blob at 0x88000000

       Loading Device Tree to 8df0b000, end 8df15750 ... OK

    Srini kernel_entry address -2113929216

    ## Transferring control to Linux (at address 82000000)...

     Srini debug @ line 169 in function device_remove in file ../drivers/core/device-remove.c

    Srini debug @ line 213 in function device_remove in file ../drivers/core/device-remove.c

    Srini debug @ line 213 in function device_remove in file ../drivers/core/device-remove.c

    Srini debug @ line 107 in function announce_and_cleanup in file ../arch/arm/lib/bootm.c

    machid : 3589

    Srini r2 : 8df0b000

    Jumping to 82000000

    Bye bye u-boot :(

     

    I have put some debug messages to see if there is any problem in u-boot.  U-boot seems to fine.  I have right R2 and jump address printed but still kernel is not coming up.

    Regards

    Srinivasa

  • Just noticed that am335x-evmsk uses “TPS65910A3” for power management and “am335x-evmsk.dtsi” has included #include "tps65910.dtsi".

    Our target board uses “TPS51200” for VTT regulartor.

    Is tps65910.dtsi compatible for TPS51200?

    Is this making any difference?

    How important the nodes of &tps play in bringing the board?

    Regards

    Srinivasa

  • Your main PMIC is TPS65910A3 right?

  • Yes, that is correct.

    Regards

    Srinivasa

  • We have probed the DDR_VTT_EN pin and it is always HIGH.

    Do we need to specify the SDRAM size anywhere in the Kernel source (other than .dts) file?

    Regards

    Srinivasa

  • Can you enter this option in U-Boot console and check whether the kernel will start to load?

    => setenv optargs mem=256M nomodule

  • Our board SDRAM size is 256 MB, tried above option but no luck.

    Since Beaglebone DRAM is of 512 MB, performed negative testing with below option:

    setenv optargs mem=128M nomodule

    Beaglebone black kernel comes up.  So I am not sure if above env variable is making any impact.

    Regards

    Srinivasa

  • Now I want to increase the SDRAM clock speed or want to try by chaning the timing of clock in u-boot.

    It you be very helpful if you can suggest which is the macro in file "\arch\arm\include\asm\arch-am33xx\ddr_defs.h" will be ideal for this?

    Regards

    Srinivasa

  • Hello Srinivasa,

    I am wondering if you have updated your rootfs partition on your SD card. I understand you are migrating from older Uboot/Kernel versions to newer versions and I recommend running the create-sdcard.sh script to format the SD card again. Then, copy the MLO+u-boot.img to the boot partition and copy the zImage+dtb to the rootfs/boot partition of the SD card.

    I do not think you need to manually load all the Kernel images from Uboot. As long as the SD card is formatted correctly and the appropriate images are in the boot partition and rootfs/boot partition, the board should boot without any problems. Also, in the following post, I noticed you were using the wrong cross-compiler and we only support the arm-linux-gnueabihf-.

    In Uboot, please stop at the Uboot environment and run the command "env default -f -a" and "saveenv" to remove any old saved data. 

    Regards,
    Krunal

  • Hi Krunal,

    As suggested, created new sd-card from  create-sdcard.sh script and copied only our customized MLO and u-boot.img to boot partition.  Also copied zImage + dtb fiels to root/boot partition of th SD Card.

    Kernel is not booting up, please find message log below


    U-Boot SPL 2018.01-00569-g7b4e473842-dirty (Jul 10 2019 - 12:55:03)
    Trying to boot from MMC1


    U-Boot 2018.01-00569-g7b4e473842-dirty (Jul 10 2019 - 12:55:03 +0530)

    CPU : AM335X-GP rev 2.1
    Model: TI AM335x EVM
    DRAM: 256 MiB
    NAND: 0 MiB
    MMC: OMAP SD/MMC: 0
    Net: No ethernet found.
    Hit any key to stop autoboot: 0
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    ** Unable to read file boot.scr **
    ** Unable to read file uEnv.txt **
    switch to partitions #0, OK
    mmc0 is current device
    Scanning mmc 0:1...
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    2318848 bytes read in 358 ms (6.2 MiB/s)
    30545 bytes read in 25 ms (1.2 MiB/s)
    ## Flattened Device Tree blob at 88000000
    Booting using the fdt blob at 0x88000000
    Loading Device Tree to 8df0a000, end 8df14750 ... OK

    Starting kernel ...

    Srini machid : 3589

    Srini r2 : 8df0a000

    Jumping to 82000000


    Bye bye u-boot :(

    The purpose of manullay loding the kernal manually is to avoid any dependency on u-boot environment variables.

    We are using arm-linux-gnueabihf- only.

    Regards

    Srinivasa

  • Hello Srinivasa,

    In the following thread, I noticed you loaded zImage-am335x-evm.bin and I just wanted to confirm if you meant "zImage". Also, please add the UART, I2C, MMC, and PMIC nodes because they are necessary for booting.

    Regards,
    Krunal

  • Hi All

    Finally the board is up after removing below lines in am33xx.dtsi file.   Just disabling below  peripheral does not work.  We need to delete below lines and board is up now.

    rtc: rtc@44e3e000 {

    compatible = "ti,am3352-rtc", "ti,da830-rtc";
    reg = <0x44e3e000 0x1000>;
    interrupts = <75
    76>;
    ti,hwmods = "rtc";
    clocks = <&clkdiv32k_ick>;
    clock-names = "int-clk";

    };

    Regards

    Srinivasa

  • Hello Srinivasa,

    I am happy to hear that you resolved the issue. Please, do not forget to mark the thread as resolved.

    Thanks,
    Kemal