[RFC] yamldt and dts2yaml.

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

 




Hi all,

yamldt has a new minor release out (v0.3)

The last minor release brought schema validation, and this one
bring dts2yaml an automatic DTS to YAML conversion tool.

The test-suite converts and compiles all the current DTS files in
the kernel and out of the 1.3 thousand DTS files only 6 fail to
convert (due to complex macro usage that make the source file look
nothing like DTS).

Conversion is extremely simple:

$ dts2yaml -r bcm2837-rpi-3-b.dts

Will convert the rpi-3 DTS file (and all the included files).

$ ls *.yaml*
bcm2835-rpi.yamli  bcm2837-rpi-3-b.yaml  bcm2837.yamli  bcm283x-rpi-smsc9514.yamli  bcm283x-rpi-usb-host.yamli  bcm283x.yamli

$ cat bcm2837-rpi-3-b.dts 
/dts-v1/;
#include "bcm2837.dtsi"
#include "bcm2835-rpi.dtsi"
#include "bcm283x-rpi-smsc9514.dtsi"
#include "bcm283x-rpi-usb-host.dtsi"

/ {
	compatible = "raspberrypi,3-model-b", "brcm,bcm2837";
	model = "Raspberry Pi 3 Model B";

	memory {
		reg = <0 0x40000000>;
	};

	leds {
		act {
			gpios = <&gpio 47 0>;
		};
	};
};

&uart1 {
	status = "okay";
};

/* SDHCI is used to control the SDIO for wireless */
&sdhci {
	pinctrl-names = "default";
	pinctrl-0 = <&emmc_gpio34>;
	status = "okay";
	bus-width = <4>;
	non-removable;
};

/* SDHOST is used to drive the SD card */
&sdhost {
	pinctrl-names = "default";
	pinctrl-0 = <&sdhost_gpio48>;
	status = "okay";
	bus-width = <4>;
};

$ cat bcm2837-rpi-3-b.yaml 
#include "bcm2837.yamli"
#include "bcm2835-rpi.yamli"
#include "bcm283x-rpi-smsc9514.yamli"
#include "bcm283x-rpi-usb-host.yamli"

compatible: [ "raspberrypi,3-model-b", "brcm,bcm2837" ]
model: "Raspberry Pi 3 Model B"

memory:
  reg: [ 0, 0x40000000 ]

leds:
  act:
    gpios: [ *gpio, 47, 0 ]

*uart1:
  status: "okay"

# SDHCI is used to control the SDIO for wireless
*sdhci:
  pinctrl-names: "default"
  pinctrl-0: *emmc_gpio34
  status: "okay"
  bus-width: 4
  non-removable: true

# SDHOST is used to drive the SD card
*sdhost:
  pinctrl-names: "default"
  pinctrl-0: *sdhost_gpio48
  status: "okay"
  bus-width: 4


For more take a look here.

https://github.com/pantoniou/yamldt

I am eagerly awaiting for your comments.

Regards

-- Pantelis

--
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