SC16IS752 Serial Expansion Board

Continuing the discussion from SC16IS7xx Serial expander support Device Tree:

I’m trying to follow the instructions from the linked post, but am having issues making it work.

First, I’m really unclear on how to change Pin 18 to GPIO3_PB.07. When I download the pinmux spreadsheet for the Jetson Nano, it looks like spi2_cs0 is already set to GPIO3_PB.07, but there’s no mention of pin 18, so I’m not entirely sure.

Assuming that I didn’t need to change that, I went ahead with the make commands, but I get a syntax error from the modification of the dtsi file. The output of the make dtbs command is:

$ make -C kernel/kernel-4.9/ ARCH=arm64 O=$TEGRA_KERNEL_OUT LOCALVERSION=-tegra CROSS_COMPILE=${TOOLCHAIN_PREFIX} -j8 --output-sync=target dtbs
  CHK     scripts/mod/devicetable-offsets.h
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t210/jetson/kernel-dts/tegra210-jetson-e-base-p2595-0000-a00.dtb
Error: /home/bluecamel/nano_kernel/Linux_for_Tegra/source/public/kernel/kernel-4.9/../../hardware/nvidia/soc/t210/kernel-dts/tegra210-soc/tegra210-soc-shield.dtsi:435.12-13 syntax error
FATAL ERROR: Unable to parse input tree
/home/bluecamel/nano_kernel/Linux_for_Tegra/source/public/kernel/kernel-4.9/arch/arm64/boot/dts/Makefile:120: recipe for target 'arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t210/jetson/kernel-dts/tegra210-jetson-e-base-p2595-0000-a00.dtb' failed
make[2]: *** [arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t210/jetson/kernel-dts/tegra210-jetson-e-base-p2595-0000-a00.dtb] Error 1
make[2]: *** Waiting for unfinished jobs....
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t210/jetson/kernel-dts/tegra210-jetson-cv-base-p2597-2180-a00.dtb
Error: /home/bluecamel/nano_kernel/Linux_for_Tegra/source/public/kernel/kernel-4.9/../../hardware/nvidia/soc/t210/kernel-dts/tegra210-soc/tegra210-soc-shield.dtsi:435.12-13 syntax error
FATAL ERROR: Unable to parse input tree
/home/bluecamel/nano_kernel/Linux_for_Tegra/source/public/kernel/kernel-4.9/arch/arm64/boot/dts/Makefile:120: recipe for target 'arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t210/jetson/kernel-dts/tegra210-jetson-cv-base-p2597-2180-a00.dtb' failed
make[2]: *** [arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t210/jetson/kernel-dts/tegra210-jetson-cv-base-p2597-2180-a00.dtb] Error 1
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t210/jetson/kernel-dts/tegra210-jetson-cv-p2597-2180-a00.dtb
Error: /home/bluecamel/nano_kernel/Linux_for_Tegra/source/public/kernel/kernel-4.9/../../hardware/nvidia/soc/t210/kernel-dts/tegra210-soc/tegra210-soc-shield.dtsi:435.12-13 syntax error
FATAL ERROR: Unable to parse input tree
/home/bluecamel/nano_kernel/Linux_for_Tegra/source/public/kernel/kernel-4.9/arch/arm64/boot/dts/Makefile:120: recipe for target 'arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t210/jetson/kernel-dts/tegra210-jetson-cv-p2597-2180-a00.dtb' failed
make[2]: *** [arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t210/jetson/kernel-dts/tegra210-jetson-cv-p2597-2180-a00.dtb] Error 1
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t210/jetson/kernel-dts/tegra210-jetson-tx1-imx274-dp-hdmi.dtb
Error: /home/bluecamel/nano_kernel/Linux_for_Tegra/source/public/kernel/kernel-4.9/../../hardware/nvidia/soc/t210/kernel-dts/tegra210-soc/tegra210-soc-shield.dtsi:435.12-13 syntax error
FATAL ERROR: Unable to parse input tree
/home/bluecamel/nano_kernel/Linux_for_Tegra/source/public/kernel/kernel-4.9/arch/arm64/boot/dts/Makefile:120: recipe for target 'arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t210/jetson/kernel-dts/tegra210-jetson-tx1-imx274-dp-hdmi.dtb' failed
make[2]: *** [arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t210/jetson/kernel-dts/tegra210-jetson-tx1-imx274-dp-hdmi.dtb] Error 1
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t210/jetson/kernel-dts/tegra210-jetson-cv-p2597-2180-a00-auo-1080p-edp.dtb
Error: /home/bluecamel/nano_kernel/Linux_for_Tegra/source/public/kernel/kernel-4.9/../../hardware/nvidia/soc/t210/kernel-dts/tegra210-soc/tegra210-soc-shield.dtsi:435.12-13 syntax error
FATAL ERROR: Unable to parse input tree
/home/bluecamel/nano_kernel/Linux_for_Tegra/source/public/kernel/kernel-4.9/arch/arm64/boot/dts/Makefile:120: recipe for target 'arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t210/jetson/kernel-dts/tegra210-jetson-cv-p2597-2180-a00-auo-1080p-edp.dtb' failed
make[2]: *** [arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t210/jetson/kernel-dts/tegra210-jetson-cv-p2597-2180-a00-auo-1080p-edp.dtb] Error 1
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t210/jetson/kernel-dts/tegra210-jetson-cv-p2597-2180-imx274-hdmi.dtb
Error: /home/bluecamel/nano_kernel/Linux_for_Tegra/source/public/kernel/kernel-4.9/../../hardware/nvidia/soc/t210/kernel-dts/tegra210-soc/tegra210-soc-shield.dtsi:435.12-13 syntax error
FATAL ERROR: Unable to parse input tree
/home/bluecamel/nano_kernel/Linux_for_Tegra/source/public/kernel/kernel-4.9/arch/arm64/boot/dts/Makefile:120: recipe for target 'arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t210/jetson/kernel-dts/tegra210-jetson-cv-p2597-2180-imx274-hdmi.dtb' failed
make[2]: *** [arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t210/jetson/kernel-dts/tegra210-jetson-cv-p2597-2180-imx274-hdmi.dtb] Error 1
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t210/jetson/kernel-dts/tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb
Error: /home/bluecamel/nano_kernel/Linux_for_Tegra/source/public/kernel/kernel-4.9/../../hardware/nvidia/soc/t210/kernel-dts/tegra210-soc/tegra210-soc-shield.dtsi:435.12-13 syntax error
FATAL ERROR: Unable to parse input tree
/home/bluecamel/nano_kernel/Linux_for_Tegra/source/public/kernel/kernel-4.9/arch/arm64/boot/dts/Makefile:120: recipe for target 'arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t210/jetson/kernel-dts/tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb' failed
make[2]: *** [arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t210/jetson/kernel-dts/tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb] Error 1
  DTC     arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t210/jetson/kernel-dts/tegra210-jetson-tx1-p2597-2180-a01-android-devkit.dtb
