From b941a5cbe10201afa937fba90d68d7af6093d3d4 Mon Sep 17 00:00:00 2001 From: Sergei Shtylyov Date: Wed, 7 Oct 2015 02:05:41 +0300 Subject: [PATCH 1/7] ARM: shmobile: porter: add SDHI0/2 DT support Define the Porter board dependent part of the SDHI0/2 device nodes along with the necessary voltage regulators (note that the Vcc regulators are dummy -- they are required but don't actually exist on the board). Also, GPIOs have to be used for the CD and WP signals due to the SDHI driver constraints... This patch is analogous to the commit 1299df03d719 ("ARM: shmobile: henninger: add SDHI0/2 DT support") as there are no differences between those boards in this respect. Signed-off-by: Sergei Shtylyov Signed-off-by: Simon Horman --- arch/arm/boot/dts/r8a7791-porter.dts | 76 ++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/arch/arm/boot/dts/r8a7791-porter.dts b/arch/arm/boot/dts/r8a7791-porter.dts index ca59ff8619230f..5bc4d23c1edbe6 100644 --- a/arch/arm/boot/dts/r8a7791-porter.dts +++ b/arch/arm/boot/dts/r8a7791-porter.dts @@ -10,6 +10,7 @@ /dts-v1/; #include "r8a7791.dtsi" +#include / { model = "Porter"; @@ -33,6 +34,50 @@ device_type = "memory"; reg = <2 0x00000000 0 0x40000000>; }; + + vcc_sdhi0: regulator@0 { + compatible = "regulator-fixed"; + + regulator-name = "SDHI0 Vcc"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + vccq_sdhi0: regulator@1 { + compatible = "regulator-gpio"; + + regulator-name = "SDHI0 VccQ"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + + gpios = <&gpio2 12 GPIO_ACTIVE_HIGH>; + gpios-states = <1>; + states = <3300000 1 + 1800000 0>; + }; + + vcc_sdhi2: regulator@2 { + compatible = "regulator-fixed"; + + regulator-name = "SDHI2 Vcc"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + vccq_sdhi2: regulator@3 { + compatible = "regulator-gpio"; + + regulator-name = "SDHI2 VccQ"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + + gpios = <&gpio2 26 GPIO_ACTIVE_HIGH>; + gpios-states = <1>; + states = <3300000 1 + 1800000 0>; + }; }; &extal_clk { @@ -54,6 +99,16 @@ renesas,groups = "intc_irq0"; renesas,function = "intc"; }; + + sdhi0_pins: sd0 { + renesas,groups = "sdhi0_data4", "sdhi0_ctrl"; + renesas,function = "sdhi0"; + }; + + sdhi2_pins: sd2 { + renesas,groups = "sdhi2_data4", "sdhi2_ctrl"; + renesas,function = "sdhi2"; + }; }; &scif0 { @@ -78,3 +133,24 @@ micrel,led-mode = <1>; }; }; + +&sdhi0 { + pinctrl-0 = <&sdhi0_pins>; + pinctrl-names = "default"; + + vmmc-supply = <&vcc_sdhi0>; + vqmmc-supply = <&vccq_sdhi0>; + cd-gpios = <&gpio6 6 GPIO_ACTIVE_LOW>; + wp-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>; + status = "okay"; +}; + +&sdhi2 { + pinctrl-0 = <&sdhi2_pins>; + pinctrl-names = "default"; + + vmmc-supply = <&vcc_sdhi2>; + vqmmc-supply = <&vccq_sdhi2>; + cd-gpios = <&gpio6 22 GPIO_ACTIVE_LOW>; + status = "okay"; +}; From efbb05c2c00231d73393390db2156046bda787de Mon Sep 17 00:00:00 2001 From: Sergei Shtylyov Date: Thu, 8 Oct 2015 01:00:06 +0300 Subject: [PATCH 2/7] ARM: shmobile: porter: enable SATA0 Enable SATA0 device for the Porter board. This patch is analogous to the commit 5a62ec57004f ("ARM: shmobile: henninger: enable SATA0") as there are no differences between the boards in this respect. Signed-off-by: Sergei Shtylyov Signed-off-by: Simon Horman --- arch/arm/boot/dts/r8a7791-porter.dts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/boot/dts/r8a7791-porter.dts b/arch/arm/boot/dts/r8a7791-porter.dts index 5bc4d23c1edbe6..7f46980ffd1283 100644 --- a/arch/arm/boot/dts/r8a7791-porter.dts +++ b/arch/arm/boot/dts/r8a7791-porter.dts @@ -154,3 +154,7 @@ cd-gpios = <&gpio6 22 GPIO_ACTIVE_LOW>; status = "okay"; }; + +&sata0 { + status = "okay"; +}; From d6b940395e430a9afd89131d5de8d7ab1c22f5d1 Mon Sep 17 00:00:00 2001 From: Sergei Shtylyov Date: Fri, 9 Oct 2015 00:44:18 +0300 Subject: [PATCH 3/7] ARM: shmobile: porter: add I2C2 DT support Define the Porter board dependent part of the I2C2 device node. This patch is analogous to the commit 29a647c396a0 ("ARM: shmobile: henninger: add I2C2 DT support") as there are no differences between the boards in this respect. Signed-off-by: Sergei Shtylyov Signed-off-by: Simon Horman --- arch/arm/boot/dts/r8a7791-porter.dts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/arm/boot/dts/r8a7791-porter.dts b/arch/arm/boot/dts/r8a7791-porter.dts index 7f46980ffd1283..03edb8424ef560 100644 --- a/arch/arm/boot/dts/r8a7791-porter.dts +++ b/arch/arm/boot/dts/r8a7791-porter.dts @@ -109,6 +109,11 @@ renesas,groups = "sdhi2_data4", "sdhi2_ctrl"; renesas,function = "sdhi2"; }; + + i2c2_pins: i2c2 { + renesas,groups = "i2c2"; + renesas,function = "i2c2"; + }; }; &scif0 { @@ -155,6 +160,14 @@ status = "okay"; }; +&i2c2 { + pinctrl-0 = <&i2c2_pins>; + pinctrl-names = "default"; + + status = "okay"; + clock-frequency = <400000>; +}; + &sata0 { status = "okay"; }; From 778f2e7a7b75e643fb56151797b7d950305b48ea Mon Sep 17 00:00:00 2001 From: Sergei Shtylyov Date: Fri, 9 Oct 2015 00:45:49 +0300 Subject: [PATCH 4/7] ARM: shmobile: porter: add VIN0/ADV7180 DT support Define the Porter board dependent part of the VIN0 device node. Add the device node for Analog Devices ADV7180 video decoder to I2C2 bus. Add the necessary subnodes to interconnect VIN0 and ADV7180 devices. This patch is analogous to the commit 8d62f4f75320 ("ARM: shmobile: henninger: add VIN0/ADV7180 DT support") as there are no differences between the boards in this respect. Signed-off-by: Sergei Shtylyov Signed-off-by: Simon Horman --- arch/arm/boot/dts/r8a7791-porter.dts | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/arch/arm/boot/dts/r8a7791-porter.dts b/arch/arm/boot/dts/r8a7791-porter.dts index 03edb8424ef560..b7fa8261e02feb 100644 --- a/arch/arm/boot/dts/r8a7791-porter.dts +++ b/arch/arm/boot/dts/r8a7791-porter.dts @@ -114,6 +114,11 @@ renesas,groups = "i2c2"; renesas,function = "i2c2"; }; + + vin0_pins: vin0 { + renesas,groups = "vin0_data8", "vin0_clk"; + renesas,function = "vin0"; + }; }; &scif0 { @@ -166,8 +171,38 @@ status = "okay"; clock-frequency = <400000>; + + composite-in@20 { + compatible = "adi,adv7180"; + reg = <0x20>; + remote = <&vin0>; + + port { + adv7180: endpoint { + bus-width = <8>; + remote-endpoint = <&vin0ep>; + }; + }; + }; }; &sata0 { status = "okay"; }; + +/* composite video input */ +&vin0 { + status = "ok"; + pinctrl-0 = <&vin0_pins>; + pinctrl-names = "default"; + + port { + #address-cells = <1>; + #size-cells = <0>; + + vin0ep: endpoint { + remote-endpoint = <&adv7180>; + bus-width = <8>; + }; + }; +}; From 2685a2cefe6bcd17e6b407799f41369c7dad422d Mon Sep 17 00:00:00 2001 From: Sergei Shtylyov Date: Sat, 10 Oct 2015 00:40:31 +0300 Subject: [PATCH 5/7] ARM: shmobile: porter: add QSPI DT support Define the Porter board dependent part of the QSPI device node. Add device nodes for Spansion S25FL512S SPI flash and the MTD partitions on it. This patch is mostly analogous to the commit f59838d44835 ("ARM: shmobile: henninger: add QSPI DT support") as there are no differences between the boards in this respect. Signed-off-by: Sergei Shtylyov Signed-off-by: Simon Horman --- arch/arm/boot/dts/r8a7791-porter.dts | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/arch/arm/boot/dts/r8a7791-porter.dts b/arch/arm/boot/dts/r8a7791-porter.dts index b7fa8261e02feb..4eebc67773d28a 100644 --- a/arch/arm/boot/dts/r8a7791-porter.dts +++ b/arch/arm/boot/dts/r8a7791-porter.dts @@ -110,6 +110,11 @@ renesas,function = "sdhi2"; }; + qspi_pins: spi0 { + renesas,groups = "qspi_ctrl", "qspi_data4"; + renesas,function = "qspi"; + }; + i2c2_pins: i2c2 { renesas,groups = "i2c2"; renesas,function = "i2c2"; @@ -165,6 +170,39 @@ status = "okay"; }; +&qspi { + pinctrl-0 = <&qspi_pins>; + pinctrl-names = "default"; + + status = "okay"; + + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spansion,s25fl512s", "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <30000000>; + spi-tx-bus-width = <4>; + spi-rx-bus-width = <4>; + m25p,fast-read; + + partition@0 { + label = "loader_prg"; + reg = <0x00000000 0x00040000>; + read-only; + }; + partition@40000 { + label = "user_prg"; + reg = <0x00040000 0x00400000>; + read-only; + }; + partition@440000 { + label = "flash_fs"; + reg = <0x00440000 0x03bc0000>; + }; + }; +}; + &i2c2 { pinctrl-0 = <&i2c2_pins>; pinctrl-names = "default"; From f9953c5e2a84ffc309ca5f6a281528907a3c8a39 Mon Sep 17 00:00:00 2001 From: Sergei Shtylyov Date: Sat, 10 Oct 2015 00:41:26 +0300 Subject: [PATCH 6/7] ARM: shmobile: porter: enable PCIe Enable the PCIe controller and clock for the Porter board. This patch is analogous to the commit 485f3ce67c11 ("ARM: shmobile: henninger: Enable PCIe Controller & PCIe bus clock") as there are no differences between the boards in this respect. Signed-off-by: Sergei Shtylyov Signed-off-by: Simon Horman --- arch/arm/boot/dts/r8a7791-porter.dts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm/boot/dts/r8a7791-porter.dts b/arch/arm/boot/dts/r8a7791-porter.dts index 4eebc67773d28a..c46aad3954f41c 100644 --- a/arch/arm/boot/dts/r8a7791-porter.dts +++ b/arch/arm/boot/dts/r8a7791-porter.dts @@ -244,3 +244,11 @@ }; }; }; + +&pcie_bus_clk { + status = "okay"; +}; + +&pciec { + status = "okay"; +}; From 99f7445ea41c0187cd2e78bcb58cdd9e6c1756e5 Mon Sep 17 00:00:00 2001 From: Sergei Shtylyov Date: Tue, 13 Oct 2015 01:12:18 +0300 Subject: [PATCH 7/7] ARM: shmobile: porter: enable internal PCI and USB PHY Enable internal AHB-PCI bridges for the USB EHCI/OHCI controllers attached to them and also enable USB PHY device for the Porter board. We have to enable everything in one patch since EHCI/OHCI devices are already linked to the USB PHY device. Signed-off-by: Sergei Shtylyov Signed-off-by: Simon Horman --- arch/arm/boot/dts/r8a7791-porter.dts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/arch/arm/boot/dts/r8a7791-porter.dts b/arch/arm/boot/dts/r8a7791-porter.dts index c46aad3954f41c..fe0f12fc02a186 100644 --- a/arch/arm/boot/dts/r8a7791-porter.dts +++ b/arch/arm/boot/dts/r8a7791-porter.dts @@ -120,6 +120,16 @@ renesas,function = "i2c2"; }; + usb0_pins: usb0 { + renesas,groups = "usb0"; + renesas,function = "usb0"; + }; + + usb1_pins: usb1 { + renesas,groups = "usb1"; + renesas,function = "usb1"; + }; + vin0_pins: vin0 { renesas,groups = "vin0_data8", "vin0_clk"; renesas,function = "vin0"; @@ -245,6 +255,24 @@ }; }; +&pci0 { + pinctrl-0 = <&usb0_pins>; + pinctrl-names = "default"; + + status = "okay"; +}; + +&pci1 { + pinctrl-0 = <&usb1_pins>; + pinctrl-names = "default"; + + status = "okay"; +}; + +&usbphy { + status = "okay"; +}; + &pcie_bus_clk { status = "okay"; };