Skip to content

Commit 8575158

Browse files
committed
Merge tag 'renesas-drivers-for-v6.16-tag2' of https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into soc/drivers
Renesas driver updates for v6.16 (take two) - Cover all R-Car drivers in the ARM/RISC-V/RENESAS ARCHITECTURE maintainer entry, - Identify the Renesas RZ/V2N (R9A09G056) SoC. * tag 'renesas-drivers-for-v6.16-tag2' of https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: soc: renesas: rz-sysc: Add SoC identification for RZ/V2N SoC MAINTAINERS: Generalize ARM/RISC-V/RENESAS ARCHITECTURE Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]>
2 parents 60dce06 + 3903b47 commit 8575158

File tree

6 files changed

+86
-1
lines changed

6 files changed

+86
-1
lines changed

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3063,10 +3063,10 @@ F: arch/arm/include/debug/renesas-scif.S
30633063
F: arch/arm/mach-shmobile/
30643064
F: arch/arm64/boot/dts/renesas/
30653065
F: arch/riscv/boot/dts/renesas/
3066-
F: drivers/nvmem/rcar-efuse.c
30673066
F: drivers/pmdomain/renesas/
30683067
F: drivers/soc/renesas/
30693068
F: include/linux/soc/renesas/
3069+
N: rcar
30703070
K: \brenesas,
30713071

30723072
ARM/RISCPC ARCHITECTURE

drivers/soc/renesas/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ config ARCH_R9A09G047
396396
config ARCH_R9A09G056
397397
bool "ARM64 Platform support for RZ/V2N"
398398
default y if ARCH_RENESAS
399+
select SYS_R9A09G056
399400
help
400401
This enables support for the Renesas RZ/V2N SoC variants.
401402

@@ -445,6 +446,10 @@ config SYS_R9A09G047
445446
bool "Renesas RZ/G3E System controller support" if COMPILE_TEST
446447
select SYSC_RZ
447448

449+
config SYS_R9A09G056
450+
bool "Renesas RZ/V2N System controller support" if COMPILE_TEST
451+
select SYSC_RZ
452+
448453
config SYS_R9A09G057
449454
bool "Renesas RZ/V2H System controller support" if COMPILE_TEST
450455
select SYSC_RZ

drivers/soc/renesas/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ obj-$(CONFIG_ARCH_R9A06G032) += r9a06g032-smp.o
88
endif
99
obj-$(CONFIG_SYSC_R9A08G045) += r9a08g045-sysc.o
1010
obj-$(CONFIG_SYS_R9A09G047) += r9a09g047-sys.o
11+
obj-$(CONFIG_SYS_R9A09G056) += r9a09g056-sys.o
1112
obj-$(CONFIG_SYS_R9A09G057) += r9a09g057-sys.o
1213

1314
# Family

