Lines Matching +full:mpfs +full:- +full:clock

1 // SPDX-License-Identifier: GPL-2.0-only
3 * PolarFire SoC (MPFS) Peripheral Clock Reset Controller
16 #include <linux/reset-controller.h>
17 #include <dt-bindings/clock/microchip,mpfs-clock.h>
18 #include <soc/microchip/mpfs.h>
22 * defines in the dt to make things easier to configure - so this is accounting
44 * Peripheral clock resets
54 reg = readl(rst->base); in mpfs_assert()
56 writel(reg, rst->base); in mpfs_assert()
71 reg = readl(rst->base); in mpfs_deassert()
73 writel(reg, rst->base); in mpfs_deassert()
83 u32 reg = readl(rst->base); in mpfs_status()
113 unsigned int index = reset_spec->args[0]; in mpfs_reset_xlate()
116 * CLK_RESERVED does not map to a clock, but it does map to a reset, in mpfs_reset_xlate()
118 * so if this reset gets called - do not reset it. in mpfs_reset_xlate()
121 dev_err(rcdev->dev, "Resetting the fabric is not supported\n"); in mpfs_reset_xlate()
122 return -EINVAL; in mpfs_reset_xlate()
125 if (index < MPFS_PERIPH_OFFSET || index >= (MPFS_PERIPH_OFFSET + rcdev->nr_resets)) { in mpfs_reset_xlate()
126 dev_err(rcdev->dev, "Invalid reset index %u\n", index); in mpfs_reset_xlate()
127 return -EINVAL; in mpfs_reset_xlate()
130 return index - MPFS_PERIPH_OFFSET; in mpfs_reset_xlate()
136 struct device *dev = &adev->dev; in mpfs_reset_probe()
142 return -ENOMEM; in mpfs_reset_probe()
144 rst->base = (void __iomem *)adev->dev.platform_data; in mpfs_reset_probe()
146 rcdev = &rst->rcdev; in mpfs_reset_probe()
147 rcdev->dev = dev; in mpfs_reset_probe()
148 rcdev->dev->parent = dev->parent; in mpfs_reset_probe()
149 rcdev->ops = &mpfs_reset_ops; in mpfs_reset_probe()
150 rcdev->of_node = dev->parent->of_node; in mpfs_reset_probe()
151 rcdev->of_reset_n_cells = 1; in mpfs_reset_probe()
152 rcdev->of_xlate = mpfs_reset_xlate; in mpfs_reset_probe()
153 rcdev->nr_resets = MPFS_NUM_RESETS; in mpfs_reset_probe()
180 return ERR_PTR(-ENOMEM); in mpfs_reset_adev_alloc()
182 adev->name = "reset-mpfs"; in mpfs_reset_adev_alloc()
183 adev->dev.parent = clk_dev; in mpfs_reset_adev_alloc()
184 adev->dev.release = mpfs_reset_adev_release; in mpfs_reset_adev_alloc()
185 adev->id = 666u; in mpfs_reset_adev_alloc()
211 adev->dev.platform_data = (__force void *)base; in mpfs_reset_controller_register()
219 .name = "reset_mpfs.reset-mpfs",