Skip to contentSkip to conversation

support hisilicon SoC

PATCH Superseded Haojian Zhuang 2 participants 11 messages Mar 14, 2013

Subsystems (5)

v4 of 12 Superseded Latest is v12 →

lore
Share & tools
lore
#0 lore raw

v4 cover support hisilicon SoC

Changelog:
v4:
1. Discard sp804 since Rob's patch also handle this.
2. Update pinmux setting in DTS.
3. Update sp804 setting in DTS.
v3:
1. Replace to call hs_init_clocks() in hi3xxx.c by of_clk_init().
2. Add CLK_OF_DECLARE() in clk-hi3xxx driver.
3. Add "select USE_OF" for CONFIG_CLKSRC_OF configuration. So drop CONFIG_OF in sp804 driver.
4. Move readme file into driver patch.
5. Append "arm,integrator-timer" for sp804 match table.
v2:
1. Rename mach-hs to mach-hi3xxx.
2. Remove CONFIG_MACH_HS_DT.
3. Move sp804 dual timer driver into drivers/clocksource.
4. Make sp804 driver to support DT. Append CLOCKSOURCE_OF_DECLARE() in sp804 driver.
5. Update hisilicon,hi3620-clkgate & hisilicon,hi3620-clkrst property in clk-hi3xxx driver.

#1 lore raw

PATCH v4 1/5 ARM: debug: support debug ll on hisilicon soc

Support UART0 debug ll on hisilicon Hi3620 SoC.

---
 arch/arm/Kconfig.debug             |   15 +++++++++++++++
 arch/arm/include/debug/hisilicon.S |   30 ++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+)
 create mode 100644 arch/arm/include/debug/hisilicon.S
arch/arm/Kconfig.debug +15 -0
index acdddda..fd658db 100644
@@ -240,6 +240,20 @@ choice
 		  Say Y here if you want kernel low-level debugging support
 		  on i.MX6Q.
 
+	config DEBUG_HI3620_UART
+		bool "Hisilicon HI3620 Debug UART"
+		depends on ARCH_HI3xxx
+		help
+		  Say Y here if you want kernel low-level debugging support
+		  on HI3620 UART.
+
+	config DEBUG_HI3716_UART
+		bool "Hisilicon Hi3716 Debug UART"
+		depends on ARCH_HI3xxx
+		help
+		  Say Y here if you want kernel low-level debugging support
+		  on HI3716 UART.
+
 	config DEBUG_MMP_UART2
 		bool "Kernel low-level debugging message via MMP UART2"
 		depends on ARCH_MMP
@@ -589,6 +603,7 @@ config DEBUG_LL_INCLUDE
 				 DEBUG_IMX53_UART ||\
 				 DEBUG_IMX6Q_UART
 	default "debug/highbank.S" if DEBUG_HIGHBANK_UART
+	default "debug/hisilicon.S" if DEBUG_HI3620_UART || DEBUG_HI3716_UART
 	default "debug/mvebu.S" if DEBUG_MVEBU_UART
 	default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART
 	default "debug/picoxcell.S" if DEBUG_PICOXCELL_UART