Error: /home/bluecamel/nano_kernel/Linux_for_Tegra/source/public/kernel/kernel-4.9/../../hardware/nvidia/soc/t210/kernel-dts/tegra210-soc/tegra210-soc-shield.dtsi:435.12-13 syntax error
FATAL ERROR: Unable to parse input tree
/home/bluecamel/nano_kernel/Linux_for_Tegra/source/public/kernel/kernel-4.9/arch/arm64/boot/dts/Makefile:120: recipe for target 'arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t210/jetson/kernel-dts/tegra210-jetson-tx1-p2597-2180-a01-android-devkit.dtb' failed
make[2]: *** [arch/arm64/boot/dts/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/_ddot_/hardware/nvidia/platform/t210/jetson/kernel-dts/tegra210-jetson-tx1-p2597-2180-a01-android-devkit.dtb] Error 1
arch/arm64/Makefile:154: recipe for target 'dtbs' failed
make[1]: *** [dtbs] Error 2
Makefile:171: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2

I would really appreciate if anyone can point me in the right direction to make this work. Thanks!

Well, I figured out one of the problems. Copying the provided block into the tegra210-soc-shield.dtsi file apparently got the wrong character for double quotes. I changed those and was able to compile and flash. However, the sc16is7xx kernel module doesn’t appear to be there. When I run sudo modprobe sc16is7xx I get an error that the module is not found.

