Several Questions Regarding the IMX327 Camera Device Tree:

Hello everyone in the forum,
I am a beginner developer currently using Jetson Orin NX and I am learning about camera drivers and device tree writing. However, I have encountered some confusion:

Question 1: I am using the l4t_35.4.1 environment setup package and decompiled the system’s device tree file system_devicetree.dts in the /boot/dtb directory. In the system’s device tree, I found a node called cam_i2cmux. Could anyone explain what the purpose of this node is? Does it correspond to specific hardware?

Question 2: Additionally, a senior colleague has previously written the device tree and drivers for three IMX327 cameras, and I am currently studying his code. I noticed that he placed the settings for different camera modes under the i2c@3180000 node and added a tca9548 node. I understand that the tca9548 is an I2C multiplexer, but why do I not see this multiplexer node in the system_devicetree.dts file? Moreover, why didn’t my senior use the default cam_i2c multiplexer node? Is there any relevant documentation from NVIDIA regarding cam_i2cmux and tca9548? If so, could you recommend it to me?

Question 3: In the Jetson Orin NX Series and Jetson Orin Nano Series Product Design Guide document, I saw that the NX processor seems to use only 4 I2C interfaces. However, when I decompiled the device tree file, I found 9 I2C nodes. How are these I2C nodes and their address information determined?


Hello @2018302080149

It’s great to hear that you are learning camera driver development.
At the beginning it might feel a bit overwhelming, but you will see that once you start to understand the system it becomes fairly simple.

Please allow me to answer your questions one by one.

  1. The cam_i2cmux is used so that you can connect multiple devices with the same i2c address to the same i2cbus. This allows you to send messages on a bus for a specific address and control which of the i2c devices on the same bus and address gets the message. The i2cmux is an actual HW piece on the carrier board.
  2. The tca9548 is in fact an i2c mux. The reason why you are not able to see the tca9548 multiplexer on the systems decompiled DTB is because the driver that is actually loaded on the systems DTB is for an imx477 as shown in the compatible. This happens because by default NVIDIA devices load either imx219 or imx477 drivers, this can be changed by fixing a camera driver to be loaded on the platforms dts file or by using jetson_io tool. Now, the reason why your senior dev did not use the cam_i2cmux instead of tca9548 could have been because of multiple reasons, such as a driver that he based on was developed that way, it could have also been that the senior dev created the driver for a different Jetson board, or even a custom carrier board.
  3. The reason for having more i2c nodes that the ones in documentaton is because of the muxes. For every mux, you will see the actual bus you are connecting the bus to and 1 extra bus per subnode you connect to the bus.

If you are trying to port the driver into Jetson Orin Nano, I would suggest you base yourself out of the imx477 DTB and just move the actual configuration for your sensor and HW setup so that it works with your HW.

Please let us know if you require further assistance, we would love to help.

regards,
Andrew
Embedded Software Engineer at ProventusNova

1 Like

Thank you for your response. If possible, I have some new questions to ask:

Question 4: The development board we are using seems to be equipped with the Orin NX processor and uses a customized baseboard from a company based in Beijing. I’m considering whether the additional 4 I2C nodes might have been added by this company during the customization of the baseboard, thus increasing the number of I2C interfaces. The symbols corresponding to these 8 I2C nodes seem to represent their functions. Or, as you mentioned, are these 8 I2C nodes predefined in the Orin NX processor, and the additional I2C interfaces are due to the use of a multiplexer?
image

These two new questions arise from the previous discussions:

Question 5: What does the address information following the @ in these nodes represent? For example, in the i2c@3180000 node (also known as the cam_i2c node), is 3180000 the address of this I2C interface? When writing device tree drivers, do I need to know the corresponding address of each I2C interface? I noticed that my senior directly referenced the alias cam_i2c when writing the device tree file (see the second image in the topic). If I do need this information, how can I find out the address of each I2C interface?

Question 6: In the device tree file, it seems that aliases are used to indicate the function of each I2C node. For example, i2c@3180000 corresponds to cam_i2c, indicating that this might be an I2C interface for the camera, and i2c@3190000 corresponds to dp_aux_ch1_i2c, which could represent a display interface. Are the roles of each I2C interface determined from the beginning for specific devices? For instance, would defining a camera device tree under the i2c@3190000 node be invalid? I noticed that the code for each I2C node in the system’s device tree looks similar, and there doesn’t seem to be a specific definition indicating what each I2C interface is used for. Is the function of each I2C interface identified at the hardware level?


Thank you!

Q4: Yes those i2c@xxxx0000 is predefined in ONX processor.
Q5: Need to check the HW design to know the device connect to which bus.
Q6: like the Q5

Thank you for your response.
Does checking the hardware design refer to checking the ONX processor? If I want to know the hardware design or the function of these 8 I2C nodes, does NVIDIA provide any relevant documentation for developers to learn from?

Yes, you can find the address of the i2c control in Orin processor spec(TRM)
You can download the TRM from the download center.

Hello, based on your suggestion, I found this document, but it is so lengthy that I don’t know how to find the answers to my previous questions. In the second image below, I saw the address information for the I2C nodes, but they are labeled as i2c1, i2c3, and so on. I would like to know how I can identify the specific function of each I2C node. Where is this part discussed in the TRM?

Also, regarding the transition from 4 I2C nodes to 9 I2C nodes, is this information covered in this document? If so, where can I find it?Thank you.