arm64,hi6220: Enable Hisilicon Hi6220 SoC
Subsystems (6)
v4 cover arm64,hi6220: Enable Hisilicon Hi6220 SoC
Hi6220 is one mobile solution of Hisilicon, this patchset contains initial support for Hi6220 SoC and HiKey development board, which supports octal ARM Cortex A53 cores. Initial support is minimal and includes just the arch configuration, clock driver, device tree configuration.
PSCI is enabled in device tree and there is no problem to boot all the octal cores, and the CPU hotplug is also working now, you can download and compile the latest firmware based on the following link to run this patch set:
https://github.com/96boards/documentation/wiki/UEFI
Changes v4:
* Rebase to kernel 4.1-rc1
* Delete "arm,cortex-a15-gic" from the gic node in dts
Changes v3:
* Verified the CPU hotplug based on the new released firmware
* Redefined the compatible strings of four system controllers in dts
* Setting COMMON_CLK_HI6220 to a bool symbol
* Keep CONFGI_ARCH_HISI sorted alphabetically
Changes v2:
* Split the DT bindings documents into earlier patches
* Change SMP enable method from spin-table to PSCI in device tree
* Remove "clock-frequency" from armv8-timer device node in device tree
* Add more description about Hisilicon designed system controllers in DT bindings document
* Enable high speed clock on UART1 mux
* Other changes based on the discussion in the mailing list:
https://lkml.org/lkml/2015/2/5/147
Bintian Wang (5):
arm64: Enable Hisilicon ARMv8 SoC family in Kconfig and defconfig
arm64: hi6220: Document devicetree bindings for Hisilicon hi6220 SoC
clk: hi6220: Document devicetree bindings for hi6220 clock
clk: hi6220: Clock driver support for Hisilicon hi6220 SoC
arm64: dts: Add dts files for Hisilicon Hi6220 SoC
.../bindings/arm/hisilicon/hisilicon.txt | 87 ++++++ .../devicetree/bindings/clock/hi6220-clock.txt | 34 +++ arch/arm64/Kconfig | 5 + arch/arm64/boot/dts/Makefile | 1 + arch/arm64/boot/dts/hisilicon/Makefile | 5 + arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts | 31 +++ arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 172 ++++++++++++ arch/arm64/configs/defconfig | 1 + drivers/clk/Kconfig | 2 + drivers/clk/Makefile | 4 +- drivers/clk/hisilicon/Kconfig | 6 + drivers/clk/hisilicon/Makefile | 3 +- drivers/clk/hisilicon/clk-hi6220.c | 292 +++++++++++++++++++++ drivers/clk/hisilicon/clk.c | 29 ++ drivers/clk/hisilicon/clk.h | 17 ++ drivers/clk/hisilicon/clkdivider-hi6220.c | 273 +++++++++++++++++++ include/dt-bindings/clock/hi6220-clock.h | 173 ++++++++++++ 17 files changed, 1131 insertions(+), 4 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/hi6220-clock.txt create mode 100644 arch/arm64/boot/dts/hisilicon/Makefile create mode 100644 arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts create mode 100644 arch/arm64/boot/dts/hisilicon/hi6220.dtsi create mode 100644 drivers/clk/hisilicon/Kconfig create mode 100644 drivers/clk/hisilicon/clk-hi6220.c create mode 100644 drivers/clk/hisilicon/clkdivider-hi6220.c create mode 100644 include/dt-bindings/clock/hi6220-clock.h
Signature · 1 line
1.9.1
PATCH v4 1/5 arm64: Enable Hisilicon ARMv8 SoC family in Kconfig and defconfig
This patch introduces ARCH_HISI to enable Hisilicon SoC family in Kconfig and defconfig.
--- arch/arm64/Kconfig | 5 +++++ arch/arm64/configs/defconfig | 1 + 2 files changed, 6 insertions(+)
arch/arm64/Kconfig +5 -0
@@ -180,6 +180,11 @@ config ARCH_FSL_LS2085A help This enables support for Freescale LS2085A SOC. +config ARCH_HISI + bool "Hisilicon SoC Family" + help + This enables support for Hisilicon ARMv8 SoC family + config ARCH_MEDIATEK bool "Mediatek MT65xx & MT81xx ARMv8 SoC" select ARM_GIC
arch/arm64/configs/defconfig +1 -0
@@ -33,6 +33,7 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_IOSCHED_DEADLINE is not set CONFIG_ARCH_EXYNOS7=y CONFIG_ARCH_FSL_LS2085A=y +CONFIG_ARCH_HISI=y CONFIG_ARCH_MEDIATEK=y CONFIG_ARCH_SEATTLE=y CONFIG_ARCH_TEGRA=y
Signature · 1 line
1.9.1
PATCH v4 2/5 arm64: hi6220: Document devicetree bindings for Hisilicon hi6220 SoC
In reply to Bintian WangThis patch adds documentation for the devicetree bindings used by the DT files of Hisilicon hi6220 SoC mobile platform.
--- .../bindings/arm/hisilicon/hisilicon.txt | 87 ++++++++++++++++++++++ 1 file changed, 87 insertions(+)
Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt +87 -0
@@ -1,5 +1,8 @@ Hisilicon Platforms Device Tree Bindings ---------------------------------------------------- +Hi6220 SoC +Required root node properties: + - compatible = "hisilicon,hi6220"; Hi4511 Board Required root node properties:
@@ -13,6 +16,9 @@ HiP01 ca9x2 Board Required root node properties: - compatible = "hisilicon,hip01-ca9x2"; +HiKey Board +Required root node properties: + - compatible = "hisilicon,hi6220-hikey", "hisilicon,hi6220"; Hisilicon system controller
@@ -41,6 +47,87 @@ Example: }; ----------------------------------------------------------------------- +Hisilicon Hi6220 system controller + +Required properties: +- compatible : "hisilicon,hi6220-sysctrl" +- reg : Register address and size +- #clock-cells: should be set to 1, many clock registers are defined + under this controller and this property must be present. + +Hisilicon designs this controller as one of the system controllers, +its main functions are the same as Hisilicon system controller, but +the register offset of some core modules are different. + +Example: + /*for Hi6220*/ + sys_ctrl: sys_ctrl { + compatible = "hisilicon,hi6220-sysctrl", "syscon"; + reg = <0x0 0xf7030000 0x0 0x2000>; + #clock-cells = <1>; + }; + + +Hisilicon Hi6220 Power Always ON domain controller + +Required properties: +- compatible : "hisilicon,hi6220-aoctrl" +- reg : Register address and size +- #clock-cells: should be set to 1, many clock registers are defined + under this controller and this property must be present. + +Hisilicon designs this system controller to control the power always +on domain for mobile platform. + +Example: + /*for Hi6220*/ + ao_ctrl: ao_ctrl { + compatible = "hisilicon,hi6220-aoctrl", "syscon"; + reg = <0x0 0xf7800000 0x0 0x2000>; + #clock-cells = <1>; + }; + + +Hisilicon Hi6220 Media domain controller + +Required properties: +- compatible : "hisilicon,hi6220-mediactrl" +- reg : Register address and size +- #clock-cells: should be set to 1, many clock registers are defined + under this controller and this property must be present. + +Hisilicon designs this system controller to control the multimedia +domain(e.g. codec, G3D ...) for mobile platform. + +Example: + /*for Hi6220*/ + media_ctrl: media_ctrl { + compatible = "hisilicon,hi6220-mediactrl", "syscon"; + reg = <0x0 0xf4410000 0x0 0x1000>; + #clock-cells = <1>; + }; + + +Hisilicon Hi6220 Power Management domain controller + +Required properties: +- compatible : "hisilicon,hi6220-pmctrl" +- reg : Register address and size +- #clock-cells: should be set to 1, some clock registers are define + under this controller and this property must be present. + +Hisilicon designs this system controller to control the power management +domain for mobile platform. + +Example: + /*for Hi6220*/ + pm_ctrl: pm_ctrl { + compatible = "hisilicon,hi6220-pmctrl", "syscon"; + reg = <0x0 0xf7032000 0x0 0x1000>; + #clock-cells = <1>; + }; + +----------------------------------------------------------------------- Hisilicon HiP01 system controller Required properties:
Signature · 1 line
1.9.1
Re: [PATCH v4 2/5] arm64: hi6220: Document devicetree bindings for Hisilicon hi6220 SoC
Quoted 4 lines · Bintian Wang
This patch adds documentation for the devicetree bindings used by the DT files of Hisilicon hi6220 SoC mobile platform.
Signed-off-by Bintian Wang <[email protected]>
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v4 2/5] arm64: hi6220: Document devicetree bindings for Hisilicon hi6220 SoC
Hello Stephen,
Quoted 8 lines · Stephen Boyd
Quoted 4 lines · Bintian Wang
This patch adds documentation for the devicetree bindings used by the DT files of Hisilicon hi6220 SoC mobile platform.
Signed-off-by Bintian Wang <[email protected]>Acked-by Stephen Boyd <[email protected]>
Thanks for your ACK!
Bintian
PATCH v4 3/5 clk: hi6220: Document devicetree bindings for hi6220 clock
In reply to Bintian WangDocument DT files bindings for Hisilicon hi6220 clock.
--- .../devicetree/bindings/clock/hi6220-clock.txt | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/hi6220-clock.txt
Documentation/devicetree/bindings/clock/hi6220-clock.txt new file +34 -0
@@ -0,0 +1,34 @@ +* Hisilicon Hi6220 Clock Controller + +Clock control registers reside in different Hi6220 system controllers, +please refer the following document to know more about the binding rules +for these system controllers: + +Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt + +Required Properties: + +- compatible: the compatible should be one of the following strings to + indicate the clock controller functionality. + + - "hisilicon,hi6220-aoctrl" + - "hisilicon,hi6220-sysctrl" + - "hisilicon,hi6220-mediactrl" + - "hisilicon,hi6220-pmctrl" + +- reg: physical base address of the controller and length of memory mapped + region. + +- #clock-cells: should be 1. + +For example: + sys_ctrl: sys_ctrl { + compatible = "hisilicon,hi6220-sysctrl", "syscon"; + reg = <0x0 0xf7030000 0x0 0x2000>; + #clock-cells = <1>; + }; + +Each clock is assigned an identifier and client nodes use this identifier +to specify the clock which they consume. + +All these identifier could be found in <dt-bindings/clock/hi6220-clock.h>.
Signature · 1 line
1.9.1
Re: [PATCH v4 3/5] clk: hi6220: Document devicetree bindings for hi6220 clock
Quoted 4 lines · Bintian Wang
Document DT files bindings for Hisilicon hi6220 clock.
Signed-off-by Bintian Wang <[email protected]>Reviewed-by Haojian Zhuang <[email protected]>
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH v4 4/5 clk: hi6220: Clock driver support for Hisilicon hi6220 SoC
In reply to Bintian WangAdd clock drivers for hi6220 SoC, this driver controls the SoC registers to supply different clocks to different IPs in the SoC.
We add one divider clock for hi6220 because the divider in hi6220 also has a mask bit but it doesnot obey the rule defined by flag "CLK_DIVIDER_HIWORD_MASK", we can not get index of the mask bit by left shift fixed bits (e.g. 16 bits), so we add this divider clock to handle it.
--- drivers/clk/Kconfig | 2 + drivers/clk/Makefile | 4 +- drivers/clk/hisilicon/Kconfig | 6 + drivers/clk/hisilicon/Makefile | 3 +- drivers/clk/hisilicon/clk-hi6220.c | 292 ++++++++++++++++++++++++++++++ drivers/clk/hisilicon/clk.c | 29 +++ drivers/clk/hisilicon/clk.h | 17 ++ drivers/clk/hisilicon/clkdivider-hi6220.c | 273 ++++++++++++++++++++++++++++ include/dt-bindings/clock/hi6220-clock.h | 173 ++++++++++++++++++ 9 files changed, 795 insertions(+), 4 deletions(-) create mode 100644 drivers/clk/hisilicon/Kconfig create mode 100644 drivers/clk/hisilicon/clk-hi6220.c create mode 100644 drivers/clk/hisilicon/clkdivider-hi6220.c create mode 100644 include/dt-bindings/clock/hi6220-clock.h
drivers/clk/Kconfig +2 -0
@@ -152,6 +152,8 @@ config COMMON_CLK_CDCE706 source "drivers/clk/qcom/Kconfig" +source "drivers/clk/hisilicon/Kconfig" + endmenu source "drivers/clk/bcm/Kconfig"
drivers/clk/Makefile +1 -3
@@ -47,9 +47,7 @@ obj-$(CONFIG_COMMON_CLK_PWM) += clk-pwm.o obj-$(CONFIG_COMMON_CLK_AT91) += at91/ obj-$(CONFIG_ARCH_BCM_MOBILE) += bcm/ obj-$(CONFIG_ARCH_BERLIN) += berlin/ -obj-$(CONFIG_ARCH_HI3xxx) += hisilicon/ -obj-$(CONFIG_ARCH_HIP04) += hisilicon/ -obj-$(CONFIG_ARCH_HIX5HD2) += hisilicon/ +obj-$(CONFIG_ARCH_HISI) += hisilicon/ obj-$(CONFIG_COMMON_CLK_KEYSTONE) += keystone/ ifeq ($(CONFIG_COMMON_CLK), y) obj-$(CONFIG_ARCH_MMP) += mmp/
drivers/clk/hisilicon/Kconfig new file +6 -0
@@ -0,0 +1,6 @@ +config COMMON_CLK_HI6220 + bool "Hi6220 Clock Driver" + depends on OF && ARCH_HISI + default y + help + Build the Hisilicon Hi6220 clock driver based on the common clock framework.
drivers/clk/hisilicon/Makefile +2 -1
@@ -2,8 +2,9 @@ # Hisilicon Clock specific Makefile # -obj-y += clk.o clkgate-separated.o +obj-y += clk.o clkgate-separated.o clkdivider-hi6220.o obj-$(CONFIG_ARCH_HI3xxx) += clk-hi3620.o obj-$(CONFIG_ARCH_HIP04) += clk-hip04.o obj-$(CONFIG_ARCH_HIX5HD2) += clk-hix5hd2.o +obj-$(CONFIG_COMMON_CLK_HI6220) += clk-hi6220.o
drivers/clk/hisilicon/clk-hi6220.c new file +292 -0
292 lines not on this page · raw message
drivers/clk/hisilicon/clk.c +29 -0
@@ -232,3 +232,32 @@ void __init hisi_clk_register_gate_sep(struct hisi_gate_clock *clks, data->clk_data.clks[clks[i].id] = clk; } } + +void __init hi6220_clk_register_divider (struct hi6220_divider_clock *clks, +int nums,struct hisi_clock_data *data) +{ +struct clk *clk; +void __iomem *base = data->base; +int i; + +for (i =0 ; i < nums; i++) { + clk =hi6220_register_clkdiv (NULL , clks[i].name, + clks[i].parent_name, + clks[i].flags, + base + clks[i].offset, + clks[i].shift, + clks[i].width, + clks[i].mask_bit, + &hisi_clk_lock); +if (IS_ERR (clk)) { +pr_err ("%s: failed to register clock %s\n" , + __func__, clks[i].name); +continue ; + } + +if (clks[i].alias) +clk_register_clkdev (clk, clks[i].alias,NULL ); + + data->clk_data.clks[clks[i].id] = clk; + } +}
drivers/clk/hisilicon/clk.h +17 -0
@@ -79,6 +79,18 @@ struct hisi_divider_clock {const char *alias; }; +struct hi6220_divider_clock { +unsigned int id; +const char *name; +const char *parent_name; +unsigned long flags; +unsigned long offset; +u8 shift; +u8 width; +u32 mask_bit; +const char *alias; +}; +struct hisi_gate_clock {unsigned int id;const char *name;
@@ -94,6 +106,9 @@ struct clk *hisi_register_clkgate_sep(struct device *, const char *, const char *, unsigned long, void __iomem *, u8, u8, spinlock_t *); +struct clk *hi6220_register_clkdiv (struct device *dev,const char *name, +const char *parent_name,unsigned long flags,void __iomem *reg, +u8 shift,u8 width,u32 mask_bit,spinlock_t *lock);struct hisi_clock_data __init *hisi_clk_init (struct device_node *,int ); void __init hisi_clk_register_fixed_rate(struct hisi_fixed_rate_clock *,
@@ -108,4 +123,6 @@ void __init hisi_clk_register_gate(struct hisi_gate_clock *, int, struct hisi_clock_data *);void __init hisi_clk_register_gate_sep (struct hisi_gate_clock *,int ,struct hisi_clock_data *); +void __init hi6220_clk_register_divider (struct hi6220_divider_clock *, +int ,struct hisi_clock_data *);#endif /* __HISI_CLK_H */
drivers/clk/hisilicon/clkdivider-hi6220.c new file +273 -0
273 lines not on this page · raw message
include/dt-bindings/clock/hi6220-clock.h new file +173 -0
173 lines not on this page · raw message
Signature · 1 line
1.9.1
Re: [PATCH v4 4/5] clk: hi6220: Clock driver support for Hisilicon hi6220 SoC
drivers/clk/Kconfig config COMMON_CLK_CDCE706 · line 156
Quoted 10 lines · Bintian Wang
drivers/clk/Kconfig +2
-0@@ -152,6 +152,8 @@ config COMMON_CLK_CDCE706 source "drivers/clk/qcom/Kconfig" +source "drivers/clk/hisilicon/Kconfig" +
Please move this above qcom to maintain alphabet sort.
drivers/clk/hisilicon/Kconfig line 4
Quoted 13 lines
drivers/clk/Kconfig +0
-0endmenu source "drivers/clk/bcm/Kconfig"drivers/clk/hisilicon/Kconfig new file +4
-0@@ -0,0 +1,6 @@ +config COMMON_CLK_HI6220 + bool "Hi6220 Clock Driver" + depends on OF && ARCH_HISI + default y
Can this be
depends on ARCH_HISI || COMPILE_TEST default ARCH_HISI
instead? I'd like to increase build coverage.
Quoted 19 lines
drivers/clk/hisilicon/Kconfig new file +2
-0+ help + Build the Hisilicon Hi6220 clock driver based on the common clock framework.drivers/clk/hisilicon/clk-hi6220.c new file +11
-0@@ -0,0 +1,292 @@ +/* +* Hisilicon Hi6220 clock driver +* +* Copyright (c) 2015 Hisilicon Limited. +* +* Author: Bintian Wang <[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. +*/
drivers/clk/hisilicon/clk-hi6220.c line 21
Quoted 10 lines
drivers/clk/hisilicon/clk-hi6220.c new file +10
-0+ +#include <linux/kernel.h> +#include <linux/clk-provider.h> +#include <linux/clkdev.h> +#include <linux/io.h> +#include <linux/of.h> +#include <linux/of_address.h> +#include <linux/of_device.h> +#include <linux/slab.h> +#include <linux/clk.h>
Do we need to include linux/clk.h? I don't see any consumer usage here.
Quoted 10 lines
drivers/clk/hisilicon/clk-hi6220.c new file +5
-0+ +#include <dt-bindings/clock/hi6220-clock.h> + +#include "clk.h" +drivers/clk/hisilicon/clk.c +0
-0
drivers/clk/hisilicon/clk.c void __init hisi_clk_register_gate(struct hisi_gate_clock *, · line 127
Quoted 5 lines
drivers/clk/hisilicon/clk.c +2
-0@@ -108,4 +123,6 @@ void __init hisi_clk_register_gate(struct hisi_gate_clock *, int, struct hisi_clock_data *);void __init hisi_clk_register_gate_sep (struct hisi_gate_clock *,int ,struct hisi_clock_data *); +void __init hi6220_clk_register_divider (struct hi6220_divider_clock *, +int ,struct hisi_clock_data *);
__init markings on function prototypes are useless. Please remove them.
Quoted 13 lines
drivers/clk/hisilicon/clk.c +0
-0#endif /* __HISI_CLK_H */ drivers/clk/hisilicon/clkdivider-hi6220.c +11
-0+ +/** +* struct hi6220_clk_divider - divider clock for hi6220 +* +* @hw: handle between common and hardware-specific interfaces +* @reg: register containing divider +* @shift: shift to the divider bit field +* @width: width of the divider bit field +* @mask: mask for setting divider rate +* @table: the div table that the divider supports +* @lock: register lock
drivers/clk/hisilicon/clkdivider-hi6220.c line 47
Quoted 10 lines
drivers/clk/hisilicon/clkdivider-hi6220.c +10
-0+*/ +struct hi6220_clk_divider { +struct clk_hw hw; +void __iomem *reg; +u8 shift; +u8 width; +u32 mask; +const struct clk_div_table *table; +spinlock_t *lock; +};
The clk-divider.c code has been made "reusable". Can you please try to use the functions that it now exposes instead of copy/pasting it and modifying it to suit your needs? A lot of this code looks the same.
Quoted 2 lines
drivers/clk/hisilicon/clkdivider-hi6220.c +2
-0+ +#define to_hi6220_clk_divider (_hw) \
[..]
drivers/clk/hisilicon/clkdivider-hi6220.c line 209
Quoted 2 lines
drivers/clk/hisilicon/clkdivider-hi6220.c +2
-0+ +static struct clk_ops hi6220_clkdiv_ops = {
const?
Quoted 10 lines
drivers/clk/hisilicon/clkdivider-hi6220.c +10
-0+ .recalc_rate = hi6220_clkdiv_recalc_rate, + .round_rate = hi6220_clkdiv_round_rate, + .set_rate = hi6220_clkdiv_set_rate, +}; + +struct clk *hi6220_register_clkdiv (struct device *dev,const char *name, +const char *parent_name,unsigned long flags,void __iomem *reg, +u8 shift,u8 width,u32 mask_bit,spinlock_t *lock) +{ +struct hi6220_clk_divider *div;
drivers/clk/hisilicon/clkdivider-hi6220.c line 229
Quoted 10 lines
drivers/clk/hisilicon/clkdivider-hi6220.c +10
-0+struct clk *clk; +struct clk_init_data init; +struct clk_div_table *table; +u32 max_div, min_div; +int i; + +/* allocate the divider */ + div =kzalloc (sizeof (struct hi6220_clk_divider ),GFP_KERNEL ); +if (!div) { +pr_err ("%s: could not allocate divider clk\n" , __func__);
Useless error message on allocation failure. Please run checkpatch. I've sent a patch to remove these from basic clock types.
drivers/clk/hisilicon/clkdivider-hi6220.c line 240
Quoted 11 lines
drivers/clk/hisilicon/clkdivider-hi6220.c +11
-0+return ERR_PTR (-ENOMEM ); + } + +/* Init the divider table */ + max_div =div_mask (width) +1 ; + min_div =1 ; + + table =kzalloc (sizeof (struct clk_div_table ) * (max_div +1 ),GFP_KERNEL ); +if (!table) { +kfree (div); +pr_err ("%s: failed to alloc divider table!\n" , __func__);
ditto.
drivers/clk/hisilicon/clkdivider-hi6220.c line 251
Quoted 11 lines
drivers/clk/hisilicon/clkdivider-hi6220.c +11
-0+return ERR_PTR (-ENOMEM ); + } + +for (i =0 ; i < max_div; i++) { + table[i].div = min_div + i; + table[i].val = table[i].div -1 ; + } + + init.name = name; + init.ops = &hi6220_clkdiv_ops; + init.flags = flags |CLK_IS_BASIC ;
It's basic?
Quoted 2 lines
drivers/clk/hisilicon/clkdivider-hi6220.c +2
-0+ init.parent_names = parent_name ? &parent_name :NULL ; + init.num_parents = parent_name ?1 :0 ;
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v4 4/5] clk: hi6220: Clock driver support for Hisilicon hi6220 SoC
Hello Stephen,
Quoted 7 lines · Stephen Boyd
Quoted 6 lines · Bintian Wang
drivers/clk/Kconfig +0
-0@@ -152,6 +152,8 @@ config COMMON_CLK_CDCE706
Quoted 6 lines
drivers/clk/Kconfig config COMMON_CLK_CDCE706 · line 156
Quoted 4 lines
drivers/clk/Kconfig +2
-0source "drivers/clk/qcom/Kconfig" +source "drivers/clk/hisilicon/Kconfig" +Please move this above qcom to maintain alphabet sort.
OK, fix in next version.
Quoted 17 lines
Quoted 10 lines
drivers/clk/Kconfig +0
-0endmenu source "drivers/clk/bcm/Kconfig"drivers/clk/hisilicon/Kconfig new file +0
-0drivers/clk/hisilicon/Kconfig line 4
Quoted 4 lines
drivers/clk/hisilicon/Kconfig new file +4
-0@@ -0,0 +1,6 @@ +config COMMON_CLK_HI6220 + bool "Hi6220 Clock Driver" + depends on OF && ARCH_HISI + default yCan this be
Quoted 4 lines
depends on ARCH_HISI || COMPILE_TEST default ARCH_HISIinstead? I'd like to increase build coverage.
No problem, will fix in next version.
Quoted 25 lines
Quoted 25 lines
drivers/clk/hisilicon/Kconfig new file +2
-0+ help + Build the Hisilicon Hi6220 clock driver based on the common clock framework.drivers/clk/hisilicon/clk-hi6220.c new file +16
-0@@ -0,0 +1,292 @@ +/* +* Hisilicon Hi6220 clock driver +* +* Copyright (c) 2015 Hisilicon Limited. +* +* Author: Bintian Wang <[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/kernel.h> +#include <linux/clk-provider.h> +#include <linux/clkdev.h> +#include <linux/io.h>
Quoted 8 lines
drivers/clk/hisilicon/clk-hi6220.c line 21
Quoted 5 lines
drivers/clk/hisilicon/clk-hi6220.c new file +5
-0+#include <linux/of.h> +#include <linux/of_address.h> +#include <linux/of_device.h> +#include <linux/slab.h> +#include <linux/clk.h> Do we need to include
linux/clk.h? I don't see any consumer usage here.
You are right, remove in next version.
Quoted 10 lines
Quoted 10 lines
drivers/clk/hisilicon/clk-hi6220.c new file +5
-0+ +#include <dt-bindings/clock/hi6220-clock.h> + +#include "clk.h" +drivers/clk/hisilicon/clk.c +0
-0
Quoted 8 lines
drivers/clk/hisilicon/clk.c void __init hisi_clk_register_gate(struct hisi_gate_clock *, · line 127
Quoted 6 lines
drivers/clk/hisilicon/clk.c +2
-0@@ -108,4 +123,6 @@ void __init hisi_clk_register_gate(struct hisi_gate_clock *, int, struct hisi_clock_data *);void __init hisi_clk_register_gate_sep (struct hisi_gate_clock *,int ,struct hisi_clock_data *); +void __init hi6220_clk_register_divider (struct hi6220_divider_clock *, +int ,struct hisi_clock_data *);
__initmarkings on function prototypes are useless. Please remove them.
OK
Quoted 21 lines
Quoted 21 lines
drivers/clk/hisilicon/clk.c +0
-0#endif /* __HISI_CLK_H */ drivers/clk/hisilicon/clkdivider-hi6220.c +18
-0+ +/** +* struct hi6220_clk_divider - divider clock for hi6220 +* +* @hw: handle between common and hardware-specific interfaces +* @reg: register containing divider +* @shift: shift to the divider bit field +* @width: width of the divider bit field +* @mask: mask for setting divider rate +* @table: the div table that the divider supports +* @lock: register lock +*/ +struct hi6220_clk_divider { +struct clk_hw hw; +void __iomem *reg; +u8 shift; +u8 width; +u32 mask;
Quoted 8 lines
drivers/clk/hisilicon/clkdivider-hi6220.c line 47
Quoted 3 lines
drivers/clk/hisilicon/clkdivider-hi6220.c +3
-0+const struct clk_div_table *table; +spinlock_t *lock; +};The
clk-divider.ccode has been made "reusable". Can you please try to use the functions that it now exposes instead of copy/pasting it and modifying it to suit your needs? A lot of this code looks the same.
In fact, I discussed this problem with Rob Herring and Mike Turquette in the 96boards internal mail list before.
The divider in hi6220 has a mask bit to guarantee writing the correct bits in register when setting rate, but the index of this mask bit has no rules to get (e.g. by left shift some fixed bits), so I add this divider clock to handle it, we can regard hi6220_clk_divider as a special case of generic divider clock.
If I don't add this divider clock for hi6220 chip, then I should change the core APIs "clk_register_divider" and "clk_register_divider_table", and then many other drivers will be updated.
So I think just add this divider clock is a good solution now.
Quoted 8 lines
Quoted 3 lines
drivers/clk/hisilicon/clkdivider-hi6220.c +2
-0+ +#define to_hi6220_clk_divider (_hw) \[..]
drivers/clk/hisilicon/clkdivider-hi6220.c line 209
Quoted 2 lines
drivers/clk/hisilicon/clkdivider-hi6220.c +2
-0+ +static struct clk_ops hi6220_clkdiv_ops = {const?
Add in next version.
Quoted 17 lines
Quoted 17 lines
drivers/clk/hisilicon/clkdivider-hi6220.c +16
-0+ .recalc_rate = hi6220_clkdiv_recalc_rate, + .round_rate = hi6220_clkdiv_round_rate, + .set_rate = hi6220_clkdiv_set_rate, +}; + +struct clk *hi6220_register_clkdiv (struct device *dev,const char *name, +const char *parent_name,unsigned long flags,void __iomem *reg, +u8 shift,u8 width,u32 mask_bit,spinlock_t *lock) +{ +struct hi6220_clk_divider *div; +struct clk *clk; +struct clk_init_data init; +struct clk_div_table *table; +u32 max_div, min_div; +int i; +
Quoted 8 lines
drivers/clk/hisilicon/clkdivider-hi6220.c line 229
Quoted 4 lines
drivers/clk/hisilicon/clkdivider-hi6220.c +4
-0+/* allocate the divider */ + div =kzalloc (sizeof (struct hi6220_clk_divider ),GFP_KERNEL ); +if (!div) { +pr_err ("%s: could not allocate divider clk\n" , __func__);Useless error message on allocation failure. Please run checkpatch. I've sent a patch to remove these from basic clock types.
Remove in next version.
Quoted 14 lines
drivers/clk/hisilicon/clkdivider-hi6220.c line 240
Quoted 12 lines
drivers/clk/hisilicon/clkdivider-hi6220.c +11
-0+return ERR_PTR (-ENOMEM ); + } + +/* Init the divider table */ + max_div =div_mask (width) +1 ; + min_div =1 ; + + table =kzalloc (sizeof (struct clk_div_table ) * (max_div +1 ),GFP_KERNEL ); +if (!table) { +kfree (div); +pr_err ("%s: failed to alloc divider table!\n" , __func__);ditto.
Will remove in next version.
Quoted 14 lines
drivers/clk/hisilicon/clkdivider-hi6220.c line 251
Quoted 12 lines
drivers/clk/hisilicon/clkdivider-hi6220.c +11
-0+return ERR_PTR (-ENOMEM ); + } + +for (i =0 ; i < max_div; i++) { + table[i].div = min_div + i; + table[i].val = table[i].div -1 ; + } + + init.name = name; + init.ops = &hi6220_clkdiv_ops; + init.flags = flags |CLK_IS_BASIC ;It's basic?
I rechecked this flag, it's really useless to us, so I can remove it. But can you tell me which case I should use it?
How about just send this patch for review not the whole patch set in next version?
Thanks,
Bintian
Quoted 4 lines
Quoted 3 lines
drivers/clk/hisilicon/clkdivider-hi6220.c +2
-0+ init.parent_names = parent_name ? &parent_name :NULL ; + init.num_parents = parent_name ?1 :0 ;
Re: [PATCH v4 4/5] clk: hi6220: Clock driver support for Hisilicon hi6220 SoC
Quoted 38 lines · Bintian
Quoted 20 lines · Stephen Boyd
Quoted 19 lines · Bintian Wang
drivers/clk/hisilicon/clkdivider-hi6220.c +18
-0+ +/** +* struct hi6220_clk_divider - divider clock for hi6220 +* +* @hw: handle between common and hardware-specific interfaces +* @reg: register containing divider +* @shift: shift to the divider bit field +* @width: width of the divider bit field +* @mask: mask for setting divider rate +* @table: the div table that the divider supports +* @lock: register lock +*/ +struct hi6220_clk_divider { +struct clk_hw hw; +void __iomem *reg; +u8 shift; +u8 width; +u32 mask;Quoted 8 lines
drivers/clk/hisilicon/clkdivider-hi6220.c line 47
Quoted 3 lines
drivers/clk/hisilicon/clkdivider-hi6220.c +3
-0+const struct clk_div_table *table; +spinlock_t *lock; +};The
clk-divider.ccode has been made "reusable". Can you please try to use the functions that it now exposes instead of copy/pasting it and modifying it to suit your needs? A lot of this code looks the same.In fact, I discussed this problem with Rob Herring and Mike Turquette in the 96boards internal mail list before.
The divider in hi6220 has a mask bit to guarantee writing the correct bits in register when setting rate, but the index of this mask bit has no rules to get (e.g. by left shift some fixed bits), so I add this divider clock to handle it, we can regard
hi6220_clk_divideras a special case of generic divider clock.
Quoted 4 lines
If I don't add this divider clock for hi6220 chip, then I should change the core APIs "
clk_register_divider" and "clk_register_divider_table", and then many other drivers will be updated.
So I think just add this divider clock is a good solution now.
I think you missed my point. I didn't suggest using clk_register_divider or clk_register_divider_table(). I'm suggesting to use
unsigned long divider_recalc_rate(struct clk_hw *hw, unsigned long parent_rate,
unsigned int val, const struct clk_div_table *table, unsigned long flags);
long divider_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *prate, const struct clk_div_table *table, u8 width, unsigned long flags);
int divider_get_val(unsigned long rate, unsigned long parent_rate,
const struct clk_div_table *table, u8 width, unsigned long flags);
Quoted 13 lines
Quoted 5 lines
Quoted 5 lines
drivers/clk/hisilicon/clkdivider-hi6220.c +5
-0+return ERR_PTR (-ENOMEM ); + } + +for (i =0 ; i < max_div; i++) { + table[i].div = min_div + i;Quoted 8 lines
drivers/clk/hisilicon/clkdivider-hi6220.c line 251
Quoted 6 lines
drivers/clk/hisilicon/clkdivider-hi6220.c +6
-0+ table[i].val = table[i].div -1 ; + } + + init.name = name; + init.ops = &hi6220_clkdiv_ops; + init.flags = flags |CLK_IS_BASIC ;It's basic?
Quoted 2 lines
I rechecked this flag, it's really useless to us, so I can remove it. But can you tell me which case I should use it?
I think the basic flag is there for drivers that want to know what type of clock they're dealing with when all they have is the struct clk_hw pointer. I like to discourage use of this flag in hopes of deleting it someday.
Quoted 4 lines
How about just send this patch for review not the whole patch set in next version?
Yes a single patch is fine. I take it you want the patch to go through arm-soc with some Ack from us?
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v4 4/5] clk: hi6220: Clock driver support for Hisilicon hi6220 SoC
Hello Stephen,
2015-05-16 3:30 GMT+08:00 Stephen Boyd <[email protected]>:
Quoted 48 lines · Bintian
Quoted 38 lines · Stephen Boyd
Quoted 20 lines · Bintian Wang
Quoted 19 lines
drivers/clk/hisilicon/clkdivider-hi6220.c +18
-0+ +/** +* struct hi6220_clk_divider - divider clock for hi6220 +* +* @hw: handle between common and hardware-specific interfaces +* @reg: register containing divider +* @shift: shift to the divider bit field +* @width: width of the divider bit field +* @mask: mask for setting divider rate +* @table: the div table that the divider supports +* @lock: register lock +*/ +struct hi6220_clk_divider { +struct clk_hw hw; +void __iomem *reg; +u8 shift; +u8 width; +u32 mask;Quoted 8 lines
drivers/clk/hisilicon/clkdivider-hi6220.c line 47
Quoted 3 lines
drivers/clk/hisilicon/clkdivider-hi6220.c +3
-0+const struct clk_div_table *table; +spinlock_t *lock; +};The
clk-divider.ccode has been made "reusable". Can you please try to use the functions that it now exposes instead of copy/pasting it and modifying it to suit your needs? A lot of this code looks the same.In fact, I discussed this problem with Rob Herring and Mike Turquette in the 96boards internal mail list before.
The divider in hi6220 has a mask bit to guarantee writing the correct bits in register when setting rate, but the index of this mask bit has no rules to get (e.g. by left shift some fixed bits), so I add this divider clock to handle it, we can regard
hi6220_clk_divideras a special case of generic divider clock.Quoted 4 lines
If I don't add this divider clock for hi6220 chip, then I should change the core APIs "
clk_register_divider" and "clk_register_divider_table", and then many other drivers will be updated.
So I think just add this divider clock is a good solution now.I think you missed my point. I didn't suggest using
clk_register_dividerorclk_register_divider_table(). I'm suggesting to use
Quoted 9 lines
unsigned long divider_recalc_rate(struct
clk_hw*hw, unsigned longparent_rate,
unsigned int val, const structclk_div_table*table, unsigned long flags);
long divider_round_rate(structclk_hw*hw, unsigned long rate,
unsigned long *prate, const structclk_div_table*table, u8 width, unsigned long flags);
int divider_get_val(unsigned long rate, unsigned longparent_rate,
const structclk_div_table*table, u8 width, unsigned long flags);
Got it and I will prepare next version soon.
Quoted 23 lines
Quoted 14 lines
Quoted 14 lines
drivers/clk/hisilicon/clkdivider-hi6220.c line 251
Quoted 12 lines
drivers/clk/hisilicon/clkdivider-hi6220.c +11
-0+return ERR_PTR (-ENOMEM ); + } + +for (i =0 ; i < max_div; i++) { + table[i].div = min_div + i; + table[i].val = table[i].div -1 ; + } + + init.name = name; + init.ops = &hi6220_clkdiv_ops; + init.flags = flags |CLK_IS_BASIC ;It's basic?
Quoted 2 lines
I rechecked this flag, it's really useless to us, so I can remove it. But can you tell me which case I should use it?
I think the basic flag is there for drivers that want to know what type of clock they're dealing with when all they have is the struct
clk_hwpointer. I like to discourage use of this flag in hopes of deleting it someday.Quoted 1 line
Quoted 6 lines
Quoted 3 lines
How about just send this patch for review not the whole patch set in next version?
Yes a single patch is fine. I take it you want the patch to go through arm-soc with some Ack from us?
Yes, exactly.
The dts file includes the clock head file, this patch goes through arm-soc is a good choice.
Thanks,
Bintian
Quoted 9 lines
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v4 4/5] clk: hi6220: Clock driver support for Hisilicon hi6220 SoC
Quoted 9 lines · Brent Wang
Quoted 6 lines
Quoted 4 lines
How about just send this patch for review not the whole patch set in next version?
Yes a single patch is fine. I take it you want the patch to go through arm-soc with some Ack from us?
Yes, exactly.
The dts file includes the clock head file, this patch goes through arm-soc is a good choice.
One way to avoid that problem is to split the clock header file into its own patch and then duplicate that patch in two trees, one that goes through arm-soc and one that goes through clk.
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v4 4/5] clk: hi6220: Clock driver support for Hisilicon hi6220 SoC
Hello Stephen,
Quoted 7 lines · Stephen Boyd
Quoted 6 lines · Brent Wang
Quoted 6 lines
Quoted 4 lines
How about just send this patch for review not the whole patch set in next version?
Yes a single patch is fine. I take it you want the patch to go through arm-soc with some Ack from us?
Quoted 8 lines
Quoted 3 lines
Yes, exactly.
The dts file includes the clock head file, this patch goes through arm-soc is a good choice.One way to avoid that problem is to split the clock header file into its own patch and then duplicate that patch in two trees, one that goes through arm-soc and one that goes through clk.
Thanks for your suggestion, I will talk about this with Hisilicon SoC maintainer XuWei.
I have updated this patch based on your suggestion, could you help review patch "[PATCH v6 5/6] clk: hi6220: Clock driver support for Hisilicon hi6220 SoC"?
Thanks,
Bintian
PATCH v4 5/5 arm64: dts: Add dts files for Hisilicon Hi6220 SoC
In reply to Bintian WangAdd initial dtsi file to support Hisilicon Hi6220 SoC with support of Octal core CPUs in two clusters and each cluster has quard Cortex-A53.
Also add dts file to support HiKey development board which based on Hi6220 SoC.
--- arch/arm64/boot/dts/Makefile | 1 + arch/arm64/boot/dts/hisilicon/Makefile | 5 + arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts | 31 +++++ arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 172 +++++++++++++++++++++++++ 4 files changed, 209 insertions(+) create mode 100644 arch/arm64/boot/dts/hisilicon/Makefile create mode 100644 arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts create mode 100644 arch/arm64/boot/dts/hisilicon/hi6220.dtsi
arch/arm64/boot/dts/Makefile +1 -0
@@ -4,6 +4,7 @@ dts-dirs += arm dts-dirs += cavium dts-dirs += exynos dts-dirs += freescale +dts-dirs += hisilicon dts-dirs += mediatek dts-dirs += qcom dts-dirs += sprd
arch/arm64/boot/dts/hisilicon/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +dtb-$(CONFIG_ARCH_HISI) += hi6220-hikey.dtb + +always := $(dtb-y) +subdir-y := $(dts-dirs) +clean-files := *.dtb
arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts new file +31 -0
@@ -0,0 +1,31 @@ +/* + * dts file for Hisilicon HiKey Development Board + * + * Copyright (C) 2015, Hisilicon Ltd. + * + */ + +/dts-v1/; + +/*Reserved 1MB memory for MCU*/ +/memreserve/ 0x05e00000 0x00100000; + +#include "hi6220.dtsi" + +/ { + model = "HiKey Development Board"; + compatible = "hisilicon,hi6220-hikey", "hisilicon,hi6220"; + + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x0 0x0 0x40000000>; + }; +};
arch/arm64/boot/dts/hisilicon/hi6220.dtsi new file +172 -0
172 lines not on this page · raw message
Signature · 1 line
1.9.1
Mark Rutland
reviewerPATCH v4 5/5 arm64: dts: Add dts files for Hisilicon Hi6220 SoC
Hi,
arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts line 11
Quoted 2 lines
arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts new file +2
-0+/*Reserved 1MB memory for MCU*/ +/memreserve/ 0x05e00000 0x00100000;
What exactly is the MCU used for, and what does it use this memory for?
Can this be carved out from the memory node instead? If the OS doesn't need to access this memory to communicate with the MCU, preventing the OS from mapping the memory avoids a number of potential issues.
I take it that with UEFI this region is not described to the OS?
[...]
arch/arm64/boot/dts/hisilicon/hi6220.dtsi line 19
Quoted 4 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi new file +4
-0+ psci { + compatible = "arm,psci-0.2"; + method = "smc"; + };
Are all the PSCI 0.2 mandatory features implemented?
Can CPU0 be hot unplugged?
[...]
arch/arm64/boot/dts/hisilicon/hi6220.dtsi line 170
Quoted 7 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi new file +7
-0+ uart0: uart at f8015000 { /* console */ + compatible = "arm,pl011", "arm,primecell"; + reg = <0x0 0xf8015000 0x0 0x1000>; + interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ao_ctrl HI6220_UART0_PCLK>, <&ao_ctrl HI6220_UART0_PCLK>; + clock-names = "uartclk", "apb_pclk"; + };
In a previous discussion [1] the UART on HI6220 was described as not fully PL011 compliant, with a number of differences (e.g. the FIFO length).
Given that, I feel somewhat uncomfortable with the current compatible string list. What exactly are those differences? We may need a more specific compatible string (even if in addition to those existing ones), or perhaps other properties.
Thanks,
Mark.
[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2015-March/328978.html
PATCH v4 5/5 arm64: dts: Add dts files for Hisilicon Hi6220 SoC
Hello Mark,
Quoted 7 lines · Mark Rutland
Hi,
arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts line 11
Quoted 2 lines
arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts new file +2
-0+/*Reserved 1MB memory for MCU*/ +/memreserve/ 0x05e00000 0x00100000;What exactly is the MCU used for, and what does it use this memory for?
Quoted 5 lines
Can this be carved out from the memory node instead? If the OS doesn't need to access this memory to communicate with the MCU, preventing the OS from mapping the memory avoids a number of potential issues.
I take it that with UEFI this region is not described to the OS?
MCU is used for system low power control, the reserved memory is hard coded by hardware and used by MCU, OS will access this memory to communicate with the MCU to change the CPU frequency.
Quoted 9 lines
[...]
arch/arm64/boot/dts/hisilicon/hi6220.dtsi line 19
Quoted 4 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi new file +4
-0+ psci { + compatible = "arm,psci-0.2"; + method = "smc"; + };Are all the PSCI 0.2 mandatory features implemented?
The system off/suspend is under development, and system off will be released in next months, and system suspend may be released in the following two months.
Leo does the development of PSCI, and he can give more detailed plan.
So can I keep "arm,psci-0.2" here?
Quoted 1 line
Can CPU0 be hot unplugged?
Yes, CPU0~CPU7 all can be hot unplugged.
Quoted 14 lines
[...]
arch/arm64/boot/dts/hisilicon/hi6220.dtsi line 170
Quoted 7 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi new file +7
-0+ uart0: uart at f8015000 { /* console */ + compatible = "arm,pl011", "arm,primecell"; + reg = <0x0 0xf8015000 0x0 0x1000>; + interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ao_ctrl HI6220_UART0_PCLK>, <&ao_ctrl HI6220_UART0_PCLK>; + clock-names = "uartclk", "apb_pclk"; + };In a previous discussion [1] the UART on HI6220 was described as not fully PL011 compliant, with a number of differences (e.g. the FIFO length).
Quoted 4 lines
Given that, I feel somewhat uncomfortable with the current compatible string list. What exactly are those differences? We may need a more specific compatible string (even if in addition to those existing ones), or perhaps other properties.
The small system can be booted and the console also works well without changing any code of driver amba-pl011.c, so I think the compatible string is OK for this patch set.
Hisilicon do some performance enhancements based on PL011, but the current driver "amba-pl011.c" also works on hi6220 without those enhancements driver code.
Thanks,
Bintian
Quoted 8 lines
Thanks,
Mark.[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2015-March/328978.html
.
PATCH v4 5/5 arm64: dts: Add dts files for Hisilicon Hi6220 SoC
Quoted 10 lines · Bintian Wang
Quoted 8 lines · Mark Rutland
[...]
arch/arm64/boot/dts/hisilicon/hi6220.dtsi line 19
Quoted 4 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi new file +4
-0+ psci { + compatible = "arm,psci-0.2"; + method = "smc"; + };Are all the PSCI 0.2 mandatory features implemented?
Quoted 3 lines
The system off/suspend is under development, and system off will be released in next months, and system suspend may be released in the following two months.
Yes; now for mandatory features, except SYSTEM_OFF others have supported. for PSCI 0.2, SYSTEM_SUSPEND even is not supported, right?
Quoted 4 lines
So can I keep "arm,psci-0.2" here?
Quoted 1 line
Can CPU0 be hot unplugged?
Yes, CPU0~CPU7 all can be hot unplugged.
Just clarify: now use s/w method to emulate CPU and cluster's low power state; all cores can be hotplugged [1].
[1] https://github.com/96boards/arm-trusted-firmware;
Thanks,
Leo Yan
Mark Rutland
reviewerPATCH v4 5/5 arm64: dts: Add dts files for Hisilicon Hi6220 SoC
Quoted 11 lines · Leo Yan
Quoted 10 lines · Bintian Wang
Quoted 8 lines · Mark Rutland
[...]
arch/arm64/boot/dts/hisilicon/hi6220.dtsi line 19
Quoted 4 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi new file +4
-0+ psci { + compatible = "arm,psci-0.2"; + method = "smc"; + };Are all the PSCI 0.2 mandatory features implemented?
Quoted 5 lines
Quoted 3 lines
The system off/suspend is under development, and system off will be released in next months, and system suspend may be released in the following two months.
Yes; now for mandatory features, except
SYSTEM_OFFothers have supported.
Ok. Do you mean in the next month, or in a number of months?
Quoted 1 line
for PSCI 0.2,
SYSTEM_SUSPENDeven is not supported, right?
SYSTEM_SUSPEND was introduced in PSCI 1.0, and is optional.
So long as PSCI_VERSION reports 0.2 or PSCI_FEATURES reports NOT_SUPPORTED for SYSTEM_SUSPEND, it's ok to not implement.
I guess PSCI_VERSION reports PSCI 0.2?
Quoted 7 lines
Quoted 4 lines
So can I keep "arm,psci-0.2" here?
Quoted 1 line
Can CPU0 be hot unplugged?
Yes, CPU0~CPU7 all can be hot unplugged.
Just clarify: now use s/w method to emulate CPU and cluster's low power state; all cores can be hotplugged [1].
So long as CPUs brought online are reset appropriately, and "offline" CPUs can't bring down the system somehow, that should be fine. For now the important part is the interface.
Thanks,
Mark.
PATCH v4 5/5 arm64: dts: Add dts files for Hisilicon Hi6220 SoC
hi Mark,
Thanks for detailed reviewing, pls see below inline comments.
Quoted 12 lines · Mark Rutland
Quoted 11 lines · Leo Yan
Quoted 10 lines · Bintian Wang
Quoted 8 lines · Mark Rutland
[...]
arch/arm64/boot/dts/hisilicon/hi6220.dtsi line 19
Quoted 4 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi new file +4
-0+ psci { + compatible = "arm,psci-0.2"; + method = "smc"; + };Are all the PSCI 0.2 mandatory features implemented?
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
The system off/suspend is under development, and system off will be released in next months, and system suspend may be released in the following two months.
Yes; now for mandatory features, except
SYSTEM_OFFothers have supported.Ok. Do you mean in the next month, or in a number of months?
We will finish it in May; the mainly work is to hook this API w/t PMIC to power down system.
Quoted 8 lines
Quoted 1 line
for PSCI 0.2,
SYSTEM_SUSPENDeven is not supported, right?
SYSTEM_SUSPENDwas introduced in PSCI 1.0, and is optional.So long as
PSCI_VERSIONreports 0.2 orPSCI_FEATURESreportsNOT_SUPPORTEDforSYSTEM_SUSPEND, it's ok to not implement.I guess
PSCI_VERSIONreports PSCI 0.2?
This is depend on ARM trusted firmware's implementation, now we are using ATFv1.1, so it will declare to support PSCI 1.0; pls see below boot log:
psci: probing for conduit method from DT.
psci: PSCIv1.0 detected in firmware.
psci: Using standard PSCI v0.2 function IDs
Quoted 11 lines
Quoted 7 lines
Quoted 4 lines
So can I keep "arm,psci-0.2" here?
Quoted 1 line
Can CPU0 be hot unplugged?
Yes, CPU0~CPU7 all can be hot unplugged.
Just clarify: now use s/w method to emulate CPU and cluster's low power state; all cores can be hotplugged [1].
So long as CPUs brought online are reset appropriately, and "offline" CPUs can't bring down the system somehow, that should be fine. For now the important part is the interface.
Thanks for confirmation.
Thanks,
Leo Yan
PATCH v4 5/5 arm64: dts: Add dts files for Hisilicon Hi6220 SoC
In reply to BintianHello Mark,
Quoted 3 lines · Bintian
Hello Mark,
On 2015/5/6 1:13, Mark Rutland wrote:
[...]
Quoted 17 lines
Quoted 9 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi line 170
Quoted 8 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi new file +5
-0+ uart0: uart at f8015000 { /* console */ + compatible = "arm,pl011", "arm,primecell"; + reg = <0x0 0xf8015000 0x0 0x1000>; + interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ao_ctrl HI6220_UART0_PCLK>, <&ao_ctrl
HI6220_UART0_PCLK>;arch/arm64/boot/dts/hisilicon/hi6220.dtsi new file +2
-0+ clock-names = "uartclk", "apb_pclk"; + };Quoted 8 lines
In a previous discussion [1] the UART on HI6220 was described as not fully PL011 compliant, with a number of differences (e.g. the FIFO length).
Given that, I feel somewhat uncomfortable with the current compatible string list. What exactly are those differences? We may need a more specific compatible string (even if in addition to those existing ones), or perhaps other properties.
Quoted 7 lines
The small system can be booted and the console also works well without changing any code of driver
amba-pl011.c, so I think the compatible string is OK for this patch set.Hisilicon do some performance enhancements based on PL011, but the current driver "
amba-pl011.c" also works on hi6220 without those enhancements driver code.
Checked with Hisilicon chip designer, the UART0 is used for DEBUG console and compliant with PL011 fully.
Thanks,
Bintian
Quoted 20 lines
Quoted 11 lines
Thanks,
Mark.[1]
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-March/328978.html.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel.
Mark Rutland
reviewerPATCH v4 5/5 arm64: dts: Add dts files for Hisilicon Hi6220 SoC
Quoted 28 lines · Bintian
Hello Mark,
Quoted 3 lines · Bintian
Hello Mark,
On 2015/5/6 1:13, Mark Rutland wrote:
[...]
Quoted 21 lines
Quoted 9 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi line 170
Quoted 8 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi new file +5
-0+ uart0: uart at f8015000 { /* console */ + compatible = "arm,pl011", "arm,primecell"; + reg = <0x0 0xf8015000 0x0 0x1000>; + interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ao_ctrl HI6220_UART0_PCLK>, <&ao_ctrl
HI6220_UART0_PCLK>;arch/arm64/boot/dts/hisilicon/hi6220.dtsi new file +2
-0+ clock-names = "uartclk", "apb_pclk"; + };Quoted 8 lines
In a previous discussion [1] the UART on HI6220 was described as not fully PL011 compliant, with a number of differences (e.g. the FIFO length).
Given that, I feel somewhat uncomfortable with the current compatible string list. What exactly are those differences? We may need a more specific compatible string (even if in addition to those existing ones), or perhaps other properties.
The small system can be booted and the console also works well without changing any code of driver
amba-pl011.c, so I think the compatible string is OK for this patch set.
Quoted 5 lines
Quoted 3 lines
Hisilicon do some performance enhancements based on PL011, but the current driver "
amba-pl011.c" also works on hi6220 without those enhancements driver code.Checked with Hisilicon chip designer, the UART0 is used for DEBUG console and compliant with PL011 fully.
I think that given that we know the UART is not quite a PL011 we should add an additional compatible string just in case some difference crops up later that is problematic.
So we'd have something like:
compatible = "hisilicon,hi6220-uart", "arm,pl011", "arm,primecell";
That way we can add any optimisations or workarounds later as required.
Thanks,
Mark.
PATCH v4 5/5 arm64: dts: Add dts files for Hisilicon Hi6220 SoC
Hello Mark,
Quoted 39 lines · Mark Rutland
Quoted 28 lines · Bintian
Hello Mark,
Quoted 3 lines · Bintian
Hello Mark,
On 2015/5/6 1:13, Mark Rutland wrote:
[...]
Quoted 21 lines
Quoted 9 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi line 170
Quoted 8 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi new file +5
-0+ uart0: uart at f8015000 { /* console */ + compatible = "arm,pl011", "arm,primecell"; + reg = <0x0 0xf8015000 0x0 0x1000>; + interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ao_ctrl HI6220_UART0_PCLK>, <&ao_ctrl
HI6220_UART0_PCLK>;arch/arm64/boot/dts/hisilicon/hi6220.dtsi new file +2
-0+ clock-names = "uartclk", "apb_pclk"; + };Quoted 8 lines
In a previous discussion [1] the UART on HI6220 was described as not fully PL011 compliant, with a number of differences (e.g. the FIFO length).
Given that, I feel somewhat uncomfortable with the current compatible string list. What exactly are those differences? We may need a more specific compatible string (even if in addition to those existing ones), or perhaps other properties.
The small system can be booted and the console also works well without changing any code of driver
amba-pl011.c, so I think the compatible string is OK for this patch set.Quoted 5 lines
Quoted 3 lines
Hisilicon do some performance enhancements based on PL011, but the current driver "
amba-pl011.c" also works on hi6220 without those enhancements driver code.Checked with Hisilicon chip designer, the UART0 is used for DEBUG console and compliant with PL011 fully.
I think that given that we know the UART is not quite a PL011 we should add an additional compatible string just in case some difference crops up later that is problematic.
Quoted 5 lines
So we'd have something like:
compatible = "hisilicon,hi6220-uart", "arm,pl011", "arm,primecell";That way we can add any optimisations or workarounds later as required.
I understand and thanks for your suggestion.
Can I do not do this work in this patch set? Because I got the information UART0 is PL011 compatible. Hisilicon uart engineer can do this work in the future, maybe for UART1/UART2.
Thank you Mark,
BR,
Bintian
Quoted 6 lines
Thanks,
Mark..
Mark Rutland
reviewerPATCH v4 5/5 arm64: dts: Add dts files for Hisilicon Hi6220 SoC
Hi,
Quoted 6 lines
Quoted 6 lines
I think that given that we know the UART is not quite a PL011 we should add an additional compatible string just in case some difference crops up later that is problematic.
So we'd have something like:
Quoted 8 lines
Quoted 3 lines
compatible = "hisilicon,hi6220-uart", "arm,pl011", "arm,primecell";That way we can add any optimisations or workarounds later as required.
I understand and thanks for your suggestion.
Can I do not do this work in this patch set? Because I got the information UART0 is PL011 compatible. Hisilicon uart engineer can do this work in the future, maybe for UART1/UART2.
I am not asking you to do any driver work for this -- the current driver should ignore the "hisilicon,hi6220-uart" string and recognise "arm,pl011".
I am only asking you to add the additional string to the DTS, and to update the binding document to list the new string. That way if and when we need the kernel to distinguish between a regular PL011 and the hi6220-specific variant, the DTB does not need to be updated in order to do so.
Is UART 0 different from UART1 and UART2?
Thanks,
Mark.
PATCH v4 5/5 arm64: dts: Add dts files for Hisilicon Hi6220 SoC
Hi Mark,
2015-05-06 18:55 GMT+08:00, Mark Rutland <[email protected]>:
Quoted 21 lines
Hi,
Quoted 6 lines
Quoted 6 lines
I think that given that we know the UART is not quite a PL011 we should add an additional compatible string just in case some difference crops up later that is problematic.
So we'd have something like:
Quoted 8 lines
Quoted 3 lines
compatible = "hisilicon,hi6220-uart", "arm,pl011", "arm,primecell";That way we can add any optimisations or workarounds later as required.
I understand and thanks for your suggestion.
Can I do not do this work in this patch set? Because I got the information UART0 is PL011 compatible. Hisilicon uart engineer can do this work in the future, maybe for UART1/UART2.
I am not asking you to do any driver work for this -- the current driver should ignore the "hisilicon,hi6220-uart" string and recognise "arm,pl011".
Quoted 5 lines
I am only asking you to add the additional string to the DTS, and to update the binding document to list the new string. That way if and when we need the kernel to distinguish between a regular PL011 and the hi6220-specific variant, the DTB does not need to be updated in order to do so.
How about add the following binding rule to my 2/5 patch:
---------------------------
*Hisilicon Enhanced ARM AMBA Primecell PL011 serial UART
Required properties:
- compatible: must be "hisilicon,hi6220-uart", "arm,primecell", "arm,pl011"
- reg: exactly one register range with length 0x1000
- interrupts: exactly one interrupt specifier
See also bindings/serial/pl011.txt
Example:
uart0: uart at f8015000 {
compatible = "hisilicon,hi6220-uart", "arm,pl011", "arm,primecell";
reg = <0x0 0xf8015000 0x0 0x1000>;
interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ao_ctrl HI6220_UART0_PCLK>, <&ao_ctrl HI6220_UART0_PCLK>;
clock-names = "uartclk", "apb_pclk";
};---------------------------
Quoted 1 line
Is UART 0 different from UART1 and UART2?
Yes, but my patch just includes UART0, we do some changements for UART1/2 to improve performance.
Thanks,
Bintian
Quoted 9 lines
Thanks,
Mark._______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
Best Regards, Bintian =========================== Don't be nervous, just be happy!
Mark Rutland
reviewerPATCH v4 5/5 arm64: dts: Add dts files for Hisilicon Hi6220 SoC
Hi,
Quoted 6 lines
How about add the following binding rule to my 2/5 patch:
---------------------------
*Hisilicon Enhanced ARM AMBA Primecell PL011 serial UARTRequired properties:
- compatible: must be "hisilicon,hi6220-uart", "arm,primecell", "arm,pl011"
"arm,primecell" should come last.
Quoted 7 lines
- reg: exactly one register range with length
0x1000
- interrupts: exactly one interrupt specifierSee also
bindings/serial/pl011.txtExample:
Quoted 7 lines
uart0: uart at f8015000 {
compatible = "hisilicon,hi6220-uart", "arm,pl011", "arm,primecell";
reg = <0x0 0xf8015000 0x0 0x1000>;
interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ao_ctrl HI6220_UART0_PCLK>, <&ao_ctrl HI6220_UART0_PCLK>;
clock-names = "uartclk", "apb_pclk";
};How about for the moment we just modify the existing pl011 binding document to allow for the hi6220-specific string in addition to its existing strings? We can always split it out later if the hi6220 UART binding needs to be significantly divergent.
Quoted 3 lines
Quoted 1 line
Is UART 0 different from UART1 and UART2?
Yes, but my patch just includes UART0, we do some changements for UART1/2 to improve performance.
Sure, but we need to make sure we can choose a sane compatible string for them, that won't clash with whatever we choose for UART0.
Are they the same IP as UART0, or fundamentally different?
Are they also PL011 derived?
Thanks,
Mark.
PATCH v4 5/5 arm64: dts: Add dts files for Hisilicon Hi6220 SoC
Hi Mark,
2015-05-06 23:44 GMT+08:00, Mark Rutland <[email protected]>:
Quoted 29 lines
Hi,
Quoted 7 lines
How about add the following binding rule to my 2/5 patch:
---------------------------
*Hisilicon Enhanced ARM AMBA Primecell PL011 serial UARTRequired properties:
- compatible: must be "hisilicon,hi6220-uart", "arm,primecell", "arm,pl011""arm,primecell" should come last.
Quoted 7 lines
- reg: exactly one register range with length
0x1000
- interrupts: exactly one interrupt specifierSee also
bindings/serial/pl011.txtExample:
Quoted 9 lines
uart0: uart at f8015000 { compatible = "hisilicon,hi6220-uart", "arm,pl011", "arm,primecell"; reg = <0x0 0xf8015000 0x0 0x1000>; interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; clocks = <&ao_ctrl HI6220_UART0_PCLK>, <&ao_ctrl HI6220_UART0_PCLK>; clock-names = "uartclk", "apb_pclk"; };
Quoted 4 lines
How about for the moment we just modify the existing pl011 binding document to allow for the hi6220-specific string in addition to its existing strings? We can always split it out later if the hi6220 UART binding needs to be significantly divergent.
How about adding the following rule to pl011.txt?
----------
(quoted diff) +0 -0
b/Documentation/devicetree/bindings/serial/pl011.txt index ba3ecb8..1221ccb 100644
Documentation/devicetree/bindings/serial/pl011.txt +4 -1
@@ -35,6 +35,10 @@ Optional properties: - poll-timeout-ms: Poll timeout when auto-poll is set, default 3000ms. +- compatible: "hisilicon,hi6220-uart": + Hisilicon does some enhancements (e.g. larger FIFO length) + based on PL011, so when using these UART hosts, this compatible + string should be added. See also bindings/arm/primecell.txt ------------
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Is UART 0 different from UART1 and UART2?
Yes, but my patch just includes UART0, we do some changements for UART1/2
to improve performance.Sure, but we need to make sure we can choose a sane compatible string for them, that won't clash with whatever we choose for UART0.
OK, do I also need to add compatible ""hisilicon,hi6220-uart"," to UART0 node?
Quoted 2 lines
Are they the same IP as UART0, or fundamentally different?
The same IP.
Quoted 2 lines
Are they also PL011 derived?
Yes, just do some enhancements to improve performance.
Thanks,
Bintian
Quoted 4 lines
Thanks,
Mark.
Signature · 5 lines
Best Regards, Bintian =========================== Don't be nervous, just be happy!
Mark Rutland
reviewerPATCH v4 5/5 arm64: dts: Add dts files for Hisilicon Hi6220 SoC
Quoted 44 lines · Brent Wang
Hi Mark,
2015-05-06 23:44 GMT+08:00, Mark Rutland <[email protected]>:
Quoted 29 lines
Hi,
Quoted 7 lines
How about add the following binding rule to my 2/5 patch:
---------------------------
*Hisilicon Enhanced ARM AMBA Primecell PL011 serial UARTRequired properties:
- compatible: must be "hisilicon,hi6220-uart", "arm,primecell", "arm,pl011""arm,primecell" should come last.
Quoted 7 lines
- reg: exactly one register range with length
0x1000
- interrupts: exactly one interrupt specifierSee also
bindings/serial/pl011.txtExample:
Quoted 9 lines
uart0: uart at f8015000 { compatible = "hisilicon,hi6220-uart", "arm,pl011", "arm,primecell"; reg = <0x0 0xf8015000 0x0 0x1000>; interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; clocks = <&ao_ctrl HI6220_UART0_PCLK>, <&ao_ctrl HI6220_UART0_PCLK>; clock-names = "uartclk", "apb_pclk"; };Quoted 4 lines
How about for the moment we just modify the existing pl011 binding document to allow for the hi6220-specific string in addition to its existing strings? We can always split it out later if the hi6220 UART binding needs to be significantly divergent.
How about adding the following rule to pl011.txt?
----------Documentation/devicetree/bindings/serial/pl011.txt +0
-0
Documentation/devicetree/bindings/serial/pl011.txt Optional properties: · line 41
Quoted 7 lines
Documentation/devicetree/bindings/serial/pl011.txt +4
-0@@ -35,6 +35,10 @@ Optional properties: - poll-timeout-ms: Poll timeout when auto-poll is set, default 3000ms. +- compatible: "hisilicon,hi6220-uart": + Hisilicon does some enhancements (e.g. larger FIFO length) + based on PL011, so when using these UART hosts, this compatible + string should be added.
Up at the top of the document there's already a description of the compatible property. Just change it into a list something like:
- compatible: should contain one of the following sequences:
* "arm,pl011", "arm,primecell"
* "hisilicon,hi6220-pl011", "arm,pl011", "arm,primecell"
Quoted 11 lines
Documentation/devicetree/bindings/serial/pl011.txt +0
-1See also bindings/arm/primecell.txt ------------Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Is UART 0 different from UART1 and UART2?
Yes, but my patch just includes UART0, we do some changements for UART1/2
to improve performance.Sure, but we need to make sure we can choose a sane compatible string for them, that won't clash with whatever we choose for UART0.
OK, do I also need to add compatible ""hisilicon,hi6220-uart"," to UART0 node?
This depends on a number of factors. Questions below.
Quoted 5 lines
Quoted 1 line
Are they the same IP as UART0, or fundamentally different?
The same IP.
Quoted 2 lines
Are they also PL011 derived?
Yes, just do some enhancements to improve performance.
What exactly is different between UART0 and UART{1,2}, given they are the same IP?
Can UART{1,2} be used as if they are standard PL011 instances?
Is the difference internal, or do they just have different clocks/regulators/etc?
Do they have feature control pins tied off differently?
Are they simply programmed differently at reset by firmware?
Thanks,
Mark.
PATCH v4 5/5 arm64: dts: Add dts files for Hisilicon Hi6220 SoC
Hi Mark,
2015-05-07 0:23 GMT+08:00, Mark Rutland <[email protected]>:
Quoted 57 lines · Brent Wang
Quoted 50 lines
Hi Mark,
2015-05-06 23:44 GMT+08:00, Mark Rutland <[email protected]>:
Quoted 29 lines
Hi,
Quoted 7 lines
How about add the following binding rule to my 2/5 patch:
---------------------------
*Hisilicon Enhanced ARM AMBA Primecell PL011 serial UARTRequired properties:
- compatible: must be "hisilicon,hi6220-uart", "arm,primecell", "arm,pl011""arm,primecell" should come last.
Quoted 7 lines
- reg: exactly one register range with length
0x1000
- interrupts: exactly one interrupt specifierSee also
bindings/serial/pl011.txtExample:
Quoted 9 lines
uart0: uart at f8015000 { compatible = "hisilicon,hi6220-uart", "arm,pl011", "arm,primecell"; reg = <0x0 0xf8015000 0x0 0x1000>; interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; clocks = <&ao_ctrl HI6220_UART0_PCLK>, <&ao_ctrl HI6220_UART0_PCLK>; clock-names = "uartclk", "apb_pclk"; };Quoted 4 lines
How about for the moment we just modify the existing pl011 binding document to allow for the hi6220-specific string in addition to its existing strings? We can always split it out later if the hi6220 UART binding needs to be significantly divergent.
How about adding the following rule to pl011.txt?
----------Documentation/devicetree/bindings/serial/pl011.txt +3
-0@@ -35,6 +35,10 @@ Optional properties: - poll-timeout-ms: Poll timeout when auto-poll is set, default 3000ms. +- compatible: "hisilicon,hi6220-uart": + Hisilicon does some enhancements (e.g. larger FIFO length) + based on PL011, so when using these UART hosts, thisQuoted 2 lines
compatible
+ string should be added.Up at the top of the document there's already a description of the compatible property. Just change it into a list something like:
Quoted 3 lines
- compatible: should contain one of the following sequences:
* "arm,pl011", "arm,primecell"
* "hisilicon,hi6220-pl011", "arm,pl011", "arm,primecell"
OK, I will add in next version.
Quoted 16 lines
Quoted 5 lines
See also
bindings/arm/primecell.txt
------------Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Is UART 0 different from UART1 and UART2?
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Yes, but my patch just includes UART0, we do some changements for UART1/2
to improve performance.Sure, but we need to make sure we can choose a sane compatible string for them, that won't clash with whatever we choose for UART0.
OK, do I also need to add compatible ""hisilicon,hi6220-uart"," to UART0 node?
This depends on a number of factors. Questions below.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Are they the same IP as UART0, or fundamentally different?
The same IP.
Quoted 2 lines
Are they also PL011 derived?
Yes, just do some enhancements to improve performance.
What exactly is different between UART0 and UART{1,2}, given they are the same IP?
I know they are the same IP, but UART{1,2} have larger FIFO length.
Quoted 2 lines
Can UART{1,2} be used as if they are standard PL011 instances?
Yes
Quoted 2 lines
Is the difference internal, or do they just have different clocks/regulators/etc?
The different FIFO length means internal? Sure, they have different clocks/regualtors.
Quoted 2 lines
Do they have feature control pins tied off differently?
UART{1,2} have reset function, we must disable the reset before using them, is it the feature
control pins you mentioned ?
Quoted 2 lines
Are they simply programmed differently at reset by firmware?
I think so.
For hi6220 uart{1,2} , I think add one "struct vendor_data vendor_hisilicon" to "amba-pl011.c" may be a good solution in the future.
I am not the uart driver developer and the Hisilicon engineer who develop it may have a deep
discussion with you when upstreaming UART{1,2}.
I suggest not add "hisilicon,hi6220-uart" to UART0;
Must go to bed, it's very late here :(
Thanks,
Bintian
Quoted 4 lines
Thanks,
Mark.
Signature · 5 lines
Best Regards, Bintian =========================== Don't be nervous, just be happy!
PATCH v4 5/5 arm64: dts: Add dts files for Hisilicon Hi6220 SoC
Hi Mark,
Quoted 112 lines · Brent Wang
Hi Mark,
2015-05-07 0:23 GMT+08:00, Mark Rutland <[email protected]>:
Quoted 57 lines · Brent Wang
Quoted 50 lines
Hi Mark,
2015-05-06 23:44 GMT+08:00, Mark Rutland <[email protected]>:
Quoted 29 lines
Hi,
Quoted 7 lines
How about add the following binding rule to my 2/5 patch:
---------------------------
*Hisilicon Enhanced ARM AMBA Primecell PL011 serial UARTRequired properties:
- compatible: must be "hisilicon,hi6220-uart", "arm,primecell", "arm,pl011""arm,primecell" should come last.
Quoted 7 lines
- reg: exactly one register range with length
0x1000
- interrupts: exactly one interrupt specifierSee also
bindings/serial/pl011.txtExample:
Quoted 9 lines
uart0: uart at f8015000 { compatible = "hisilicon,hi6220-uart", "arm,pl011", "arm,primecell"; reg = <0x0 0xf8015000 0x0 0x1000>; interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; clocks = <&ao_ctrl HI6220_UART0_PCLK>, <&ao_ctrl HI6220_UART0_PCLK>; clock-names = "uartclk", "apb_pclk"; };Quoted 4 lines
How about for the moment we just modify the existing pl011 binding document to allow for the hi6220-specific string in addition to its existing strings? We can always split it out later if the hi6220 UART binding needs to be significantly divergent.
How about adding the following rule to pl011.txt?
----------Documentation/devicetree/bindings/serial/pl011.txt +3
-0@@ -35,6 +35,10 @@ Optional properties: - poll-timeout-ms: Poll timeout when auto-poll is set, default 3000ms. +- compatible: "hisilicon,hi6220-uart": + Hisilicon does some enhancements (e.g. larger FIFO length) + based on PL011, so when using these UART hosts, thisQuoted 2 lines
compatible
+ string should be added.Up at the top of the document there's already a description of the compatible property. Just change it into a list something like:
Quoted 3 lines
- compatible: should contain one of the following sequences:
* "arm,pl011", "arm,primecell"
* "hisilicon,hi6220-pl011", "arm,pl011", "arm,primecell"OK, I will add in next version.
Quoted 16 lines
Quoted 5 lines
See also
bindings/arm/primecell.txt
------------Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Is UART 0 different from UART1 and UART2?
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Yes, but my patch just includes UART0, we do some changements for UART1/2
to improve performance.Sure, but we need to make sure we can choose a sane compatible string for them, that won't clash with whatever we choose for UART0.
OK, do I also need to add compatible ""hisilicon,hi6220-uart"," to UART0 node?
This depends on a number of factors. Questions below.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Are they the same IP as UART0, or fundamentally different?
The same IP.
Quoted 2 lines
Are they also PL011 derived?
Yes, just do some enhancements to improve performance.
What exactly is different between UART0 and UART{1,2}, given they are the same IP?
I know they are the same IP, but UART{1,2} have larger FIFO length.
Quoted 2 lines
Can UART{1,2} be used as if they are standard PL011 instances?
Yes
Quoted 2 lines
Is the difference internal, or do they just have different clocks/regulators/etc?
The different FIFO length means internal? Sure, they have different clocks/regualtors.
Quoted 2 lines
Do they have feature control pins tied off differently?
UART{1,2} have reset function, we must disable the reset before using them, is it the feature
control pins you mentioned ?Quoted 2 lines
Are they simply programmed differently at reset by firmware?
I think so.
For hi6220 uart{1,2} , I think add one "struct
vendor_datavendor_hisilicon" to "amba-pl011.c" may be a good solution in the future.
Quoted 5 lines
I am not the uart driver developer and the Hisilicon engineer who develop it may have a deep
discussion with you when upstreaming UART{1,2}.I suggest not add "hisilicon,hi6220-uart" to UART0;
How about not adding "hisilicon,hi6220-uart" to UART0, and just add this compatible string for future use? you know, the UART0 is PL011 compatible and I checked this with chip designer.
If there is no problem, I will send another version of this patch set and add this compatible string to pl011.txt as you suggested.
Thanks,
Bintian
Quoted 12 lines
Must go to bed, it's very late here :(
Thanks,
Bintian
Quoted 4 lines
Thanks,
Mark.
PATCH v4 5/5 arm64: dts: Add dts files for Hisilicon Hi6220 SoC
In reply to Mark RutlandHi Mark,
Quoted 21 lines
Hi,
Quoted 6 lines
Quoted 6 lines
I think that given that we know the UART is not quite a PL011 we should add an additional compatible string just in case some difference crops up later that is problematic.
So we'd have something like:
Quoted 8 lines
Quoted 3 lines
compatible = "hisilicon,hi6220-uart", "arm,pl011", "arm,primecell";That way we can add any optimisations or workarounds later as required.
I understand and thanks for your suggestion.
Can I do not do this work in this patch set? Because I got the information UART0 is PL011 compatible. Hisilicon uart engineer can do this work in the future, maybe for UART1/UART2.
I am not asking you to do any driver work for this -- the current driver should ignore the "hisilicon,hi6220-uart" string and recognise "arm,pl011".
Quoted 5 lines
I am only asking you to add the additional string to the DTS, and to update the binding document to list the new string. That way if and when we need the kernel to distinguish between a regular PL011 and the hi6220-specific variant, the DTB does not need to be updated in order to do so.
How about add the following binding rule to the 2/5 patch:
---------------------------
*Hisilicon Enhanced ARM AMBA Primecell PL011 serial UART
Required properties:
- compatible: must be "hisilicon,hi6220-uart", "arm,primecell", "arm,pl011"
- reg: exactly one register range with length 0x1000
- interrupts: exactly one interrupt specifier
See also bindings/serial/pl011.txt
Example:
uart0: uart at f8015000 {
compatible = "hisilicon,hi6220-uart", "arm,pl011", "arm,primecell";
reg = <0x0 0xf8015000 0x0 0x1000>;
interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ao_ctrl HI6220_UART0_PCLK>, <&ao_ctrl HI6220_UART0_PCLK>;
clock-names = "uartclk", "apb_pclk";
};---------------------------
Quoted 1 line
Is UART 0 different from UART1 and UART2?
Yes, but my patch just includes UART0, we do some changements for UART1/2 to improve performance.
Thanks,
Bintian
Quoted 8 lines
Thanks,
Mark._______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 5/5 arm64: dts: Add dts files for Hisilicon Hi6220 SoC
Please ignore this email.
Quoted 73 lines · Bintian Wang
Hi Mark,
Quoted 21 lines
Hi,
Quoted 6 lines
Quoted 6 lines
I think that given that we know the UART is not quite a PL011 we should add an additional compatible string just in case some difference crops up later that is problematic.
So we'd have something like:
Quoted 8 lines
Quoted 3 lines
compatible = "hisilicon,hi6220-uart", "arm,pl011", "arm,primecell";That way we can add any optimisations or workarounds later as required.
I understand and thanks for your suggestion.
Can I do not do this work in this patch set? Because I got the information UART0 is PL011 compatible. Hisilicon uart engineer can do this work in the future, maybe for UART1/UART2.
I am not asking you to do any driver work for this -- the current driver should ignore the "hisilicon,hi6220-uart" string and recognise "arm,pl011".
Quoted 5 lines
I am only asking you to add the additional string to the DTS, and to update the binding document to list the new string. That way if and when we need the kernel to distinguish between a regular PL011 and the hi6220-specific variant, the DTB does not need to be updated in order to do so.
How about add the following binding rule to the 2/5 patch:
---------------------------
*Hisilicon Enhanced ARM AMBA Primecell PL011 serial UARTRequired properties:
- compatible: must be "hisilicon,hi6220-uart", "arm,primecell", "arm,pl011"
- reg: exactly one register range with length0x1000
- interrupts: exactly one interrupt specifierSee also
bindings/serial/pl011.txtExample:
uart0: uart at f8015000 { compatible = "hisilicon,hi6220-uart", "arm,pl011", "arm,primecell"; reg = <0x0 0xf8015000 0x0 0x1000>; interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; clocks = <&ao_ctrl HI6220_UART0_PCLK>, <&ao_ctrl HI6220_UART0_PCLK>; clock-names = "uartclk", "apb_pclk"; };---------------------------
Quoted 1 line
Is UART 0 different from UART1 and UART2?
Yes, but my patch just includes UART0, we do some changements for UART1/2 to improve performance.
Thanks,
Bintian
Quoted 8 lines
Thanks,
Mark._______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel.
PATCH v4 5/5 arm64: dts: Add dts files for Hisilicon Hi6220 SoC
In reply to Mark RutlandQuoted 39 lines · Mark Rutland
Quoted 28 lines · Bintian
Hello Mark,
Quoted 3 lines · Bintian
Hello Mark,
On 2015/5/6 1:13, Mark Rutland wrote:
[...]
Quoted 21 lines
Quoted 9 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi line 170
Quoted 8 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi new file +5
-0+ uart0: uart at f8015000 { /* console */ + compatible = "arm,pl011", "arm,primecell"; + reg = <0x0 0xf8015000 0x0 0x1000>; + interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ao_ctrl HI6220_UART0_PCLK>, <&ao_ctrl
HI6220_UART0_PCLK>;arch/arm64/boot/dts/hisilicon/hi6220.dtsi new file +2
-0+ clock-names = "uartclk", "apb_pclk"; + };Quoted 8 lines
In a previous discussion [1] the UART on HI6220 was described as not fully PL011 compliant, with a number of differences (e.g. the FIFO length).
Given that, I feel somewhat uncomfortable with the current compatible string list. What exactly are those differences? We may need a more specific compatible string (even if in addition to those existing ones), or perhaps other properties.
The small system can be booted and the console also works well without changing any code of driver
amba-pl011.c, so I think the compatible string is OK for this patch set.Quoted 5 lines
Quoted 3 lines
Hisilicon do some performance enhancements based on PL011, but the current driver "
amba-pl011.c" also works on hi6220 without those enhancements driver code.Checked with Hisilicon chip designer, the UART0 is used for DEBUG console and compliant with PL011 fully.
I think that given that we know the UART is not quite a PL011 we should add an additional compatible string just in case some difference crops up later that is problematic.
Quoted 6 lines
So we'd have something like:
compatible = "hisilicon,hi6220-uart", "arm,pl011", "arm,primecell";That way we can add any optimisations or workarounds later as required.
There's no code to handle the feature of hi6220 uart in mainline. It's meaningless to append "hisilicon,hi6220-uart" at here. I think it's only required
when those uart code are merged into mainline.
Regards
Haojian
Mark Rutland
reviewerPATCH v4 5/5 arm64: dts: Add dts files for Hisilicon Hi6220 SoC
Quoted 40 lines · Haojian Zhuang
Quoted 39 lines · Mark Rutland
Quoted 28 lines · Bintian
Hello Mark,
Quoted 3 lines · Bintian
Hello Mark,
On 2015/5/6 1:13, Mark Rutland wrote:
[...]
Quoted 21 lines
Quoted 9 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi line 170
Quoted 8 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi new file +5
-0+ uart0: uart at f8015000 { /* console */ + compatible = "arm,pl011", "arm,primecell"; + reg = <0x0 0xf8015000 0x0 0x1000>; + interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ao_ctrl HI6220_UART0_PCLK>, <&ao_ctrl
HI6220_UART0_PCLK>;arch/arm64/boot/dts/hisilicon/hi6220.dtsi new file +2
-0+ clock-names = "uartclk", "apb_pclk"; + };Quoted 8 lines
In a previous discussion [1] the UART on HI6220 was described as not fully PL011 compliant, with a number of differences (e.g. the FIFO length).
Given that, I feel somewhat uncomfortable with the current compatible string list. What exactly are those differences? We may need a more specific compatible string (even if in addition to those existing ones), or perhaps other properties.
The small system can be booted and the console also works well without changing any code of driver
amba-pl011.c, so I think the compatible string is OK for this patch set.Quoted 5 lines
Quoted 3 lines
Hisilicon do some performance enhancements based on PL011, but the current driver "
amba-pl011.c" also works on hi6220 without those enhancements driver code.Checked with Hisilicon chip designer, the UART0 is used for DEBUG console and compliant with PL011 fully.
I think that given that we know the UART is not quite a PL011 we should add an additional compatible string just in case some difference crops up later that is problematic.
Quoted 8 lines
Quoted 6 lines
So we'd have something like:
compatible = "hisilicon,hi6220-uart", "arm,pl011", "arm,primecell";That way we can add any optimisations or workarounds later as required.
There's no code to handle the feature of hi6220 uart in mainline.
Sure, I wasn't suggesting that there was.
Quoted 2 lines
It's meaningless to append "hisilicon,hi6220-uart" at here. I think it's only required when those uart code are merged into mainline.
I disagree. Given that the UART is not quite a PL011, it is likely to behave differently under certain circumstances, and may have its own errata that need to be worked around.
Even if the driver happens to currently work with it, a driver change could easily break that. By being explicit from the outset that this is a hi6220-specific PL011 variant, we can target workarounds far more effectively later, without requiring DTB updates.
Having the additional string costs us nothing today.
Thanks,
Mark.
Quoted 12 lines · Bintian Wang
Hi6220 is one mobile solution of Hisilicon, this patchset contains initial support for Hi6220 SoC and HiKey development board, which supports octal ARM Cortex A53 cores. Initial support is minimal and includes just the arch configuration, clock driver, device tree configuration.
PSCI is enabled in device tree and there is no problem to boot all the octal cores, and the CPU hotplug is also working now, you can download and compile the latest firmware based on the following link to run this patch set:
https://github.com/96boards/documentation/wiki/UEFI
Quoted 4 lines
Changes v4:
* Rebase to kernel 4.1-rc1
* Delete "arm,cortex-a15-gic" from the gic node in dts
Quoted 12 lines · Bintian Wang
Hi6220 is one mobile solution of Hisilicon, this patchset contains initial support for Hi6220 SoC and HiKey development board, which supports octal ARM Cortex A53 cores. Initial support is minimal and includes just the arch configuration, clock driver, device tree configuration.
PSCI is enabled in device tree and there is no problem to boot all the octal cores, and the CPU hotplug is also working now, you can download and compile the latest firmware based on the following link to run this patch set:
https://github.com/96boards/documentation/wiki/UEFI
Quoted 3 lines
Changes v4:
* Rebase to kernel 4.1-rc1
* Delete "arm,cortex-a15-gic" from the gic node in dts
Tested by: Tyler Baker <[email protected]>
Built and booted all v4 patches in this series ontop a v4.1-rc1 based tree. Tested with the UEFI load mentioned above, booting to a minimal ramdisk userspace[0]. Confirmed all 8 CPUs were activated.
Quoted 51 lines
Changes v3:
* Verified the CPU hotplug based on the new released firmware
* Redefined the compatible strings of four system controllers in dts
* SettingCOMMON_CLK_HI6220to a bool symbol
* KeepCONFGI_ARCH_HISIsorted alphabeticallyChanges v2:
* Split the DT bindings documents into earlier patches
* Change SMP enable method from spin-table to PSCI in device tree
* Remove "clock-frequency" from armv8-timer device node in device tree
* Add more description about Hisilicon designed system controllers in DT bindings document
* Enable high speed clock on UART1 mux
* Other changes based on the discussion in the mailing list:
https://lkml.org/lkml/2015/2/5/147Bintian Wang (5):
arm64: Enable Hisilicon ARMv8 SoC family inKconfigand defconfig
arm64: hi6220: Document devicetree bindings for Hisilicon hi6220 SoC
clk: hi6220: Document devicetree bindings for hi6220 clock
clk: hi6220: Clock driver support for Hisilicon hi6220 SoC
arm64: dts: Add dts files for Hisilicon Hi6220 SoC.../bindings/arm/hisilicon/hisilicon.txt | 87 ++++++ .../devicetree/bindings/clock/hi6220-clock.txt | 34 +++ arch/arm64/Kconfig | 5 + arch/arm64/boot/dts/Makefile | 1 + arch/arm64/boot/dts/hisilicon/Makefile | 5 + arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts | 31 +++ arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 172 ++++++++++++ arch/arm64/configs/defconfig | 1 + drivers/clk/Kconfig | 2 + drivers/clk/Makefile | 4 +- drivers/clk/hisilicon/Kconfig | 6 + drivers/clk/hisilicon/Makefile | 3 +- drivers/clk/hisilicon/clk-hi6220.c | 292 +++++++++++++++++++++ drivers/clk/hisilicon/clk.c | 29 ++ drivers/clk/hisilicon/clk.h | 17 ++ drivers/clk/hisilicon/clkdivider-hi6220.c | 273 +++++++++++++++++++ include/dt-bindings/clock/hi6220-clock.h | 173 ++++++++++++ 17 files changed, 1131 insertions(+), 4 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/hi6220-clock.txt create mode 100644 arch/arm64/boot/dts/hisilicon/Makefile create mode 100644 arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts create mode 100644 arch/arm64/boot/dts/hisilicon/hi6220.dtsi create mode 100644 drivers/clk/hisilicon/Kconfig create mode 100644 drivers/clk/hisilicon/clk-hi6220.c create mode 100644 drivers/clk/hisilicon/clkdivider-hi6220.c create mode 100644 include/dt-bindings/clock/hi6220-clock.h
Quoted 3 lines
--
1.9.1
Cheers,
Tyler
Thank you Tyler for testing this patch set.
Quoted 86 lines · Tyler Baker
Quoted 12 lines · Bintian Wang
Hi6220 is one mobile solution of Hisilicon, this patchset contains initial support for Hi6220 SoC and HiKey development board, which supports octal ARM Cortex A53 cores. Initial support is minimal and includes just the arch configuration, clock driver, device tree configuration.
PSCI is enabled in device tree and there is no problem to boot all the octal cores, and the CPU hotplug is also working now, you can download and compile the latest firmware based on the following link to run this patch set:
https://github.com/96boards/documentation/wiki/UEFIQuoted 3 lines
Changes v4:
* Rebase to kernel 4.1-rc1
* Delete "arm,cortex-a15-gic" from the gic node in dtsTested by: Tyler Baker <[email protected]>
Built and booted all v4 patches in this series ontop a v4.1-rc1 based tree. Tested with the UEFI load mentioned above, booting to a minimal ramdisk userspace[0]. Confirmed all 8 CPUs were activated.
Quoted 51 lines
Changes v3:
* Verified the CPU hotplug based on the new released firmware
* Redefined the compatible strings of four system controllers in dts
* SettingCOMMON_CLK_HI6220to a bool symbol
* KeepCONFGI_ARCH_HISIsorted alphabeticallyChanges v2:
* Split the DT bindings documents into earlier patches
* Change SMP enable method from spin-table to PSCI in device tree
* Remove "clock-frequency" from armv8-timer device node in device tree
* Add more description about Hisilicon designed system controllers in DT bindings document
* Enable high speed clock on UART1 mux
* Other changes based on the discussion in the mailing list:https://lkml.org/lkml/2015/2/5/147Bintian Wang (5):
arm64: Enable Hisilicon ARMv8 SoC family inKconfigand defconfig
arm64: hi6220: Document devicetree bindings for Hisilicon hi6220 SoC
clk: hi6220: Document devicetree bindings for hi6220 clock
clk: hi6220: Clock driver support for Hisilicon hi6220 SoC
arm64: dts: Add dts files for Hisilicon Hi6220 SoC.../bindings/arm/hisilicon/hisilicon.txt | 87 ++++++ .../devicetree/bindings/clock/hi6220-clock.txt | 34 +++ arch/arm64/Kconfig | 5 + arch/arm64/boot/dts/Makefile | 1 + arch/arm64/boot/dts/hisilicon/Makefile | 5 + arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts | 31 +++ arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 172 ++++++++++++ arch/arm64/configs/defconfig | 1 + drivers/clk/Kconfig | 2 + drivers/clk/Makefile | 4 +- drivers/clk/hisilicon/Kconfig | 6 + drivers/clk/hisilicon/Makefile | 3 +- drivers/clk/hisilicon/clk-hi6220.c | 292 +++++++++++++++++++++ drivers/clk/hisilicon/clk.c | 29 ++ drivers/clk/hisilicon/clk.h | 17 ++ drivers/clk/hisilicon/clkdivider-hi6220.c | 273 +++++++++++++++++++ include/dt-bindings/clock/hi6220-clock.h | 173 ++++++++++++ 17 files changed, 1131 insertions(+), 4 deletions(-)create mode 100644
Documentation/devicetree/bindings/clock/hi6220-clock.txtcreate mode 100644arch/arm64/boot/dts/hisilicon/Makefilecreate mode 100644arch/arm64/boot/dts/hisilicon/hi6220-hikey.dtscreate mode 100644arch/arm64/boot/dts/hisilicon/hi6220.dtsicreate mode 100644drivers/clk/hisilicon/Kconfig
create mode 100644drivers/clk/hisilicon/clk-hi6220.c
create mode 100644drivers/clk/hisilicon/clkdivider-hi6220.ccreate mode 100644include/dt-bindings/clock/hi6220-clock.hQuoted 3 lines
--
1.9.1Cheers,
Tyler
.
v4 cover arm64,hi6220: Enable Hisilicon Hi6220 SoC
In reply to Bintian WangHi Bintian,
Quoted 12 lines · Bintian Wang
Hi6220 is one mobile solution of Hisilicon, this patchset contains initial support for Hi6220 SoC and HiKey development board, which supports octal ARM Cortex A53 cores. Initial support is minimal and includes just the arch configuration, clock driver, device tree configuration.
PSCI is enabled in device tree and there is no problem to boot all the octal cores, and the CPU hotplug is also working now, you can download and compile the latest firmware based on the following link to run this patch set:
https://github.com/96boards/documentation/wiki/UEFI
Quoted 3 lines
Changes v4:
* Rebase to kernel 4.1-rc1
* Delete "arm,cortex-a15-gic" from the gic node in dts
I gave these patches a go on top of -rc2 using the ATF and UEFI you link to above.
The good news is that the thing booted and all the cores entered at EL2. Thanks!
The bad news is that running hackbench quickly got the *heatsink* temperature to 73 degress C and rising (measured with an infrared thermometer).
So my question is, does this SoC have an automatic thermal cut out? Whilst I'm all for merging enabling code into the kernel, if it really relies on the kernel to stop it from catching fire, maybe it's not a great idea putting these patches into people's hands just yet.
Will
v4 cover arm64,hi6220: Enable Hisilicon Hi6220 SoC
Hi Will,
Quoted 19 lines · Will Deacon
Hi Bintian,
Quoted 12 lines · Bintian Wang
Hi6220 is one mobile solution of Hisilicon, this patchset contains initial support for Hi6220 SoC and HiKey development board, which supports octal ARM Cortex A53 cores. Initial support is minimal and includes just the arch configuration, clock driver, device tree configuration.
PSCI is enabled in device tree and there is no problem to boot all the octal cores, and the CPU hotplug is also working now, you can download and compile the latest firmware based on the following link to run this patch set:
https://github.com/96boards/documentation/wiki/UEFIQuoted 3 lines
Changes v4:
* Rebase to kernel 4.1-rc1
* Delete "arm,cortex-a15-gic" from the gic node in dts
Quoted 5 lines
I gave these patches a go on top of -rc2 using the ATF and UEFI you link to above.
The good news is that the thing booted and all the cores entered at EL2. Thanks!
Really thank you very much for testing this patch set.
Quoted 4 lines
The bad news is that running hackbench quickly got the *heatsink* temperature to 73 degress C and rising (measured with an infrared thermometer).
This patch set is just for booting the small system, if you want to test the temperature, I think you should using the HiKey released version (https://www.96boards.org/).
This patch is just for the small system, and not include those drivers for adjusting the CPU frequency, thermal control and so on. After this patch is merged, all those drivers will be submitted later.
Quoted 5 lines
So my question is, does this SoC have an automatic thermal cut out? Whilst I'm all for merging enabling code into the kernel, if it really relies on the kernel to stop it from catching fire, maybe it's not a great idea putting these patches into people's hands just yet.
Hikey is a low cost board, I think it doesn't have an automatic thermal cut out; I always use HiKey to test my patch, in the normal case, temperature is not a problem.
Thanks,
Bintian
Quoted 5 lines
Will
.
v4 cover arm64,hi6220: Enable Hisilicon Hi6220 SoC
Quoted 18 lines · Bintian
Quoted 17 lines · Will Deacon
Quoted 15 lines · Bintian Wang
Hi6220 is one mobile solution of Hisilicon, this patchset contains initial support for Hi6220 SoC and HiKey development board, which supports octal ARM Cortex A53 cores. Initial support is minimal and includes just the arch configuration, clock driver, device tree configuration.
PSCI is enabled in device tree and there is no problem to boot all the octal cores, and the CPU hotplug is also working now, you can download and compile the latest firmware based on the following link to run this patch set:
https://github.com/96boards/documentation/wiki/UEFIChanges v4:
* Rebase to kernel 4.1-rc1
* Delete "arm,cortex-a15-gic" from the gic node in dts
Quoted 6 lines
Quoted 5 lines
I gave these patches a go on top of -rc2 using the ATF and UEFI you link to above.
The good news is that the thing booted and all the cores entered at EL2. Thanks!
Really thank you very much for testing this patch set.
Feel free to add my tested-by if you like.
Quoted 6 lines
Quoted 3 lines
The bad news is that running hackbench quickly got the *heatsink* temperature to 73 degress C and rising (measured with an infrared thermometer).
This patch set is just for booting the small system, if you want to test the temperature, I think you should using the HiKey released version (https://www.96boards.org/).
I'm not really interested in the temperature numbers, but I am interested in the board not melting and potentially setting fire to my desk.
Quoted 3 lines
This patch is just for the small system, and not include those drivers for adjusting the CPU frequency, thermal control and so on. After this patch is merged, all those drivers will be submitted later.
Should those drivers *really* exist only in the kernel? What happens if the kernel panics for some other reason? You'll basically have 8 spinning cores and no sensible way to handle the thermal interrupt.
Shouldn't there be something in the secure firmware as a last resort?
Quoted 7 lines
Quoted 4 lines
So my question is, does this SoC have an automatic thermal cut out? Whilst I'm all for merging enabling code into the kernel, if it really relies on the kernel to stop it from catching fire, maybe it's not a great idea putting these patches into people's hands just yet.
Hikey is a low cost board, I think it doesn't have an automatic thermal cut out; I always use HiKey to test my patch, in the normal case, temperature is not a problem.
I don't see why the cost has anything to do with this issue; any money I save on the board will quickly be re-invested in my increased insurance premium.
All I think we need is for secure software to keep an eye on the temperature and hit the power controller if it goes over some `fatal' threshold. Ideally, you'd be able to use a secure interrupt for this, but I suspect that you don't have the right hardware features for that (please correct me if I'm wrong). An alternative would be to hang something off a secure timer and get the firmware to check the board temperature on some low-frequency periodic tick.
Will
v4 cover arm64,hi6220: Enable Hisilicon Hi6220 SoC
Quoted 3 lines · Will Deacon
Quoted 2 lines · Bintian
Quoted 1 line · Will Deacon
On Tue, May 05, 2015 at 01:06:34PM +0100, Bintian Wang wrote:
[...]
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
The bad news is that running hackbench quickly got the *heatsink* temperature to 73 degress C and rising (measured with an infrared thermometer).
This patch set is just for booting the small system, if you want to test the temperature, I think you should using the HiKey released version (https://www.96boards.org/).
I'm not really interested in the temperature numbers, but I am interested in the board not melting and potentially setting fire to my desk.
All cpus will be initialized w/t 800MHz, suppose the dynamic leakage is high; w/t Bintian's patches, suppose the cpuidle also has not been enabled; so there also have static leakage even cpus run into "wfi" state.
I also have not exactly power data for SoC, but suppose the leakage is high.
Quoted 9 lines
Quoted 3 lines
This patch is just for the small system, and not include those drivers for adjusting the CPU frequency, thermal control and so on. After this patch is merged, all those drivers will be submitted later.
Should those drivers *really* exist only in the kernel? What happens if the kernel panics for some other reason? You'll basically have 8 spinning cores and no sensible way to handle the thermal interrupt.
Shouldn't there be something in the secure firmware as a last resort?
We are integrate Hisilicon's MCU firmware, which is the similiar module w/t Juno's SCP. It will support mainly two functionality:
- CPU Frequency Scaling;
CPUFreq driver has been merged yet. [2]
For CPU frequency scaling part, Due MCU FW has some updating from hisilicon, so we need re-work cpu clock driver. [1]
- CPUIdle and system's low power state;
This part need integrate ARM-TF w/t MCU FW to support PSCI;
Quoted 12 lines
Quoted 7 lines
Quoted 4 lines
So my question is, does this SoC have an automatic thermal cut out? Whilst I'm all for merging enabling code into the kernel, if it really relies on the kernel to stop it from catching fire, maybe it's not a great idea putting these patches into people's hands just yet.
Hikey is a low cost board, I think it doesn't have an automatic thermal cut out; I always use HiKey to test my patch, in the normal case, temperature is not a problem.
I don't see why the cost has anything to do with this issue; any money I save on the board will quickly be re-invested in my increased insurance premium.
Quoted 7 lines
All I think we need is for secure software to keep an eye on the temperature and hit the power controller if it goes over some `fatal' threshold. Ideally, you'd be able to use a secure interrupt for this, but I suspect that you don't have the right hardware features for that (please correct me if I'm wrong). An alternative would be to hang something off a secure timer and get the firmware to check the board temperature on some low-frequency periodic tick.
Now we are using thermal framework to monitor thermal and if temperature hit the trip point it will take cpu as cooling device and set limitation for cpu's max frequency. [3]
[1] http://archive.arm.linux.org.uk/lurker/message/20150326.111335.0d484b89.en.html
[2] http://archive.arm.linux.org.uk/lurker/message/20150330.052637.16e0f3f4.en.html
[3] http://archive.arm.linux.org.uk/lurker/message/20150424.035121.80e0e24b.en.html
Thanks,
Leo Yan
v4 cover arm64,hi6220: Enable Hisilicon Hi6220 SoC
In reply to Will DeaconHi Will,
Quoted 19 lines · Will Deacon
Quoted 18 lines · Bintian
Quoted 17 lines · Will Deacon
Quoted 15 lines · Bintian Wang
Hi6220 is one mobile solution of Hisilicon, this patchset contains initial support for Hi6220 SoC and HiKey development board, which supports octal ARM Cortex A53 cores. Initial support is minimal and includes just the arch configuration, clock driver, device tree configuration.
PSCI is enabled in device tree and there is no problem to boot all the octal cores, and the CPU hotplug is also working now, you can download and compile the latest firmware based on the following link to run this patch set:
https://github.com/96boards/documentation/wiki/UEFIChanges v4:
* Rebase to kernel 4.1-rc1
* Delete "arm,cortex-a15-gic" from the gic node in dts
Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
I gave these patches a go on top of -rc2 using the ATF and UEFI you link to above.
The good news is that the thing booted and all the cores entered at EL2. Thanks!
Really thank you very much for testing this patch set.
Feel free to add my tested-by if you like.
Sure, I will add and prepare the next version soon.
Quoted 33 lines
Quoted 7 lines
Quoted 4 lines
The bad news is that running hackbench quickly got the *heatsink* temperature to 73 degress C and rising (measured with an infrared thermometer).
This patch set is just for booting the small system, if you want to test the temperature, I think you should using the HiKey released version (https://www.96boards.org/).
I'm not really interested in the temperature numbers, but I am interested in the board not melting and potentially setting fire to my desk.
Quoted 3 lines
This patch is just for the small system, and not include those drivers for adjusting the CPU frequency, thermal control and so on. After this patch is merged, all those drivers will be submitted later.
Should those drivers *really* exist only in the kernel? What happens if the kernel panics for some other reason? You'll basically have 8 spinning cores and no sensible way to handle the thermal interrupt.
Shouldn't there be something in the secure firmware as a last resort?
Quoted 7 lines
Quoted 4 lines
So my question is, does this SoC have an automatic thermal cut out? Whilst I'm all for merging enabling code into the kernel, if it really relies on the kernel to stop it from catching fire, maybe it's not a great idea putting these patches into people's hands just yet.
Hikey is a low cost board, I think it doesn't have an automatic thermal cut out; I always use HiKey to test my patch, in the normal case, temperature is not a problem.
I don't see why the cost has anything to do with this issue; any money I save on the board will quickly be re-invested in my increased insurance premium.
Quoted 7 lines
All I think we need is for secure software to keep an eye on the temperature and hit the power controller if it goes over some `fatal' threshold. Ideally, you'd be able to use a secure interrupt for this, but I suspect that you don't have the right hardware features for that (please correct me if I'm wrong). An alternative would be to hang something off a secure timer and get the firmware to check the board temperature on some low-frequency periodic tick.
If there is exception occurred on A core, there are two methods to handle it:
(1) Delay for a period of time, watchdog will trigger the system reset.
(2) If the temperature is over 105 degree, the CPU will trigger reset(I guess it's chip level).
Thanks,
Bintian
Quoted 5 lines
Will
.
v4 cover arm64,hi6220: Enable Hisilicon Hi6220 SoC
Quoted 17 lines · Bintian
Quoted 9 lines · Will Deacon
Quoted 3 lines · Bintian
Hikey is a low cost board, I think it doesn't have an automatic thermal cut out; I always use HiKey to test my patch, in the normal case, temperature is not a problem.
I don't see why the cost has anything to do with this issue; any money I save on the board will quickly be re-invested in my increased insurance premium.
Quoted 7 lines
All I think we need is for secure software to keep an eye on the temperature and hit the power controller if it goes over some `fatal' threshold. Ideally, you'd be able to use a secure interrupt for this, but I suspect that you don't have the right hardware features for that (please correct me if I'm wrong). An alternative would be to hang something off a secure timer and get the firmware to check the board temperature on some low-frequency periodic tick.
Quoted 5 lines
If there is exception occurred on A core, there are two methods to handle it:
(1) Delay for a period of time, watchdog will trigger the system reset.
(2) If the temperature is over 105 degree, the CPU will trigger reset(I guess it's chip level).
Aha, so now you're saying that there *is* a hardware shut-off at 105 degrees, regardless of what the kernel is doing? If that's the case, then we're fine and the current patches make sense in isolation.
Cheers,
Will
v4 cover arm64,hi6220: Enable Hisilicon Hi6220 SoC
Hello Will,
Quoted 18 lines · Will Deacon
Quoted 17 lines · Bintian
Quoted 16 lines · Will Deacon
Quoted 3 lines · Bintian
Hikey is a low cost board, I think it doesn't have an automatic thermal cut out; I always use HiKey to test my patch, in the normal case, temperature is not a problem.
I don't see why the cost has anything to do with this issue; any money I save on the board will quickly be re-invested in my increased insurance premium.
All I think we need is for secure software to keep an eye on the temperature and hit the power controller if it goes over some `fatal' threshold. Ideally, you'd be able to use a secure interrupt for this, but I suspect that you don't have the right hardware features for that (please correct me if I'm wrong). An alternative would be to hang something off a secure timer and get the firmware to check the board temperature on some low-frequency periodic tick.
Quoted 8 lines
Quoted 5 lines
If there is exception occurred on A core, there are two methods to handle it:
(1) Delay for a period of time, watchdog will trigger the system reset.
(2) If the temperature is over 105 degree, the CPU will trigger reset(I guess it's chip level).Aha, so now you're saying that there *is* a hardware shut-off at 105 degrees, regardless of what the kernel is doing?
Yes!
Quoted 2 lines
If that's the case, then
we're fine and the current patches make sense in isolation.
Thank you very much and I need your ack in next version :) I am preparing the next version and will send out soon.
Thanks,
Bintian
Quoted 7 lines
Cheers,
Will
.
v4 cover arm64,hi6220: Enable Hisilicon Hi6220 SoC
In reply to Will DeaconQuoted 22 lines · Will Deacon
Hi Bintian,
Quoted 12 lines · Bintian Wang
Hi6220 is one mobile solution of Hisilicon, this patchset contains initial support for Hi6220 SoC and HiKey development board, which supports octal ARM Cortex A53 cores. Initial support is minimal and includes just the arch configuration, clock driver, device tree configuration.
PSCI is enabled in device tree and there is no problem to boot all the octal cores, and the CPU hotplug is also working now, you can download and compile the latest firmware based on the following link to run this patch set:
https://github.com/96boards/documentation/wiki/UEFIQuoted 3 lines
Changes v4:
* Rebase to kernel 4.1-rc1
* Delete "arm,cortex-a15-gic" from the gic node in dtsI gave these patches a go on top of -rc2 using the ATF and UEFI you link to above.
Quoted 6 lines
The good news is that the thing booted and all the cores entered at EL2. Thanks!
The bad news is that running hackbench quickly got the *heatsink* temperature to 73 degress C and rising (measured with an infrared thermometer).
Because you're just testing with minimum patch set. If you can choose our release
on v3.10 & v3.18, you can observe lower temperature. Because we have thermal framework and cpufreq driver. We're also upstreaming the thermal driver, but it's not merged yet.
Quoted 2 lines
So my question is, does this SoC have an automatic thermal cut out?
It's a low cost board. This feature is implemente by software. So we need thermal
driver and cpufreq driver.
Regards
Haojian
v4 cover arm64,hi6220: Enable Hisilicon Hi6220 SoC
Quoted 25 lines · Haojian Zhuang
Quoted 24 lines · Will Deacon
Hi Bintian,
Quoted 12 lines · Bintian Wang
Hi6220 is one mobile solution of Hisilicon, this patchset contains initial support for Hi6220 SoC and HiKey development board, which supports octal ARM Cortex A53 cores. Initial support is minimal and includes just the arch configuration, clock driver, device tree configuration.
PSCI is enabled in device tree and there is no problem to boot all the octal cores, and the CPU hotplug is also working now, you can download and compile the latest firmware based on the following link to run this patch set:
https://github.com/96boards/documentation/wiki/UEFIQuoted 3 lines
Changes v4:
* Rebase to kernel 4.1-rc1
* Delete "arm,cortex-a15-gic" from the gic node in dtsI gave these patches a go on top of -rc2 using the ATF and UEFI you link to above.
The good news is that the thing booted and all the cores entered at EL2. Thanks!
Quoted 8 lines
Quoted 3 lines
The bad news is that running hackbench quickly got the *heatsink* temperature to 73 degress C and rising (measured with an infrared thermometer).
Because you're just testing with minimum patch set. If you can choose our release
on v3.10 & v3.18, you can observe lower temperature. Because we have thermal framework and cpufreq driver. We're also upstreaming the thermal driver, but it's not merged yet.
the thermal driver is now on v4 (see below)
https://lkml.org/lkml/2015/4/24/1
Quoted 8 lines
Quoted 2 lines
So my question is, does this SoC have an automatic thermal cut out?
It's a low cost board. This feature is implemente by software. So we need thermal
driver and cpufreq driver.Regards
Haojian
Hello Mark, Will,
Any other suggestions for this patch set?
Thanks,
Bintian
Quoted 66 lines · Bintian Wang
Hi6220 is one mobile solution of Hisilicon, this patchset contains initial support for Hi6220 SoC and HiKey development board, which supports octal ARM Cortex A53 cores. Initial support is minimal and includes just the arch configuration, clock driver, device tree configuration.
PSCI is enabled in device tree and there is no problem to boot all the octal cores, and the CPU hotplug is also working now, you can download and compile the latest firmware based on the following link to run this patch set:
https://github.com/96boards/documentation/wiki/UEFIChanges v4:
* Rebase to kernel 4.1-rc1
* Delete "arm,cortex-a15-gic" from the gic node in dtsChanges v3:
* Verified the CPU hotplug based on the new released firmware
* Redefined the compatible strings of four system controllers in dts
* SettingCOMMON_CLK_HI6220to a bool symbol
* KeepCONFGI_ARCH_HISIsorted alphabeticallyChanges v2:
* Split the DT bindings documents into earlier patches
* Change SMP enable method from spin-table to PSCI in device tree
* Remove "clock-frequency" from armv8-timer device node in device tree
* Add more description about Hisilicon designed system controllers in DT bindings document
* Enable high speed clock on UART1 mux
* Other changes based on the discussion in the mailing list:https://lkml.org/lkml/2015/2/5/147Bintian Wang (5):
arm64: Enable Hisilicon ARMv8 SoC family inKconfigand defconfig
arm64: hi6220: Document devicetree bindings for Hisilicon hi6220 SoC
clk: hi6220: Document devicetree bindings for hi6220 clock
clk: hi6220: Clock driver support for Hisilicon hi6220 SoC
arm64: dts: Add dts files for Hisilicon Hi6220 SoC.../bindings/arm/hisilicon/hisilicon.txt | 87 ++++++ .../devicetree/bindings/clock/hi6220-clock.txt | 34 +++ arch/arm64/Kconfig | 5 + arch/arm64/boot/dts/Makefile | 1 + arch/arm64/boot/dts/hisilicon/Makefile | 5 + arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts | 31 +++ arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 172 ++++++++++++ arch/arm64/configs/defconfig | 1 + drivers/clk/Kconfig | 2 + drivers/clk/Makefile | 4 +- drivers/clk/hisilicon/Kconfig | 6 + drivers/clk/hisilicon/Makefile | 3 +- drivers/clk/hisilicon/clk-hi6220.c | 292 +++++++++++++++++++++ drivers/clk/hisilicon/clk.c | 29 ++ drivers/clk/hisilicon/clk.h | 17 ++ drivers/clk/hisilicon/clkdivider-hi6220.c | 273 +++++++++++++++++++ include/dt-bindings/clock/hi6220-clock.h | 173 ++++++++++++ 17 files changed, 1131 insertions(+), 4 deletions(-)create mode 100644
Documentation/devicetree/bindings/clock/hi6220-clock.txtcreate mode 100644arch/arm64/boot/dts/hisilicon/Makefilecreate mode 100644arch/arm64/boot/dts/hisilicon/hi6220-hikey.dtscreate mode 100644arch/arm64/boot/dts/hisilicon/hi6220.dtsicreate mode 100644drivers/clk/hisilicon/Kconfig
create mode 100644drivers/clk/hisilicon/clk-hi6220.c
create mode 100644drivers/clk/hisilicon/clkdivider-hi6220.ccreate mode 100644include/dt-bindings/clock/hi6220-clock.h
v4 cover arm64,hi6220: Enable Hisilicon Hi6220 SoC
Quoted 1 line · Bintian
Any other suggestions for this patch set?
You sent a v5, right, so this version (4) has been superseded? The patches should all go via arm-soc once you've got the relevant acks in place (I don't think you need anything from me or Catalin -- the Kconfig changes are trivial).
Will
Arnd Bergmann
maintainerv4 cover arm64,hi6220: Enable Hisilicon Hi6220 SoC
Quoted 9 lines · On Wednesday 13 May 2015 10:16:44 Will Deacon wrote:
Quoted 1 line · Bintian
Any other suggestions for this patch set?
You sent a v5, right, so this version (4) has been superseded? The patches should all go via arm-soc once you've got the relevant acks in place (I don't think you need anything from me or Catalin -- the
Kconfigchanges are trivial).
To be more specific here, I expect the patches to be picked up by Wei Xu and forwarded to arm at kernel.org when he's made sure that everybody including himself is happy with the outcome.
Arnd
v4 cover arm64,hi6220: Enable Hisilicon Hi6220 SoC
In reply to Will DeaconHello Will,
Quoted 4 lines · Will Deacon
Quoted 1 line · Bintian
Any other suggestions for this patch set?
You sent a v5, right, so this version (4) has been superseded?
Sorry for my mistake, I just want to get feedback about v5, but send this email with v4, v5 includes some changes based on some suggestions from Mark.
Please consider the version (5).
Thanks,
Bintian
Quoted 8 lines
The patches should all go via arm-soc once you've got the relevant acks in place (I don't think you need anything from me or Catalin -- the
Kconfigchanges are trivial).Will
.