[PATCH/RFC 08/11] ARM: dts: wheat: Enable watchdog support

2018-02-08 Thread Geert Uytterhoeven
Enable the watchdog, so the board can be restarted by a watchdog
timeout.

Signed-off-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7792-wheat.dts | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7792-wheat.dts 
b/arch/arm/boot/dts/r8a7792-wheat.dts
index b9471b67b72829de..293b9e3b3e70d7b8 100644
--- a/arch/arm/boot/dts/r8a7792-wheat.dts
+++ b/arch/arm/boot/dts/r8a7792-wheat.dts
@@ -168,6 +168,11 @@
};
 };
 
+&rwdt {
+   timeout-sec = <60>;
+   status = "okay";
+};
+
 &scif0 {
pinctrl-0 = <&scif0_pins>;
pinctrl-names = "default";
-- 
2.7.4



[PATCH/RFC 07/11] ARM: dts: blanche: Enable watchdog support

2018-02-08 Thread Geert Uytterhoeven
Enable the watchdog, so the board can be restarted by a watchdog
timeout.

Signed-off-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7792-blanche.dts | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7792-blanche.dts 
b/arch/arm/boot/dts/r8a7792-blanche.dts
index 9b67dca6c9ef550d..04fb70931b3b0772 100644
--- a/arch/arm/boot/dts/r8a7792-blanche.dts
+++ b/arch/arm/boot/dts/r8a7792-blanche.dts
@@ -239,6 +239,11 @@
};
 };
 
+&rwdt {
+   timeout-sec = <60>;
+   status = "okay";
+};
+
 &scif0 {
pinctrl-0 = <&scif0_pins>;
pinctrl-names = "default";
-- 
2.7.4



[PATCH/RFC 04/11] ARM: dts: lager: Enable watchdog support

2018-02-08 Thread Geert Uytterhoeven
Enable the watchdog, so the board can be restarted by a watchdog
timeout.

Signed-off-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7790-lager.dts | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7790-lager.dts 
b/arch/arm/boot/dts/r8a7790-lager.dts
index 7892b113ecaa14c6..4d8fb09fdbb816a5 100644
--- a/arch/arm/boot/dts/r8a7790-lager.dts
+++ b/arch/arm/boot/dts/r8a7790-lager.dts
@@ -860,6 +860,11 @@
};
 };
 
+&rwdt {
+   timeout-sec = <60>;
+   status = "okay";
+};
+
 &ssi1 {
shared-pin;
 };
-- 
2.7.4



[PATCH/RFC 06/11] ARM: dts: porter: Enable watchdog support

2018-02-08 Thread Geert Uytterhoeven
Enable the watchdog, so the board can be restarted by a watchdog
timeout.

Signed-off-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7791-porter.dts | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7791-porter.dts 
b/arch/arm/boot/dts/r8a7791-porter.dts
index 9a02d03b23c2b7e9..7d06fb24bcdf2fee 100644
--- a/arch/arm/boot/dts/r8a7791-porter.dts
+++ b/arch/arm/boot/dts/r8a7791-porter.dts
@@ -449,6 +449,11 @@
};
 };
 
+&rwdt {
+   timeout-sec = <60>;
+   status = "okay";
+};
+
 &ssi1 {
shared-pin;
 };
-- 
2.7.4



[PATCH/RFC 00/11] ARM: dts: rcar-gen2: Enable watchdog support

2018-02-08 Thread Geert Uytterhoeven
Hi all,

This patch series enables the builtin watchdog timer on R-Car Gen2 SoCs
on all supported boards, and builds on top of Fabrizio's "[RFC v4 00/26]
Fix watchdog on Renesas R-Car Gen2 and RZ/G1".  It is marked RFC as it
is known not to work on all SoCs and SoC revisions.

Based on my experiments, there are 3 success/failure modes:

  1. It works!

 This is the case on R-Car M2-N ES1.0 and E2 ES1.0 (tested on gose
 and alt).

  2. The system hangs on watchdog timeout, unless only the first CPU
 core is in use.
 This can be achieved by booting with "maxcpus=1", or by manually
 offlining all secondary CPU cores first:

 for i in /sys/*/*/cpu/cpu[1-9]*; do echo 0 > $i/online; done

 This is the case on R-Car H2 ES1.0 and M2-W ES1.0 (tested on lager
 and koelsch).

  3. The system hangs on watchdog timeout, unless the kernel was built
 with CONFIG_SMP disabled.

 This is the case on R-Car V2H ES1.1 (tested on blanche).
 Presumably the restart part in the new shmobile_boot_vector_gen2 is
 not compatible with R-Car V2H in some way (CPU off/onlining does
 work).

Once we know on which SoCs and revisions it does work, we can add the
proper checks. Right now I'm thinking of adding something like:

if (IS_ENABLED(CONFIG_SMP) && maxcpus > 1 &&
soc_device_match(rcar_gen2_wdt_needs_up))
return -ENODEV;

to the watchdog's probe function (assumed we can fix
shmobile_boot_vector_gen2 for R-Car V2H, else we need more checks).

For your convenience, Fabrizio's and my series are available in the
topic/rcar-gen2-wdt-v4 resp. topic/rcar-gen2-wdt-v4+ branches of my
renesas-drivers git repository at
git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git.

shmobile_defconfig should enable all support needed for testing.

Test procedure:

cat > /dev/watchdog0 & for i in $(seq 100); do echo $i; sleep 1; done

If everything goes well, the board should reboot after 60 seconds.

Note that on several boards there are multiple watchdogs (RWDT and
DA9063 PMIC):

# ls -l /dev/watchdog*
crw--- 1 root root  10, 130 Jan  1  2000 /dev/watchdog
crw--- 1 root root 247,   0 Jan  1  2000 /dev/watchdog0
crw--- 1 root root 247,   1 Jan  1  2000 /dev/watchdog1

/dev/watchdog always corresponds to /dev/watchdog0.
The first one is usually the RWDT. If you want to be 100% sure, look in
sysfs for devices with the (dynamic!) major matching the /dev/watchdog*
files:

# find /sys/devices/ -name dev | xargs grep 247:
/sys/devices/platform/soc/e602.watchdog/watchdog/watchdog0/dev:247:0

/sys/devices/platform/soc/e60b.i2c/i2c-6/6-0058/da9063-watchdog/watchdog/watchdog1/dev:247:1

Thanks for testing, especially on newer revisions of R-Car H2, M2-W, and
V2H, and on other boards!

Geert Uytterhoeven (11):
  clk: renesas: r8a7792: Add rwdt clock
  ARM: dts: r8a7792: Add RWDT node
  ARM: dts: r8a7793: Add RWDT node
  ARM: dts: lager: Enable watchdog support
  ARM: dts: koelsch: Enable watchdog support
  ARM: dts: porter: Enable watchdog support
  ARM: dts: blanche: Enable watchdog support
  ARM: dts: wheat: Enable watchdog support
  ARM: dts: gose: Enable watchdog support
  ARM: dts: alt: Enable watchdog support
  ARM: dts: silk: Enable watchdog support

 arch/arm/boot/dts/r8a7790-lager.dts|  5 +
 arch/arm/boot/dts/r8a7791-koelsch.dts  |  5 +
 arch/arm/boot/dts/r8a7791-porter.dts   |  5 +
 arch/arm/boot/dts/r8a7792-blanche.dts  |  5 +
 arch/arm/boot/dts/r8a7792-wheat.dts|  5 +
 arch/arm/boot/dts/r8a7792.dtsi | 10 ++
 arch/arm/boot/dts/r8a7793-gose.dts |  5 +
 arch/arm/boot/dts/r8a7793.dtsi | 10 ++
 arch/arm/boot/dts/r8a7794-alt.dts  |  5 +
 arch/arm/boot/dts/r8a7794-silk.dts |  5 +
 drivers/clk/renesas/r8a7792-cpg-mssr.c |  2 ++
 11 files changed, 62 insertions(+)

-- 
2.7.4

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds


[PATCH/RFC 01/11] clk: renesas: r8a7792: Add rwdt clock

2018-02-08 Thread Geert Uytterhoeven
Add "rwdt" clock to r8a7792_mod_clks. Also, since we may need to access
the watchdog registers at any time, declare the clock as critical.

Signed-off-by: Geert Uytterhoeven 
---
 drivers/clk/renesas/r8a7792-cpg-mssr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/renesas/r8a7792-cpg-mssr.c 
b/drivers/clk/renesas/r8a7792-cpg-mssr.c
index 7f85bbf20bf782b7..609a540804965c40 100644
--- a/drivers/clk/renesas/r8a7792-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a7792-cpg-mssr.c
@@ -98,6 +98,7 @@ static const struct mssr_mod_clk r8a7792_mod_clks[] 
__initconst = {
DEF_MOD("tpu0",  304,   R8A7792_CLK_CP),
DEF_MOD("sdhi0", 314,   R8A7792_CLK_SD),
DEF_MOD("cmt1",  329,   R8A7792_CLK_R),
+   DEF_MOD("rwdt",  402,   R8A7792_CLK_R),
DEF_MOD("irqc",  407,   R8A7792_CLK_CP),
DEF_MOD("intc-sys",  408,   R8A7792_CLK_ZS),
DEF_MOD("audio-dmac0",   502,   R8A7792_CLK_HP),
@@ -154,6 +155,7 @@ static const struct mssr_mod_clk r8a7792_mod_clks[] 
__initconst = {
 };
 
 static const unsigned int r8a7792_crit_mod_clks[] __initconst = {
+   MOD_CLK_ID(402),/* RWDT */
MOD_CLK_ID(408),/* INTC-SYS (GIC) */
 };
 
-- 
2.7.4



[PATCH/RFC 03/11] ARM: dts: r8a7793: Add RWDT node

2018-02-08 Thread Geert Uytterhoeven
Add a device node for the Watchdog Timer (WDT) controller on the Renesas
R-Car M2-N (r8a7793) SoC.

Signed-off-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7793.dtsi | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7793.dtsi b/arch/arm/boot/dts/r8a7793.dtsi
index f0e0415682f89440..5a06ad1788b27ff1 100644
--- a/arch/arm/boot/dts/r8a7793.dtsi
+++ b/arch/arm/boot/dts/r8a7793.dtsi
@@ -126,6 +126,16 @@
#size-cells = <2>;
ranges;
 
+   rwdt: watchdog@e602 {
+   compatible = "renesas,r8a7793-wdt",
+"renesas,rcar-gen2-wdt";
+   reg = <0 0xe602 0 0x0c>;
+   clocks = <&cpg CPG_MOD 402>;
+   power-domains = <&sysc R8A7793_PD_ALWAYS_ON>;
+   resets = <&cpg 402>;
+   status = "disabled";
+   };
+
gpio0: gpio@e605 {
compatible = "renesas,gpio-r8a7793",
 "renesas,rcar-gen2-gpio";
-- 
2.7.4



[PATCH/RFC 02/11] ARM: dts: r8a7792: Add RWDT node

2018-02-08 Thread Geert Uytterhoeven
Add a device node for the Watchdog Timer (WDT) controller on the Renesas
R-Car V2H (r8a7792) SoC.

Signed-off-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7792.dtsi | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7792.dtsi b/arch/arm/boot/dts/r8a7792.dtsi
index bea0f12f03d36195..d2cf8dd2d9b03624 100644
--- a/arch/arm/boot/dts/r8a7792.dtsi
+++ b/arch/arm/boot/dts/r8a7792.dtsi
@@ -101,6 +101,16 @@
#size-cells = <2>;
ranges;
 
+   rwdt: watchdog@e602 {
+   compatible = "renesas,r8a7792-wdt",
+"renesas,rcar-gen2-wdt";
+   reg = <0 0xe602 0 0x0c>;
+   clocks = <&cpg CPG_MOD 402>;
+   power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
+   resets = <&cpg 402>;
+   status = "disabled";
+   };
+
gpio0: gpio@e605 {
compatible = "renesas,gpio-r8a7792",
 "renesas,rcar-gen2-gpio";
-- 
2.7.4



[PATCH/RFC 09/11] ARM: dts: gose: Enable watchdog support

2018-02-08 Thread Geert Uytterhoeven
Enable the watchdog, so the board can be restarted by a watchdog
timeout.

Signed-off-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7793-gose.dts | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7793-gose.dts 
b/arch/arm/boot/dts/r8a7793-gose.dts
index 51b3ffac8efaad1d..1c8b4f1b5257216c 100644
--- a/arch/arm/boot/dts/r8a7793-gose.dts
+++ b/arch/arm/boot/dts/r8a7793-gose.dts
@@ -446,6 +446,11 @@
status = "okay";
 };
 
+&rwdt {
+   timeout-sec = <60>;
+   status = "okay";
+};
+
 &scif0 {
pinctrl-0 = <&scif0_pins>;
pinctrl-names = "default";
-- 
2.7.4



[PATCH/RFC 10/11] ARM: dts: alt: Enable watchdog support

2018-02-08 Thread Geert Uytterhoeven
Enable the watchdog, so the board can be restarted by a watchdog
timeout.

Signed-off-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7794-alt.dts | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7794-alt.dts 
b/arch/arm/boot/dts/r8a7794-alt.dts
index 60c6515c499660eb..fdc4a311648dc30d 100644
--- a/arch/arm/boot/dts/r8a7794-alt.dts
+++ b/arch/arm/boot/dts/r8a7794-alt.dts
@@ -295,6 +295,11 @@
status = "okay";
 };
 
+&rwdt {
+   timeout-sec = <60>;
+   status = "okay";
+};
+
 &sdhi0 {
pinctrl-0 = <&sdhi0_pins>;
pinctrl-1 = <&sdhi0_pins_uhs>;
-- 
2.7.4



[PATCH/RFC 11/11] ARM: dts: silk: Enable watchdog support

2018-02-08 Thread Geert Uytterhoeven
Enable the watchdog, so the board can be restarted by a watchdog
timeout.

Signed-off-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7794-silk.dts | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7794-silk.dts 
b/arch/arm/boot/dts/r8a7794-silk.dts
index edfad0e5ac53a0c1..993f83c70dedbb30 100644
--- a/arch/arm/boot/dts/r8a7794-silk.dts
+++ b/arch/arm/boot/dts/r8a7794-silk.dts
@@ -457,6 +457,11 @@
};
 };
 
+&rwdt {
+   timeout-sec = <60>;
+   status = "okay";
+};
+
 &ssi1 {
shared-pin;
 };
-- 
2.7.4



[PATCH/RFC 05/11] ARM: dts: koelsch: Enable watchdog support

2018-02-08 Thread Geert Uytterhoeven
Enable the watchdog, so the board can be restarted by a watchdog
timeout.

Signed-off-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7791-koelsch.dts | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts 
b/arch/arm/boot/dts/r8a7791-koelsch.dts
index a50924d12b6f37d5..c90462dbcd36c836 100644
--- a/arch/arm/boot/dts/r8a7791-koelsch.dts
+++ b/arch/arm/boot/dts/r8a7791-koelsch.dts
@@ -499,6 +499,11 @@
status = "okay";
 };
 
+&rwdt {
+   timeout-sec = <60>;
+   status = "okay";
+};
+
 &sata0 {
status = "okay";
 };
-- 
2.7.4



Re: [PATCH v2 0/3] mmc: renesas_sdhi: add eMMC HS400 mode support

2018-02-08 Thread Simon Horman
On Wed, Feb 07, 2018 at 11:26:30PM +0100, Wolfram Sang wrote:
> 
> > * [PATCH] clk: renesas: rcar-gen3: Fix SD divider setting
> 
> I tried to address this one before:
> 
> [PATCH 0/3] clk: renesas: rcar-gen3-cpg: updates to SD divider table
> 
> but this had problems with H3 ES1.0 :(
> 
> I haven't yet compared the above dependency patch with what I did back
> then. Will need to do that hopefully tomorrow. But as I read it, it
> worked fine for you on H3 ES1.0?

Yes, it seemed to, though my memory of the testing is not fresh at this point.



Re: [PATCH] can: m_can: change comparison to bitshift when dealing with a mask

2018-02-08 Thread Marc Kleine-Budde
On 02/06/2018 09:52 AM, Wolfram Sang wrote:
> Due to a typo, the mask was destroyed by a comparison instead of a bit
> shift.
> 
> Reported-by: Geert Uytterhoeven 
> Signed-off-by: Wolfram Sang 

Applied to can.

tnx,
Marc

-- 
Pengutronix e.K.  | Marc Kleine-Budde   |
Industrial Linux Solutions| Phone: +49-231-2826-924 |
Vertretung West/Dortmund  | Fax:   +49-5121-206917- |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |



signature.asc
Description: OpenPGP digital signature


Re: [PATCH] can: m_can: change comparison to bitshift when dealing with a mask

2018-02-08 Thread Marc Kleine-Budde
On 02/06/2018 09:52 AM, Wolfram Sang wrote:
> Due to a typo, the mask was destroyed by a comparison instead of a bit
> shift.
> 
> Reported-by: Geert Uytterhoeven 
> Signed-off-by: Wolfram Sang 
> ---
> Only build tested.

Applied to can. Luckily that define is not used :)

Tnx,
Marc

-- 
Pengutronix e.K.  | Marc Kleine-Budde   |
Industrial Linux Solutions| Phone: +49-231-2826-924 |
Vertretung West/Dortmund  | Fax:   +49-5121-206917- |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |



signature.asc
Description: OpenPGP digital signature


[PATCH v2 1/5] arm64: dts: renesass: r8a77970: add FCPVD support

2018-02-08 Thread Niklas Söderlund
From: Sergei Shtylyov 

Describe FCPVD0 in the R8A77970 device tree; it will be used by VSPD0 in
the next patch...

Based on the original (and large) patch by Daisuke Matsushita
.

Signed-off-by: Vladimir Barinov 
Signed-off-by: Sergei Shtylyov 
Signed-off-by: Niklas Söderlund 
---
 arch/arm64/boot/dts/renesas/r8a77970.dtsi | 8 
 1 file changed, 8 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a77970.dtsi 
b/arch/arm64/boot/dts/renesas/r8a77970.dtsi
index 13c88414cb432b1a..2567e68fe0c6cf7b 100644
--- a/arch/arm64/boot/dts/renesas/r8a77970.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77970.dtsi
@@ -612,6 +612,14 @@
#address-cells = <1>;
#size-cells = <0>;
};
+
+   fcpvd0: fcp@fea27000 {
+   compatible = "renesas,fcpv";
+   reg = <0 0xfea27000 0 0x200>;
+   clocks = <&cpg CPG_MOD 603>;
+   power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+   resets = <&cpg 603>;
+   };
};
 
timer {
-- 
2.16.1



[PATCH v2 2/5] arm64: dts: renesass: r8a77970: add VSPD support

2018-02-08 Thread Niklas Söderlund
From: Sergei Shtylyov 

Describe VSPD0 in the R8A77970 device tree; it will be used by DU in
the next patch...

Based on the original (and large) patch by Daisuke Matsushita
.

Signed-off-by: Vladimir Barinov 
Signed-off-by: Sergei Shtylyov 
Signed-off-by: Niklas Söderlund 
---
 arch/arm64/boot/dts/renesas/r8a77970.dtsi | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a77970.dtsi 
b/arch/arm64/boot/dts/renesas/r8a77970.dtsi
index 2567e68fe0c6cf7b..5eb5d4b26f955671 100644
--- a/arch/arm64/boot/dts/renesas/r8a77970.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77970.dtsi
@@ -620,6 +620,16 @@
power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
resets = <&cpg 603>;
};
+
+   vspd0: vsp@fea2 {
+   compatible = "renesas,vsp2";
+   reg = <0 0xfea2 0 0x4000>;
+   interrupts = ;
+   clocks = <&cpg CPG_MOD 623>;
+   power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+   resets = <&cpg 623>;
+   renesas,fcp = <&fcpvd0>;
+   };
};
 
timer {
-- 
2.16.1



[PATCH v2 0/5] arm64: dts: renesas: r8a77970: enable HDMI output

2018-02-08 Thread Niklas Söderlund
Hi,

This series enables the HDMI out put on V3M. It is based on top of the
latest renesas-drivers release and depends on patches from both Laurent
and Sergei.

- [PATCH v2 00/12] R-Car DU: Convert LVDS code to bridge driver
- [PATCH v2 0/2] Add R-Car V3M (R8A77970) support to the DU driver
- [PATCH 0/3] Add R-Car V3M (R8A77970) support to the R-Car LVDS driver

It is tested on V3M by connecting the HDMI output to a monitor and
booting the board. To console will eventually show up on the screen.

* Changes since v1.
- Replace patches 1-3 by patches posted by Sergei which I had missed.
- Fixed comment on 4/5 by adding reset and power-domain properties.

Niklas Söderlund (2):
  arm64: dts: renesas: r8a77970: add the LVDS instance
  arm64: dts: renesas: eagle: add HDMI output using the ADV7511W

Sergei Shtylyov (3):
  arm64: dts: renesass: r8a77970: add FCPVD support
  arm64: dts: renesass: r8a77970: add VSPD support
  arm64: dts: renesas: r8a77970: add DU support

 arch/arm64/boot/dts/renesas/r8a77970-eagle.dts | 66 +++
 arch/arm64/boot/dts/renesas/r8a77970.dtsi  | 73 ++
 2 files changed, 139 insertions(+)

-- 
2.16.1



[PATCH v2 3/5] arm64: dts: renesas: r8a77970: add DU support

2018-02-08 Thread Niklas Söderlund
From: Sergei Shtylyov 

Define the generic R8A77970 part of the DU device node.

Based on the original (and large) patch by Daisuke Matsushita
.

Signed-off-by: Vladimir Barinov 
Signed-off-by: Sergei Shtylyov 
Signed-off-by: Niklas Söderlund 
---
 arch/arm64/boot/dts/renesas/r8a77970.dtsi | 28 
 1 file changed, 28 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a77970.dtsi 
b/arch/arm64/boot/dts/renesas/r8a77970.dtsi
index 5eb5d4b26f955671..c6056635bd372ce3 100644
--- a/arch/arm64/boot/dts/renesas/r8a77970.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77970.dtsi
@@ -630,6 +630,34 @@
resets = <&cpg 623>;
renesas,fcp = <&fcpvd0>;
};
+
+   du: display@feb0 {
+   compatible = "renesas,du-r8a77970";
+   reg = <0 0xfeb0 0 0x8>;
+   interrupts = ;
+   clocks = <&cpg CPG_MOD 724>;
+   clock-names = "du.0";
+   power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+   vsps = <&vspd0>;
+   status = "disabled";
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   port@0 {
+   reg = <0>;
+   du_out_rgb: endpoint {
+   };
+   };
+
+   port@1 {
+   reg = <1>;
+   du_out_lvds: endpoint {
+   };
+   };
+   };
+   };
};
 
timer {
-- 
2.16.1



[PATCH v2 4/5] arm64: dts: renesas: r8a77970: add the LVDS instance

2018-02-08 Thread Niklas Söderlund
Add the LVDS device to r8a77970.dtsi in a disabled state. Also connect
the it to the LVDS output of the DU. While at it align the endpoint name
of the du to du_out_lvds0 which is used in other Renesas DTS files to
describe this link.

Signed-off-by: Niklas Söderlund 
---
 arch/arm64/boot/dts/renesas/r8a77970.dtsi | 29 -
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/renesas/r8a77970.dtsi 
b/arch/arm64/boot/dts/renesas/r8a77970.dtsi
index c6056635bd372ce3..9c65884cc384952d 100644
--- a/arch/arm64/boot/dts/renesas/r8a77970.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77970.dtsi
@@ -653,7 +653,34 @@
 
port@1 {
reg = <1>;
-   du_out_lvds: endpoint {
+   du_out_lvds0: endpoint {
+   remote-endpoint = <&lvds0_in>;
+   };
+   };
+   };
+   };
+
+   lvds0: lvds@feb9 {
+   compatible = "renesas,r8a77970-lvds";
+   reg = <0 0xfeb9 0 0x14>;
+   clocks = <&cpg CPG_MOD 727>;
+   power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+   resets = <&cpg 727>;
+   status = "disabled";
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   port@0 {
+   reg = <0>;
+   lvds0_in: endpoint {
+   remote-endpoint = 
<&du_out_lvds0>;
+   };
+   };
+   port@1 {
+   reg = <1>;
+   lvds0_out: endpoint {
};
};
};
-- 
2.16.1



[PATCH v2 5/5] arm64: dts: renesas: eagle: add HDMI output using the ADV7511W

2018-02-08 Thread Niklas Söderlund
Add the HDMI connector and the ADV7511W, also connect it to LVDS. Enable
the DU and LVDS to be able to use the HDMI output.

Signed-off-by: Niklas Söderlund 
---
 arch/arm64/boot/dts/renesas/r8a77970-eagle.dts | 66 ++
 1 file changed, 66 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts 
b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
index 359e835cca9876fe..c0fd144970c55fa2 100644
--- a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
+++ b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
@@ -31,6 +31,17 @@
/* first 128MB is reserved for secure area. */
reg = <0x0 0x4800 0x0 0x3800>;
};
+
+   hdmi-out {
+   compatible = "hdmi-connector";
+   type = "a";
+
+   port {
+   hdmi_con_out: endpoint {
+   remote-endpoint = <&adv7511_out>;
+   };
+   };
+   };
 };
 
 &avb {
@@ -67,9 +78,46 @@
gpio-controller;
#gpio-cells = <2>;
};
+
+   hdmi@39 {
+   compatible = "adi,adv7511w";
+   reg = <0x39>;
+   interrupt-parent = <&gpio1>;
+   interrupts = <20 IRQ_TYPE_LEVEL_LOW>;
+
+   adi,input-depth = <8>;
+   adi,input-colorspace = "rgb";
+   adi,input-clock = "1x";
+   adi,input-style = <1>;
+   adi,input-justification = "evenly";
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   port@0 {
+   reg = <0>;
+   adv7511_in: endpoint {
+   remote-endpoint = <&lvds0_out>;
+   };
+   };
+
+   port@1 {
+   reg = <1>;
+   adv7511_out: endpoint {
+   remote-endpoint = <&hdmi_con_out>;
+   };
+   };
+   };
+   };
 };
 
 &pfc {
+   du_pins: du {
+   groups = "du_rgb666", "du_sync", "du_oddf", "du_clk_out";
+   function = "du";
+   };
+
i2c0_pins: i2c0 {
groups = "i2c0";
function = "i2c0";
@@ -92,3 +140,21 @@
 
status = "okay";
 };
+
+&du {
+   pinctrl-0 = <&du_pins>;
+   pinctrl-names = "default";
+   status = "okay";
+};
+
+&lvds0 {
+   status = "okay";
+
+   ports {
+   port@1 {
+   endpoint {
+   remote-endpoint = <&adv7511_in>;
+   };
+   };
+   };
+};
-- 
2.16.1



Re: [PATCH v2 4/5] arm64: dts: renesas: r8a77970: add the LVDS instance

2018-02-08 Thread Sergei Shtylyov
Hello!

On 02/08/2018 06:47 PM, Niklas Söderlund wrote:

> Add the LVDS device to r8a77970.dtsi in a disabled state. Also connect
> the it to the LVDS output of the DU. While at it align the endpoint name
> of the du to du_out_lvds0 which is used in other Renesas DTS files to
> describe this link.
> 
> Signed-off-by: Niklas Söderlund 
> ---
>  arch/arm64/boot/dts/renesas/r8a77970.dtsi | 29 -
>  1 file changed, 28 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/boot/dts/renesas/r8a77970.dtsi 
> b/arch/arm64/boot/dts/renesas/r8a77970.dtsi
> index c6056635bd372ce3..9c65884cc384952d 100644
> --- a/arch/arm64/boot/dts/renesas/r8a77970.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r8a77970.dtsi
> @@ -653,7 +653,34 @@
>  
>   port@1 {
>   reg = <1>;
> - du_out_lvds: endpoint {
> + du_out_lvds0: endpoint {
> + remote-endpoint = <&lvds0_in>;
> + };
> + };
> + };
> + };
> +
> + lvds0: lvds@feb9 {
> + compatible = "renesas,r8a77970-lvds";
> + reg = <0 0xfeb9 0 0x14>;
> + clocks = <&cpg CPG_MOD 727>;
> + power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
> + resets = <&cpg 727>;
> + status = "disabled";
> +
> + ports {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + port@0 {
> + reg = <0>;
> + lvds0_in: endpoint {
> + remote-endpoint = 
> <&du_out_lvds0>;
> + };
> + };
> + port@1 {
> + reg = <1>;
> + lvds0_out: endpoint {
>   };
>   };
>   };


   That's basically my patch modulo the added "power-domains" and "resets" 
props, and the node/endpoint rename (of a dubious value, if you ask me ;-)).

MBSR, Sergei


Re: [PATCH 09/11] DT: arm: shmobile: document Condor board bindings

2018-02-08 Thread Rob Herring
On Fri, Feb 02, 2018 at 09:45:08PM +0300, Sergei Shtylyov wrote:
> Document the Condor device tree bindings, listing it as a supported board.
> 
> This allows to use checkpatch.pl to validate .dts files referring to the
> Condor board.
> 
> Signed-off-by: Sergei Shtylyov 
> 
> ---
>  Documentation/devicetree/bindings/arm/shmobile.txt |2 ++
>  1 file changed, 2 insertions(+)

Reviewed-by: Rob Herring 


Re: [PATCH 2/2] drm: adv7511: Add support for i2c_new_secondary_device

2018-02-08 Thread Laurent Pinchart
Hi Kieran,

On Thursday, 8 February 2018 01:30:43 EET Kieran Bingham wrote:
> On 07/02/18 21:59, Laurent Pinchart wrote:
> > On Wednesday, 7 February 2018 17:14:09 EET Kieran Bingham wrote:
> >> On 29/01/18 10:26, Laurent Pinchart wrote:
> >>> On Monday, 22 January 2018 14:50:00 EET Kieran Bingham wrote:
>  The ADV7511 has four 256-byte maps that can be accessed via the main
>  I²C ports. Each map has it own I²C address and acts as a standard slave
>  device on the I²C bus.
>  
>  Allow a device tree node to override the default addresses so that
>  address conflicts with other devices on the same bus may be resolved at
>  the board description level.
>  
>  Signed-off-by: Kieran Bingham 
>  ---
>  
>   .../bindings/display/bridge/adi,adv7511.txt| 10 +-
> >>> 
> >>> I don't mind personally, but device tree maintainers usually ask for DT
> >>> bindings changes to be split to a separate patch.
> >>> 
>   drivers/gpu/drm/bridge/adv7511/adv7511.h   |  4 +++
>   drivers/gpu/drm/bridge/adv7511/adv7511_drv.c   | 36++-
>   3 files changed, 37 insertions(+), 13 deletions(-)
>  
>  diff --git
>  a/Documentation/devicetree/bindings/display/bridge/adi,adv7511.txt
>  b/Documentation/devicetree/bindings/display/bridge/adi,adv7511.txt
>  index 0047b1394c70..f6bb9f6d3f48 100644
>  --- a/Documentation/devicetree/bindings/display/bridge/adi,adv7511.txt
>  +++ b/Documentation/devicetree/bindings/display/bridge/adi,adv7511.txt
>  
>  @@ -70,6 +70,9 @@ Optional properties:
> rather than generate its own timings for HDMI output.
>   - clocks: from common clock binding: reference to the CEC clock.
>   - clock-names: from common clock binding: must be "cec".
>  +- reg-names : Names of maps with programmable addresses.
>  +It can contain any map needing a non-default address.
>  +Possible maps names are : "main", "edid", "cec", "packet"
> >>> 
> >>> Is the reg-names property (and the additional maps) mandatory or
> >>> optional ? If mandatory you should also update the existing DT sources
> >>> that use those bindings.
> >> 
> >> They are currently optional. I do prefer it that way - but perhaps due to
> >> an issue mentioned below we might need to make this driver mandatory ?>> 
> >> 
> >>> If optional you should define which I2C addresses will be used when
> >>> the maps are not specified (and in that case I think we should go for
> >>> the addresses listed as default in the datasheet, which correspond to
> >>> the current driver implementation when the main address is 0x3d/0x7a).
> >> 
> >> The current addresses do not correspond to the datasheet, even when the
> >> implementation main address is set to 0x3d.
> > 
> > Don't they ? The driver currently uses the following (8-bit) I2C
> > addresses:
> > 
> > EDID:   main + 4  = 0x7e (0x3f)
> > Packet: main - 10 = 0x70 (0x38)
> > CEC:main - 2  = 0x78 (0x3c)
> > 
> > Those are the default addresses according to section 4.1 of the ADV7511W
> > programming guide (rev. B), and they match the ones you set in this patch.
> 
> Sorry - I was clearly subtracting 8bit values from a 7bit address in my
> failed assertion, to both you and Archit.

No worries.

> >> Thus, in my opinion - they are currently 'wrong' - but perhaps changing
> >> them is considered breakage too.
> >> 
> >> A particular issue will arise here too - as on this device - when the
> >> device is in low-power mode (after probe, before use) - the maps will
> >> respond on their *hardware default* addresses (the ones implemented in
> >> this patch), and thus consume that address on the I2C bus regardless of
> >> their settings in the driver.
> > 
> > We've discussed this previously and I share you concern. Just to make sure
> > I remember correctly, did all the secondary maps reset to their default
> > addresses, or just the EDID map ?
> 
> The following responds on the bus when programmed at alternative addresses,
> and in low power mode. The responses are all 0, but that's still going to
> conflict with other hardware if it tries to use the 'un-used' addresses.
> 
> Packet (0x38),
> Main (0x39),
> Fixed (set to 0 by software, but shows up at 0x3e)
> and EDID (0x3f).
> 
> So actually it's only the CEC which don't respond when in "low-power-mode".
> 
> As far as I can see, (git grep  -B3 adi,adv75) - The r8a7792-wheat.dts is
> the only instance of a device using 0x3d, which means that Sergei's patch
> changed the behaviour of all the existing devices before that.
> 
> Thus - this patch could be seen to be a 'correction' back to the original
> behaviour for all devices except the Wheat, and possibly devices added after
> Sergei's patch went in.
> 
> However - by my understanding, - any device which has only one ADV75(3,1)+
> should use the hardware defined addresses (the hardware defaults will be
> conflicting on the bus anyway, thus should be assign

Re: [PATCH 09/11] DT: arm: shmobile: document Condor board bindings

2018-02-08 Thread Geert Uytterhoeven
On Fri, Feb 2, 2018 at 7:45 PM, Sergei Shtylyov
 wrote:
> Document the Condor device tree bindings, listing it as a supported board.
>
> This allows to use checkpatch.pl to validate .dts files referring to the
> Condor board.
>
> Signed-off-by: Sergei Shtylyov 

Reviewed-by: Geert Uytterhoeven 

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds


Re: [PATCH 10/11] arm64: dts: renesas: initial Condor board device tree

2018-02-08 Thread Geert Uytterhoeven
Hi Sergei,

On Fri, Feb 2, 2018 at 7:46 PM, Sergei Shtylyov
 wrote:
> Add the initial device  tree for  the R8A77980 SoC based Condor board.
> The board has 1 debug serial port (SCIF0); include support for it, so
> that the serial console can work.
>
> Based on the original (and large) patch by Vladimir Barinov.
>
> Signed-off-by: Vladimir Barinov 
> Signed-off-by: Sergei Shtylyov 

Thanks for your patch!

> --- /dev/null
> +++ renesas/arch/arm64/boot/dts/renesas/r8a77980-condor.dts
> @@ -0,0 +1,46 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Device Tree Source for the Condor board
> + *
> + * Copyright (C) 2018 Renesas Electronics Corp.
> + * Copyright (C) 2018 Cogent Embedded, Inc.
> + */
> +
> +/dts-v1/;
> +#include "r8a77980.dtsi"
> +
> +/ {
> +   model = "Renesas Condor board based on r8a77980";
> +   compatible = "renesas,condor", "renesas,r8a77980";
> +
> +   aliases {
> +   serial0 = &scif0;
> +   };
> +
> +   chosen {
> +   stdout-path = "serial0:115200n8";
> +   };
> +
> +   memory@4800 {
> +   device_type = "memory";
> +   /* first 128MB is reserved for secure area. */
> +   reg = <0x0 0x4800 0x0 0x3800>;

According to the Samsung website, the LPDDR is a 16 Gib part, i.e. 2 GiB.
Is there any specific reason you're limiting memory to 1 GiB?

> +   };

With the above resolved:
Reviewed-by: Geert Uytterhoeven 

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds