Skip to contentSkip to conversation

arm: hisi: enable Hi3521a soc

PATCH In review Marty E. Plummer 3 participants 9 messages May 1, 2022 – May 3, 2022 1 message not in the archive

Subsystems (6)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/2 clk: hisilicon: add CRG driver Hi3521a SoC

Add CRG driver for Hi3521A SoC. CRG (Clock and Reset Generator) module generates clock and reset signals used by other module blocks on SoC.

---
 drivers/clk/hisilicon/Kconfig             |   8 ++
 drivers/clk/hisilicon/Makefile            |   1 +
 drivers/clk/hisilicon/crg-hi3521a.c       | 141 ++++++++++++++++++++++
 include/dt-bindings/clock/hi3521a-clock.h |  34 ++++++
 4 files changed, 184 insertions(+)
 create mode 100644 drivers/clk/hisilicon/crg-hi3521a.c
 create mode 100644 include/dt-bindings/clock/hi3521a-clock.h
drivers/clk/hisilicon/Kconfig +8 -0
index c1ec75aa4ccd..72435c06bf4d 100644
@@ -15,6 +15,14 @@ config COMMON_CLK_HI3519
 	help
 	  Build the clock driver for hi3519.
 
+config COMMON_CLK_HI3521A
+	tristate "Hi3521a Clock Driver"
+	depends on ARCH_HISI || COMPILE_TEST
+	select RESET_HISI
+	default ARCH_HISI
+	help
+	  Build the clock driver for hi3521a.
+
 config COMMON_CLK_HI3559A
 	bool "Hi3559A Clock Driver"
 	depends on ARCH_HISI || COMPILE_TEST
drivers/clk/hisilicon/Makefile +1 -0
index 2978e56cb876..dc27acc5b885 100644
@@ -10,6 +10,7 @@ obj-$(CONFIG_ARCH_HIP04)	+= clk-hip04.o
 obj-$(CONFIG_ARCH_HIX5HD2)	+= clk-hix5hd2.o
 obj-$(CONFIG_COMMON_CLK_HI3516CV300)	+= crg-hi3516cv300.o
 obj-$(CONFIG_COMMON_CLK_HI3519)	+= clk-hi3519.o
+obj-$(CONFIG_COMMON_CLK_HI3521A)	+= crg-hi3521a.o
 obj-$(CONFIG_COMMON_CLK_HI3559A)	+= clk-hi3559a.o
 obj-$(CONFIG_COMMON_CLK_HI3660) += clk-hi3660.o
 obj-$(CONFIG_COMMON_CLK_HI3670) += clk-hi3670.o
drivers/clk/hisilicon/crg-hi3521a.c new file +141 -0

141 lines not on this page · raw message

include/dt-bindings/clock/hi3521a-clock.h new file +34 -0
new file mode 100644
index 000000000000..416a08079002
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier:	GPL-2.0-or-later */
+/*
+ * Copyright (C) 2017-2022 Marty E. Plummer <[email protected]>
+ */
+
+#ifndef __DTS_HI3521A_CLOCK_H
+#define __DTS_HI3521A_CLOCK_H
+
+/* clocks provided by the crg */
+#define HI3521A_FIXED_3M		1
+#define HI3521A_FMC_CLK			2
+#define HI3521A_SPI0_CLK		3
+#define HI3521A_UART0_CLK		4
+#define HI3521A_UART1_CLK		5
+#define HI3521A_UART2_CLK		6
+#define HI3521A_DMAC_CLK		7
+#define HI3521A_IR_CLK			8
+#define HI3521A_ETH_CLK			9
+#define HI3521A_ETH_MACIF_CLK	10
+#define HI3521A_USB2_BUS_CLK	11
+#define HI3521A_USB2_PORT_CLK	12
+#define HI3521A_APB_CLK			13
+
+/* clocks provided by the sysctrl */
+#define HI3521A_TIMER0_CLK		1
+#define HI3521A_TIMER1_CLK		2
+#define HI3521A_TIMER2_CLK		3
+#define HI3521A_TIMER3_CLK		4
+#define HI3521A_TIMER4_CLK		5
+#define HI3521A_TIMER5_CLK		6
+#define HI3521A_TIMER6_CLK		7
+#define HI3521A_TIMER7_CLK		8
+
+#endif /* __DTS_HI3521A_CLK_H */
Signature · 1 line
2.35.1
#2 lore raw

