Skip to content

Commit

Permalink
Merge tag 'reset-fixes-for-v6.14' of git://git.pengutronix.de/pza/lin…
Browse files Browse the repository at this point in the history
…ux into arm/fixes

Reset controller fixes for v6.14

* Fix lan966x boot with internal CPU by stopping reset-microchip-sparx5
  from indirectly calling devm_request_mem_region() on a memory region
  shared with other devices.

* tag 'reset-fixes-for-v6.14' of git://git.pengutronix.de/pza/linux:
  reset: mchp: sparx5: Fix for lan966x

Link: https://lore.kernel.org/r/20250314164401.743984-1-p.zabel@pengutronix.de
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
  • Loading branch information
Arnd Bergmann committed Mar 14, 2025
2 parents 262666c + 0e2268f commit 5c81649
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions drivers/reset/reset-microchip-sparx5.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/
#include <linux/mfd/syscon.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/property.h>
Expand Down Expand Up @@ -72,14 +73,22 @@ static struct regmap *mchp_lan966x_syscon_to_regmap(struct device *dev,
struct device_node *syscon_np)
{
struct regmap_config regmap_config = mchp_lan966x_syscon_regmap_config;
resource_size_t size;
struct resource res;
void __iomem *base;
int err;

err = of_address_to_resource(syscon_np, 0, &res);
if (err)
return ERR_PTR(err);

base = devm_of_iomap(dev, syscon_np, 0, &size);
if (IS_ERR(base))
return ERR_CAST(base);
/* It is not possible to use devm_of_iomap because this resource is
* shared with other drivers.
*/
base = devm_ioremap(dev, res.start, resource_size(&res));
if (!base)
return ERR_PTR(-ENOMEM);

regmap_config.max_register = size - 4;
regmap_config.max_register = resource_size(&res) - 4;

return devm_regmap_init_mmio(dev, base, &regmap_config);
}
Expand Down

0 comments on commit 5c81649

Please sign in to comment.