Skip to content

Commit b1de982

Browse files
bijudasgeertu
authored andcommitted
soc: renesas: rz-sysc: Add SoC identification for RZ/G3L SoC
Add SoC identification for the RZ/G3L SoC using the System Controller (SYSC) block. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20260203103031.247435-5-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
1 parent 6de23f8 commit b1de982

5 files changed

Lines changed: 108 additions & 0 deletions

File tree

drivers/soc/renesas/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,14 @@ config ARCH_R9A08G045
390390
help
391391
This enables support for the Renesas RZ/G3S SoC variants.
392392

393+
config ARCH_R9A08G046
394+
bool "ARM64 Platform support for R9A08G046 (RZ/G3L)"
395+
default y if ARCH_RENESAS
396+
select ARCH_RZG2L
397+
select SYSC_R9A08G046
398+
help
399+
This enables support for the Renesas RZ/G3L SoC variants.
400+
393401
config ARCH_R9A09G011
394402
bool "ARM64 Platform support for R9A09G011 (RZ/V2M)"
395403
default y if ARCH_RENESAS
@@ -474,6 +482,10 @@ config SYSC_R9A08G045
474482
bool "Renesas System controller support for R9A08G045 (RZ/G3S)" if COMPILE_TEST
475483
select SYSC_RZ
476484

485+
config SYSC_R9A08G046
486+
bool "Renesas System controller support for R9A08G046 (RZ/G3L)" if COMPILE_TEST
487+
select SYSC_RZ
488+
477489
config SYS_R9A09G047
478490
bool "Renesas System controller support for R9A09G047 (RZ/G3E)" if COMPILE_TEST
479491
select SYSC_RZ

drivers/soc/renesas/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ ifdef CONFIG_SMP
77
obj-$(CONFIG_ARCH_R9A06G032) += r9a06g032-smp.o
88
endif
99
obj-$(CONFIG_SYSC_R9A08G045) += r9a08g045-sysc.o
10+
obj-$(CONFIG_SYSC_R9A08G046) += r9a08g046-sysc.o
1011
obj-$(CONFIG_SYS_R9A09G047) += r9a09g047-sys.o
1112
obj-$(CONFIG_SYS_R9A09G056) += r9a09g056-sys.o
1213
obj-$(CONFIG_SYS_R9A09G057) += r9a09g057-sys.o
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
/*
3+
* RZ/G3L System controller (SYSC) driver
4+
*
5+
* Copyright (C) 2026 Renesas Electronics Corp.
6+
*/
7+
8+
#include <linux/bits.h>
9+
#include <linux/device.h>
10+
#include <linux/init.h>
11+
12+
#include "rz-sysc.h"
13+
14+
#define SYS_XSPI_MAP_STAADD_CS0 0x348
15+
#define SYS_XSPI_MAP_ENDADD_CS0 0x34c
16+
#define SYS_XSPI_MAP_STAADD_CS1 0x350
17+
#define SYS_XSPI_MAP_ENDADD_CS1 0x354
18+
#define SYS_GETH0_CFG 0x380
19+
#define SYS_GETH1_CFG 0x390
20+
#define SYS_PCIE_CFG 0x3a0
21+
#define SYS_PCIE_MON 0x3a4
22+
#define SYS_PCIE_PHY 0x3b4
23+
#define SYS_I2C0_CFG 0x400
24+
#define SYS_I2C1_CFG 0x410
25+
#define SYS_I2C2_CFG 0x420
26+
#define SYS_I2C3_CFG 0x430
27+
#define SYS_I3C_CFG 0x440
28+
#define SYS_PWRRDY_N 0xd70
29+
#define SYS_IPCONT_SEL_CLONECH 0xe2c
30+
31+
static bool rzg3l_regmap_readable_reg(struct device *dev, unsigned int reg)
32+
{
33+
switch (reg) {
34+
case SYS_XSPI_MAP_STAADD_CS0:
35+
case SYS_XSPI_MAP_ENDADD_CS0:
36+
case SYS_XSPI_MAP_STAADD_CS1:
37+
case SYS_XSPI_MAP_ENDADD_CS1:
38+
case SYS_GETH0_CFG:
39+
case SYS_GETH1_CFG:
40+
case SYS_PCIE_CFG:
41+
case SYS_PCIE_MON:
42+
case SYS_PCIE_PHY:
43+
case SYS_I2C0_CFG:
44+
case SYS_I2C1_CFG:
45+
case SYS_I2C2_CFG:
46+
case SYS_I2C3_CFG:
47+
case SYS_I3C_CFG:
48+
case SYS_PWRRDY_N:
49+
case SYS_IPCONT_SEL_CLONECH:
50+
return true;
51+
default:
52+
return false;
53+
}
54+
}
55+
56+
static bool rzg3l_regmap_writeable_reg(struct device *dev, unsigned int reg)
57+
{
58+
switch (reg) {
59+
case SYS_XSPI_MAP_STAADD_CS0:
60+
case SYS_XSPI_MAP_ENDADD_CS0:
61+
case SYS_XSPI_MAP_STAADD_CS1:
62+
case SYS_XSPI_MAP_ENDADD_CS1:
63+
case SYS_PCIE_CFG:
64+
case SYS_PCIE_PHY:
65+
case SYS_I2C0_CFG:
66+
case SYS_I2C1_CFG:
67+
case SYS_I2C2_CFG:
68+
case SYS_I2C3_CFG:
69+
case SYS_I3C_CFG:
70+
case SYS_PWRRDY_N:
71+
case SYS_IPCONT_SEL_CLONECH:
72+
return true;
73+
default:
74+
return false;
75+
}
76+
}
77+
78+
static const struct rz_sysc_soc_id_init_data rzg3l_sysc_soc_id_init_data __initconst = {
79+
.family = "RZ/G3L",
80+
.id = 0x87d9447,
81+
.devid_offset = 0xa04,
82+
.revision_mask = GENMASK(31, 28),
83+
.specific_id_mask = GENMASK(27, 0),
84+
};
85+
86+
const struct rz_sysc_init_data rzg3l_sysc_init_data __initconst = {
87+
.soc_id_init_data = &rzg3l_sysc_soc_id_init_data,
88+
.readable_reg = rzg3l_regmap_readable_reg,
89+
.writeable_reg = rzg3l_regmap_writeable_reg,
90+
.max_register = 0xe2c,
91+
};

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_SYSC_R9A08G045
8989
{ .compatible = "renesas,r9a08g045-sysc", .data = &rzg3s_sysc_init_data },
9090
#endif
91+
#ifdef CONFIG_SYSC_R9A08G046
92+
{ .compatible = "renesas,r9a08g046-sysc", .data = &rzg3l_sysc_init_data },
93+
#endif
9194
#ifdef CONFIG_SYS_R9A09G047
9295
{ .compatible = "renesas,r9a09g047-sys", .data = &rzg3e_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
@@ -46,6 +46,7 @@ struct rz_sysc_init_data {
4646
};
4747

4848
extern const struct rz_sysc_init_data rzg3e_sys_init_data;
49+
extern const struct rz_sysc_init_data rzg3l_sysc_init_data;
4950
extern const struct rz_sysc_init_data rzg3s_sysc_init_data;
5051
extern const struct rz_sysc_init_data rzv2h_sys_init_data;
5152
extern const struct rz_sysc_init_data rzv2n_sys_init_data;

0 commit comments

Comments
 (0)