devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] yamldt and dts2yaml.
@ 2017-09-04 13:48 Pantelis Antoniou
  0 siblings, 0 replies; only message in thread
From: Pantelis Antoniou @ 2017-09-04 13:48 UTC (permalink / raw)
  To: Frank Rowand
  Cc: Grant Likely, David Gibson, Tom Rini, Rob Herring,
	Franklin S Cooper Jr, Matt Porter, Simon Glass, Phil Elwell,
	Geert Uytterhoeven, Marek Vasut, Devicetree Compiler,
	devicetree-u79uwXL29TY76Z2rM5mHXA

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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-09-04 13:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-04 13:48 [RFC] yamldt and dts2yaml Pantelis Antoniou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).