Hi everyone, I want to add new sensor with MIPI-CIS connector. I have read “Tegra Linux Driver” document that have an chapter “Camera Modules and Device Tree”. That chapter tell me which file I need make, some .c,.h,.dtsi, but it doesn’t show me how to make them work. May be that’s some basic knowledge of Linux development but I mostly develop window application and driver. So my question is:
- How to compile dtsi file? I know use dtc command and use CPP to solve the problem of ‘#include’, but compile still fail with ‘syntax error FATAL ERROR: Unable to parse input tree’.
Actually I didn’t add or change any code, just want to try the code of Sony IMX219.
I found tegra210-camera-rbpcv2-imx219.dtsi include by tegra210-porg-p3448-common.dtsi that include in tegra210-p3448-0000-p3449-0000-a00.dts (that in directory /public_sources/hardware/nvidia/platform/t210/porg/kernel-dts). So I try below script to compile…
device="tegra210-p3448-0000-p3449-0000-a00" src_dts=$device.dts tmp_dts=$device.tmp.dts dst_dtb=$device.dtb cpp -nostdinc -I. \ -isystem /home/leon/Downloads/public_sources/hardware/nvidia/platform/t210/common/kernel-dts \ -isystem /home/leon/Downloads/public_sources/hardware/nvidia/soc/t210/kernel-dts \ -isystem /home/leon/Downloads/public_sources/hardware/nvidia/soc/tegra/kernel-include \ -undef -x assembler-with-cpp $src_dts > $tmp_dts dtc -I dts -O dtb -b 0 -o $dst_dtb $tmp_dts rm $tmp_dts
but fail… I don’t know what’s meaning about the error code
leon@leon-ubuntu:~/Downloads/public_sources/hardware/nvidia/platform/t210/porg/kernel-dts$ ./dts2dtb.sh Error: /home/leon/Downloads/public_sources/hardware/nvidia/platform/t210/common/kernel-dts/t210-common-platforms/tegra210-common.dtsi:0.136-137 syntax error FATAL ERROR: Unable to parse input tree
- Another question is if I succeeded compile driver code(.c,.h file) and .dtsi file, e.g. got imx219.ko and tegra210-p3448-0000-p3449-0000-a00.dtb. Does the new driver will work if I overlay old files of ubuntu and reboot it?? If don’t work how should I do?
I’m appreciated for any help