Re: [PATCH 1/2] clk: hisilicon: add CRG driver Hi3521a SoC

Quoted 4 lines · Marty E. Plummer

Add CRG driver for Hi3521A SoC. CRG (Clock and Reset Generator) module generates clock and reset signals used by other module blocks on SoC.

(...)

drivers/clk/hisilicon/crg-hi3521a.c line 141

Quoted 7 lines
drivers/clk/hisilicon/crg-hi3521a.c new file +7 -0
+		return;
+
+	hisi_clk_register_mux(hi3521a_sysctrl_mux_clks,
+				ARRAY_SIZE(hi3521a_sysctrl_mux_clks),
+				clk_data);
+}
+CLK_OF_DECLARE(hi3521a_sysctrl, "hisilicon,hi3521a-sysctrl", hi3521a_sysctrl_init);

Missing bindings.

Best regards,
Krzysztof

#3 lore raw

Re: [PATCH 1/2] clk: hisilicon: add CRG driver Hi3521a SoC

Quoted 7 lines · Krzysztof Kozlowski
Quoted 4 lines · Marty E. Plummer

Add CRG driver for Hi3521A SoC. CRG (Clock and Reset Generator) module generates clock and reset signals used by other module blocks on SoC.

(...)

Quoted 9 lines

drivers/clk/hisilicon/crg-hi3521a.c line 141

Quoted 7 lines
drivers/clk/hisilicon/crg-hi3521a.c new file +7 -0
+		return;
+
+	hisi_clk_register_mux(hi3521a_sysctrl_mux_clks,
+				ARRAY_SIZE(hi3521a_sysctrl_mux_clks),
+				clk_data);
+}
+CLK_OF_DECLARE(hi3521a_sysctrl, "hisilicon,hi3521a-sysctrl", hi3521a_sysctrl_init);

Missing bindings.

Assume you mean the Documentation/dt/binding/... file? Will do. I probably should have prefixed it with RFC, as I'm mostly hoping to get the attention of the hisi people to see what's the deal with the mtd reads being borked.

Quoted 2 lines

Best regards,
Krzysztof

#4 lore raw

Re: [PATCH 1/2] clk: hisilicon: add CRG driver Hi3521a SoC

Quoted 17 lines · Marty E. Plummer
Quoted 7 lines · Krzysztof Kozlowski
Quoted 4 lines · Marty E. Plummer

Add CRG driver for Hi3521A SoC. CRG (Clock and Reset Generator) module generates clock and reset signals used by other module blocks on SoC.

(...)

Quoted 9 lines

drivers/clk/hisilicon/crg-hi3521a.c line 141

Quoted 7 lines
drivers/clk/hisilicon/crg-hi3521a.c new file +7 -0
+		return;
+
+	hisi_clk_register_mux(hi3521a_sysctrl_mux_clks,
+				ARRAY_SIZE(hi3521a_sysctrl_mux_clks),
+				clk_data);
+}
+CLK_OF_DECLARE(hi3521a_sysctrl, "hisilicon,hi3521a-sysctrl", hi3521a_sysctrl_init);

Missing bindings.

Quoted 4 lines

Assume you mean the Documentation/dt/binding/... file? Will do. I probably should have prefixed it with RFC, as I'm mostly hoping to get the attention of the hisi people to see what's the deal with the mtd reads being borked.

Then just don't Cc devicetree folks and put in cover letter disclaimer that this was intentionally omitted and will be later fixed.

It is a waste of time of reviewers to look/filter/organize such email, if it is intentionally not for us.

