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.

[FAQ] TDA4VM: Linux DTS DTB FAQs

Part Number: TDA4VM

I have the following questions:

  1. How to know which driver is probed with a particular Device tree node?
  2. How to know which CONFIG to be enabled to probe a particular Device tree node?
  3. How to get the DTS(device tree source) of a particular DTB(device tree binary)?

  • Answers to questions in the order:

    1. How to know which driver is probed with a particular Device tree node?

      They key lies in the compatible string. For example ospi0 node:
       ospi0: spi@47040000 {
                              compatible = "ti,j721e-ospi", "ti,am654-ospi";
                              reg = <0x0 0x47040000 0x0 0x100>,
                                      <0x5 0x00000000 0x1 0x0000000>;
                              interrupts = <GIC_SPI 840 IRQ_TYPE_LEVEL_HIGH>;
                              cdns,fifo-depth = <256>;
      

      Search for compatible strings under drivers folder of Linux repository starting from first to last in order.
      Continuing with our ospi0 example:

      git grep ti,j721e-ospi drivers/
      

      No matches found so search for the next compatible.

      git grep ti,am654-ospi drivers/

      drivers/mtd/spi-nor/cadence-quadspi.c: .compatible = "ti,am654-ospi",

      Ospi0 probes the drivers/mtd/spi-nor/cadence-quadspi.c driver.

    2. How to know which CONFIG to be enabled to probe a particular Device tree node?

      Follow the steps for Q1 and once you know the driver name.
      Continuing with our ospi0 example.

      Couple of more steps to get to the CONFIG option:
              
      Driver: drivers/mtd/spi-nor/cadence-quadspi.c driver.
      Open the Makefile in the folder that has the driver.
      vi drivers/mtd/spi-nor/Makefile
      

      Search for cadence-quadspi.o (Driver name with object extension)

      obj-$(CONFIG_SPI_CADENCE_QUADSPI)       += cadence-quadspi.o

      CONFIG_SPI_CADENCE_QUADSPI option corresponds to ospi0 node.

    3. How to get the DTS(device tree source) of a particular DTB(device tree binary)?

      cd to the Linux repo.
      Example: Source for k3-am654-r5-base-board.dtb.
      scripts/dtc/dtc -I dtb -O dts  -o devicetree.dts arch/arm/dts/k3-am654-r5-base-board.dtb

      The source will be saved as devicetree.dts

    Regards,
    Keerthy