Skip to contentSkip to conversation

sh-pfc: add R8A7794 PFC support

PATCH Superseded Sergei Shtylyov 3 participants 4 messages Feb 11, 2015 – Feb 16, 2015

Subsystems (5)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 sh-pfc: add R8A7794 PFC support

From: Hisashi Nakamura <[email protected]>

Add PFC support for the R8A7794 SoC including pin groups for some on-chip devices such as ETH, I2C, INTC, MSIOF, QSPI, [H]SCIF...

[Sergei: squashed together several patches, fixed the MLB_CLK typo, added IRQ4.. IRQ9 pin groups, fixed IRQn comments, added ETH B pin group names, removed stray new line and fixed typos in the comments in the pinmux_config_regs[] initializer, added reasonable and removed unreasonable copyrights, modified the bindings document, renamed, added changelog.]

---
The patch is against the 'devel' branch of Linus W.'s 'linux-pinctrl.git' repo.

Changes in version 2:
- rebased the patch.

 Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt |    1 
 drivers/pinctrl/sh-pfc/Kconfig                                    |    5 
 drivers/pinctrl/sh-pfc/Makefile                                   |    1 
 drivers/pinctrl/sh-pfc/core.c                                     |    9 
 drivers/pinctrl/sh-pfc/core.h                                     |    1 
 drivers/pinctrl/sh-pfc/pfc-r8a7794.c                              | 3989 ++++++++++
 6 files changed, 4006 insertions(+)
Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt +1 -0
Index: linux-pinctrl/Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt
===================================================================
@@ -17,6 +17,7 @@ Required Properties:
     - "renesas,pfc-r8a7779": for R8A7779 (R-Car H1) compatible pin-controller.
     - "renesas,pfc-r8a7790": for R8A7790 (R-Car H2) compatible pin-controller.
     - "renesas,pfc-r8a7791": for R8A7791 (R-Car M2) compatible pin-controller.
+    - "renesas,pfc-r8a7794": for R8A7794 (R-Car E2) compatible pin-controller.
     - "renesas,pfc-sh73a0": for SH73A0 (SH-Mobile AG5) compatible pin-controller.
 
   - reg: Base address and length of each memory resource used by the pin
drivers/pinctrl/sh-pfc/Kconfig +5 -0
Index: linux-pinctrl/drivers/pinctrl/sh-pfc/Kconfig
===================================================================
@@ -55,6 +55,11 @@ config PINCTRL_PFC_R8A7791
 	depends on ARCH_R8A7791
 	select PINCTRL_SH_PFC
 
+config PINCTRL_PFC_R8A7794
+	def_bool y
+	depends on ARCH_R8A7794
+	select PINCTRL_SH_PFC
+
 config PINCTRL_PFC_SH7203
 	def_bool y
 	depends on CPU_SUBTYPE_SH7203
drivers/pinctrl/sh-pfc/Makefile +1 -0
Index: linux-pinctrl/drivers/pinctrl/sh-pfc/Makefile
===================================================================
@@ -10,6 +10,7 @@ obj-$(CONFIG_PINCTRL_PFC_R8A7778)	+= pfc
 obj-$(CONFIG_PINCTRL_PFC_R8A7779)	+= pfc-r8a7779.o
 obj-$(CONFIG_PINCTRL_PFC_R8A7790)	+= pfc-r8a7790.o
 obj-$(CONFIG_PINCTRL_PFC_R8A7791)	+= pfc-r8a7791.o
+obj-$(CONFIG_PINCTRL_PFC_R8A7794)	+= pfc-r8a7794.o
 obj-$(CONFIG_PINCTRL_PFC_SH7203)	+= pfc-sh7203.o
 obj-$(CONFIG_PINCTRL_PFC_SH7264)	+= pfc-sh7264.o
 obj-$(CONFIG_PINCTRL_PFC_SH7269)	+= pfc-sh7269.o
drivers/pinctrl/sh-pfc/core.c +9 -0
Index: linux-pinctrl/drivers/pinctrl/sh-pfc/core.c
===================================================================
@@ -481,6 +481,12 @@ static const struct of_device_id sh_pfc_
 		.data = &r8a7791_pinmux_info,
 	},
 #endif
+#ifdef CONFIG_PINCTRL_PFC_R8A7794
+	{
+		.compatible = "renesas,pfc-r8a7794",
+		.data = &r8a7794_pinmux_info,
+	},
+#endif
 #ifdef CONFIG_PINCTRL_PFC_SH73A0
 	{
 		.compatible = "renesas,pfc-sh73a0",
@@ -600,6 +606,9 @@ static const struct platform_device_id s
 #ifdef CONFIG_PINCTRL_PFC_R8A7791
 	{ "pfc-r8a7791", (kernel_ulong_t)&r8a7791_pinmux_info },
 #endif
+#ifdef CONFIG_PINCTRL_PFC_R8A7794
+	{ "pfc-r8a7794", (kernel_ulong_t)&r8a7794_pinmux_info },
+#endif
 #ifdef CONFIG_PINCTRL_PFC_SH7203
 	{ "pfc-sh7203", (kernel_ulong_t)&sh7203_pinmux_info },
 #endif
drivers/pinctrl/sh-pfc/core.h +1 -0
Index: linux-pinctrl/drivers/pinctrl/sh-pfc/core.h
===================================================================
@@ -72,6 +72,7 @@ extern const struct sh_pfc_soc_info r8a7
 extern const struct sh_pfc_soc_info r8a7779_pinmux_info;
 extern const struct sh_pfc_soc_info r8a7790_pinmux_info;
 extern const struct sh_pfc_soc_info r8a7791_pinmux_info;
+extern const struct sh_pfc_soc_info r8a7794_pinmux_info;
 extern const struct sh_pfc_soc_info sh7203_pinmux_info;
 extern const struct sh_pfc_soc_info sh7264_pinmux_info;
 extern const struct sh_pfc_soc_info sh7269_pinmux_info;
drivers/pinctrl/sh-pfc/pfc-r8a7794.c new file +3989 -0

2,947 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.

#1 lore raw

Hi Sergei,

Thank you for the patch.

Quoted 27 lines · On Thursday 12 February 2015 00:01:18 Sergei Shtylyov wrote:

From: Hisashi Nakamura <[email protected]>

Add PFC support for the R8A7794 SoC including pin groups for some on-chip devices such as ETH, I2C, INTC, MSIOF, QSPI, [H]SCIF...

[Sergei: squashed together several patches, fixed the MLB_CLK typo, added IRQ4.. IRQ9 pin groups, fixed IRQn comments, added ETH B pin group names, removed stray new line and fixed typos in the comments in the pinmux_config_regs[] initializer, added reasonable and removed unreasonable copyrights, modified the bindings document, renamed, added changelog.]

---
The patch is against the 'devel' branch of Linus W.'s 'linux-pinctrl.git' repo.

Changes in version 2:
- rebased the patch.

 Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt |    1
 drivers/pinctrl/sh-pfc/Kconfig                                    |    5
 drivers/pinctrl/sh-pfc/Makefile                                   |    1
 drivers/pinctrl/sh-pfc/core.c                                     |    9
 drivers/pinctrl/sh-pfc/core.h                                     |    1
 drivers/pinctrl/sh-pfc/pfc-r8a7794.c                              | 3989 ++
 6 files changed, 4006 insertions(+)

[snip]

Quoted 18 lines

Index: linux-pinctrl/drivers/pinctrl/sh-pfc/core.c
===================================================================

drivers/pinctrl/sh-pfc/core.c +6 -0
@@ -481,6 +481,12 @@ static const struct of_device_id sh_pfc_
 		.data = &r8a7791_pinmux_info,
 	},
 #endif
+#ifdef CONFIG_PINCTRL_PFC_R8A7794
+	{
+		.compatible = "renesas,pfc-r8a7794",
+		.data = &r8a7794_pinmux_info,
+	},
+#endif
 #ifdef CONFIG_PINCTRL_PFC_SH73A0
 	{
 		.compatible = "renesas,pfc-sh73a0",

drivers/pinctrl/sh-pfc/core.c static const struct platform_device_id s · line 610

Quoted 5 lines
drivers/pinctrl/sh-pfc/core.c +2 -0
@@ -600,6 +606,9 @@ static const struct platform_device_id s
 #ifdef CONFIG_PINCTRL_PFC_R8A7791
 	{ "pfc-r8a7791", (kernel_ulong_t)&r8a7791_pinmux_info },
 #endif
+#ifdef CONFIG_PINCTRL_PFC_R8A7794
+	{ "pfc-r8a7794", (kernel_ulong_t)&r8a7794_pinmux_info },

R-Car E2 is DT-only, so there's no need for a platform_device_id entry.

Quoted 4 lines
drivers/pinctrl/sh-pfc/core.c +1 -0
+#endif
 #ifdef CONFIG_PINCTRL_PFC_SH7203
 	{ "pfc-sh7203", (kernel_ulong_t)&sh7203_pinmux_info },
 #endif

[snip]

Quoted 21 lines

Index: linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
===================================================================

drivers/pinctrl/sh-pfc/pfc-r8a7794.c new file +16 -0
@@ -0,0 +1,3989 @@
+/*
+ * r8a7794 processor support - PFC hardware block.
+ *
+ * Copyright (C) 2014 Renesas Electronics Corporation
+ * Copyright (C) 2015 Renesas Solutions Corp.
+ * Copyright (C) 2015 Cogent  Embedded, Inc., <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/platform_data/gpio-rcar.h>
+
+#include "core.h"

drivers/pinctrl/sh-pfc/pfc-r8a7794.c line 26

Quoted 10 lines
drivers/pinctrl/sh-pfc/pfc-r8a7794.c new file +10 -0
+#include "sh_pfc.h"
+
+#define CPU_ALL_PORT(fn, sfx)						\
+	PORT_GP_32(0, fn, sfx),						\
+	PORT_GP_32(1, fn, sfx),						\
+	PORT_GP_32(2, fn, sfx),						\
+	PORT_GP_32(3, fn, sfx),						\
+	PORT_GP_32(4, fn, sfx),						\
+	PORT_GP_32(5, fn, sfx),						\
+	PORT_GP_32(6, fn, sfx)

If I'm not mistaken port GP1 has 26 pins only, GP5 28 pins and GP6 26 pins.

[snip]

I haven't checked all pins in details, but the pin groups look sensible to me.

Signature · 3 lines
Regards,

Laurent Pinchart
#2 lore raw
Quoted 23 lines · Laurent Pinchart
Quoted 23 lines
drivers/pinctrl/sh-pfc/pfc-r8a7794.c new file +20 -0
@@ -0,0 +1,3989 @@
+/*
+ * r8a7794 processor support - PFC hardware block.
+ *
+ * Copyright (C) 2014 Renesas Electronics Corporation
+ * Copyright (C) 2015 Renesas Solutions Corp.
+ * Copyright (C) 2015 Cogent  Embedded, Inc., <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/platform_data/gpio-rcar.h>
+
+#include "core.h"
+#include "sh_pfc.h"
+
+#define CPU_ALL_PORT(fn, sfx)                                                \
+     PORT_GP_32(0, fn, sfx),                                         \
Quoted 8 lines

drivers/pinctrl/sh-pfc/pfc-r8a7794.c line 26

Quoted 6 lines
drivers/pinctrl/sh-pfc/pfc-r8a7794.c new file +6 -0
+     PORT_GP_32(1, fn, sfx),                                         \
+     PORT_GP_32(2, fn, sfx),                                         \
+     PORT_GP_32(3, fn, sfx),                                         \
+     PORT_GP_32(4, fn, sfx),                                         \
+     PORT_GP_32(5, fn, sfx),                                         \
+     PORT_GP_32(6, fn, sfx)

If I'm not mistaken port GP1 has 26 pins only, GP5 28 pins and GP6 26 pins.

That's correct.

If that has to be reflected in the CPU_ALL_PORT() macro, a few existing pfc drivers should be modified, too:
- on r8a7790, port GP1 and GP2 have 30 pins only,
- on r8a7791, port GP1 has 26 pins only.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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

#3 lore raw

Hi Geert,

Quoted 35 lines · On Monday 16 February 2015 09:57:09 Geert Uytterhoeven wrote:
Quoted 25 lines · Laurent Pinchart
Quoted 25 lines
drivers/pinctrl/sh-pfc/pfc-r8a7794.c new file +6 -0
@@ -0,0 +1,3989 @@
+/*
+ * r8a7794 processor support - PFC hardware block.
+ *
+ * Copyright (C) 2014 Renesas Electronics Corporation
+ * Copyright (C) 2015 Renesas Solutions Corp.
+ * Copyright (C) 2015 Cogent  Embedded, Inc.,

<[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ */

drivers/pinctrl/sh-pfc/pfc-r8a7794.c new file +8 -0
+
+#include <linux/kernel.h>
+#include <linux/platform_data/gpio-rcar.h>
+
+#include "core.h"
+#include "sh_pfc.h"
+
+#define CPU_ALL_PORT(fn, sfx)                                           
    \ +     PORT_GP_32(0, fn, sfx),                                     
   \ +     PORT_GP_32(1, fn, sfx),                                      
Quoted 8 lines
Quoted 5 lines

\ + PORT_GP_32(2, fn, sfx),
\ + PORT_GP_32(3, fn, sfx),

\ +     PORT_GP_32(4, fn, sfx),                                        
\ +     PORT_GP_32(5, fn, sfx),                                        
\ +     PORT_GP_32(6, fn, sfx)

If I'm not mistaken port GP1 has 26 pins only, GP5 28 pins and GP6 26 pins.

Quoted 6 lines

That's correct.

If that has to be reflected in the CPU_ALL_PORT() macro, a few existing pfc drivers should be modified, too:
- on r8a7790, port GP1 and GP2 have 30 pins only,
- on r8a7791, port GP1 has 26 pins only.

Done :-)

Signature · 3 lines
Regards,

Laurent Pinchart