![]() This can be accomplished in many different ways: pulling GPIO pins, programming hardware fuses, storing values in non-volatile memory, etc. It is important for the software running on the new design to recognize the unique set of peripherals and components used on the PCB so that the drivers can be properly loaded and configured. One common challenge: how to properly load and configure software drivers during boot. or software related: incorrect device tree, improper drivers, bad configuration values etc. These challenges can be hardware related: incorrect connections, improper voltages, bad component values, etc. When creating a new embedded Linux design, getting a printed circuit board (PCB) to boot for the first time can have many unique challenges. This will allow us to gain some memory/room for our changes.Published On: June, 13, 2018 By: Erik Welsh ![]() Note: about the “fdt resize” command (excerpt from u-boot’s help): fdt resize - Resize fdt to size + padding to 4k addr Libretech_cc# fdt mknode fdt set compatible "maxim,ds3231" Libretech_cc# fdt set pinctrl-names "default" Libretech_cc# fdt addr 0x02f00000 fdt resize On the u-boot command line, this translate into (alias not handled here, not the main aim of the change): libretech_cc# ext4load mmc 0:1 0x02f00000 /meson-gxl-s905x-libretech-cc.dtb I’ll choose 0x100 as number because there are very few chances of collisions. The quick and dirty solution I’m using is to add manually the new phandle. The first one is a label, so all is needed is to replace it with the corresponding node path : second is called a phandle (see the elinux wiki for instance) and when compiled, the device tree binaries are only keeping the ones used and thus, unfortunately for us, the phandle is removed. Unfortunately, there are some small challenges: &i2c_AO and are some kind of references. Looking at the changes done in the device tree, it seems easy. This means that all the changes done in the device tree must be written in terms of u-boot commands. Given that our board is new enough to have a u-boot with device tree support, the new solution coming at hands is to modify the device tree from it. Having to patch the dts and then build the dtb every new kernel update (as long as there are changes in the device tree).The first approach is simple but has some small problems like (the list is not complete and subjective) : So, if the new dts is compiled, and the kernel booted, we can check everything is fine: # ls #size-cells clocks compatible interrupts linux,phandle name phandle pinctrl-0 pinctrl-names reg statusġ-0068 delete_device device name new_device of_node power subsystem uevent This roughly translate into adding the following code to the kernel device-tree. Configure the pinctrl for the pins 3 and 5,. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |