Reset controller updates for v6.8

Make use of devm_platform_get_and_ioremap_resource() and
 device_get_match_data() in several drivers, support the Amlogic C3 reset
 controller, and improve various device tree binding documents.
 -----BEGIN PGP SIGNATURE-----
 
 iI0EABYIADUWIQRRO6F6WdpH1R0vGibVhaclGDdiwAUCZXnObhcccC56YWJlbEBw
 ZW5ndXRyb25peC5kZQAKCRDVhaclGDdiwK/cAQDfkw0rO9u3T5gdsbbEWBFaHoMc
 /R7fBR1e9u+zqdW2SgD/X9Jszc2zOVzZuuG7uyidscCz9+UkM4HAMqlOip8j/gM=
 =3iPp
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmWFdLAACgkQYKtH/8kJ
 UifxBxAAiJ8JgLPKhGSWVAPQCkGzfJl9ONDjGWxH4j3U0vdnlfBkjzlVFy9yQoK5
 QG+IzLNoaLlLh17x6Sy12fFDaQErFHeWL3a9sTBlCT2csrBMrle10XRCbVFBYn+j
 0RfgcIBbj3BBJlNXlvAk1mpdwuRTkRbQJPDeBNiCoJArFYb1GV4Kqxy840+jfICZ
 FpEDttL+7OSLKItDgVwImGqCBdfsPOzL+GY4Rvj7lE9FMsfrYbUxA+61kSBSPwbO
 JIsQ52LFpO8KvheeXEt71oS57jO0lAKGx0nM1mqe7gxED69bff1G8QjRojzYIDul
 mC0DQtG0cFjsGO4GuTHUQd1/5H1uCjjJKDwynDpXLG8rl+3GFCpwYxSYbKF+RCqJ
 R2SSVP0pCkiW9F8svDyK5h1NgoUZdoXptUYxzufJpnc+wwYuAPVV+zMhOnUlsSjg
 XOCQu29ql7N2SugIhLsNzcgOHCsxCOvki0yOt96kYKwtRGBv+1UX5oJzdE/XpjZn
 ATs08gcpK45rJfcFOYZ1kjmS0nSi95hsY+IvUNfSPs5ttBhbid8EEdZc73U1db/Y
 tlkqO4OKqqAcmpk0CJg3mwU1jX04/OAlNv9ifxzfUUR4tiONspk5rfp+klf5YbiR
 Qs1GGNt5N8hlBuiU3SqClayl3Lr3NKRqLiDeREdiDBaRzvJxqLw=
 =hbni
 -----END PGP SIGNATURE-----

Merge tag 'reset-for-v6.8' of git://git.pengutronix.de/pza/linux into soc/drivers

Reset controller updates for v6.8

Make use of devm_platform_get_and_ioremap_resource() and
device_get_match_data() in several drivers, support the Amlogic C3 reset
controller, and improve various device tree binding documents.

* tag 'reset-for-v6.8' of git://git.pengutronix.de/pza/linux:
  dt-bindings: reset: hisilicon,hi3660-reset: Drop providers and consumers from example
  dt-bindings: reset: imx-src: Simplify compatible schema and drop unneeded quotes
  dt-bindings: reset: qcom: drop unneeded quotes
  dt-bindings: reset: renesas,rzg2l-usbphy-ctrl: Document RZ/Five SoC
  reset: Use device_get_match_data()
  reset: reset-meson: add support for Amlogic C3 SoC Reset Controller
  dt-bindings: reset: Add compatible and DT bindings for Amlogic C3 Reset Controller
  reset: uniphier-glue: Use devm_platform_get_and_ioremap_resource()
  reset: sunplus: Use devm_platform_get_and_ioremap_resource()
  reset: simple: Convert to devm_platform_get_and_ioremap_resource()
  reset: qcom: Convert to devm_platform_ioremap_resource()
  reset: qcom-aoss: Convert to devm_platform_ioremap_resource()
  reset: meson-audio-arb: Convert to devm_platform_ioremap_resource()
  reset: brcmstb: Use devm_platform_get_and_ioremap_resource()

Link: https://lore.kernel.org/r/20231213153313.278867-1-p.zabel@pengutronix.de
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
Arnd Bergmann 2023-12-22 11:36:16 +00:00
commit feb69ea40a
17 changed files with 157 additions and 80 deletions

View file

