mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-09-29 17:51:26 +02:00
pinctrl: renesas: r8a77951: Add R8A774E1 PFC support
Renesas RZ/G2H (r8a774e1) is pin compatible with R-Car H3 (r8a77951), however it doesn't have several automotive specific peripherals. Add a r8a77951 specific pin groups/functions along with common pin groups/functions for supporting both r8a77951 and r8a774e1 SoC. PFC changes are synced from mainline linux-5.9 commit bbf5c979011a ("Linux 5.9"). Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
This commit is contained in:
parent
c5f3762588
commit
975154bc2c
@ -17,6 +17,7 @@ config R8A774C0
|
||||
config R8A774E1
|
||||
bool "Renesas SoC R8A774E1"
|
||||
imply CLK_R8A774E1
|
||||
imply PINCTRL_PFC_R8A774E1
|
||||
|
||||
config R8A7795
|
||||
bool "Renesas SoC R8A7795"
|
||||
|
@ -77,6 +77,16 @@ config PINCTRL_PFC_R8A774B1
|
||||
the GPIO definitions and pin control functions for each available
|
||||
multiplex function.
|
||||
|
||||
config PINCTRL_PFC_R8A774E1
|
||||
bool "Renesas RZ/G2 R8A774E1 pin control driver"
|
||||
depends on PINCTRL_PFC
|
||||
help
|
||||
Support pin multiplexing control on Renesas RZ/G2H R8A774E1 SoCs.
|
||||
|
||||
The driver is controlled by a device tree node which contains both
|
||||
the GPIO definitions and pin control functions for each available
|
||||
multiplex function.
|
||||
|
||||
config PINCTRL_PFC_R8A7795
|
||||
bool "Renesas RCar Gen3 R8A7795 pin control driver"
|
||||
depends on PINCTRL_PFC
|
||||
|
@ -1,6 +1,7 @@
|
||||
obj-$(CONFIG_PINCTRL_PFC) += pfc.o
|
||||
obj-$(CONFIG_PINCTRL_PFC_R8A774A1) += pfc-r8a7796.o
|
||||
obj-$(CONFIG_PINCTRL_PFC_R8A774B1) += pfc-r8a77965.o
|
||||
obj-$(CONFIG_PINCTRL_PFC_R8A774E1) += pfc-r8a7795.o
|
||||
obj-$(CONFIG_PINCTRL_PFC_R8A7790) += pfc-r8a7790.o
|
||||
obj-$(CONFIG_PINCTRL_PFC_R8A7791) += pfc-r8a7791.o
|
||||
obj-$(CONFIG_PINCTRL_PFC_R8A7792) += pfc-r8a7792.o
|
||||
|
@ -683,7 +683,7 @@ static const u16 pinmux_data[] = {
|
||||
PINMUX_IPSR_PHYS_MSEL(IP1_23_20, HRX3_D, I2C_SEL_3_0, SEL_HSCIF3_3),
|
||||
PINMUX_IPSR_PHYS_MSEL(IP1_23_20, VI4_DATA7_B, I2C_SEL_3_0, SEL_VIN4_1),
|
||||
PINMUX_IPSR_PHYS_MSEL(IP1_23_20, IERX_B, I2C_SEL_3_0, SEL_IEBUS_1),
|
||||
PINMUX_IPSR_PHYS(IP0_23_20, SCL3, I2C_SEL_3_1),
|
||||
PINMUX_IPSR_PHYS(IP1_23_20, SCL3, I2C_SEL_3_1),
|
||||
|
||||
PINMUX_IPSR_PHYS_MSEL(IP1_27_24, PWM2_A, I2C_SEL_3_0, SEL_PWM2_0),
|
||||
PINMUX_IPSR_PHYS_MSEL(IP1_27_24, HTX3_D, I2C_SEL_3_0, SEL_HSCIF3_3),
|
||||
@ -3902,6 +3902,36 @@ static const unsigned int tmu_tclk2_b_mux[] = {
|
||||
TCLK2_B_MARK,
|
||||
};
|
||||
|
||||
/* - TPU ------------------------------------------------------------------- */
|
||||
static const unsigned int tpu_to0_pins[] = {
|
||||
/* TPU0TO0 */
|
||||
RCAR_GP_PIN(6, 28),
|
||||
};
|
||||
static const unsigned int tpu_to0_mux[] = {
|
||||
TPU0TO0_MARK,
|
||||
};
|
||||
static const unsigned int tpu_to1_pins[] = {
|
||||
/* TPU0TO1 */
|
||||
RCAR_GP_PIN(6, 29),
|
||||
};
|
||||
static const unsigned int tpu_to1_mux[] = {
|
||||
TPU0TO1_MARK,
|
||||
};
|
||||
static const unsigned int tpu_to2_pins[] = {
|
||||
/* TPU0TO2 */
|
||||
RCAR_GP_PIN(6, 30),
|
||||
};
|
||||
static const unsigned int tpu_to2_mux[] = {
|
||||
TPU0TO2_MARK,
|
||||
};
|
||||
static const unsigned int tpu_to3_pins[] = {
|
||||
/* TPU0TO3 */
|
||||
RCAR_GP_PIN(6, 31),
|
||||
};
|
||||
static const unsigned int tpu_to3_mux[] = {
|
||||
TPU0TO3_MARK,
|
||||
};
|
||||
|
||||
/* - USB0 ------------------------------------------------------------------- */
|
||||
static const unsigned int usb0_pins[] = {
|
||||
/* PWEN, OVC */
|
||||
@ -4136,7 +4166,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[320];
|
||||
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),
|
||||
@ -4172,36 +4206,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),
|
||||
@ -4452,6 +4456,10 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
|
||||
SH_PFC_PIN_GROUP(tmu_tclk1_b),
|
||||
SH_PFC_PIN_GROUP(tmu_tclk2_a),
|
||||
SH_PFC_PIN_GROUP(tmu_tclk2_b),
|
||||
SH_PFC_PIN_GROUP(tpu_to0),
|
||||
SH_PFC_PIN_GROUP(tpu_to1),
|
||||
SH_PFC_PIN_GROUP(tpu_to2),
|
||||
SH_PFC_PIN_GROUP(tpu_to3),
|
||||
SH_PFC_PIN_GROUP(usb0),
|
||||
SH_PFC_PIN_GROUP(usb1),
|
||||
SH_PFC_PIN_GROUP(usb2),
|
||||
@ -4483,6 +4491,40 @@ 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[] = {
|
||||
@ -4947,6 +4989,13 @@ static const char * const tmu_groups[] = {
|
||||
"tmu_tclk2_b",
|
||||
};
|
||||
|
||||
static const char * const tpu_groups[] = {
|
||||
"tpu_to0",
|
||||
"tpu_to1",
|
||||
"tpu_to2",
|
||||
"tpu_to3",
|
||||
};
|
||||
|
||||
static const char * const usb0_groups[] = {
|
||||
"usb0",
|
||||
};
|
||||
@ -4999,7 +5048,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[53];
|
||||
struct sh_pfc_function automotive[4];
|
||||
} pinmux_functions = {
|
||||
.common = {
|
||||
SH_PFC_FUNCTION(audio_clk),
|
||||
SH_PFC_FUNCTION(avb),
|
||||
SH_PFC_FUNCTION(can0),
|
||||
@ -5007,10 +5060,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),
|
||||
@ -5049,6 +5098,7 @@ static const struct sh_pfc_function pinmux_functions[] = {
|
||||
SH_PFC_FUNCTION(sdhi3),
|
||||
SH_PFC_FUNCTION(ssi),
|
||||
SH_PFC_FUNCTION(tmu),
|
||||
SH_PFC_FUNCTION(tpu),
|
||||
SH_PFC_FUNCTION(usb0),
|
||||
SH_PFC_FUNCTION(usb1),
|
||||
SH_PFC_FUNCTION(usb2),
|
||||
@ -5056,6 +5106,14 @@ 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[] = {
|
||||
@ -6186,8 +6244,9 @@ static const struct sh_pfc_soc_operations r8a7795_pinmux_ops = {
|
||||
.set_bias = r8a7795_pinmux_set_bias,
|
||||
};
|
||||
|
||||
const struct sh_pfc_soc_info r8a7795_pinmux_info = {
|
||||
.name = "r8a77951_pfc",
|
||||
#ifdef CONFIG_PINCTRL_PFC_R8A774E1
|
||||
const struct sh_pfc_soc_info r8a774e1_pinmux_info = {
|
||||
.name = "r8a774e1_pfc",
|
||||
.ops = &r8a7795_pinmux_ops,
|
||||
.unlock_reg = 0xe6060000, /* PMMR */
|
||||
|
||||
@ -6195,10 +6254,10 @@ const struct sh_pfc_soc_info r8a7795_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),
|
||||
.functions = pinmux_functions.common,
|
||||
.nr_functions = ARRAY_SIZE(pinmux_functions.common),
|
||||
|
||||
.cfg_regs = pinmux_config_regs,
|
||||
.drive_regs = pinmux_drive_regs,
|
||||
@ -6208,3 +6267,31 @@ const struct sh_pfc_soc_info r8a7795_pinmux_info = {
|
||||
.pinmux_data = pinmux_data,
|
||||
.pinmux_data_size = ARRAY_SIZE(pinmux_data),
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PINCTRL_PFC_R8A7795
|
||||
const struct sh_pfc_soc_info r8a7795_pinmux_info = {
|
||||
.name = "r8a77951_pfc",
|
||||
.ops = &r8a7795_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) +
|
||||
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,
|
||||
.bias_regs = pinmux_bias_regs,
|
||||
.ioctrl_regs = pinmux_ioctrl_regs,
|
||||
|
||||
.pinmux_data = pinmux_data,
|
||||
.pinmux_data_size = ARRAY_SIZE(pinmux_data),
|
||||
};
|
||||
#endif
|
||||
|
@ -34,6 +34,7 @@ enum sh_pfc_model {
|
||||
SH_PFC_R8A7796,
|
||||
SH_PFC_R8A774A1,
|
||||
SH_PFC_R8A774B1,
|
||||
SH_PFC_R8A774E1,
|
||||
SH_PFC_R8A77965,
|
||||
SH_PFC_R8A77970,
|
||||
SH_PFC_R8A77980,
|
||||
@ -863,6 +864,10 @@ static int sh_pfc_pinctrl_probe(struct udevice *dev)
|
||||
if (model == SH_PFC_R8A774B1)
|
||||
priv->pfc.info = &r8a774b1_pinmux_info;
|
||||
#endif
|
||||
#ifdef CONFIG_PINCTRL_PFC_R8A774E1
|
||||
if (model == SH_PFC_R8A774E1)
|
||||
priv->pfc.info = &r8a774e1_pinmux_info;
|
||||
#endif
|
||||
#ifdef CONFIG_PINCTRL_PFC_R8A77965
|
||||
if (model == SH_PFC_R8A77965)
|
||||
priv->pfc.info = &r8a77965_pinmux_info;
|
||||
@ -946,6 +951,12 @@ static const struct udevice_id sh_pfc_pinctrl_ids[] = {
|
||||
.data = SH_PFC_R8A774B1,
|
||||
},
|
||||
#endif
|
||||
#ifdef CONFIG_PINCTRL_PFC_R8A774E1
|
||||
{
|
||||
.compatible = "renesas,pfc-r8a774e1",
|
||||
.data = SH_PFC_R8A774E1,
|
||||
},
|
||||
#endif
|
||||
#ifdef CONFIG_PINCTRL_PFC_R8A77965
|
||||
{
|
||||
.compatible = "renesas,pfc-r8a77965",
|
||||
|
@ -295,6 +295,7 @@ sh_pfc_pin_to_bias_reg(const struct sh_pfc *pfc, unsigned int pin,
|
||||
|
||||
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 r8a774e1_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 r8a7792_pinmux_info;
|
||||
|
Loading…
x
Reference in New Issue
Block a user