No subject
Subsystems (5)
Changelog:
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.
PATCH v8 1/8 ARM: debug: support debug ll on hisilicon soc
Support UART0 debug ll on Hisilicon Hi3620 SoC & Hi3716 SoC.
--- arch/arm/Kconfig.debug | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
arch/arm/Kconfig.debug +19 -0
@@ -194,6 +194,22 @@ choice Say Y here if you want kernel low-level debugging support on HI3716 UART. + config DEBUG_HI3620_UART + bool "Hisilicon HI3620 Debug UART" + depends on ARCH_HI3xxx + select DEBUG_UART_PL01X + 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 + select DEBUG_UART_PL01X + help + Say Y here if you want kernel low-level debugging support + on HI3716 UART. + config DEBUG_HIGHBANK_UART bool "Kernel low-level debugging messages via Highbank UART" depends on ARCH_HIGHBANK
@@ -980,6 +996,8 @@ config DEBUG_UART_PHYS default 0xf1012000 if DEBUG_MVEBU_UART_ALTERNATE default 0xf1012000 if ARCH_DOVE || ARCH_KIRKWOOD || ARCH_MV78XX0 || \ ARCH_ORION5X + default 0xf8b00000 if DEBUG_HI3716_UART + default 0xfcb00000 if DEBUG_HI3620_UART default 0xfe800000 if ARCH_IOP32X default 0xffc02000 if DEBUG_SOCFPGA_UART default 0xffd82340 if ARCH_IOP13XX
@@ -1016,6 +1034,7 @@ config DEBUG_UART_VIRT default 0xfe100000 if DEBUG_IMX23_UART || DEBUG_IMX28_UART default 0xfe230000 if DEBUG_PICOXCELL_UART default 0xfe800000 if ARCH_IOP32X + default 0xfeb00000 if DEBUG_HI3620_UART || DEBUG_HI3716_UART default 0xfeb24000 if DEBUG_RK3X_UART0 default 0xfeb26000 if DEBUG_RK3X_UART1 default 0xfeb30c00 if DEBUG_KEYSTONE_UART0
Signature · 1 line
1.8.1.2
PATCH v8 1/8 ARM: debug: support debug ll on hisilicon soc
Quoted 12 lines · Haojian Zhuang
Support UART0 debug ll on Hisilicon Hi3620 SoC & Hi3716 SoC.
Signed-off-by Haojian Zhuang <[email protected]>--- arch/arm/Kconfig.debug | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)arch/arm/Kconfig.debug +0
-0
arch/arm/Kconfig.debug choice · line 196
Quoted 3 lines
arch/arm/Kconfig.debug +0
-0@@ -194,6 +194,22 @@ choice Say Y here if you want kernel low-level debugging support on HI3716 UART.
I'm having problems applying this patch - I don't have the above context lines in my tree, or anything remotely resembling them. Neither can I find anything remotely similar in mainline.
What did you generate this patch against? It can't be v3.11-rc6 as you put in your KernelVersion: line for the patch system.
Your diff above says that this was generated against blob 814d224, which doesn't exist in mainline either. Neither does it seem to appear in my build tree which includes arm-soc's for-next branch.
PATCH v8 1/8 ARM: debug: support debug ll on hisilicon soc
Quoted 21 lines · Russell King - ARM Linux
Quoted 12 lines · Haojian Zhuang
Support UART0 debug ll on Hisilicon Hi3620 SoC & Hi3716 SoC.
Signed-off-by Haojian Zhuang <[email protected]>--- arch/arm/Kconfig.debug | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)arch/arm/Kconfig.debug +0
-0arch/arm/Kconfig.debug choice · line 196
Quoted 3 lines
arch/arm/Kconfig.debug +0
-0@@ -194,6 +194,22 @@ choice Say Y here if you want kernel low-level debugging support on HI3716 UART.I'm having problems applying this patch - I don't have the above context lines in my tree, or anything remotely resembling them. Neither can I find anything remotely similar in mainline.
Quoted 6 lines
What did you generate this patch against? It can't be v3.11-rc6 as you put in your KernelVersion: line for the patch system.
Your diff above says that this was generated against blob 814d224, which doesn't exist in mainline either. Neither does it seem to appear in my build tree which includes arm-soc's for-next branch.
Because there's some optimization on debug ll in your tree, I only find those commits in linux-next git tree. So I based this commit in linux-next.
Could you help me to figure out which branch should I base in your git tree? Since I can't find a right one.
Regards
Haojian
PATCH v8 2/8 clk: hi3xxx: add clock support
In reply to Haojian ZhuangAdd clock support with device tree on Hisilicon SoC.
--- .../devicetree/bindings/clock/hisilicon.txt | 118 +++++++++ drivers/clk/Makefile | 1 + drivers/clk/hisilicon/Makefile | 2 + drivers/clk/hisilicon/clk-hi3xxx.c | 272 +++++++++++++++++++++ drivers/clk/hisilicon/clk-hi3xxx.h | 34 +++ drivers/clk/hisilicon/clkgate-seperated.c | 129 ++++++++++ 6 files changed, 556 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/hisilicon.txt create mode 100644 drivers/clk/hisilicon/Makefile create mode 100644 drivers/clk/hisilicon/clk-hi3xxx.c create mode 100644 drivers/clk/hisilicon/clk-hi3xxx.h create mode 100644 drivers/clk/hisilicon/clkgate-seperated.c
Documentation/devicetree/bindings/clock/hisilicon.txt new file +118 -0
@@ -0,0 +1,118 @@ +Device Tree Clock bindings for arch-hi3xxx + +This binding uses the common clock binding[1]. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt + +All the mux, gate & divider are in clock container of DTS file. + +Required properties for mux clocks: + - compatible : shall be "hisilicon,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. + - reg : the mux register address. It should be the offset of the container. + - clkmux-mask : mask bits of the mux register. + - clkmux-table : array of mux select bits. + +Optional properties for mux clocks: + - clkmux-hiword-mask : indicates that the bit[31:16] are the hiword mask + of mux selected bits (bit[15:0]). The bit[15:0] is valid only when + bit[31:16] is set. + + + +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. + - reg : the mux register address. It should be the offset of the container. + - clkgate : bit index to control the clock gate in the gate register. + +Optional properties for gate clocks: + - clkgate-inverted : it indicates that setting 0 could enable the clock gate + and setting 1 could disable the clock gate. + - clkgate-seperated-reg : it indicates that there're three continuous + registers (enable, disable & status) for the same clock gate. + + + +Required properties for divider clocks: + - compatible : shall be "hisilicon,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. + - reg : the divider register address. It should be the offset of the + container. + - clkdiv-mask : mask bits of the divider register. + - clkdiv-min : the minimum divider of the clock divider. + - clkdiv-max : the maximum divider of the clock divider. + +Optional properties for divider clocks: + - clkdiv-hiword-mask : indicates that the bit[31:16] are the hiword mask + of divider selected bits (bit[15:0]). The bit[15:0] is valid only when + bit[31:16] is set. + + + +For example: + sctrl: sctrl at fc802000 { + compatible = "hisilicon,sctrl"; + reg = <0xfc802000 0x1000>; + #address-cells = <1>; + #size-cells = <0>; + + + timer0_mux: timer0_mux { + compatible = "hisilicon,clk-mux"; + #clock-cells = <0>; + clocks = <&osc32k &timerclk01>; + clock-output-names = "timer0_mux"; + reg = <0>; + clkmux-mask = <0x8000>; + clkmux-table = <0 0x8000>; + }; + uart0_mux: uart0_mux { + compatible = "hisilicon,clk-mux"; + #clock-cells = <0>; + clocks = <&osc26m &pclk>; + clock-output-names = "uart0_mux"; + reg = <0x100>; + clkmux-mask = <0x80>; + /* each item value */ + clkmux-table = <0 0x80>; + clkmux-hiword-mask; + }; + timclk0: timclk0 { + compatible = "hisilicon,clk-gate"; + #clock-cells = <0>; + clocks = <&timer0_mux>; + clock-output-names = "timclk0"; + clkgate-inverted; + reg = <0>; + clkgate = <16>; + }; + timerclk01: timerclk01 { + compatible = "hisilicon,clk-gate"; + #clock-cells = <0>; + clocks = <&timer_rclk01>; + clock-output-names = "timerclk01"; + reg = <0x20>; + clkgate = <0>; + clkgate-seperated-reg; + }; + mmc1_div: mmc1_div { + compatible = "hisilicon,clk-div"; + #clock-cells = <0>; + clocks = <&mmc1_mux>; + clock-output-names = "mmc1_div"; + reg = <0x108>; + clkdiv-mask = <0x1e0>; + clkdiv-min = <1>; + clkdiv-max = <16>; + clkdiv-hiword-mask; + }; + };
drivers/clk/Makefile +1 -0
@@ -12,6 +12,7 @@ obj-$(CONFIG_COMMON_CLK) += clk-composite.o # SoCs specific obj-$(CONFIG_ARCH_BCM2835) += clk-bcm2835.o obj-$(CONFIG_ARCH_NOMADIK) += clk-nomadik.o +obj-$(CONFIG_ARCH_HI3xxx) += hisilicon/ obj-$(CONFIG_ARCH_HIGHBANK) += clk-highbank.o obj-$(CONFIG_ARCH_NSPIRE) += clk-nspire.o obj-$(CONFIG_ARCH_MXS) += mxs/
drivers/clk/hisilicon/Makefile new file +2 -0
@@ -0,0 +1,2 @@ + +obj-y += clk-hi3xxx.o clkgate-seperated.o
drivers/clk/hisilicon/clk-hi3xxx.c new file +272 -0
272 lines not on this page · raw message
drivers/clk/hisilicon/clk-hi3xxx.h new file +34 -0
@@ -0,0 +1,34 @@ +/* +* Hisilicon Hi3620 clock gate driver +* +* Copyright (c) 2012-2013 Hisilicon Limited. +* Copyright (c) 2012-2013 Linaro Limited. +* +* Author: Haojian Zhuang <[email protected]> +* Xin Li <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License along +* with this program; if not, write to the Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +* +*/ + +#ifndef __HI3XXX_CLKGATE_SEPERATED +#define __HI3XXX_CLKGATE_SEPERATED + +extern struct clk *hi3xxx_register_clkgate_sep (struct device *,const char *, +const char *,unsigned long , +void __iomem *,u8 , +u8 ,spinlock_t *); + +#endif /* __HI3XXX_CLKGATE_SEPERATED */
drivers/clk/hisilicon/clkgate-seperated.c new file +129 -0
129 lines not on this page · raw message
Signature · 1 line
1.8.1.2
PATCH v8 3/8 ARM: hi3xxx: add board support with device tree
In reply to Haojian ZhuangAdd board support with device tree for Hisilicon Hi36xx/Hi37xx platform.
Changelog:
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 | 10 ++++++ 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 | 36 ++++++++++++++++++++++ 6 files changed, 66 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
@@ -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
@@ -943,6 +943,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
@@ -155,6 +155,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
@@ -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
@@ -0,0 +1,5 @@ +# +# Makefile for Hisilicon Hi36xx/Hi37xx processors line +# + +obj-y += hi3xxx.o
arch/arm/mach-hi3xxx/hi3xxx.c new file +36 -0
@@ -0,0 +1,36 @@ +/* +* (Hisilicon's Hi36xx/Hi37xx SoC based) flattened device tree enabled machine +* +* Copyright (c) 2012-2013 Hisilicon 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. +*/ + +#include <linux/clk-provider.h> +#include <linux/clocksource.h> +#include <linux/irqchip.h> +#include <linux/of_platform.h> + +#include <asm/mach/arch.h> +#include <asm/mach/map.h> + +static void __init hi3xxx_timer_init (void ) +{ +of_clk_init (NULL ); +clocksource_of_init (); +} + +static const char *hs_compat[]__initdata = { +"hisilicon,hi3620-hi4511" , +NULL , +}; + +DT_MACHINE_START (HI3xxx,"Hisilicon Hi36xx/Hi37xx (Flattened Device Tree)" ) + .init_time = hi3xxx_timer_init, + .dt_compat = hs_compat, +MACHINE_END
Signature · 1 line
1.8.1.2
PATCH v8 4/8 ARM: dts: enable hi4511 with device tree
In reply to Haojian ZhuangEnable Hisilicon Hi4511 development platform with device tree support.
--- arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/hi3620-clk.dtsi | 1058 +++++++++++++++++++++++++++++++++++++ arch/arm/boot/dts/hi3620.dtsi | 513 ++++++++++++++++++ arch/arm/boot/dts/hi4511.dts | 648 +++++++++++++++++++++++ 4 files changed, 2220 insertions(+) create mode 100644 arch/arm/boot/dts/hi3620-clk.dtsi 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
@@ -64,6 +64,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-clk.dtsi new file +1058 -0
1,058 lines not on this page · raw message
arch/arm/boot/dts/hi3620.dtsi new file +513 -0
513 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.1.2
PATCH v8 5/8 ARM: config: enable hi3xxx in multi_v7_defconfig
In reply to Haojian ZhuangEnable 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
@@ -8,6 +8,7 @@ CONFIG_MACH_ARMADA_XP=y CONFIG_ARCH_BCM=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.1.2
PATCH v8 6/8 ARM: config: add defconfig for Hi3xxx
In reply to Haojian ZhuangAdd 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
@@ -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.1.2
PATCH v8 7/8 ARM: hi3xxx: add smp support
In reply to Haojian ZhuangFrom: Zhangfei Gao <[email protected]>
Enable SMP support on hi3xxx platform
--- .../bindings/arm/hisilicon/hisilicon.txt | 47 ++++++++++++++++ arch/arm/boot/dts/hi3620-clk.dtsi | 4 ++ arch/arm/boot/dts/hi3620.dtsi | 24 ++++++++ arch/arm/boot/dts/hi4511.dts | 2 +- arch/arm/mach-hi3xxx/Kconfig | 2 + arch/arm/mach-hi3xxx/Makefile | 3 +- arch/arm/mach-hi3xxx/core.h | 14 +++++ arch/arm/mach-hi3xxx/hi3xxx.c | 5 ++ arch/arm/mach-hi3xxx/platsmp.c | 43 ++++++++++++++ arch/arm/mach-hi3xxx/system.c | 65 ++++++++++++++++++++++ 10 files changed, 207 insertions(+), 2 deletions(-) create mode 100644 arch/arm/mach-hi3xxx/core.h create mode 100644 arch/arm/mach-hi3xxx/platsmp.c create mode 100644 arch/arm/mach-hi3xxx/system.c
Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt +47 -0
@@ -8,3 +8,50 @@ Required root node properties: Hi4511 Board Required root node properties: - compatible = "hisilicon,hi3620-hi4511"; + + +Hisilicon sctrl resiter + +Required properties: +- compatible : "hisilicon,sctrl" +- reg : Address and size of sysctrl. + +Optional properties: +- smp_reg : 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_reg : offset in sysctrl for notifying cpu0 when resume +- reset_reg : offset in sysctrl for system reset + +Example: + hi3716: + sctrl at f8000000 { + compatible = "hisilicon,sctrl"; + reg = <0xf8000000 0x1000>; + smp_reg = <0xc0>; + reboot_reg = <0x4>; + }; + + hi3620: + sctrl at fc802000 { + compatible = "hisilicon,sctrl"; + reg = <0xfc802000 0x1000>; + smp_reg = <0x31c>; + resume_reg = <0x308>; + reboot_reg = <0x4>; + }; + +Hi3716 cpuctrl register +Required properties: +- compatible : "hisilicon,cpuctrl" +- reg : Address and size of cpuctrl. + +Hi3716 specific cpuctrl register, control hotplug info etc. +Example: + hi3716: + cpuctrl at f8a22000 { + compatible = "hisilicon,cpuctrl"; + reg = <0xf8a22000 0x2000>; + };
arch/arm/boot/dts/hi3620-clk.dtsi +4 -0
@@ -102,6 +102,10 @@ #address-cells = <1>; #size-cells = <0>; + smp_reg = <0x31c>; + resume_reg = <0x308>; + reboot_reg = <0x4>; + timer0_mux: timer0_mux { compatible = "hisilicon,clk-mux"; #clock-cells = <0>;
arch/arm/boot/dts/hi3620.dtsi +24 -0
@@ -34,6 +34,24 @@ reg = <0x0>; next-level-cache = <&L2>; }; + cpu1: cpu at 1 { + compatible = "arm,cortex-a9"; + device_type = "cpu"; + reg = <1>; + next-level-cache = <&L2>; + }; + cpu2: cpu at 2 { + compatible = "arm,cortex-a9"; + device_type = "cpu"; + reg = <2>; + next-level-cache = <&L2>; + }; + cpu3: cpu at 3 { + compatible = "arm,cortex-a9"; + device_type = "cpu"; + reg = <3>; + next-level-cache = <&L2>; + }; }; amba {
@@ -110,6 +128,12 @@ status = "disabled"; }; + timer5: timer at fc000600 { + compatible = "arm,cortex-a9-twd-timer"; + reg = <0xfc000600 0x20>; + interrupts = <1 13 0xf01>; + }; + uart0: uart at fcb00000 { compatible = "arm,pl011", "arm,primecell"; reg = <0xfcb00000 0x1000>;
arch/arm/boot/dts/hi4511.dts +1 -1
@@ -15,7 +15,7 @@ compatible = "hisilicon,hi3620-hi4511"; chosen { - bootargs = "console=ttyAMA0,115200 root=/dev/ram0 earlyprintk"; + bootargs = "console=ttyAMA0,115200 root=/dev/ram0 nr_cpus=4 earlyprintk"; }; memory {
arch/arm/mach-hi3xxx/Kconfig +2 -0
@@ -6,6 +6,8 @@ config ARCH_HI3xxx select CACHE_L2X0 select CLKSRC_OF select GENERIC_CLOCKEVENTS + select HAVE_ARM_SCU + select HAVE_SMP select PINCTRL select PINCTRL_SINGLE help
arch/arm/mach-hi3xxx/Makefile +2 -1
@@ -2,4 +2,5 @@ # Makefile for Hisilicon Hi36xx/Hi37xx processors line # -obj-y += hi3xxx.o +obj-y += hi3xxx.o system.o +obj-$(CONFIG_SMP) += platsmp.o
arch/arm/mach-hi3xxx/core.h new file +14 -0
@@ -0,0 +1,14 @@ +#ifndef __HISILICON_CORE_H +#define __HISILICON_CORE_H + +#include <linux/init.h> +#include <linux/reboot.h> + +extern void hs_set_cpu_jump (int cpu,void *jump_addr); +extern int hs_get_cpu_jump (int cpu); +extern void secondary_startup (void ); +extern void hs_map_io (void ); +extern void hs_restart (enum reboot_mode ,const char *cmd); +extern struct smp_operations hs_smp_ops; + +#endif
arch/arm/mach-hi3xxx/hi3xxx.c +5 -0
@@ -19,8 +19,11 @@#include <asm/mach/arch.h> #include <asm/mach/map.h> +#include "core.h" +static void __init hi3xxx_timer_init (void ) { +hs_map_io ();of_clk_init (NULL );clocksource_of_init (); }
@@ -33,4 +36,6 @@ static const char *hs_compat[] __initdata = {DT_MACHINE_START (HI3xxx,"Hisilicon Hi36xx/Hi37xx (Flattened Device Tree)" ) .init_time = hi3xxx_timer_init, .dt_compat = hs_compat, + .smp = smp_ops(hs_smp_ops), + .restart = hs_restart,MACHINE_END
arch/arm/mach-hi3xxx/platsmp.c new file +43 -0
43 lines not on this page · raw message
arch/arm/mach-hi3xxx/system.c new file +65 -0
65 lines not on this page · raw message
Signature · 1 line
1.8.1.2
PATCH v8 8/8 ARM: hi3xxx: add hotplug support
In reply to Haojian ZhuangFrom: 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 | 5 ++ arch/arm/mach-hi3xxx/hi3xxx.c | 1 + arch/arm/mach-hi3xxx/hotplug.c | 154 +++++++++++++++++++++++++++++++++++++++++ arch/arm/mach-hi3xxx/platsmp.c | 5 ++ 5 files changed, 166 insertions(+) create mode 100644 arch/arm/mach-hi3xxx/hotplug.c
arch/arm/mach-hi3xxx/Makefile +1 -0
@@ -4,3 +4,4 @@ obj-y += hi3xxx.o system.o obj-$(CONFIG_SMP) += platsmp.o +obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
arch/arm/mach-hi3xxx/core.h +5 -0
@@ -11,4 +11,9 @@ extern void hs_map_io(void);extern void hs_restart (enum reboot_mode ,const char *cmd);extern struct smp_operations hs_smp_ops; +extern void __init hs_hotplug_init (void ); +extern void hs_cpu_die (unsigned int cpu); +extern int hs_cpu_kill (unsigned int cpu); +extern void hs_set_cpu (int cpu,bool enable); +#endif
arch/arm/mach-hi3xxx/hi3xxx.c +1 -0
@@ -24,6 +24,7 @@static void __init hi3xxx_timer_init (void ) {hs_map_io (); +hs_hotplug_init ();of_clk_init (NULL );clocksource_of_init (); }
arch/arm/mach-hi3xxx/hotplug.c new file +154 -0
154 lines not on this page · raw message
arch/arm/mach-hi3xxx/platsmp.c +5 -0
@@ -32,6 +32,7 @@ static void __init hs_smp_prepare_cpus(unsigned int max_cpus)static int hs_boot_secondary (unsigned int cpu,struct task_struct *idle) { +hs_set_cpu (cpu, true);hs_set_cpu_jump (cpu, secondary_startup);arch_send_wakeup_ipi_mask (cpumask_of (cpu));return 0 ;
@@ -40,4 +41,8 @@ static int hs_boot_secondary(unsigned int cpu, struct task_struct *idle)struct smp_operations hs_smp_ops__initdata = { .smp_prepare_cpus = hs_smp_prepare_cpus, .smp_boot_secondary = hs_boot_secondary, +#ifdef CONFIG_HOTPLUG_CPU + .cpu_die = hs_cpu_die, + .cpu_kill = hs_cpu_kill, +#endif };
Signature · 1 line
1.8.1.2