From: Tali Perry <tali.perry1@gmail.com> Date: 2018-02-15 13:41:59
Add Nuvoton BMC NPCM7xx clock driver.
Nuvoton BMC NPCM7xx contain integrated clock controller which
generates and supplies clock to all modules within the NPCM7xx BMC
1 ==> 2
This patch includes fix request described here:
https://lkml.org/lkml/2018/2/8/739
(add clock header to patch, fix typos and content in dt-binding txt)
Signed-off-by: Tali Perry <tali.perry1@gmail.com>
Tali Perry (1):
clk: npcm750: update text with fixed clocks
.../bindings/clock/nuvoton,npcm750-clk.txt | 103 +++++++++++++++++++++
include/dt-bindings/clock/nuvoton,npcm7xx-clock.h | 51 ++++++++++
2 files changed, 154 insertions(+)
create mode 100644 Documentation/devicetree/bindings/clock/nuvoton,npcm750-clk.txt
create mode 100644 include/dt-bindings/clock/nuvoton,npcm7xx-clock.h
--
2.14.1
@@ -0,0 +1,103 @@+* Nuvoton NPCM7XX Clock Controller++Nuvoton Poleg BMC NPCM7XX contains an integrated clock controller, which+generates and supplies clocks to all modules within the BMC.++External clocks:++There are six fixed clocks that are generated outside the BMC. All clocks are of+a known fixed value that cannot be changed. clk_refclk, clk_mcbypck and+clk_sysbypck are inputs to the clock controller.+clk_rg1refck, clk_rg2refck and clk_xin are external clocks suppling the+network. They are set on the device tree, but not used by the clock module. The+network devices use them directly.+Example can be found below.++All available clocks are defined as preprocessor macros in:+dt-bindings/clock/nuvoton,npcm7xx-clock.h+and can be reused as DT sources.++Required Properties of clock controller:++Clock controller node requirements:+ - compatible: "nuvoton,npcm750-clk" : for clock controller of Nuvoton+ Poleg BMC NPCM750++ - reg: physical base address of the clock controller and length of+ memory mapped region.++ - #clock-cells: should be 1.++Example: Clock controller node:++ clk: clock-controller@f0801000 {+ compatible = "nuvoton,npcm750-clk";+ #clock-cells = <1>;+ clock-controller;+ reg = <0xf0801000 0x1000>;+ };++Example: Required external clocks for network:++ /* external reference clock */+ clk_refclk: clk-refclk {+ compatible = "fixed-clock";+ #clock-cells = <0>;+ clock-frequency = <25000000>;+ clock-output-names = "refclk";+ };++ /* external reference clock for cpu. float in normal operation */+ clk_sysbypck: clk-sysbypck {+ compatible = "fixed-clock";+ #clock-cells = <0>;+ clock-frequency = <800000000>;+ clock-output-names = "sysbypck";+ };++ /* external reference clock for MC. float in normal operation */+ clk_mcbypck: clk-mcbypck {+ compatible = "fixed-clock";+ #clock-cells = <0>;+ clock-frequency = <800000000>;+ clock-output-names = "mcbypck";+ };++ /* external clock signal rg1refck, supplied by the phy */+ clk_rg1refck: clk-rg1refck {+ compatible = "fixed-clock";+ #clock-cells = <0>;+ clock-frequency = <125000000>;+ clock-output-names = "clk_rg1refck";+ };++ /* external clock signal rg2refck, supplied by the phy */+ clk_rg2refck: clk-rg2refck {+ compatible = "fixed-clock";+ #clock-cells = <0>;+ clock-frequency = <125000000>;+ clock-output-names = "clk_rg2refck";+ };++ clk_xin: clk-xin {+ compatible = "fixed-clock";+ #clock-cells = <0>;+ clock-frequency = <50000000>;+ clock-output-names = "clk_xin";+ };+++Example: GMAC controller node that consumes two clocks: a generated clk by the+clock controller and a fixed clock from DT (clk_rg1refck).++ gmac0: eth@f0802000 {+ device_type = "network";+ compatible = "snps,dwmac";+ reg = <0xf0802000 0x2000>;+ interrupts = <0 14 4>;+ interrupt-names = "macirq";+ ethernet = <0>;+ clocks = <&clk_rg1refck>, <&clk NPCM7XX_CLK_AHB>;+ clock-names = "stmmaceth", "clk_gmac";+ status = "disabled";+ };
--
2.14.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
On Thu, Feb 15, 2018 at 5:39 AM, Tali Perry [off-list ref] wrote:
Signed-off-by: Tali Perry <redacted>
<snip>
I think this should probably be rolled into [PATCH v2 1/1] npcm750: add fixed
clocks (moved from drivers/clk/clk-npcm7xx.c):
https://www.spinics.net/lists/arm-kernel/msg634678.html
Cheers
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
@@ -0,0 +1,103 @@+* Nuvoton NPCM7XX Clock Controller++Nuvoton Poleg BMC NPCM7XX contains an integrated clock controller, which+generates and supplies clocks to all modules within the BMC.++External clocks:++There are six fixed clocks that are generated outside the BMC. All clocks are of+a known fixed value that cannot be changed. clk_refclk, clk_mcbypck and+clk_sysbypck are inputs to the clock controller.+clk_rg1refck, clk_rg2refck and clk_xin are external clocks suppling the+network. They are set on the device tree, but not used by the clock module. The+network devices use them directly.+Example can be found below.++All available clocks are defined as preprocessor macros in:+dt-bindings/clock/nuvoton,npcm7xx-clock.h+and can be reused as DT sources.++Required Properties of clock controller:++Clock controller node requirements:
This line is redundant.
+ - compatible: "nuvoton,npcm750-clk" : for clock controller of Nuvoton
+ Poleg BMC NPCM750
+
+ - reg: physical base address of the clock controller and length of
+ memory mapped region.
+
+ - #clock-cells: should be 1.
+
+Example: Clock controller node:
+
+ clk: clock-controller@f0801000 {
+ compatible = "nuvoton,npcm750-clk";
+ #clock-cells = <1>;
+ clock-controller;
No, binding docs, dts files and driver code should all be separate
patches.
My mistake. This patch has a dt-bindings include file; should the include file
go in here, with the dtsi changes, or in its own separate patch?
It defines the binding, so with the binding documentation.
So two things, first off, the include file I was asking about is not a dtsi, but
a file that defines a bunch of macros for referencing clocks. I don't know if
that makes a difference.
Second, the patch that I referenced above, "[PATCH v2 1/1] npcm750: add fixed
clocks (moved from drivers/clk/clk-npcm7xx.c):
https://www.spinics.net/lists/arm-kernel/msg634678.html", *does* contain a dtsi
and nothing else, and defines these bindings, which is why I thought it went in
with the binding docs.
Cheers