Modify device tree of Orin Nano for custom board

Hi guys,
I’m newbie and get difficult when Modify device tree of Orin Nano 8GB Devkit for custom board in Jetpack 6.0.

For example when i try porting USB2.0 from M.2 Key E Connector to USB3.0 HUB. I think i need to overlay in tegra234-p3768-0000+p3767-0000-nv.dts, but when see in the included root file tegra234.dtsi, i don’t know what i need to change.
usb@3550000 {
compatible = “nvidia,tegra234-xudc”;
reg = <0x0 0x03550000 0x0 0x8000>,
<0x0 0x03558000 0x0 0x8000>;
reg-names = “base”, “fpci”;
interrupts = <GIC_SPI 166 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&bpmp TEGRA234_CLK_XUSB_CORE_DEV>,
<&bpmp TEGRA234_CLK_XUSB_CORE_SS>,
<&bpmp TEGRA234_CLK_XUSB_SS>,
<&bpmp TEGRA234_CLK_XUSB_FS>;
clock-names = “dev”, “ss”, “ss_src”, “fs_src”;
interconnects = <&mc TEGRA234_MEMORY_CLIENT_XUSB_DEVR &emc>,
<&mc TEGRA234_MEMORY_CLIENT_XUSB_DEVW &emc>;
interconnect-names = “dma-mem”, “write”;
iommus = <&smmu_niso1 TEGRA234_SID_XUSB_DEV>;
power-domains = <&bpmp TEGRA234_POWER_DOMAIN_XUSBB>,
<&bpmp TEGRA234_POWER_DOMAIN_XUSBA>;
power-domain-names = “dev”, “ss”;
nvidia,xusb-padctl = <&xusb_padctl>;
dma-coherent;
status = “disabled”;
};

I only know change “mode” to otg/host or “status” to okay/disable follow this guide Jetson Orin NX and Nano Series — NVIDIA Jetson Linux Developer Guide 1 documentation

Hmm… I also see in other node have description as :
compatible = “usb-c-connector”;
reg = <0>;
label = “USB-C”;
data-role = “host”;

I think device tree has a base source as tegra234.dts/dtsi which have fully nodes and all pre-defined values for each properties, is right? I don’t know where to know that, can you let me know some hint or tutorial?

Thank you so much!

This document has the info.

https://docs.nvidia.com/jetson/archives/r36.3/DeveloperGuide/HR/JetsonModuleAdaptationAndBringUp/JetsonAgxOrinSeries.html?highlight=universal%20serial%20bus#porting-the-universal-serial-bus

I think we can discuss it after you read this document.

For example, usb@3550000 is for usb device mode. usb@3610000 is for usb host mode.

A hub should only have function for usb host mode.

Thanks for quick reply,

Sorry, could i have some questions? How to know the purpose of a node? Because i don’t see that in properties.
Example, usb node does not mention is USB HUB, or M2 Connector or Type-C.

Thanks so much!

What does “node” mean here? There are bunches of nodes in device tree. Which one are you talking about?

Actually the original NV devkit is already a platform as a template that demos you lots of kind of thing.
It has USB hub, M.2 connecotr and also a type C. Which means NV original default dtb file already has them.

The problem here is you don’t know the mapping of each thing to the hardware there. For that case, you need to read the schematic and this thing is over here.

A USB hub and M.2 no need to directly tell you something like “it is a usb hub / it is a m.2” in device tree. They are not complicated as type C.

Hi WayneWWW,
Thanks for your reply, it is very useful for me!

About UART section, i have a concern.
I’m following the Jetson_Orin_NX_Nano_Design_Guide-DG-10931-001_v1.3.pdf from Jetson Download Center.

This document only mention to UART0, UART1, UART2. But in the tegra234.dtsi file, they are uarta:serial@3100000, uarte:serial@3140000, uarti:serial@31d0000

How can i match them?

Thanks so much!

You can refer to this page.

https://elinux.org/Jetson/L4T/peripheral/#Mapping_3

But he final device /dev/ttyTHSx might be different between rel-35 and rel-36.

That’s great!

I need to disable General UART

I converted the final tegra234-p3768-0000+p3767-0005-nv.dtb to .dts and see 3 port are enabled, i think them should be:
uarta:serial@3100000 → General UART
uarte:serial@3140000 → M.2 Key
uarti:serial@31d0000 → Debug

Whether i only need to disable uarta:serial@3100000, right?

Additionally, should i need to add more uartb@3110000 for M.2 and uartc@c280000 for Debug, instead for uarti:serial@31d0000 and uarte:serial@3140000 ?

please file a more specific topic for this new question.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.