[PATCH v2 2/2] ARM: dts: r8a7793: add CAN nodes to device tree

2016-03-15 Thread Simon Horman
Add CAN nodes to r8a7793 device tree.

Based on work by Sergei Shtylyov for the r8a7791 SoC.

Cc: Sergei Shtylyov 
Signed-off-by: Simon Horman 
---
v2
* Use "renesas,rcar-gen2-can" compat string
---
 arch/arm/boot/dts/r8a7793.dtsi | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7793.dtsi b/arch/arm/boot/dts/r8a7793.dtsi
index 3d21a00f5b38..4ed786c22560 100644
--- a/arch/arm/boot/dts/r8a7793.dtsi
+++ b/arch/arm/boot/dts/r8a7793.dtsi
@@ -806,6 +806,28 @@
};
};
 
+   can0: can@e6e8 {
+   compatible = "renesas,can-r8a7793", "renesas,rcar-gen2-can";
+   reg = <0 0xe6e8 0 0x1000>;
+   interrupts = ;
+   clocks = <_clks R8A7793_CLK_RCAN0>,
+<_clocks R8A7793_CLK_RCAN>, <_clk>;
+   clock-names = "clkp1", "clkp2", "can_clk";
+   power-domains = <_clocks>;
+   status = "disabled";
+   };
+
+   can1: can@e6e88000 {
+   compatible = "renesas,can-r8a7793", "renesas,rcar-gen2-can";
+   reg = <0 0xe6e88000 0 0x1000>;
+   interrupts = ;
+   clocks = <_clks R8A7793_CLK_RCAN1>,
+<_clocks R8A7793_CLK_RCAN>, <_clk>;
+   clock-names = "clkp1", "clkp2", "can_clk";
+   power-domains = <_clocks>;
+   status = "disabled";
+   };
+
clocks {
#address-cells = <2>;
#size-cells = <2>;
-- 
2.1.4



[PATCH v2 0/2] ARM: dts: r8a7793: add CAN to device tree

2016-03-15 Thread Simon Horman
Hi,

this short series adds CAN clocks and nodes to the r8a7793 device tree.

I am not aware of an r8a7793 board that exposes CAN - the gose
board does not appear to - and thus am unsure of a way to test these changes.
However, they are based on what is present for the r8a7791 SoC and
I am unable to find a difference in the SoC documentation.

This series is similar to a series I posted for the r8a7794
earlier this week.

Based on renesas-devel-20160315-v4.5

Changes in v2
* Correct clock node names
* Add MSTP9 clocks
* Omit clock-output-names property from new nodes
* Use "renesas,rcar-gen2-can" compat string

Simon Horman (2):
  ARM: dts: r8a7793: add CAN clocks to device tree
  ARM: dts: r8a7793: add CAN nodes to device tree

 arch/arm/boot/dts/r8a7793.dtsi | 49 ++
 1 file changed, 45 insertions(+), 4 deletions(-)

-- 
2.1.4



Re: [PATCH] clk: renesas: div6: use RENESAS for #define

2016-03-15 Thread Stephen Boyd
On 03/08, Simon Horman wrote:
> Name the #define guarding compilation of this header
> __RENESAS_CLK_DIV6_H__ rather than __SHMOBILE_CLK_DIV6_H__.
> 
> This is a follow-up to renaming the directory in which this file lives from
> shmobile to renesas which is in turn part of an ongoing process to migrate
> from ARCH_SHMOBILE to ARCH_RENESAS the motivation for which being that
> RENESAS seems to be a more appropriate name than SHMOBILE for the majority
> of Renesas ARM based SoCs.
> 
> Signed-off-by: Simon Horman 
> ---

Applied to clk-next

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project


Re: [PATCH v2] clk: renesas: Rename header file renesas.h

2016-03-15 Thread Stephen Boyd
On 03/08, Simon Horman wrote:
> This is part of an ongoing process to migrate from ARCH_SHMOBILE to
> ARCH_RENESAS the motivation for which being that RENESAS seems to be a more
> appropriate name than SHMOBILE for the majority of Renesas ARM based SoCs.
> 
> Along with the above mentioned Kconfig changes it seems appropriate
> to also rename files.
> 
> Signed-off-by: Simon Horman 
> 
> ---

Applied to clk-next

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project


[PATCH 2/2] pinctrl: sh-pfc: IPSRx and MOD_SELx should be set before GPSRx

2016-03-15 Thread Kuninori Morimoto
From: Kuninori Morimoto 

Gen2 / Gen3 datasheet will have below note in next version.
This patch follows this note.

IPSRx and MOD_SELx registers shall be set before setting GPSRx
registers in case that they need to be configured.
MOD_SELx registers can be set either earlier or later than setting
IPSRx registers.

Signed-off-by: Kuninori Morimoto 
---
 drivers/pinctrl/sh-pfc/sh_pfc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/sh-pfc/sh_pfc.h b/drivers/pinctrl/sh-pfc/sh_pfc.h
index 2b593fc..f174d61 100644
--- a/drivers/pinctrl/sh-pfc/sh_pfc.h
+++ b/drivers/pinctrl/sh-pfc/sh_pfc.h
@@ -279,7 +279,7 @@ struct sh_pfc_soc_info {
  *   - msel: Module selector
  */
 #define PINMUX_IPSR_MSEL(ipsr, fn, msel)   \
-   PINMUX_DATA(fn##_MARK, FN_##msel, FN_##ipsr, FN_##fn)
+   PINMUX_DATA(fn##_MARK, FN_##msel, FN_##fn, FN_##ipsr)
 
 /*
  * Describe a pinmux configuration for a single-function pin with GPIO
-- 
1.9.1



[PATCH 1/2] pinctrl: sh-pfc: enable to indicate GPSR/IPSR/MOD_SEL for debug

2016-03-15 Thread Kuninori Morimoto
From: Kuninori Morimoto 

Current sh_pfc can't indicate GPSR/IPSR/MOD_SEL name for debug.
Of course we can get it from indicated register address, but it
is not convenient. This patch enables to indicate these.

Signed-off-by: Kuninori Morimoto 
---
 drivers/pinctrl/sh-pfc/core.c   | 3 ++-
 drivers/pinctrl/sh-pfc/sh_pfc.h | 9 ++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/sh-pfc/core.c b/drivers/pinctrl/sh-pfc/core.c
index 0c2d14c..c59f858 100644
--- a/drivers/pinctrl/sh-pfc/core.c
+++ b/drivers/pinctrl/sh-pfc/core.c
@@ -204,8 +204,9 @@ static void sh_pfc_write_config_reg(struct sh_pfc *pfc,
 
sh_pfc_config_reg_helper(pfc, crp, field, _reg, , );
 
-   dev_dbg(pfc->dev, "write_reg addr = %x, value = 0x%x, field = %u, "
+   dev_dbg(pfc->dev, "%s: write_reg addr = %x, value = 0x%x, field = %u, "
"r_width = %u, f_width = %u\n",
+   crp->name,
crp->reg, value, field, crp->reg_width, crp->field_width);
 
mask = ~(mask << pos);
diff --git a/drivers/pinctrl/sh-pfc/sh_pfc.h b/drivers/pinctrl/sh-pfc/sh_pfc.h
index a490834..2b593fc 100644
--- a/drivers/pinctrl/sh-pfc/sh_pfc.h
+++ b/drivers/pinctrl/sh-pfc/sh_pfc.h
@@ -94,6 +94,7 @@ struct pinmux_func {
 };
 
 struct pinmux_cfg_reg {
+   const char *name;
u32 reg;
u8 reg_width, field_width;
const u16 *enum_ids;
@@ -110,7 +111,8 @@ struct pinmux_cfg_reg {
  * (from left to right, i.e. MSB to LSB), 2^f_width enum IDs must be specified,
  * one for each possible combination of the register field bit values.
  */
-#define PINMUX_CFG_REG(name, r, r_width, f_width) \
+#define PINMUX_CFG_REG(_name, r, r_width, f_width) \
+   .name = _name, \
.reg = r, .reg_width = r_width, .field_width = f_width, \
.enum_ids = (const u16 [(r_width / f_width) * (1 << f_width)])
 
@@ -125,7 +127,8 @@ struct pinmux_cfg_reg {
  * (from left to right, i.e. MSB to LSB), 2^var_fwi enum IDs must be specified,
  * one for each possible combination of the register field bit values.
  */
-#define PINMUX_CFG_REG_VAR(name, r, r_width, var_fw0, var_fwn...) \
+#define PINMUX_CFG_REG_VAR(_name, r, r_width, var_fw0, var_fwn...) \
+   .name = _name, \
.reg = r, .reg_width = r_width, \
.var_field_width = (const u8 [r_width]) \
{ var_fw0, var_fwn, 0 }, \
@@ -465,7 +468,7 @@ struct sh_pfc_soc_info {
  */
 #define PORTCR(nr, reg)
\
{   \
-   PINMUX_CFG_REG_VAR("PORT" nr "CR", reg, 8, 2, 2, 1, 3) {\
+   PINMUX_CFG_REG_VAR("PORT" #nr "CR", reg, 8, 2, 2, 1, 3) {\
/* PULMD[1:0], handled by .set_bias() */\
0, 0, 0, 0, \
/* IE and OE */ \
-- 
1.9.1



[PATCH 0/2] pinctrl: sh-pfc: tidyup IPSR/MOD_SEL/GPSR settings order

2016-03-15 Thread Kuninori Morimoto

Hi Geert, Laurent

Gen2 / Gen3 next datasheet will has below note.
Our current PFC settings order is
MOD_SEL -> GPSR -> IPSR
But, this fixes it to
MOD_SEL -> IPSR -> GPSR


IPSRx and MOD_SELx registers shall be set before setting GPSRx
registers in case that they need to be configured.
MOD_SELx registers can be set either earlier or later than setting
IPSRx registers.


1) patch make it easy to check
2) patch fixes above

Kuninori Morimoto (2):
  1) pinctrl: sh-pfc: enable to indicate GPSR/IPSR/MOD_SEL for debug
  2) pinctrl: sh-pfc: IPSRx and MOD_SELx should be set before GPSRx

 drivers/pinctrl/sh-pfc/core.c   |  3 ++-
 drivers/pinctrl/sh-pfc/sh_pfc.h | 11 +++
 2 files changed, 9 insertions(+), 5 deletions(-)



Best regards
---
Kuninori Morimoto


[PATCH] ARM: dts: r8a7790: Remove unnecessary clock-output-names properties

2016-03-15 Thread Simon Horman
* Fixed rate and fixed factor clocks do not require an
  clock-output-names property.
* Since 1fae91ec99fb ("clk: shmobile: div6: Extract cpg_div6_register()")
  Renesas div6 clocks do not require a clock-output-names property.

In the above cases there is only one clock output and its name is taken
from that of the clock node.

Accordingly, remove the unnecessary clock-output-names properties and
as necessary the nodes.

Signed-off-by: Simon Horman 
---
 arch/arm/boot/dts/r8a7790.dtsi | 88 ++
 1 file changed, 28 insertions(+), 60 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index b71b3e20b6e4..634f7e05ba6b 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -1038,20 +1038,18 @@
ranges;
 
/* External root clock */
-   extal_clk: extal_clk {
+   extal_clk: extal {
compatible = "fixed-clock";
#clock-cells = <0>;
/* This value must be overriden by the board. */
clock-frequency = <0>;
-   clock-output-names = "extal";
};
 
/* External PCIe clock - can be overridden by the board */
-   pcie_bus_clk: pcie_bus_clk {
+   pcie_bus_clk: pcie_bus {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <1>;
-   clock-output-names = "pcie_bus";
status = "disabled";
};
 
@@ -1063,19 +1061,16 @@
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <0>;
-   clock-output-names = "audio_clk_a";
};
audio_clk_b: audio_clk_b {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <0>;
-   clock-output-names = "audio_clk_b";
};
audio_clk_c: audio_clk_c {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <0>;
-   clock-output-names = "audio_clk_c";
};
 
/* External SCIF clock */
@@ -1088,11 +1083,10 @@
};
 
/* External USB clock - can be overridden by the board */
-   usb_extal_clk: usb_extal_clk {
+   usb_extal_clk: usb_extal {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <4800>;
-   clock-output-names = "usb_extal";
};
 
/* External CAN clock */
@@ -1101,7 +1095,6 @@
#clock-cells = <0>;
/* This value must be overridden by the board. */
clock-frequency = <0>;
-   clock-output-names = "can_clk";
status = "disabled";
};
 
@@ -1119,201 +1112,176 @@
};
 
/* Variable factor clocks */
-   sd2_clk: sd2_clk@e6150078 {
+   sd2_clk: sd2@e6150078 {
compatible = "renesas,r8a7790-div6-clock", 
"renesas,cpg-div6-clock";
reg = <0 0xe6150078 0 4>;
clocks = <_div2_clk>;
#clock-cells = <0>;
-   clock-output-names = "sd2";
};
-   sd3_clk: sd3_clk@e615026c {
+   sd3_clk: sd3@e615026c {
compatible = "renesas,r8a7790-div6-clock", 
"renesas,cpg-div6-clock";
reg = <0 0xe615026c 0 4>;
clocks = <_div2_clk>;
#clock-cells = <0>;
-   clock-output-names = "sd3";
};
-   mmc0_clk: mmc0_clk@e6150240 {
+   mmc0_clk: mmc0@e6150240 {
compatible = "renesas,r8a7790-div6-clock", 
"renesas,cpg-div6-clock";
reg = <0 0xe6150240 0 4>;
clocks = <_div2_clk>;
#clock-cells = <0>;
-   clock-output-names = "mmc0";
};
-   mmc1_clk: mmc1_clk@e6150244 {
+   mmc1_clk: mmc1@e6150244 {
compatible = "renesas,r8a7790-div6-clock", 
"renesas,cpg-div6-clock";
reg = <0 0xe6150244 0 4>;
clocks = <_div2_clk>;
#clock-cells = <0>;
-   clock-output-names = "mmc1";
};
-   ssp_clk: 

Re: [PATCH v2 0/2] ARM: dts: r8a7793: add CAN to device tree

2016-03-15 Thread Simon Horman
On Tue, Mar 15, 2016 at 05:02:32PM +0900, Simon Horman wrote:
> On Tue, Mar 15, 2016 at 07:09:23AM +, Ramesh Shanmugasundaram wrote:
> > Hi Simon,
> > 
> > > Subject: [PATCH v2 0/2] ARM: dts: r8a7793: add CAN to device tree
> > 
> > r8a7794?
> 
> Yes, my bad.
> 
> > > 
> > > Hi,
> > > 
> > > this short series adds CAN clocks and nodes to the r8a7794 device tree.
> > > 
> > > I am not aware of an r8a7794 board that exposes CAN - neither the alt nor
> > > the silk board appear to - and thus am unsure of a way to test these
> > > changes.  However, they are based on what is present for the r8a7791 SoC
> > > and I am unable to find a difference in the SoC documentation.
> > > 
> > > This series is similar to a similar series I posted for the r8a7794 in
> > > January.
> > > 
> > > Based on renesas-devel-20160311-v4.5-rc7.
> > > 
> > > Changes in v2
> > > * Correct clock node names
> > > * Add MSTP9 clocks
> > > * Omit clock-output-names property from new nodes
> > 
> > Acked-by: Ramesh Shanmugasundaram 
> > 
> > for this series.
> 
> Thanks

I have gone ahead and queued up this series.


Re: [PATCHv2 00/31] ARM: dts: r8a779[0-4]: Reference both DMA controllers

2016-03-15 Thread Simon Horman
On Tue, Mar 15, 2016 at 01:41:37PM +0100, Niklas Söderlund wrote:
> Hi,
> 
> R-Car Gen2 have two DMA controllers, which are equivalent. However DMA
> slaves were tied only to a single DMA controller in .dtsi. This series
> add references to to both DMA controllers for all nodes that previously
> only referenced one of them. It also adds dma references to the SDHI
> nodes for r8a7794 which according to the datasheet should work but I
> have not access to HW to verify.
> 
> Tested on Koelsch (r8a7791) by altering the compatible value of either
> dmac0 or dmac1 and verifying that the DMA slaves pick the DMA controller
> that is instantiated.
> 
> For your convince the series can be fetched from
> https://git.ragnatech.se/linux rcar-dmas-dt-2
> 
> * Changes since v1
> - Rebase on top of renesas-devel-20160315-v4.5 and add dmas references
>   new nodes (r8a7790: scif2 r8a7793: i2c6,i2c7,i2c8).
> - Correct error in commit message 31/31 (s/QSPI/MMCIF).
> - Collect Ack and Reviewed tags from Geert.

Thanks Niklas,

I have queued these up for v4.7.


Re: [PATCH v7 net-next] ravb: Add dma queue interrupt support

2016-03-15 Thread Sergei Shtylyov

Hello.

On 03/15/2016 06:03 PM, Yoshihiro Kaneko wrote:


From: Kazuya Mizuguchi 

This patch supports the following interrupts.

- One interrupt for multiple (timestamp, error, gPTP)
- One interrupt for emac
- Four interrupts for dma queue (best effort rx/tx, network control rx/tx)

This patch improve efficiency of the interrupt handler by adding the
interrupt handler corresponding to each interrupt source described
above. Additionally, it reduces the number of times of the access to
EthernetAVB IF.
Also this patch prevent this driver depends on the whim of a boot loader.

[ykaneko0...@gmail.com: define bit names of registers]
[ykaneko0...@gmail.com: add comment for gen3 only registers]
[ykaneko0...@gmail.com: fix coding style]
[ykaneko0...@gmail.com: update changelog]
[ykaneko0...@gmail.com: gen3: fix initialization of interrupts]
[ykaneko0...@gmail.com: gen3: fix clearing interrupts]
[ykaneko0...@gmail.com: gen3: add helper function for request_irq()]
[ykaneko0...@gmail.com: gen3: remove IRQF_SHARED flag for request_irq()]
[ykaneko0...@gmail.com: revert ravb_close() and ravb_ptp_stop()]
[ykaneko0...@gmail.com: avoid calling free_irq() to non-hooked interrupts]
[ykaneko0...@gmail.com: make NC/BE interrupt handler a function]
[ykaneko0...@gmail.com: make timestamp interrupt handler a function]
[ykaneko0...@gmail.com: timestamp interrupt is handled in multiple
   interrupt handler instead of dma queue interrupt handler]
Signed-off-by: Kazuya Mizuguchi 
Signed-off-by: Yoshihiro Kaneko 


[...]


diff --git a/drivers/net/ethernet/renesas/ravb_main.c
b/drivers/net/ethernet/renesas/ravb_main.c
index 8f2c4fb..8fa8ffe 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c


[...]


@@ -757,14 +806,73 @@ static irqreturn_t ravb_interrupt(int irq, void
*dev_id)
 result = IRQ_HANDLED;
 }

-   if (iss & ISS_CGIS)
-   result = ravb_ptp_interrupt(ndev);
+   /* gPTP interrupt status summary */
+   if ((iss & ISS_CGIS) && ravb_ptp_interrupt(ndev) == IRQ_HANDLED)
+   result = IRQ_HANDLED;


Wait, this seems like a bug in the existing driver! Please do fix it with
a separate patch against net.git. Sorry about missing (or even adding) it
while cleaning up the driver before submission...



Thanks, I will do so.


   TIA.



[...]

Looks fine otherwise, however the new features and the fixes shouldn't be
mixed together, so I couldn't ACK yet. I'll go test it on gen2...


Thanks in advance.


   My testing on the modified Porter board went smooth.


Thanks,
kaneko


MBR, Sergei



[PATCH 04/04] iommu/ipmmu-vmsa: Add new IOMMU_DOMAIN_DMA ops

2016-03-15 Thread Magnus Damm
From: Magnus Damm 

Introduce a new set of iommu_ops suitable for 64-bit ARM
as well as 32-bit ARM when CONFIG_IOMMU_DMA=y. The ->of_xlate()
callback is needed by the code exported by of_iommu.h and
it is wrapped in #ifdefs to also compile of x86_64.

Signed-off-by: Magnus Damm 
---

 drivers/iommu/ipmmu-vmsa.c |   94 +++-
 1 file changed, 92 insertions(+), 2 deletions(-)

--- 0011/drivers/iommu/ipmmu-vmsa.c
+++ work/drivers/iommu/ipmmu-vmsa.c 2016-03-16 01:35:06.990513000 +0900
@@ -10,6 +10,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -804,7 +805,7 @@ static void ipmmu_remove_device(struct d
dev->archdata.iommu = NULL;
 }
 
-static const struct iommu_ops ipmmu_ops = {
+static const struct iommu_ops __maybe_unused ipmmu_ops = {
.domain_alloc = ipmmu_domain_alloc,
.domain_free = ipmmu_domain_free,
.attach_dev = ipmmu_attach_device,
@@ -818,6 +819,92 @@ static const struct iommu_ops ipmmu_ops
.pgsize_bitmap = SZ_1G | SZ_2M | SZ_4K,
 };
 
+static struct iommu_domain *ipmmu_domain_alloc_dma(unsigned type)
+{
+   struct iommu_domain *io_domain;
+
+   if (type != IOMMU_DOMAIN_DMA)
+   return NULL;
+
+   io_domain = __ipmmu_domain_alloc(type);
+   if (io_domain)
+   iommu_get_dma_cookie(io_domain);
+
+   return io_domain;
+}
+
+static void ipmmu_domain_free_dma(struct iommu_domain *io_domain)
+{
+   iommu_put_dma_cookie(io_domain);
+   ipmmu_domain_free(io_domain);
+}
+
+static int ipmmu_add_device_dma(struct device *dev)
+{
+   struct iommu_group *group;
+
+   /* only accept devices with iommus property */
+   if (of_count_phandle_with_args(dev->of_node, "iommus",
+  "#iommu-cells") < 0)
+   return -ENODEV;
+
+   group = iommu_group_get_for_dev(dev);
+   if (IS_ERR(group))
+   return PTR_ERR(group);
+
+   return 0;
+}
+
+static void ipmmu_remove_device_dma(struct device *dev)
+{
+   iommu_group_remove_device(dev);
+}
+
+static struct iommu_group *ipmmu_device_group_dma(struct device *dev)
+{
+   struct iommu_group *group;
+   int ret;
+
+   group = generic_device_group(dev);
+   if (IS_ERR(group))
+   return group;
+
+   ret = ipmmu_init_platform_device(dev, group);
+   if (ret) {
+   iommu_group_put(group);
+   group = ERR_PTR(ret);
+   }
+
+   return group;
+}
+
+#ifdef CONFIG_OF_IOMMU
+static int ipmmu_of_xlate_dma(struct device *dev,
+ struct of_phandle_args *spec)
+{
+   /* dummy callback to satisfy of_iommu_configure() */
+   return 0;
+}
+#endif
+
+static const struct iommu_ops __maybe_unused ipmmu_ops_dma = {
+   .domain_alloc = ipmmu_domain_alloc_dma,
+   .domain_free = ipmmu_domain_free_dma,
+   .attach_dev = ipmmu_attach_device,
+   .detach_dev = ipmmu_detach_device,
+   .map = ipmmu_map,
+   .unmap = ipmmu_unmap,
+   .map_sg = default_iommu_map_sg,
+   .iova_to_phys = ipmmu_iova_to_phys,
+   .add_device = ipmmu_add_device_dma,
+   .remove_device = ipmmu_remove_device_dma,
+   .device_group = ipmmu_device_group_dma,
+   .pgsize_bitmap = SZ_1G | SZ_2M | SZ_4K,
+#ifdef CONFIG_OF_IOMMU
+   .of_xlate = ipmmu_of_xlate_dma,
+#endif
+};
+
 /* 
-
  * Probe/remove and init
  */
@@ -929,14 +1016,17 @@ static struct platform_driver ipmmu_driv
 
 static int __init ipmmu_init(void)
 {
+   const struct iommu_ops *ops;
int ret;
 
ret = platform_driver_register(_driver);
if (ret < 0)
return ret;
 
+   ops = IS_ENABLED(CONFIG_IOMMU_DMA) ? _ops_dma : _ops;
+
if (!iommu_present(_bus_type))
-   bus_set_iommu(_bus_type, _ops);
+   bus_set_iommu(_bus_type, ops);
 
return 0;
 }


[PATCH 03/04] iommu/ipmmu-vmsa: Break out domain allocation code

2016-03-15 Thread Magnus Damm
From: Magnus Damm 

Break out the domain allocation code into a separate function.
This is preparation for future code sharing.

Signed-off-by: Magnus Damm 
---

 drivers/iommu/ipmmu-vmsa.c |   13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

--- 0014/drivers/iommu/ipmmu-vmsa.c
+++ work/drivers/iommu/ipmmu-vmsa.c 2015-12-14 19:23:22.210513000 +0900
@@ -457,13 +457,10 @@ static irqreturn_t ipmmu_domain_irq(int
  * IOMMU Operations
  */
 
-static struct iommu_domain *ipmmu_domain_alloc(unsigned type)
+static struct iommu_domain *__ipmmu_domain_alloc(unsigned type)
 {
struct ipmmu_vmsa_domain *domain;
 
-   if (type != IOMMU_DOMAIN_UNMANAGED)
-   return NULL;
-
domain = kzalloc(sizeof(*domain), GFP_KERNEL);
if (!domain)
return NULL;
@@ -473,6 +470,14 @@ static struct iommu_domain *ipmmu_domain
return >io_domain;
 }
 
+static struct iommu_domain *ipmmu_domain_alloc(unsigned type)
+{
+   if (type != IOMMU_DOMAIN_UNMANAGED)
+   return NULL;
+
+   return __ipmmu_domain_alloc(type);
+}
+
 static void ipmmu_domain_free(struct iommu_domain *io_domain)
 {
struct ipmmu_vmsa_domain *domain = to_vmsa_domain(io_domain);


[PATCH 02/04] iommu/ipmmu-vmsa: Break out utlb parsing code

2016-03-15 Thread Magnus Damm
From: Magnus Damm 

Break out the utlb parsing code and dev_data allocation into a
separate function. This is preparation for future code sharing.

Signed-off-by: Magnus Damm 
---

 drivers/iommu/ipmmu-vmsa.c |  125 
 1 file changed, 70 insertions(+), 55 deletions(-)

--- 0008/drivers/iommu/ipmmu-vmsa.c
+++ work/drivers/iommu/ipmmu-vmsa.c 2016-03-15 21:08:20.180513000 +0900
@@ -619,6 +619,69 @@ static int ipmmu_find_utlbs(struct ipmmu
return 0;
 }
 
+static int ipmmu_init_platform_device(struct device *dev,
+ struct iommu_group *group)
+{
+   struct ipmmu_vmsa_archdata *archdata;
+   struct ipmmu_vmsa_device *mmu;
+   unsigned int *utlbs;
+   unsigned int i;
+   int num_utlbs;
+   int ret = -ENODEV;
+
+   /* Find the master corresponding to the device. */
+
+   num_utlbs = of_count_phandle_with_args(dev->of_node, "iommus",
+  "#iommu-cells");
+   if (num_utlbs < 0)
+   return -ENODEV;
+
+   utlbs = kcalloc(num_utlbs, sizeof(*utlbs), GFP_KERNEL);
+   if (!utlbs)
+   return -ENOMEM;
+
+   spin_lock(_devices_lock);
+
+   list_for_each_entry(mmu, _devices, list) {
+   ret = ipmmu_find_utlbs(mmu, dev, utlbs, num_utlbs);
+   if (!ret) {
+   /*
+* TODO Take a reference to the MMU to protect
+* against device removal.
+*/
+   break;
+   }
+   }
+
+   spin_unlock(_devices_lock);
+
+   if (ret < 0)
+   goto error;
+
+   for (i = 0; i < num_utlbs; ++i) {
+   if (utlbs[i] >= mmu->num_utlbs) {
+   ret = -EINVAL;
+   goto error;
+   }
+   }
+
+   archdata = kzalloc(sizeof(*archdata), GFP_KERNEL);
+   if (!archdata) {
+   ret = -ENOMEM;
+   goto error;
+   }
+
+   archdata->mmu = mmu;
+   archdata->utlbs = utlbs;
+   archdata->num_utlbs = num_utlbs;
+   dev->archdata.iommu = archdata;
+   return 0;
+
+error:
+   kfree(utlbs);
+   return ret;
+}
+
 #if defined(CONFIG_ARM) && !defined(CONFIG_IOMMU_DMA)
 static int ipmmu_map_attach(struct device *dev, struct ipmmu_vmsa_device *mmu)
 {
@@ -675,13 +738,8 @@ static inline void ipmmu_release_mapping
 
 static int ipmmu_add_device(struct device *dev)
 {
-   struct ipmmu_vmsa_archdata *archdata;
-   struct ipmmu_vmsa_device *mmu;
-   struct iommu_group *group = NULL;
-   unsigned int *utlbs;
-   unsigned int i;
-   int num_utlbs;
-   int ret = -ENODEV;
+   struct iommu_group *group;
+   int ret;
 
if (dev->archdata.iommu) {
dev_warn(dev, "IOMMU driver already assigned to device %s\n",
@@ -689,42 +747,6 @@ static int ipmmu_add_device(struct devic
return -EINVAL;
}
 
-   /* Find the master corresponding to the device. */
-
-   num_utlbs = of_count_phandle_with_args(dev->of_node, "iommus",
-  "#iommu-cells");
-   if (num_utlbs < 0)
-   return -ENODEV;
-
-   utlbs = kcalloc(num_utlbs, sizeof(*utlbs), GFP_KERNEL);
-   if (!utlbs)
-   return -ENOMEM;
-
-   spin_lock(_devices_lock);
-
-   list_for_each_entry(mmu, _devices, list) {
-   ret = ipmmu_find_utlbs(mmu, dev, utlbs, num_utlbs);
-   if (!ret) {
-   /*
-* TODO Take a reference to the MMU to protect
-* against device removal.
-*/
-   break;
-   }
-   }
-
-   spin_unlock(_devices_lock);
-
-   if (ret < 0)
-   return -ENODEV;
-
-   for (i = 0; i < num_utlbs; ++i) {
-   if (utlbs[i] >= mmu->num_utlbs) {
-   ret = -EINVAL;
-   goto error;
-   }
-   }
-
/* Create a device group and add the device to it. */
group = iommu_group_alloc();
if (IS_ERR(group)) {
@@ -742,27 +764,20 @@ static int ipmmu_add_device(struct devic
goto error;
}
 
-   archdata = kzalloc(sizeof(*archdata), GFP_KERNEL);
-   if (!archdata) {
-   ret = -ENOMEM;
+   ret = ipmmu_init_platform_device(dev, group);
+   if (ret < 0) {
+   dev_err(dev, "Failed to init platform device\n");
goto error;
}
 
-   archdata->mmu = mmu;
-   archdata->utlbs = utlbs;
-   archdata->num_utlbs = num_utlbs;
-   dev->archdata.iommu = archdata;
-
-   ret = ipmmu_map_attach(dev, mmu);
+   ret = ipmmu_map_attach(dev, ((struct ipmmu_vmsa_archdata *)
+ 

Re: [PATCH] media: add GFP flag to media_*() that could get called in atomic context

2016-03-15 Thread Mauro Carvalho Chehab
Em Mon, 14 Mar 2016 14:09:09 +0200
Sakari Ailus  escreveu:

> Hi Mauro,
> 
> On Mon, Mar 14, 2016 at 08:46:33AM -0300, Mauro Carvalho Chehab wrote:
> > Em Mon, 14 Mar 2016 12:52:54 +0200
> > Sakari Ailus  escreveu:
> >   
> > > Hi Mauro,
> > > 
> > > On Mon, Mar 14, 2016 at 07:13:58AM -0300, Mauro Carvalho Chehab wrote:  
> > > > Em Mon, 14 Mar 2016 09:22:37 +0200
> > > > Sakari Ailus  escreveu:
> > > > 
> > > > > Hi Shuah,
> > > > > 
> > > > > On Sat, Mar 12, 2016 at 06:48:09PM -0700, Shuah Khan wrote:
> > > > > > Add GFP flags to media_create_pad_link(), media_create_intf_link(),
> > > > > > media_devnode_create(), and media_add_link() that could get called
> > > > > > in atomic context to allow callers to pass in the right flags for
> > > > > > memory allocation.
> > > > > > 
> > > > > > tree-wide driver changes for media_*() GFP flags change:
> > > > > > Change drivers to add gfpflags to interffaces, 
> > > > > > media_create_pad_link(),
> > > > > > media_create_intf_link() and media_devnode_create().
> > > > > > 
> > > > > > Signed-off-by: Shuah Khan 
> > > > > > Suggested-by: Mauro Carvalho Chehab   
> > > > > 
> > > > > What's the use case for calling the above functions in an atomic 
> > > > > context?
> > > > > 
> > > > 
> > > > ALSA code seems to do a lot of stuff at atomic context. That's what
> > > > happens on my test machine when au0828 gets probed before
> > > > snd-usb-audio:
> > > > http://pastebin.com/LEX5LD5K
> > > > 
> > > > It seems that ALSA USB probe routine (usb_audio_probe) happens in
> > > > atomic context.
> > > 
> > > usb_audio_probe() grabs a mutex (register_mutex) on its own. It certainly
> > > cannot be called in atomic context.
> > > 
> > > In the above log, what I did notice, though, was that because *we* grab
> > > mdev->lock spinlock in media_device_register_entity(), we may not sleep
> > > which is what the notify() callback implementation in au0828 driver does
> > > (for memory allocation).  
> > 
> > True. After looking into the code, the problem is that the notify
> > callbacks are called with the spinlock hold. I don't see any reason
> > to do that.  
> 
> Notify callbacks, perhaps not, but the list is still protected by the
> spinlock. It perhaps is not likely that another process would change it but
> I don't think we can rely on that.

I can see only 2 risks protected by the lock:

1) mdev gets freed while an entity is being created. This is a problem
   with the current memory protection schema we're using. I guess the
   only way to fix it is to use kref for mdev/entities/interfaces/links/pads.
   This change doesn't make it better or worse.
   Also, I don't think we have such risk with the current devices.

2) a notifier may be inserted or removed by another driver, while the
   loop is running.

To avoid (2), I see 3 alternatives:

a) keep the loop as proposed on this patch. As the list is navigated using 
list_for_each_entry_safe(), I guess[1] it should be safe to remove/add
new notify callbacks there while the loop is running by some other process. 

[1] It *is* safe if the change were done inside the loop - but I'm not
100% sure that it is safe if some other CPU touches the notify list.

b) Unlock/relock the spinlock every time:

/* previous code that locks mdev->lock spinlock */

/* invoke entity_notify callbacks */
list_for_each_entry_safe(notify, next, >entity_notify, list) {
spin_unlock(>lock);
(notify)->notify(entity, notify->notify_data);
spin_lock(>lock);
}
 
spin_unlock(>lock);

c) use a separate lock for the notify list -this seems to be an overkill.

d) Protect it with the graph traversal mutex. That sounds the worse idea,
   IMHO, as we'll be abusing the lock.

> 
> >   
> > > Could we instead replace mdev->lock by a mutex?  
> > 
> > We changed the code to use a spinlock for a reason: this fixed some
> > troubles in the past with the code locking (can't remember the problem,
> > but this was documented at the kernel logs and at the ML). Yet, the code
> > under the spinlock never sleeps, so this is fine.  
> 
> struct media_device.lock was added by this patch:
> 
> commit 53e269c102fbaf77e7dc526b1606ad4a48e57200
> Author: Laurent Pinchart 
> Date:   Wed Dec 9 08:40:00 2009 -0300
> 
> [media] media: Entities, pads and links
> 
> As video hardware pipelines become increasingly complex and
> configurable, the current hardware description through v4l2 subdevices
> reaches its limits. In addition to enumerating and configuring
> subdevices, video camera drivers need a way to discover and modify at
> runtime how those subdevices are connected. This is done through new
> elements called entities, pads and links.
> 
> ...
> 
> Signed-off-by: Laurent Pinchart 

[PATCH net] ravb: fix result value overwrite

2016-03-15 Thread Yoshihiro Kaneko
The result value is overwritten by a return value of
ravb_ptp_interrupt().

Signed-off-by: Yoshihiro Kaneko 
---

This patch is based on the master branch of David Miller's networking tree.

 drivers/net/ethernet/renesas/ravb_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/renesas/ravb_main.c 
b/drivers/net/ethernet/renesas/ravb_main.c
index 86449c3..d369af8 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -765,8 +765,8 @@ static irqreturn_t ravb_interrupt(int irq, void *dev_id)
result = IRQ_HANDLED;
}
 
-   if (iss & ISS_CGIS)
-   result = ravb_ptp_interrupt(ndev);
+   if ((iss & ISS_CGIS) && ravb_ptp_interrupt(ndev) == IRQ_HANDLED)
+   result = IRQ_HANDLED;
 
mmiowb();
spin_unlock(>lock);
-- 
1.9.1



Re: [PATCH v7 net-next] ravb: Add dma queue interrupt support

2016-03-15 Thread Yoshihiro Kaneko
Hi,

2016-03-15 5:48 GMT+09:00 Sergei Shtylyov :
> Hello.
>
>
> On 03/13/2016 09:11 PM, Yoshihiro Kaneko wrote:
>
>> From: Kazuya Mizuguchi 
>>
>> This patch supports the following interrupts.
>>
>> - One interrupt for multiple (timestamp, error, gPTP)
>> - One interrupt for emac
>> - Four interrupts for dma queue (best effort rx/tx, network control rx/tx)
>>
>> This patch improve efficiency of the interrupt handler by adding the
>> interrupt handler corresponding to each interrupt source described
>> above. Additionally, it reduces the number of times of the access to
>> EthernetAVB IF.
>> Also this patch prevent this driver depends on the whim of a boot loader.
>>
>> [ykaneko0...@gmail.com: define bit names of registers]
>> [ykaneko0...@gmail.com: add comment for gen3 only registers]
>> [ykaneko0...@gmail.com: fix coding style]
>> [ykaneko0...@gmail.com: update changelog]
>> [ykaneko0...@gmail.com: gen3: fix initialization of interrupts]
>> [ykaneko0...@gmail.com: gen3: fix clearing interrupts]
>> [ykaneko0...@gmail.com: gen3: add helper function for request_irq()]
>> [ykaneko0...@gmail.com: gen3: remove IRQF_SHARED flag for request_irq()]
>> [ykaneko0...@gmail.com: revert ravb_close() and ravb_ptp_stop()]
>> [ykaneko0...@gmail.com: avoid calling free_irq() to non-hooked interrupts]
>> [ykaneko0...@gmail.com: make NC/BE interrupt handler a function]
>> [ykaneko0...@gmail.com: make timestamp interrupt handler a function]
>> [ykaneko0...@gmail.com: timestamp interrupt is handled in multiple
>>   interrupt handler instead of dma queue interrupt handler]
>> Signed-off-by: Kazuya Mizuguchi 
>> Signed-off-by: Yoshihiro Kaneko 
>
> [...]
>>
>> diff --git a/drivers/net/ethernet/renesas/ravb_main.c
>> b/drivers/net/ethernet/renesas/ravb_main.c
>> index 8f2c4fb..8fa8ffe 100644
>> --- a/drivers/net/ethernet/renesas/ravb_main.c
>> +++ b/drivers/net/ethernet/renesas/ravb_main.c
>
> [...]
>>
>> @@ -757,14 +806,73 @@ static irqreturn_t ravb_interrupt(int irq, void
>> *dev_id)
>> result = IRQ_HANDLED;
>> }
>>
>> -   if (iss & ISS_CGIS)
>> -   result = ravb_ptp_interrupt(ndev);
>> +   /* gPTP interrupt status summary */
>> +   if ((iss & ISS_CGIS) && ravb_ptp_interrupt(ndev) == IRQ_HANDLED)
>> +   result = IRQ_HANDLED;
>
>
>Wait, this seems like a bug in the existing driver! Please do fix it with
> a separate patch against net.git. Sorry about missing (or even adding) it
> while cleaning up the driver before submission...

Thanks, I will do so.

>
> [...]
>
>Looks fine otherwise, however the new features and the fixes shouldn't be
> mixed together, so I couldn't ACK yet. I'll go test it on gen2...

Thanks in advance.

>
> MBR, Sergei
>

Thanks,
kaneko


RE: [PATCH v3] can: rcar_canfd: Add Renesas R-Car CAN FD driver

2016-03-15 Thread Ramesh Shanmugasundaram
Hi Marc,

> Subject: Re: [PATCH v3] can: rcar_canfd: Add Renesas R-Car CAN FD driver
> 
> On 03/15/2016 10:48 AM, Ramesh Shanmugasundaram wrote:
> > This patch adds support for the CAN FD controller found in Renesas
> > R-Car SoCs. The controller operates in CAN FD only mode by default.
> >
> > CAN FD mode supports both Classical CAN & CAN FD frame formats. The
> > controller supports ISO 11898-1:2015 CAN FD format only.
> >
> > This controller supports two channels and the driver can enable either
> > or both of the channels.
> >
> > Driver uses Rx FIFOs (one per channel) for reception & Common FIFOs
> > (one per channel) for transmission. Rx filter rules are configured to
> > the minimum (one per channel) and it accepts Standard, Extended, Data
> > & Remote Frame combinations.
> >
> > Note: There are few documentation errors in R-Car Gen3 Hardware User
> > Manual v0.5E with respect to CAN FD controller. They are listed below:
> >
> > 1. CAN FD interrupt numbers 29 & 30 are listed as per channel
> > interrupts. However, they are common to both channels (i.e.) they are
> > global and channel interrupts respectively.
> >
> > 2. CANFD clock is derived from PLL1. This is not documented.
> >
> > 3. CANFD clock is further divided by (1/2) within the CAN FD controller.
> > This is not documented.
> >
> > 4. The minimum value of NTSEG1 in RSCFDnCFDCmNCFG register is 2 Tq. It
> > is specified 4 Tq in the manual.
> >
> > 5. The maximum number of message RAM area the controller can use is
> > 3584 bytes. It is specified 10752 bytes in the manual.
> >
> > Signed-off-by: Ramesh Shanmugasundaram
> > 
> > ---
> > Hi All,
> >
> >Thanks for the review comments.
> >
> >This updated patch is based on linux-can-next tag (linux-can-next-
> for-4.6-20160310).
> >
> >This patch depends on
> >
> >[RFC] [PATCH v3] can: fix handling of unmodifiable configuration
> options
> >(http://comments.gmane.org/gmane.linux.can/9126)
> >
> > Changes since v2:
> > * Rebased to latest tag (linux-can-next-for-4.6-20160310)
> > * Cleaned up leftover debugfs code (Thanks Oliver H)
> > * Revised devicetree documentation text (as suggested by Rob H)
> >   (https://www.mail-archive.com/linux-renesas-
> s...@vger.kernel.org/msg01597.html)
> > * Used new can subsystem api to set static configuration & removed
> check in rcar_canfd_start (as suggested by Oliver H)
> >   (Refer: http://comments.gmane.org/gmane.linux.can/9126 &
> >https://www.mail-archive.com/linux-renesas-
> s...@vger.kernel.org/msg01867.html)
> > * Clubbed Renesas controller drivers to driver/net/can/rcar dir (as
> > suggested by Oliver H)
> 
> Please make moving of the existing drivers a separate patch.

OK. I'll submit new patch with CAN FD driver in new "rcar" dir and will provide 
a separate patch on top that will move the CAN driver to "rcar" dir.

Thanks,
Ramesh


Re: [PATCH v3] can: rcar_canfd: Add Renesas R-Car CAN FD driver

2016-03-15 Thread Marc Kleine-Budde
On 03/15/2016 10:48 AM, Ramesh Shanmugasundaram wrote:
> This patch adds support for the CAN FD controller found in Renesas R-Car
> SoCs. The controller operates in CAN FD only mode by default.
> 
> CAN FD mode supports both Classical CAN & CAN FD frame formats. The
> controller supports ISO 11898-1:2015 CAN FD format only.
> 
> This controller supports two channels and the driver can enable either
> or both of the channels.
> 
> Driver uses Rx FIFOs (one per channel) for reception & Common FIFOs (one
> per channel) for transmission. Rx filter rules are configured to the
> minimum (one per channel) and it accepts Standard, Extended, Data &
> Remote Frame combinations.
> 
> Note: There are few documentation errors in R-Car Gen3 Hardware User
> Manual v0.5E with respect to CAN FD controller. They are listed below:
> 
> 1. CAN FD interrupt numbers 29 & 30 are listed as per channel
> interrupts. However, they are common to both channels (i.e.) they are
> global and channel interrupts respectively.
> 
> 2. CANFD clock is derived from PLL1. This is not documented.
> 
> 3. CANFD clock is further divided by (1/2) within the CAN FD controller.
> This is not documented.
> 
> 4. The minimum value of NTSEG1 in RSCFDnCFDCmNCFG register is 2 Tq. It
> is specified 4 Tq in the manual.
> 
> 5. The maximum number of message RAM area the controller can use is 3584
> bytes. It is specified 10752 bytes in the manual.
> 
> Signed-off-by: Ramesh Shanmugasundaram 
> 
> ---
> Hi All,
> 
>Thanks for the review comments.
> 
>This updated patch is based on linux-can-next tag 
> (linux-can-next-for-4.6-20160310).
> 
>This patch depends on
> 
>[RFC] [PATCH v3] can: fix handling of unmodifiable configuration options
>(http://comments.gmane.org/gmane.linux.can/9126)
> 
> Changes since v2:
>   * Rebased to latest tag (linux-can-next-for-4.6-20160310)
>   * Cleaned up leftover debugfs code (Thanks Oliver H)
>   * Revised devicetree documentation text (as suggested by Rob H)
> 
> (https://www.mail-archive.com/linux-renesas-soc@vger.kernel.org/msg01597.html)
>   * Used new can subsystem api to set static configuration & removed 
> check in rcar_canfd_start (as suggested by Oliver H)
> (Refer: http://comments.gmane.org/gmane.linux.can/9126 &
>  
> https://www.mail-archive.com/linux-renesas-soc@vger.kernel.org/msg01867.html)
>   * Clubbed Renesas controller drivers to driver/net/can/rcar dir (as 
> suggested by Oliver H)

Please make moving of the existing drivers a separate patch.

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


[PATCHv2 22/31] ARM: dts: r8a7793: Reference both DMA controllers in SCIF nodes

2016-03-15 Thread Niklas Söderlund
R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can fallback to the
later if the first one is unavailable.

Signed-off-by: Niklas Söderlund 
Acked-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7793.dtsi | 30 ++
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7793.dtsi b/arch/arm/boot/dts/r8a7793.dtsi
index be2e1fd..88164ac 100644
--- a/arch/arm/boot/dts/r8a7793.dtsi
+++ b/arch/arm/boot/dts/r8a7793.dtsi
@@ -641,8 +641,9 @@
clocks = <_clks R8A7793_CLK_SCIF0>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0x29>, < 0x2a>;
-   dma-names = "tx", "rx";
+   dmas = < 0x29>, < 0x2a>,
+  < 0x29>, < 0x2a>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -655,8 +656,9 @@
clocks = <_clks R8A7793_CLK_SCIF1>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0x2d>, < 0x2e>;
-   dma-names = "tx", "rx";
+   dmas = < 0x2d>, < 0x2e>,
+  < 0x2d>, < 0x2e>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -669,8 +671,9 @@
clocks = <_clks R8A7793_CLK_SCIF2>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0x2b>, < 0x2c>;
-   dma-names = "tx", "rx";
+   dmas = < 0x2b>, < 0x2c>,
+  < 0x2b>, < 0x2c>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -683,8 +686,9 @@
clocks = <_clks R8A7793_CLK_SCIF3>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0x2f>, < 0x30>;
-   dma-names = "tx", "rx";
+   dmas = < 0x2f>, < 0x30>,
+  < 0x2f>, < 0x30>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -697,8 +701,9 @@
clocks = <_clks R8A7793_CLK_SCIF4>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0xfb>, < 0xfc>;
-   dma-names = "tx", "rx";
+   dmas = < 0xfb>, < 0xfc>,
+  < 0xfb>, < 0xfc>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -711,8 +716,9 @@
clocks = <_clks R8A7793_CLK_SCIF5>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0xfd>, < 0xfe>;
-   dma-names = "tx", "rx";
+   dmas = < 0xfd>, < 0xfe>,
+  < 0xfd>, < 0xfe>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
-- 
2.7.2



[PATCHv2 01/31] ARM: dts: r8a7790: Reference both DMA controllers in SCIFA nodes

2016-03-15 Thread Niklas Söderlund
R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can fallback to the
later if the first one is unavailable.

Signed-off-by: Niklas Söderlund 
Acked-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7790.dtsi | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index 0077de7..7d9ff0b 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -633,8 +633,9 @@
interrupts = ;
clocks = <_clks R8A7790_CLK_SCIFA0>;
clock-names = "fck";
-   dmas = < 0x21>, < 0x22>;
-   dma-names = "tx", "rx";
+   dmas = < 0x21>, < 0x22>,
+  < 0x21>, < 0x22>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -646,8 +647,9 @@
interrupts = ;
clocks = <_clks R8A7790_CLK_SCIFA1>;
clock-names = "fck";
-   dmas = < 0x25>, < 0x26>;
-   dma-names = "tx", "rx";
+   dmas = < 0x25>, < 0x26>,
+  < 0x25>, < 0x26>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -659,8 +661,9 @@
interrupts = ;
clocks = <_clks R8A7790_CLK_SCIFA2>;
clock-names = "fck";
-   dmas = < 0x27>, < 0x28>;
-   dma-names = "tx", "rx";
+   dmas = < 0x27>, < 0x28>,
+  < 0x27>, < 0x28>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
-- 
2.7.2



[PATCHv2 19/31] ARM: dts: r8a7793: Reference both DMA controllers in SCIFA nodes

2016-03-15 Thread Niklas Söderlund
R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can fallback to the
later if the first one is unavailable.

Signed-off-by: Niklas Söderlund 
Acked-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7793.dtsi | 30 ++
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7793.dtsi b/arch/arm/boot/dts/r8a7793.dtsi
index b482159..d833423 100644
--- a/arch/arm/boot/dts/r8a7793.dtsi
+++ b/arch/arm/boot/dts/r8a7793.dtsi
@@ -514,8 +514,9 @@
interrupts = ;
clocks = <_clks R8A7793_CLK_SCIFA0>;
clock-names = "fck";
-   dmas = < 0x21>, < 0x22>;
-   dma-names = "tx", "rx";
+   dmas = < 0x21>, < 0x22>,
+  < 0x21>, < 0x22>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -527,8 +528,9 @@
interrupts = ;
clocks = <_clks R8A7793_CLK_SCIFA1>;
clock-names = "fck";
-   dmas = < 0x25>, < 0x26>;
-   dma-names = "tx", "rx";
+   dmas = < 0x25>, < 0x26>,
+  < 0x25>, < 0x26>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -540,8 +542,9 @@
interrupts = ;
clocks = <_clks R8A7793_CLK_SCIFA2>;
clock-names = "fck";
-   dmas = < 0x27>, < 0x28>;
-   dma-names = "tx", "rx";
+   dmas = < 0x27>, < 0x28>,
+  < 0x27>, < 0x28>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -553,8 +556,9 @@
interrupts = ;
clocks = <_clks R8A7793_CLK_SCIFA3>;
clock-names = "fck";
-   dmas = < 0x1b>, < 0x1c>;
-   dma-names = "tx", "rx";
+   dmas = < 0x1b>, < 0x1c>,
+  < 0x1b>, < 0x1c>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -566,8 +570,9 @@
interrupts = ;
clocks = <_clks R8A7793_CLK_SCIFA4>;
clock-names = "fck";
-   dmas = < 0x1f>, < 0x20>;
-   dma-names = "tx", "rx";
+   dmas = < 0x1f>, < 0x20>,
+  < 0x1f>, < 0x20>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -579,8 +584,9 @@
interrupts = ;
clocks = <_clks R8A7793_CLK_SCIFA5>;
clock-names = "fck";
-   dmas = < 0x23>, < 0x24>;
-   dma-names = "tx", "rx";
+   dmas = < 0x23>, < 0x24>,
+  < 0x23>, < 0x24>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
-- 
2.7.2



[PATCHv2 13/31] ARM: dts: r8a7791: Reference both DMA controllers in SCIF nodes

2016-03-15 Thread Niklas Söderlund
R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can fallback to the
later if the first one is unavailable.

Signed-off-by: Niklas Söderlund 
Acked-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7791.dtsi | 30 ++
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index 7854a4f..76c8da8 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -727,8 +727,9 @@
clocks = <_clks R8A7791_CLK_SCIF0>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0x29>, < 0x2a>;
-   dma-names = "tx", "rx";
+   dmas = < 0x29>, < 0x2a>,
+  < 0x29>, < 0x2a>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -741,8 +742,9 @@
clocks = <_clks R8A7791_CLK_SCIF1>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0x2d>, < 0x2e>;
-   dma-names = "tx", "rx";
+   dmas = < 0x2d>, < 0x2e>,
+  < 0x2d>, < 0x2e>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -755,8 +757,9 @@
clocks = <_clks R8A7791_CLK_SCIF2>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0x2b>, < 0x2c>;
-   dma-names = "tx", "rx";
+   dmas = < 0x2b>, < 0x2c>,
+  < 0x2b>, < 0x2c>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -769,8 +772,9 @@
clocks = <_clks R8A7791_CLK_SCIF3>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0x2f>, < 0x30>;
-   dma-names = "tx", "rx";
+   dmas = < 0x2f>, < 0x30>,
+  < 0x2f>, < 0x30>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -783,8 +787,9 @@
clocks = <_clks R8A7791_CLK_SCIF4>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0xfb>, < 0xfc>;
-   dma-names = "tx", "rx";
+   dmas = < 0xfb>, < 0xfc>,
+  < 0xfb>, < 0xfc>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -797,8 +802,9 @@
clocks = <_clks R8A7791_CLK_SCIF5>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0xfd>, < 0xfe>;
-   dma-names = "tx", "rx";
+   dmas = < 0xfd>, < 0xfe>,
+  < 0xfd>, < 0xfe>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
-- 
2.7.2



[PATCHv2 24/31] ARM: dts: r8a7793: Reference both DMA controllers in IIC nodes

2016-03-15 Thread Niklas Söderlund
R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can fallback to the
later if the first one is unavailable.

Signed-off-by: Niklas Söderlund 
Acked-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7793.dtsi | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7793.dtsi b/arch/arm/boot/dts/r8a7793.dtsi
index b16b0cc..90925c5 100644
--- a/arch/arm/boot/dts/r8a7793.dtsi
+++ b/arch/arm/boot/dts/r8a7793.dtsi
@@ -470,8 +470,9 @@
reg = <0 0xe60b 0 0x425>;
interrupts = ;
clocks = <_clks R8A7793_CLK_IICDVFS>;
-   dmas = < 0x77>, < 0x78>;
-   dma-names = "tx", "rx";
+   dmas = < 0x77>, < 0x78>,
+  < 0x77>, < 0x78>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -483,8 +484,9 @@
reg = <0 0xe650 0 0x425>;
interrupts = ;
clocks = <_clks R8A7793_CLK_IIC0>;
-   dmas = < 0x61>, < 0x62>;
-   dma-names = "tx", "rx";
+   dmas = < 0x61>, < 0x62>,
+  < 0x61>, < 0x62>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -496,8 +498,9 @@
reg = <0 0xe651 0 0x425>;
interrupts = ;
clocks = <_clks R8A7793_CLK_IIC1>;
-   dmas = < 0x65>, < 0x66>;
-   dma-names = "tx", "rx";
+   dmas = < 0x65>, < 0x66>,
+  < 0x65>, < 0x66>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
-- 
2.7.2



[PATCHv2 09/31] ARM: dts: r8a7790: Reference both DMA controllers in MMCIF nodes

2016-03-15 Thread Niklas Söderlund
R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can fallback to the
later if the first one is unavailable.

Signed-off-by: Niklas Söderlund 
Acked-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7790.dtsi | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index 31b9b0a..b71b3e2 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -560,8 +560,9 @@
reg = <0 0xee20 0 0x80>;
interrupts = ;
clocks = <_clks R8A7790_CLK_MMCIF0>;
-   dmas = < 0xd1>, < 0xd2>;
-   dma-names = "tx", "rx";
+   dmas = < 0xd1>, < 0xd2>,
+  < 0xd1>, < 0xd2>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
reg-io-width = <4>;
status = "disabled";
@@ -573,8 +574,9 @@
reg = <0 0xee22 0 0x80>;
interrupts = ;
clocks = <_clks R8A7790_CLK_MMCIF1>;
-   dmas = < 0xe1>, < 0xe2>;
-   dma-names = "tx", "rx";
+   dmas = < 0xe1>, < 0xe2>,
+  < 0xe1>, < 0xe2>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
reg-io-width = <4>;
status = "disabled";
-- 
2.7.2



[PATCHv2 00/31] ARM: dts: r8a779[0-4]: Reference both DMA controllers

2016-03-15 Thread Niklas Söderlund
Hi,

R-Car Gen2 have two DMA controllers, which are equivalent. However DMA
slaves were tied only to a single DMA controller in .dtsi. This series
add references to to both DMA controllers for all nodes that previously
only referenced one of them. It also adds dma references to the SDHI
nodes for r8a7794 which according to the datasheet should work but I
have not access to HW to verify.

Tested on Koelsch (r8a7791) by altering the compatible value of either
dmac0 or dmac1 and verifying that the DMA slaves pick the DMA controller
that is instantiated.

For your convince the series can be fetched from
https://git.ragnatech.se/linux rcar-dmas-dt-2

* Changes since v1
- Rebase on top of renesas-devel-20160315-v4.5 and add dmas references
  new nodes (r8a7790: scif2 r8a7793: i2c6,i2c7,i2c8).
- Correct error in commit message 31/31 (s/QSPI/MMCIF).
- Collect Ack and Reviewed tags from Geert.

Niklas Söderlund (31):
  ARM: dts: r8a7790: Reference both DMA controllers in SCIFA nodes
  ARM: dts: r8a7790: Reference both DMA controllers in SCIFB nodes
  ARM: dts: r8a7790: Reference both DMA controllers in HSCIF nodes
  ARM: dts: r8a7790: Reference both DMA controllers in SCIF nodes
  ARM: dts: r8a7790: Reference both DMA controllers in MSIOF nodes
  ARM: dts: r8a7790: Reference both DMA controllers in QSPI node
  ARM: dts: r8a7790: Reference both DMA controllers in IIC nodes
  ARM: dts: r8a7790: Reference both DMA controllers in SDHI nodes
  ARM: dts: r8a7790: Reference both DMA controllers in MMCIF nodes
  ARM: dts: r8a7791: Reference both DMA controllers in SCIFA nodes
  ARM: dts: r8a7791: Reference both DMA controllers in SCIFB nodes
  ARM: dts: r8a7791: Reference both DMA controllers in HSCIF nodes
  ARM: dts: r8a7791: Reference both DMA controllers in SCIF nodes
  ARM: dts: r8a7791: Reference both DMA controllers in MSIOF nodes
  ARM: dts: r8a7791: Reference both DMA controllers in QSPI node
  ARM: dts: r8a7791: Reference both DMA controllers in IIC nodes
  ARM: dts: r8a7791: Reference both DMA controllers in SDHI nodes
  ARM: dts: r8a7791: Reference both DMA controllers in MMCIF node
  ARM: dts: r8a7793: Reference both DMA controllers in SCIFA nodes
  ARM: dts: r8a7793: Reference both DMA controllers in SCIFB nodes
  ARM: dts: r8a7793: Reference both DMA controllers in HSCIF nodes
  ARM: dts: r8a7793: Reference both DMA controllers in SCIF nodes
  ARM: dts: r8a7793: Reference both DMA controllers in QSPI node
  ARM: dts: r8a7793: Reference both DMA controllers in IIC nodes
  ARM: dts: r8a7794: Reference both DMA controllers in SCIFA nodes
  ARM: dts: r8a7794: Reference both DMA controllers in SCIFB nodes
  ARM: dts: r8a7794: Reference both DMA controllers in HSCIF nodes
  ARM: dts: r8a7794: Reference both DMA controllers in SCIF nodes
  ARM: dts: r8a7794: Reference both DMA controllers in QSPI node
  ARM: dts: r8a7794: Reference both DMA controllers in SDHI nodes
  ARM: dts: r8a7794: Reference both DMA controllers in MMCIF node

 arch/arm/boot/dts/r8a7790.dtsi | 130 +---
 arch/arm/boot/dts/r8a7791.dtsi | 145 -
 arch/arm/boot/dts/r8a7793.dtsi | 110 ++-
 arch/arm/boot/dts/r8a7794.dtsi | 109 +++
 4 files changed, 300 insertions(+), 194 deletions(-)

--
2.7.2



[PATCHv2 16/31] ARM: dts: r8a7791: Reference both DMA controllers in IIC nodes

2016-03-15 Thread Niklas Söderlund
R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can fallback to the
later if the first one is unavailable.

Signed-off-by: Niklas Söderlund 
Acked-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7791.dtsi | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index 8880e22..9acecdf 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -510,8 +510,9 @@
reg = <0 0xe60b 0 0x425>;
interrupts = ;
clocks = <_clks R8A7791_CLK_IICDVFS>;
-   dmas = < 0x77>, < 0x78>;
-   dma-names = "tx", "rx";
+   dmas = < 0x77>, < 0x78>,
+  < 0x77>, < 0x78>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -523,8 +524,9 @@
reg = <0 0xe650 0 0x425>;
interrupts = ;
clocks = <_clks R8A7791_CLK_IIC0>;
-   dmas = < 0x61>, < 0x62>;
-   dma-names = "tx", "rx";
+   dmas = < 0x61>, < 0x62>,
+  < 0x61>, < 0x62>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -536,8 +538,9 @@
reg = <0 0xe651 0 0x425>;
interrupts = ;
clocks = <_clks R8A7791_CLK_IIC1>;
-   dmas = < 0x65>, < 0x66>;
-   dma-names = "tx", "rx";
+   dmas = < 0x65>, < 0x66>,
+  < 0x65>, < 0x66>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
-- 
2.7.2



[PATCHv2 23/31] ARM: dts: r8a7793: Reference both DMA controllers in QSPI node

2016-03-15 Thread Niklas Söderlund
R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can fallback to the
later if the first one is unavailable.

Signed-off-by: Niklas Söderlund 
Acked-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7793.dtsi | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7793.dtsi b/arch/arm/boot/dts/r8a7793.dtsi
index 88164ac..b16b0cc 100644
--- a/arch/arm/boot/dts/r8a7793.dtsi
+++ b/arch/arm/boot/dts/r8a7793.dtsi
@@ -785,8 +785,9 @@
reg = <0 0xe6b1 0 0x2c>;
interrupts = ;
clocks = <_clks R8A7793_CLK_QSPI_MOD>;
-   dmas = < 0x17>, < 0x18>;
-   dma-names = "tx", "rx";
+   dmas = < 0x17>, < 0x18>,
+  < 0x17>, < 0x18>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
num-cs = <1>;
#address-cells = <1>;
-- 
2.7.2



[PATCHv2 17/31] ARM: dts: r8a7791: Reference both DMA controllers in SDHI nodes

2016-03-15 Thread Niklas Söderlund
R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can fallback to the
later if the first one is unavailable.

Signed-off-by: Niklas Söderlund 
Acked-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7791.dtsi | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index 9acecdf..145c5aa 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -568,8 +568,9 @@
reg = <0 0xee10 0 0x328>;
interrupts = ;
clocks = <_clks R8A7791_CLK_SDHI0>;
-   dmas = < 0xcd>, < 0xce>;
-   dma-names = "tx", "rx";
+   dmas = < 0xcd>, < 0xce>,
+  < 0xcd>, < 0xce>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -579,8 +580,9 @@
reg = <0 0xee14 0 0x100>;
interrupts = ;
clocks = <_clks R8A7791_CLK_SDHI1>;
-   dmas = < 0xc1>, < 0xc2>;
-   dma-names = "tx", "rx";
+   dmas = < 0xc1>, < 0xc2>,
+  < 0xc1>, < 0xc2>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -590,8 +592,9 @@
reg = <0 0xee16 0 0x100>;
interrupts = ;
clocks = <_clks R8A7791_CLK_SDHI2>;
-   dmas = < 0xd3>, < 0xd4>;
-   dma-names = "tx", "rx";
+   dmas = < 0xd3>, < 0xd4>,
+  < 0xd3>, < 0xd4>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
-- 
2.7.2



[PATCHv2 15/31] ARM: dts: r8a7791: Reference both DMA controllers in QSPI node

2016-03-15 Thread Niklas Söderlund
R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can fallback to the
later if the first one is unavailable.

Signed-off-by: Niklas Söderlund 
Acked-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7791.dtsi | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index 4d0d7a7..8880e22 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -1518,8 +1518,9 @@
reg = <0 0xe6b1 0 0x2c>;
interrupts = ;
clocks = <_clks R8A7791_CLK_QSPI_MOD>;
-   dmas = < 0x17>, < 0x18>;
-   dma-names = "tx", "rx";
+   dmas = < 0x17>, < 0x18>,
+  < 0x17>, < 0x18>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
num-cs = <1>;
#address-cells = <1>;
-- 
2.7.2



[PATCHv2 28/31] ARM: dts: r8a7794: Reference both DMA controllers in SCIF nodes

2016-03-15 Thread Niklas Söderlund
R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can fallback to the
later if the first one is unavailable.

Signed-off-by: Niklas Söderlund 
Acked-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7794.dtsi | 30 ++
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7794.dtsi b/arch/arm/boot/dts/r8a7794.dtsi
index bc65153..982f089 100644
--- a/arch/arm/boot/dts/r8a7794.dtsi
+++ b/arch/arm/boot/dts/r8a7794.dtsi
@@ -423,8 +423,9 @@
clocks = <_clks R8A7794_CLK_SCIF0>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0x29>, < 0x2a>;
-   dma-names = "tx", "rx";
+   dmas = < 0x29>, < 0x2a>,
+  < 0x29>, < 0x2a>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -437,8 +438,9 @@
clocks = <_clks R8A7794_CLK_SCIF1>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0x2d>, < 0x2e>;
-   dma-names = "tx", "rx";
+   dmas = < 0x2d>, < 0x2e>,
+  < 0x2d>, < 0x2e>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -451,8 +453,9 @@
clocks = <_clks R8A7794_CLK_SCIF2>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0x2b>, < 0x2c>;
-   dma-names = "tx", "rx";
+   dmas = < 0x2b>, < 0x2c>,
+  < 0x2b>, < 0x2c>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -465,8 +468,9 @@
clocks = <_clks R8A7794_CLK_SCIF3>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0x2f>, < 0x30>;
-   dma-names = "tx", "rx";
+   dmas = < 0x2f>, < 0x30>,
+  < 0x2f>, < 0x30>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -479,8 +483,9 @@
clocks = <_clks R8A7794_CLK_SCIF4>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0xfb>, < 0xfc>;
-   dma-names = "tx", "rx";
+   dmas = < 0xfb>, < 0xfc>,
+  < 0xfb>, < 0xfc>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -493,8 +498,9 @@
clocks = <_clks R8A7794_CLK_SCIF5>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0xfd>, < 0xfe>;
-   dma-names = "tx", "rx";
+   dmas = < 0xfd>, < 0xfe>,
+  < 0xfd>, < 0xfe>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
-- 
2.7.2



[PATCHv2 30/31] ARM: dts: r8a7794: Reference both DMA controllers in SDHI nodes

2016-03-15 Thread Niklas Söderlund
R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can fallback to the
later if the first one is unavailable.

Signed-off-by: Niklas Söderlund 
Reviewed-by: Geert Uytterhoeven 
Acked-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7794.dtsi | 9 +
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7794.dtsi b/arch/arm/boot/dts/r8a7794.dtsi
index 4761849..ec54246 100644
--- a/arch/arm/boot/dts/r8a7794.dtsi
+++ b/arch/arm/boot/dts/r8a7794.dtsi
@@ -664,6 +664,9 @@
reg = <0 0xee10 0 0x200>;
interrupts = ;
clocks = <_clks R8A7794_CLK_SDHI0>;
+   dmas = < 0xcd>, < 0xce>,
+  < 0xcd>, < 0xce>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -673,6 +676,9 @@
reg = <0 0xee14 0 0x100>;
interrupts = ;
clocks = <_clks R8A7794_CLK_SDHI1>;
+   dmas = < 0xc1>, < 0xc2>,
+  < 0xc1>, < 0xc2>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -682,6 +688,9 @@
reg = <0 0xee16 0 0x100>;
interrupts = ;
clocks = <_clks R8A7794_CLK_SDHI2>;
+   dmas = < 0xd3>, < 0xd4>,
+  < 0xd3>, < 0xd4>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
-- 
2.7.2



[PATCHv2 14/31] ARM: dts: r8a7791: Reference both DMA controllers in MSIOF nodes

2016-03-15 Thread Niklas Söderlund
R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can fallback to the
later if the first one is unavailable.

Signed-off-by: Niklas Söderlund 
Acked-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7791.dtsi | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index 76c8da8..4d0d7a7 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -1532,8 +1532,9 @@
reg = <0 0xe6e2 0 0x0064>;
interrupts = ;
clocks = <_clks R8A7791_CLK_MSIOF0>;
-   dmas = < 0x51>, < 0x52>;
-   dma-names = "tx", "rx";
+   dmas = < 0x51>, < 0x52>,
+  < 0x51>, < 0x52>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
#address-cells = <1>;
#size-cells = <0>;
@@ -1545,8 +1546,9 @@
reg = <0 0xe6e1 0 0x0064>;
interrupts = ;
clocks = <_clks R8A7791_CLK_MSIOF1>;
-   dmas = < 0x55>, < 0x56>;
-   dma-names = "tx", "rx";
+   dmas = < 0x55>, < 0x56>,
+  < 0x55>, < 0x56>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
#address-cells = <1>;
#size-cells = <0>;
@@ -1558,8 +1560,9 @@
reg = <0 0xe6e0 0 0x0064>;
interrupts = ;
clocks = <_clks R8A7791_CLK_MSIOF2>;
-   dmas = < 0x41>, < 0x42>;
-   dma-names = "tx", "rx";
+   dmas = < 0x41>, < 0x42>,
+  < 0x41>, < 0x42>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
#address-cells = <1>;
#size-cells = <0>;
-- 
2.7.2



[PATCHv2 21/31] ARM: dts: r8a7793: Reference both DMA controllers in HSCIF nodes

2016-03-15 Thread Niklas Söderlund
R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can fallback to the
later if the first one is unavailable.

Signed-off-by: Niklas Söderlund 
Acked-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7793.dtsi | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7793.dtsi b/arch/arm/boot/dts/r8a7793.dtsi
index d704790..be2e1fd 100644
--- a/arch/arm/boot/dts/r8a7793.dtsi
+++ b/arch/arm/boot/dts/r8a7793.dtsi
@@ -725,8 +725,9 @@
clocks = <_clks R8A7793_CLK_HSCIF0>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0x39>, < 0x3a>;
-   dma-names = "tx", "rx";
+   dmas = < 0x39>, < 0x3a>,
+  < 0x39>, < 0x3a>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -739,8 +740,9 @@
clocks = <_clks R8A7793_CLK_HSCIF1>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0x4d>, < 0x4e>;
-   dma-names = "tx", "rx";
+   dmas = < 0x4d>, < 0x4e>,
+  < 0x4d>, < 0x4e>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -753,8 +755,9 @@
clocks = <_clks R8A7793_CLK_HSCIF2>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0x3b>, < 0x3c>;
-   dma-names = "tx", "rx";
+   dmas = < 0x3b>, < 0x3c>,
+  < 0x3b>, < 0x3c>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
-- 
2.7.2



[PATCHv2 08/31] ARM: dts: r8a7790: Reference both DMA controllers in SDHI nodes

2016-03-15 Thread Niklas Söderlund
R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can fallback to the
later if the first one is unavailable.

Signed-off-by: Niklas Söderlund 
Acked-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7790.dtsi | 20 
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index cfa91f0..31b9b0a 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -591,8 +591,9 @@
reg = <0 0xee10 0 0x328>;
interrupts = ;
clocks = <_clks R8A7790_CLK_SDHI0>;
-   dmas = < 0xcd>, < 0xce>;
-   dma-names = "tx", "rx";
+   dmas = < 0xcd>, < 0xce>,
+  < 0xcd>, < 0xce>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -602,8 +603,9 @@
reg = <0 0xee12 0 0x328>;
interrupts = ;
clocks = <_clks R8A7790_CLK_SDHI1>;
-   dmas = < 0xc9>, < 0xca>;
-   dma-names = "tx", "rx";
+   dmas = < 0xc9>, < 0xca>,
+  < 0xc9>, < 0xca>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -613,8 +615,9 @@
reg = <0 0xee14 0 0x100>;
interrupts = ;
clocks = <_clks R8A7790_CLK_SDHI2>;
-   dmas = < 0xc1>, < 0xc2>;
-   dma-names = "tx", "rx";
+   dmas = < 0xc1>, < 0xc2>,
+  < 0xc1>, < 0xc2>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -624,8 +627,9 @@
reg = <0 0xee16 0 0x100>;
interrupts = ;
clocks = <_clks R8A7790_CLK_SDHI3>;
-   dmas = < 0xd3>, < 0xd4>;
-   dma-names = "tx", "rx";
+   dmas = < 0xd3>, < 0xd4>,
+  < 0xd3>, < 0xd4>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
-- 
2.7.2



[PATCHv2 31/31] ARM: dts: r8a7794: Reference both DMA controllers in MMCIF node

2016-03-15 Thread Niklas Söderlund
R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can fallback to the
later if the first one is unavailable.

Signed-off-by: Niklas Söderlund 
Acked-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7794.dtsi | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7794.dtsi b/arch/arm/boot/dts/r8a7794.dtsi
index ec54246..1219f75 100644
--- a/arch/arm/boot/dts/r8a7794.dtsi
+++ b/arch/arm/boot/dts/r8a7794.dtsi
@@ -652,8 +652,9 @@
reg = <0 0xee20 0 0x80>;
interrupts = ;
clocks = <_clks R8A7794_CLK_MMCIF0>;
-   dmas = < 0xd1>, < 0xd2>;
-   dma-names = "tx", "rx";
+   dmas = < 0xd1>, < 0xd2>,
+  < 0xd1>, < 0xd2>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
reg-io-width = <4>;
status = "disabled";
-- 
2.7.2



[PATCHv2 10/31] ARM: dts: r8a7791: Reference both DMA controllers in SCIFA nodes

2016-03-15 Thread Niklas Söderlund
R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can fallback to the
later if the first one is unavailable.

Signed-off-by: Niklas Söderlund 
Acked-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7791.dtsi | 30 ++
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index 396a640..4de4812 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -600,8 +600,9 @@
interrupts = ;
clocks = <_clks R8A7791_CLK_SCIFA0>;
clock-names = "fck";
-   dmas = < 0x21>, < 0x22>;
-   dma-names = "tx", "rx";
+   dmas = < 0x21>, < 0x22>,
+  < 0x21>, < 0x22>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -613,8 +614,9 @@
interrupts = ;
clocks = <_clks R8A7791_CLK_SCIFA1>;
clock-names = "fck";
-   dmas = < 0x25>, < 0x26>;
-   dma-names = "tx", "rx";
+   dmas = < 0x25>, < 0x26>,
+  < 0x25>, < 0x26>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -626,8 +628,9 @@
interrupts = ;
clocks = <_clks R8A7791_CLK_SCIFA2>;
clock-names = "fck";
-   dmas = < 0x27>, < 0x28>;
-   dma-names = "tx", "rx";
+   dmas = < 0x27>, < 0x28>,
+  < 0x27>, < 0x28>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -639,8 +642,9 @@
interrupts = ;
clocks = <_clks R8A7791_CLK_SCIFA3>;
clock-names = "fck";
-   dmas = < 0x1b>, < 0x1c>;
-   dma-names = "tx", "rx";
+   dmas = < 0x1b>, < 0x1c>,
+  < 0x1b>, < 0x1c>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -652,8 +656,9 @@
interrupts = ;
clocks = <_clks R8A7791_CLK_SCIFA4>;
clock-names = "fck";
-   dmas = < 0x1f>, < 0x20>;
-   dma-names = "tx", "rx";
+   dmas = < 0x1f>, < 0x20>,
+  < 0x1f>, < 0x20>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -665,8 +670,9 @@
interrupts = ;
clocks = <_clks R8A7791_CLK_SCIFA5>;
clock-names = "fck";
-   dmas = < 0x23>, < 0x24>;
-   dma-names = "tx", "rx";
+   dmas = < 0x23>, < 0x24>,
+  < 0x23>, < 0x24>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
-- 
2.7.2



[PATCHv2 12/31] ARM: dts: r8a7791: Reference both DMA controllers in HSCIF nodes

2016-03-15 Thread Niklas Söderlund
R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can fallback to the
later if the first one is unavailable.

Signed-off-by: Niklas Söderlund 
Acked-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7791.dtsi | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index 319e34c..7854a4f 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -811,8 +811,9 @@
clocks = <_clks R8A7791_CLK_HSCIF0>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0x39>, < 0x3a>;
-   dma-names = "tx", "rx";
+   dmas = < 0x39>, < 0x3a>,
+  < 0x39>, < 0x3a>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -825,8 +826,9 @@
clocks = <_clks R8A7791_CLK_HSCIF1>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0x4d>, < 0x4e>;
-   dma-names = "tx", "rx";
+   dmas = < 0x4d>, < 0x4e>,
+  < 0x4d>, < 0x4e>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -839,8 +841,9 @@
clocks = <_clks R8A7791_CLK_HSCIF2>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0x3b>, < 0x3c>;
-   dma-names = "tx", "rx";
+   dmas = < 0x3b>, < 0x3c>,
+  < 0x3b>, < 0x3c>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
-- 
2.7.2



[PATCHv2 02/31] ARM: dts: r8a7790: Reference both DMA controllers in SCIFB nodes

2016-03-15 Thread Niklas Söderlund
R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can fallback to the
later if the first one is unavailable.

Signed-off-by: Niklas Söderlund 
Acked-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7790.dtsi | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index 7d9ff0b..13e8817 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -675,8 +675,9 @@
interrupts = ;
clocks = <_clks R8A7790_CLK_SCIFB0>;
clock-names = "fck";
-   dmas = < 0x3d>, < 0x3e>;
-   dma-names = "tx", "rx";
+   dmas = < 0x3d>, < 0x3e>,
+  < 0x3d>, < 0x3e>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -688,8 +689,9 @@
interrupts = ;
clocks = <_clks R8A7790_CLK_SCIFB1>;
clock-names = "fck";
-   dmas = < 0x19>, < 0x1a>;
-   dma-names = "tx", "rx";
+   dmas = < 0x19>, < 0x1a>,
+  < 0x19>, < 0x1a>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -701,8 +703,9 @@
interrupts = ;
clocks = <_clks R8A7790_CLK_SCIFB2>;
clock-names = "fck";
-   dmas = < 0x1d>, < 0x1e>;
-   dma-names = "tx", "rx";
+   dmas = < 0x1d>, < 0x1e>,
+  < 0x1d>, < 0x1e>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
-- 
2.7.2



[PATCHv2 25/31] ARM: dts: r8a7794: Reference both DMA controllers in SCIFA nodes

2016-03-15 Thread Niklas Söderlund
R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can fallback to the
later if the first one is unavailable.

Signed-off-by: Niklas Söderlund 
Acked-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7794.dtsi | 30 ++
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7794.dtsi b/arch/arm/boot/dts/r8a7794.dtsi
index eacb2b2..4256557 100644
--- a/arch/arm/boot/dts/r8a7794.dtsi
+++ b/arch/arm/boot/dts/r8a7794.dtsi
@@ -296,8 +296,9 @@
interrupts = ;
clocks = <_clks R8A7794_CLK_SCIFA0>;
clock-names = "fck";
-   dmas = < 0x21>, < 0x22>;
-   dma-names = "tx", "rx";
+   dmas = < 0x21>, < 0x22>,
+  < 0x21>, < 0x22>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -309,8 +310,9 @@
interrupts = ;
clocks = <_clks R8A7794_CLK_SCIFA1>;
clock-names = "fck";
-   dmas = < 0x25>, < 0x26>;
-   dma-names = "tx", "rx";
+   dmas = < 0x25>, < 0x26>,
+  < 0x25>, < 0x26>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -322,8 +324,9 @@
interrupts = ;
clocks = <_clks R8A7794_CLK_SCIFA2>;
clock-names = "fck";
-   dmas = < 0x27>, < 0x28>;
-   dma-names = "tx", "rx";
+   dmas = < 0x27>, < 0x28>,
+  < 0x27>, < 0x28>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -335,8 +338,9 @@
interrupts = ;
clocks = <_clks R8A7794_CLK_SCIFA3>;
clock-names = "fck";
-   dmas = < 0x1b>, < 0x1c>;
-   dma-names = "tx", "rx";
+   dmas = < 0x1b>, < 0x1c>,
+  < 0x1b>, < 0x1c>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -348,8 +352,9 @@
interrupts = ;
clocks = <_clks R8A7794_CLK_SCIFA4>;
clock-names = "fck";
-   dmas = < 0x1f>, < 0x20>;
-   dma-names = "tx", "rx";
+   dmas = < 0x1f>, < 0x20>,
+  < 0x1f>, < 0x20>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -361,8 +366,9 @@
interrupts = ;
clocks = <_clks R8A7794_CLK_SCIFA5>;
clock-names = "fck";
-   dmas = < 0x23>, < 0x24>;
-   dma-names = "tx", "rx";
+   dmas = < 0x23>, < 0x24>,
+  < 0x23>, < 0x24>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
-- 
2.7.2



[PATCHv2 06/31] ARM: dts: r8a7790: Reference both DMA controllers in QSPI node

2016-03-15 Thread Niklas Söderlund
R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can fallback to the
later if the first one is unavailable.

Signed-off-by: Niklas Söderlund 
Acked-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7790.dtsi | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index 102973c..a80791a 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -1494,8 +1494,9 @@
reg = <0 0xe6b1 0 0x2c>;
interrupts = ;
clocks = <_clks R8A7790_CLK_QSPI_MOD>;
-   dmas = < 0x17>, < 0x18>;
-   dma-names = "tx", "rx";
+   dmas = < 0x17>, < 0x18>,
+  < 0x17>, < 0x18>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
num-cs = <1>;
#address-cells = <1>;
-- 
2.7.2



[PATCHv2 11/31] ARM: dts: r8a7791: Reference both DMA controllers in SCIFB nodes

2016-03-15 Thread Niklas Söderlund
R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can fallback to the
later if the first one is unavailable.

Signed-off-by: Niklas Söderlund 
Acked-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7791.dtsi | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index 4de4812..319e34c 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -684,8 +684,9 @@
interrupts = ;
clocks = <_clks R8A7791_CLK_SCIFB0>;
clock-names = "fck";
-   dmas = < 0x3d>, < 0x3e>;
-   dma-names = "tx", "rx";
+   dmas = < 0x3d>, < 0x3e>,
+  < 0x3d>, < 0x3e>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -697,8 +698,9 @@
interrupts = ;
clocks = <_clks R8A7791_CLK_SCIFB1>;
clock-names = "fck";
-   dmas = < 0x19>, < 0x1a>;
-   dma-names = "tx", "rx";
+   dmas = < 0x19>, < 0x1a>,
+  < 0x19>, < 0x1a>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -710,8 +712,9 @@
interrupts = ;
clocks = <_clks R8A7791_CLK_SCIFB2>;
clock-names = "fck";
-   dmas = < 0x1d>, < 0x1e>;
-   dma-names = "tx", "rx";
+   dmas = < 0x1d>, < 0x1e>,
+  < 0x1d>, < 0x1e>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
-- 
2.7.2



[PATCHv2 18/31] ARM: dts: r8a7791: Reference both DMA controllers in MMCIF node

2016-03-15 Thread Niklas Söderlund
R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can fallback to the
later if the first one is unavailable.

Signed-off-by: Niklas Söderlund 
Acked-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7791.dtsi | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index 145c5aa..5f89b58 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -555,8 +555,9 @@
reg = <0 0xee20 0 0x80>;
interrupts = ;
clocks = <_clks R8A7791_CLK_MMCIF0>;
-   dmas = < 0xd1>, < 0xd2>;
-   dma-names = "tx", "rx";
+   dmas = < 0xd1>, < 0xd2>,
+  < 0xd1>, < 0xd2>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
reg-io-width = <4>;
status = "disabled";
-- 
2.7.2



[PATCHv2 04/31] ARM: dts: r8a7790: Reference both DMA controllers in SCIF nodes

2016-03-15 Thread Niklas Söderlund
R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can fallback to the
later if the first one is unavailable.

Signed-off-by: Niklas Söderlund 
Acked-by: Geert Uytterhoeven 
---
 arch/arm/boot/dts/r8a7790.dtsi | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index 2c02493..fe1e995 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -718,8 +718,9 @@
clocks = <_clks R8A7790_CLK_SCIF0>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0x29>, < 0x2a>;
-   dma-names = "tx", "rx";
+   dmas = < 0x29>, < 0x2a>,
+  < 0x29>, < 0x2a>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -732,8 +733,9 @@
clocks = <_clks R8A7790_CLK_SCIF1>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0x2d>, < 0x2e>;
-   dma-names = "tx", "rx";
+   dmas = < 0x2d>, < 0x2e>,
+  < 0x2d>, < 0x2e>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
@@ -746,8 +748,9 @@
clocks = <_clks R8A7790_CLK_SCIF2>, <_clk>,
 <_clk>;
clock-names = "fck", "brg_int", "scif_clk";
-   dmas = < 0x2b>, < 0x2c>;
-   dma-names = "tx", "rx";
+   dmas = < 0x2b>, < 0x2c>,
+  < 0x2b>, < 0x2c>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = <_clocks>;
status = "disabled";
};
-- 
2.7.2



Re: [RFC] pinctrl: sh-pfc: only use dummy states for non-DT platforms

2016-03-15 Thread Sergei Shtylyov

On 3/15/2016 11:29 AM, Linus Walleij wrote:


From: Wolfram Sang 

If pinctrl_provide_dummies() is used unconditionally, then the dummy
state will be used even on DT platforms when the "init" state was
intentionally left out. Instead of "default", the dummy "init" state
will then be used during probe. Thus, when probing an I2C controller on
cold boot, communication triggered by bus notifiers broke because the
pins were not initialized.

Do it like OMAP2: use the dummy state only for non-DT platforms.

Reported-by: Geert Uytterhoeven 
Signed-off-by: Wolfram Sang 


Patch applied for fixes with all the ACKs etc.

This unfortiunately coincide with the merge window so was slow
to pick it up, but it will be in the first round of fixes to Torvalds,
possibly at -rc1 possibly earlier.


   TIA!


-   pinctrl_provide_dummies();
+   /* Enable dummy states for those platforms without pinctrl support */
+   if (!of_have_populated_dt())
+   pinctrl_provide_dummies();


So remind we: what Renesas platforms are still not using DT?
arch/sh?


   Yes, only those are left.


Yours,
Linus Walleij


MBR, Sergei



renesas-drivers-2016-03-15-v4.5

2016-03-15 Thread Geert Uytterhoeven
I've pushed renesas-drivers-2016-03-15-v4.5 to
https://git.kernel.org/cgit/linux/kernel/git/geert/renesas-drivers.git
This tree is meant to ease development of platform support and drivers for
Renesas ARM ("shmobile") SoCs. It's created by merging (a) the for-next 
branches of various subsystem trees and (b) branches with driver code
submitted or planned for submission to maintainers into the development
branch of Simon Horman's renesas.git tree.

Today's version is based on renesas-devel-20160315-v4.5.

Included branches with driver code:
  - sh-pfc-for-v4.7
  - topic/rcar-dmac-residue-v1
  - topic/rcar-dmac-hamza-v3
  - 
git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git#topic/r8a7795-pcie
  - topic/ipmmu-multi-arch-v1
  - topic/r8a7795-ipmmu-rfc
  - topic/rcar-sysc-pd-v3
  - git://linuxtv.org/pinchartl/fbdev.git#vsp1-kms-request-20160306

Included fixes:
  - arm64: dts: r8a7795: Hook up PCIe devices to SYSC "always-on" PM Domain
  - arm64: dts: r8a7795: Hook up FCPV devices to SYSC PM Domains
  - arm64: dts: r8a7795: Hook up VSP devices to SYSC PM Domains
  - [RFC] v4l: subdev: subdev_fh->pad depends on CONFIG_VIDEO_V4L2_SUBDEV_API

Included subsystem trees:
  - git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git#linux-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git#clk-next
  - 
git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git#for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git#for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git#for-next
  - git://git.infradead.org/users/dedekind/l2-mtd-2.6.git#master
  - git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git#master
  - git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git#tty-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git#i2c/for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git#for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git#master
  - git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git#usb-next
  - git://people.freedesktop.org/~airlied/linux#drm-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git#next
  - git://linuxtv.org/mchehab/media-next.git#master
  - git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git#mmc-next
  - git://git.linaro.org/people/ulf.hansson/mmc.git#next
  - 
git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm.git#for-next
  - git://git.linaro.org/people/daniel.lezcano/linux.git#clockevents/next
  - git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git#testing/next
  - git://git.kernel.org/pub/scm/linux/kernel/git/djbw/dmaengine.git#next
  - git://git.infradead.org/users/vkoul/slave-dma.git#next
  - 
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git#staging-next
  - 
git://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-arm.git#for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git#next
  - git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git#for-next
  - git://git.infradead.org/users/jcooper/linux.git#irqchip/for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux.git#for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git#for-next
  - git://git.infradead.org/battery-2.6.git#master
  - git://www.linux-watchdog.org/linux-watchdog-next.git#master
  - git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git#for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git#for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git#for-next/core
  - git://anongit.freedesktop.org/drm-intel#topic/drm-misc
  - git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git#next
  - git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git#next

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 v3] can: rcar_canfd: Add Renesas R-Car CAN FD driver

2016-03-15 Thread Ramesh Shanmugasundaram
This patch adds support for the CAN FD controller found in Renesas R-Car
SoCs. The controller operates in CAN FD only mode by default.

CAN FD mode supports both Classical CAN & CAN FD frame formats. The
controller supports ISO 11898-1:2015 CAN FD format only.

This controller supports two channels and the driver can enable either
or both of the channels.

Driver uses Rx FIFOs (one per channel) for reception & Common FIFOs (one
per channel) for transmission. Rx filter rules are configured to the
minimum (one per channel) and it accepts Standard, Extended, Data &
Remote Frame combinations.

Note: There are few documentation errors in R-Car Gen3 Hardware User
Manual v0.5E with respect to CAN FD controller. They are listed below:

1. CAN FD interrupt numbers 29 & 30 are listed as per channel
interrupts. However, they are common to both channels (i.e.) they are
global and channel interrupts respectively.

2. CANFD clock is derived from PLL1. This is not documented.

3. CANFD clock is further divided by (1/2) within the CAN FD controller.
This is not documented.

4. The minimum value of NTSEG1 in RSCFDnCFDCmNCFG register is 2 Tq. It
is specified 4 Tq in the manual.

5. The maximum number of message RAM area the controller can use is 3584
bytes. It is specified 10752 bytes in the manual.

Signed-off-by: Ramesh Shanmugasundaram 
---
Hi All,

   Thanks for the review comments.

   This updated patch is based on linux-can-next tag 
(linux-can-next-for-4.6-20160310).

   This patch depends on

   [RFC] [PATCH v3] can: fix handling of unmodifiable configuration options
   (http://comments.gmane.org/gmane.linux.can/9126)

Changes since v2:
* Rebased to latest tag (linux-can-next-for-4.6-20160310)
* Cleaned up leftover debugfs code (Thanks Oliver H)
* Revised devicetree documentation text (as suggested by Rob H)
  
(https://www.mail-archive.com/linux-renesas-soc@vger.kernel.org/msg01597.html)
* Used new can subsystem api to set static configuration & removed 
check in rcar_canfd_start (as suggested by Oliver H)
  (Refer: http://comments.gmane.org/gmane.linux.can/9126 &
   
https://www.mail-archive.com/linux-renesas-soc@vger.kernel.org/msg01867.html)
* Clubbed Renesas controller drivers to driver/net/can/rcar dir (as 
suggested by Oliver H)
* Updated commit message

Changes since v1:
* Removed testmodes & debugfs code (suggested by Oliver H)
* Fixed tx path race issue by introducing lock (suggested by Marc K)
* Removed __maybe_unused attribute of rcar_canfd_of_table
---
 .../devicetree/bindings/net/can/rcar_canfd.txt |   89 ++
 drivers/net/can/Kconfig|   11 +-
 drivers/net/can/Makefile   |2 +-
 drivers/net/can/rcar/Kconfig   |   19 +
 drivers/net/can/rcar/Makefile  |6 +
 drivers/net/can/{ => rcar}/rcar_can.c  |0
 drivers/net/can/rcar/rcar_canfd.c  | 1614 
 7 files changed, 1730 insertions(+), 11 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/can/rcar_canfd.txt
 create mode 100644 drivers/net/can/rcar/Kconfig
 create mode 100644 drivers/net/can/rcar/Makefile
 rename drivers/net/can/{ => rcar}/rcar_can.c (100%)
 create mode 100644 drivers/net/can/rcar/rcar_canfd.c

diff --git a/Documentation/devicetree/bindings/net/can/rcar_canfd.txt 
b/Documentation/devicetree/bindings/net/can/rcar_canfd.txt
new file mode 100644
index 000..d45182b
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/can/rcar_canfd.txt
@@ -0,0 +1,89 @@
+Renesas R-Car CAN FD controller Device Tree Bindings
+
+
+Required properties:
+- compatible: Must contain one or more of the following:
+  - "renesas,rcar-gen3-canfd" for R-Car Gen3 compatible controller.
+  - "renesas,r8a7795-canfd" for R8A7795 (R-Car H3) compatible controller.
+
+  When compatible with the generic version, nodes must list the
+  SoC-specific version corresponding to the platform first, followed by the
+  family-specific and/or generic versions.
+
+- reg: physical base address and size of the R-Car CAN FD register map.
+- interrupts: interrupt specifier for the Global & Channel interrupts
+- clocks: phandles and clock specifiers for 3 clock inputs.
+- clock-names: 3 clock input name strings: "fck", "canfd", "can_clk".
+- pinctrl-0: pin control group to be used for this controller.
+- pinctrl-names: must be "default".
+
+Required child nodes:
+The controller supports two channels and each is represented as a child node.
+The name of the child nodes are "channel0" and "channel1" respectively. Each
+child node supports the "status" property only, which is used to
+enable/disable the respective channel.
+
+Required properties for "renesas,r8a7795-canfd" compatible:
+In R8A7795 SoC, canfd clock is a div6 clock and can be 

Re: [RFC] pinctrl: sh-pfc: only use dummy states for non-DT platforms

2016-03-15 Thread Geert Uytterhoeven
Hi Linus,

On Tue, Mar 15, 2016 at 9:29 AM, Linus Walleij  wrote:
> On Mon, Mar 7, 2016 at 7:40 PM, Wolfram Sang  wrote:
>
>> From: Wolfram Sang 
>>
>> If pinctrl_provide_dummies() is used unconditionally, then the dummy
>> state will be used even on DT platforms when the "init" state was
>> intentionally left out. Instead of "default", the dummy "init" state
>> will then be used during probe. Thus, when probing an I2C controller on
>> cold boot, communication triggered by bus notifiers broke because the
>> pins were not initialized.
>>
>> Do it like OMAP2: use the dummy state only for non-DT platforms.
>>
>> Reported-by: Geert Uytterhoeven 
>> Signed-off-by: Wolfram Sang 
>
> Patch applied for fixes with all the ACKs etc.
>
> This unfortiunately coincide with the merge window so was slow
> to pick it up, but it will be in the first round of fixes to Torvalds,
> possibly at -rc1 possibly earlier.

Thanks, I understand.

>> -   pinctrl_provide_dummies();
>> +   /* Enable dummy states for those platforms without pinctrl support */
>> +   if (!of_have_populated_dt())
>> +   pinctrl_provide_dummies();
>
> So remind we: what Renesas platforms are still not using DT?
> arch/sh?

Yep, the mighty SuperH. Old H8 and new ARM are DT-only.

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: [RFC] pinctrl: sh-pfc: only use dummy states for non-DT platforms

2016-03-15 Thread Linus Walleij
On Mon, Mar 7, 2016 at 7:40 PM, Wolfram Sang  wrote:

> From: Wolfram Sang 
>
> If pinctrl_provide_dummies() is used unconditionally, then the dummy
> state will be used even on DT platforms when the "init" state was
> intentionally left out. Instead of "default", the dummy "init" state
> will then be used during probe. Thus, when probing an I2C controller on
> cold boot, communication triggered by bus notifiers broke because the
> pins were not initialized.
>
> Do it like OMAP2: use the dummy state only for non-DT platforms.
>
> Reported-by: Geert Uytterhoeven 
> Signed-off-by: Wolfram Sang 

Patch applied for fixes with all the ACKs etc.

This unfortiunately coincide with the merge window so was slow
to pick it up, but it will be in the first round of fixes to Torvalds,
possibly at -rc1 possibly earlier.

> -   pinctrl_provide_dummies();
> +   /* Enable dummy states for those platforms without pinctrl support */
> +   if (!of_have_populated_dt())
> +   pinctrl_provide_dummies();

So remind we: what Renesas platforms are still not using DT?
arch/sh?

Yours,
Linus Walleij


Re: [PATCH v5 3/9] dma-mapping: add dma_{map,unmap}_resource

2016-03-15 Thread Christoph Hellwig
On Fri, Mar 11, 2016 at 01:58:46PM +0100, Niklas S?derlund wrote:
> Without an IOMMU this is easy since the phys_addr_t and dma_addr_t are 
> the same and no special care is needed. However if you have a IOMMU you 
> need to map the DMA slave phys_addr_t to a dma_addr_t using something 
> like this. Is it not very similar to dma_map_single() where one maps 
> processor virtual memory (instead if MMIO) so that it can be used with 
> DMA slaves?

It's similar, but I don't think this actually works as a general case
as there are quite a few places that expect to be able to have a
struct page for a physical address.  We'd at least need a very careful
audit for that case.


Re: [PATCH v2 0/2] ARM: dts: r8a7793: add CAN to device tree

2016-03-15 Thread Simon Horman
On Tue, Mar 15, 2016 at 07:09:23AM +, Ramesh Shanmugasundaram wrote:
> Hi Simon,
> 
> > Subject: [PATCH v2 0/2] ARM: dts: r8a7793: add CAN to device tree
> 
> r8a7794?

Yes, my bad.

> > 
> > Hi,
> > 
> > this short series adds CAN clocks and nodes to the r8a7794 device tree.
> > 
> > I am not aware of an r8a7794 board that exposes CAN - neither the alt nor
> > the silk board appear to - and thus am unsure of a way to test these
> > changes.  However, they are based on what is present for the r8a7791 SoC
> > and I am unable to find a difference in the SoC documentation.
> > 
> > This series is similar to a similar series I posted for the r8a7794 in
> > January.
> > 
> > Based on renesas-devel-20160311-v4.5-rc7.
> > 
> > Changes in v2
> > * Correct clock node names
> > * Add MSTP9 clocks
> > * Omit clock-output-names property from new nodes
> 
> Acked-by: Ramesh Shanmugasundaram 
> 
> for this series.

Thanks


Re: [PATCH 1/2] ARM: dts: r8a7794: add CAN clocks to device tree

2016-03-15 Thread Simon Horman
On Tue, Mar 15, 2016 at 08:28:42AM +0100, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Tue, Mar 15, 2016 at 12:56 AM, Simon Horman  wrote:
> > On Mon, Mar 14, 2016 at 10:23:01AM +0100, Geert Uytterhoeven wrote:
> >> On Mon, Mar 14, 2016 at 3:29 AM, Simon Horman
> >>  wrote:
> >> > --- a/arch/arm/boot/dts/r8a7794.dtsi
> >> > +++ b/arch/arm/boot/dts/r8a7794.dtsi
> >> > @@ -844,6 +844,24 @@
> >> > clock-output-names = "extal";
> >> > };
> >> >
> >> > +   /* External USB clock - can be overridden by the board */
> >> > +   usb_extal_clk: usb_extal_clk {
> >> > +   compatible = "fixed-clock";
> >> > +   #clock-cells = <0>;
> >> > +   clock-frequency = <4800>;
> >> > +   clock-output-names = "usb_extal";
> >>
> >> "clock-output-names" is optional these days, so please drop it.
> >
> > Thanks, I will drop it from this patch.
> >
> > Do we have a plan to remove it from existing nodes?
> > Should I do a sweep of the Renesas DTS files?
> 
> That's up to you.
> 
> It's more churn, but from the other side, it avoids people copying deprecated
> practices.

Thanks, I'll tentatively add it to my todo list.
I think its worth avoiding the copies.

> > And in particular, should it be removed from cpg_clocks ?
> 
> It's not optional for clocks with multiple outputs, cfr. the issues we
> had with cpg_clocks on H3, before the advent of the CPG/MSSR driver.

Understood.


Re: [PATCH 1/2] ARM: dts: r8a7794: add CAN clocks to device tree

2016-03-15 Thread Geert Uytterhoeven
Hi Simon,

On Tue, Mar 15, 2016 at 12:56 AM, Simon Horman  wrote:
> On Mon, Mar 14, 2016 at 10:23:01AM +0100, Geert Uytterhoeven wrote:
>> On Mon, Mar 14, 2016 at 3:29 AM, Simon Horman
>>  wrote:
>> > --- a/arch/arm/boot/dts/r8a7794.dtsi
>> > +++ b/arch/arm/boot/dts/r8a7794.dtsi
>> > @@ -844,6 +844,24 @@
>> > clock-output-names = "extal";
>> > };
>> >
>> > +   /* External USB clock - can be overridden by the board */
>> > +   usb_extal_clk: usb_extal_clk {
>> > +   compatible = "fixed-clock";
>> > +   #clock-cells = <0>;
>> > +   clock-frequency = <4800>;
>> > +   clock-output-names = "usb_extal";
>>
>> "clock-output-names" is optional these days, so please drop it.
>
> Thanks, I will drop it from this patch.
>
> Do we have a plan to remove it from existing nodes?
> Should I do a sweep of the Renesas DTS files?

That's up to you.

It's more churn, but from the other side, it avoids people copying deprecated
practices.

> And in particular, should it be removed from cpg_clocks ?

It's not optional for clocks with multiple outputs, cfr. the issues we had with
cpg_clocks on H3, before the advent of the CPG/MSSR driver.

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 v2 0/2] ARM: dts: r8a7793: add CAN to device tree

2016-03-15 Thread Ramesh Shanmugasundaram
Hi Simon,

> Subject: [PATCH v2 0/2] ARM: dts: r8a7793: add CAN to device tree

r8a7794?

> 
> Hi,
> 
> this short series adds CAN clocks and nodes to the r8a7794 device tree.
> 
> I am not aware of an r8a7794 board that exposes CAN - neither the alt nor
> the silk board appear to - and thus am unsure of a way to test these
> changes.  However, they are based on what is present for the r8a7791 SoC
> and I am unable to find a difference in the SoC documentation.
> 
> This series is similar to a similar series I posted for the r8a7794 in
> January.
> 
> Based on renesas-devel-20160311-v4.5-rc7.
> 
> Changes in v2
> * Correct clock node names
> * Add MSTP9 clocks
> * Omit clock-output-names property from new nodes

Acked-by: Ramesh Shanmugasundaram 

for this series.

Thanks,
Ramesh