linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] ARM: mvebu: kirkwood: add PogoPlug series 4 device tree
@ 2015-11-26 23:01 Linus Walleij
  2015-11-27 20:27 ` Andrew Lunn
  0 siblings, 1 reply; 4+ messages in thread
From: Linus Walleij @ 2015-11-26 23:01 UTC (permalink / raw)
  To: linux-arm-kernel

This adds a device tree for the CloudEngines PogoPlug series 4
NAS device. Inspired by out-of-tree boardfiles from ArchLinux
by Kevin Mihelich.

Cc: Moonman <moonman.ca@gmail.com>
Cc: Kevin Mihelich <kevin@archlinuxarm.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/boot/dts/Makefile                       |   1 +
 arch/arm/boot/dts/kirkwood-pogoplug-series-4.dts | 183 +++++++++++++++++++++++
 2 files changed, 184 insertions(+)
 create mode 100644 arch/arm/boot/dts/kirkwood-pogoplug-series-4.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 30bbc3746130..2d9f475a9ceb 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -206,6 +206,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \
 	kirkwood-openrd-client.dtb \
 	kirkwood-openrd-ultimate.dtb \
 	kirkwood-pogo_e02.dtb \
+	kirkwood-pogoplug-series-4.dtb \
 	kirkwood-rd88f6192.dtb \
 	kirkwood-rd88f6281-z0.dtb \
 	kirkwood-rd88f6281-a.dtb \
diff --git a/arch/arm/boot/dts/kirkwood-pogoplug-series-4.dts b/arch/arm/boot/dts/kirkwood-pogoplug-series-4.dts
new file mode 100644
index 000000000000..28318d666e72
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-pogoplug-series-4.dts
@@ -0,0 +1,183 @@
+/*
+ * kirkwood-pogoplug-series-4.dts - Device tree file for PogoPlug Series 4
+ * inspired by the board files made by Kevin Mihelich for ArchLinux,
+ * and their DTS file.
+ *
+ * Copyright (C) 2015 Linus Walleij <linus.walleij@linaro.org>
+ */
+
+/dts-v1/;
+
+#include "kirkwood.dtsi"
+#include "kirkwood-6192.dtsi"
+
+/ {
+	model = "Cloud Engines PogoPlug Series 4";
+	compatible = "cloudengines,pogoplugv4", "marvell,kirkwood-88f6192",
+		     "marvell,kirkwood";
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x08000000>;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8";
+		stdout-path = &uart0;
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		pinctrl-0 = <&pmx_button_eject>;
+		pinctrl-names = "default";
+
+		button at 1 {
+			debounce_interval = <50>;
+			wakeup-source;
+			/* KEY_EJECTCD */
+			linux,code = <161>;
+			label = "Eject Button";
+			gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&pmx_led_green &pmx_led_red>;
+		pinctrl-names = "default";
+
+		health {
+			label = "status:green:health";
+			gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
+			default-state = "on";
+		};
+		fault {
+			label = "status:red:fault";
+			gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
+		};
+	};
+};
+
+&pinctrl {
+	pmx_sata0: pmx-sata0 {
+		marvell,pins = "mpp21";
+		marvell,function = "sata0";
+	};
+
+	pmx_sata1: pmx-sata1 {
+		marvell,pins = "mpp20";
+		marvell,function = "sata1";
+	};
+
+	pmx_sdio_cd: pmx-sdio-cd {
+		marvell,pins = "mpp27";
+		marvell,function = "gpio";
+	};
+
+	pmx_sdio_wp: pmx-sdio-wp {
+		marvell,pins = "mpp28";
+		marvell,function = "gpio";
+	};
+
+	pmx_button_eject: pmx-button-eject {
+		marvell,pins = "mpp29";
+		marvell,function = "gpio";
+	};
+
+	pmx_led_green: pmx-led-green {
+		marvell,pins = "mpp22";
+		marvell,function = "gpio";
+	};
+
+	pmx_led_red: pmx-led-red {
+		marvell,pins = "mpp24";
+		marvell,function = "gpio";
+	};
+};
+
+&uart0 {
+	status = "okay";
+};
+
+/*
+ * This PCIE controller has a USB 3.0 XHCI controller at 1,0
+ */
+&pciec {
+	status = "okay";
+};
+
+&pcie0 {
+	status = "okay";
+};
+
+&i2c0 {
+	status = "okay";
+};
+
+&sata {
+	status = "okay";
+	pinctrl-0 = <&pmx_sata0 &pmx_sata1>;
+	pinctrl-names = "default";
+	nr-ports = <1>;
+};
+
+&sdio {
+	status = "okay";
+	pinctrl-0 = <&pmx_sdio &pmx_sdio_cd &pmx_sdio_wp>;
+	pinctrl-names = "default";
+	cd-gpios = <&gpio0 27 GPIO_ACTIVE_LOW>;
+	wp-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>;
+};
+
+&nand {
+	/* 128 MiB of NAND flash */
+	chip-delay = <40>;
+	status = "okay";
+	partitions {
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partition at 0 {
+			label = "u-boot";
+			reg = <0x00000000 0x200000>;
+			read-only;
+		};
+
+		partition at 200000 {
+			label = "uImage";
+			reg = <0x00200000 0x300000>;
+		};
+
+		partition at 500000 {
+			label = "uImage2";
+			reg = <0x00500000 0x300000>;
+		};
+
+		partition at 800000 {
+			label = "failsafe";
+			reg = <0x00800000 0x800000>;
+		};
+
+		partition at 1000000 {
+			label = "root";
+			reg = <0x01000000 0x7000000>;
+		};
+	};
+};
+
+&mdio {
+	status = "okay";
+
+	ethphy0: ethernet-phy at 0 {
+		reg = <0>;
+	};
+};
+
+&eth0 {
+	status = "okay";
+	ethernet0-port at 0 {
+		phy-handle = <&ethphy0>;
+	};
+};
-- 
2.4.3

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

* [PATCH 2/2] ARM: mvebu: kirkwood: add PogoPlug series 4 device tree
  2015-11-26 23:01 [PATCH 2/2] ARM: mvebu: kirkwood: add PogoPlug series 4 device tree Linus Walleij
@ 2015-11-27 20:27 ` Andrew Lunn
  2015-12-11  8:28   ` Linus Walleij
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Lunn @ 2015-11-27 20:27 UTC (permalink / raw)
  To: linux-arm-kernel

> +	chosen {
> +		bootargs = "console=ttyS0,115200n8";
> +		stdout-path = &uart0;

Hi Linus

You can append the baud rate etc to uart0, and then don't need
bootargs.

> +	};
> +
> +	gpio_keys {
> +		compatible = "gpio-keys";
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +		pinctrl-0 = <&pmx_button_eject>;
> +		pinctrl-names = "default";
> +
> +		button at 1 {
> +			debounce_interval = <50>;
> +			wakeup-source;
> +			/* KEY_EJECTCD */
> +			linux,code = <161>;

include/dt-bindings/input/linux-event-codes.h and then

	                linux,code = <KEY_EJECTCD>

> +			label = "Eject Button";
> +			gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
> +		};
> +	};
> +
> +	gpio-leds {
> +		compatible = "gpio-leds";
> +		pinctrl-0 = <&pmx_led_green &pmx_led_red>;
> +		pinctrl-names = "default";
> +
> +		health {
> +			label = "status:green:health";

The convention is that the first part of the label is the machine
name. OpenWRT and others often does something else... So

s/status/pogoplugv4/g
 
> +			gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
> +			default-state = "on";
> +		};
> +		fault {
> +			label = "status:red:fault";
> +			gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
> +		};
> +	};
> +};


> +&i2c0 {
> +	status = "okay";
> +};

Is there something on this i2c bus?

Thanks
	Andrew

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

* [PATCH 2/2] ARM: mvebu: kirkwood: add PogoPlug series 4 device tree
  2015-11-27 20:27 ` Andrew Lunn
@ 2015-12-11  8:28   ` Linus Walleij
  2015-12-11 14:21     ` Andrew Lunn
  0 siblings, 1 reply; 4+ messages in thread
From: Linus Walleij @ 2015-12-11  8:28 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Nov 27, 2015 at 9:27 PM, Andrew Lunn <andrew@lunn.ch> wrote:
>> +     chosen {
>> +             bootargs = "console=ttyS0,115200n8";
>> +             stdout-path = &uart0;
>
> Hi Linus
>
> You can append the baud rate etc to uart0, and then don't need
> bootargs.

I dropped the bootargs but how do you see it here?

Of course I can do this, so that is what I did:

&uart0 {
    status = "okay";
    current-speed = <115200>;
};

But that only indicates that the hardware (firmware) set up the
port to a speed like that. It wouldn't work if the hardware was
set any other way. It seems to be like so on the PogoPlug though
so I went with this.

It has no way to indicate how parity etc was set up on the UART
though.

However there is also stdout-path, so I went for this:

stdout-path = "serial0:115200n8";

Reposting the patch soon.

Yours,
Linus Walleij

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

* [PATCH 2/2] ARM: mvebu: kirkwood: add PogoPlug series 4 device tree
  2015-12-11  8:28   ` Linus Walleij
@ 2015-12-11 14:21     ` Andrew Lunn
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2015-12-11 14:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Dec 11, 2015 at 09:28:54AM +0100, Linus Walleij wrote:
> On Fri, Nov 27, 2015 at 9:27 PM, Andrew Lunn <andrew@lunn.ch> wrote:
> >> +     chosen {
> >> +             bootargs = "console=ttyS0,115200n8";
> >> +             stdout-path = &uart0;
> >
> > Hi Linus
> >
> > You can append the baud rate etc to uart0, and then don't need
> > bootargs.

> However there is also stdout-path, so I went for this:
> 
> stdout-path = "serial0:115200n8";

Hi Linus

Yes, this is what i meant.

     Andrew

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

end of thread, other threads:[~2015-12-11 14:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-26 23:01 [PATCH 2/2] ARM: mvebu: kirkwood: add PogoPlug series 4 device tree Linus Walleij
2015-11-27 20:27 ` Andrew Lunn
2015-12-11  8:28   ` Linus Walleij
2015-12-11 14:21     ` Andrew Lunn

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