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.

Am335x Kernel Booting Issues

Other Parts Discussed in Thread: AM3352

We have a custom board with an AM3352 mounted on it, and a DDR3 chip. 

So far, we can successfully boot SPL and U-Boot, but the boot process stops when the kernel takes over.

Here is our boot log:

U-Boot SPL 2013.10-00189-g78d8ebd-dirty (Apr 09 2015 - 16:11:34)
Clock enable failed for 0x44e00800 idlest 0x10002

reading args
spl: error reading image args, err - -1
reading u-boot.img
reading u-boot.img


U-Boot 2013.10-00189-g78d8ebd-dirty (Apr 09 2015 - 16:11:34)

I2C: ready
DRAM: 256 MiB
NAND: 0 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Error - No Valid Environment Area found
*** Warning - bad CRC, using default environment

Could not probe the EEPROM; Ignore warning since no chip.
Net: <ethaddr> not set. Validating first E-fuse MAC
Could not probe the EEPROM; Ignore warning since no chip.
Could not get PHY for cpsw: addr 0
cpsw, usb_ether
Hit any key to stop autoboot: 0
mmc0 is current device
Scanning mmc 0...
4117616 bytes read in 394 ms (10 MiB/s)
WARNING: Could not determine device tree to use
** File not found /boot/undefined **
mmc0 is current device
SD/MMC found on device 0
reading uEnv.txt
** Unable to read file uEnv.txt **
4117616 bytes read in 394 ms (10 MiB/s)
** File not found /boot/undefined **
Kernel image @ 0x80200000 [ 0x000000 - 0x3ed470 ]

Starting kernel ...

Here, the boot process hangs. 

For booting, we use a prebuilt Linux and device tree for testing purposes. SPL and U-Boot was customized, but should not cause any issues.

We use 07.00 SDK. 

Why is our device tree not found, and what is with the "File not found" errors? 

