Device tree compiler not recognizes C syntax for include files
This is not a Device Tree syntax issue, you just have to pre-process the .dts file with the C preprocessor, cpp, in order to obtain a file that can be digested by the Device Tree Compiler as is.
In your specific case, assuming your current directory would be the kernel root directory, you would have to use the two following commands:
cpp -nostdinc -I include -I arch -undef -x assembler-with-cpp arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts meson-gxl-s905x-khadas-vim.dts.preprocessed
dtc -I dts -O dtb -p 0x1000 meson-gxl-s905x-khadas-vim.dts.preprocessed -o kvim1.dtb
kvim1.dtb: Warning (unit_address_vs_reg): Node /scpi/clocks/scpi_clocks@0 has a unit name, but no reg property
kvim1.dtb: Warning (unit_address_vs_reg): Node /soc/bus@c8100000/pinctrl@14 has a unit name, but no reg property
kvim1.dtb: Warning (unit_address_vs_reg): Node /soc/periphs@c8834000/rng has a reg or ranges property, but no unit name
kvim1.dtb: Warning (unit_address_vs_reg): Node /soc/periphs@c8834000/pinctrl@4b0 has a unit name, but no reg property
kvim1.dtb: Warning (unit_address_vs_reg): Node /soc/periphs@c8834000/eth-phy-mux has a reg or ranges property, but no unit name
kvim1.dtb: Warning (unit_address_vs_reg): Node /gpio-keys-polled/button@0 has a unit name, but no reg property
kvim1.dtb: Warning (simple_bus_reg): Node /soc/bus@c8100000/pinctrl@14 missing or empty reg/ranges property
kvim1.dtb: Warning (simple_bus_reg): Node /soc/periphs@c8834000/rng simple-bus unit address format error, expected "0"
kvim1.dtb: Warning (simple_bus_reg): Node /soc/periphs@c8834000/pinctrl@4b0 missing or empty reg/ranges property
kvim1.dtb: Warning (simple_bus_reg): Node /soc/periphs@c8834000/eth-phy-mux simple-bus unit address format error, expected "55c"
Verifying kvim1.dtb was built:
ls -ail kvim1.tdb
4359446 -rw-rw-r-- 1 user user 27568 Jun 2 12:05 kvim1.dtb
For the official Device Tree specification, please refer to its official web site and its git repository.
DTC compile error for #address-cells = 2 case
I’ve found how to do it.
For that you should first add CONFIG_ARCH_VEXPRESS and ran ‘make V=1 ARCH=arm64 CROSS_COMPILE=aarch64-none-elf- dtbs |& tee logx’
Dtbs for ARCH_VEXPRESS are generated in the dts directory. Then you can see the command to make the dtb (in the logx file).
Below is the command. Lots of options for the dtc(related to unit address too).
mkdir -p arch/arm64/boot/dts/arm/ ; gcc -E -Wp,-MD,arch/arm64/boot/dts/arm/.fvp-base-revc.dtb.d.pre.tmp -nostdinc -I./scripts/dtc/include-prefixes -undef -D__DTS__ -x assembler-with-cpp -o arch/arm64/boot/dts/arm/.fvp-base-revc.dtb.dts.tmp arch/arm64/boot/dts/arm/fvp-base-revc.dts ; ./scripts/dtc/dtc -O dtb -o arch/arm64/boot/dts/arm/fvp-base-revc.dtb -b 0 -iarch/arm64/boot/dts/arm/ -i./scripts/dtc/include-prefixes -Wno-unit_address_vs_reg -Wno-unit_address_format -Wno-avoid_unnecessary_addr_size -Wno-alias_paths -Wno-graph_child_address -Wno-simple_bus_reg -Wno-unique_unit_address -Wno-pci_device_reg -d arch/arm64/boot/dts/arm/.fvp-base-revc.dtb.d.dtc.tmp arch/arm64/boot/dts/arm/.fvp-base-revc.dtb.dts.tmp ; cat arch/arm64/boot/dts/arm/.fvp-base-revc.dtb.d.pre.tmp arch/arm64/boot/dts/arm/.fvp-base-revc.dtb.d.dtc.tmp > arch/arm64/boot/dts/arm/.fvp-base-revc.dtb.d
You can use this command to make a specific dtb file.
device tree ERROR: Unable to parse input tree (syntax error)
The solution was to change imx7d-pico-pi-m4.dtb to imx7d-pico-pi-qca-m4.dtb in the Yocto/Hardknott/technexion configuration file called pico-imx7.conf(described in the post)
Related Topics
Bash VS Csh VS Others - Which Is Better for Application Maintenance
Sort Across Multiple Files in Linux
Download Images from Google with Command Line
Packet Mangling Utilities Besides Iptables
Percentage Value with Gnu Diff
How to Sleep for 1 Second Between Each Xargs Command
View a Particular Line of a File Denoted by a Number
How to Find or Calculate a Linux Process's Page Table Size and Other Kernel Accounting
How to Setup Oracle Odbc Drivers on Rhel 6/Linux
The Return Code from 'Grep' Is Not as Expected on Linux
Link a Static Library to a Shared One During Build
Define Alias That References Other Aliases
Bash Script Read All the Files in Directory
How to Close a Netcat Connection After a Certain Character Is Returned in the Response
How to Correctly Install Wkhtmltopdf on Debian 64 Bit
Where Is the System Call Table in Linux Kernel
How to Find All the Files That Were Created Today in Unix/Linux