drivers/soc/renesas/r9a09g056-sys.c

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
/*
3+
* RZ/V2N System controller (SYS) driver
4+
*
5+
* Copyright (C) 2025 Renesas Electronics Corp.
6+
*/
7+
8+
#include <linux/bitfield.h>
9+
#include <linux/bits.h>
10+
#include <linux/device.h>
11+
#include <linux/init.h>
12+
#include <linux/io.h>
13+
14+
#include "rz-sysc.h"
15+
16+
/* Register Offsets */
17+
#define SYS_LSI_MODE 0x300
18+
#define SYS_LSI_MODE_SEC_EN BIT(16)
19+
/*
20+
* BOOTPLLCA[1:0]
21+
* [0,0] => 1.1GHZ
22+
* [0,1] => 1.5GHZ
23+
* [1,0] => 1.6GHZ
24+
* [1,1] => 1.7GHZ
25+
*/
26+
#define SYS_LSI_MODE_STAT_BOOTPLLCA55 GENMASK(12, 11)
27+
#define SYS_LSI_MODE_CA55_1_7GHZ 0x3
28+
29+
#define SYS_LSI_PRR 0x308
30+
#define SYS_LSI_PRR_GPU_DIS BIT(0)
31+
#define SYS_LSI_PRR_ISP_DIS BIT(4)
32+
33+
#define SYS_RZV2N_FEATURE_G31 BIT(0)
34+
#define SYS_RZV2N_FEATURE_C55 BIT(1)
35+
#define SYS_RZV2N_FEATURE_SEC BIT(2)
36+
37+
static void rzv2n_sys_print_id(struct device *dev,
38+
void __iomem *sysc_base,
39+
struct soc_device_attribute *soc_dev_attr)
40+
{
41+
u32 prr_val, mode_val;
42+
u8 feature_flags;
43+
44+
prr_val = readl(sysc_base + SYS_LSI_PRR);
45+
mode_val = readl(sysc_base + SYS_LSI_MODE);
46+
47+
/* Check GPU, ISP and Cryptographic configuration */
48+
feature_flags = !(prr_val & SYS_LSI_PRR_GPU_DIS) ? SYS_RZV2N_FEATURE_G31 : 0;
49+
feature_flags |= !(prr_val & SYS_LSI_PRR_ISP_DIS) ? SYS_RZV2N_FEATURE_C55 : 0;
50+
feature_flags |= (mode_val & SYS_LSI_MODE_SEC_EN) ? SYS_RZV2N_FEATURE_SEC : 0;
51+
52+
dev_info(dev, "Detected Renesas %s %sn%d Rev %s%s%s%s%s\n", soc_dev_attr->family,
53+
soc_dev_attr->soc_id, 41 + feature_flags, soc_dev_attr->revision,
54+
feature_flags ? " with" : "",
55+
feature_flags & SYS_RZV2N_FEATURE_G31 ? " GE3D (Mali-G31)" : "",
56+
feature_flags & SYS_RZV2N_FEATURE_SEC ? " Cryptographic engine" : "",
57+
feature_flags & SYS_RZV2N_FEATURE_C55 ? " ISP (Mali-C55)" : "");
58+
59+
/* Check CA55 PLL configuration */
60+
if (FIELD_GET(SYS_LSI_MODE_STAT_BOOTPLLCA55, mode_val) != SYS_LSI_MODE_CA55_1_7GHZ)
61+
dev_warn(dev, "CA55 PLL is not set to 1.7GHz\n");
62+
}
63+
64+
static const struct rz_sysc_soc_id_init_data rzv2n_sys_soc_id_init_data __initconst = {
65+
.family = "RZ/V2N",
66+
.id = 0x867d447,
67+
.devid_offset = 0x304,
68+
.revision_mask = GENMASK(31, 28),
69+
.specific_id_mask = GENMASK(27, 0),
70+
.print_id = rzv2n_sys_print_id,
71+
};
72+
73+
const struct rz_sysc_init_data rzv2n_sys_init_data = {
74+
.soc_id_init_data = &rzv2n_sys_soc_id_init_data,
75+
};

drivers/soc/renesas/rz-sysc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ static const struct of_device_id rz_sysc_match[] = {
8888
#ifdef CONFIG_SYS_R9A09G047
8989
{ .compatible = "renesas,r9a09g047-sys", .data = &rzg3e_sys_init_data },
9090
#endif
91+
#ifdef CONFIG_SYS_R9A09G056
92+
{ .compatible = "renesas,r9a09g056-sys", .data = &rzv2n_sys_init_data },
93+
#endif
9194
#ifdef CONFIG_SYS_R9A09G057
9295
{ .compatible = "renesas,r9a09g057-sys", .data = &rzv2h_sys_init_data },
9396
#endif

drivers/soc/renesas/rz-sysc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,6 @@ struct rz_sysc_init_data {
4242
extern const struct rz_sysc_init_data rzg3e_sys_init_data;
4343
extern const struct rz_sysc_init_data rzg3s_sysc_init_data;
4444
extern const struct rz_sysc_init_data rzv2h_sys_init_data;
45+
extern const struct rz_sysc_init_data rzv2n_sys_init_data;
4546

4647
#endif /* __SOC_RENESAS_RZ_SYSC_H__ */

0 commit comments

Comments
 (0)