diff options
| author | Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> | 2025-11-01 03:44:47 +0300 |
|---|---|---|
| committer | Tom Rini <trini@konsulko.com> | 2025-11-07 16:00:58 -0600 |
| commit | 9aa3e440c6e64b9af6a8e679d08686b9e816eecf (patch) | |
| tree | 6cd40e52c11de4df6bbea6ed76f5a1492b6b1085 | |
| parent | 97aa00e0211d1d0b387e69e4a568ec2ceec7815f (diff) | |
arm: airoha: introduce AN7581 helpers to get SCU and CHIP_SCU regmaps
We need access SCU and CHIP_SCU regmaps in several places (clk-airoha,
reset-airoha, airoha_eth). Unfortunately these regmaps can't be easily
retrieved with a common code, because of different Airoha SoCs uses
a different dts structure.
To make life easy we can write a commonly named SoC specific helpers
for these tasks. This patch implements helpers for Airoha AN7581 SoC.
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
| -rw-r--r-- | arch/arm/include/asm/arch-airoha/scu-regmap.h | 13 | ||||
| l--------- | arch/arm/include/asm/arch-an7581 | 1 | ||||
| -rw-r--r-- | arch/arm/mach-airoha/an7581/Makefile | 1 | ||||
| -rw-r--r-- | arch/arm/mach-airoha/an7581/scu-regmap.c | 30 |
4 files changed, 45 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-airoha/scu-regmap.h b/arch/arm/include/asm/arch-airoha/scu-regmap.h new file mode 100644 index 00000000000..31fc23d8c4d --- /dev/null +++ b/arch/arm/include/asm/arch-airoha/scu-regmap.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Author: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> + */ +#ifndef __AIROHA_SCU_REGMAP__ +#define __AIROHA_SCU_REGMAP__ + +#include <regmap.h> + +struct regmap *airoha_get_scu_regmap(void); +struct regmap *airoha_get_chip_scu_regmap(void); + +#endif diff --git a/arch/arm/include/asm/arch-an7581 b/arch/arm/include/asm/arch-an7581 new file mode 120000 index 00000000000..d2317ed3bc3 --- /dev/null +++ b/arch/arm/include/asm/arch-an7581 @@ -0,0 +1 @@ +arch-airoha
\ No newline at end of file diff --git a/arch/arm/mach-airoha/an7581/Makefile b/arch/arm/mach-airoha/an7581/Makefile index 886ab7e4eb9..51f978aa101 100644 --- a/arch/arm/mach-airoha/an7581/Makefile +++ b/arch/arm/mach-airoha/an7581/Makefile @@ -1,3 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 obj-y += init.o +obj-y += scu-regmap.o diff --git a/arch/arm/mach-airoha/an7581/scu-regmap.c b/arch/arm/mach-airoha/an7581/scu-regmap.c new file mode 100644 index 00000000000..7beeaecccc1 --- /dev/null +++ b/arch/arm/mach-airoha/an7581/scu-regmap.c @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Author: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> + */ + +#include <syscon.h> +#include <linux/err.h> +#include <asm/arch/scu-regmap.h> + +struct regmap *airoha_get_scu_regmap(void) +{ + ofnode node; + + node = ofnode_by_compatible(ofnode_null(), "airoha,en7581-scu"); + if (!ofnode_valid(node)) + return ERR_PTR(-EINVAL); + + return syscon_node_to_regmap(node); +} + +struct regmap *airoha_get_chip_scu_regmap(void) +{ + ofnode node; + + node = ofnode_by_compatible(ofnode_null(), "airoha,en7581-chip-scu"); + if (!ofnode_valid(node)) + return ERR_PTR(-EINVAL); + + return syscon_node_to_regmap(node); +} |
