Commit 4ecc7ff8 authored by Lad Prabhakar's avatar Lad Prabhakar Committed by Geert Uytterhoeven

pinctrl: sh-pfc: r8a7790: Add r8a7742 PFC support

Renesas RZ/G1H (R8A7742) is pin compatible with R-Car H2 (R8A7790),
however it doesn't have several automotive specific peripherals. Add
automotive-specific pin groups/functions along with common pin
groups/functions for supporting both r8a7790 and r8a7742 SoC.
Signed-off-by: default avatarLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: default avatarMarian-Cristian Rotariu <marian-cristian.rotariu.rb@bp.renesas.com>
Link: https://lore.kernel.org/r/1588542414-14826-3-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.comSigned-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
parent baf674bf
...@@ -12,6 +12,7 @@ config PINCTRL_SH_PFC ...@@ -12,6 +12,7 @@ config PINCTRL_SH_PFC
select PINCTRL_PFC_EMEV2 if ARCH_EMEV2 select PINCTRL_PFC_EMEV2 if ARCH_EMEV2
select PINCTRL_PFC_R8A73A4 if ARCH_R8A73A4 select PINCTRL_PFC_R8A73A4 if ARCH_R8A73A4
select PINCTRL_PFC_R8A7740 if ARCH_R8A7740 select PINCTRL_PFC_R8A7740 if ARCH_R8A7740
select PINCTRL_PFC_R8A7742 if ARCH_R8A7742
select PINCTRL_PFC_R8A7743 if ARCH_R8A7743 select PINCTRL_PFC_R8A7743 if ARCH_R8A7743
select PINCTRL_PFC_R8A7744 if ARCH_R8A7744 select PINCTRL_PFC_R8A7744 if ARCH_R8A7744
select PINCTRL_PFC_R8A7745 if ARCH_R8A7745 select PINCTRL_PFC_R8A7745 if ARCH_R8A7745
...@@ -74,6 +75,9 @@ config PINCTRL_PFC_R8A7740 ...@@ -74,6 +75,9 @@ config PINCTRL_PFC_R8A7740
bool "R-Mobile A1 pin control support" if COMPILE_TEST bool "R-Mobile A1 pin control support" if COMPILE_TEST
select PINCTRL_SH_PFC_GPIO select PINCTRL_SH_PFC_GPIO
config PINCTRL_PFC_R8A7742
bool "RZ/G1H pin control support" if COMPILE_TEST
config PINCTRL_PFC_R8A7743 config PINCTRL_PFC_R8A7743
bool "RZ/G1M pin control support" if COMPILE_TEST bool "RZ/G1M pin control support" if COMPILE_TEST
......
...@@ -4,6 +4,7 @@ obj-$(CONFIG_PINCTRL_SH_PFC_GPIO) += gpio.o ...@@ -4,6 +4,7 @@ obj-$(CONFIG_PINCTRL_SH_PFC_GPIO) += gpio.o
obj-$(CONFIG_PINCTRL_PFC_EMEV2) += pfc-emev2.o obj-$(CONFIG_PINCTRL_PFC_EMEV2) += pfc-emev2.o
obj-$(CONFIG_PINCTRL_PFC_R8A73A4) += pfc-r8a73a4.o obj-$(CONFIG_PINCTRL_PFC_R8A73A4) += pfc-r8a73a4.o
obj-$(CONFIG_PINCTRL_PFC_R8A7740) += pfc-r8a7740.o obj-$(CONFIG_PINCTRL_PFC_R8A7740) += pfc-r8a7740.o
obj-$(CONFIG_PINCTRL_PFC_R8A7742) += pfc-r8a7790.o
obj-$(CONFIG_PINCTRL_PFC_R8A7743) += pfc-r8a7791.o obj-$(CONFIG_PINCTRL_PFC_R8A7743) += pfc-r8a7791.o
obj-$(CONFIG_PINCTRL_PFC_R8A7744) += pfc-r8a7791.o obj-$(CONFIG_PINCTRL_PFC_R8A7744) += pfc-r8a7791.o
obj-$(CONFIG_PINCTRL_PFC_R8A7745) += pfc-r8a7794.o obj-$(CONFIG_PINCTRL_PFC_R8A7745) += pfc-r8a7794.o
......
...@@ -485,6 +485,12 @@ static const struct of_device_id sh_pfc_of_table[] = { ...@@ -485,6 +485,12 @@ static const struct of_device_id sh_pfc_of_table[] = {
.data = &r8a7740_pinmux_info, .data = &r8a7740_pinmux_info,
}, },
#endif #endif
#ifdef CONFIG_PINCTRL_PFC_R8A7742
{
.compatible = "renesas,pfc-r8a7742",
.data = &r8a7742_pinmux_info,
},
#endif
#ifdef CONFIG_PINCTRL_PFC_R8A7743 #ifdef CONFIG_PINCTRL_PFC_R8A7743
{ {
.compatible = "renesas,pfc-r8a7743", .compatible = "renesas,pfc-r8a7743",
......
...@@ -3938,7 +3938,11 @@ static const unsigned int vin3_clk_mux[] = { ...@@ -3938,7 +3938,11 @@ static const unsigned int vin3_clk_mux[] = {
VI3_CLK_MARK, VI3_CLK_MARK,
}; };
static const struct sh_pfc_pin_group pinmux_groups[] = { static const struct {
struct sh_pfc_pin_group common[289];
struct sh_pfc_pin_group automotive[1];
} pinmux_groups = {
.common = {
SH_PFC_PIN_GROUP(audio_clk_a), SH_PFC_PIN_GROUP(audio_clk_a),
SH_PFC_PIN_GROUP(audio_clk_b), SH_PFC_PIN_GROUP(audio_clk_b),
SH_PFC_PIN_GROUP(audio_clk_c), SH_PFC_PIN_GROUP(audio_clk_c),
...@@ -4009,7 +4013,6 @@ static const struct sh_pfc_pin_group pinmux_groups[] = { ...@@ -4009,7 +4013,6 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
SH_PFC_PIN_GROUP(intc_irq1), SH_PFC_PIN_GROUP(intc_irq1),
SH_PFC_PIN_GROUP(intc_irq2), SH_PFC_PIN_GROUP(intc_irq2),
SH_PFC_PIN_GROUP(intc_irq3), SH_PFC_PIN_GROUP(intc_irq3),
SH_PFC_PIN_GROUP(mlb_3pin),
SH_PFC_PIN_GROUP(mmc0_data1), SH_PFC_PIN_GROUP(mmc0_data1),
SH_PFC_PIN_GROUP(mmc0_data4), SH_PFC_PIN_GROUP(mmc0_data4),
SH_PFC_PIN_GROUP(mmc0_data8), SH_PFC_PIN_GROUP(mmc0_data8),
...@@ -4229,6 +4232,10 @@ static const struct sh_pfc_pin_group pinmux_groups[] = { ...@@ -4229,6 +4232,10 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
SH_PFC_PIN_GROUP(vin3_field), SH_PFC_PIN_GROUP(vin3_field),
SH_PFC_PIN_GROUP(vin3_clkenb), SH_PFC_PIN_GROUP(vin3_clkenb),
SH_PFC_PIN_GROUP(vin3_clk), SH_PFC_PIN_GROUP(vin3_clk),
},
.automotive = {
SH_PFC_PIN_GROUP(mlb_3pin),
}
}; };
static const char * const audio_clk_groups[] = { static const char * const audio_clk_groups[] = {
...@@ -4689,7 +4696,11 @@ static const char * const vin3_groups[] = { ...@@ -4689,7 +4696,11 @@ static const char * const vin3_groups[] = {
"vin3_clk", "vin3_clk",
}; };
static const struct sh_pfc_function pinmux_functions[] = { static const struct {
struct sh_pfc_function common[55];
struct sh_pfc_function automotive[1];
} pinmux_functions = {
.common = {
SH_PFC_FUNCTION(audio_clk), SH_PFC_FUNCTION(audio_clk),
SH_PFC_FUNCTION(avb), SH_PFC_FUNCTION(avb),
SH_PFC_FUNCTION(du), SH_PFC_FUNCTION(du),
...@@ -4708,7 +4719,6 @@ static const struct sh_pfc_function pinmux_functions[] = { ...@@ -4708,7 +4719,6 @@ static const struct sh_pfc_function pinmux_functions[] = {
SH_PFC_FUNCTION(iic2), SH_PFC_FUNCTION(iic2),
SH_PFC_FUNCTION(iic3), SH_PFC_FUNCTION(iic3),
SH_PFC_FUNCTION(intc), SH_PFC_FUNCTION(intc),
SH_PFC_FUNCTION(mlb),
SH_PFC_FUNCTION(mmc0), SH_PFC_FUNCTION(mmc0),
SH_PFC_FUNCTION(mmc1), SH_PFC_FUNCTION(mmc1),
SH_PFC_FUNCTION(msiof0), SH_PFC_FUNCTION(msiof0),
...@@ -4746,6 +4756,10 @@ static const struct sh_pfc_function pinmux_functions[] = { ...@@ -4746,6 +4756,10 @@ static const struct sh_pfc_function pinmux_functions[] = {
SH_PFC_FUNCTION(vin1), SH_PFC_FUNCTION(vin1),
SH_PFC_FUNCTION(vin2), SH_PFC_FUNCTION(vin2),
SH_PFC_FUNCTION(vin3), SH_PFC_FUNCTION(vin3),
},
.automotive = {
SH_PFC_FUNCTION(mlb),
}
}; };
static const struct pinmux_cfg_reg pinmux_config_regs[] = { static const struct pinmux_cfg_reg pinmux_config_regs[] = {
...@@ -5736,6 +5750,29 @@ static const struct sh_pfc_soc_operations r8a7790_pinmux_ops = { ...@@ -5736,6 +5750,29 @@ static const struct sh_pfc_soc_operations r8a7790_pinmux_ops = {
.pin_to_pocctrl = r8a7790_pin_to_pocctrl, .pin_to_pocctrl = r8a7790_pin_to_pocctrl,
}; };
#ifdef CONFIG_PINCTRL_PFC_R8A7742
const struct sh_pfc_soc_info r8a7742_pinmux_info = {
.name = "r8a77420_pfc",
.ops = &r8a7790_pinmux_ops,
.unlock_reg = 0xe6060000, /* PMMR */
.function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
.pins = pinmux_pins,
.nr_pins = ARRAY_SIZE(pinmux_pins),
.groups = pinmux_groups.common,
.nr_groups = ARRAY_SIZE(pinmux_groups.common),
.functions = pinmux_functions.common,
.nr_functions = ARRAY_SIZE(pinmux_functions.common),
.cfg_regs = pinmux_config_regs,
.pinmux_data = pinmux_data,
.pinmux_data_size = ARRAY_SIZE(pinmux_data),
};
#endif
#ifdef CONFIG_PINCTRL_PFC_R8A7790
const struct sh_pfc_soc_info r8a7790_pinmux_info = { const struct sh_pfc_soc_info r8a7790_pinmux_info = {
.name = "r8a77900_pfc", .name = "r8a77900_pfc",
.ops = &r8a7790_pinmux_ops, .ops = &r8a7790_pinmux_ops,
...@@ -5745,13 +5782,16 @@ const struct sh_pfc_soc_info r8a7790_pinmux_info = { ...@@ -5745,13 +5782,16 @@ const struct sh_pfc_soc_info r8a7790_pinmux_info = {
.pins = pinmux_pins, .pins = pinmux_pins,
.nr_pins = ARRAY_SIZE(pinmux_pins), .nr_pins = ARRAY_SIZE(pinmux_pins),
.groups = pinmux_groups, .groups = pinmux_groups.common,
.nr_groups = ARRAY_SIZE(pinmux_groups), .nr_groups = ARRAY_SIZE(pinmux_groups.common) +
.functions = pinmux_functions, ARRAY_SIZE(pinmux_groups.automotive),
.nr_functions = ARRAY_SIZE(pinmux_functions), .functions = pinmux_functions.common,
.nr_functions = ARRAY_SIZE(pinmux_functions.common) +
ARRAY_SIZE(pinmux_functions.automotive),
.cfg_regs = pinmux_config_regs, .cfg_regs = pinmux_config_regs,
.pinmux_data = pinmux_data, .pinmux_data = pinmux_data,
.pinmux_data_size = ARRAY_SIZE(pinmux_data), .pinmux_data_size = ARRAY_SIZE(pinmux_data),
}; };
#endif
...@@ -304,6 +304,7 @@ struct sh_pfc_soc_info { ...@@ -304,6 +304,7 @@ struct sh_pfc_soc_info {
extern const struct sh_pfc_soc_info emev2_pinmux_info; extern const struct sh_pfc_soc_info emev2_pinmux_info;
extern const struct sh_pfc_soc_info r8a73a4_pinmux_info; extern const struct sh_pfc_soc_info r8a73a4_pinmux_info;
extern const struct sh_pfc_soc_info r8a7740_pinmux_info; extern const struct sh_pfc_soc_info r8a7740_pinmux_info;
extern const struct sh_pfc_soc_info r8a7742_pinmux_info;
extern const struct sh_pfc_soc_info r8a7743_pinmux_info; extern const struct sh_pfc_soc_info r8a7743_pinmux_info;
extern const struct sh_pfc_soc_info r8a7744_pinmux_info; extern const struct sh_pfc_soc_info r8a7744_pinmux_info;
extern const struct sh_pfc_soc_info r8a7745_pinmux_info; extern const struct sh_pfc_soc_info r8a7745_pinmux_info;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment