Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'reset-for-v5.16' of git://git.pengutronix.de/pza/linux into arm/drivers

Reset controller updates for v5.16

Allow building the reset-brcmstb-rescal driver as module, add reset
lines for the Uniphier PXs3 audio and video input subsystems and
bindings for the Uniphier NX1 SoC, and add lan966x switch reset support
to the reset-microchip-sparx5 driver.

* tag 'reset-for-v5.16' of git://git.pengutronix.de/pza/linux:
reset: mchp: sparx5: Extend support for lan966x
dt-bindings: reset: Add lan966x support
reset: uniphier: Add NX1 reset support
dt-bindings: reset: uniphier: Add NX1 reset control binding
reset: uniphier: Add audio system and video input reset control for PXs3
reset: Allow building Broadcom STB RESCAL as module

Link: https://lore.kernel.org/r/96e686f78f0e42bad666df5ec0cbcb2dcdc270a3.camel@pengutronix.de
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+72 -11
+3 -1
Documentation/devicetree/bindings/reset/microchip,rst.yaml
··· 20 20 pattern: "^reset-controller@[0-9a-f]+$" 21 21 22 22 compatible: 23 - const: microchip,sparx5-switch-reset 23 + enum: 24 + - microchip,sparx5-switch-reset 25 + - microchip,lan966x-switch-reset 24 26 25 27 reg: 26 28 items:
+1
Documentation/devicetree/bindings/reset/socionext,uniphier-glue-reset.yaml
··· 23 23 - socionext,uniphier-pxs2-usb3-reset 24 24 - socionext,uniphier-ld20-usb3-reset 25 25 - socionext,uniphier-pxs3-usb3-reset 26 + - socionext,uniphier-nx1-usb3-reset 26 27 - socionext,uniphier-pro4-ahci-reset 27 28 - socionext,uniphier-pxs2-ahci-reset 28 29 - socionext,uniphier-pxs3-ahci-reset
+3
Documentation/devicetree/bindings/reset/socionext,uniphier-reset.yaml
··· 23 23 - socionext,uniphier-ld11-reset 24 24 - socionext,uniphier-ld20-reset 25 25 - socionext,uniphier-pxs3-reset 26 + - socionext,uniphier-nx1-reset 26 27 - description: Media I/O (MIO) reset, SD reset 27 28 enum: 28 29 - socionext,uniphier-ld4-mio-reset ··· 35 34 - socionext,uniphier-ld11-sd-reset 36 35 - socionext,uniphier-ld20-sd-reset 37 36 - socionext,uniphier-pxs3-sd-reset 37 + - socionext,uniphier-nx1-sd-reset 38 38 - description: Peripheral reset 39 39 enum: 40 40 - socionext,uniphier-ld4-peri-reset ··· 46 44 - socionext,uniphier-ld11-peri-reset 47 45 - socionext,uniphier-ld20-peri-reset 48 46 - socionext,uniphier-pxs3-peri-reset 47 + - socionext,uniphier-nx1-peri-reset 49 48 - description: Analog signal amplifier reset 50 49 enum: 51 50 - socionext,uniphier-ld11-adamv-reset
+2 -2
drivers/reset/Kconfig
··· 58 58 a SUN_TOP_CTRL_SW_INIT style controller. 59 59 60 60 config RESET_BRCMSTB_RESCAL 61 - bool "Broadcom STB RESCAL reset controller" 61 + tristate "Broadcom STB RESCAL reset controller" 62 62 depends on HAS_IOMEM 63 63 depends on ARCH_BRCMSTB || COMPILE_TEST 64 64 default ARCH_BRCMSTB ··· 116 116 117 117 config RESET_MCHP_SPARX5 118 118 bool "Microchip Sparx5 reset driver" 119 - depends on ARCH_SPARX5 || COMPILE_TEST 119 + depends on ARCH_SPARX5 || SOC_LAN966 || COMPILE_TEST 120 120 default y if SPARX5_SWITCH 121 121 select MFD_SYSCON 122 122 help
+32 -8
drivers/reset/reset-microchip-sparx5.c
··· 13 13 #include <linux/regmap.h> 14 14 #include <linux/reset-controller.h> 15 15 16 - #define PROTECT_REG 0x84 17 - #define PROTECT_BIT BIT(10) 18 - #define SOFT_RESET_REG 0x00 19 - #define SOFT_RESET_BIT BIT(1) 16 + struct reset_props { 17 + u32 protect_reg; 18 + u32 protect_bit; 19 + u32 reset_reg; 20 + u32 reset_bit; 21 + }; 20 22 21 23 struct mchp_reset_context { 22 24 struct regmap *cpu_ctrl; 23 25 struct regmap *gcb_ctrl; 24 26 struct reset_controller_dev rcdev; 27 + const struct reset_props *props; 25 28 }; 26 29 27 30 static struct regmap_config sparx5_reset_regmap_config = { ··· 41 38 u32 val; 42 39 43 40 /* Make sure the core is PROTECTED from reset */ 44 - regmap_update_bits(ctx->cpu_ctrl, PROTECT_REG, PROTECT_BIT, PROTECT_BIT); 41 + regmap_update_bits(ctx->cpu_ctrl, ctx->props->protect_reg, 42 + ctx->props->protect_bit, ctx->props->protect_bit); 45 43 46 44 /* Start soft reset */ 47 - regmap_write(ctx->gcb_ctrl, SOFT_RESET_REG, SOFT_RESET_BIT); 45 + regmap_write(ctx->gcb_ctrl, ctx->props->reset_reg, 46 + ctx->props->reset_bit); 48 47 49 48 /* Wait for soft reset done */ 50 - return regmap_read_poll_timeout(ctx->gcb_ctrl, SOFT_RESET_REG, val, 51 - (val & SOFT_RESET_BIT) == 0, 49 + return regmap_read_poll_timeout(ctx->gcb_ctrl, ctx->props->reset_reg, val, 50 + (val & ctx->props->reset_bit) == 0, 52 51 1, 100); 53 52 } 54 53 ··· 120 115 ctx->rcdev.nr_resets = 1; 121 116 ctx->rcdev.ops = &sparx5_reset_ops; 122 117 ctx->rcdev.of_node = dn; 118 + ctx->props = device_get_match_data(&pdev->dev); 123 119 124 120 return devm_reset_controller_register(&pdev->dev, &ctx->rcdev); 125 121 } 126 122 123 + static const struct reset_props reset_props_sparx5 = { 124 + .protect_reg = 0x84, 125 + .protect_bit = BIT(10), 126 + .reset_reg = 0x0, 127 + .reset_bit = BIT(1), 128 + }; 129 + 130 + static const struct reset_props reset_props_lan966x = { 131 + .protect_reg = 0x88, 132 + .protect_bit = BIT(5), 133 + .reset_reg = 0x0, 134 + .reset_bit = BIT(1), 135 + }; 136 + 127 137 static const struct of_device_id mchp_sparx5_reset_of_match[] = { 128 138 { 129 139 .compatible = "microchip,sparx5-switch-reset", 140 + .data = &reset_props_sparx5, 141 + }, { 142 + .compatible = "microchip,lan966x-switch-reset", 143 + .data = &reset_props_lan966x, 130 144 }, 131 145 { } 132 146 };
+4
drivers/reset/reset-uniphier-glue.c
··· 156 156 .data = &uniphier_pxs2_data, 157 157 }, 158 158 { 159 + .compatible = "socionext,uniphier-nx1-usb3-reset", 160 + .data = &uniphier_pxs2_data, 161 + }, 162 + { 159 163 .compatible = "socionext,uniphier-pro4-ahci-reset", 160 164 .data = &uniphier_pro4_data, 161 165 },
+27
drivers/reset/reset-uniphier.c
··· 136 136 UNIPHIER_RESETX(28, 0x200c, 7), /* SATA0 */ 137 137 UNIPHIER_RESETX(29, 0x200c, 8), /* SATA1 */ 138 138 UNIPHIER_RESETX(30, 0x200c, 21), /* SATA-PHY */ 139 + UNIPHIER_RESETX(40, 0x2008, 0), /* AIO */ 140 + UNIPHIER_RESETX(42, 0x2010, 2), /* EXIV */ 141 + UNIPHIER_RESET_END, 142 + }; 143 + 144 + static const struct uniphier_reset_data uniphier_nx1_sys_reset_data[] = { 145 + UNIPHIER_RESETX(4, 0x2008, 8), /* eMMC */ 146 + UNIPHIER_RESETX(6, 0x200c, 0), /* Ether */ 147 + UNIPHIER_RESETX(12, 0x200c, 16), /* USB30 link */ 148 + UNIPHIER_RESETX(16, 0x200c, 24), /* USB30-PHY0 */ 149 + UNIPHIER_RESETX(17, 0x200c, 25), /* USB30-PHY1 */ 150 + UNIPHIER_RESETX(18, 0x200c, 26), /* USB30-PHY2 */ 151 + UNIPHIER_RESETX(24, 0x200c, 8), /* PCIe */ 152 + UNIPHIER_RESETX(52, 0x2010, 0), /* VOC */ 153 + UNIPHIER_RESETX(58, 0x2010, 8), /* HDMI-Tx */ 139 154 UNIPHIER_RESET_END, 140 155 }; 141 156 ··· 415 400 .compatible = "socionext,uniphier-pxs3-reset", 416 401 .data = uniphier_pxs3_sys_reset_data, 417 402 }, 403 + { 404 + .compatible = "socionext,uniphier-nx1-reset", 405 + .data = uniphier_nx1_sys_reset_data, 406 + }, 418 407 /* Media I/O reset, SD reset */ 419 408 { 420 409 .compatible = "socionext,uniphier-ld4-mio-reset", ··· 456 437 .compatible = "socionext,uniphier-pxs3-sd-reset", 457 438 .data = uniphier_pro5_sd_reset_data, 458 439 }, 440 + { 441 + .compatible = "socionext,uniphier-nx1-sd-reset", 442 + .data = uniphier_pro5_sd_reset_data, 443 + }, 459 444 /* Peripheral reset */ 460 445 { 461 446 .compatible = "socionext,uniphier-ld4-peri-reset", ··· 491 468 }, 492 469 { 493 470 .compatible = "socionext,uniphier-pxs3-peri-reset", 471 + .data = uniphier_pro4_peri_reset_data, 472 + }, 473 + { 474 + .compatible = "socionext,uniphier-nx1-peri-reset", 494 475 .data = uniphier_pro4_peri_reset_data, 495 476 }, 496 477 /* Analog signal amplifiers reset */