Help would be appreciated.

  • Hi,

    I'm forwarding this to the SW team.

  • It looks like you do not have an EEPROM on your board. By default, u-boot reads the name of the board out of an EEPROM and selects the .dtb file name based on the board name. You should be able to just hardcode your board file name. Take a look at include/configs/am335x_evm.h. Look for the findfdt variable. You could probably just hard code fdtfile to your .dtb file name and remove all it if statements.

    Steve K.

  • Hi,

    As I see your kernel cannot find devicetree (dtb) file in /boot and therefore cannot load kernel correctly.

    You are booting your board from sd card, right? Did you create your card, using the create-sdcard.sh script? What is the content of the /boot directory in the rootfs partition?

    Can you stop your board at u-boot, run printenv & share the output?

    Best Regards,
    Yordan
  • Hey! I am aware of that. "Could not probe the EEPROM; Ignore warning since no chip. " is actually my custom message. I hardcoded the board name in the struct member.

    The read_eeprom looks like this:

    static int read_eeprom(struct am335x_baseboard_id *header)
    {

    strncpy("A335X_SK", header->name, sizeof(header->name));
    puts("Could not probe the EEPROM; Ignore warning since no chip.\n");
    return 0;
    }

    I think this is OK, otherwise U-Boot would not start.
  • I am booting from the SD card. It has 2 partitions. I created the card with the create-sdcard script. I then
    overwritten the MLO and u-boot files in boot partition with my own files.

    The content of the /boot is: MLO and, u-boot.img
    rootfs contains the filessystem.

    printenv says:

    <START>

    arch=arm
    baudrate=115200
    board=am335x
    board_name=|�0@��0@
    board_rev=\\Lˁ�
    boot_fdt=try
    boot_targets= mmc0 nand
    bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
    bootcmd_mmc0=setenv devnum 0; setenv rootpart 2; run mmc_boot;
    bootcmd_nand=run nandboot;
    bootcmd_usb=setenv devnum 0; run usb_boot;
    bootdelay=3
    bootdir=/boot
    bootenv=uEnv.txt
    bootfile=zImage
    bootpart=0:2
    console=ttyO0,115200n8
    cpu=armv7
    dfu_alt_info_emmc=rawemmc mmc 0 3751936
    dfu_alt_info_mmc=boot part 0 1;rootfs part 0 2;MLO fat 0 1;MLO.raw mmc 100 100;u-boot.img.raw mmc
    300 400;spl-os-args.raw mmc 80 80;spl-os-image.raw mmc 900 2000;spl-os-args fat 0 1;spl-os-image f
    at 0 1;u-boot.img fat 0 1;uEnv.txt fat 0 1
    dfu_alt_info_nand=NAND.SPL part 0 1;NAND.SPL.backup1 part 0 2;NAND.SPL.backup2 part 0 3;NAND.SPL.b
    ackup3 part 0 4;NAND.u-boot-spl-os part 0 5;NAND.u-boot part 0 6;NAND.u-boot-env part 0 7;NAND.u-b
    oot-env.backup1 part 0 8;NAND.kernel part 0 9;NAND.rootfs part 0 10
    dfu_alt_info_ram=kernel ram 0x80200000 0xD80000;fdt ram 0x80F80000 0x80000;ramdisk ram 0x81000000
    0x4000000
    eth1addr=d0:ff:50:22:eb:55
    ethact=cpsw
    ethaddr=d0:ff:50:22:eb:54
    fdt_high=0xa0000000
    fdtaddr=0x80F80000
    fdtfile=undefined
    findfdt=if test $board_name = A335BONE; then setenv fdtfile am335x-bone.dtb; fi; if test $board_na
    me = A335BNLT; then setenv fdtfile am335x-boneblack.dtb; fi; if test $board_name = A33515BB; then
    setenv fdtfile am335x-evm.dtb; fi; if test $board_name = A335X_SK; then setenv fdtfile am335x-evms
    k.dtb; fi; if test $fdtfile = undefined; then echo WARNING: Could not determine device tree to use
    ; fi;
    importbootenv=echo Importing environment from mmc ...; env import -t $loadaddr $filesize
    loadaddr=0x80200000
    loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}
    loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}
    loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
    loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz
    mmc_boot=setenv devtype mmc; if mmc dev ${devnum}; then run mmcargs;run scan_boot; run mmcboot;set
    env mmcdev 1; setenv bootpart 1:2; run mmcboot;fi
    mmcargs=setenv bootargs console=${console} ${optargs} root=${mmcroot} rootfstype=${mmcrootfstype}
    mmcboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadbo
    otenv; then echo Loaded environment from ${bootenv};run importbootenv;fi;if test -n $uenvcmd; then
    echo Running uenvcmd ...;run uenvcmd;fi;if run loadimage; then run mmcloados;fi;fi;
    mmcdev=0
    mmcloados=run mmcargs; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; t
    hen bootz ${loadaddr} - ${fdtaddr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Ca
    nnot load the DT; fi; fi; else bootz; fi;
    mmcroot=/dev/mmcblk0p2 ro
    mmcrootfstype=ext4 rootwait
    mtdids=nand0=nand.0
    mtdparts=mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.backup2),128k(NAND.SP
    L.backup3),256k(NAND.u-boot-spl-os),1m(NAND.u-boot),128k(NAND.u-boot-env),128k(NAND.u-boot-env.bac
    kup1),8m(NAND.kernel),-(NAND.rootfs)
    nandargs=setenv bootargs console=${console} ${optargs} root=${nandroot} rootfstype=${nandrootfstyp
    e}
    nandboot=echo Booting from nand ...; run nandargs; nand read ${fdtaddr} NAND.u-boot-spl-os; nand r
    ead ${loadaddr} NAND.kernel; bootz ${loadaddr} - ${fdtaddr}
    nandroot=ubi0:rootfs rw ubi.mtd=NAND.file-system,2048
    nandrootfstype=ubifs rootwait=1
    netargs=setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath
    },${nfsopts} rw ip=dhcp
    netboot=echo Booting from network ...; setenv autoload no; dhcp; tftp ${loadaddr} ${bootfile}; tft
    p ${fdtaddr} ${fdtfile}; run netargs; bootz ${loadaddr} - ${fdtaddr}
    nfsopts=nolock
    partitions=uuid_disk=${uuid_gpt_disk};name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}
    ramargs=setenv bootargs console=${console} ${optargs} root=${ramroot} rootfstype=${ramrootfstype}
    ramboot=echo Booting from ramdisk ...; run ramargs; bootz ${loadaddr} ${rdaddr} ${fdtaddr}
    ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=${rdaddr},64M
    ramrootfstype=ext2
    rdaddr=0x81000000
    rootpart=2
    rootpath=/export/rootfs
    scan_boot=echo Scanning ${devtype} ${devnum}...; for prefix in ${bootdir}; do for script in ${boot
    file}; do run script_boot; done; done;
    script_boot=if load ${devtype} ${devnum}:${rootpart} ${loadaddr} ${bootdir}/${bootfile}; then run
    findfdt; load ${devtype} ${devnum}:${rootpart} ${fdtaddr} ${bootdir}/${fdtfile};fi;
    soc=am33xx
    spiargs=setenv bootargs console=${console} ${optargs} root=${spiroot} rootfstype=${spirootfstype}
    spiboot=echo Booting from spi ...; run spiargs; sf probe ${spibusno}:0; sf read ${loadaddr} ${spis
    rcaddr} ${spiimgsize}; bootz ${loadaddr}
    spibusno=0
    spiimgsize=0x362000
    spiroot=/dev/mtdblock4 rw
    spirootfstype=jffs2
    spisrcaddr=0xe0000
    static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
    stderr=serial
    stdin=serial
    stdout=serial
    usb_boot=setenv devtype usb; run usb_init; if usb dev 0; then run usbargs;run scan_boot; bootz ${l
    oadaddr} - ${fdtaddr}; fi
    usb_init=usb start 0;
    usbargs=setenv bootargs console=${console} ${optargs} root=${usbroot} rootfstype=${usbrootfstype}
    usbnet_devaddr=d0:ff:50:22:eb:55
    usbroot=/dev/sda2 rw
    usbrootfstype=ext4 rootwait
    vendor=ti
    ver=U-Boot 2013.10-00189-g78d8ebd-dirty (Apr 09 2015 - 16:11:34)

    Environment size: 5420/131067 bytes

    <END>

    So

    board_name=|�0@��0@
    board_rev=\\Lˁ�

    does not look promissing. The values are not set. Can some one post the values of the AM335x EVM SK so i can set it with setenv?

    Also:

    console=ttyO0,115200n8

    concerns me. I am connected via UART0 of AM3352. Maybe the output is sent somewhere else? 

  • As Steve, said your board cannot find dtb file.

    You can see that you have fdtfile=undefined and your setup have to select one of the dtb files in rootfs/boot, if you check that directory you will see that the options are am335x-boneblack.dtb, am335x-bone.dtb, am335x-evm.dtb, am335x-evmsk.dtb. The selection is done by reading board id from EEPROM. 

    Since you don't have EEPROM, try hardcoding the fdtfile variable. You can do that 

      1) by modifying include/configs/am335x_evm.h: 
          

    #define CONFIG_EXTRA_ENV_SETTINGS \
    DEFAULT_LINUX_BOOT_ENV \
    "boot_fdt=try\0" \
    "bootpart=0:2\0" \
    "bootdir=/boot\0" \
    "bootfile=zImage\0" \
    "fdtfile=am335x-boneblack.dtb\0" \                           /*you can use either of the above listed dtb files, choose the board your design resembles the most*/

      2). from u-boot execute: 
           setenv fdtfile am335x-boneblack.dtb 

           saveenv

    Personally I recommend using the first approach (modify the am335x_evm.h file). 

    Hope this helps. 

    Best Regards, 
    Yordan

  • I just set the file manually in u-boot and it worked, and I came here to post the happy news :)
    Thank you anyway. I will also edit the header file.

    Thank you all for help.