pinctrl: renesas: Add TDSEL fixup for H2/E2 ES1.0 SoCs
authorMarek Vasut <marek.vasut+renesas@gmail.com>
Mon, 4 Mar 2019 21:29:30 +0000 (22:29 +0100)
committerMarek Vasut <marex@denx.de>
Tue, 9 Apr 2019 16:19:10 +0000 (18:19 +0200)
Linux 5.0, commit 1c163f4c7b3f621efff9b28a47abb36f7378d783,
has a TDSEL fix for R8A7790 H2 and R8A7794 E2 SoCs, implement
similar fix for U-Boot. The difference here is that the SoC
ES matching has to be implemented manually.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
drivers/pinctrl/renesas/pfc-r8a7790.c
drivers/pinctrl/renesas/pfc-r8a7794.c

index ad492b5..ef23ca2 100644 (file)
@@ -5694,7 +5694,18 @@ static int r8a7790_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin, u32 *poc
        return 31 - (pin & 0x1f);
 }
 
+static int r8a7790_pinmux_soc_init(struct sh_pfc *pfc)
+{
+       /* Initialize TDSEL on old revisions */
+       if ((rmobile_get_cpu_rev_integer() == 1) &&
+           (rmobile_get_cpu_rev_fraction() == 0))
+               sh_pfc_write(pfc, 0xe6060088, 0x00155554);
+
+       return 0;
+}
+
 static const struct sh_pfc_soc_operations r8a7790_pinmux_ops = {
+       .init = r8a7790_pinmux_soc_init,
        .pin_to_pocctrl = r8a7790_pin_to_pocctrl,
 };
 
index 7264c70..079f443 100644 (file)
@@ -5563,7 +5563,18 @@ static int r8a7794_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin, u32 *poc
        return -EINVAL;
 }
 
+static int r8a7794_pinmux_soc_init(struct sh_pfc *pfc)
+{
+       /* Initialize TDSEL on old revisions */
+       if ((rmobile_get_cpu_rev_integer() == 1) &&
+           (rmobile_get_cpu_rev_fraction() == 0))
+               sh_pfc_write(pfc, 0xe6060068, 0x55555500);
+
+       return 0;
+}
+
 static const struct sh_pfc_soc_operations r8a7794_pinmux_ops = {
+       .init = r8a7794_pinmux_soc_init,
        .pin_to_pocctrl = r8a7794_pin_to_pocctrl,
 };