Commit 271ff378 authored by Biju Das's avatar Biju Das Committed by Geert Uytterhoeven
Browse files

pinctrl: sh-pfc: r8a77965: Add R8A774B1 PFC support



Renesas RZ/G2N (r8a774b1) is pin compatible with R-Car M3-N (r8a77965),
however it doesn't have several automotive specific peripherals. Add
a r8a77965 specific pin groups/functions along with common pin
groups/functions for supporting both r8a77965 and r8a774b1 SoC.

Signed-off-by: default avatarBiju Das <biju.das@bp.renesas.com>
Link: https://lore.kernel.org/r/1568881036-4404-9-git-send-email-biju.das@bp.renesas.com


Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
parent 887047c3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ config PINCTRL_SH_PFC
	select PINCTRL_PFC_R8A7745 if ARCH_R8A7745
	select PINCTRL_PFC_R8A77470 if ARCH_R8A77470
	select PINCTRL_PFC_R8A774A1 if ARCH_R8A774A1
	select PINCTRL_PFC_R8A774B1 if ARCH_R8A774B1
	select PINCTRL_PFC_R8A774C0 if ARCH_R8A774C0
	select PINCTRL_PFC_R8A7778 if ARCH_R8A7778
	select PINCTRL_PFC_R8A7779 if ARCH_R8A7779
@@ -86,6 +87,9 @@ config PINCTRL_PFC_R8A77470
config PINCTRL_PFC_R8A774A1
	bool "RZ/G2M pin control support" if COMPILE_TEST

config PINCTRL_PFC_R8A774B1
	bool "RZ/G2N pin control support" if COMPILE_TEST

config PINCTRL_PFC_R8A774C0
	bool "RZ/G2E pin control support" if COMPILE_TEST

+1 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ obj-$(CONFIG_PINCTRL_PFC_R8A7744) += pfc-r8a7791.o
obj-$(CONFIG_PINCTRL_PFC_R8A7745)	+= pfc-r8a7794.o
obj-$(CONFIG_PINCTRL_PFC_R8A77470)	+= pfc-r8a77470.o
obj-$(CONFIG_PINCTRL_PFC_R8A774A1)	+= pfc-r8a7796.o
obj-$(CONFIG_PINCTRL_PFC_R8A774B1)	+= pfc-r8a77965.o
obj-$(CONFIG_PINCTRL_PFC_R8A774C0)	+= pfc-r8a77990.o
obj-$(CONFIG_PINCTRL_PFC_R8A7778)	+= pfc-r8a7778.o
obj-$(CONFIG_PINCTRL_PFC_R8A7779)	+= pfc-r8a7779.o
+6 −0
Original line number Diff line number Diff line
@@ -518,6 +518,12 @@ static const struct of_device_id sh_pfc_of_table[] = {
		.data = &r8a774a1_pinmux_info,
	},
#endif
#ifdef CONFIG_PINCTRL_PFC_R8A774B1
	{
		.compatible = "renesas,pfc-r8a774b1",
		.data = &r8a774b1_pinmux_info,
	},
#endif
#ifdef CONFIG_PINCTRL_PFC_R8A774C0
	{
		.compatible = "renesas,pfc-r8a774c0",
+452 −409
Original line number Diff line number Diff line
@@ -4378,7 +4378,11 @@ static const unsigned int vin5_clk_mux[] = {
	VI5_CLK_MARK,
};

static const struct sh_pfc_pin_group pinmux_groups[] = {
static const struct {
	struct sh_pfc_pin_group common[318];
	struct sh_pfc_pin_group automotive[30];
} pinmux_groups = {
	.common = {
		SH_PFC_PIN_GROUP(audio_clk_a_a),
		SH_PFC_PIN_GROUP(audio_clk_a_b),
		SH_PFC_PIN_GROUP(audio_clk_a_c),
@@ -4414,36 +4418,6 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
		SH_PFC_PIN_GROUP(canfd0_data_a),
		SH_PFC_PIN_GROUP(canfd0_data_b),
		SH_PFC_PIN_GROUP(canfd1_data),
	SH_PFC_PIN_GROUP(drif0_ctrl_a),
	SH_PFC_PIN_GROUP(drif0_data0_a),
	SH_PFC_PIN_GROUP(drif0_data1_a),
	SH_PFC_PIN_GROUP(drif0_ctrl_b),
	SH_PFC_PIN_GROUP(drif0_data0_b),
	SH_PFC_PIN_GROUP(drif0_data1_b),
	SH_PFC_PIN_GROUP(drif0_ctrl_c),
	SH_PFC_PIN_GROUP(drif0_data0_c),
	SH_PFC_PIN_GROUP(drif0_data1_c),
	SH_PFC_PIN_GROUP(drif1_ctrl_a),
	SH_PFC_PIN_GROUP(drif1_data0_a),
	SH_PFC_PIN_GROUP(drif1_data1_a),
	SH_PFC_PIN_GROUP(drif1_ctrl_b),
	SH_PFC_PIN_GROUP(drif1_data0_b),
	SH_PFC_PIN_GROUP(drif1_data1_b),
	SH_PFC_PIN_GROUP(drif1_ctrl_c),
	SH_PFC_PIN_GROUP(drif1_data0_c),
	SH_PFC_PIN_GROUP(drif1_data1_c),
	SH_PFC_PIN_GROUP(drif2_ctrl_a),
	SH_PFC_PIN_GROUP(drif2_data0_a),
	SH_PFC_PIN_GROUP(drif2_data1_a),
	SH_PFC_PIN_GROUP(drif2_ctrl_b),
	SH_PFC_PIN_GROUP(drif2_data0_b),
	SH_PFC_PIN_GROUP(drif2_data1_b),
	SH_PFC_PIN_GROUP(drif3_ctrl_a),
	SH_PFC_PIN_GROUP(drif3_data0_a),
	SH_PFC_PIN_GROUP(drif3_data1_a),
	SH_PFC_PIN_GROUP(drif3_ctrl_b),
	SH_PFC_PIN_GROUP(drif3_data0_b),
	SH_PFC_PIN_GROUP(drif3_data1_b),
		SH_PFC_PIN_GROUP(du_rgb666),
		SH_PFC_PIN_GROUP(du_rgb888),
		SH_PFC_PIN_GROUP(du_clk_out_0),
@@ -4727,6 +4701,39 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
		SH_PFC_PIN_GROUP(vin5_field),
		SH_PFC_PIN_GROUP(vin5_clkenb),
		SH_PFC_PIN_GROUP(vin5_clk),
	},
	.automotive = {
		SH_PFC_PIN_GROUP(drif0_ctrl_a),
		SH_PFC_PIN_GROUP(drif0_data0_a),
		SH_PFC_PIN_GROUP(drif0_data1_a),
		SH_PFC_PIN_GROUP(drif0_ctrl_b),
		SH_PFC_PIN_GROUP(drif0_data0_b),
		SH_PFC_PIN_GROUP(drif0_data1_b),
		SH_PFC_PIN_GROUP(drif0_ctrl_c),
		SH_PFC_PIN_GROUP(drif0_data0_c),
		SH_PFC_PIN_GROUP(drif0_data1_c),
		SH_PFC_PIN_GROUP(drif1_ctrl_a),
		SH_PFC_PIN_GROUP(drif1_data0_a),
		SH_PFC_PIN_GROUP(drif1_data1_a),
		SH_PFC_PIN_GROUP(drif1_ctrl_b),
		SH_PFC_PIN_GROUP(drif1_data0_b),
		SH_PFC_PIN_GROUP(drif1_data1_b),
		SH_PFC_PIN_GROUP(drif1_ctrl_c),
		SH_PFC_PIN_GROUP(drif1_data0_c),
		SH_PFC_PIN_GROUP(drif1_data1_c),
		SH_PFC_PIN_GROUP(drif2_ctrl_a),
		SH_PFC_PIN_GROUP(drif2_data0_a),
		SH_PFC_PIN_GROUP(drif2_data1_a),
		SH_PFC_PIN_GROUP(drif2_ctrl_b),
		SH_PFC_PIN_GROUP(drif2_data0_b),
		SH_PFC_PIN_GROUP(drif2_data1_b),
		SH_PFC_PIN_GROUP(drif3_ctrl_a),
		SH_PFC_PIN_GROUP(drif3_data0_a),
		SH_PFC_PIN_GROUP(drif3_data1_a),
		SH_PFC_PIN_GROUP(drif3_ctrl_b),
		SH_PFC_PIN_GROUP(drif3_data0_b),
		SH_PFC_PIN_GROUP(drif3_data1_b),
	}
};

static const char * const audio_clk_groups[] = {
@@ -5241,7 +5248,11 @@ static const char * const vin5_groups[] = {
	"vin5_clk",
};

static const struct sh_pfc_function pinmux_functions[] = {
static const struct {
	struct sh_pfc_function common[51];
	struct sh_pfc_function automotive[4];
} pinmux_functions = {
	.common = {
		SH_PFC_FUNCTION(audio_clk),
		SH_PFC_FUNCTION(avb),
		SH_PFC_FUNCTION(can0),
@@ -5249,10 +5260,6 @@ static const struct sh_pfc_function pinmux_functions[] = {
		SH_PFC_FUNCTION(can_clk),
		SH_PFC_FUNCTION(canfd0),
		SH_PFC_FUNCTION(canfd1),
	SH_PFC_FUNCTION(drif0),
	SH_PFC_FUNCTION(drif1),
	SH_PFC_FUNCTION(drif2),
	SH_PFC_FUNCTION(drif3),
		SH_PFC_FUNCTION(du),
		SH_PFC_FUNCTION(hscif0),
		SH_PFC_FUNCTION(hscif1),
@@ -5297,6 +5304,13 @@ static const struct sh_pfc_function pinmux_functions[] = {
		SH_PFC_FUNCTION(usb30),
		SH_PFC_FUNCTION(vin4),
		SH_PFC_FUNCTION(vin5),
	},
	.automotive = {
		SH_PFC_FUNCTION(drif0),
		SH_PFC_FUNCTION(drif1),
		SH_PFC_FUNCTION(drif2),
		SH_PFC_FUNCTION(drif3),
	}
};

static const struct pinmux_cfg_reg pinmux_config_regs[] = {
@@ -6425,6 +6439,32 @@ static const struct sh_pfc_soc_operations r8a77965_pinmux_ops = {
	.set_bias = r8a77965_pinmux_set_bias,
};

#ifdef CONFIG_PINCTRL_PFC_R8A774B1
const struct sh_pfc_soc_info r8a774b1_pinmux_info = {
	.name = "r8a774b1_pfc",
	.ops = &r8a77965_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,
	.drive_regs = pinmux_drive_regs,
	.bias_regs = pinmux_bias_regs,
	.ioctrl_regs = pinmux_ioctrl_regs,

	.pinmux_data = pinmux_data,
	.pinmux_data_size = ARRAY_SIZE(pinmux_data),
};
#endif

#ifdef CONFIG_PINCTRL_PFC_R8A77965
const struct sh_pfc_soc_info r8a77965_pinmux_info = {
	.name = "r8a77965_pfc",
	.ops = &r8a77965_pinmux_ops,
@@ -6434,10 +6474,12 @@ const struct sh_pfc_soc_info r8a77965_pinmux_info = {

	.pins = pinmux_pins,
	.nr_pins = ARRAY_SIZE(pinmux_pins),
	.groups = pinmux_groups,
	.nr_groups = ARRAY_SIZE(pinmux_groups),
	.functions = pinmux_functions,
	.nr_functions = ARRAY_SIZE(pinmux_functions),
	.groups = pinmux_groups.common,
	.nr_groups = ARRAY_SIZE(pinmux_groups.common) +
		ARRAY_SIZE(pinmux_groups.automotive),
	.functions = pinmux_functions.common,
	.nr_functions = ARRAY_SIZE(pinmux_functions.common) +
		ARRAY_SIZE(pinmux_functions.automotive),

	.cfg_regs = pinmux_config_regs,
	.drive_regs = pinmux_drive_regs,
@@ -6447,3 +6489,4 @@ const struct sh_pfc_soc_info r8a77965_pinmux_info = {
	.pinmux_data = pinmux_data,
	.pinmux_data_size = ARRAY_SIZE(pinmux_data),
};
#endif
+1 −0
Original line number Diff line number Diff line
@@ -309,6 +309,7 @@ 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 r8a77470_pinmux_info;
extern const struct sh_pfc_soc_info r8a774a1_pinmux_info;
extern const struct sh_pfc_soc_info r8a774b1_pinmux_info;
extern const struct sh_pfc_soc_info r8a774c0_pinmux_info;
extern const struct sh_pfc_soc_info r8a7778_pinmux_info;
extern const struct sh_pfc_soc_info r8a7779_pinmux_info;