]> git.ipfire.org Git - people/ms/linux.git/commitdiff
Merge tag 'reset-fixes-for-v6.0' of git://git.pengutronix.de/pza/linux into arm/fixes
authorArnd Bergmann <arnd@arndb.de>
Fri, 23 Sep 2022 15:45:13 +0000 (17:45 +0200)
committerArnd Bergmann <arnd@arndb.de>
Fri, 23 Sep 2022 15:45:14 +0000 (17:45 +0200)
Reset controller fixes for v6.0

Fix the i.MX8MP PCIe PHY PERST bit polarity, issue the Sparx5 "switch"
reset (which turned out to be a rather more global reset) early on
startup, stubbing out the reset controller driver, and fix the NPCM8XX
USB reset sequence by setting IPSRST4 bits in the correct register.

* tag 'reset-fixes-for-v6.0' of git://git.pengutronix.de/pza/linux:
  reset: npcm: fix iprst2 and iprst4 setting
  reset: microchip-sparx5: issue a reset on startup
  reset: imx7: Fix the iMX8MP PCIe PHY PERST support

Link: https://lore.kernel.org/r/20220923143519.41735-1-p.zabel@pengutronix.de
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/reset/reset-imx7.c
drivers/reset/reset-microchip-sparx5.c
drivers/reset/reset-npcm.c

index 185a333df66c55286cf69b329420db30956f7239..d2408725eb2c3c1376d125ae69650206e5978456 100644 (file)
@@ -329,6 +329,7 @@ static int imx8mp_reset_set(struct reset_controller_dev *rcdev,
                break;
 
        case IMX8MP_RESET_PCIE_CTRL_APPS_EN:
+       case IMX8MP_RESET_PCIEPHY_PERST:
                value = assert ? 0 : bit;
                break;
        }
index 00b612a0effa11729c6c71c4165385a769f09cee..f3528dd1d084ea6b8da57120d0b4294011d9696e 100644 (file)
@@ -33,11 +33,8 @@ static struct regmap_config sparx5_reset_regmap_config = {
        .reg_stride     = 4,
 };
 
-static int sparx5_switch_reset(struct reset_controller_dev *rcdev,
-                              unsigned long id)
+static int sparx5_switch_reset(struct mchp_reset_context *ctx)
 {
-       struct mchp_reset_context *ctx =
-               container_of(rcdev, struct mchp_reset_context, rcdev);
        u32 val;
 
        /* Make sure the core is PROTECTED from reset */
@@ -54,8 +51,14 @@ static int sparx5_switch_reset(struct reset_controller_dev *rcdev,
                                        1, 100);
 }
 
+static int sparx5_reset_noop(struct reset_controller_dev *rcdev,
+                            unsigned long id)
+{
+       return 0;
+}
+
 static const struct reset_control_ops sparx5_reset_ops = {
-       .reset = sparx5_switch_reset,
+       .reset = sparx5_reset_noop,
 };
 
 static int mchp_sparx5_map_syscon(struct platform_device *pdev, char *name,
@@ -122,6 +125,11 @@ static int mchp_sparx5_reset_probe(struct platform_device *pdev)
        ctx->rcdev.of_node = dn;
        ctx->props = device_get_match_data(&pdev->dev);
 
+       /* Issue the reset very early, our actual reset callback is a noop. */
+       err = sparx5_switch_reset(ctx);
+       if (err)
+               return err;
+
        return devm_reset_controller_register(&pdev->dev, &ctx->rcdev);
 }
 
@@ -163,6 +171,10 @@ static int __init mchp_sparx5_reset_init(void)
        return platform_driver_register(&mchp_sparx5_reset_driver);
 }
 
+/*
+ * Because this is a global reset, keep this postcore_initcall() to issue the
+ * reset as early as possible during the kernel startup.
+ */
 postcore_initcall(mchp_sparx5_reset_init);
 
 MODULE_DESCRIPTION("Microchip Sparx5 switch reset driver");
index 24c55efa98e556c4e81fbd227b383c2f85de679c..f2333506b0a670de941d50e278269459b69ca1f4 100644 (file)
@@ -291,7 +291,7 @@ static void npcm_usb_reset_npcm8xx(struct npcm_rc_data *rc)
        iprst2 |= ipsrst2_bits;
        iprst3 |= (ipsrst3_bits | NPCM_IPSRST3_USBPHY1 |
                   NPCM_IPSRST3_USBPHY2);
-       iprst2 |= ipsrst4_bits;
+       iprst4 |= ipsrst4_bits;
 
        writel(iprst1, rc->base + NPCM_IPSRST1);
        writel(iprst2, rc->base + NPCM_IPSRST2);