Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1364915 > unrolled thread
| Started by | Xing Zheng <zhengxing@rock-chips.com> |
|---|---|
| First post | 2016-03-26 07:40 +0100 |
| Last post | 2016-03-28 08:20 +0200 |
| Articles | 10 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH v5 0/4] Add more clock compatible features and support the RK3399 clock Xing Zheng <zhengxing@rock-chips.com> - 2016-03-26 07:40 +0100
[PATCH v5 1/4] clk: rockchip: fix big.LITTLE cores alternate reparent failed Xing Zheng <zhengxing@rock-chips.com> - 2016-03-26 07:40 +0100
Re: [PATCH v5 1/4] clk: rockchip: fix big.LITTLE cores alternate reparent failed Heiko Stübner <heiko@sntech.de> - 2016-03-27 23:30 +0200
[PATCH v5 2/4] dt-bindings: add bindings for rk3399 clock controller Xing Zheng <zhengxing@rock-chips.com> - 2016-03-26 07:40 +0100
Re: [PATCH v5 2/4] dt-bindings: add bindings for rk3399 clock controller Heiko Stübner <heiko@sntech.de> - 2016-03-28 02:00 +0200
Re: [PATCH v5 2/4] dt-bindings: add bindings for rk3399 clock controller Heiko Stuebner <heiko@sntech.de> - 2016-03-28 02:10 +0200
Re: [PATCH v5 2/4] dt-bindings: add bindings for rk3399 clock controller Xing Zheng <zhengxing@rock-chips.com> - 2016-03-28 05:30 +0200
Re: [PATCH v5 2/4] dt-bindings: add bindings for rk3399 clock controller Xing Zheng <zhengxing@rock-chips.com> - 2016-03-28 05:00 +0200
Re: [PATCH v5 4/4] clk: rockchip: add clock controller for the RK3399 Heiko Stuebner <heiko@sntech.de> - 2016-03-28 02:20 +0200
Re: [PATCH v5 4/4] clk: rockchip: add clock controller for the RK3399 Xing Zheng <zhengxing@rock-chips.com> - 2016-03-28 08:20 +0200
| From | Xing Zheng <zhengxing@rock-chips.com> |
|---|---|
| Date | 2016-03-26 07:40 +0100 |
| Subject | [PATCH v5 0/4] Add more clock compatible features and support the RK3399 clock |
| Message-ID | <rgQ38-5jF-3@gated-at.bofh.it> |
Hi, The patch series add support more mux parameters and multiple clock providers for the rockchip features of the clock framework, and support the clock controller for the RK3399. Changes in v5: - add some necessary clock IDs - keep PPLL independent into the part of the PMUCRU - fix PMUCRU IDs are out of range - add clock IDs to drivers reference - fix some important bugs - fix configuration for cpu tables Changes in v3: - rename pclkin_cif to pclkin_cifmux, add diagram and comment for pclkin_cifmux - add the clk_test node - modify the cif_testout path - include two new patches that dt-bindings and header file from Jianqun's patch series Changes in v2: - rename the aplll/apllb to lpll/bpll - add drv/sample clock nodes for sdmmc/sdio Xing Zheng (4): clk: rockchip: fix big.LITTLE cores alternate reparent failed dt-bindings: add bindings for rk3399 clock controller clk: rockchip: add dt-binding header for rk3399 clk: rockchip: add clock controller for the RK3399 .../bindings/clock/rockchip,rk3399-cru.txt | 83 ++ drivers/clk/rockchip/Makefile | 1 + drivers/clk/rockchip/clk-cpu.c | 15 +- drivers/clk/rockchip/clk-rk3399.c | 1550 ++++++++++++++++++++ drivers/clk/rockchip/clk.h | 24 +- include/dt-bindings/clock/rk3399-cru.h | 752 ++++++++++ 6 files changed, 2417 insertions(+), 8 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/rockchip,rk3399-cru.txt create mode 100644 drivers/clk/rockchip/clk-rk3399.c create mode 100644 include/dt-bindings/clock/rk3399-cru.h -- 1.7.9.5
[toc] | [next] | [standalone]
| From | Xing Zheng <zhengxing@rock-chips.com> |
|---|---|
| Date | 2016-03-26 07:40 +0100 |
| Subject | [PATCH v5 1/4] clk: rockchip: fix big.LITTLE cores alternate reparent failed |
| Message-ID | <rgQ38-5jF-9@gated-at.bofh.it> |
| In reply to | #1364915 |
On the RK3399, the order of the core's parents are LPLL/BPLL/DPLL/GPLL,
there is incorrect to select bit_0 and bit_1 as the main and alternate
parents for LPLL/BPLL. They should be configurable.
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
---
Changes in v5: None
Changes in v3: None
Changes in v2: None
drivers/clk/rockchip/clk-cpu.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/clk/rockchip/clk-cpu.c b/drivers/clk/rockchip/clk-cpu.c
index 5556849..4bb130c 100644
--- a/drivers/clk/rockchip/clk-cpu.c
+++ b/drivers/clk/rockchip/clk-cpu.c
@@ -258,7 +258,7 @@ struct clk *rockchip_clk_register_cpuclk(const char *name,
return ERR_PTR(-ENOMEM);
init.name = name;
- init.parent_names = &parent_names[0];
+ init.parent_names = &parent_names[reg_data->mux_core_main];
init.num_parents = 1;
init.ops = &rockchip_cpuclk_ops;
@@ -276,10 +276,10 @@ struct clk *rockchip_clk_register_cpuclk(const char *name,
cpuclk->clk_nb.notifier_call = rockchip_cpuclk_notifier_cb;
cpuclk->hw.init = &init;
- cpuclk->alt_parent = __clk_lookup(parent_names[1]);
+ cpuclk->alt_parent = __clk_lookup(parent_names[reg_data->mux_core_alt]);
if (!cpuclk->alt_parent) {
- pr_err("%s: could not lookup alternate parent\n",
- __func__);
+ pr_err("%s: could not lookup alternate parent: (%d)\n",
+ __func__, reg_data->mux_core_alt);
ret = -EINVAL;
goto free_cpuclk;
}
@@ -291,10 +291,11 @@ struct clk *rockchip_clk_register_cpuclk(const char *name,
goto free_cpuclk;
}
- clk = __clk_lookup(parent_names[0]);
+ clk = __clk_lookup(parent_names[reg_data->mux_core_main]);
if (!clk) {
- pr_err("%s: could not lookup parent clock %s\n",
- __func__, parent_names[0]);
+ pr_err("%s: could not lookup parent clock: (%d) %s\n",
+ __func__, reg_data->mux_core_main,
+ parent_names[reg_data->mux_core_main]);
ret = -EINVAL;
goto free_alt_parent;
}
--
1.7.9.5
[toc] | [prev] | [next] | [standalone]
| From | Heiko Stübner <heiko@sntech.de> |
|---|---|
| Date | 2016-03-27 23:30 +0200 |
| Subject | Re: [PATCH v5 1/4] clk: rockchip: fix big.LITTLE cores alternate reparent failed |
| Message-ID | <rhqpY-5Hn-9@gated-at.bofh.it> |
| In reply to | #1364916 |
Am Samstag, 26. März 2016, 14:37:53 schrieb Xing Zheng: > On the RK3399, the order of the core's parents are LPLL/BPLL/DPLL/GPLL, > there is incorrect to select bit_0 and bit_1 as the main and alternate > parents for LPLL/BPLL. They should be configurable. > > Signed-off-by: Xing Zheng <zhengxing@rock-chips.com> I've folded this fix into the original patch [0] Thanks Heiko [0] https://git.kernel.org/cgit/linux/kernel/git/mmind/linux-rockchip.git/commit/?h=v4.7-clk/next&id=268aebaa2410152bf91ea1ede6b284ff8138822d
[toc] | [prev] | [next] | [standalone]
| From | Xing Zheng <zhengxing@rock-chips.com> |
|---|---|
| Date | 2016-03-26 07:40 +0100 |
| Subject | [PATCH v5 2/4] dt-bindings: add bindings for rk3399 clock controller |
| Message-ID | <rgQ38-5jF-5@gated-at.bofh.it> |
| In reply to | #1364915 |
Add devicetree bindings for Rockchip cru which found on
Rockchip SoCs.
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Acked-by: Rob Herring <robh@kernel.org>
---
Changes in v5: None
Changes in v3: None
Changes in v2: None
.../bindings/clock/rockchip,rk3399-cru.txt | 83 ++++++++++++++++++++
1 file changed, 83 insertions(+)
create mode 100644 Documentation/devicetree/bindings/clock/rockchip,rk3399-cru.txt
diff --git a/Documentation/devicetree/bindings/clock/rockchip,rk3399-cru.txt b/Documentation/devicetree/bindings/clock/rockchip,rk3399-cru.txt
new file mode 100644
index 0000000..9427caa
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/rockchip,rk3399-cru.txt
@@ -0,0 +1,83 @@
+* Rockchip RK3399 Clock and Reset Unit
+
+The RK3399 clock controller generates and supplies clock to various
+controllers within the SoC and also implements a reset controller for SoC
+peripherals.
+
+Required Properties:
+
+- compatible: PMU for CRU should be "rockchip,rk3399-pmucru"
+- compatible: CRU should be "rockchip,rk3399-cru"
+- reg: physical base address of the controller and length of memory mapped
+ region.
+- #clock-cells: should be 1.
+- #reset-cells: should be 1.
+
+Optional Properties:
+
+- rockchip,grf: phandle to the syscon managing the "general register files"
+ If missing, pll rates are not changeable, due to the missing pll lock status.
+
+Each clock is assigned an identifier and client nodes can use this identifier
+to specify the clock which they consume. All available clocks are defined as
+preprocessor macros in the dt-bindings/clock/rk3399-cru.h headers and can be
+used in device tree sources. Similar macros exist for the reset sources in
+these files.
+
+External clocks:
+
+There are several clocks that are generated outside the SoC. It is expected
+that they are defined using standard clock bindings with following
+clock-output-names:
+ - "xin24m" - crystal input - required,
+ - "xin32k" - rtc clock - optional,
+ - "ext_i2s" - external I2S clock - optional,
+ - "ext_gmac" - external GMAC clock - optional
+ - "ext_hsadc" - external HSADC clock - optional,
+ - "ext_isp" - external ISP clock - optional,
+ - "ext_jtag" - external JTAG clock - optional
+ - "ext_vip" - external VIP clock - optional,
+ - "usbotg_out" - output clock of the pll in the otg phy
+
+Example: General Register Files
+
+ pmugrf: syscon@ff320000 {
+ compatible = "rockchip,rk3399-pmugrf", "syscon";
+ reg = <0x0 0xff320000 0x0 0x1000>;
+ };
+
+ grf: syscon@ff770000 {
+ compatible = "rockchip,rk3399-grf", "syscon";
+ reg = <0x0 0xff770000 0x0 0x10000>;
+ };
+
+Example: Clock controller node:
+
+ pmucru: pmu-clock-controller@ff750000 {
+ compatible = "rockchip,rk3399-pmucru";
+ reg = <0x0 0xff750000 0x0 0x1000>;
+ rockchip,grf = <&pmugrf>;
+ #clock-cells = <1>;
+ #reset-cells = <1>;
+ };
+
+ cru: clock-controller@ff760000 {
+ compatible = "rockchip,rk3399-cru";
+ reg = <0x0 0xff760000 0x0 0x1000>;
+ rockchip,grf = <&grf>;
+ #clock-cells = <1>;
+ #reset-cells = <1>;
+ };
+
+Example: UART controller node that consumes the clock generated by the clock
+ controller:
+
+ uart0: serial@ff1a0000 {
+ compatible = "rockchip,rk3399-uart", "snps,dw-apb-uart";
+ reg = <0x0 0xff180000 0x0 0x100>;
+ clocks = <&cru SCLK_UART0>, <&cru PCLK_UART0>;
+ clock-names = "baudclk", "apb_pclk";
+ interrupts = <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>;
+ reg-shift = <2>;
+ reg-io-width = <4>;
+ };
--
1.7.9.5
[toc] | [prev] | [next] | [standalone]
| From | Heiko Stübner <heiko@sntech.de> |
|---|---|
| Date | 2016-03-28 02:00 +0200 |
| Subject | Re: [PATCH v5 2/4] dt-bindings: add bindings for rk3399 clock controller |
| Message-ID | <rhsL8-7d9-5@gated-at.bofh.it> |
| In reply to | #1364917 |
Hi Xing,
Am Samstag, 26. März 2016, 14:37:54 schrieb Xing Zheng:
> Add devicetree bindings for Rockchip cru which found on
> Rockchip SoCs.
>
> Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
> Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
> Acked-by: Rob Herring <robh@kernel.org>
> ---
>
> Changes in v5: None
> Changes in v3: None
> Changes in v2: None
>
> .../bindings/clock/rockchip,rk3399-cru.txt | 83
> ++++++++++++++++++++ 1 file changed, 83 insertions(+)
> create mode 100644
> Documentation/devicetree/bindings/clock/rockchip,rk3399-cru.txt
>
> diff --git a/Documentation/devicetree/bindings/clock/rockchip,rk3399-
cru.txt
> b/Documentation/devicetree/bindings/clock/rockchip,rk3399-cru.txt new file
> mode 100644
> index 0000000..9427caa
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/clock/rockchip,rk3399-cru.txt
> @@ -0,0 +1,83 @@
> +* Rockchip RK3399 Clock and Reset Unit
> +
> +The RK3399 clock controller generates and supplies clock to various
> +controllers within the SoC and also implements a reset controller for SoC
> +peripherals.
> +
> +Required Properties:
> +
> +- compatible: PMU for CRU should be "rockchip,rk3399-pmucru"
> +- compatible: CRU should be "rockchip,rk3399-cru"
> +- reg: physical base address of the controller and length of memory
mapped
> + region.
> +- #clock-cells: should be 1.
> +- #reset-cells: should be 1.
> +
> +Optional Properties:
> +
> +- rockchip,grf: phandle to the syscon managing the "general register
files"
> + If missing, pll rates are not changeable, due to the missing pll lock
> status. +
the rk3399 doesn't need the GRF, so we should drop this block for now
> +Each clock is assigned an identifier and client nodes can use this
> identifier +to specify the clock which they consume. All available clocks
> are defined as +preprocessor macros in the dt-bindings/clock/rk3399-cru.h
> headers and can be +used in device tree sources. Similar macros exist for
> the reset sources in +these files.
> +
> +External clocks:
> +
> +There are several clocks that are generated outside the SoC. It is
expected
> +that they are defined using standard clock bindings with following
> +clock-output-names:
> + - "xin24m" - crystal input - required,
> + - "xin32k" - rtc clock - optional,
> + - "ext_i2s" - external I2S clock - optional,
> + - "ext_gmac" - external GMAC clock - optional
> + - "ext_hsadc" - external HSADC clock - optional,
> + - "ext_isp" - external ISP clock - optional,
> + - "ext_jtag" - external JTAG clock - optional
> + - "ext_vip" - external VIP clock - optional,
> + - "usbotg_out" - output clock of the pll in the otg phy
external clock listing needs adjusting, something like
- clkin_i2s
- clkin_gmac
--> remove ext_hsadc
- clkin_cif
--> remove ext_jtag
--> remove ext_vip
- clk_usbphy0_480m
- clk_usbphy0_480m
maybe?
> +
> +Example: General Register Files
> +
> + pmugrf: syscon@ff320000 {
> + compatible = "rockchip,rk3399-pmugrf", "syscon";
> + reg = <0x0 0xff320000 0x0 0x1000>;
> + };
> +
> + grf: syscon@ff770000 {
> + compatible = "rockchip,rk3399-grf", "syscon";
> + reg = <0x0 0xff770000 0x0 0x10000>;
> + };
> +
> +Example: Clock controller node:
> +
> + pmucru: pmu-clock-controller@ff750000 {
> + compatible = "rockchip,rk3399-pmucru";
> + reg = <0x0 0xff750000 0x0 0x1000>;
> + rockchip,grf = <&pmugrf>;
> + #clock-cells = <1>;
> + #reset-cells = <1>;
> + };
> +
> + cru: clock-controller@ff760000 {
> + compatible = "rockchip,rk3399-cru";
> + reg = <0x0 0xff760000 0x0 0x1000>;
> + rockchip,grf = <&grf>;
> + #clock-cells = <1>;
> + #reset-cells = <1>;
> + };
also here drop grf nodes and rockchip,grf properties?
> +
> +Example: UART controller node that consumes the clock generated by the
> clock + controller:
> +
> + uart0: serial@ff1a0000 {
> + compatible = "rockchip,rk3399-uart", "snps,dw-apb-uart";
> + reg = <0x0 0xff180000 0x0 0x100>;
> + clocks = <&cru SCLK_UART0>, <&cru PCLK_UART0>;
> + clock-names = "baudclk", "apb_pclk";
> + interrupts = <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>;
> + reg-shift = <2>;
> + reg-io-width = <4>;
> + };
[toc] | [prev] | [next] | [standalone]
| From | Heiko Stuebner <heiko@sntech.de> |
|---|---|
| Date | 2016-03-28 02:10 +0200 |
| Subject | Re: [PATCH v5 2/4] dt-bindings: add bindings for rk3399 clock controller |
| Message-ID | <rhsUO-7zw-1@gated-at.bofh.it> |
| In reply to | #1365237 |
Hi Xing,
Am Montag, 28. März 2016, 01:52:12 schrieb Heiko Stübner:
> Am Samstag, 26. März 2016, 14:37:54 schrieb Xing Zheng:
> > Add devicetree bindings for Rockchip cru which found on
> > Rockchip SoCs.
> >
> > Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
> > Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
> > Acked-by: Rob Herring <robh@kernel.org>
> > ---
> >
> > Changes in v5: None
> > Changes in v3: None
> > Changes in v2: None
> >
> > .../bindings/clock/rockchip,rk3399-cru.txt | 83
> >
> > ++++++++++++++++++++ 1 file changed, 83 insertions(+)
> >
> > create mode 100644
> >
> > Documentation/devicetree/bindings/clock/rockchip,rk3399-cru.txt
> >
> > diff --git a/Documentation/devicetree/bindings/clock/rockchip,rk3399-
>
> cru.txt
>
> > b/Documentation/devicetree/bindings/clock/rockchip,rk3399-cru.txt new
> > file mode 100644
> > index 0000000..9427caa
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/clock/rockchip,rk3399-cru.txt
> > @@ -0,0 +1,83 @@
> > +* Rockchip RK3399 Clock and Reset Unit
> > +
> > +The RK3399 clock controller generates and supplies clock to various
> > +controllers within the SoC and also implements a reset controller for
> > SoC +peripherals.
> > +
> > +Required Properties:
> > +
> > +- compatible: PMU for CRU should be "rockchip,rk3399-pmucru"
> > +- compatible: CRU should be "rockchip,rk3399-cru"
> > +- reg: physical base address of the controller and length of memory
>
> mapped
>
> > + region.
> > +- #clock-cells: should be 1.
> > +- #reset-cells: should be 1.
> > +
> > +Optional Properties:
> > +
> > +- rockchip,grf: phandle to the syscon managing the "general register
>
> files"
>
> > + If missing, pll rates are not changeable, due to the missing pll lock
> > status. +
>
> the rk3399 doesn't need the GRF, so we should drop this block for now
actually, I just saw that the GRF is needed for the static settings during
init. So the rockchip,grf should stay but also move up to required
properties?
Same for the grf-comment in the examples-section.
Heiko
>
> > +Each clock is assigned an identifier and client nodes can use this
> > identifier +to specify the clock which they consume. All available
> > clocks
> > are defined as +preprocessor macros in the
> > dt-bindings/clock/rk3399-cru.h
> > headers and can be +used in device tree sources. Similar macros exist
> > for
> > the reset sources in +these files.
> > +
> > +External clocks:
> > +
> > +There are several clocks that are generated outside the SoC. It is
>
> expected
>
> > +that they are defined using standard clock bindings with following
> > +clock-output-names:
> > + - "xin24m" - crystal input - required,
> > + - "xin32k" - rtc clock - optional,
> > + - "ext_i2s" - external I2S clock - optional,
> > + - "ext_gmac" - external GMAC clock - optional
> > + - "ext_hsadc" - external HSADC clock - optional,
> > + - "ext_isp" - external ISP clock - optional,
> > + - "ext_jtag" - external JTAG clock - optional
> > + - "ext_vip" - external VIP clock - optional,
> > + - "usbotg_out" - output clock of the pll in the otg phy
>
> external clock listing needs adjusting, something like
>
> - clkin_i2s
> - clkin_gmac
> --> remove ext_hsadc
> - clkin_cif
> --> remove ext_jtag
> --> remove ext_vip
> - clk_usbphy0_480m
> - clk_usbphy0_480m
>
> maybe?
>
> > +
> > +Example: General Register Files
> > +
> > + pmugrf: syscon@ff320000 {
> > + compatible = "rockchip,rk3399-pmugrf", "syscon";
> > + reg = <0x0 0xff320000 0x0 0x1000>;
> > + };
> > +
> > + grf: syscon@ff770000 {
> > + compatible = "rockchip,rk3399-grf", "syscon";
> > + reg = <0x0 0xff770000 0x0 0x10000>;
> > + };
> > +
> > +Example: Clock controller node:
> > +
> > + pmucru: pmu-clock-controller@ff750000 {
> > + compatible = "rockchip,rk3399-pmucru";
> > + reg = <0x0 0xff750000 0x0 0x1000>;
> > + rockchip,grf = <&pmugrf>;
> > + #clock-cells = <1>;
> > + #reset-cells = <1>;
> > + };
> > +
> > + cru: clock-controller@ff760000 {
> > + compatible = "rockchip,rk3399-cru";
> > + reg = <0x0 0xff760000 0x0 0x1000>;
> > + rockchip,grf = <&grf>;
> > + #clock-cells = <1>;
> > + #reset-cells = <1>;
> > + };
>
> also here drop grf nodes and rockchip,grf properties?
>
> > +
> > +Example: UART controller node that consumes the clock generated by the
> > clock + controller:
> > +
> > + uart0: serial@ff1a0000 {
> > + compatible = "rockchip,rk3399-uart", "snps,dw-apb-uart";
> > + reg = <0x0 0xff180000 0x0 0x100>;
> > + clocks = <&cru SCLK_UART0>, <&cru PCLK_UART0>;
> > + clock-names = "baudclk", "apb_pclk";
> > + interrupts = <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>;
> > + reg-shift = <2>;
> > + reg-io-width = <4>;
> > + };
[toc] | [prev] | [next] | [standalone]
| From | Xing Zheng <zhengxing@rock-chips.com> |
|---|---|
| Date | 2016-03-28 05:30 +0200 |
| Subject | Re: [PATCH v5 2/4] dt-bindings: add bindings for rk3399 clock controller |
| Message-ID | <rhw2l-19u-11@gated-at.bofh.it> |
| In reply to | #1365238 |
Hi Heiko, On 2016年03月28日 08:07, Heiko Stuebner wrote: > Hi Xing, > > Am Montag, 28. März 2016, 01:52:12 schrieb Heiko Stübner: >> Am Samstag, 26. März 2016, 14:37:54 schrieb Xing Zheng: >>> Add devicetree bindings for Rockchip cru which found on >>> Rockchip SoCs. >>> >>> Signed-off-by: Xing Zheng<zhengxing@rock-chips.com> >>> Signed-off-by: Jianqun Xu<jay.xu@rock-chips.com> >>> Acked-by: Rob Herring<robh@kernel.org> >>> --- >>> >>> Changes in v5: None >>> Changes in v3: None >>> Changes in v2: None >>> >>> .../bindings/clock/rockchip,rk3399-cru.txt | 83 >>> >>> ++++++++++++++++++++ 1 file changed, 83 insertions(+) >>> >>> create mode 100644 >>> >>> Documentation/devicetree/bindings/clock/rockchip,rk3399-cru.txt >>> >>> diff --git a/Documentation/devicetree/bindings/clock/rockchip,rk3399- >> cru.txt >> >>> b/Documentation/devicetree/bindings/clock/rockchip,rk3399-cru.txt new >>> file mode 100644 >>> index 0000000..9427caa >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/clock/rockchip,rk3399-cru.txt >>> @@ -0,0 +1,83 @@ >>> +* Rockchip RK3399 Clock and Reset Unit >>> + >>> +The RK3399 clock controller generates and supplies clock to various >>> +controllers within the SoC and also implements a reset controller for >>> SoC +peripherals. >>> + >>> +Required Properties: >>> + >>> +- compatible: PMU for CRU should be "rockchip,rk3399-pmucru" >>> +- compatible: CRU should be "rockchip,rk3399-cru" >>> +- reg: physical base address of the controller and length of memory >> mapped >> >>> + region. >>> +- #clock-cells: should be 1. >>> +- #reset-cells: should be 1. >>> + >>> +Optional Properties: >>> + >>> +- rockchip,grf: phandle to the syscon managing the "general register >> files" >> >>> + If missing, pll rates are not changeable, due to the missing pll lock >>> status. + >> the rk3399 doesn't need the GRF, so we should drop this block for now > actually, I just saw that the GRF is needed for the static settings during > init. So the rockchip,grf should stay but also move up to required > properties? > > Same for the grf-comment in the examples-section. > > I check the setting of the pclk_alive and pclk_pmu_src are not gating default on the PMUGRF_SOC_CON0, so I think that we don't need to do the static settings to re-enable them in the clock driver any more. Thanks. -- - Xing Zheng
[toc] | [prev] | [next] | [standalone]
| From | Xing Zheng <zhengxing@rock-chips.com> |
|---|---|
| Date | 2016-03-28 05:00 +0200 |
| Subject | Re: [PATCH v5 2/4] dt-bindings: add bindings for rk3399 clock controller |
| Message-ID | <rhvzk-Gz-9@gated-at.bofh.it> |
| In reply to | #1365237 |
Hi Heiko,
On 2016年03月28日 07:52, Heiko Stübner wrote:
> Hi Xing,
>
> Am Samstag, 26. März 2016, 14:37:54 schrieb Xing Zheng:
>> Add devicetree bindings for Rockchip cru which found on
>> Rockchip SoCs.
>>
>> Signed-off-by: Xing Zheng<zhengxing@rock-chips.com>
>> Signed-off-by: Jianqun Xu<jay.xu@rock-chips.com>
>> Acked-by: Rob Herring<robh@kernel.org>
>> ---
>>
>> Changes in v5: None
>> Changes in v3: None
>> Changes in v2: None
>>
>> .../bindings/clock/rockchip,rk3399-cru.txt | 83
>> ++++++++++++++++++++ 1 file changed, 83 insertions(+)
>> create mode 100644
>> Documentation/devicetree/bindings/clock/rockchip,rk3399-cru.txt
>>
>> diff --git a/Documentation/devicetree/bindings/clock/rockchip,rk3399-
> cru.txt
>> b/Documentation/devicetree/bindings/clock/rockchip,rk3399-cru.txt new file
>> mode 100644
>> index 0000000..9427caa
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/clock/rockchip,rk3399-cru.txt
>> @@ -0,0 +1,83 @@
>> +* Rockchip RK3399 Clock and Reset Unit
>> +
>> +The RK3399 clock controller generates and supplies clock to various
>> +controllers within the SoC and also implements a reset controller for SoC
>> +peripherals.
>> +
>> +Required Properties:
>> +
>> +- compatible: PMU for CRU should be "rockchip,rk3399-pmucru"
>> +- compatible: CRU should be "rockchip,rk3399-cru"
>> +- reg: physical base address of the controller and length of memory
> mapped
>> + region.
>> +- #clock-cells: should be 1.
>> +- #reset-cells: should be 1.
>> +
>> +Optional Properties:
>> +
>> +- rockchip,grf: phandle to the syscon managing the "general register
> files"
>> + If missing, pll rates are not changeable, due to the missing pll lock
>> status. +
> the rk3399 doesn't need the GRF, so we should drop this block for now
>
>> +Each clock is assigned an identifier and client nodes can use this
>> identifier +to specify the clock which they consume. All available clocks
>> are defined as +preprocessor macros in the dt-bindings/clock/rk3399-cru.h
>> headers and can be +used in device tree sources. Similar macros exist for
>> the reset sources in +these files.
>> +
>> +External clocks:
>> +
>> +There are several clocks that are generated outside the SoC. It is
> expected
>> +that they are defined using standard clock bindings with following
>> +clock-output-names:
>> + - "xin24m" - crystal input - required,
>> + - "xin32k" - rtc clock - optional,
>> + - "ext_i2s" - external I2S clock - optional,
>> + - "ext_gmac" - external GMAC clock - optional
>> + - "ext_hsadc" - external HSADC clock - optional,
>> + - "ext_isp" - external ISP clock - optional,
>> + - "ext_jtag" - external JTAG clock - optional
>> + - "ext_vip" - external VIP clock - optional,
>> + - "usbotg_out" - output clock of the pll in the otg phy
> external clock listing needs adjusting, something like
>
> - clkin_i2s
> - clkin_gmac
> --> remove ext_hsadc
> - clkin_cif
> --> remove ext_jtag
> --> remove ext_vip
> - clk_usbphy0_480m
> - clk_usbphy0_480m
>
> maybe?
Thanks, now they like this:
clock-output-names:
- "xin24m" - crystal input - required,
- "xin32k" - rtc clock - optional,
- "clkin_gmac" - external GMAC clock - optional,
- "gmac_phy_rx_clk" - external GMAC RX clock - optional,
- "clkin_i2s" - external I2S clock - optional,
- "pclkin_cif" - external ISP clock - optional,
- "clk_usbphy0_480m" - output clock of the pll in the usbphy0
- "clk_usbphy1_480m" - output clock of the pll in the usbphy1
>
>> +
>> +Example: General Register Files
>> +
>> + pmugrf: syscon@ff320000 {
>> + compatible = "rockchip,rk3399-pmugrf", "syscon";
>> + reg =<0x0 0xff320000 0x0 0x1000>;
>> + };
>> +
>> + grf: syscon@ff770000 {
>> + compatible = "rockchip,rk3399-grf", "syscon";
>> + reg =<0x0 0xff770000 0x0 0x10000>;
>> + };
>> +
>> +Example: Clock controller node:
>> +
>> + pmucru: pmu-clock-controller@ff750000 {
>> + compatible = "rockchip,rk3399-pmucru";
>> + reg =<0x0 0xff750000 0x0 0x1000>;
>> + rockchip,grf =<&pmugrf>;
>> + #clock-cells =<1>;
>> + #reset-cells =<1>;
>> + };
>> +
>> + cru: clock-controller@ff760000 {
>> + compatible = "rockchip,rk3399-cru";
>> + reg =<0x0 0xff760000 0x0 0x1000>;
>> + rockchip,grf =<&grf>;
>> + #clock-cells =<1>;
>> + #reset-cells =<1>;
>> + };
> also here drop grf nodes and rockchip,grf properties?
Done.
>
>
>> +
>> +Example: UART controller node that consumes the clock generated by the
>> clock + controller:
>> +
>> + uart0: serial@ff1a0000 {
>> + compatible = "rockchip,rk3399-uart", "snps,dw-apb-uart";
>> + reg =<0x0 0xff180000 0x0 0x100>;
>> + clocks =<&cru SCLK_UART0>,<&cru PCLK_UART0>;
>> + clock-names = "baudclk", "apb_pclk";
>> + interrupts =<GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>;
>> + reg-shift =<2>;
>> + reg-io-width =<4>;
>> + };
>
>
Thanks.
--
- Xing Zheng
[toc] | [prev] | [next] | [standalone]
| From | Heiko Stuebner <heiko@sntech.de> |
|---|---|
| Date | 2016-03-28 02:20 +0200 |
| Subject | Re: [PATCH v5 4/4] clk: rockchip: add clock controller for the RK3399 |
| Message-ID | <rht4t-7CY-1@gated-at.bofh.it> |
| In reply to | #1364915 |
Hi Xing, Am Samstag, 26. März 2016, 14:37:56 schrieb Xing Zheng: > Add the clock tree definition for the new RK3399 SoC. > > Signed-off-by: Xing Zheng <zhengxing@rock-chips.com> > --- [...] > + /* > + * We use pclkin_cifinv by default GRF_SOC_CON20[9] (GSC20_9) setting in > system, + * so we ignore the mux and make clocks nodes as following, > + * > + * pclkin_cifinv --|-------\ > + * |GSC20_9|-- pclkin_cifmux > + * pclkin_cif --|-------/ > + */ > + GATE(PCLK_ISP1_WRAPPER, "pclkin_isp1_wrapper", "pclkin_cifmux", please name that source clock pclkin_cif as in the TRM. pclkin_cif is the actual input clock - if I'm reading the TRM correctly and the inverter is part of the soc or so? That we currently hide / hardcode the phase-handling should not be part of our outside connection - which should be stable even if we implement this later. Heiko
[toc] | [prev] | [next] | [standalone]
| From | Xing Zheng <zhengxing@rock-chips.com> |
|---|---|
| Date | 2016-03-28 08:20 +0200 |
| Subject | Re: [PATCH v5 4/4] clk: rockchip: add clock controller for the RK3399 |
| Message-ID | <rhyGR-2ZJ-7@gated-at.bofh.it> |
| In reply to | #1365241 |
Hi Heiko, On 2016年03月28日 08:13, Heiko Stuebner wrote: > Hi Xing, > > Am Samstag, 26. März 2016, 14:37:56 schrieb Xing Zheng: >> Add the clock tree definition for the new RK3399 SoC. >> >> Signed-off-by: Xing Zheng<zhengxing@rock-chips.com> >> --- > [...] > >> + /* >> + * We use pclkin_cifinv by default GRF_SOC_CON20[9] (GSC20_9) setting in >> system, + * so we ignore the mux and make clocks nodes as following, >> + * >> + * pclkin_cifinv --|-------\ >> + * |GSC20_9|-- pclkin_cifmux >> + * pclkin_cif --|-------/ >> + */ >> + GATE(PCLK_ISP1_WRAPPER, "pclkin_isp1_wrapper", "pclkin_cifmux", > please name that source clock pclkin_cif as in the TRM. > pclkin_cif is the actual input clock - if I'm reading the TRM correctly and > the inverter is part of the soc or so? > > That we currently hide / hardcode the phase-handling should not be part of > our outside connection - which should be stable even if we implement this > later. > > Yes, I think I will modify them like this: GATE(PCLK_ISP1_WRAPPER, "pclkin_isp1_wrapper", "pclkin_cif", CLK_IGNORE_UNUSED, RK3399_CLKGATE_CON(27), 6, GFLAGS), Thanks. -- - Xing Zheng
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web