Re: renesas-drivers-2016-08-23-v4.8-rc3

2016-08-31 Thread Wolfram Sang

> I can reproduce this on Lager board now.
> If I OFF:ed on SW8 : 4bit (= MD21), kernel boot will be failed.
> It happened on both board

Even with my recent patch?



signature.asc
Description: PGP signature


Re: renesas-drivers-2016-08-23-v4.8-rc3

2016-08-31 Thread Kuninori Morimoto

Hi Geert, Wolfram

> > Magnus has my previous Lager board, so I can't try it today.
> > I think my current board and previous board have different type of chip.
> > Magnus will bring me my previous board tomorrow, so I will check it,
> > and try your solution.
> 
> The revision doesn't seem to be printed on the chip package, but it is
> identified by the da9063 driver (CONFIG_REGULATOR_DA9063=y).
> 
> My Koelsch has:
> 
>  da9063 6-0058: Device detected (chip-ID: 0x61, var-ID: 0x30)
> 
> which corresponds to PMIC_DA9063_AD.
> Magnus' Lager (remote access) has the same version.
> 
> (after adding the missing pieces to DT) Magnus's Gose has:
> 
> da9063 6-0058: Device detected (chip-ID: 0x61, var-ID: 0x50)
> 
> which corresponds to PMIC_DA9063_BB.
> 
> Which revision do you have?

Thank you for your help. I found the hot-spot.
The issue was not ES2.0 vs ES3.0, not DA9063 Type,
not Hot/Cold boot, and not uboot version on my desk.
It was dipswitch.
I can reproduce this on Lager board now.
If I OFF:ed on SW8 : 4bit (= MD21), kernel boot will be failed.
It happened on both board

ES2.0 : da9063 11-0058: Device detected (chip-ID: 0x61, var-ID: 0x50)
ES3.0 : da9063 11-0058: Device detected (chip-ID: 0x61, var-ID: 0x30)



[PATCH v3 08/12] arm64: dts: h3ulcb: enable EXTALR clk

2016-08-31 Thread Vladimir Barinov
This enables EXTALR clock that can be used for the watchdog.

Signed-off-by: Vladimir Barinov 
---
Changes in version 3:
- initially added

 arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts 
b/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts
index 3682bcc..6936288 100644
--- a/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts
+++ b/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts
@@ -74,6 +74,10 @@
clock-frequency = <1666>;
 };
 
+_clk {
+   clock-frequency = <32768>;
+};
+
  {
pinctrl-0 = <_clk_pins>;
pinctrl-names = "default";
-- 
1.9.1



[PATCH v3 06/12] arm64: dts: h3ulcb: enable SDHI0

2016-08-31 Thread Vladimir Barinov
This supports SDHI0 on H3ULCB board SD card slot

Signed-off-by: Vladimir Barinov 
---
Changes in version 3:
- initially added

 arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts | 48 ++
 1 file changed, 48 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts 
b/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts
index 3329f78..5be0cf6 100644
--- a/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts
+++ b/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts
@@ -44,6 +44,30 @@
gpios = < 13 GPIO_ACTIVE_HIGH>;
};
};
+
+   vcc_sdhi0: regulator-vcc-sdhi0 {
+   compatible = "regulator-fixed";
+
+   regulator-name = "SDHI0 Vcc";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+
+   gpio = < 2 GPIO_ACTIVE_HIGH>;
+   enable-active-high;
+   };
+
+   vccq_sdhi0: regulator-vccq-sdhi0 {
+   compatible = "regulator-gpio";
+
+   regulator-name = "SDHI0 VccQ";
+   regulator-min-microvolt = <180>;
+   regulator-max-microvolt = <330>;
+
+   gpios = < 1 GPIO_ACTIVE_HIGH>;
+   gpios-states = <1>;
+   states = <330 1
+ 180 0>;
+   };
 };
 
 _clk {
@@ -68,6 +92,18 @@
groups = "avb_mdc";
function = "avb";
};
+
+   sdhi0_pins_3v3: sd0_3v3 {
+   groups = "sdhi0_data4", "sdhi0_ctrl";
+   function = "sdhi0";
+   power-source = <3300>;
+   };
+
+   sdhi0_pins_1v8: sd0_1v8 {
+   groups = "sdhi0_data4", "sdhi0_ctrl";
+   function = "sdhi0";
+   power-source = <1800>;
+   };
 };
 
  {
@@ -82,6 +118,18 @@
status = "okay";
 };
 
+ {
+   pinctrl-0 = <_pins_3v3>;
+   pinctrl-1 = <_pins_1v8>;
+   pinctrl-names = "default", "state_uhs";
+
+   vmmc-supply = <_sdhi0>;
+   vqmmc-supply = <_sdhi0>;
+   cd-gpios = < 12 GPIO_ACTIVE_LOW>;
+   bus-width = <4>;
+   status = "okay";
+};
+
  {
pinctrl-0 = <_pins>;
pinctrl-names = "default";
-- 
1.9.1



[PATCH v3 07/12] arm64: dts: h3ulcb: enable I2C2

2016-08-31 Thread Vladimir Barinov
This supports I2C2 bus on H3ULCB board

Signed-off-by: Vladimir Barinov 
---
Changes in version 3:
- initially added

 arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts | 12 
 1 file changed, 12 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts 
b/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts
index 5be0cf6..3682bcc 100644
--- a/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts
+++ b/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts
@@ -88,6 +88,11 @@
function = "scif_clk";
};
 
+   i2c2_pins: i2c2 {
+   groups = "i2c2_a";
+   function = "i2c2";
+   };
+
avb_pins: avb {
groups = "avb_mdc";
function = "avb";
@@ -118,6 +123,13 @@
status = "okay";
 };
 
+ {
+   pinctrl-0 = <_pins>;
+   pinctrl-names = "default";
+
+   status = "okay";
+};
+
  {
pinctrl-0 = <_pins_3v3>;
pinctrl-1 = <_pins_1v8>;
-- 
1.9.1



[PATCH v3 11/12] arm64: dts: h3ulcb: enable USB2.0 Host channel 1

2016-08-31 Thread Vladimir Barinov
This supports USB2.0 Host channel 1 on H3ULCB board

Signed-off-by: Vladimir Barinov 
---
Changes in version 3:
- initially added

 arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts | 8 
 1 file changed, 8 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts 
b/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts
index 1750bb1..bbd7928 100644
--- a/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts
+++ b/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts
@@ -187,3 +187,11 @@
 
status = "okay";
 };
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
-- 
1.9.1



[PATCH v3 12/12] arm64: dts: h3ulcb: Sound SSI support

2016-08-31 Thread Vladimir Barinov
This supports SSI sound for H3ULCB board.
SSI DMA mode used. CS2000 used as AUDIO_CLK_B.

Signed-off-by: Vladimir Barinov 
---
Changes in version 3:
- initially added

 arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts | 115 +
 1 file changed, 115 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts 
b/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts
index bbd7928..a254231 100644
--- a/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts
+++ b/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts
@@ -45,6 +45,12 @@
};
};
 
+   x12_clk: x12_clk {
+   compatible = "fixed-clock";
+   #clock-cells = <0>;
+   clock-frequency = <24576000>;
+   };
+
vcc_sdhi0: regulator-vcc-sdhi0 {
compatible = "regulator-fixed";
 
@@ -68,6 +74,28 @@
states = <330 1
  180 0>;
};
+
+   audio_clkout: audio_clkout {
+   compatible = "fixed-clock";
+   #clock-cells = <0>;
+   clock-frequency = <11289600>;
+   };
+
+   rsnd_ak4613: sound {
+   compatible = "simple-audio-card";
+
+   simple-audio-card,format = "left_j";
+   simple-audio-card,bitclock-master = <>;
+   simple-audio-card,frame-master = <>;
+
+   sndcpu: simple-audio-card,cpu {
+   sound-dai = <_sound>;
+   };
+
+   sndcodec: simple-audio-card,codec {
+   sound-dai = <>;
+   };
+   };
 };
 
 _clk {
@@ -113,6 +141,18 @@
function = "sdhi0";
power-source = <1800>;
};
+
+   sound_pins: sound {
+   groups = "ssi01239_ctrl", "ssi0_data", "ssi1_data_a";
+   function = "ssi";
+   };
+
+   sound_clk_pins: sound_clk {
+   groups = "audio_clk_a_a", "audio_clk_b_a", "audio_clk_c_a",
+"audio_clkout_a", "audio_clkout3_a";
+   function = "audio_clk";
+   };
+
usb1_pins: usb1 {
groups = "usb1";
function = "usb1";
@@ -136,6 +176,73 @@
pinctrl-names = "default";
 
status = "okay";
+
+   clock-frequency = <10>;
+
+   ak4613: codec@10 {
+   compatible = "asahi-kasei,ak4613";
+   #sound-dai-cells = <0>;
+   reg = <0x10>;
+   clocks = <_sound 3>;
+
+   asahi-kasei,in1-single-end;
+   asahi-kasei,in2-single-end;
+   asahi-kasei,out1-single-end;
+   asahi-kasei,out2-single-end;
+   asahi-kasei,out3-single-end;
+   asahi-kasei,out4-single-end;
+   asahi-kasei,out5-single-end;
+   asahi-kasei,out6-single-end;
+   };
+
+   cs2000: clk_multiplier@4f {
+   #clock-cells = <0>;
+   compatible = "cirrus,cs2000-cp";
+   reg = <0x4f>;
+   clocks = <_clkout>, <_clk>;
+   clock-names = "clk_in", "ref_clk";
+
+   assigned-clocks = <>;
+   assigned-clock-rates = <24576000>; /* 1/1 divide */
+   };
+};
+
+_sound {
+   pinctrl-0 = <_pins _clk_pins>;
+   pinctrl-names = "default";
+
+   /* Single DAI */
+   #sound-dai-cells = <0>;
+
+   /* audio_clkout0/1/2/3 */
+   #clock-cells = <1>;
+   clock-frequency = <11289600>;
+
+   status = "okay";
+
+   /* update  to  */
+   clocks = < CPG_MOD 1005>,
+< CPG_MOD 1006>, < CPG_MOD 1007>,
+< CPG_MOD 1008>, < CPG_MOD 1009>,
+< CPG_MOD 1010>, < CPG_MOD 1011>,
+< CPG_MOD 1012>, < CPG_MOD 1013>,
+< CPG_MOD 1014>, < CPG_MOD 1015>,
+< CPG_MOD 1022>, < CPG_MOD 1023>,
+< CPG_MOD 1024>, < CPG_MOD 1025>,
+< CPG_MOD 1026>, < CPG_MOD 1027>,
+< CPG_MOD 1028>, < CPG_MOD 1029>,
+< CPG_MOD 1030>, < CPG_MOD 1031>,
+< CPG_MOD 1019>, < CPG_MOD 1018>,
+<_clk_a>, <>,
+<_clk_c>,
+< CPG_CORE R8A7795_CLK_S0D4>;
+
+   rcar_sound,dai {
+   dai0 {
+   playback = <  >;
+   capture  = <  >;
+   };
+   };
 };
 
  {
@@ -150,11 +257,19 @@
status = "okay";
 };
 
+ {
+   shared-pin;
+};
+
  {
timeout-sec = <60>;
status = "okay";
 };
 
+_clk_a {
+   clock-frequency = <22579200>;
+};
+
  {
pinctrl-0 = <_pins>;
pinctrl-names = "default";
-- 
1.9.1



[PATCH v3 04/12] arm64: dts: h3ulcb: enable EthernetAVB

2016-08-31 Thread Vladimir Barinov
This supports Ethernet AVB on H3ULCB board

Signed-off-by: Vladimir Barinov 
---
Changes in version 3:
- initially added

 arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts | 32 ++
 1 file changed, 32 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts 
b/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts
index 67ce368..fb694b8 100644
--- a/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts
+++ b/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts
@@ -19,6 +19,7 @@
 
aliases {
serial0 = 
+   ethernet0 = 
};
 
chosen {
@@ -49,6 +50,11 @@
groups = "scif_clk_a";
function = "scif_clk";
};
+
+   avb_pins: avb {
+   groups = "avb_mdc";
+   function = "avb";
+   };
 };
 
  {
@@ -62,3 +68,29 @@
clock-frequency = <14745600>;
status = "okay";
 };
+
+ {
+   pinctrl-0 = <_pins>;
+   pinctrl-names = "default";
+   renesas,no-ether-link;
+   phy-handle = <>;
+   status = "okay";
+
+   phy0: ethernet-phy@0 {
+   rxc-skew-ps = <900>;
+   rxdv-skew-ps = <0>;
+   rxd0-skew-ps = <0>;
+   rxd1-skew-ps = <0>;
+   rxd2-skew-ps = <0>;
+   rxd3-skew-ps = <0>;
+   txc-skew-ps = <900>;
+   txen-skew-ps = <0>;
+   txd0-skew-ps = <0>;
+   txd1-skew-ps = <0>;
+   txd2-skew-ps = <0>;
+   txd3-skew-ps = <0>;
+   reg = <0>;
+   interrupt-parent = <>;
+   interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+   };
+};
-- 
1.9.1



[PATCH v3 05/12] arm64: dts: h3ulcb: enable GPIO leds

2016-08-31 Thread Vladimir Barinov
This supports GPIO leds on H3ULCB board

Signed-off-by: Vladimir Barinov 
---
Changes in version 3:
- initially added

 arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts | 13 +
 1 file changed, 13 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts 
b/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts
index fb694b8..3329f78 100644
--- a/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts
+++ b/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts
@@ -31,6 +31,19 @@
/* first 128MB is reserved for secure area. */
reg = <0x0 0x4800 0x0 0x3800>;
};
+
+   leds {
+   compatible = "gpio-leds";
+   led4 {
+   gpios = < 11 GPIO_ACTIVE_HIGH>;
+   };
+   led5 {
+   gpios = < 12 GPIO_ACTIVE_HIGH>;
+   };
+   led6 {
+   gpios = < 13 GPIO_ACTIVE_HIGH>;
+   };
+   };
 };
 
 _clk {
-- 
1.9.1



[PATCH v3 01/12] dt: arm: shmobile: add H3ULCB board DT bindings

2016-08-31 Thread Vladimir Barinov
Add H3ULCB Device tree bindings Documentation, listing it as a supported
board.

Signed-off-by: Vladimir Barinov 
Acked-by: Rob Herring 
Reviewed-by: Geert Uytterhoeven 
---
Changes in version 2:
- none
Changes in version 3:
- none

 Documentation/devicetree/bindings/arm/shmobile.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/shmobile.txt 
b/Documentation/devicetree/bindings/arm/shmobile.txt
index 5484c31d..2f0b716 100644
--- a/Documentation/devicetree/bindings/arm/shmobile.txt
+++ b/Documentation/devicetree/bindings/arm/shmobile.txt
@@ -49,6 +49,8 @@ Boards:
 compatible = "renesas,genmai", "renesas,r7s72100"
   - Gose
 compatible = "renesas,gose", "renesas,r8a7793"
+  - H3ULCB (RTP0RC7795SKB00010S)
+compatible = "renesas,h3ulcb", "renesas,r8a7795";
   - Henninger
 compatible = "renesas,henninger", "renesas,r8a7791"
   - Koelsch (RTP0RC7791SEB00010S)
-- 
1.9.1



[PATCH v3 03/12] arm64: dts: h3ulcb: enable SCIF clk and pins

2016-08-31 Thread Vladimir Barinov
This enables the external crystal for the SCIF_CLK and its pinctrl, to
be used by the Baud Rate Generator for External Clock (BRG) on (H)SCIF.

Signed-off-by: Vladimir Barinov 
---
Changes in version 3:
- initially added

 arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts | 13 +
 1 file changed, 13 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts 
b/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts
index ecb9e11..67ce368 100644
--- a/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts
+++ b/arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts
@@ -37,10 +37,18 @@
 };
 
  {
+   pinctrl-0 = <_clk_pins>;
+   pinctrl-names = "default";
+
scif2_pins: scif2 {
groups = "scif2_data_a";
function = "scif2";
};
+
+   scif_clk_pins: scif_clk {
+   groups = "scif_clk_a";
+   function = "scif_clk";
+   };
 };
 
  {
@@ -49,3 +57,8 @@
 
status = "okay";
 };
+
+_clk {
+   clock-frequency = <14745600>;
+   status = "okay";
+};
-- 
1.9.1



[PATCH v3 0/12] arm64: renesas: add H3ULCB board

2016-08-31 Thread Vladimir Barinov
Hello,

This adds the folowing:
- R8A7795 SoC based H3ULCB low cost board device tree
- Document DT bindings

Vladimir Barinov (12):
[01/12] dt: arm: shmobile: add H3ULCB board DT bindings
[02/12] arm64: dts: h3ulcb: initial device tree
[03/12] arm64: dts: h3ulcb: enable SCIF clk and pins
[04/12] arm64: dts: h3ulcb: enable EthernetAVB
[05/12] arm64: dts: h3ulcb: enable GPIO leds
[06/12] arm64: dts: h3ulcb: enable SDHI0
[07/12] arm64: dts: h3ulcb: enable I2C2
[08/12] arm64: dts: h3ulcb: enable EXTALR clk
[09/12] arm64: dts: h3ulcb: enable WDT
[10/12] arm64: dts: h3ulcb: enable USB2 PHY of channel 1
[11/12] arm64: dts: h3ulcb: enable USB2.0 Host channel 1
[12/12] arm64: dts: h3ulcb: Sound SSI support

---
This patchset is against the 'kernel/git/horms/renesas.git' repo.

 arch/arm64/boot/dts/renesas/Makefile   |   2 +-
 arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts | 316 
+
 Documentation/devicetree/bindings/arm/shmobile.txt |   2 ++
 3 files changed, 319 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts


[PATCH] spi: sh-msiof: Use ARCH_SHMOBILE instead of SUPERH

2016-08-31 Thread Geert Uytterhoeven
"spi_sh_msiof" is used on sh7723 and sh7724 only. As all of the above
select ARCH_SHMOBILE, restrict its driver dependencies from SUPERH to
ARCH_SHMOBILE.

Signed-off-by: Geert Uytterhoeven 
---
 drivers/spi/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 5c8e51e96888cc53..96087e9fc998461c 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -556,7 +556,7 @@ config SPI_SC18IS602
 config SPI_SH_MSIOF
tristate "SuperH MSIOF SPI controller"
depends on HAVE_CLK && HAS_DMA
-   depends on SUPERH || ARCH_RENESAS || COMPILE_TEST
+   depends on ARCH_SHMOBILE || ARCH_RENESAS || COMPILE_TEST
help
  SPI driver for SuperH and SH Mobile MSIOF blocks.
 
-- 
1.9.1



[PATCH] i2c: shmobile: Use ARCH_SHMOBILE instead of SUPERH

2016-08-31 Thread Geert Uytterhoeven
"i2c-sh_mobile" is used on sh7343, sh7366, sh7722, sh7723, and sh7724
only. As all of the above select ARCH_SHMOBILE, restrict its driver
dependencies from SUPERH to ARCH_SHMOBILE.

Signed-off-by: Geert Uytterhoeven 
---
 drivers/i2c/busses/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 1f3239ead0377426..6d94e2ec5b4f7183 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -836,7 +836,7 @@ config I2C_SH7760
 config I2C_SH_MOBILE
tristate "SuperH Mobile I2C Controller"
depends on HAS_DMA
-   depends on SUPERH || ARCH_RENESAS || COMPILE_TEST
+   depends on ARCH_SHMOBILE || ARCH_RENESAS || COMPILE_TEST
help
  If you say yes to this option, support will be included for the
  built-in I2C interface on the Renesas SH-Mobile processor.
-- 
1.9.1



[PATCH] PCI: rcar: Don't disable/unprepare clocks on prepare/enable failure

2016-08-31 Thread Geert Uytterhoeven
If clk_prepare_enable() fails, we must not call clk_disable_unprepare()
in the error path.

Signed-off-by: Geert Uytterhoeven 
---
 drivers/pci/host/pcie-rcar.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
index 65db7a2215090ff4..0f5c2b2b4f8dfcd2 100644
--- a/drivers/pci/host/pcie-rcar.c
+++ b/drivers/pci/host/pcie-rcar.c
@@ -782,7 +782,7 @@ static int rcar_pcie_get_resources(struct platform_device 
*pdev,
}
err = clk_prepare_enable(pcie->clk);
if (err)
-   goto fail_clk;
+   return err;
 
pcie->bus_clk = devm_clk_get(>dev, "pcie_bus");
if (IS_ERR(pcie->bus_clk)) {
@@ -792,7 +792,7 @@ static int rcar_pcie_get_resources(struct platform_device 
*pdev,
}
err = clk_prepare_enable(pcie->bus_clk);
if (err)
-   goto err_map_reg;
+   goto fail_clk;
 
i = irq_of_parse_and_map(pdev->dev.of_node, 0);
if (!i) {
-- 
1.9.1



[PATCH] ARM: shmobile: gose: Add da9063 PMIC device node for system restart

2016-08-31 Thread Geert Uytterhoeven
Enable i2c6, and add a device node for the da9063 PMIC, with subnodes
for rtc and wdt.  Regulator support is not yet included.

This allows the system to be restarted when the watchdog timer times
out, or when a system restart is requested.

Signed-off-by: Geert Uytterhoeven 
---
No board schematics, but assumed similar to Koelsch, and 'reboot -f' now
works ;-)

 arch/arm/boot/dts/r8a7793-gose.dts | 21 +
 1 file changed, 21 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7793-gose.dts 
b/arch/arm/boot/dts/r8a7793-gose.dts
index 0e418e7a6d5c7cfc..b8addf6471518810 100644
--- a/arch/arm/boot/dts/r8a7793-gose.dts
+++ b/arch/arm/boot/dts/r8a7793-gose.dts
@@ -597,6 +597,27 @@
pinctrl-names = "i2c-exio4";
 };
 
+ {
+   status = "okay";
+   clock-frequency = <10>;
+
+   pmic@58 {
+   compatible = "dlg,da9063";
+   reg = <0x58>;
+   interrupt-parent = <>;
+   interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
+   interrupt-controller;
+
+   rtc {
+   compatible = "dlg,da9063-rtc";
+   };
+
+   wdt {
+   compatible = "dlg,da9063-watchdog";
+   };
+   };
+};
+
 _sound {
pinctrl-0 = <_pins _clk_pins>;
pinctrl-names = "default";
-- 
1.9.1



[PATCH] arm64: renesas: r8a7796/salvator-x: Add board part number to DT bindings

2016-08-31 Thread Geert Uytterhoeven
Signed-off-by: Geert Uytterhoeven 
---
 Documentation/devicetree/bindings/arm/shmobile.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/arm/shmobile.txt 
b/Documentation/devicetree/bindings/arm/shmobile.txt
index 90cf237ee5581978..42a046a97acba00f 100644
--- a/Documentation/devicetree/bindings/arm/shmobile.txt
+++ b/Documentation/devicetree/bindings/arm/shmobile.txt
@@ -65,7 +65,7 @@ Boards:
 compatible = "renesas,porter", "renesas,r8a7791"
   - Salvator-X (RTP0RC7795SIPB0010S)
 compatible = "renesas,salvator-x", "renesas,r8a7795";
-  - Salvator-X
+  - Salvator-X (RTP0RC7796SIPB0011S)
 compatible = "renesas,salvator-x", "renesas,r8a7796";
   - SILK (RTP0RC7794LCB00011S)
 compatible = "renesas,silk", "renesas,r8a7794"
-- 
1.9.1



Re: [PATCH v5 08/11] arm64: r8a7795: Set maximum frequencies for SDHI clocks

2016-08-31 Thread Wolfram Sang
On Tue, Aug 30, 2016 at 11:09:56PM +0200, Simon Horman wrote:
> Signed-off-by: Simon Horman 
> ---
> v5
> * New patch

Huh? There is already 721e9a08aa514c ("arm64: dts: r8a7795: set maximum
frequency for SDHI clocks") in renesas/drivers? Why didn't you pick this
one?



signature.asc
Description: PGP signature


Re: renesas-drivers-2016-08-23-v4.8-rc3

2016-08-31 Thread Geert Uytterhoeven
Hi Wolfram,

On Wed, Aug 31, 2016 at 10:07 AM, Wolfram Sang  wrote:
> Am I recalling correctly that noone of us has access to DA9063
> documentation? Is this still true? Or do we know the differences of the
> revisions?

Yes.

I had completely forgotten I did apply for documentation on their website
a long time ago. No response.

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: renesas-drivers-2016-08-23-v4.8-rc3

2016-08-31 Thread Wolfram Sang

> The revision doesn't seem to be printed on the chip package, but it is
> identified by the da9063 driver (CONFIG_REGULATOR_DA9063=y).

Am I recalling correctly that noone of us has access to DA9063
documentation? Is this still true? Or do we know the differences of the
revisions?



signature.asc
Description: PGP signature


Re: [PATCH v5 03/11] mmc: tmio: Add hw reset support

2016-08-31 Thread Ulf Hansson
On 30 August 2016 at 23:09, Simon Horman  wrote:
> From: Ai Kyuse 
>
> Add hw reset support.
>
> Signed-off-by: Ai Kyuse 
> Signed-off-by: Simon Horman 
> ---
> This is required by tuning support which will
> be introduced by follow-up patches.
>
> v5 [Simon Horman]
> * As suggested by Ulf Hansson
>   - Broke out of a larger patch
> ---
>  drivers/mmc/host/tmio_mmc.h |  1 +
>  drivers/mmc/host/tmio_mmc_pio.c | 12 
>  2 files changed, 13 insertions(+)
>
> diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
> index 4b36cb5c2d9c..4b71f31fba63 100644
> --- a/drivers/mmc/host/tmio_mmc.h
> +++ b/drivers/mmc/host/tmio_mmc.h
> @@ -164,6 +164,7 @@ struct tmio_mmc_host {
> int (*start_signal_voltage_switch)(struct mmc_host *mmc,
>struct mmc_ios *ios);
> int (*write16_hook)(struct tmio_mmc_host *host, int addr);
> +   void (*hw_reset)(struct tmio_mmc_host *host);
>  };
>
>  struct tmio_mmc_host *tmio_mmc_host_alloc(struct platform_device *pdev);
> diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
> index 806308ac93e7..90758647bae6 100644
> --- a/drivers/mmc/host/tmio_mmc_pio.c
> +++ b/drivers/mmc/host/tmio_mmc_pio.c
> @@ -756,6 +756,17 @@ static int tmio_mmc_start_data(struct tmio_mmc_host 
> *host,
> return 0;
>  }
>
> +static void tmio_mmc_hw_reset(struct mmc_host *mmc)
> +{
> +   struct tmio_mmc_host *host = mmc_priv(mmc);
> +
> +   if (host->hw_reset)
> +   host->hw_reset(host);
> +
> +   mmc_retune_timer_stop(host->mmc);
> +   mmc_retune_needed(host->mmc);

Both the above tuning calls are completely pointless as the mmc core
will run a reinitialization of the card when a ->hw_reset() host ops
is invoked.
That means a regular tuning will happen as part of the initialization
of the card, so you don't need to trigger it from here as well.

So if that's the only reason to why you need to add the hw_reset()
support, I think you should drop it instead.

> +}
> +
>  /* Process requests from the MMC layer */
>  static void tmio_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
>  {
> @@ -970,6 +981,7 @@ static struct mmc_host_ops tmio_mmc_ops = {
> .get_cd = mmc_gpio_get_cd,
> .enable_sdio_irq = tmio_mmc_enable_sdio_irq,
> .multi_io_quirk = tmio_multi_io_quirk,
> +   .hw_reset   = tmio_mmc_hw_reset,
>  };
>
>  static int tmio_mmc_init_ocr(struct tmio_mmc_host *host)
> --
> 2.7.0.rc3.207.g0ac5344
>

Kind regards
Uffe


Re: renesas-drivers-2016-08-23-v4.8-rc3

2016-08-31 Thread Geert Uytterhoeven
Hi Morimoto-san,

On Wed, Aug 31, 2016 at 8:20 AM, Kuninori Morimoto
 wrote:
>> > I noticed that Lager "ES3.0" board can't boot on this and previous -rc2 
>> > branch.
>> > In my and Shimoda-san's check, "ES2.0" seems have no problem.
>>
>> I understand the issue now. It is not about ES3.0 vs. ES2.0, it is about
>> cold-boot vs. warm-boot. I remembered the DA9xxx interrupt storm
>> problems we had, and voila, I could reproduce the lockup on ES2.0 here,
>> but you need to cold-boot and have the da9xxx drivers enabled.
>
> It seems lager board has 2 type of DA9xxx chip, type A, and type B.
> We don't know which chip your / my board has.
>
> My *current* Lager board has no issue on cold / warm boot.
> Magnus has my previous Lager board, so I can't try it today.
> I think my current board and previous board have different type of chip.
> Magnus will bring me my previous board tomorrow, so I will check it,
> and try your solution.

The revision doesn't seem to be printed on the chip package, but it is
identified by the da9063 driver (CONFIG_REGULATOR_DA9063=y).

My Koelsch has:

 da9063 6-0058: Device detected (chip-ID: 0x61, var-ID: 0x30)

which corresponds to PMIC_DA9063_AD.
Magnus' Lager (remote access) has the same version.

(after adding the missing pieces to DT) Magnus's Gose has:

da9063 6-0058: Device detected (chip-ID: 0x61, var-ID: 0x50)

which corresponds to PMIC_DA9063_BB.

Which revision do you have?

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 v4 2/4] mmc: tmio: Add tuning support

2016-08-31 Thread Ulf Hansson
On 30 August 2016 at 22:51, Simon Horman  wrote:
> On Mon, Aug 29, 2016 at 04:05:55PM +0200, Ulf Hansson wrote:
>> On 29 August 2016 at 14:05, Simon Horman  wrote:
>> > On Fri, Aug 26, 2016 at 10:01:35AM +0200, Ulf Hansson wrote:
>> >> On 25 August 2016 at 14:04, Simon Horman  wrote:
>> >> > On Tue, Aug 23, 2016 at 05:02:56PM +0200, Ulf Hansson wrote:
>> >
>> > ...
>
> ...
>
>> > @@ -1271,6 +1278,7 @@ int tmio_mmc_host_runtime_suspend(struct device *dev)
>> >
>> > mmc_retune_timer_stop(host->mmc);
>> > mmc_retune_needed(host->mmc);
>> > +   host->use_saved_taps = true;
>>
>> I don't think you should trigger a re-tune here at all. Moreover you
>> don't need to keep track of whether you have valid tap values by using
>> the ->use_saved_taps variable, the mmc core deals with this for you.
>>
>> Instead, you should restore the tap values by invoking
>> host->select_tuning() from the ->runtime_resume() callback, although
>> only when host->mmc->can_retune == 1. We should probably add a helper
>> function in the mmc core for this check, instead of accessing
>> "can_retune" directly.
>
> Thanks, I was wondering what the best way to handle this is.
>
> I tried your suggestion above but it seems that host->mmc->can_retune is
> zero when ->runtime_resume() is called because of the following call paths:
>
> a) _mmc_sd_suspend()
>  -> mmc_power_off()
> -> mmc_set_initial_state()
>-> mmc_retune_disable
>and
> b) mmc_sd_runtime_resume()
>  -> mmc_power_up
> -> mmc_set_initial_state()
>-> mmc_retune_disable
>
>> > tmio_mmc_disable_mmc_irqs(host, TMIO_MASK_ALL);

This is exactly what shall happen :-)

If the mmc core suspends the card, it means it will also re-initialize
the card when resuming it. In that way the regular tuning sequence
will take place as a part of re-initialization of the card, so you
definitely must not restore tap values in these case. That is why you
should be using the can_retune to know when to restore the values.

>
>
> I plan to repost this patchset without the tap restoration code.
> This is because I have a number of changes locally, in particular
> to address other parts of your review, and I would like
> them to see the light of day.
>
> I will mark the tap restoration as a TODO item which we can address
> before merging the code in question.

It shouldn't be that hard to implement this, so I rather see that we
get this right from the beginning.

As matter of fact it probably requires less code than you had in your
initial approach, especially since I don't think you need to deal with
anything tuning related in the ->runtime_suspend() callback, but only
in ->runtime_resume().

Kind regards
Uffe


Re: [PATCH] ARM: dts: wheat: add SDHI0 support

2016-08-31 Thread Geert Uytterhoeven
Hi Sergei,

On Wed, Aug 31, 2016 at 12:24 AM, Sergei Shtylyov
 wrote:
> Define the Wheat board dependent  part of  the SDHI0 (connected to the
> micro-SD slot)  device node along with the necessary voltage regulator.
>
> Signed-off-by: Sergei Shtylyov 
>
> ---
> This patch is against the 'renesas-devel-20160830-v4.8-rc4' of Simon Horman's
> 'renesas.git' repo plus the CAN patch posted yesterday.
> Starting with this patch, SMSC LAN89218 Ethernet chip starts to misbehave on 
> my
> board...

Are GP11_11 or GP11_12 connected to the Ethernet chip?
Does the misbehaving go away if you drop
  - cd-gpios?
  - The regulator?
  - sdhi0-pins (there may be a bug in the pfc register bit definitions)?

>  arch/arm/boot/dts/r8a7792-wheat.dts |   26 ++
>  1 file changed, 26 insertions(+)
>
> Index: renesas/arch/arm/boot/dts/r8a7792-wheat.dts
> ===
> --- renesas.orig/arch/arm/boot/dts/r8a7792-wheat.dts
> +++ renesas/arch/arm/boot/dts/r8a7792-wheat.dts
> @@ -11,6 +11,7 @@
>
>  /dts-v1/;
>  #include "r8a7792.dtsi"
> +#include 
>
>  / {
> model = "Wheat";
> @@ -54,6 +55,17 @@
> pinctrl-0 = <_pins>;
> pinctrl-names = "default";
> };
> +
> +   vcc_sdhi0: regulator-vcc-sdhi0 {
> +   compatible = "regulator-fixed";
> +
> +   regulator-name = "SDHI0 Vcc";
> +   regulator-min-microvolt = <330>;
> +   regulator-max-microvolt = <330>;
> +
> +   gpio = < 12 GPIO_ACTIVE_HIGH>;
> +   enable-active-high;
> +   };
>  };
>
>  _clk {
> @@ -86,6 +98,11 @@
> groups = "can1_data";
> function = "can1";
> };
> +
> +   sdhi0_pins: sdhi0 {
> +   groups = "sdhi0_data4", "sdhi0_ctrl";
> +   function = "sdhi0";
> +   };
>  };
>
>   {
> @@ -108,3 +125,12 @@
>
> status = "okay";
>  };
> +
> + {
> +   pinctrl-0 = <_pins>;
> +   pinctrl-names = "default";
> +
> +   vmmc-supply = <_sdhi0>;
> +   cd-gpios = < 11 GPIO_ACTIVE_LOW>;
> +   status = "okay";
> +};

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


[PULL REQUEST] renesas/topic/i2c_sdhi_maintenance for renesas drivers

2016-08-31 Thread Wolfram Sang
Hi Geert,

here is a topic branch for renesas-drivers. Most of the patches I did
for this i2c/sdhi maintenance task are already in renesas-drivers,
because they came back via linux-next. Only the last three are missing
currently, but they are on the way, too. So, this branch will soonish
become obsolete again. Yay!

Kind regards,

   Wolfram


The following changes since commit 3eab887a55424fc2c27553b7bfe32330df83f7b8:

  Linux 4.8-rc4 (2016-08-28 15:04:33 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git 
renesas/topic/i2c_sdhi_maintenance

for you to fetch changes up to 91d6e42f0ba217c5d26d88648a18022f573d75de:

  ARM: shmobile: fix regulator quirk for Gen2 (2016-08-31 08:51:08 +0200)


Wolfram Sang (9):
  arm64: dts: r8a7795: set maximum frequency for SDHI clocks
  i2c: mux: demux-pinctrl: invalidate properly when switching fails
  i2c: sh_mobile: use proper device with dma_mapping_error
  i2c: rcar: use proper device with dma_mapping_error
  mmc: host: sh_mobile_sdhi: move card_busy from tmio to sdhi
  mmc: host: sh_mobile_sdhi: don't populate unneeded functions
  i2c: mux: demux-pinctrl: run properly with multiple instances
  Documentation: devicetree: changesets do locking on their own meanwhile
  ARM: shmobile: fix regulator quirk for Gen2

 Documentation/devicetree/changesets.txt| 19 ++-
 arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c | 62 +-
 arch/arm64/boot/dts/renesas/r8a7795.dtsi   |  4 ++
 drivers/i2c/busses/i2c-rcar.c  |  2 +-
 drivers/i2c/busses/i2c-sh_mobile.c |  2 +-
 drivers/i2c/muxes/i2c-demux-pinctrl.c  | 15 --
 drivers/mmc/host/sh_mobile_sdhi.c  | 16 +-
 drivers/mmc/host/tmio_mmc.h|  1 +
 drivers/mmc/host/tmio_mmc_pio.c|  9 +---
 9 files changed, 65 insertions(+), 65 deletions(-)


signature.asc
Description: PGP signature


Re: [PATCH] ravb: avoid unused function warnings

2016-08-31 Thread David Miller
From: Arnd Bergmann 
Date: Fri, 26 Aug 2016 17:30:29 +0200

> When CONFIG_PM_SLEEP is disabled, we get a couple of harmless warnings:
> 
> drivers/net/ethernet/renesas/ravb_main.c:2117:12: error: 'ravb_resume' 
> defined but not used [-Werror=unused-function]
> drivers/net/ethernet/renesas/ravb_main.c:2104:12: error: 'ravb_suspend' 
> defined but not used [-Werror=unused-function]
> 
> The simplest solution here is to replace the #ifdef with __maybe_unused
> annotations, which lets the compiler do the right thing by itself.
> 
> Signed-off-by: Arnd Bergmann 
> Fixes: 0184165b2f42 ("ravb: add sleep PM suspend/resume support")

Applied, thanks.


Re: renesas-drivers-2016-08-23-v4.8-rc3

2016-08-31 Thread Kuninori Morimoto

Hi Wolfram

> > I noticed that Lager "ES3.0" board can't boot on this and previous -rc2 
> > branch.
> > In my and Shimoda-san's check, "ES2.0" seems have no problem.
> 
> I understand the issue now. It is not about ES3.0 vs. ES2.0, it is about
> cold-boot vs. warm-boot. I remembered the DA9xxx interrupt storm
> problems we had, and voila, I could reproduce the lockup on ES2.0 here,
> but you need to cold-boot and have the da9xxx drivers enabled.

It seems lager board has 2 type of DA9xxx chip, type A, and type B.
We don't know which chip your / my board has.

My *current* Lager board has no issue on cold / warm boot.
Magnus has my previous Lager board, so I can't try it today.
I think my current board and previous board have different type of chip.
Magnus will bring me my previous board tomorrow, so I will check it,
and try your solution.

Best regards
---
Kuninori Morimoto