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: Same dtb file for different HW options

Part Number: AM3352

Hello,

We have our own HW design using am3352 and we got linux 4.14.67 from TI SDK.

Regarding spi interface, we have  different dtb files because we have different HW options. For example, we can have different CAN options connected to the same spi, so different drivers need to be loaded.

&spi1 {
   status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&can3_pins>;
    ti,pindir-d0-out-d1-in;
    can@3 {
      compatible = "microchip,mcp2518fd";
      reg = <0>;
      spi-max-frequency = <12000000>;            // 12 MHz
      interrupt-parent = <&gpio0>;//interrupt on port 0
      interrupts = <28 IRQ_TYPE_EDGE_FALLING>;//port 0-28
      clocks = <&mcp2518_clock>;
   };
};


or

&spi1 {
   status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&can3_pins>;
    ti,pindir-d0-out-d1-in;
   can@3 {
      compatible = "microchip,mcp2515";
      reg = <0>;
      spi-max-frequency = <12000000>;            // 12 MHz
      interrupt-parent = <&gpio0>;//interrupt on port 0
      interrupts = <28 IRQ_TYPE_EDGE_FALLING>;//port 0-28
      clocks = <&mcp2515_clock>;
   };
};

In order to make it simpler while loading final FW, we would like to have only one dtb file. Do you know if it is possible to have both possibilities in the same dtb file?

It it is not possible in one dtb file, do you know any other way to do it?

Best regards and thank you

Angel

  • Hi Angel,

    Regarding u-boot DTS files, you can not have both options in a single DTB file.

    See for example how AM572x EVM different revisions are handled. We have 3 types of AM572x EVM boards, each with very few HW changes from the others.

    u-boot-2019.01/arch/arm/dts/am57xx-beagle-x15.dts - initial rev A2
    u-boot-2019.01/arch/arm/dts/am57xx-beagle-x15-revb1.dts - rev B1
    u-boot-2019.01/arch/arm/dts/am57xx-beagle-x15-revc.dts - latest rev C

    We use EEPROM memory to check on which type of AM572x EVM board we are exactly at (A2, B1 or C), thus loading the specific DTB file. Check how this is handled in below u-boot files:

    u-boot-2019.01/configs/am57xx_evm_defconfig
    u-boot-2019.01/include/environment/ti/boot.h
    u-boot-2019.01/arch/arm/dts/Makefile
    u-boot-2019.01/board/ti/am57xx/board.c
    u-boot-2019.01/board/ti/common/board_detect.c

    We use the same approach (EEPROM memory) to differentiate between different AM335x beagle boards - Bone, Bone Black, Bone Green:

    u-boot-2019.01/arch/arm/dts/am335x-bone.dts

    u-boot-2019.01/arch/arm/dts/am335x-boneblack.dts

    u-boot-2019.01/arch/arm/dts/am335x-bonegreen.dts

    Check below u-boot files how AM335x different boards are handled:

    u-boot-2019.01/board/ti/am335x/board.h
    u-boot-2019.01/board/ti/am335x/board.c
    u-boot-2019.01/board/ti/am335x/mux.c
    u-boot-2019.01/arch/arm/dts/Makefile
    u-boot-2019.01/include/configs/am335x_evm.h
    u-boot-2019.01/configs/am335x_evm_defconfig

    Regards,
    Pavel

  • Angel,

    In Linux kernel, we also use different DTS files for different HW boards. Check for example how AM572x EVM revisions are handled:

    linux-4.19.38/arch/arm/boot/dts/ti/am57xx-evm.dtso - "AM57xx EVM"

    linux-4.19.38/arch/arm/boot/dts/ti/am57xx-evm-reva3.dtso - "AM57xx EVM rev A3"

    linux-4.19.38/arch/arm/boot/dts/ti/am57xx-evm.its

    linux-4.19.38/arch/arm/boot/dts/Makefile

    linux-4.19.38/arch/arm/boot/dts/ti/Makefile

    In latest PSDK v6.00 (kernel 4.19.38) we support device overly for AM572x EVM, check below e2e thread for details:

    For AM335x devices, we have separate DTS file for all AM335x BeagleBone boards:

    linux-4.19.38/arch/arm/boot/dts/am335x-bone.dts

    linux-4.19.38/arch/arm/boot/dts/am335x-boneblack.dts

    linux-4.19.38/arch/arm/boot/dts/am335x-boneblack-wireless.dts

    linux-4.19.38/arch/arm/boot/dts/am335x-boneblue.dts

    linux-4.19.38/arch/arm/boot/dts/am335x-bonegreen.dts

    linux-4.19.38/arch/arm/boot/dts/am335x-bonegreen-wireless.dts

    For which DTB file linux kernel should load, is passed through u-boot environments. And u-boot knows which dtb file to pass to linux kernel, though EEPROM memory reading.

    Regards,
    Pavel

  • Hello Pavel,

    Thanks for your help. We will try to find out the best solution for our device.

    Best regards

    Angel