From b42d5e4fe4a17d5ae87895b8fddf77f2a9574729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 24 Aug 2026 15:53:45 +0200 Subject: [PATCH 1/5] soc: adi: sc5xx: icc: Make internally used only functions static MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The three function adi_tru_set_trigger(), adi_tru_set_trigger_by_id() and adi_tru_trigger() are used only internally, so mark the functions static. adi_tru_trigger() is used by adi_tru_trigger_device(), so their order has to be swapped to not need a function declaration. Signed-off-by: Uwe Kleine-König --- drivers/soc/adi/mach-sc5xx/icc.c | 41 ++++++++++++++++---------------- include/linux/soc/adi/icc.h | 5 ---- 2 files changed, 20 insertions(+), 26 deletions(-) diff --git a/drivers/soc/adi/mach-sc5xx/icc.c b/drivers/soc/adi/mach-sc5xx/icc.c index df420864964741..f7e1d73bbd20e3 100644 --- a/drivers/soc/adi/mach-sc5xx/icc.c +++ b/drivers/soc/adi/mach-sc5xx/icc.c @@ -83,22 +83,6 @@ void put_adi_tru(struct adi_tru *tru) } EXPORT_SYMBOL(put_adi_tru); -int adi_tru_trigger_device(struct adi_tru *tru, struct device *dev) -{ - struct device_node *np = dev->of_node; - u32 master = 0; - - if (of_property_read_u32(np, "adi,tru-master-id", &master)) { - dev_err(tru->dev, - "dts entry %s is missing a adi,tru-master-id", - np->full_name); - return -ENOENT; - } - - return adi_tru_trigger(tru, master); -} -EXPORT_SYMBOL(adi_tru_trigger_device); - static int adi_tru_smc_trigger(struct adi_tru *tru, u32 master) { struct arm_smccc_res res; @@ -107,7 +91,7 @@ static int adi_tru_smc_trigger(struct adi_tru *tru, u32 master) return (res.a0 == 0) ? 0 : -EINVAL; } -int adi_tru_trigger(struct adi_tru *tru, u32 master) +static int adi_tru_trigger(struct adi_tru *tru, u32 master) { if (master == 0 || master > tru->max_master_id) { dev_err(tru->dev, "Invalid master ID to trigger %d\n", @@ -121,7 +105,22 @@ int adi_tru_trigger(struct adi_tru *tru, u32 master) writel(master, tru->ioaddr + ADI_TRU_REG_MTR); return 0; } -EXPORT_SYMBOL(adi_tru_trigger); + +int adi_tru_trigger_device(struct adi_tru *tru, struct device *dev) +{ + struct device_node *np = dev->of_node; + u32 master = 0; + + if (of_property_read_u32(np, "adi,tru-master-id", &master)) { + dev_err(tru->dev, + "dts entry %s is missing a adi,tru-master-id", + np->full_name); + return -ENOENT; + } + + return adi_tru_trigger(tru, master); +} +EXPORT_SYMBOL(adi_tru_trigger_device); /** * Configure the given slave (i.e. TRU_SSR[n]) to be triggered by the given @@ -130,7 +129,7 @@ EXPORT_SYMBOL(adi_tru_trigger); * count to SSR[187]) should be used as-is. There's effectively an ID 0 master * that is unused and undocumented. */ -int adi_tru_set_trigger_by_id(struct adi_tru *tru, u32 master, u32 slave) +static int adi_tru_set_trigger_by_id(struct adi_tru *tru, u32 master, u32 slave) { if (slave > tru->max_slave_id) { dev_err(tru->dev, "Invalid slave ID %d passed to %s", @@ -171,8 +170,8 @@ int adi_tru_set_trigger_by_id(struct adi_tru *tru, u32 master, u32 slave) * }; * then parse the phandles and pass the node here, then put the node back. */ -int adi_tru_set_trigger(struct adi_tru *tru, struct device_node *master, - struct device_node *slave) +static int adi_tru_set_trigger(struct adi_tru *tru, struct device_node *master, + struct device_node *slave) { u32 mid = 0; u32 sid = 0; diff --git a/include/linux/soc/adi/icc.h b/include/linux/soc/adi/icc.h index cb826537eafd93..4ac572c79744b9 100644 --- a/include/linux/soc/adi/icc.h +++ b/include/linux/soc/adi/icc.h @@ -114,12 +114,7 @@ struct adi_tru; struct adi_tru *get_adi_tru_from_node(struct device *dev); void put_adi_tru(struct adi_tru *tru); int adi_tru_trigger_device(struct adi_tru *tru, struct device *dev); -int adi_tru_trigger(struct adi_tru *tru, u32 master); -int adi_tru_set_trigger_by_id(struct adi_tru *tru, u32 master, u32 slave); int adi_tru_probe(struct platform_device *pdev); void adi_tru_remove(struct platform_device *pdev); -int adi_tru_set_trigger(struct adi_tru *tru, - struct device_node *master, - struct device_node *slave); #endif From 2b15323b3c0ac389addeaff10136b9da692f795a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Tue, 25 Aug 2026 12:53:03 +0200 Subject: [PATCH 2/5] soc: adi: sc5xx: rcu: Make various functions static MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The functions adi_rcu_check_coreid_valid(), adi_rcu_reset_core(), adi_rcu_start_core() and adi_rcu_stop_core() are only used within the compile unit and so can be static and don't need to be exported. Signed-off-by: Uwe Kleine-König --- drivers/soc/adi/mach-sc5xx/rcu.c | 16 ++++------------ include/linux/soc/adi/rcu.h | 4 ---- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/drivers/soc/adi/mach-sc5xx/rcu.c b/drivers/soc/adi/mach-sc5xx/rcu.c index aee990d93ace32..b4cdde5962732b 100644 --- a/drivers/soc/adi/mach-sc5xx/rcu.c +++ b/drivers/soc/adi/mach-sc5xx/rcu.c @@ -126,7 +126,7 @@ void adi_rcu_set_sec(struct adi_rcu *rcu, struct adi_sec *sec) } // API for other drivers to interact with RCU -int adi_rcu_check_coreid_valid(struct adi_rcu *rcu, int coreid) +static int adi_rcu_check_coreid_valid(struct adi_rcu *rcu, int coreid) { if (coreid < rcu->sharc_min_coreid || coreid > rcu->sharc_max_coreid) @@ -134,9 +134,7 @@ int adi_rcu_check_coreid_valid(struct adi_rcu *rcu, int coreid) return 0; } -EXPORT_SYMBOL(adi_rcu_check_coreid_valid); - -int adi_rcu_reset_core(struct adi_rcu *rcu, int coreid) +static int adi_rcu_reset_core(struct adi_rcu *rcu, int coreid) { u32 val; int ret; @@ -181,9 +179,7 @@ int adi_rcu_reset_core(struct adi_rcu *rcu, int coreid) return 0; } -EXPORT_SYMBOL(adi_rcu_reset_core); - -int adi_rcu_start_core(struct adi_rcu *rcu, int coreid) +static int adi_rcu_start_core(struct adi_rcu *rcu, int coreid) { int ret; @@ -200,8 +196,6 @@ int adi_rcu_start_core(struct adi_rcu *rcu, int coreid) return 0; } -EXPORT_SYMBOL(adi_rcu_start_core); - int adi_rcu_is_core_idle(struct adi_rcu *rcu, int coreid) { int ret = adi_rcu_check_coreid_valid(rcu, coreid); @@ -214,7 +208,7 @@ int adi_rcu_is_core_idle(struct adi_rcu *rcu, int coreid) EXPORT_SYMBOL(adi_rcu_is_core_idle); -int adi_rcu_stop_core(struct adi_rcu *rcu, int coreid, int coreirq) +static int adi_rcu_stop_core(struct adi_rcu *rcu, int coreid, int coreirq) { unsigned long timeout = jiffies + ADI_RCU_CORE_INIT_TIMEOUT; bool is_timeout = true; @@ -261,8 +255,6 @@ int adi_rcu_stop_core(struct adi_rcu *rcu, int coreid, int coreirq) return 0; } -EXPORT_SYMBOL(adi_rcu_stop_core); - /* * Reset controller ops * diff --git a/include/linux/soc/adi/rcu.h b/include/linux/soc/adi/rcu.h index aac6e1c13cbfdc..1e47f26a2a3966 100644 --- a/include/linux/soc/adi/rcu.h +++ b/include/linux/soc/adi/rcu.h @@ -76,10 +76,6 @@ void adi_rcu_msg_clear(struct adi_rcu *rcu, u32 bits); /* * These are defined for use with SHARC cores not ARM cores */ -int adi_rcu_check_coreid_valid(struct adi_rcu *rcu, int coreid); -int adi_rcu_reset_core(struct adi_rcu *rcu, int coreid); -int adi_rcu_start_core(struct adi_rcu *rcu, int coreid); -int adi_rcu_stop_core(struct adi_rcu *rcu, int coreid, int coreirq); int adi_rcu_is_core_idle(struct adi_rcu *rcu, int coreid); void adi_rcu_set_sec(struct adi_rcu *rcu, struct adi_sec *sec); From 7928f7431db7e2abdec4697823c4b4cfd9cef7e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Tue, 25 Aug 2026 11:17:58 +0200 Subject: [PATCH 3/5] soc: adi: sc5xx: sec: Drop unused functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both get_adi_sec_from_node() and put_adi_sec() are not used, and never were since they were introduced. So drop them. Signed-off-by: Uwe Kleine-König --- drivers/soc/adi/mach-sc5xx/sec.c | 34 -------------------------------- drivers/soc/adi/mach-sc5xx/sec.h | 2 -- 2 files changed, 36 deletions(-) diff --git a/drivers/soc/adi/mach-sc5xx/sec.c b/drivers/soc/adi/mach-sc5xx/sec.c index 6e86ff51561a84..a680e18e3bd918 100644 --- a/drivers/soc/adi/mach-sc5xx/sec.c +++ b/drivers/soc/adi/mach-sc5xx/sec.c @@ -128,40 +128,6 @@ void sec_set_ssi_coreid(struct adi_sec *sec, unsigned int sid, EXPORT_SYMBOL(sec_set_ssi_coreid); -struct adi_sec *get_adi_sec_from_node(struct device *dev) -{ - struct platform_device *sec_pdev; - struct device_node *sec_node; - struct adi_sec *ret = NULL; - - sec_node = of_parse_phandle(dev->of_node, "adi,sec", 0); - if (!sec_node) { - dev_err(dev, "Missing adi,sec phandle in device tree\n"); - return ERR_PTR(-ENODEV); - } - - sec_pdev = of_find_device_by_node(sec_node); - if (!sec_pdev) { - ret = ERR_PTR(-EPROBE_DEFER); - goto cleanup; - } - - ret = dev_get_drvdata(&sec_pdev->dev); - -cleanup: - of_node_put(sec_node); - return ret; -} - -EXPORT_SYMBOL(get_adi_sec_from_node); - -void put_adi_sec(struct adi_sec *sec) -{ - put_device(sec->dev); -} - -EXPORT_SYMBOL(put_adi_sec); - static int adi_sec_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; diff --git a/drivers/soc/adi/mach-sc5xx/sec.h b/drivers/soc/adi/mach-sc5xx/sec.h index 4aae2e05c49565..6398915727716d 100644 --- a/drivers/soc/adi/mach-sc5xx/sec.h +++ b/drivers/soc/adi/mach-sc5xx/sec.h @@ -54,8 +54,6 @@ void sec_enable_ssi(struct adi_sec *sec, unsigned int sid, bool fault, bool source); void sec_set_ssi_coreid(struct adi_sec *sec, unsigned int sid, unsigned int coreid); -struct adi_sec *get_adi_sec_from_node(struct device *dev); -void put_adi_sec(struct adi_sec *sec); void adi_sec_writel(u32 val, struct adi_sec *rcu, int offset); u32 adi_sec_readl(struct adi_sec *rcu, int offset); From cbbd3d76ae76f04655ce562913881ff4cf41a783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Tue, 25 Aug 2026 12:49:42 +0200 Subject: [PATCH 4/5] soc: adi: sc5xx: rcu: Typo fix manully -> manually MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Uwe Kleine-König --- drivers/soc/adi/mach-sc5xx/rcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/adi/mach-sc5xx/rcu.c b/drivers/soc/adi/mach-sc5xx/rcu.c index b4cdde5962732b..333742e61ea9d6 100644 --- a/drivers/soc/adi/mach-sc5xx/rcu.c +++ b/drivers/soc/adi/mach-sc5xx/rcu.c @@ -234,7 +234,7 @@ static int adi_rcu_stop_core(struct adi_rcu *rcu, int coreid, int coreirq) sec_raise_irq(rcu->sec, coreirq); } // Wait until the specific core enter into IDLE bit(8:10) - // DSP should set the IDLE bit to 1 manully in ISR + // DSP should set the IDLE bit to 1 manually in ISR do { if (adi_rcu_is_core_idle(rcu, coreid)) { is_timeout = false; From 540f215d0ad6502bd69b01d38ce565e1273e307e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Tue, 25 Aug 2026 14:01:58 +0200 Subject: [PATCH 5/5] soc: adi: Drop empty mach-sc59x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is only a single .c file which only consists of #include statements. There is no code generated and throwing that away doesn't hurt. So do that. Signed-off-by: Uwe Kleine-König --- drivers/soc/adi/Makefile | 1 - drivers/soc/adi/mach-sc59x/Makefile | 5 ---- drivers/soc/adi/mach-sc59x/core.c | 37 ----------------------------- drivers/soc/adi/mach-sc59x/core.h | 26 -------------------- 4 files changed, 69 deletions(-) delete mode 100644 drivers/soc/adi/mach-sc59x/Makefile delete mode 100644 drivers/soc/adi/mach-sc59x/core.c delete mode 100644 drivers/soc/adi/mach-sc59x/core.h diff --git a/drivers/soc/adi/Makefile b/drivers/soc/adi/Makefile index 675431006b715d..974cc245a0bad0 100644 --- a/drivers/soc/adi/Makefile +++ b/drivers/soc/adi/Makefile @@ -1,4 +1,3 @@ # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -obj-$(CONFIG_ADI_MACH_SC59X) += mach-sc59x/ obj-$(CONFIG_ADI_MACH_SC5XX) += mach-sc5xx/ diff --git a/drivers/soc/adi/mach-sc59x/Makefile b/drivers/soc/adi/mach-sc59x/Makefile deleted file mode 100644 index 44baa95f0256de..00000000000000 --- a/drivers/soc/adi/mach-sc59x/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)-or-later - -# todo modularize with kconfigs - -obj-y := core.o diff --git a/drivers/soc/adi/mach-sc59x/core.c b/drivers/soc/adi/mach-sc59x/core.c deleted file mode 100644 index 70caf38633d1f1..00000000000000 --- a/drivers/soc/adi/mach-sc59x/core.c +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * core timer and machine init for ADI processor on-chip memory - * - * (C) Copyright 2022 - Analog Devices, Inc. - * - * Written and/or maintained by Timesys Corporation - * - * Contact: Nathan Barrett-Morrison - * Contact: Greg Malysa - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include "core.h" diff --git a/drivers/soc/adi/mach-sc59x/core.h b/drivers/soc/adi/mach-sc59x/core.h deleted file mode 100644 index a8a2f8add269d7..00000000000000 --- a/drivers/soc/adi/mach-sc59x/core.h +++ /dev/null @@ -1,26 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* - * core timer and machine init for ADI processor on-chip memory - * - * (C) Copyright 2022 - Analog Devices, Inc. - * - * Written and/or maintained by Timesys Corporation - * - * Contact: Nathan Barrett-Morrison - * Contact: Greg Malysa - * - */ - -#ifndef __ASM_ARCH_SC58X_H -#define __ASM_ARCH_SC58X_H - -#include -#include - -extern void __init sc59x_init(void); -extern void __init sc59x_init_early(void); -extern void __init sc59x_init_irq(void); -extern void __init sc59x_map_io(void); -extern void sc59x_timer_init(void); -extern void sc59x_clock_init(void); -#endif