I should mention that I did one other thing different than what the post said, since I got an error until I added an additional line to build/.config: CONFIG_SERIAL_SC16IS7XX_SPI=n

Hi bluecamel,

Are you using the devkit or custom board for Jetson Nano?
What’s your Jetpack version in use?

From pinmux spreadsheet, you could find the pin SPI1_CS0 configured as GPIO3_PB.07 by default.


Pin 18 here means the 18th pin on 40-pin header and you could find it from the spec of carrier board.

This is on a Jetson Nano Development Kit (A02). I’m working with Jetpack 4.6.4 and L4T 32.7.4.

I hadn’t been able to use the spreasheet because I didn’t have Excel yesterday, but I was able to get a trial copy this morning and generate the dtsi. I changed column AA to pu and column AU to Int PU, which I think is what the previous poster was saying to do. I generated the dtsi files and continued with the rest of the steps for that and I’m not sure if that worked.

After flashing, I can run sudo cat /sys/kernel/debug/gpio and the line for gpio-110 is blank aside from that name:

$ sudo cat /sys/kernel/debug/gpio | grep 110
 gpio-110 (                    )

Also, as far as the kernel module, I had misinterpreted and realized that it isn’t building a module, but is instead building it into the kernel. I now see that the devices (/dev/ttySC0 and /dev/ttySC1) are being created, but when I try to use them, dmesg repeatedly shows an error:

[ 3942.400194] tegra-i2c 7000c400.i2c: no acknowledge from address 0x48

Well, I seem to have figured it out. I had two of these boards and, though I had no real reason to suspect one of them defective, I decided to try the second and I can send characters back and forth using screen/minicom. I’ll have to try some other devices to confirm.

I guess I must have had the device tree and kernel compiled correctly all along. I would still appreciate if someone could point me to a guide for the device tree that doesn’t require days of study to grok, because that’s still clear as mud to me :)

Configuring the device tree depends on the different drivers needing and the module.
If you get a new module for your board, there should be the porting guide including all necessary modifications for device tree from your vendor.

Editing a device tree is simple. The hard part is knowing what edits to make.

Some devices are “plug-n-play”, meaning that they can self-report what they are and where they are. Drivers use that information to decide which driver works with it, and to arrange what physical address to find the device at. Other devices require “firmware”, of which the device tree is a subset. That particular subset provides the things the driver need to find and operate the device. This includes the physical address, explicitly naming what drivers work with the device, and perhaps some of the driver parameters for loading. Addresses are based on a physical address on a bus, and might include setting up “general purpose” I/O (GPIO) for some specific purpose. If it is an i2c device, then the node will start with “i2c@...some hexadecimal address...”. The driver it works with will have its name in the right hand side of a “compatible” statement of the device tree node. So it isn’t really possible to just guess the details, although it is possible to easily make the edits if you know some details and if you have a similar device with a device tree.

I can’t really give you an answer, but if you need to change “pin 18”, then it implies usually using the PINMUX spreadsheet to set up that pin to the correct function. I don’t even know if pin 18 can be changed (I don’t know if it is GPIO or something else). However, assuming this is an ordinary Jetson Nano development kit, this would show the PINMUX spreadsheet:
https://developer.nvidia.com/embedded/downloads#?search=pinmux&tx=$product,jetson_nano
(you would enable macros and look for what pin 18 can be set up as, along with what is required)

If you had the pin set up correctly, then that would at least be a start.