@ -18,6 +18,7 @@ properties:
- amlogic,meson-axg-reset # Reset Controller on AXG and compatible SoCs
- amlogic,meson-a1-reset # Reset Controller on A1 and compatible SoCs
- amlogic,meson-s4-reset # Reset Controller on S4 and compatible SoCs
- amlogic,c3-reset # Reset Controller on C3 and compatible SoCs
reg:
maxItems: 1

View file

@ -28,28 +28,17 @@ description: |
properties:
compatible:
oneOf:
- const: "fsl,imx51-src"
- const: fsl,imx51-src
- items:
- const: "fsl,imx50-src"
- const: "fsl,imx51-src"
- items:
- const: "fsl,imx53-src"
- const: "fsl,imx51-src"
- items:
- const: "fsl,imx6q-src"
- const: "fsl,imx51-src"
- items:
- const: "fsl,imx6sx-src"
- const: "fsl,imx51-src"
- items:
- const: "fsl,imx6sl-src"
- const: "fsl,imx51-src"
- items:
- const: "fsl,imx6ul-src"
- const: "fsl,imx51-src"
- items:
- const: "fsl,imx6sll-src"
- const: "fsl,imx51-src"
- enum:
- fsl,imx50-src
- fsl,imx53-src
- fsl,imx6q-src
- fsl,imx6sx-src
- fsl,imx6sl-src
- fsl,imx6ul-src
- fsl,imx6sll-src
- const: fsl,imx51-src
reg:
maxItems: 1

View file

@ -50,32 +50,9 @@ additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/hi3660-clock.h>
iomcu: iomcu@ffd7e000 {
compatible = "hisilicon,hi3660-iomcu", "syscon";
reg = <0xffd7e000 0x1000>;
};
iomcu_rst: iomcu_rst_controller {
iomcu_rst_controller {
compatible = "hisilicon,hi3660-reset";
hisilicon,rst-syscon = <&iomcu>;
#reset-cells = <2>;
};
/* Specifying reset lines connected to IP modules */
i2c@ffd71000 {
compatible = "snps,designware-i2c";
reg = <0xffd71000 0x1000>;
interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>;
#address-cells = <1>;
#size-cells = <0>;
clock-frequency = <400000>;
clocks = <&crg_ctrl HI3660_CLK_GATE_I2C0>;
resets = <&iomcu_rst 0x20 3>;
pinctrl-names = "default";
pinctrl-0 = <&i2c0_pmx_func &i2c0_cfg_func>;
};
...

View file

@ -18,17 +18,17 @@ properties:
oneOf:
- description: on SC7180 SoCs the following compatibles must be specified
items:
- const: "qcom,sc7180-aoss-cc"
- const: "qcom,sdm845-aoss-cc"
- const: qcom,sc7180-aoss-cc
- const: qcom,sdm845-aoss-cc
- description: on SC7280 SoCs the following compatibles must be specified
items:
- const: "qcom,sc7280-aoss-cc"
- const: "qcom,sdm845-aoss-cc"
- const: qcom,sc7280-aoss-cc
- const: qcom,sdm845-aoss-cc
- description: on SDM845 SoCs the following compatibles must be specified
items:
- const: "qcom,sdm845-aoss-cc"
- const: qcom,sdm845-aoss-cc
reg:
maxItems: 1

View file

@ -18,16 +18,16 @@ properties:
oneOf:
- description: on SC7180 SoCs the following compatibles must be specified
items:
- const: "qcom,sc7180-pdc-global"
- const: "qcom,sdm845-pdc-global"
- const: qcom,sc7180-pdc-global
- const: qcom,sdm845-pdc-global
- description: on SC7280 SoCs the following compatibles must be specified
items:
- const: "qcom,sc7280-pdc-global"
- const: qcom,sc7280-pdc-global
- description: on SDM845 SoCs the following compatibles must be specified
items:
- const: "qcom,sdm845-pdc-global"
- const: qcom,sdm845-pdc-global
reg:
maxItems: 1

View file

@ -17,7 +17,7 @@ properties:
compatible:
items:
- enum:
- renesas,r9a07g043-usbphy-ctrl # RZ/G2UL
- renesas,r9a07g043-usbphy-ctrl # RZ/G2UL and RZ/Five
- renesas,r9a07g044-usbphy-ctrl # RZ/G2{L,LC}
- renesas,r9a07g054-usbphy-ctrl # RZ/V2L
- const: renesas,rzg2l-usbphy-ctrl

View file

@ -90,8 +90,7 @@ static int brcmstb_reset_probe(struct platform_device *pdev)
if (!priv)
return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
priv->base = devm_ioremap_resource(kdev, res);
priv->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(priv->base))
return PTR_ERR(priv->base);

View file

@ -139,7 +139,6 @@ static int meson_audio_arb_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
const struct meson_audio_arb_match_data *data;
struct meson_audio_arb_data *arb;
struct resource *res;
int ret;
data = of_device_get_match_data(dev);
@ -155,8 +154,7 @@ static int meson_audio_arb_probe(struct platform_device *pdev)
if (IS_ERR(arb->clk))
return dev_err_probe(dev, PTR_ERR(arb->clk), "failed to get clock\n");
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
arb->regs = devm_ioremap_resource(dev, res);
arb->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(arb->regs))
return PTR_ERR(arb->regs);

View file

@ -108,6 +108,7 @@ static const struct of_device_id meson_reset_dt_ids[] = {
{ .compatible = "amlogic,meson-axg-reset", .data = &meson8b_param},
{ .compatible = "amlogic,meson-a1-reset", .data = &meson_a1_param},
{ .compatible = "amlogic,meson-s4-reset", .data = &meson_s4_param},
{ .compatible = "amlogic,c3-reset", .data = &meson_s4_param},
{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(of, meson_reset_dt_ids);

View file

@ -6,8 +6,8 @@
#include <linux/io.h>
#include <linux/init.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/reboot.h>
#include <linux/reset-controller.h>
#include <linux/spinlock.h>
@ -351,8 +351,7 @@ static int npcm_usb_reset(struct platform_device *pdev, struct npcm_rc_data *rc)
}
}
rc->info = (const struct npcm_reset_info *)
of_match_device(dev->driver->of_match_table, dev)->data;
rc->info = device_get_match_data(dev);
switch (rc->info->bmc_id) {
case BMC_NPCM7XX:
npcm_usb_reset_npcm7xx(rc);

View file

@ -90,7 +90,6 @@ static int qcom_aoss_reset_probe(struct platform_device *pdev)
struct qcom_aoss_reset_data *data;
struct device *dev = &pdev->dev;
const struct qcom_aoss_desc *desc;
struct resource *res;
desc = of_device_get_match_data(dev);
if (!desc)
@ -101,8 +100,7 @@ static int qcom_aoss_reset_probe(struct platform_device *pdev)
return -ENOMEM;
data->desc = desc;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
data->base = devm_ioremap_resource(dev, res);
data->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(data->base))
return PTR_ERR(data->base);

View file

@ -114,7 +114,6 @@ static int qcom_pdc_reset_probe(struct platform_device *pdev)
struct qcom_pdc_reset_data *data;
struct device *dev = &pdev->dev;
void __iomem *base;
struct resource *res;
desc = device_get_match_data(&pdev->dev);
if (!desc)
@ -125,8 +124,7 @@ static int qcom_pdc_reset_probe(struct platform_device *pdev)
return -ENOMEM;
data->desc = desc;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
base = devm_ioremap_resource(dev, res);
base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(base))
return PTR_ERR(base);

View file

@ -169,8 +169,7 @@ static int reset_simple_probe(struct platform_device *pdev)
if (!data)
return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
membase = devm_ioremap_resource(dev, res);
membase = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(membase))
return PTR_ERR(membase);

View file

@ -176,8 +176,7 @@ static int sp_reset_probe(struct platform_device *pdev)
if (!reset)
return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
reset->base = devm_ioremap_resource(dev, res);
reset->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(reset->base))
return PTR_ERR(reset->base);

View file

@ -58,8 +58,7 @@ static int uniphier_glue_reset_probe(struct platform_device *pdev)
priv->data->nrsts > MAX_RSTS))
return -EINVAL;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
priv->rdata.membase = devm_ioremap_resource(dev, res);
priv->rdata.membase = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(priv->rdata.membase))
return PTR_ERR(priv->rdata.membase);

View file

@ -7,10 +7,11 @@
*/
#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/module.h>
#include <linux/err.h>
#include <linux/types.h>
#include <linux/of_device.h>
#include <linux/of.h>
#include <linux/regmap.h>
#include <linux/mfd/syscon.h>
@ -183,14 +184,14 @@ static int syscfg_reset_controller_register(struct device *dev,
int syscfg_reset_probe(struct platform_device *pdev)
{
struct device *dev = pdev ? &pdev->dev : NULL;
const struct of_device_id *match;
const void *data;
if (!dev || !dev->driver)
return -ENODEV;
match = of_match_device(dev->driver->of_match_table, dev);
if (!match || !match->data)
data = device_get_match_data(&pdev->dev);
if (!data)
return -EINVAL;
return syscfg_reset_controller_register(dev, match->data);
return syscfg_reset_controller_register(dev, data);
}

View file

@ -0,0 +1,119 @@
/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
/*
* Copyright (c) 2023 Amlogic, Inc. All rights reserved.
*/
#ifndef _DT_BINDINGS_AMLOGIC_C3_RESET_H
#define _DT_BINDINGS_AMLOGIC_C3_RESET_H
/* RESET0 */
/* 0-3 */
#define RESET_USBCTRL 4
/* 5-7 */
#define RESET_USBPHY20 8
/* 9 */
#define RESET_USB2DRD 10
#define RESET_MIPI_DSI_HOST 11
#define RESET_MIPI_DSI_PHY 12
/* 13-20 */
#define RESET_GE2D 21
#define RESET_DWAP 22
/* 23-31 */
/* RESET1 */
#define RESET_AUDIO 32
/* 33-34 */
#define RESET_DDRAPB 35
#define RESET_DDR 36
#define RESET_DOS_CAPB3 37
#define RESET_DOS 38
/* 39-46 */
#define RESET_NNA 47
#define RESET_ETHERNET 48
#define RESET_ISP 49
#define RESET_VC9000E_APB 50
#define RESET_VC9000E_A 51
/* 52 */
#define RESET_VC9000E_CORE 53
/* 54-63 */
/* RESET2 */
#define RESET_ABUS_ARB 64
#define RESET_IRCTRL 65
/* 66 */
#define RESET_TEMP_PII 67
/* 68-72 */
#define RESET_SPICC_0 73
#define RESET_SPICC_1 74
#define RESET_RSA 75
/* 76-79 */
#define RESET_MSR_CLK 80
#define RESET_SPIFC 81
#define RESET_SAR_ADC 82
/* 83-87 */
#define RESET_ACODEC 88
/* 89-90 */
#define RESET_WATCHDOG 91
/* 92-95 */
/* RESET3 */
#define RESET_ISP_NIC_GPV 96
#define RESET_ISP_NIC_MAIN 97
#define RESET_ISP_NIC_VCLK 98
#define RESET_ISP_NIC_VOUT 99
#define RESET_ISP_NIC_ALL 100
#define RESET_VOUT 101
#define RESET_VOUT_VENC 102
/* 103 */
#define RESET_CVE_NIC_GPV 104
#define RESET_CVE_NIC_MAIN 105
#define RESET_CVE_NIC_GE2D 106
#define RESET_CVE_NIC_DW 106
#define RESET_CVE_NIC_CVE 108
#define RESET_CVE_NIC_ALL 109
#define RESET_CVE 110
/* 112-127 */
/* RESET4 */
#define RESET_RTC 128
#define RESET_PWM_AB 129
#define RESET_PWM_CD 130
#define RESET_PWM_EF 131
#define RESET_PWM_GH 132
#define RESET_PWM_IJ 133
#define RESET_PWM_KL 134
#define RESET_PWM_MN 135
/* 136-137 */
#define RESET_UART_A 138
#define RESET_UART_B 139
#define RESET_UART_C 140
#define RESET_UART_D 141
#define RESET_UART_E 142
#define RESET_UART_F 143
#define RESET_I2C_S_A 144
#define RESET_I2C_M_A 145
#define RESET_I2C_M_B 146
#define RESET_I2C_M_C 147
#define RESET_I2C_M_D 148
/* 149-151 */
#define RESET_SD_EMMC_A 152
#define RESET_SD_EMMC_B 153
#define RESET_SD_EMMC_C 154
/* RESET5 */
/* 160-172 */
#define RESET_BRG_NIC_NNA 173
#define RESET_BRG_MUX_NIC_MAIN 174
#define RESET_BRG_AO_NIC_ALL 175
/* 176-183 */
#define RESET_BRG_NIC_VAPB 184
#define RESET_BRG_NIC_SDIO_B 185
#define RESET_BRG_NIC_SDIO_A 186
#define RESET_BRG_NIC_EMMC 187
#define RESET_BRG_NIC_DSU 188
#define RESET_BRG_NIC_SYSCLK 189
#define RESET_BRG_NIC_MAIN 190
#define RESET_BRG_NIC_ALL 191
#endif