Skip to contentSkip to conversation

enable hisilicon hi3xxx SoC

PATCH New Haojian Zhuang 2 participants 14 messages Dec 11, 2013 – Dec 18, 2013

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v12 cover enable hisilicon hi3xxx SoC

v12:
1. Add CONFIG_SMP as default selection. Add GPIOLIB as default selection.
2. Use macro definition to replace constant number in IO mapping of hi3620.c.
3. Add more comments in platsmp.c.

v11:
1. Add comments on iotable.
2. Use dummy clock in DTS. Remove common clock binding in DTS file. Clock driver will be in another patchset.

v10:
1. Use static IO mapping in Hi3xxx.
2. Totally drop to support of Hi3716.
3. Rename smp-off property to smp-offset.
4. Remove hardcoding in hotplug driver.

v9:
1. Clean code in DTS file according to Olof's comments.
2. Since debug ll patch is going through Russell's tree, remove it from this patch set.

v8:
1. Drop to support CLK_GATE_SEPERATED_REG in common clock gate driver. Support this feature in hi3xxx clock driver.
2. Clean unnecessary device node in DTS.
3. Define all clocks in hi3620-clk.dtsi. And all clock nodes are defined in the clocks node.
4. Fix the clock gate & clock mux for timer.
5. Rename timer0~4 to dual_timer0~4 in DTS file. It's used to make name clearer.

v7:
1. Add hi3xxx_defconfig.
2. Use reg property in clock node.
3. Drop origin clock divider table.
4. Reuse clock divider register helper.
5. Reuse clock gate register helper.
6. Append CLK_GATE_SEPERATED_REG flag in order to support Hisilicon

    Hi3620 SoC.

7. Rebase DEBUG_LL for Hi3xxx.
8. Add more clock node in DTS file.

v6:
1. Remove hisilicon string from properties in clock driver.
2. Replace array by pointer in clock driver. Since only sctrl parent node exists at this time.

v5:
1. Remove HIWORD clk patches since they're merged into clk git tree.
2. Set hisilicon,clk-reset property of clkgate node is optional.
3. Update on commandline args in DTS file. Remove earlyprintk, mem, nfs.
4. Move gpio-keys out of amba node in DTS file.

v4:
1. Add clk gate with HIWORD mask for Rockchip.
2. Update comments and code of HIWORD flags for mux/divider.
3. Append a mux without HIWORD mask in Hisilicon 3620.
4. Fix the pinmux setting in Hi4511.

v3:
1. Use clk_register_mux_table().

v2:
1. Reuse mux & divider driver. So append CLK_MUX_HIWORD_MASK & CLK_DIVIDER_HIWORD_MASK for Hi3620 SoC.
2. Fix system timer running too fast because wrong divider is choosen.
3. Remove .init_irq in DT machine descriptor.

#1 lore raw

PATCH v12 1/8 ARM: hi3xxx: add board support with device tree

From: Haojian Zhuang <[email protected]>

Add board support with device tree for Hisilicon Hi3620 SoC platform.

Changelog:
v11:
1. Add comments for iotable.

v10:
1. Add .map_io() & debug_ll_io_init() back. Since debug_ll_io_init() is only called if .map_io() isn't assigned. Use .map_io() to setup static IO mapping that is used in clock driver.

v3:
1. Remove .map_io() in DT machine descriptor. Since debug_ll_io_init() is called by default.
2. Remove .init_machine() in DT machine descriptor. Since of_platform_populate() is called by default in DT mode.

v2:
1. Remove .init_irq() in DT machine descriptor. Since irqchip_init() is called by default in DT mode.

---
 .../bindings/arm/hisilicon/hisilicon.txt           |  6 +++
 arch/arm/Kconfig                                   |  2 +
 arch/arm/Makefile                                  |  1 +
 arch/arm/mach-hi3xxx/Kconfig                       | 12 +++++
 arch/arm/mach-hi3xxx/Makefile                      |  5 ++
 arch/arm/mach-hi3xxx/hi3xxx.c                      | 60 ++++++++++++++++++++++
 6 files changed, 86 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt
 create mode 100644 arch/arm/mach-hi3xxx/Kconfig
 create mode 100644 arch/arm/mach-hi3xxx/Makefile
 create mode 100644 arch/arm/mach-hi3xxx/hi3xxx.c
Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt new file +6 -0
new file mode 100644
index 0000000..21a7336
@@ -0,0 +1,6 @@
+Hisilicon Platforms Device Tree Bindings
+----------------------------------------------------
+
+Hi4511 Board
+Required root node properties:
+	- compatible = "hisilicon,hi3620-hi4511";
arch/arm/Kconfig +2 -0
index c1f1a7e..75eb5323 100644
@@ -925,6 +925,8 @@ source "arch/arm/mach-footbridge/Kconfig"
 
 source "arch/arm/mach-gemini/Kconfig"
 
+source "arch/arm/mach-hi3xxx/Kconfig"
+
 source "arch/arm/mach-highbank/Kconfig"
 
 source "arch/arm/mach-integrator/Kconfig"
arch/arm/Makefile +1 -0
index c99b108..dfbafa3 100644
@@ -156,6 +156,7 @@ machine-$(CONFIG_ARCH_EBSA110)		+= ebsa110
 machine-$(CONFIG_ARCH_EP93XX)		+= ep93xx
 machine-$(CONFIG_ARCH_EXYNOS)		+= exynos
 machine-$(CONFIG_ARCH_GEMINI)		+= gemini
+machine-$(CONFIG_ARCH_HI3xxx)		+= hi3xxx
 machine-$(CONFIG_ARCH_HIGHBANK)		+= highbank
 machine-$(CONFIG_ARCH_INTEGRATOR)	+= integrator
 machine-$(CONFIG_ARCH_IOP13XX)		+= iop13xx
arch/arm/mach-hi3xxx/Kconfig new file +12 -0
new file mode 100644
index 0000000..68bd26c
@@ -0,0 +1,12 @@
+config ARCH_HI3xxx
+	bool "Hisilicon Hi36xx/Hi37xx family" if ARCH_MULTI_V7
+	select ARM_AMBA
+	select ARM_GIC
+	select ARM_TIMER_SP804
+	select CACHE_L2X0
+	select CLKSRC_OF
+	select GENERIC_CLOCKEVENTS
+	select PINCTRL
+	select PINCTRL_SINGLE
+	help
+	  Support for Hisilicon Hi36xx/Hi37xx processor family
arch/arm/mach-hi3xxx/Makefile new file +5 -0
new file mode 100644
index 0000000..d68ebb3
@@ -0,0 +1,5 @@
+#
+# Makefile for Hisilicon Hi36xx/Hi37xx processors line
+#
+
+obj-y	+= hi3xxx.o
arch/arm/mach-hi3xxx/hi3xxx.c new file +60 -0

60 lines not on this page · raw message

Signature · 1 line
1.8.3.2
#2 lore raw

PATCH v12 1/8 ARM: hi3xxx: add board support with device tree

Quoted 4 lines · Haojian Zhuang

From: Haojian Zhuang <[email protected]>

Add board support with device tree for Hisilicon Hi3620 SoC platform.

This patch still has checkpatch problems:

ERROR: Use of const init definition must use __initconst #166: FILE: arch/arm/mach-hi3xxx/hi3xxx.c:51:
+static const char *hi3xxx_compat[] __initdata = {

I know you're frustrated that it's taken a long time to get this stuff merged, but these are the kinds of mistakes that make us have to take a *very* close look at every detail, which greatly slows down the process.

I'll fix this up locally, but please be sure to run checkpatch on your patches before submitting.

Quoted 15 lines

Changelog:
v11:
1. Add comments for iotable.

v10:
1. Add .map_io() & debug_ll_io_init() back. Since debug_ll_io_init() is only called if .map_io() isn't assigned. Use .map_io() to setup static IO mapping that is used in clock driver.

v3:
1. Remove .map_io() in DT machine descriptor. Since debug_ll_io_init() is called by default.
2. Remove .init_machine() in DT machine descriptor. Since of_platform_populate() is called by default in DT mode.

Quoted 3 lines

v2:
1. Remove .init_irq() in DT machine descriptor. Since irqchip_init() is called by default in DT mode.

Also not a major deal, but typically the full changelog history goes after the '---' since in most cases, it's not relevant to the permanent git history.

Kevin

#3 lore raw

PATCH v12 2/8 ARM: dts: enable hi4511 with device tree

In reply to Haojian Zhuang

From: Haojian Zhuang <[email protected]>

Enable Hisilicon Hi4511 development platform with device tree support.

---
 arch/arm/boot/dts/Makefile    |   1 +
 arch/arm/boot/dts/hi3620.dtsi | 518 +++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/hi4511.dts  | 648 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 1167 insertions(+)
 create mode 100644 arch/arm/boot/dts/hi3620.dtsi
 create mode 100644 arch/arm/boot/dts/hi4511.dts
arch/arm/boot/dts/Makefile +1 -0
index d57c1a6..a4c771f 100644
@@ -66,6 +66,7 @@ dtb-$(CONFIG_ARCH_EXYNOS) += exynos4210-origen.dtb \
 	exynos5420-smdk5420.dtb \
 	exynos5440-sd5v1.dtb \
 	exynos5440-ssdk5440.dtb
+dtb-$(CONFIG_ARCH_HI3xxx) += hi4511.dtb
 dtb-$(CONFIG_ARCH_HIGHBANK) += highbank.dtb \
 	ecx-2000.dtb
 dtb-$(CONFIG_ARCH_INTEGRATOR) += integratorap.dtb \
arch/arm/boot/dts/hi3620.dtsi new file +518 -0

518 lines not on this page · raw message

arch/arm/boot/dts/hi4511.dts new file +648 -0

648 lines not on this page · raw message

Signature · 1 line
1.8.3.2
#4 lore raw

PATCH v12 3/8 ARM: config: enable hi3xxx in multi_v7_defconfig

In reply to Haojian Zhuang

From: Haojian Zhuang <[email protected]>

Enable ARCH_HI3xxx in multi_v7_defconfig.

---
 arch/arm/configs/multi_v7_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/multi_v7_defconfig +1 -0
index 4a5903e..7910d22 100644
@@ -9,6 +9,7 @@ CONFIG_ARCH_BCM=y
 CONFIG_ARCH_BCM_MOBILE=y
 CONFIG_GPIO_PCA953X=y
 CONFIG_ARCH_HIGHBANK=y
+CONFIG_ARCH_HI3xxx=y
 CONFIG_ARCH_KEYSTONE=y
 CONFIG_ARCH_MXC=y
 CONFIG_MACH_IMX51_DT=y
Signature · 1 line
1.8.3.2
#5 lore raw

PATCH v12 4/8 ARM: config: add defconfig for Hi3xxx

In reply to Haojian Zhuang

From: Haojian Zhuang <[email protected]>

Add default config for arch-hi3xxx. It's used for Hisilicon Hi3xxx SoC.

---
 arch/arm/configs/hi3xxx_defconfig | 56 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 arch/arm/configs/hi3xxx_defconfig
arch/arm/configs/hi3xxx_defconfig new file +56 -0
new file mode 100644
index 0000000..f186bdf
@@ -0,0 +1,56 @@
+CONFIG_IRQ_DOMAIN_DEBUG=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_RD_LZMA=y
+CONFIG_ARCH_HI3xxx=y
+CONFIG_SMP=y
+CONFIG_PREEMPT=y
+CONFIG_AEABI=y
+CONFIG_ARM_APPENDED_DTB=y
+CONFIG_NET=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_ATA=y
+CONFIG_SATA_AHCI_PLATFORM=y
+CONFIG_NETDEVICES=y
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_I2C_DESIGNWARE_PLATFORM=y
+CONFIG_SPI=y
+CONFIG_SPI_PL022=y
+CONFIG_PINCTRL_SINGLE=y
+CONFIG_GPIO_GENERIC_PLATFORM=y
+CONFIG_REGULATOR_GPIO=y
+CONFIG_DRM=y
+CONFIG_FB_SIMPLE=y
+CONFIG_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_MXC=y
+CONFIG_USB_EHCI_HCD_PLATFORM=y
+CONFIG_USB_STORAGE=y
+CONFIG_NOP_USB_XCEIV=y
+CONFIG_MMC=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_PL031=y
+CONFIG_DMADEVICES=y
+CONFIG_DW_DMAC=y
+CONFIG_PL330_DMA=y
+CONFIG_PWM=y
+CONFIG_EXT4_FS=y
+CONFIG_TMPFS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_ROOT_NFS=y
+CONFIG_PRINTK_TIME=y
+CONFIG_DEBUG_FS=y
+CONFIG_DEBUG_KERNEL=y
+CONFIG_LOCKUP_DETECTOR=y
Signature · 1 line
1.8.3.2
#6 lore raw

PATCH v12 5/8 ARM: hi3xxx: add smp support

In reply to Haojian Zhuang

From: Zhangfei Gao <[email protected]>

Enable SMP support on hi3xxx platform

---
 .../bindings/arm/hisilicon/hisilicon.txt           | 26 +++++++
 arch/arm/boot/dts/hi3620.dtsi                      | 38 ++++++++++
 arch/arm/mach-hi3xxx/Kconfig                       |  4 ++
 arch/arm/mach-hi3xxx/Makefile                      |  1 +
 arch/arm/mach-hi3xxx/core.h                        | 11 +++
 arch/arm/mach-hi3xxx/hi3xxx.c                      | 41 ++++++++++-
 arch/arm/mach-hi3xxx/platsmp.c                     | 84 ++++++++++++++++++++++
 7 files changed, 203 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-hi3xxx/core.h
 create mode 100644 arch/arm/mach-hi3xxx/platsmp.c
Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt +26 -0
index 21a7336..8c7a465 100644
@@ -4,3 +4,29 @@ Hisilicon Platforms Device Tree Bindings
 Hi4511 Board
 Required root node properties:
 	- compatible = "hisilicon,hi3620-hi4511";
+
+Hisilicon system controller
+
+Required properties:
+- compatible : "hisilicon,sysctrl"
+- reg : Register address and size
+
+Optional properties:
+- smp-offset : offset in sysctrl for notifying slave cpu booting
+		cpu 1, reg;
+		cpu 2, reg + 0x4;
+		cpu 3, reg + 0x8;
+		If reg value is not zero, cpun exit wfi and go
+- resume-offset : offset in sysctrl for notifying cpu0 when resume
+- reboot-offset : offset in sysctrl for system reboot
+
+Example:
+
+	/* for Hi3620 */
+	sysctrl: system-controller at fc802000 {
+		compatible = "hisilicon,sysctrl";
+		reg = <0xfc802000 0x1000>;
+		smp-offset = <0x31c>;
+		resume-offset = <0x308>;
+		reboot-offset = <0x4>;
+	};
arch/arm/boot/dts/hi3620.dtsi +38 -0
index b9d8679..e311937 100644
@@ -39,6 +39,27 @@
 			reg = <0x0>;
 			next-level-cache = <&L2>;
 		};
+
+		cpu at 1 {
+			compatible = "arm,cortex-a9";
+			device_type = "cpu";
+			reg = <1>;
+			next-level-cache = <&L2>;
+		};
+
+		cpu at 2 {
+			compatible = "arm,cortex-a9";
+			device_type = "cpu";
+			reg = <2>;
+			next-level-cache = <&L2>;
+		};
+
+		cpu at 3 {
+			compatible = "arm,cortex-a9";
+			device_type = "cpu";
+			reg = <3>;
+			next-level-cache = <&L2>;
+		};
 	};
 
 	amba {
@@ -65,6 +86,17 @@
 			reg = <0x1000 0x1000>, <0x100 0x100>;
 		};
 
+		sysctrl: system-controller at 802000 {
+			compatible = "hisilicon,sysctrl";
+			reg = <0x802000 0x1000>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			smp-offset = <0x31c>;
+			resume-offset = <0x308>;
+			reboot-offset = <0x4>;
+		};
+
 		dual_timer0: dual_timer at 800000 {
 			compatible = "arm,sp804", "arm,primecell";
 			reg = <0x800000 0x1000>;
@@ -115,6 +147,12 @@
 			status = "disabled";
 		};
 
+		timer5: timer at 600 {
+			compatible = "arm,cortex-a9-twd-timer";
+			reg = <0x600 0x20>;
+			interrupts = <1 13 0xf01>;
+		};
+
 		uart0: uart at b00000 {
 			compatible = "arm,pl011", "arm,primecell";
 			reg = <0xb00000 0x1000>;
arch/arm/mach-hi3xxx/Kconfig +4 -0
index 68bd26c..4007ecf 100644
@@ -6,7 +6,11 @@ config ARCH_HI3xxx
 	select CACHE_L2X0
 	select CLKSRC_OF
 	select GENERIC_CLOCKEVENTS
+	select HAVE_ARM_SCU
+	select HAVE_ARM_TWD
+	select HAVE_SMP
 	select PINCTRL
 	select PINCTRL_SINGLE
+	select SMP
 	help
 	  Support for Hisilicon Hi36xx/Hi37xx processor family
arch/arm/mach-hi3xxx/Makefile +1 -0
index d68ebb3..7a869a7 100644
@@ -3,3 +3,4 @@
 #
 
 obj-y	+= hi3xxx.o
+obj-$(CONFIG_SMP)		+= platsmp.o
arch/arm/mach-hi3xxx/core.h new file +11 -0
new file mode 100644
index 0000000..226f020
@@ -0,0 +1,11 @@
+#ifndef __HISILICON_CORE_H
+#define __HISILICON_CORE_H
+
+#include <linux/reboot.h>
+
+extern void hi3xxx_set_cpu_jump(int cpu, void *jump_addr);
+extern int hi3xxx_get_cpu_jump(int cpu);
+extern void secondary_startup(void);
+extern struct smp_operations hi3xxx_smp_ops;
+
+#endif
arch/arm/mach-hi3xxx/hi3xxx.c +39 -2

68 lines not on this page · raw message

arch/arm/mach-hi3xxx/platsmp.c new file +84 -0

84 lines not on this page · raw message

Signature · 1 line
1.8.3.2
#7 lore raw

PATCH v12 5/8 ARM: hi3xxx: add smp support

Quoted 8 lines · Haojian Zhuang

From: Zhangfei Gao <[email protected]>

Enable SMP support on hi3xxx platform

This one has checkpatch errors too:

ERROR: do not initialise statics to 0 or NULL
#267: FILE: arch/arm/mach-hi3xxx/platsmp.c:20:
+static void __iomem *ctrl_base = NULL;

ERROR: space prohibited before that close parenthesis ')' #282: FILE: arch/arm/mach-hi3xxx/platsmp.c:35:
+ return readl_relaxed(ctrl_base + ((cpu - 1 ) << 2));

I fixed these up locally too, but my generosity is running out.

Kevin

#8 lore raw

PATCH v12 6/8 ARM: hi3xxx: add hotplug support

In reply to Haojian Zhuang

From: Zhangfei Gao <[email protected]>

Enable hotplug support on hi3xxx platform

How to test:
cat proc/interrupts
echo 0 > /sys/devices/system/cpu/cpuX/online
cat proc/interrupts
echo 1 > /sys/devices/system/cpu/cpuX/online

---
 arch/arm/mach-hi3xxx/Makefile  |   1 +
 arch/arm/mach-hi3xxx/core.h    |   4 +
 arch/arm/mach-hi3xxx/hotplug.c | 200 +++++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-hi3xxx/platsmp.c |   5 ++
 4 files changed, 210 insertions(+)
 create mode 100644 arch/arm/mach-hi3xxx/hotplug.c
arch/arm/mach-hi3xxx/Makefile +1 -0
index 7a869a7..c9919e8 100644
@@ -4,3 +4,4 @@
 
 obj-y	+= hi3xxx.o
 obj-$(CONFIG_SMP)		+= platsmp.o
+obj-$(CONFIG_HOTPLUG_CPU)	+= hotplug.o
arch/arm/mach-hi3xxx/core.h +4 -0
index 226f020..af23ec2 100644
@@ -8,4 +8,8 @@ extern int hi3xxx_get_cpu_jump(int cpu);
 extern void secondary_startup(void);
 extern struct smp_operations hi3xxx_smp_ops;
 
+extern void hi3xxx_cpu_die(unsigned int cpu);
+extern int hi3xxx_cpu_kill(unsigned int cpu);
+extern void hi3xxx_set_cpu(int cpu, bool enable);
+
 #endif
arch/arm/mach-hi3xxx/hotplug.c new file +200 -0

200 lines not on this page · raw message

arch/arm/mach-hi3xxx/platsmp.c +5 -0
index e532c69..a3d1b3f 100644
@@ -73,6 +73,7 @@ static void __init hi3xxx_smp_prepare_cpus(unsigned int max_cpus)
 
 static int hi3xxx_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
+	hi3xxx_set_cpu(cpu, true);
 	hi3xxx_set_cpu_jump(cpu, secondary_startup);
 	arch_send_wakeup_ipi_mask(cpumask_of(cpu));
 	return 0;
@@ -81,4 +82,8 @@ static int hi3xxx_boot_secondary(unsigned int cpu, struct task_struct *idle)
 struct smp_operations hi3xxx_smp_ops __initdata = {
 	.smp_prepare_cpus	= hi3xxx_smp_prepare_cpus,
 	.smp_boot_secondary	= hi3xxx_boot_secondary,
+#ifdef CONFIG_HOTPLUG_CPU
+	.cpu_die		= hi3xxx_cpu_die,
+	.cpu_kill		= hi3xxx_cpu_kill,
+#endif
 };
Signature · 1 line
1.8.3.2
#9 lore raw

PATCH v12 6/8 ARM: hi3xxx: add hotplug support

Quoted 10 lines · Haojian Zhuang

From: Zhangfei Gao <[email protected]>

Enable hotplug support on hi3xxx platform

How to test:
cat proc/interrupts
echo 0 > /sys/devices/system/cpu/cpuX/online
cat proc/interrupts
echo 1 > /sys/devices/system/cpu/cpuX/online

Quoted 3 lines

ugh, more checkpatch errors:

ERROR: do not initialise statics to 0 or NULL
#120: FILE: arch/arm/mach-hi3xxx/hotplug.c:65:
+static void __iomem *ctrl_base = NULL;

Fixed this one too, but any more and the flames might start to appear.

Kevin

#10 lore raw

PATCH v12 7/8 ARM: dts: enable clock binding on Hi3620

In reply to Haojian Zhuang

Enable clock binding for Hi3620 common clock driver.

---
 arch/arm/boot/dts/hi3620.dtsi | 79 ++++++++++++++++++++++++-------------------
 arch/arm/boot/dts/hi4511.dts  |  3 +-
 2 files changed, 46 insertions(+), 36 deletions(-)
arch/arm/boot/dts/hi3620.dtsi +44 -35
index e311937..ab1116d 100644
@@ -11,7 +11,8 @@
  * publishhed by the Free Software Foundation.
  */
 
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
+#include <dt-bindings/clock/hi3620-clock.h>
 
 / {
 	aliases {
@@ -63,6 +64,7 @@
 	};
 
 	amba {
+
 		#address-cells = <1>;
 		#size-cells = <1>;
 		compatible = "arm,amba-bus";
@@ -88,13 +90,20 @@
 
 		sysctrl: system-controller at 802000 {
 			compatible = "hisilicon,sysctrl";
-			reg = <0x802000 0x1000>;
 			#address-cells = <1>;
-			#size-cells = <0>;
+			#size-cells = <1>;
+			ranges = <0 0x802000 0x1000>;
+			reg = <0x802000 0x1000>;
 
 			smp-offset = <0x31c>;
 			resume-offset = <0x308>;
 			reboot-offset = <0x4>;
+
+			clock: clock at 0 {
+				compatible = "hisilicon,hi3620-clock";
+				reg = <0 0x10000>;
+				#clock-cells = <1>;
+			};
 		};
 
 		dual_timer0: dual_timer at 800000 {
@@ -102,7 +111,7 @@
 			reg = <0x800000 0x1000>;
 			/* timer00 & timer01 */
 			interrupts = <0 0 4>, <0 1 4>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_TIMER0_MUX>, <&clock HI3620_TIMER1_MUX>;
 			clock-names = "apb_pclk";
 			status = "disabled";
 		};
@@ -112,7 +121,7 @@
 			reg = <0x801000 0x1000>;
 			/* timer10 & timer11 */
 			interrupts = <0 2 4>, <0 3 4>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_TIMER2_MUX>, <&clock HI3620_TIMER3_MUX>;
 			clock-names = "apb_pclk";
 			status = "disabled";
 		};
@@ -122,7 +131,7 @@
 			reg = <0xa01000 0x1000>;
 			/* timer20 & timer21 */
 			interrupts = <0 4 4>, <0 5 4>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_TIMER4_MUX>, <&clock HI3620_TIMER5_MUX>;
 			clock-names = "apb_pclk";
 			status = "disabled";
 		};
@@ -132,7 +141,7 @@
 			reg = <0xa02000 0x1000>;
 			/* timer30 & timer31 */
 			interrupts = <0 6 4>, <0 7 4>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_TIMER6_MUX>, <&clock HI3620_TIMER7_MUX>;
 			clock-names = "apb_pclk";
 			status = "disabled";
 		};
@@ -142,7 +151,7 @@
 			reg = <0xa03000 0x1000>;
 			/* timer40 & timer41 */
 			interrupts = <0 96 4>, <0 97 4>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_TIMER8_MUX>, <&clock HI3620_TIMER9_MUX>;
 			clock-names = "apb_pclk";
 			status = "disabled";
 		};
@@ -157,7 +166,7 @@
 			compatible = "arm,pl011", "arm,primecell";
 			reg = <0xb00000 0x1000>;
 			interrupts = <0 20 4>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_UARTCLK0>;
 			clock-names = "apb_pclk";
 			status = "disabled";
 		};
@@ -166,7 +175,7 @@
 			compatible = "arm,pl011", "arm,primecell";
 			reg = <0xb01000 0x1000>;
 			interrupts = <0 21 4>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_UARTCLK1>;
 			clock-names = "apb_pclk";
 			status = "disabled";
 		};
@@ -175,7 +184,7 @@
 			compatible = "arm,pl011", "arm,primecell";
 			reg = <0xb02000 0x1000>;
 			interrupts = <0 22 4>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_UARTCLK2>;
 			clock-names = "apb_pclk";
 			status = "disabled";
 		};
@@ -184,7 +193,7 @@
 			compatible = "arm,pl011", "arm,primecell";
 			reg = <0xb03000 0x1000>;
 			interrupts = <0 23 4>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_UARTCLK3>;
 			clock-names = "apb_pclk";
 			status = "disabled";
 		};
@@ -193,7 +202,7 @@
 			compatible = "arm,pl011", "arm,primecell";
 			reg = <0xb04000 0x1000>;
 			interrupts = <0 24 4>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_UARTCLK4>;
 			clock-names = "apb_pclk";
 			status = "disabled";
 		};
@@ -208,7 +217,7 @@
 					&pmx0 5 0 1 &pmx0 6 1 1 &pmx0 7 2 1>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_GPIOCLK0>;
 			clock-names = "apb_pclk";
 		};
 
@@ -223,7 +232,7 @@
 					&pmx0 6 5 1 &pmx0 7 6 1>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_GPIOCLK1>;
 			clock-names = "apb_pclk";
 		};
 
@@ -238,7 +247,7 @@
 					&pmx0 6 3 1 &pmx0 7 3 1>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_GPIOCLK2>;
 			clock-names = "apb_pclk";
 		};
 
@@ -253,7 +262,7 @@
 					&pmx0 6 11 1 &pmx0 7 11 1>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_GPIOCLK3>;
 			clock-names = "apb_pclk";
 		};
 
@@ -268,7 +277,7 @@
 					&pmx0 6 13 1 &pmx0 7 13 1>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_GPIOCLK4>;
 			clock-names = "apb_pclk";
 		};
 
@@ -283,7 +292,7 @@
 					&pmx0 6 16 1 &pmx0 7 16 1>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_GPIOCLK5>;
 			clock-names = "apb_pclk";
 		};
 
@@ -298,7 +307,7 @@
 					&pmx0 6 18 1 &pmx0 7 19 1>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_GPIOCLK6>;
 			clock-names = "apb_pclk";
 		};
 
@@ -313,7 +322,7 @@
 					&pmx0 6 25 1 &pmx0 7 26 1>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_GPIOCLK7>;
 			clock-names = "apb_pclk";
 		};
 
@@ -328,7 +337,7 @@
 					&pmx0 6 33 1 &pmx0 7 34 1>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_GPIOCLK8>;
 			clock-names = "apb_pclk";
 		};
 
@@ -343,7 +352,7 @@
 					&pmx0 6 41 1>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_GPIOCLK9>;
 			clock-names = "apb_pclk";
 		};
 
@@ -357,7 +366,7 @@
 					&pmx0 5 45 1 &pmx0 6 46 1 &pmx0 7 46 1>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_GPIOCLK10>;
 			clock-names = "apb_pclk";
 		};
 
@@ -372,7 +381,7 @@
 					&pmx0 6 49 1 &pmx0 7 49 1>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_GPIOCLK11>;
 			clock-names = "apb_pclk";
 		};
 
@@ -387,7 +396,7 @@
 					&pmx0 6 51 1 &pmx0 7 52 1>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_GPIOCLK12>;
 			clock-names = "apb_pclk";
 		};
 
@@ -402,7 +411,7 @@
 					&pmx0 6 55 1 &pmx0 7 56 1>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_GPIOCLK13>;
 			clock-names = "apb_pclk";
 		};
 
@@ -417,7 +426,7 @@
 					&pmx0 6 60 1 &pmx0 7 61 1>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_GPIOCLK14>;
 			clock-names = "apb_pclk";
 		};
 
@@ -432,7 +441,7 @@
 					&pmx0 6 64 1 &pmx0 7 65 1>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_GPIOCLK15>;
 			clock-names = "apb_pclk";
 		};
 
@@ -447,7 +456,7 @@
 					&pmx0 6 72 1 &pmx0 7 73 1>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_GPIOCLK16>;
 			clock-names = "apb_pclk";
 		};
 
@@ -462,7 +471,7 @@
 					&pmx0 6 80 1 &pmx0 7 81 1>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_GPIOCLK17>;
 			clock-names = "apb_pclk";
 		};
 
@@ -477,7 +486,7 @@
 					&pmx0 6 86 1 &pmx0 7 87 1>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_GPIOCLK18>;
 			clock-names = "apb_pclk";
 		};
 
@@ -491,7 +500,7 @@
 					&pmx0 3 88 1>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_GPIOCLK19>;
 			clock-names = "apb_pclk";
 		};
 
@@ -505,7 +514,7 @@
 					&pmx0 3 90 1 &pmx0 4 91 1 &pmx0 5 92 1>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_GPIOCLK20>;
 			clock-names = "apb_pclk";
 		};
 
@@ -518,7 +527,7 @@
 			gpio-ranges = <	&pmx0 3 94 1 &pmx0 7 96 1>;
 			interrupt-controller;
 			#interrupt-cells = <2>;
-			clocks = <&pclk>;
+			clocks = <&clock HI3620_GPIOCLK21>;
 			clock-names = "apb_pclk";
 		};
 
arch/arm/boot/dts/hi4511.dts +2 -1
index 96e69ab..fe62392 100644
@@ -8,7 +8,8 @@
  */
 
 /dts-v1/;
-/include/ "hi3620.dtsi"
+
+#include "hi3620.dtsi"
 
 / {
 	model = "Hisilicon Hi4511 Development Board";
Signature · 1 line
1.8.3.2
#11 lore raw

PATCH v12 7/8 ARM: dts: enable clock binding on Hi3620

Quoted 13 lines · Haojian Zhuang

Enable clock binding for Hi3620 common clock driver.

---
 arch/arm/boot/dts/hi3620.dtsi | 79 ++++++++++++++++++++++++-------------------
 arch/arm/boot/dts/hi4511.dts  |  3 +-
 2 files changed, 46 insertions(+), 36 deletions(-)
arch/arm/boot/dts/hi3620.dtsi +0 -0
index e311937..ab1116d 100644

arch/arm/boot/dts/hi3620.dtsi line 15

Quoted 6 lines
arch/arm/boot/dts/hi3620.dtsi +2 -1
@@ -11,7 +11,8 @@
  * publishhed by the Free Software Foundation.
  */
 
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
+#include <dt-bindings/clock/hi3620-clock.h>

This file doesn't exist in this series, so fails to build. This appears to depend on the clock series that Mike has merged into his clk-next branch, so I tested the build with clk-next and it works.

In the future, please be sure to mention external dependencies like this. Maintainers don't like to be surprised by this kind of thing.

I'll just merge this as is now, but builds for hi3xxx_defconfig will be broken until everything hits -next.

Kevin

#12 lore raw

PATCH v12 8/8 ARM: hi3xxx: select GPIO in Kconfig

In reply to Haojian Zhuang

Select GPIO in hi3xxx Kconfig.

---
 arch/arm/mach-hi3xxx/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-hi3xxx/Kconfig +1 -0
index 4007ecf..018ad67 100644
@@ -3,6 +3,7 @@ config ARCH_HI3xxx
 	select ARM_AMBA
 	select ARM_GIC
 	select ARM_TIMER_SP804
+	select ARCH_WANT_OPTIONAL_GPIOLIB
 	select CACHE_L2X0
 	select CLKSRC_OF
 	select GENERIC_CLOCKEVENTS
Signature · 1 line
1.8.3.2
#13 lore raw

PATCH v12 8/8 ARM: hi3xxx: select GPIO in Kconfig

Quoted 12 lines · Haojian Zhuang

Select GPIO in hi3xxx Kconfig.

---
 arch/arm/mach-hi3xxx/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-hi3xxx/Kconfig +0 -0
index 4007ecf..018ad67 100644

arch/arm/mach-hi3xxx/Kconfig config ARCH_HI3xxx · line 9

Quoted 7 lines
arch/arm/mach-hi3xxx/Kconfig +1 -0
@@ -3,6 +3,7 @@ config ARCH_HI3xxx
 	select ARM_AMBA
 	select ARM_GIC
 	select ARM_TIMER_SP804
+	select ARCH_WANT_OPTIONAL_GPIOLIB
 	select CACHE_L2X0
 	select CLKSRC_OF
 	select GENERIC_CLOCKEVENTS

No need for this to be a separate patch, I've folded it into patch 1.

Kevin