Enable SPI configuration on Orin NX JP5.1.2

Hi

I want to evaluate HDMI to SDI on our custom carrier board for Orin NX p3768.
I want to configure the GS Chip - GS12170-IBE3 over SPI because we need to send the processed video in SDI format for our requirement.

Schematic:

HDMI connected to SPI -pins 89,91,93,95

I followed : Whether there is any special config to enable SPI? - #9 by wangqunpj but i do not get the expected output

image

Over the GS chip i need to write certain data in the registers.
I need to know what extra configuration needs to be flashed on my board for enabling SPI.


$ ls /dev/spidev*
/dev/spidev0.0  /dev/spidev0.1  /dev/spidev2.0  /dev/spidev2.1

KIndly assist

Hi san1998,

What’s the Jetpack version in use?

It seems you are using SPI0/CS0 currently.
As a result, you should use /dev/spidev0.0 node.

Do you need to port GS chip? (i.e. is there any custom driver for it? Or it can work with current spidev driver?)
Please share the full device tree and dmesg for further check.

@KevinFFF

Its JP5.1.2
yes i am using spidev0.0 node
Yes i need to port GS chip and for that i write data to certain registers over spidev0.0 to initialize HDMI to SDI mode. I just need to know if there is additional SPI configuration i need to flash to my board…

dmesg.txt (64.4 KB)
dts.txt (431.2 KB)

From the device tree file(dts.txt) you shared, it seems the configuration for spi@3210000 is the default one as following.

	spi@3210000 {
		compatible = "nvidia,tegra186-spi";
		reg = <0x00 0x3210000 0x00 0x10000>;
		interrupts = <0x00 0x24 0x04>;
		#address-cells = <0x01>;
		#size-cells = <0x00>;
		iommus = <0x07 0x04>;
		dma-coherent;
		dmas = <0x40 0x0f 0x40 0x0f>;
		dma-names = "rx\0tx";
		spi-max-frequency = <0x3dfd240>;
		nvidia,clk-parents = "pll_p\0clk_m";
		clocks = <0x02 0x87 0x02 0x66 0x02 0x0e>;
		clock-names = "spi\0pll_p\0clk_m";
		resets = <0x02 0x5b>;
		reset-names = "spi";
		status = "okay";
		phandle = <0x30f>;

		prod-settings {
			#prod-cells = <0x04>;

			prod {
				prod = <0x00 0x194 0x80000000 0x00>;
			};
		};

		spi@0 {
			compatible = "tegra-spidev";
			reg = <0x00>;
			spi-max-frequency = <0x2faf080>;

			controller-data {
				nvidia,enable-hw-based-cs;
				nvidia,rx-clk-tap-delay = <0x10>;
				nvidia,tx-clk-tap-delay = <0x00>;
			};
		};

What did you port for GS Chip?
Have you gotten any porting guide or related custom driver from your vendor?

@KevinFFF

According to the manual i have to initialize HDMI to SDI mode by writing certain data to registers.
For this i open spidev0.0 and set max frequency to 10Hz
i use a python script to do write data to registers

Do you mean that it doesn’t need specific driver and just need few data from SPI to be configured?
What’s the result after you perform them?
Do you also get a scope to check if the data is sent correctly?

@KevinFFF

yes just need to write data from spi for configuration

we will check with a scope and verify…
according to the logs my SPI device is available i just need to initialize it and write data to it am i correct?

Yes, SPI would work if you’ve enabled it in device tree and also configured the pinmux for those SPI pins.
You can just use spidev_test tool to send SPI data as following.

$ wget https://raw.githubusercontent.com/torvalds/linux/v5.10/tools/spi/spidev_test.c
$ gcc -o spidev_test spidev_test.c

$ sudo ./spidev_test -D /dev/spidev0.0 -v -p "HelloWorld"