arch/arm/include/debug/hisilicon.S new file +30 -0
new file mode 100644
index 0000000..47ad019
@@ -0,0 +1,30 @@
+/*
+ * Early serial output macro for Hisilicon SoC
+ *
+ * Copyright (C) 2012-2013 Hisilicon Technologies Co., Ltd.
+ * Copyright (C) 2012-2013 Linaro Ltd.
+ *
+ * Author: Haojian Zhuang <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#if defined(CONFIG_DEBUG_HI3620_UART)
+#define HS_UART_PHYS_BASE	0xfcb00000
+#define HS_UART_VIRT_BASE	0xfeb00000
+#elif defined(CONFIG_DEBUG_HI3716_UART)
+#define HS_UART_PHYS_BASE	0xf8b00000
+#define HS_UART_VIRT_BASE	0xfeb00000
+#endif
+
+#if defined(CONFIG_DEBUG_HI3620_UART) || defined(CONFIG_DEBUG_HI3716_UART)
+		.macro	addruart,rp,rv,tmp
+		ldr	\rp, =HS_UART_PHYS_BASE
+		ldr	\rv, =HS_UART_VIRT_BASE
+		.endm
+
+#include <asm/hardware/debug-pl01x.S>
+
+#endif
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH v4 2/5 clk: hi3xxx: add clock support

In reply to Haojian Zhuang

Add clock support with device tree on Hisilicon SoC.

---
 .../devicetree/bindings/clock/hisilicon.txt        |   73 +++
 drivers/clk/Makefile                               |    1 +
 drivers/clk/clk-hi3xxx.c                           |  643 ++++++++++++++++++++
 3 files changed, 717 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/hisilicon.txt
 create mode 100644 drivers/clk/clk-hi3xxx.c
Documentation/devicetree/bindings/clock/hisilicon.txt new file +73 -0
new file mode 100644
index 0000000..be8db9d
@@ -0,0 +1,73 @@
+Device Tree Clock bindings for arch-vt8500
+
+This binding uses the common clock binding[1].
+
+[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
+
+Required properties for mux clocks:
+ - compatible : Shall be "hisilicon,hi3620-clk-mux".
+ - clocks : shall be the input parent clock phandle for the clock. This should
+	be the reference clock.
+ - clock-output-names : shall be reference name.
+ - #clock-cells : from common clock binding; shall be set to 0.
+ - hisilicon,hi3620-mux : array of mux register offset & mask bits
+
+Required properties for Hi3620 gate clocks:
+ - compatible : Shall be "hisilicon,hi3620-clk-gate".
+ - clocks : shall be the input parent clock phandle for the clock. This should
+	be the reference clock.
+ - clock-output-names : shall be reference name.
+ - #clock-cells : from common clock binding; shall be set to 0.
+ - hisilicon,hi3620-clkgate : array of enable register offset & enable bits
+ - hisilicon,hi3620-clkreset : array of reset register offset & enable bits
+
+Required properties for clock divider:
+ - compatible : Shall be "hisilicon,hi3620-clk-div".
+ - clocks : shall be the input parent clock phandle for the clock. This should
+	be the reference clock.
+ - clock-output-names : shall be reference name.
+ - #clock-cells : from common clock binding; shall be set to 0.
+ - #hisilicon,clkdiv-table-cells : the number of parameters after phandle in
+   hisilicon,clkdiv-table property.
+ - hisilicon,clkdiv-table : list of value that are used to configure clock
+   divider. They're value of phandle, index & divider value.
+ - hisilicon,clkdiv : array of divider register offset & mask bits.
+
+Required properties for gate clocks:
+ - compatible : Shall be "hisilicon,clk-gate".
+ - clocks : shall be the input parent clock phandle for the clock. This should
+	be the reference clock.
+ - clock-output-names : shall be reference name.
+ - #clock-cells : from common clock binding; shall be set to 0.
+ - hisilicon,clkgate-inverted : bool value. True means that set-to-disable.
+
+Required properties for clock fixed factor divider:
+ - compatible : Shall be "hisilicon,fixed-factor".
+ - clocks : shall be the input parent clock phandle for the clock. This should
+	be the reference clock.
+ - clock-output-names : shall be reference name.
+ - #clock-cells : from common clock binding; shall be set to 0.
+ - hisilicon,fixed-factor : array of multiplier & divider.
+
+For example:
+	timclk1: clkgate at 38 {
+		compatible = "hisilicon,clk-gate";
+		#clock-cells = <0>;
+		clocks = <&refclk_timer1>;
+		clock-output-names = "timclk1";
+		hisilicon,clkgate-inverted;
+		hisilicon,clkgate = <0 18>;
+	};
+
+	dtable: clkdiv at 0 {
+		#hisilicon,clkdiv-table-cells = <2>;
+	};
+
+	div_cfgaxi: clkdiv at 2 {
+		compatible = "hisilicon,hi3620-clk-div";
+		#clock-cells = <0>;
+		clocks = <&div_shareaxi>;
+		clock-output-names = "cfgAXI_div";
+		hisilicon,clkdiv-table = <&dtable 0x01 2>;
+		hisilicon,clkdiv = <0x100 0x60>;
+	};
drivers/clk/Makefile +1 -0
index 300d477..852e5c2 100644
@@ -11,6 +11,7 @@ obj-$(CONFIG_COMMON_CLK)	+= clk-mux.o
 # SoCs specific
 obj-$(CONFIG_ARCH_BCM2835)	+= clk-bcm2835.o
 obj-$(CONFIG_ARCH_NOMADIK)	+= clk-nomadik.o
+obj-$(CONFIG_ARCH_HI3xxx)	+= clk-hi3xxx.o
 obj-$(CONFIG_ARCH_HIGHBANK)	+= clk-highbank.o
 obj-$(CONFIG_ARCH_MXS)		+= mxs/
 obj-$(CONFIG_ARCH_SOCFPGA)	+= socfpga/
drivers/clk/clk-hi3xxx.c new file +643 -0

643 lines not on this page · raw message

Signature · 1 line
1.7.10.4
maintainer
#3 lore raw

PATCH v4 2/5 clk: hi3xxx: add clock support

Quoted 4 lines · Haojian Zhuang

Add clock support with device tree on Hisilicon SoC.

Looks good to me, just one final comment from my side:

drivers/clk/clk-hi3xxx.c line 86

Quoted 5 lines
drivers/clk/clk-hi3xxx.c new file +5 -0
+
+static struct hs_clk hs_clk;
+
+static void __init hs_init_clocks(void);
+

Please move the hs_init_clocks() function itself to the top of the file to avoid the forward declaration.

Arnd

#4 lore raw

PATCH v4 2/5 clk: hi3xxx: add clock support

Quoted 17 lines · Arnd Bergmann
Quoted 4 lines · Haojian Zhuang

Add clock support with device tree on Hisilicon SoC.

Looks good to me, just one final comment from my side:

drivers/clk/clk-hi3xxx.c line 86

Quoted 5 lines
drivers/clk/clk-hi3xxx.c new file +5 -0
+
+static struct hs_clk hs_clk;
+
+static void __init hs_init_clocks(void);
+

Please move the hs_init_clocks() function itself to the top of the file to avoid the forward declaration.

Quoted 1 line

Arnd

No problem.

Regards
Haojian

#5 lore raw

PATCH v4 3/5 ARM: hi3xxx: add board support with device tree

In reply to Haojian Zhuang

Add board support with device tree for Hisilicon Hi36xx/Hi37xx platform.

---
 .../bindings/arm/hisilicon/hisilicon.txt           |   10 +++++
 arch/arm/Kconfig                                   |    2 +
 arch/arm/Makefile                                  |    1 +
 arch/arm/mach-hi3xxx/Kconfig                       |   13 ++++++
 arch/arm/mach-hi3xxx/Makefile                      |    5 +++
 arch/arm/mach-hi3xxx/hi3xxx.c                      |   45 ++++++++++++++++++++
 6 files changed, 76 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 +10 -0
new file mode 100644
index 0000000..3be60c8
@@ -0,0 +1,10 @@
+Hisilicon Platforms Device Tree Bindings
+----------------------------------------------------
+
+Hi3716 Development Board
+Required root node properties:
+	- compatible = "hisilicon,hi3716-dkb";
+
+Hi4511 Board
+Required root node properties:
+	- compatible = "hisilicon,hi3620-hi4511";
arch/arm/Kconfig +2 -0
index 774131a..9d07a1c 100644
@@ -1052,6 +1052,8 @@ source "arch/arm/mach-gemini/Kconfig"
 
 source "arch/arm/mach-h720x/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 ee4605f..4b0de9e 100644
@@ -148,6 +148,7 @@ machine-$(CONFIG_ARCH_EBSA110)		+= ebsa110
 machine-$(CONFIG_ARCH_EP93XX)		+= ep93xx
 machine-$(CONFIG_ARCH_GEMINI)		+= gemini
 machine-$(CONFIG_ARCH_H720X)		+= h720x
+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 +13 -0
new file mode 100644
index 0000000..a991dee
@@ -0,0 +1,13 @@
+config ARCH_HI3xxx
+	bool "Hisilicon Hi36xx/Hi37xx family" if ARCH_MULTI_V7
+	select ARM_AMBA
+	select ARM_GIC
+	select CACHE_L2X0
+	select CACHE_PL310
+	select CLKSRC_OF
+	select PINCTRL
+	select PINCTRL_SINGLE
+	select SERIAL_AMBA_PL011
+	select SERIAL_AMBA_PL011_CONSOLE
+	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 +45 -0

45 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#6 lore raw

PATCH v4 4/5 ARM: hi3xxx: enable hi4511 with device tree

In reply to Haojian Zhuang

Enable Hisilicon Hi4511 development platform with device tree support.

---
 arch/arm/boot/dts/Makefile    |    1 +
 arch/arm/boot/dts/hi3620.dtsi | 1155 +++++++++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/hi4511.dts  |  738 ++++++++++++++++++++++++++
 3 files changed, 1894 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 08d298d..742920d 100644
@@ -46,6 +46,7 @@ dtb-$(CONFIG_ARCH_EXYNOS) += exynos4210-origen.dtb \
 	exynos5250-smdk5250.dtb \
 	exynos5250-snow.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 +1155 -0

1,155 lines not on this page · raw message

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

738 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#7 lore raw

PATCH v4 5/5 ARM: config: append arch hi3xxx into multi defconfig

In reply to Haojian Zhuang

Append ARCH_HI3xxx (Hisilicon SoC) into multi_v7_defconfig.

---
 arch/arm/configs/multi_v7_defconfig |    1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/multi_v7_defconfig +1 -0
index e31d442..1891611 100644
@@ -5,6 +5,7 @@ CONFIG_ARCH_MVEBU=y
 CONFIG_MACH_ARMADA_370=y
 CONFIG_MACH_ARMADA_XP=y
 CONFIG_ARCH_HIGHBANK=y
+CONFIG_ARCH_HI3xxx=y
 CONFIG_ARCH_SOCFPGA=y
 CONFIG_ARCH_SUNXI=y
 # CONFIG_ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA is not set
Signature · 1 line
1.7.10.4
maintainer
#8 lore raw

PATCH v4 5/5 ARM: config: append arch hi3xxx into multi defconfig

arch/arm/configs/multi_v7_defconfig CONFIG_ARCH_MVEBU=y · line 11

Quoted 10 lines · Haojian Zhuang
arch/arm/configs/multi_v7_defconfig +1 -0
@@ -5,6 +5,7 @@ CONFIG_ARCH_MVEBU=y
 CONFIG_MACH_ARMADA_370=y
 CONFIG_MACH_ARMADA_XP=y
 CONFIG_ARCH_HIGHBANK=y
+CONFIG_ARCH_HI3xxx=y
 CONFIG_ARCH_SOCFPGA=y
 CONFIG_ARCH_SUNXI=y
 # CONFIG_ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA is not set

Are you sure this is enough? Normally we also have to enable some device drivers to get a bootable system.

Arnd

#9 lore raw

PATCH v4 5/5 ARM: config: append arch hi3xxx into multi defconfig

Quoted 15 lines · Arnd Bergmann

arch/arm/configs/multi_v7_defconfig CONFIG_ARCH_MVEBU=y · line 11

Quoted 10 lines · Haojian Zhuang
arch/arm/configs/multi_v7_defconfig +1 -0
@@ -5,6 +5,7 @@ CONFIG_ARCH_MVEBU=y
 CONFIG_MACH_ARMADA_370=y
 CONFIG_MACH_ARMADA_XP=y
 CONFIG_ARCH_HIGHBANK=y
+CONFIG_ARCH_HI3xxx=y
 CONFIG_ARCH_SOCFPGA=y
 CONFIG_ARCH_SUNXI=y
 # CONFIG_ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA is not set

Are you sure this is enough? Normally we also have to enable some device drivers to get a bootable system.

Quoted 1 line

Arnd

Yes, it could boot. Those components are already enabled in multi_v7_defconfig. Since hi3xxx used a lot of AMBA IPs.

Regards
Haojian

maintainer
#10 lore raw

PATCH v4 5/5 ARM: config: append arch hi3xxx into multi defconfig

Quoted 7 lines · Haojian Zhuang
Quoted 4 lines · Arnd Bergmann

Are you sure this is enough? Normally we also have to enable some device drivers to get a bootable system.

Yes, it could boot. Those components are already enabled in multi_v7_defconfig. Since hi3xxx used a lot of AMBA IPs.

Ok, very good then.

Arnd