Commit 36b6dcbc authored by Arnd Bergmann's avatar Arnd Bergmann

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

Reset controller fixes for v5.15

Fix the status bit polarity in the brcmstb-rescal driver, re-enable
pistachio driver selection after MACH_PISTACHIO removal, add transfer
error handling in the tegra-bpmp driver, and fix probing of the
reset-socfpga driver after recent device link changes.

* tag 'reset-fixes-for-v5.15' of git://git.pengutronix.de/pza/linux:
  reset: socfpga: add empty driver allowing consumers to probe
  reset: tegra-bpmp: Handle errors in BPMP response
  reset: pistachio: Re-enable driver selection
  reset: brcmstb-rescal: fix incorrect polarity of status bit

Link: https://lore.kernel.org/r/b378f2aae54538db6a13c98561b4cbcacbef937c.camel@pengutronix.deSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents e23c7487 3ad60b4b
...@@ -147,8 +147,8 @@ config RESET_OXNAS ...@@ -147,8 +147,8 @@ config RESET_OXNAS
bool bool
config RESET_PISTACHIO config RESET_PISTACHIO
bool "Pistachio Reset Driver" if COMPILE_TEST bool "Pistachio Reset Driver"
default MACH_PISTACHIO depends on MIPS || COMPILE_TEST
help help
This enables the reset driver for ImgTec Pistachio SoCs. This enables the reset driver for ImgTec Pistachio SoCs.
......
...@@ -38,7 +38,7 @@ static int brcm_rescal_reset_set(struct reset_controller_dev *rcdev, ...@@ -38,7 +38,7 @@ static int brcm_rescal_reset_set(struct reset_controller_dev *rcdev,
} }
ret = readl_poll_timeout(base + BRCM_RESCAL_STATUS, reg, ret = readl_poll_timeout(base + BRCM_RESCAL_STATUS, reg,
!(reg & BRCM_RESCAL_STATUS_BIT), 100, 1000); (reg & BRCM_RESCAL_STATUS_BIT), 100, 1000);
if (ret) { if (ret) {
dev_err(data->dev, "time out on SATA/PCIe rescal\n"); dev_err(data->dev, "time out on SATA/PCIe rescal\n");
return ret; return ret;
......
...@@ -92,3 +92,29 @@ void __init socfpga_reset_init(void) ...@@ -92,3 +92,29 @@ void __init socfpga_reset_init(void)
for_each_matching_node(np, socfpga_early_reset_dt_ids) for_each_matching_node(np, socfpga_early_reset_dt_ids)
a10_reset_init(np); a10_reset_init(np);
} }
/*
* The early driver is problematic, because it doesn't register
* itself as a driver. This causes certain device links to prevent
* consumer devices from probing. The hacky solution is to register
* an empty driver, whose only job is to attach itself to the reset
* manager and call probe.
*/
static const struct of_device_id socfpga_reset_dt_ids[] = {
{ .compatible = "altr,rst-mgr", },
{ /* sentinel */ },
};
static int reset_simple_probe(struct platform_device *pdev)
{
return 0;
}
static struct platform_driver reset_socfpga_driver = {
.probe = reset_simple_probe,
.driver = {
.name = "socfpga-reset",
.of_match_table = socfpga_reset_dt_ids,
},
};
builtin_platform_driver(reset_socfpga_driver);
...@@ -20,6 +20,7 @@ static int tegra_bpmp_reset_common(struct reset_controller_dev *rstc, ...@@ -20,6 +20,7 @@ static int tegra_bpmp_reset_common(struct reset_controller_dev *rstc,
struct tegra_bpmp *bpmp = to_tegra_bpmp(rstc); struct tegra_bpmp *bpmp = to_tegra_bpmp(rstc);
struct mrq_reset_request request; struct mrq_reset_request request;
struct tegra_bpmp_message msg; struct tegra_bpmp_message msg;
int err;
memset(&request, 0, sizeof(request)); memset(&request, 0, sizeof(request));
request.cmd = command; request.cmd = command;
...@@ -30,7 +31,13 @@ static int tegra_bpmp_reset_common(struct reset_controller_dev *rstc, ...@@ -30,7 +31,13 @@ static int tegra_bpmp_reset_common(struct reset_controller_dev *rstc,
msg.tx.data = &request; msg.tx.data = &request;
msg.tx.size = sizeof(request); msg.tx.size = sizeof(request);
return tegra_bpmp_transfer(bpmp, &msg); err = tegra_bpmp_transfer(bpmp, &msg);
if (err)
return err;
if (msg.rx.ret)
return -EINVAL;
return 0;
} }
static int tegra_bpmp_reset_module(struct reset_controller_dev *rstc, static int tegra_bpmp_reset_module(struct reset_controller_dev *rstc,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment