OK. @ShaneCCC.
Thanks to guide me.
I did what you told me.
So, can you please check am I right?
And after that, what should I do for next step?
First, here is the list of what I did.
-
Download L4T kernel source
-
Modify SPI tree section on"tegra194-p2888-0001-p2822-0000-common.dtsi" file in </home/jhschai/L4T_Source/Linux_for_Tegra/source/public/hardware/nvidia/platform/t19x/galen/kernel-dts/common>
I don’t fully understand about devicetree shown in below, but I’m sure I will use SPI1.
##############################################
spi@3210000 {
compatible = “nvidia,tegra186-spi”;
reg = <0x0 0x3210000 0x0 0x10000>;
interrupts = <0x0 0x24 0x4>;
#address-cells = <0x1>;
#size-cells = <0x0>;
iommus = <0x2 0x20>;
dma-coherent;
dmas = <0x1e 0xf 0x1e 0xf>;
dma-names = “rx”, “tx”;
spi-max-frequency = <0x3dfd240>;
nvidia,clk-parents = “pll_p”, “clk_m”;
clocks = <0x4 0x87 0x4 0x66 0x4 0xe>;
clock-names = “spi”, “pll_p”, “clk_m”;
resets = <0x5 0x5b>;
reset-names = “spi”;
status = “okay”;
linux,phandle = <0x162>;
phandle = <0x162>;spi@0 { compatible = "spidev"; reg = <0x0>; spi-max-frequency = <0x1f78a40>; nvidia,enable-hw-based-cs; nvidia,rx-clk-tap-delay = <0x11>; }; spi@1 { compatible = “spidev”; reg = <1>; status = “okay”; }
};
##############################################
-
Build kernel Source form L4T_Source with modified device-tree file.
-
copy builded image file and dtb folder contents.
-
Make new PINMUX.dtsi file from “Template.xlsm”.
-
Make .cfg file with command.
python pinmux-dts2cfg.py --pinmux addr_info.txt gpio_addr_info.txt por_val.txt --mandatory_pinmux_file mandatory_pinmux.txt tegra19x-jetson_agx_devkit-pinmux.dtsi tegra19x-jetson_agx_devkit-gpio-default.dtsi 1.0 > data.cfg
##############################################
Pinmux for gpio-input pins
pinmux.0x02212480 = 0x00000001; # CONFIG Z4
pinmux.0x0243d020 = 0x00000000; # GPIO spi1_miso_pz4
Pinmux for used pins
pinmux.0x0243d040 = 0x00000405; # spi1_sck_pz3: rsvd1, pull-down, tristate-disable, input-disable, lpdr-disable
pinmux.0x0243d020 = 0x00000055; # spi1_miso_pz4: rsvd1, pull-down, tristate-enable, input-enable, lpdr-disable
pinmux.0x0243d058 = 0x00000405; # spi1_mosi_pz5: rsvd1, pull-down, tristate-disable, input-disable, lpdr-disable
pinmux.0x0243d010 = 0x00000409; # spi1_cs0_pz6: rsvd1, pull-up, tristate-disable, input-disable, lpdr-disable
pinmux.0x0243d050 = 0x00000409; # spi1_cs1_pz7: rsvd1, pull-up, tristate-disable, input-disable, lpdr-disable
##############################################
-
Copy contents of new .cfg file to “tegra19x-mb1-pinmux-p2888-0000-a04-p2822-0000-b01.cfg”
-
Flash Kernel with modified PINMUX and modified device tree with command
sudo ./flash.sh kernel-dtb jetson-xavier mmcblk0p1 -
Re-install ubuntu at JETSON BOARD and connect [SPI1_MOSI(Header19)]&[SPI1_MISO(Header21)] to self test SPI.
This is right process to use SPI?
Second, What should I do for next step?
Please guide me little more!!
Thanks