Re: KConfig and DTS files

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

 




Hi Arnd,

On 05/07/2014 11:38 AM, Arnd Bergmann wrote:
On Wednesday 07 May 2014 11:35:12 Eric Nelson wrote:

On 05/07/2014 11:10 AM, Arnd Bergmann wrote:
On Wednesday 07 May 2014 10:47:27 Eric Nelson wrote:

It seems reasonable to tell the kernel to skip this if the
WiFi driver isn't configured into the kernel (i.e. there's
no point in enumerating), so I was hoping to surround this
USDHC2 block with #ifdefs:

          https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.10.17_1.0.0_ga/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi#L640

The alternative aren't very nice:
          populate extra parts to drive these signals, or
          copy the DTB and strip out the unused parts

The first is wasteful (and environmentally un-friendly), and
the second doesn't scale very well and pollutes the Git tree.


It's fine to have two .dtb files (as Olof and Jason also suggested)
and you can even have both in the kernel and just pick the right
one for your machine.

Another option that works is to have the boot loader set up the
present devices. With u-boot, you can easily manipulate the binary dtb
and change a 'status="disabled"' to 'status="ok"' or vice versa
for devices that are only sometimes populated, or you can change
the amount of installed RAM as detected by the loader.


Easily is such a relative term

Thanks for the advice.

I haven't done it myself, but I'm told that you can do it from the
boot script as normal commands, without having to modify the source.


It turns out not to be so difficult, but it is kinda quirky.

Once the fdt is loaded and the address set with "fdt addr",
the "fdt" command can print all or parts of the tree:

	U-Boot > fdt print /v4l2_out
	v4l2_out {
		compatible = "fsl,mxc_v4l2_output";
		status = "okay";
	};

And you can read parts of it into variables. This example
sets the "v4lstat" variable to the value of /v4l2_out.status:

	U-Boot > fdt get value v4lstat /v4l2_out status

	U-Boot > echo $v4lstat
	okay

For me, setting the status to "disabled" required a
"resize" first:

	U-Boot > fdt set /v4l2_out status disabled
	libfdt fdt_setprop(): FDT_ERR_NOSPACE
	U-Boot > fdt resize
	U-Boot > fdt set /v4l2_out status disabled

	U-Boot > fdt print /v4l2_out
	v4l2_out {
		compatible = "fsl,mxc_v4l2_output";
		status = "disabled";
	};

Regards,


Eric
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




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