Best regards,
Krzysztof

#5 lore raw

Re: [PATCH 1/2] clk: hisilicon: add CRG driver Hi3521a SoC

Quoted 18 lines · Krzysztof Kozlowski
Quoted 17 lines · Marty E. Plummer
Quoted 16 lines · Krzysztof Kozlowski
Quoted 4 lines · Marty E. Plummer

Add CRG driver for Hi3521A SoC. CRG (Clock and Reset Generator) module generates clock and reset signals used by other module blocks on SoC.

(...)

drivers/clk/hisilicon/crg-hi3521a.c line 141

Quoted 7 lines
drivers/clk/hisilicon/crg-hi3521a.c new file +7 -0
+		return;
+
+	hisi_clk_register_mux(hi3521a_sysctrl_mux_clks,
+				ARRAY_SIZE(hi3521a_sysctrl_mux_clks),
+				clk_data);
+}
+CLK_OF_DECLARE(hi3521a_sysctrl, "hisilicon,hi3521a-sysctrl", hi3521a_sysctrl_init);

Missing bindings.

Quoted 8 lines
Quoted 4 lines

Assume you mean the Documentation/dt/binding/... file? Will do. I probably should have prefixed it with RFC, as I'm mostly hoping to get the attention of the hisi people to see what's the deal with the mtd reads being borked.

Then just don't Cc devicetree folks and put in cover letter disclaimer that this was intentionally omitted and will be later fixed.

Yes, I should have disclaimered it, but I didn't intentionally cc dt folks, just what getmaintainer popped out.

Quoted 5 lines

It is a waste of time of reviewers to look/filter/organize such email, if it is intentionally not for us.

Best regards,
Krzysztof

#6 lore raw

PATCH 2/2 arm: hisi: enable Hi3521a soc

In reply to a message not in the archive

Enable Hisilicon Hi3521A/Hi3520DCV300 SoC. This SoC series includes hardware mutlimedia codec cores, commonly used in consumer cctv/dvr security systems and ipcameras. The arm core is a Cortex A7.

Add hi3521a.dtsi and hi3521a-rs-dm290e.dts for RaySharp CCTV systems, marketed under the name Samsung SDR-B74301N.

---
 arch/arm/boot/dts/Makefile | 2 ++
 arch/arm/mach-hisi/Kconfig | 9 +++++++++
 2 files changed, 11 insertions(+)
arch/arm/boot/dts/Makefile +2 -0
index 7c16f8a2b738..535cef3b14ab 100644
@@ -242,6 +242,8 @@ dtb-$(CONFIG_ARCH_GEMINI) += \
 	gemini-ssi1328.dtb \
 	gemini-wbd111.dtb \
 	gemini-wbd222.dtb
+dtb-$(CONFIG_ARCH_HI3521A) += \
+	hi3521a-rs-dm290e.dtb
 dtb-$(CONFIG_ARCH_HI3xxx) += \
 	hi3620-hi4511.dtb
 dtb-$(CONFIG_ARCH_HIGHBANK) += \
arch/arm/mach-hisi/Kconfig +9 -0
index 2e980f834a6a..165ffb972157 100644
@@ -13,6 +13,15 @@ if ARCH_HISI
 
 menu "Hisilicon platform type"
 
+config ARCH_HI3521A
+	bool "Hisilicon Hi3521a/Hi3520dcv300 family"
+	depends on ARCH_MULTI_V7
+	select CACHE_L2X0
+	select PINCTRL
+	select PINCTRL_SINGLE
+	help
+	  Hisilicon Hi3521a/Hi3520dcv300 family
+
 config ARCH_HI3xxx
 	bool "Hisilicon Hi36xx family"
 	depends on ARCH_MULTI_V7
Signature · 1 line
2.35.1
#7 lore raw
Thank you for the patch! Yet something to improve:

Hi "Marty,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on clk/clk-next]
[also build test ERROR on soc/for-next robh/for-next krzk/for-next krzk-mem-ctrl/for-next v5.18-rc4 next-20220429] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/intel-lab-lkp/linux/commits/Marty-E-Plummer/clk-hisilicon-add-CRG-driver-Hi3521a-SoC/20220501-141036
base:   https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next
config: arm-randconfig-r001-20220501 (https://download.01.org/0day-ci/archive/20220501/[email protected]/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.3.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/6677e373bf0fbceb87ba267fa934df2f4b7dc0ad
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Marty-E-Plummer/clk-hisilicon-add-CRG-driver-Hi3521a-SoC/20220501-141036 git checkout 6677e373bf0fbceb87ba267fa934df2f4b7dc0ad
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate

All errors (new ones prefixed by >>):

>> make[2]: *** No rule to make target 'arch/arm/boot/dts/hi3521a-rs-dm290e.dtb', needed by '__build'.

make[2]: Target '__build' not remade because of errors.

Signature · 2 lines
0-DAY CI Kernel Test Service
https://01.org/lkp
#8 lore raw
In reply to Marty E. Plummer
Quoted 6 lines · Marty E. Plummer

Enable Hisilicon Hi3521A/Hi3520DCV300 SoC. This SoC series includes hardware mutlimedia codec cores, commonly used in consumer cctv/dvr security systems and ipcameras. The arm core is a Cortex A7.

Add hi3521a.dtsi and hi3521a-rs-dm290e.dts for RaySharp CCTV systems, marketed under the name Samsung SDR-B74301N.

Where?

Quoted 12 lines
---
 arch/arm/boot/dts/Makefile | 2 ++
 arch/arm/mach-hisi/Kconfig | 9 +++++++++
 2 files changed, 11 insertions(+)
arch/arm/boot/dts/Makefile +0 -0
index 7c16f8a2b738..535cef3b14ab 100644

arch/arm/boot/dts/Makefile dtb-$(CONFIG_ARCH_GEMINI) += \ · line 246

Quoted 5 lines
arch/arm/boot/dts/Makefile +2 -0
@@ -242,6 +242,8 @@ dtb-$(CONFIG_ARCH_GEMINI) += \
 	gemini-ssi1328.dtb \
 	gemini-wbd111.dtb \
 	gemini-wbd222.dtb
+dtb-$(CONFIG_ARCH_HI3521A) += \
+	hi3521a-rs-dm290e.dtb

There is no such DTS.

Best regards,
Krzysztof

#9 lore raw
Quoted 17 lines · Krzysztof Kozlowski
Quoted 6 lines · Marty E. Plummer

Enable Hisilicon Hi3521A/Hi3520DCV300 SoC. This SoC series includes hardware mutlimedia codec cores, commonly used in consumer cctv/dvr security systems and ipcameras. The arm core is a Cortex A7.

Add hi3521a.dtsi and hi3521a-rs-dm290e.dts for RaySharp CCTV systems, marketed under the name Samsung SDR-B74301N.

Where?

Quoted 7 lines
---
 arch/arm/boot/dts/Makefile | 2 ++
 arch/arm/mach-hisi/Kconfig | 9 +++++++++
 2 files changed, 11 insertions(+)
Quoted 13 lines

arch/arm/boot/dts/Makefile dtb-$(CONFIG_ARCH_GEMINI) += \ · line 246

Quoted 10 lines
arch/arm/boot/dts/Makefile +2 -0
index 7c16f8a2b738..535cef3b14ab 100644
@@ -242,6 +242,8 @@ dtb-$(CONFIG_ARCH_GEMINI) += \
 	gemini-ssi1328.dtb \
 	gemini-wbd111.dtb \
 	gemini-wbd222.dtb
+dtb-$(CONFIG_ARCH_HI3521A) += \
+	hi3521a-rs-dm290e.dtb

There is no such DTS.

Ugh. Sorry, I've been fighting this for a while and must have missed it out of exaustion. will resend.

Quoted 3 lines

Best regards,
Krzysztof