devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] yamldt and dts2yaml.
@ 2017-09-04 13:48 Pantelis Antoniou
  2017-09-05 20:34 ` Rob Herring
  0 siblings, 1 reply; 2+ messages 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] 2+ messages in thread

* Re: [RFC] yamldt and dts2yaml.
  2017-09-04 13:48 [RFC] yamldt and dts2yaml Pantelis Antoniou
@ 2017-09-05 20:34 ` Rob Herring
  0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2017-09-05 20:34 UTC (permalink / raw)
  To: Pantelis Antoniou
  Cc: Frank Rowand, Grant Likely, David Gibson, Tom Rini,
	Franklin S Cooper Jr, Matt Porter, Simon Glass, Phil Elwell,
	Geert Uytterhoeven, Marek Vasut, Devicetree Compiler,
	devicetree@vger.kernel.org

On Mon, Sep 4, 2017 at 8:48 AM, Pantelis Antoniou <pantelis.antoniou@konsulko.com> wrote:
> 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).

Which ones are those? I don't want to see anything beyond defines that result in a single number.

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

I have no comments because I have no use for this on its own. I want to see a schema definition and tools to check schema files. 

Rob

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-05 20:34 UTC | newest]

Thread overview: 2+ messages (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
2017-09-05 20:34 ` Rob Herring

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