Skip to content

Commit ead73d0

Browse files
reset: sc5xx: Add ADI SC5XX reset controller driver
Move the ADI ADSP-SC5XX reset controller from drivers/soc/adi/mach-sc5xx/ to drivers/reset/ to integrate with the standard reset controller subsystem. Signed-off-by: Arturs Artamonovs <Arturs.Artamonovs@analog.com>
1 parent dca866b commit ead73d0

File tree

6 files changed

+16
-25
lines changed

6 files changed

+16
-25
lines changed

drivers/reset/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,14 @@ config RESET_RZG2L_USBPHY_CTRL
231231
Support for USBPHY Control found on RZ/G2L family. It mainly
232232
controls reset and power down of the USB/PHY.
233233

234+
config RESET_SC5XX
235+
bool "ADI SC5XX Reset Driver"
236+
depends on ARCH_SC59X_64
237+
default y
238+
help
239+
This enables simple reset controller for ADI ADSP-SC5xx family.
240+
Support software reset.
241+
234242
config RESET_SCMI
235243
tristate "Reset driver controlled via ARM SCMI interface"
236244
depends on ARM_SCMI_PROTOCOL || COMPILE_TEST

drivers/reset/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ obj-$(CONFIG_RESET_QCOM_AOSS) += reset-qcom-aoss.o
3131
obj-$(CONFIG_RESET_QCOM_PDC) += reset-qcom-pdc.o
3232
obj-$(CONFIG_RESET_RASPBERRYPI) += reset-raspberrypi.o
3333
obj-$(CONFIG_RESET_RZG2L_USBPHY_CTRL) += reset-rzg2l-usbphy-ctrl.o
34+
obj-$(CONFIG_RESET_SC5XX) += reset-sc5xx.o
3435
obj-$(CONFIG_RESET_SCMI) += reset-scmi.o
3536
obj-$(CONFIG_RESET_SIMPLE) += reset-simple.o
3637
obj-$(CONFIG_RESET_SOCFPGA) += reset-socfpga.o
Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
// SPDX-License-Identifier: GPL-2.0-or-later
1+
// SPDX-License-Identifier: GPL-2.0-only
22
/*
33
* Driver for Analog Devices Reset Control Unit
44
*
5-
* (C) Copyright 2022 - Analog Devices, Inc.
6-
*
7-
* Written and/or maintained by Timesys Corporation
8-
*
9-
* Author: Greg Malysa <greg.malysa@timesys.com>
10-
* Contact: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
5+
* (C) Copyright 2022-2026 - Analog Devices, Inc.
116
*/
127

138
#include <linux/bits.h>
@@ -22,7 +17,7 @@
2217
#include <linux/types.h>
2318

2419
#include <linux/soc/adi/rcu.h>
25-
#include "sec.h"
20+
#include <linux/soc/adi/sec.h>
2621

2722
#define ADI_RCU_REBOOT_PRIORITY 255
2823
#define ADI_RCU_CORE_INIT_TIMEOUT msecs_to_jiffies(2000)
@@ -51,7 +46,6 @@ void adi_rcu_writel(u32 val, struct adi_rcu *rcu, int offset)
5146
{
5247
writel(val, rcu->ioaddr + offset);
5348
}
54-
5549
EXPORT_SYMBOL(adi_rcu_writel);
5650

5751
void adi_rcu_msg_set(struct adi_rcu *rcu, u32 bits)
@@ -114,7 +108,6 @@ int adi_rcu_check_coreid_valid(struct adi_rcu *rcu, int coreid)
114108
return -EINVAL;
115109
return 0;
116110
}
117-
118111
EXPORT_SYMBOL(adi_rcu_check_coreid_valid);
119112

120113
int adi_rcu_reset_core(struct adi_rcu *rcu, int coreid)
@@ -161,7 +154,6 @@ int adi_rcu_reset_core(struct adi_rcu *rcu, int coreid)
161154

162155
return 0;
163156
}
164-
165157
EXPORT_SYMBOL(adi_rcu_reset_core);
166158

167159
int adi_rcu_start_core(struct adi_rcu *rcu, int coreid)
@@ -180,7 +172,6 @@ int adi_rcu_start_core(struct adi_rcu *rcu, int coreid)
180172

181173
return 0;
182174
}
183-
184175
EXPORT_SYMBOL(adi_rcu_start_core);
185176

186177
int adi_rcu_is_core_idle(struct adi_rcu *rcu, int coreid)
@@ -192,7 +183,6 @@ int adi_rcu_is_core_idle(struct adi_rcu *rcu, int coreid)
192183
return !!(adi_rcu_readl(rcu, ADI_RCU_REG_MSG) &
193184
(RCU0_MSG_C0IDLE << coreid));
194185
}
195-
196186
EXPORT_SYMBOL(adi_rcu_is_core_idle);
197187

198188
int adi_rcu_stop_core(struct adi_rcu *rcu, int coreid, int coreirq)
@@ -241,7 +231,6 @@ int adi_rcu_stop_core(struct adi_rcu *rcu, int coreid, int coreirq)
241231
adi_rcu_msg_clear(rcu, RCU0_MSG_C1ACTIVATE << (coreid - 1));
242232
return 0;
243233
}
244-
245234
EXPORT_SYMBOL(adi_rcu_stop_core);
246235

247236
static int adi_rcu_reboot(struct notifier_block *nb, unsigned long mode,
@@ -264,21 +253,15 @@ static int adi_rcu_probe(struct platform_device *pdev)
264253
struct device *dev = &pdev->dev;
265254
struct device_node *np = dev->of_node;
266255
struct adi_rcu *adi_rcu = NULL;
267-
struct resource *res;
256+
//struct resource *res;
268257
void __iomem *base;
269258
int ret;
270259

271260
adi_rcu = devm_kzalloc(dev, sizeof(*adi_rcu), GFP_KERNEL);
272261
if (!adi_rcu)
273262
return -ENOMEM;
274263

275-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
276-
if (!res) {
277-
dev_err(dev, "Cannot get RCU base address\n");
278-
return -ENODEV;
279-
}
280-
281-
base = devm_ioremap(dev, res->start, resource_size(res));
264+
base = devm_platform_ioremap_resource(pdev, 0);
282265
if (IS_ERR(base)) {
283266
dev_err(dev, "Cannot map RCU base address\n");
284267
return PTR_ERR(base);
@@ -323,7 +306,6 @@ static const struct of_device_id adi_rcu_match[] = {
323306
{.compatible = "adi,reset-controller" },
324307
{ }
325308
};
326-
327309
MODULE_DEVICE_TABLE(of, adi_rcu_match);
328310

329311
static struct platform_driver adi_rcu_driver = {

drivers/soc/adi/mach-sc5xx/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
# todo modularize with kconfigs
44

5-
obj-y := rcu.o sec.o icc.o
5+
obj-y := sec.o icc.o

drivers/soc/adi/mach-sc5xx/sec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <linux/spinlock.h>
2323

2424
#include <linux/soc/adi/rcu.h>
25-
#include "sec.h"
25+
#include <linux/soc/adi/sec.h>
2626

2727
struct adi_sec {
2828
void __iomem *ioaddr;

0 commit comments

Comments
 (0)