Initial r8a7796 PFC support
Subsystems (4)
v3 cover Initial r8a7796 PFC support
Hi!
This implements a minimal set of PFC functionality for the M3 and sits on top of renesas-drivers-2016-08-09-v4.8-rc1. It includes the SCIF pin groups and enables pin control for the serial console (SCIF2) on the Salvator-X board.
This revision has scif_clk support, no bogus pin assignments, and enhanced ePAPR compliance. See below for details.
CU
Uli
Changes since v2:
- pfc: implement scif_clk
- dts: remove bogus scif2_clk assignment
- dtsi: ePAPRly correct pfc node name
Changes since v1:
- dts: assign scif2_clk pin to scif2
- bindings: "M3" -> "M3-W"
- pfc-r8a7796.c: fix whitespace inconsistencies
- pfc-r8a7796.c: fix 0xe6060248 register name ("IPSR17" -> "IPSR18")
Takeshi Kihara (3):
pinctrl: sh-pfc: Initial R8A7796 PFC support
pinctrl: sh-pfc: r8a7796: Add SCIF pins, groups and functions
arm64: dts: r8a7796: Add pinctrl device node
Ulrich Hecht (1):
arm64: dts: r8a7796: salvator: add serial console pins
.../bindings/pinctrl/renesas,pfc-pinctrl.txt | 1 + arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts | 16 + arch/arm64/boot/dts/renesas/r8a7796.dtsi | 5 + drivers/pinctrl/sh-pfc/Kconfig | 5 + drivers/pinctrl/sh-pfc/Makefile | 1 + drivers/pinctrl/sh-pfc/core.c | 6 + drivers/pinctrl/sh-pfc/pfc-r8a7796.c | 2372 ++++++++++++++++++++ drivers/pinctrl/sh-pfc/sh_pfc.h | 1 + 8 files changed, 2407 insertions(+) create mode 100644 drivers/pinctrl/sh-pfc/pfc-r8a7796.c
Signature · 1 line
2.7.4
PATCH v3 1/4 pinctrl: sh-pfc: Initial R8A7796 PFC support
From: Takeshi Kihara <[email protected]>
This patch adds initial pinctrl driver to support for the R8A7796 SoC.
--- .../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 | 6 + drivers/pinctrl/sh-pfc/pfc-r8a7796.c | 2072 ++++++++++++++++++++ drivers/pinctrl/sh-pfc/sh_pfc.h | 1 + 6 files changed, 2086 insertions(+) create mode 100644 drivers/pinctrl/sh-pfc/pfc-r8a7796.c
Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt +1 -0
@@ -21,6 +21,7 @@ Required Properties: - "renesas,pfc-r8a7793": for R8A7793 (R-Car M2-N) compatible pin-controller. - "renesas,pfc-r8a7794": for R8A7794 (R-Car E2) compatible pin-controller. - "renesas,pfc-r8a7795": for R8A7795 (R-Car H3) compatible pin-controller. + - "renesas,pfc-r8a7796": for R8A7796 (R-Car M3-W) 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
@@ -74,6 +74,11 @@ config PINCTRL_PFC_R8A7795 depends on ARCH_R8A7795 select PINCTRL_SH_PFC +config PINCTRL_PFC_R8A7796 + def_bool y + depends on ARCH_R8A7796 + select PINCTRL_SH_PFC + config PINCTRL_PFC_SH7203 def_bool y depends on CPU_SUBTYPE_SH7203
drivers/pinctrl/sh-pfc/Makefile +1 -0
@@ -11,6 +11,7 @@ obj-$(CONFIG_PINCTRL_PFC_R8A7792) += pfc-r8a7792.o obj-$(CONFIG_PINCTRL_PFC_R8A7793) += pfc-r8a7791.o obj-$(CONFIG_PINCTRL_PFC_R8A7794) += pfc-r8a7794.o obj-$(CONFIG_PINCTRL_PFC_R8A7795) += pfc-r8a7795.o +obj-$(CONFIG_PINCTRL_PFC_R8A7796) += pfc-r8a7796.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 +6 -0
@@ -518,6 +518,12 @@ static const struct of_device_id sh_pfc_of_table[] = { .data = &r8a7795_pinmux_info, },#endif +#ifdef CONFIG_PINCTRL_PFC_R8A7796 + { + .compatible = "renesas,pfc-r8a7796", + .data = &r8a7796_pinmux_info, + }, +#endif #ifdef CONFIG_PINCTRL_PFC_SH73A0 { .compatible = "renesas,pfc-sh73a0",
drivers/pinctrl/sh-pfc/pfc-r8a7796.c new file +2072 -0
2,072 lines not on this page · raw message
drivers/pinctrl/sh-pfc/sh_pfc.h +1 -0
@@ -261,6 +261,7 @@ extern const struct sh_pfc_soc_info r8a7792_pinmux_info;extern const struct sh_pfc_soc_info r8a7793_pinmux_info;extern const struct sh_pfc_soc_info r8a7794_pinmux_info;extern const struct sh_pfc_soc_info r8a7795_pinmux_info; +extern const struct sh_pfc_soc_info r8a7796_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;
Signature · 1 line
2.7.4
PATCH v3 2/4 pinctrl: sh-pfc: r8a7796: Add SCIF pins, groups and functions
In reply to Ulrich HechtFrom: Takeshi Kihara <[email protected]>
This patch adds SCIF{0,1,2,3,4,5} pins, groups and functions to R8A7796 SoC.
--- drivers/pinctrl/sh-pfc/pfc-r8a7796.c | 300 +++++++++++++++++++++++++++++++++++ 1 file changed, 300 insertions(+)
drivers/pinctrl/sh-pfc/pfc-r8a7796.c +300 -0
@@ -1486,10 +1486,310 @@ static const struct sh_pfc_pin pinmux_pins[] = { PINMUX_GPIO_GP_ALL(), }; +/* - SCIF0 ------------------------------------------------------------------ */ +static const unsigned int scif0_data_pins[] = { +/* RX, TX */ +RCAR_GP_PIN (5 ,1 ),RCAR_GP_PIN (5 ,2 ), +}; +static const unsigned int scif0_data_mux[] = { +RX0_MARK ,TX0_MARK , +}; +static const unsigned int scif0_clk_pins[] = { +/* SCK */ +RCAR_GP_PIN (5 ,0 ), +}; +static const unsigned int scif0_clk_mux[] = { +SCK0_MARK , +}; +static const unsigned int scif0_ctrl_pins[] = { +/* RTS, CTS */ +RCAR_GP_PIN (5 ,4 ),RCAR_GP_PIN (5 ,3 ), +}; +static const unsigned int scif0_ctrl_mux[] = { +RTS0_N_TANS_MARK ,CTS0_N_MARK , +}; +/* - SCIF1 ------------------------------------------------------------------ */ +static const unsigned int scif1_data_a_pins[] = { +/* RX, TX */ +RCAR_GP_PIN (5 ,5 ),RCAR_GP_PIN (5 ,6 ), +}; +static const unsigned int scif1_data_a_mux[] = { +RX1_A_MARK ,TX1_A_MARK , +}; +static const unsigned int scif1_clk_pins[] = { +/* SCK */ +RCAR_GP_PIN (6 ,21 ), +}; +static const unsigned int scif1_clk_mux[] = { +SCK1_MARK , +}; +static const unsigned int scif1_ctrl_pins[] = { +/* RTS, CTS */ +RCAR_GP_PIN (5 ,8 ),RCAR_GP_PIN (5 ,7 ), +}; +static const unsigned int scif1_ctrl_mux[] = { +RTS1_N_TANS_MARK ,CTS1_N_MARK , +}; + +static const unsigned int scif1_data_b_pins[] = { +/* RX, TX */ +RCAR_GP_PIN (5 ,24 ),RCAR_GP_PIN (5 ,25 ), +}; +static const unsigned int scif1_data_b_mux[] = { +RX1_B_MARK ,TX1_B_MARK , +}; +/* - SCIF2 ------------------------------------------------------------------ */ +static const unsigned int scif2_data_a_pins[] = { +/* RX, TX */ +RCAR_GP_PIN (5 ,11 ),RCAR_GP_PIN (5 ,10 ), +}; +static const unsigned int scif2_data_a_mux[] = { +RX2_A_MARK ,TX2_A_MARK , +}; +static const unsigned int scif2_clk_pins[] = { +/* SCK */ +RCAR_GP_PIN (5 ,9 ), +}; +static const unsigned int scif2_clk_mux[] = { +SCK2_MARK , +}; +static const unsigned int scif2_data_b_pins[] = { +/* RX, TX */ +RCAR_GP_PIN (5 ,15 ),RCAR_GP_PIN (5 ,16 ), +}; +static const unsigned int scif2_data_b_mux[] = { +RX2_B_MARK ,TX2_B_MARK , +}; +/* - SCIF3 ------------------------------------------------------------------ */ +static const unsigned int scif3_data_a_pins[] = { +/* RX, TX */ +RCAR_GP_PIN (1 ,23 ),RCAR_GP_PIN (1 ,24 ), +}; +static const unsigned int scif3_data_a_mux[] = { +RX3_A_MARK ,TX3_A_MARK , +}; +static const unsigned int scif3_clk_pins[] = { +/* SCK */ +RCAR_GP_PIN (1 ,22 ), +}; +static const unsigned int scif3_clk_mux[] = { +SCK3_MARK , +}; +static const unsigned int scif3_ctrl_pins[] = { +/* RTS, CTS */ +RCAR_GP_PIN (1 ,26 ),RCAR_GP_PIN (1 ,25 ), +}; +static const unsigned int scif3_ctrl_mux[] = { +RTS3_N_TANS_MARK ,CTS3_N_MARK , +}; +static const unsigned int scif3_data_b_pins[] = { +/* RX, TX */ +RCAR_GP_PIN (1 ,8 ),RCAR_GP_PIN (1 ,11 ), +}; +static const unsigned int scif3_data_b_mux[] = { +RX3_B_MARK ,TX3_B_MARK , +}; +/* - SCIF4 ------------------------------------------------------------------ */ +static const unsigned int scif4_data_a_pins[] = { +/* RX, TX */ +RCAR_GP_PIN (2 ,11 ),RCAR_GP_PIN (2 ,12 ), +}; +static const unsigned int scif4_data_a_mux[] = { +RX4_A_MARK ,TX4_A_MARK , +}; +static const unsigned int scif4_clk_a_pins[] = { +/* SCK */ +RCAR_GP_PIN (2 ,10 ), +}; +static const unsigned int scif4_clk_a_mux[] = { +SCK4_A_MARK , +}; +static const unsigned int scif4_ctrl_a_pins[] = { +/* RTS, CTS */ +RCAR_GP_PIN (2 ,14 ),RCAR_GP_PIN (2 ,13 ), +}; +static const unsigned int scif4_ctrl_a_mux[] = { +RTS4_N_TANS_A_MARK ,CTS4_N_A_MARK , +}; +static const unsigned int scif4_data_b_pins[] = { +/* RX, TX */ +RCAR_GP_PIN (1 ,6 ),RCAR_GP_PIN (1 ,7 ), +}; +static const unsigned int scif4_data_b_mux[] = { +RX4_B_MARK ,TX4_B_MARK , +}; +static const unsigned int scif4_clk_b_pins[] = { +/* SCK */ +RCAR_GP_PIN (1 ,5 ), +}; +static const unsigned int scif4_clk_b_mux[] = { +SCK4_B_MARK , +}; +static const unsigned int scif4_ctrl_b_pins[] = { +/* RTS, CTS */ +RCAR_GP_PIN (1 ,10 ),RCAR_GP_PIN (1 ,9 ), +}; +static const unsigned int scif4_ctrl_b_mux[] = { +RTS4_N_TANS_B_MARK ,CTS4_N_B_MARK , +}; +static const unsigned int scif4_data_c_pins[] = { +/* RX, TX */ +RCAR_GP_PIN (0 ,12 ),RCAR_GP_PIN (0 ,13 ), +}; +static const unsigned int scif4_data_c_mux[] = { +RX4_C_MARK ,TX4_C_MARK , +}; +static const unsigned int scif4_clk_c_pins[] = { +/* SCK */ +RCAR_GP_PIN (0 ,8 ), +}; +static const unsigned int scif4_clk_c_mux[] = { +SCK4_C_MARK , +}; +static const unsigned int scif4_ctrl_c_pins[] = { +/* RTS, CTS */ +RCAR_GP_PIN (0 ,11 ),RCAR_GP_PIN (0 ,10 ), +}; +static const unsigned int scif4_ctrl_c_mux[] = { +RTS4_N_TANS_C_MARK ,CTS4_N_C_MARK , +}; +/* - SCIF5 ------------------------------------------------------------------ */ +static const unsigned int scif5_data_a_pins[] = { +/* RX, TX */ +RCAR_GP_PIN (5 ,19 ),RCAR_GP_PIN (5 ,21 ), +}; +static const unsigned int scif5_data_a_mux[] = { +RX5_A_MARK ,TX5_A_MARK , +}; +static const unsigned int scif5_clk_a_pins[] = { +/* SCK */ +RCAR_GP_PIN (6 ,21 ), +}; +static const unsigned int scif5_clk_a_mux[] = { +SCK5_A_MARK , +}; + +static const unsigned int scif5_data_b_pins[] = { +/* RX, TX */ +RCAR_GP_PIN (5 ,12 ),RCAR_GP_PIN (5 ,18 ), +}; +static const unsigned int scif5_data_b_mux[] = { +RX5_B_MARK ,TX5_B_MARK , +}; +static const unsigned int scif5_clk_b_pins[] = { +/* SCK */ +RCAR_GP_PIN (5 ,0 ), +}; +static const unsigned int scif5_clk_b_mux[] = { +SCK5_B_MARK , +}; + +/* - SCIF Clock ------------------------------------------------------------- */ +static const unsigned int scif_clk_a_pins[] = { +/* SCIF_CLK */ +RCAR_GP_PIN (6 ,23 ), +}; +static const unsigned int scif_clk_a_mux[] = { +SCIF_CLK_A_MARK , +}; +static const unsigned int scif_clk_b_pins[] = { +/* SCIF_CLK */ +RCAR_GP_PIN (5 ,9 ), +}; +static const unsigned int scif_clk_b_mux[] = { +SCIF_CLK_B_MARK , +}; +static const struct sh_pfc_pin_group pinmux_groups[] = { +SH_PFC_PIN_GROUP (scif0_data), +SH_PFC_PIN_GROUP (scif0_clk), +SH_PFC_PIN_GROUP (scif0_ctrl), +SH_PFC_PIN_GROUP (scif1_data_a), +SH_PFC_PIN_GROUP (scif1_clk), +SH_PFC_PIN_GROUP (scif1_ctrl), +SH_PFC_PIN_GROUP (scif1_data_b), +SH_PFC_PIN_GROUP (scif2_data_a), +SH_PFC_PIN_GROUP (scif2_clk), +SH_PFC_PIN_GROUP (scif2_data_b), +SH_PFC_PIN_GROUP (scif3_data_a), +SH_PFC_PIN_GROUP (scif3_clk), +SH_PFC_PIN_GROUP (scif3_ctrl), +SH_PFC_PIN_GROUP (scif3_data_b), +SH_PFC_PIN_GROUP (scif4_data_a), +SH_PFC_PIN_GROUP (scif4_clk_a), +SH_PFC_PIN_GROUP (scif4_ctrl_a), +SH_PFC_PIN_GROUP (scif4_data_b), +SH_PFC_PIN_GROUP (scif4_clk_b), +SH_PFC_PIN_GROUP (scif4_ctrl_b), +SH_PFC_PIN_GROUP (scif4_data_c), +SH_PFC_PIN_GROUP (scif4_clk_c), +SH_PFC_PIN_GROUP (scif4_ctrl_c), +SH_PFC_PIN_GROUP (scif5_data_a), +SH_PFC_PIN_GROUP (scif5_clk_a), +SH_PFC_PIN_GROUP (scif5_data_b), +SH_PFC_PIN_GROUP (scif5_clk_b), +SH_PFC_PIN_GROUP (scif_clk_a), +SH_PFC_PIN_GROUP (scif_clk_b), +}; + +static const char *const scif0_groups[] = { +"scif0_data" , +"scif0_clk" , +"scif0_ctrl" , +}; + +static const char *const scif1_groups[] = { +"scif1_data_a" , +"scif1_clk" , +"scif1_ctrl" , +"scif1_data_b" , +}; + +static const char *const scif2_groups[] = { +"scif2_data_a" , +"scif2_clk" , +"scif2_data_b" , +}; + +static const char *const scif3_groups[] = { +"scif3_data_a" , +"scif3_clk" , +"scif3_ctrl" , +"scif3_data_b" , +}; + +static const char *const scif4_groups[] = { +"scif4_data_a" , +"scif4_clk_a" , +"scif4_ctrl_a" , +"scif4_data_b" , +"scif4_clk_b" , +"scif4_ctrl_b" , +"scif4_data_c" , +"scif4_clk_c" , +"scif4_ctrl_c" , +}; + +static const char *const scif5_groups[] = { +"scif5_data_a" , +"scif5_clk_a" , +"scif5_data_b" , +"scif5_clk_b" , +}; + +static const char *const scif_clk_groups[] = { +"scif_clk_a" , +"scif_clk_b" , };static const struct sh_pfc_function pinmux_functions[] = { +SH_PFC_FUNCTION (scif0), +SH_PFC_FUNCTION (scif1), +SH_PFC_FUNCTION (scif2), +SH_PFC_FUNCTION (scif3), +SH_PFC_FUNCTION (scif4), +SH_PFC_FUNCTION (scif5), +SH_PFC_FUNCTION (scif_clk), };static const struct pinmux_cfg_reg pinmux_config_regs[] = {
Signature · 1 line
2.7.4
PATCH v3 3/4 arm64: dts: r8a7796: Add pinctrl device node
In reply to Ulrich HechtFrom: Takeshi Kihara <[email protected]>
This patch adds pinctrl device node for R8A7796 SoC.
--- arch/arm64/boot/dts/renesas/r8a7796.dtsi | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/renesas/r8a7796.dtsi +5 -0
@@ -107,6 +107,11 @@ status = "disabled"; }; + pfc: pin-controller@e6060000 { + compatible = "renesas,pfc-r8a7796"; + reg = <0 0xe6060000 0 0x50c>; + }; + cpg: clock-controller@e6150000 { compatible = "renesas,r8a7796-cpg-mssr"; reg = <0 0xe6150000 0 0x1000>;
Signature · 1 line
2.7.4
PATCH v3 4/4 arm64: dts: r8a7796: salvator: add serial console pins
In reply to Ulrich HechtAdds pin control for SCIF2.
--- arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts +16 -0
@@ -31,11 +31,27 @@ }; }; +&pfc { + pinctrl-0 = <&scif_clk_pins>; + pinctrl-names = "default"; + + scif2_pins: scif2 { + groups = "scif2_data_a"; + function = "scif2"; + }; + scif_clk_pins: scif_clk { + groups = "scif_clk_a"; + function = "scif_clk"; + }; +}; + &extal_clk { clock-frequency = <16666666>; }; &scif2 { + pinctrl-0 = <&scif2_pins>; + pinctrl-names = "default"; status = "okay"; };
Signature · 1 line
2.7.4
Re: [PATCH v3 4/4] arm64: dts: r8a7796: salvator: add serial console pins
Quoted 3 lines · Ulrich Hecht
Adds pin control for SCIF2.
Signed-off-by Ulrich Hecht <[email protected]>
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
Hi Ulrich,
Quoted 7 lines · Ulrich Hecht
This implements a minimal set of PFC functionality for the M3 and sits on top of renesas-drivers-2016-08-09-v4.8-rc1. It includes the SCIF pin groups and enables pin control for the serial console (SCIF2) on the Salvator-X board.
This revision has
scif_clksupport, no bogus pin assignments, and enhanced ePAPR compliance. See below for details.
Thank you, I've applied the first two patches to sh-pfc-for-v4.9.
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
Quoted 9 lines · Geert Uytterhoeven
Hi Ulrich,
Quoted 5 lines · Ulrich Hecht
This implements a minimal set of PFC functionality for the M3 and sits on top of renesas-drivers-2016-08-09-v4.8-rc1. It includes the SCIF pin groups and enables pin control for the serial console (SCIF2) on the Salvator-X board.
Quoted 4 lines
Quoted 2 lines
This revision has
scif_clksupport, no bogus pin assignments, and enhanced ePAPR compliance. See below for details.Thank you, I've applied the first two patches to sh-pfc-for-v4.9.
I have queued up the remaining two patches on a branch based on the sh-pfc-for-v4.9-tag2 tag of Geert's tree.