Reset controller updates for v6.15

* Add missing microchip,sam9x7-rstc compatible to device tree binding
   documentation.
 * Add SCU reset driver for i.MX8QXP and i.MX8QM.
 -----BEGIN PGP SIGNATURE-----
 
 iI0EABYIADUWIQRRO6F6WdpH1R0vGibVhaclGDdiwAUCZ9RbMRcccC56YWJlbEBw
 ZW5ndXRyb25peC5kZQAKCRDVhaclGDdiwHn0AP9GbWMXwwnx+DKAMYMjeErygVLD
 q4bAm8h+pqNylxCqngD9HrqzJ5/gbbqMnLJifaBtCutXf4aR2iDzH/uGa1tnewA=
 =LC08
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmfbPIwACgkQYKtH/8kJ
 UicNug//cJx5XBsSAzRGDhQhQXBZnw28LS5EceuoAgIZFCTMOU8SafTCjSwj26xv
 nL6vNqtPGTZc8RrvM2XC457ptDuxKOoNEL8xYYxyIgRu1ZxVzTKS8eo76dY0FiIX
 kphglhHMR8IPLYsiJIwNYkniqeE58O0jjtMHueSpWcJ6b3MD9wxSeRBA3iSn6j5/
 lgQolkHfUZ3+mAyAUdVM1eVtQKGRK97h5et7Q3/Jtk6RyAfu2xtke7ARMudmOfXc
 DuCRv851pe7zB6trwvAxbldO+62ip6fQ9LKPWA5Mx8MMOH9aLS7kE5jHwEGHdFdv
 VMcyktyDagzHKtug7KZRjUnhnbTQR+KmoVgU1UbK0AcZC5P9ujmzD9pia5B7Cl1F
 norarbymUyLs/QJDfnChWRm3VOsKDsO/Tz0yKDgJ9P2uvZwteb6BREHPxgF9oCEC
 QK7poFnIVvQC+Bjc+P+R10jna37PA3uD+88E8QxKeqGjGrYIfZuIyn/MYdjIM/CI
 +hOCKqnqOOlDV2+OSdzAccGvEyHpnGLlcHw8jYIk2gjZ8MjWm6llcWS22UPi6Ze2
 xtUD2JxaWc4dNK0Ea8wwXcQk01HpS7xZxAVD2p6OCSKWjVSDsd8JDjdJL1UI5e7m
 MJ0+Y0mm2nxld/zCKH8DRtYTAz8mde7aAKLnLLQ6VTF8q/cVQ8o=
 =KKCI
 -----END PGP SIGNATURE-----

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

Reset controller updates for v6.15

* Add missing microchip,sam9x7-rstc compatible to device tree binding
  documentation.
* Add SCU reset driver for i.MX8QXP and i.MX8QM.

* tag 'reset-for-v6.15' of git://git.pengutronix.de/pza/linux:
  reset: imx: fix incorrect module device table
  reset: imx: Add SCU reset driver for i.MX8QXP and i.MX8QM
  dt-bindings: firmware: imx: add property reset-controller
  dt-bindings: reset: atmel,at91sam9260-reset: add sam9x7

Link: https://lore.kernel.org/r/20250314164406.744117-1-p.zabel@pengutronix.de
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
Arnd Bergmann 2025-03-19 22:52:07 +01:00
commit 29759d2729
5 changed files with 125 additions and 0 deletions

View file

@ -45,6 +45,18 @@ properties:
Keys provided by the SCU
$ref: /schemas/input/fsl,scu-key.yaml
reset-controller:
type: object
properties:
compatible:
const: fsl,imx-scu-reset
'#reset-cells':
const: 1
required:
- compatible
- '#reset-cells'
additionalProperties: false
mboxes:
description:
A list of phandles of TX MU channels followed by a list of phandles of

View file

@ -26,6 +26,10 @@ properties:
- items:
- const: atmel,sama5d3-rstc
- const: atmel,at91sam9g45-rstc
- items:
- enum:
- microchip,sam9x7-rstc
- const: microchip,sam9x60-rstc
reg:
minItems: 1

View file

@ -96,6 +96,13 @@ config RESET_HSDK
help
This enables the reset controller driver for HSDK board.
config RESET_IMX_SCU
tristate "i.MX8Q Reset Driver"
depends on IMX_SCU && HAVE_ARM_SMCCC
depends on (ARM64 && ARCH_MXC) || COMPILE_TEST
help
This enables the reset controller driver for i.MX8QM/i.MX8QXP
config RESET_IMX7
tristate "i.MX7/8 Reset Driver"
depends on HAS_IOMEM

View file

@ -15,6 +15,7 @@ obj-$(CONFIG_RESET_BRCMSTB_RESCAL) += reset-brcmstb-rescal.o
obj-$(CONFIG_RESET_EYEQ) += reset-eyeq.o
obj-$(CONFIG_RESET_GPIO) += reset-gpio.o
obj-$(CONFIG_RESET_HSDK) += reset-hsdk.o
obj-$(CONFIG_RESET_IMX_SCU) += reset-imx-scu.o
obj-$(CONFIG_RESET_IMX7) += reset-imx7.o
obj-$(CONFIG_RESET_IMX8MP_AUDIOMIX) += reset-imx8mp-audiomix.o
obj-$(CONFIG_RESET_INTEL_GW) += reset-intel-gw.o

View file

@ -0,0 +1,101 @@
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright 2025 NXP
* Frank Li <Frank.Li@nxp.com>
*/
#include <linux/firmware/imx/svc/misc.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/reset-controller.h>
#include <dt-bindings/firmware/imx/rsrc.h>
struct imx_scu_reset {
struct reset_controller_dev rc;
struct imx_sc_ipc *ipc_handle;
};
static struct imx_scu_reset *to_imx_scu(struct reset_controller_dev *rc)
{
return container_of(rc, struct imx_scu_reset, rc);
}
struct imx_scu_id_map {
u32 resource_id;
u32 command_id;
};
static const struct imx_scu_id_map imx_scu_id_map[] = {
{ IMX_SC_R_CSI_0, IMX_SC_C_MIPI_RESET },
{ IMX_SC_R_CSI_1, IMX_SC_C_MIPI_RESET },
};
static int imx_scu_reset_assert(struct reset_controller_dev *rc, unsigned long id)
{
struct imx_scu_reset *priv = to_imx_scu(rc);
return imx_sc_misc_set_control(priv->ipc_handle, imx_scu_id_map[id].resource_id,
imx_scu_id_map[id].command_id, true);
}
static const struct reset_control_ops imx_scu_reset_ops = {
.assert = imx_scu_reset_assert,
};
static int imx_scu_xlate(struct reset_controller_dev *rc, const struct of_phandle_args *reset_spec)
{
int i;
for (i = 0; i < rc->nr_resets; i++)
if (reset_spec->args[0] == imx_scu_id_map[i].resource_id)
return i;
return -EINVAL;
}
static int imx_scu_reset_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct imx_scu_reset *priv;
int ret;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
platform_set_drvdata(pdev, &priv->rc);
ret = imx_scu_get_handle(&priv->ipc_handle);
if (ret)
return dev_err_probe(dev, ret, "sc_misc_MIPI get ipc handle failed!\n");
priv->rc.ops = &imx_scu_reset_ops;
priv->rc.owner = THIS_MODULE;
priv->rc.of_node = dev->of_node;
priv->rc.of_reset_n_cells = 1;
priv->rc.of_xlate = imx_scu_xlate;
priv->rc.nr_resets = ARRAY_SIZE(imx_scu_id_map);
return devm_reset_controller_register(dev, &priv->rc);
}
static const struct of_device_id imx_scu_reset_ids[] = {
{ .compatible = "fsl,imx-scu-reset", },
{}
};
MODULE_DEVICE_TABLE(of, imx_scu_reset_ids);
static struct platform_driver imx_scu_reset_driver = {
.probe = imx_scu_reset_probe,
.driver = {
.name = "scu-reset",
.of_match_table = imx_scu_reset_ids,
},
};
module_platform_driver(imx_scu_reset_driver);
MODULE_AUTHOR("Frank Li <Frank.Li@nxp.com>");
MODULE_DESCRIPTION("i.MX scu reset driver");
MODULE_LICENSE("GPL");