Dear Community,
I’m currently trying to integrate the SC16IS752 (SC16IS7xx Datasheet) into one of my Jetson Nano projects.
The chip acts as a UART expander from I2C or SPI to two more Serial ports.
There even is a driver in the kernel (driver).
For testing purposes, I use the Waveshare breakout board (WS breakout). Since this product is originally designed for the Raspberry Pi, some additional steps are necessary for using the IC with the Jetson Nano.
First, I modified the Tegra kernel config such that the driver is built as a module and installed. ( I used the scripts provided by jetson hacks to perform these tasks: scripts)
As a second step, the Device Tree needs to be adapted. Therefore, I extracted the entire tree with the command
dtc -I fs -O dts -o extracted.dts /proc/device-tree
The extracted device tree : extracted.txt (284.1 KB)
I think, that I need to add the DT node for the SC16 in the i2c@7000c400
block. (Line 9258), since this block corresponds to i2c1.
For the entry which I need to add at this place, I had a look at the DT overlay for Raspberry Pi.
I figured the IC source clock (clocks), max frequency, interrupt parent, phandle, reg and clock-frequency as well as the phandle and clock-frequency for clk out. But I have a problem with the interrupts field. I set the last value to IRQ_TYPE_LEVEL_HIGH according to the irq.h. But I do not know, how to get the middle field. For reference, I posted my proposed DT entry below. I hope, someone can help me with the interrupts field.
sc16is752@48 {
compatible = "nxp,sc16is752";
clocks = <0x81>; # phandle to the IC source clock
gpio-controller;
status = "okay";
i2c-max-frequency = <0x61a80>; # 400000 Hz
interrupt-parent = <0x118>; # i2c phandle
#interrupts = <0x1f1 0x2>;
interrupts = <0x0 ?? 0x4>;
phandle = <0x02>; #Process Handle, should be unique
reg = <0x48>; # IC I2C address
#gpio-cells = <0x0>;
clock-frequency = <0xbb8000>; # 12288000 Hz
sc16is752_clk {
compatible = "fixed-clock";
#clock-cells = <0x0>;
phandle = <0x01>; # Process Handle, should be unique
clock-frequency = <0xe10000>; # 14745600 Hz
};
};
Please let me know, if you need any further information
Thank you and have a nice day. ;)