~~NOCACHE~~
{{template>intern:templates:tabs_bootstrap_new|lang="intern"|mod_name="tqma7x"|mod_name_head="TQMa7x"|mod_arch="arm"|bsp_name="linux"|bsp_name_head="Linux"|build_system="ptxdist"|build_system_head="PTXdist"}}
\\
\\
~~NOCACHE~~
===== How-to =====
----
===== Load / Change / Save the Device Tree under U-Boot =====
\\
Devicetree can be edit with the **fdt** commands under U-Boot.
For testing purpose only. For bigger changes, please compile the Devicetree.\\ Therefore you can have a look at the following [[intern:general_information:tutorial:devicetree|tutorial]].
Tested with **TQMa7x BSP Rev.0101**
1) At first the fdt file has to be loaded from the current boot medium (mmc) into RAM.
=> run loadfdt
2) Next step is to set the predefined U-Boot environment variable fdt_addr through the **fdt addr** command.
=> fdt addr $fdt_addr
3) Afterwards the size of the fdt has to be increased (to the next 4K divider) in order to have some space for modifications. This is simply done by entering:
=> fdt resize
4) List device in the tree you want to change to have a look at the default settings.
++++Example|
=> fdt list /gpio-leds
gpio-leds {
compatible = "gpio-leds";
status = "okay";
led1 {
};
led2 {
};
};
=> fdt print /gpio-leds
gpio-leds {
compatible = "gpio-leds";
status = "okay";
led1 {
label = "led1";
gpios = <0x0000005f 0x00000008 0x00000000>;
linux,default-trigger = "default-on";
};
led2 {
label = "led2";
gpios = <0x0000005f 0x00000009 0x00000000>;
linux,default-trigger = "heartbeat";
};
};
++++
5) To modify a value of a propertie use the **fdt set** command.
=> fdt set
++++Example|
=> fdt set /gpio-leds status disabled
++++
6) //Optional:// If you want to save your modified Devicetree back to mmc you'll have to run the following command:
=> fatwrite mmc $mmcdev:$firmwarepart $fdt_addr $fdt_file
You can find out of the modified fdt by entering the command **fdt header**
Otherwise you can boot your module with the changed Devicetree right after the modification.
----
\\