diff mbox series

[v12,2/3] soc/sophgo: add top sysctrl layout file for CV18XX/SG200X

Message ID IA1PR20MB4953E0D56CE4010C470E4A71BB942@IA1PR20MB4953.namprd20.prod.outlook.com (mailing list archive)
State Superseded
Headers show
Series riscv: sophgo: add dmamux support for Sophgo CV1800/SG2000 SoCs | expand

Commit Message

Inochi Amaoto Aug. 27, 2024, 6:49 a.m. UTC
The "top" system controller of CV18XX/SG200X exposes control
register access for various devices. Add soc header file to
describe it.

Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
---
 include/soc/sophgo/cv1800-sysctl.h | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 include/soc/sophgo/cv1800-sysctl.h

Comments

Vinod Koul Aug. 28, 2024, 5:54 p.m. UTC | #1
On 27-08-24, 14:49, Inochi Amaoto wrote:
> The "top" system controller of CV18XX/SG200X exposes control
> register access for various devices. Add soc header file to
> describe it.

I dont think I am full onboard this idea, but still need someone to ack
it

> 
> Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
> ---
>  include/soc/sophgo/cv1800-sysctl.h | 30 ++++++++++++++++++++++++++++++

is soc/sophgo/ right path? why not include/soc/sifive/... (sorry dont
know much about this here...)
Inochi Amaoto Aug. 29, 2024, 1:38 a.m. UTC | #2
On Wed, Aug 28, 2024 at 11:24:24PM GMT, Vinod Koul wrote:
> On 27-08-24, 14:49, Inochi Amaoto wrote:
> > The "top" system controller of CV18XX/SG200X exposes control
> > register access for various devices. Add soc header file to
> > describe it.
> 
> I dont think I am full onboard this idea, 

Feel free to share your idea. I just added this file for
convenience to access the offset of the syscon device. 
In fact, I am not sure whether it is better to use reg
offset. Using reg adds some unncessary complexity, but
can avoid use this offset file. If you prefer this way,
it is OK for me to change.

> but still need someone to ack it

I am not sure there will be someone to ack it. If this patch
is kept.

> > 
> > Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
> > ---
> >  include/soc/sophgo/cv1800-sysctl.h | 30 ++++++++++++++++++++++++++++++
> 
> is soc/sophgo/ right path? why not include/soc/sifive/... (sorry dont
> know much about this here...)
> 

CV1800 is a SoC from Sophgo, it is not from SiFive.

Regards,
Inochi
Vinod Koul Aug. 29, 2024, 5:03 p.m. UTC | #3
On 29-08-24, 09:38, Inochi Amaoto wrote:
> On Wed, Aug 28, 2024 at 11:24:24PM GMT, Vinod Koul wrote:
> > On 27-08-24, 14:49, Inochi Amaoto wrote:
> > > The "top" system controller of CV18XX/SG200X exposes control
> > > register access for various devices. Add soc header file to
> > > describe it.
> > 
> > I dont think I am full onboard this idea, 
> 
> Feel free to share your idea. I just added this file for
> convenience to access the offset of the syscon device. 
> In fact, I am not sure whether it is better to use reg
> offset. Using reg adds some unncessary complexity, but
> can avoid use this offset file. If you prefer this way,
> it is OK for me to change.

I would just add the offsets that I need in local driver header and move
on...

> 
> > but still need someone to ack it
> 
> I am not sure there will be someone to ack it. If this patch
> is kept.
> 
> > > 
> > > Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
> > > ---
> > >  include/soc/sophgo/cv1800-sysctl.h | 30 ++++++++++++++++++++++++++++++
> > 
> > is soc/sophgo/ right path? why not include/soc/sifive/... (sorry dont
> > know much about this here...)
> > 
> 
> CV1800 is a SoC from Sophgo, it is not from SiFive.

As I said I am not sure, someone who is from this world should ack this
header
Inochi Amaoto Aug. 30, 2024, 1:30 a.m. UTC | #4
On Thu, Aug 29, 2024 at 10:33:27PM GMT, Vinod Koul wrote:
> On 29-08-24, 09:38, Inochi Amaoto wrote:
> > On Wed, Aug 28, 2024 at 11:24:24PM GMT, Vinod Koul wrote:
> > > On 27-08-24, 14:49, Inochi Amaoto wrote:
> > > > The "top" system controller of CV18XX/SG200X exposes control
> > > > register access for various devices. Add soc header file to
> > > > describe it.
> > > 
> > > I dont think I am full onboard this idea, 
> > 
> > Feel free to share your idea. I just added this file for
> > convenience to access the offset of the syscon device. 
> > In fact, I am not sure whether it is better to use reg
> > offset. Using reg adds some unncessary complexity, but
> > can avoid use this offset file. If you prefer this way,
> > it is OK for me to change.
> 
> I would just add the offsets that I need in local driver header and move
> on...
> 

Yeah, this is a solution. I think I should take it.
After rechecking the headers in the include/soc/.
I think I may make a mistake.

Regards,
Inochi
diff mbox series

Patch

diff --git a/include/soc/sophgo/cv1800-sysctl.h b/include/soc/sophgo/cv1800-sysctl.h
new file mode 100644
index 000000000000..b9396d33e240
--- /dev/null
+++ b/include/soc/sophgo/cv1800-sysctl.h
@@ -0,0 +1,30 @@ 
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (C) 2023 Inochi Amaoto <inochiama@outlook.com>
+ */
+
+#ifndef CV1800_SYSCTL_H
+#define CV1800_SYSCTL_H
+
+/*
+ * SOPHGO CV1800/SG2000 SoC top system controller registers offsets.
+ */
+
+#define CV1800_CONF_INFO		0x004
+#define CV1800_SYS_CTRL_REG		0x008
+#define CV1800_USB_PHY_CTRL_REG		0x048
+#define CV1800_SDMA_DMA_CHANNEL_REMAP0	0x154
+#define CV1800_SDMA_DMA_CHANNEL_REMAP1	0x158
+#define CV1800_TOP_TIMER_CLK_SEL	0x1a0
+#define CV1800_TOP_WDT_CTRL		0x1a8
+#define CV1800_DDR_AXI_URGENT_OW	0x1b8
+#define CV1800_DDR_AXI_URGENT		0x1bc
+#define CV1800_DDR_AXI_QOS_0		0x1d8
+#define CV1800_DDR_AXI_QOS_1		0x1dc
+#define CV1800_SD_PWRSW_CTRL		0x1f4
+#define CV1800_SD_PWRSW_TIME		0x1f8
+#define CV1800_DDR_AXI_QOS_OW		0x23c
+#define CV1800_SD_CTRL_OPT		0x294
+#define CV1800_SDMA_DMA_INT_MUX		0x298
+
+#endif // CV1800_SYSCTL_H