Array manipulation revisit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



I saw this old thread on array manipulation:
    https://www.spinics.net/lists/devicetree-compiler/msg02575.html
and was wondering if anything got implemented to handle arrays and I'm just not finding it.

For most cases I've encountered there are workarounds for dealing with the arrays, but I'd like to figure out a way to update GPIO line names from an overlay.  Example:

&gpio {
	gpio-line-names =
		"QSPI_CLK", /* GPIO0 (example, not always the same) */
		"QSPI_DQ1", /* GPIO1 (example, not always the same) */
		"QSPI_DQ2", /* GPIO2 (example, not always the same) */
		"QSPI_DQ3", /* GPIO3 (example, not always the same) */
		"QSPI_DQ0", /* GPIO4 (example, not always the same) */
		"QSPI_CS_B", /* GPIO5 (example, not always the same) */
		/* ... */
		"GPIO_MUX_SEL0", /* GPIO148 (thing to add) */
		"GPIO_MUX_SEL1", /* GPIO149 (thing to add) */
		/* ... */
	};
};

What I'm looking at is that I have several layers of device tree information:
    1) shared-based-device.dtb
    2) fpga-overlay.dtbo (different for every device)
    3) config-specific-overlay.dtbo

When all of this information is integrated into a single tree I can use #defines to set names for all the pins and then write out the pin information all at once (though this is a little painful, since it requires a #define for each pin).  However, when this information is in an overlay I need to know what the current contents are to replace things properly.  So, what I would _like_ to be able to do is something like this:

&gpio {
	gpio-line-names[148] = "GPIO_MUX_SEL0";
	gpio-line-names[149] = "GPIO_MUX_SEL1";
};

Then when the overlay is applied what I would expect to happen would be for libfdt to read the existing value, find and replace the specified indices, and then set the full property with the new value.  Is this totally crazy?  Is there already a better way to do this?

Best,
Erich E. Hoover, Ph.D.
erich.hoover@xxxxxxxxxxxx




[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux