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.

AM3352: Questions about creating device tree file.

Part Number: AM3352

I have three questions below about creating device tree file.

1. PinMux tool will output .dtsi file as shown in the fig1, but there are am335x-evm.dts file (not .dtsi file) in u-boot and kernel. What is difference between .dtsi and .dts file ? Can I use the .dtsi file outputted from PinMux for the purpose of starting our target board ?

2. There are am335x-evm.dts file in both u-boot and kernel. These two file are not equal. Why do these two file have difference ?

3. When compiling device tree file, this command was displayed.
  cat u-boot-nodtb.bin dts/dt.dtb > u-boot-dtb.bin
  cp u-boot-dtb.bin u-boot.bin
I understand that u-boot program recognize that the device tree located at the end region of u-boot.bin. Could you teach me where the source code that u-boot program search the device tree from the end region of u-boot.bin is ?

Fig.1

  • Hello,
    Driver Model (DM) and device tree support have been increasingly added in SPL/u-boot.
    For AM335x Linux SDK:
    1. SPL level:
    Due to limited on-chip SRAM available for adding FDT parsing in SPL, DM support for some peripherals is based on the traditional platform data instead of device tree. For example, DM I2C driver for AM335x EVM is defined below, and used in both SPL and u-boot for accessing EEPROM/PMIC via I2C.

    /drivers/i2c/omap24xx_i2c
    static const struct udevice_id omap_i2c_ids[] = {
    	{ .compatible = "ti,omap3-i2c", .data = OMAP_I2C_REV_V1 },
    	{ .compatible = "ti,omap4-i2c", .data = OMAP_I2C_REV_V2 },
    	{ }
    };

    2. u-boot level:
    - u-boot.img is a FIT image which embeds u-boot.bin, & multiple dtb files (i.e., am335x-evm.dtb; am335x-bone.dtb; ...) in TI u-boot.img build. FIT image header parsing can be done, i.e. "./tools/mkimage -l u-boot.img"
    - During SPL boot, SPL parse u-boot.img FIT image, and load u-boot.bin, read dtb file, and load the dtb matching to the board based on board_ID, where board_ID detection is via reading EEPROM on TI boards.

    3. Kernel level:
    DT is almost exclusively used in the latest kernel drivers.
    Some useful reference on DT:
    - $u-boot/doc/device-tree-bindings
    - $u-boot/doc/driver-model
    - $kernel/Documentation/devicetree/bindings

    Best,
    -Hong

  • Thank you for reply.
    There are many documents.
    Could you teach me which document I should read for the purpose of understanding AM335x-EVM-SK (TMDSSK3358) device tree for example ?

  • Hello,
    For AM335x Linux SDK:
    - The device tree for u-boot: "$u-boot/arch/arm/dts/*.*", and "am335x-evmsk.dts" is the top level DT for AM335x SK board
    - The device tree for kernel: "$kernel/arch/arm/boot/dts/*.*", and "am335x-evmsk.dts" is the top level DT for AM335x SK board
    For each DT node, you may refer to the u-boot/kernel device tree binding documents in my last post.
    Best,
    -Hong

  • Thank you for reply.
    I think that it will take a lot of time to check that.
    Anyway, I think that this issue should be marked as resolved.