CLK: OMAP conversion to DT
Subsystems (9)
v5 cover CLK: OMAP conversion to DT
Hi,
This set mainly fixes comments received from Nishanth Menon for v4. AM43xx + AM35xx clock data was added as new feature, also OMAP3 platforms use either the old style kernel clock data or DT data, based on boot type.
Testing done:
omap3 beagle : boot, suspend / resume
omap4 panda es: boot, suspend / resume
omap5 sevm: boot
am335x bone: boot
Branch available here:git://gitorious.org/~kristo/omap-pm/omap-pm-work.git
branch: mainline-3.11-rc3-omap-dt-clks-v5
-Tero
PATCH v5 1/31 CLK: clkdev: add support for looking up clocks from DT
clk_get_sys / clk_get can now find clocks from device-tree. If a DT clock is found, an entry is added to the clk_lookup list also for subsequent searches.
--- drivers/clk/clkdev.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+)
drivers/clk/clkdev.c +33 -0
@@ -93,6 +93,18 @@ struct clk *of_clk_get_by_name(struct device_node *np, const char *name)EXPORT_SYMBOL (of_clk_get_by_name);#endif +/** +* clkdev_add_nolock - add lookup entry for a clock +* @cl: pointer to new clock lookup entry +* +* Non-locking version, used internally by clk_find() to add DT based +* clock lookup entries. +*/ +static void clkdev_add_nolock (struct clk_lookup *cl) +{ +list_add_tail (&cl->node, &clocks); +} +/* * Find the correct struct clk for the device and connection ID. * We do slightly fuzzy matching here:
@@ -106,6 +118,9 @@ static struct clk_lookup *clk_find(const char *dev_id, const char *con_id) {struct clk_lookup *p, *cl =NULL ;int match, best_found =0 , best_possible =0 ; +struct device_node *node; +struct clk *clk; +struct of_phandle_args clkspec;if (dev_id) best_possible +=2 ;
@@ -133,6 +148,24 @@ static struct clk_lookup *clk_find(const char *dev_id, const char *con_id)break ; } } + +if (cl) +return cl; + +/* If clock was not found, attempt to look-up from DT */ + node =of_find_node_by_name (NULL , con_id); + + clkspec.np = node; + + clk =of_clk_get_from_provider (&clkspec); + +if (!IS_ERR (clk)) { +/* We found a clock, add node to clkdev */ + cl =clkdev_alloc (clk, con_id, dev_id); +if (cl) +clkdev_add_nolock (cl); + } +return cl; }
Signature · 1 line
1.7.9.5
PATCH v5 1/31 CLK: clkdev: add support for looking up clocks from DT
Hi Tero,
Quoted 44 lines · On Friday 02 of August 2013 19:25:20 Tero Kristo wrote:
clk_get_sys/clk_getcan now find clocks from device-tree. If a DT clock is found, an entry is added to theclk_lookuplist also for subsequent searches.Signed-off-by Tero Kristo <[email protected]>Cc Russell King <[email protected]>--- drivers/clk/clkdev.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+)drivers/clk/clkdev.c +15
-0@@ -93,6 +93,18 @@ struct clk *of_clk_get_by_name(struct device_node *np, const char *name) EXPORT_SYMBOL(of_clk_get_by_name);#endif +/** +* clkdev_add_nolock - add lookup entry for a clock +* @cl: pointer to new clock lookup entry +* +* Non-locking version, used internally by clk_find() to add DT based +* clock lookup entries. +*/ +static void clkdev_add_nolock (struct clk_lookup *cl) +{ +list_add_tail (&cl->node, &clocks); +} +/* * Find the correct struct clk for the device and connection ID. * We do slightly fuzzy matching here: @@ -106,6 +118,9 @@ static struct clk_lookup *clk_find(const char *dev_id, const char *con_id) {struct clk_lookup *p, *cl =NULL ;int match, best_found =0 , best_possible =0 ; +struct device_node *node; +struct clk *clk; +struct of_phandle_args clkspec;if (dev_id) best_possible +=2 ;
drivers/clk/clkdev.c static struct clk_lookup *clk_find(const char · line 156
Quoted 9 lines
drivers/clk/clkdev.c +6
-0@@ -133,6 +148,24 @@ static struct clk_lookup *clk_find(const char *dev_id, const char *con_id) break; } } + +if (cl) +return cl; + +/* If clock was not found, attempt to look-up from DT */ + node =of_find_node_by_name (NULL , con_id);
Why are we introducing the "lookup by name" brokenness to the yet (mostly) sane DT world?
We already have a good way of binding things together in DT, which is using phandles.
Not even saying that this (or something this patch relies on) breaks the ePAPR recommendation about node naming, which states that node names should not be used to convey platform-specific data, but instead should be as generic as possible to show what kind of hardware is represented by the node.
Best regards,
Tomasz
P.S. Added missing DT maintainers to CC.
Quoted 13 lines
drivers/clk/clkdev.c +11
-0+ clkspec.np = node; + + clk =of_clk_get_from_provider (&clkspec); + +if (!IS_ERR (clk)) { +/* We found a clock, add node to clkdev */ + cl =clkdev_alloc (clk, con_id, dev_id); +if (cl) +clkdev_add_nolock (cl); + } +return cl; }
PATCH v5 1/31 CLK: clkdev: add support for looking up clocks from DT
Quoted 9 lines · Tomasz Figa
drivers/clk/clkdev.c static struct clk_lookup *clk_find(const char *dev_id, const char *con_id) · line 156
Quoted 5 lines
drivers/clk/clkdev.c +5
-0+if (cl) +return cl; + +/* If clock was not found, attempt to look-up from DT */ + node =of_find_node_by_name (NULL , con_id);Why are we introducing the "lookup by name" brokenness to the yet (mostly) sane DT world?
Quoted 8 lines
We already have a good way of binding things together in DT, which is using phandles.
Not even saying that this (or something this patch relies on) breaks the ePAPR recommendation about node naming, which states that node names should not be used to convey platform-specific data, but instead should be as generic as possible to show what kind of hardware is represented by the node.
Tell me this: many devices name their clock inputs. You can find these input names in data sheets and the like. These are the names defined by the hardware. What is wrong about using those names in DT?
Remember that the second argument to clk_get() is the _clock_ _input_ _name_ on the _device_ passed in the first argument. It is not *ever* some random name of the clock producer unless someone's fscked up their use of this API (in which case they're the ones with the problem.)
PATCH v5 1/31 CLK: clkdev: add support for looking up clocks from DT
Hi Russell,
Quoted 19 lines · On Saturday 03 of August 2013 19:35:43 Russell King - ARM Linux wrote:
Quoted 9 lines · Tomasz Figa
drivers/clk/clkdev.c static struct clk_lookup *clk_find(const char *dev_id, const char *con_id) · line 156
Quoted 5 lines
drivers/clk/clkdev.c +5
-0+if (cl) +return cl; + +/* If clock was not found, attempt to look-up from DT */ + node =of_find_node_by_name (NULL , con_id);Why are we introducing the "lookup by name" brokenness to the yet (mostly) sane DT world?
Quoted 8 lines
We already have a good way of binding things together in DT, which is using phandles.
Not even saying that this (or something this patch relies on) breaks the ePAPR recommendation about node naming, which states that node names should not be used to convey platform-specific data, but instead should be as generic as possible to show what kind of hardware is represented by the node.
Quoted 3 lines
Tell me this: many devices name their clock inputs. You can find these input names in data sheets and the like. These are the names defined by the hardware. What is wrong about using those names in DT?
Yes, clock inputs. But this is about lookup by clock name, not clock input name, as far as I can tell from the patch, based on looking for a node with given name over the whole DT.
Quoted 4 lines
Remember that the second argument to
clk_get()is the _clock_ _input_ _name_ on the _device_ passed in the first argument. It is not *ever* some random name of the clock producer unless someone's fscked up their use of this API (in which case they're the ones with the problem.)
This is perfectly fine and this is how the generic common clock framework DT bindings work - clock-names property is a list of clock input names and clocks property contain specifiers of respective clocks.
Best regards,
Tomasz
PATCH v5 1/31 CLK: clkdev: add support for looking up clocks from DT
Quoted 22 lines · Tomasz Figa
Hi Russell,
Quoted 19 lines · On Saturday 03 of August 2013 19:35:43 Russell King - ARM Linux wrote:
Quoted 17 lines · Tomasz Figa
drivers/clk/clkdev.c static struct clk_lookup *clk_find(const char *dev_id, const char *con_id) · line 156
Quoted 5 lines
drivers/clk/clkdev.c +5
-0+if (cl) +return cl; + +/* If clock was not found, attempt to look-up from DT */ + node =of_find_node_by_name (NULL , con_id);Why are we introducing the "lookup by name" brokenness to the yet (mostly) sane DT world?
We already have a good way of binding things together in DT, which is using phandles.
Not even saying that this (or something this patch relies on) breaks the ePAPR recommendation about node naming, which states that node names should not be used to convey platform-specific data, but instead should be as generic as possible to show what kind of hardware is represented by the node.
Quoted 7 lines
Quoted 3 lines
Tell me this: many devices name their clock inputs. You can find these input names in data sheets and the like. These are the names defined by the hardware. What is wrong about using those names in DT?
Yes, clock inputs. But this is about lookup by clock name, not clock input name, as far as I can tell from the patch, based on looking for a node with given name over the whole DT.
"con_id" is supposed to be the clock input name when the clock API is used correctly.
Quoted 8 lines
Quoted 4 lines
Remember that the second argument to
clk_get()is the _clock_ _input_ _name_ on the _device_ passed in the first argument. It is not *ever* some random name of the clock producer unless someone's fscked up their use of this API (in which case they're the ones with the problem.)This is perfectly fine and this is how the generic common clock framework DT bindings work - clock-names property is a list of clock input names and clocks property contain specifiers of respective clocks.
There seems to be a some pressure to do clk_get()->of_clk_get() conversions, and also to find ways to lookup clocks. It seems to me that no one understands how DT handles clocks. Maybe that's where the problem is - lack of documentation about how DT clocks are handled.
PATCH v5 1/31 CLK: clkdev: add support for looking up clocks from DT
Quoted 31 lines · On Saturday 03 of August 2013 19:48:05 Russell King - ARM Linux wrote:
Quoted 30 lines · Tomasz Figa
Hi Russell,
Quoted 26 lines · On Saturday 03 of August 2013 19:35:43 Russell King - ARM Linux wrote:
Quoted 13 lines · Tomasz Figa
drivers/clk/clkdev.c static struct clk_lookup *clk_find(const char *dev_id, const char *con_id) · line 156
Quoted 5 lines
drivers/clk/clkdev.c +5
-0+if (cl) +return cl; + +/* If clock was not found, attempt to look-up from DT */ + node =of_find_node_by_name (NULL , con_id);Why are we introducing the "lookup by name" brokenness to the yet (mostly) sane DT world?
We already have a good way of binding things together in DT, which is
using phandles.Quoted 6 lines
Not even saying that this (or something this patch relies on) breaks
the ePAPR recommendation about node naming, which states that node names should not be used to convey platform-specific data, but instead should be as generic as possible to show what kind of hardware is represented by the node.Tell me this: many devices name their clock inputs. You can find these
input names in data sheets and the like. These are the names defined
by the hardware. What is wrong about using those names in DT?
Quoted 6 lines
Quoted 3 lines
Yes, clock inputs. But this is about lookup by clock name, not clock input name, as far as I can tell from the patch, based on looking for a node with given name over the whole DT.
"
con_id" is supposed to be the clock input name when the clock API is used correctly.
Right. Still, the code is looking for a node with the same name as the supposed input name, which seems strange to me, because clock input names are supposed to be defined in consumer's node, inside clock-names property.
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Remember that the second argument to
clk_get()is the _clock_ _input_
_name_ on the _device_ passed in the first argument. It is not *ever*
some random name of the clock producer unless someone's fscked up their
use of this API (in which case they're the ones with the problem.)
Quoted 7 lines
Quoted 4 lines
This is perfectly fine and this is how the generic common clock framework DT bindings work - clock-names property is a list of clock input names and clocks property contain specifiers of respective clocks.
There seems to be a some pressure to do clk_get()->of_clk_get() conversions, and also to find ways to lookup clocks.
I don't really see any need for this kind of conversion. clk_get() already handles lookup using DT correctly and from drivers perspective nothing changes.
Quoted 3 lines
It seems to me
that no one understands how DT handles clocks. Maybe that's where the problem is - lack of documentation about how DT clocks are handled.
Hmm, there is pretty much of description and examples in
Documentation/devicetree/bindings/clock/clock-bindings.txt
For me it was enough to learn how DT based clock lookup works, but I'm quite used to DT, so I'm not a good test sample.
Best regards,
Tomasz
PATCH v5 1/31 CLK: clkdev: add support for looking up clocks from DT
Hey,
(Sorry was out for a short vacation, thus late reply.)
Quoted 70 lines · Tomasz Figa
Quoted 31 lines · On Saturday 03 of August 2013 19:48:05 Russell King - ARM Linux wrote:
Quoted 30 lines · Tomasz Figa
Hi Russell,
Quoted 26 lines · On Saturday 03 of August 2013 19:35:43 Russell King - ARM Linux wrote:
Quoted 13 lines · Tomasz Figa
drivers/clk/clkdev.c static struct clk_lookup *clk_find(const char *dev_id, const char *con_id) · line 156
Quoted 5 lines
drivers/clk/clkdev.c +5
-0+if (cl) +return cl; + +/* If clock was not found, attempt to look-up from DT */ + node =of_find_node_by_name (NULL , con_id);Why are we introducing the "lookup by name" brokenness to the yet (mostly) sane DT world?
We already have a good way of binding things together in DT, which is
using phandles.Quoted 6 lines
Not even saying that this (or something this patch relies on) breaks
the ePAPR recommendation about node naming, which states that node names should not be used to convey platform-specific data, but instead should be as generic as possible to show what kind of hardware is represented by the node.Tell me this: many devices name their clock inputs. You can find these
input names in data sheets and the like. These are the names defined
by the hardware. What is wrong about using those names in DT?Quoted 6 lines
Quoted 3 lines
Yes, clock inputs. But this is about lookup by clock name, not clock input name, as far as I can tell from the patch, based on looking for a node with given name over the whole DT.
"
con_id" is supposed to be the clock input name when the clock API is used correctly.Right. Still, the code is looking for a node with the same name as the supposed input name, which seems strange to me, because clock input names are supposed to be defined in consumer's node, inside clock-names property.
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Remember that the second argument to
clk_get()is the _clock_ _input_
_name_ on the _device_ passed in the first argument. It is not *ever*
some random name of the clock producer unless someone's fscked up their
use of this API (in which case they're the ones with the problem.)Quoted 7 lines
Quoted 4 lines
This is perfectly fine and this is how the generic common clock framework DT bindings work - clock-names property is a list of clock input names and clocks property contain specifiers of respective clocks.
There seems to be a some pressure to do clk_get()->of_clk_get() conversions, and also to find ways to lookup clocks.
I don't really see any need for this kind of conversion.
clk_get()already handles lookup using DT correctly and from drivers perspective nothing changes.Quoted 3 lines
It seems to me
that no one understands how DT handles clocks. Maybe that's where the problem is - lack of documentation about how DT clocks are handled.Hmm, there is pretty much of description and examples in
Quoted 8 lines
Documentation/devicetree/bindings/clock/clock-bindings.txtFor me it was enough to learn how DT based clock lookup works, but I'm quite used to DT, so I'm not a good test sample.
Best regards,
Tomasz
I think based on these comments this patch needs to go away, I will have to find another way to map the devices in and to avoid supporting the legacy mappings (hwmod depends on this heavily atm, but Rajendra posted some patches to address this.) I'll see what I can do for next rev. I might implement some tweak inside the OMAP codebase for this.
-Tero
PATCH v5 1/31 CLK: clkdev: add support for looking up clocks from DT
In reply to Tero Kristodrivers/clk/clkdev.c static struct clk_lookup *clk_find(const char *dev_id, const char *con_id) · line 156
Quoted 6 lines · Tero Kristo
drivers/clk/clkdev.c +6
-0+ +if (cl) +return cl; + +/* If clock was not found, attempt to look-up from DT */ + node =of_find_node_by_name (NULL , con_id);
This is utterly broken if you're looking up purely by a connection ID. Please, go back and read clk_get()'s documentation in linux/clk.h. It's spelt out very plainly there.
NAK.
PATCH v5 1/31 CLK: clkdev: add support for looking up clocks from DT
Quoted 12 lines · Russell King - ARM Linux
drivers/clk/clkdev.c static struct clk_lookup *clk_find(const char *dev_id, const char *con_id) · line 156
Quoted 6 lines · Tero Kristo
drivers/clk/clkdev.c +6
-0+ +if (cl) +return cl; + +/* If clock was not found, attempt to look-up from DT */ + node =of_find_node_by_name (NULL , con_id);This is utterly broken if you're looking up purely by a connection ID. Please, go back and read clk_get()'s documentation in
linux/clk.h. It's spelt out very plainly there.
Quoted 2 lines
NAK.
Hi Russell,
After looking at this a bit more, it seems difficult to get rid of the clk_get -> of_clk_get conversion, however based on this comment I am somewhat stuck. Do you think it would be acceptable if I change the implementation of this patch to work like this:
1) both dev_id + con_id defined:
a) search for device node named dev_id
b) check clock-names for matching con_id
c) return matching clock
Example in kernel:
clocksource-nomadik-mtu.c :
clk_get_sys("mtu0", "apb_pclk");
ste-nomadik-snt8815.dts:
mtu0: mtu at 101e2000 {
/* Nomadik system timer */
compatible = "st,nomadik-mtu";
reg = <0x101e2000 0x1000>;
interrupt-parent = <&vica>;
interrupts = <4>;
clocks = <&timclk>, <&pclk>;
clock-names = "timclk", "apb_pclk";
};2) dev_id = NULL, con_id defined (current patch implementation, most of the OMAP clocks use this approach):
a) search for a device node named con_id
b) return corresponding clock from the node
Alternatively I must implement a regression and break some of the OMAP drivers with this set, and also implement omap internal clk_get functionality (basically adding a similar wrapper that I have implemented in this patch) under mach-omap2 to get some basic OMAP infra to work properly (namely, hwmod.) I can probably avoid part of this by adding more beef to the *.dts files for the critical parts to get boot working at least.
-Tero
PATCH v5 1/31 CLK: clkdev: add support for looking up clocks from DT
Quoted 16 lines · Tero Kristo
Quoted 12 lines · Russell King - ARM Linux
drivers/clk/clkdev.c static struct clk_lookup *clk_find(const char *dev_id, const char *con_id) · line 156
Quoted 6 lines · Tero Kristo
drivers/clk/clkdev.c +6
-0+ +if (cl) +return cl; + +/* If clock was not found, attempt to look-up from DT */ + node =of_find_node_by_name (NULL , con_id);This is utterly broken if you're looking up purely by a connection ID. Please, go back and read clk_get()'s documentation in
linux/clk.h. It's spelt out very plainly there.Quoted 2 lines
NAK.
Quoted 6 lines
Hi Russell,
After looking at this a bit more, it seems difficult to get rid of the
clk_get->of_clk_getconversion, however based on this comment I am somewhat stuck. Do you think it would be acceptable if I change the implementation of this patch to work like this:
Firstly, for clk_get(), you don't need to do anything - clk_get() already deals with DT, and if your DT is correct, it should already be returning the appropriate clock(s).
I guess the problem here is clk_get_sys(), because that doesn't take a struct device (and it doesn't take a struct device because it's used from code where there is no struct device to use with it.)
If you have an OF node, what's wrong with using of_clk_get_by_name()? If you don't have an OF node, how do you expect to find the clock in the device tree, remembering that clocks are specific to devices, and the 2nd argument to clk_get()/clk_get_sys() is not a unique identifier.
PATCH v5 1/31 CLK: clkdev: add support for looking up clocks from DT
Quoted 24 lines · Russell King - ARM Linux
Quoted 16 lines · Tero Kristo
Quoted 12 lines · Russell King - ARM Linux
drivers/clk/clkdev.c static struct clk_lookup *clk_find(const char *dev_id, const char *con_id) · line 156
Quoted 6 lines · Tero Kristo
drivers/clk/clkdev.c +6
-0+ +if (cl) +return cl; + +/* If clock was not found, attempt to look-up from DT */ + node =of_find_node_by_name (NULL , con_id);This is utterly broken if you're looking up purely by a connection ID. Please, go back and read clk_get()'s documentation in
linux/clk.h. It's spelt out very plainly there.Quoted 2 lines
NAK.
Quoted 6 lines
Hi Russell,
After looking at this a bit more, it seems difficult to get rid of the
clk_get->of_clk_getconversion, however based on this comment I am somewhat stuck. Do you think it would be acceptable if I change the implementation of this patch to work like this:
Quoted 7 lines
Firstly, for
clk_get(), you don't need to do anything -clk_get()already deals with DT, and if your DT is correct, it should already be returning the appropriate clock(s).I guess the problem here is
clk_get_sys(), because that doesn't take a struct device (and it doesn't take a struct device because it's used from code where there is no struct device to use with it.)
Yeah, most of the OMAP clocks have been traditionally referenced in this way, they are using clk_get_sys and with dev=NULL. conn-id is mostly unique.
Quoted 5 lines
If you have an OF node, what's wrong with using
of_clk_get_by_name()? If you don't have an OF node, how do you expect to find the clock in the device tree, remembering that clocks are specific to devices, and the 2nd argument to clk_get()/clk_get_sys() is not a unique identifier.
In the legacy code, pretty much all the clocks are mapped through clk_get_sys(NULL, conn), and large amount of the drivers don't even have DT conversion in place yet. I am attempting to handle the cases where we don't have OF nodes.... yet at least, without converting everything to DT, and without causing regressions (also, I don't even pretend to be capable of testing all the potential drivers for this.) Some parts of the basic infra which are using clk_get_sys are pretty silly also, like the ocp_if parts of the hwmod, I haven't figured out yet how to convert that to DT.
Personally I don't mind causing a regressions here though, if I get approval for it from Tony.
-Tero
Tony Lindgren
maintainerPATCH v5 1/31 CLK: clkdev: add support for looking up clocks from DT
Quoted 53 lines · Tero Kristo
Quoted 24 lines · Russell King - ARM Linux
Quoted 16 lines · Tero Kristo
Quoted 12 lines · Russell King - ARM Linux
drivers/clk/clkdev.c static struct clk_lookup *clk_find(const char *dev_id, const char *con_id) · line 156
Quoted 6 lines · Tero Kristo
drivers/clk/clkdev.c +6
-0+ +if (cl) +return cl; + +/* If clock was not found, attempt to look-up from DT */ + node =of_find_node_by_name (NULL , con_id);This is utterly broken if you're looking up purely by a connection ID. Please, go back and read clk_get()'s documentation in
linux/clk.h. It's spelt out very plainly there.Quoted 2 lines
NAK.
Quoted 6 lines
Hi Russell,
After looking at this a bit more, it seems difficult to get rid of the
clk_get->of_clk_getconversion, however based on this comment I am somewhat stuck. Do you think it would be acceptable if I change the implementation of this patch to work like this:Quoted 7 lines
Firstly, for
clk_get(), you don't need to do anything -clk_get()already deals with DT, and if your DT is correct, it should already be returning the appropriate clock(s).I guess the problem here is
clk_get_sys(), because that doesn't take a struct device (and it doesn't take a struct device because it's used from code where there is no struct device to use with it.)Yeah, most of the OMAP clocks have been traditionally referenced in this way, they are using
clk_get_sysand with dev=NULL. conn-id is mostly unique.Quoted 5 lines
If you have an OF node, what's wrong with using
of_clk_get_by_name()? If you don't have an OF node, how do you expect to find the clock in the device tree, remembering that clocks are specific to devices, and the 2nd argument to clk_get()/clk_get_sys() is not a unique identifier.In the legacy code, pretty much all the clocks are mapped through
clk_get_sys(NULL, conn), and large amount of the drivers don't even have DT conversion in place yet. I am attempting to handle the cases where we don't have OF nodes.... yet at least, without converting everything to DT, and without causing regressions (also, I don't even pretend to be capable of testing all the potential drivers for this.) Some parts of the basic infra which are usingclk_get_sysare pretty silly also, like theocp_ifparts of the hwmod, I haven't figured out yet how to convert that to DT.
Quoted 2 lines
Personally I don't mind causing a regressions here though, if I get approval for it from Tony.
No, let's not do that. We don't want to break existing drivers.
How about initialize the platform driver clocks in the clock driver and set up the clock alias? Then when the driver is fixed for DT, those can be dropped one at a time.
Regards,
Tony
PATCH v5 2/31 CLK: TI: Add DPLL clock support
In reply to Tero KristoThe OMAP clock driver now supports DPLL clock type. This patch also adds support for DT DPLL nodes.
--- .../devicetree/bindings/clock/ti/dpll.txt | 70 +++ arch/arm/mach-omap2/clock.h | 144 +----- arch/arm/mach-omap2/clock3xxx.h | 2 - drivers/clk/Makefile | 1 + drivers/clk/ti/Makefile | 3 + drivers/clk/ti/dpll.c | 488 ++++++++++++++++++++ include/linux/clk/ti.h | 164 +++++++ 7 files changed, 727 insertions(+), 145 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/ti/dpll.txt create mode 100644 drivers/clk/ti/Makefile create mode 100644 drivers/clk/ti/dpll.c create mode 100644 include/linux/clk/ti.h
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +70 -0
@@ -0,0 +1,70 @@ +Binding for Texas Instruments DPLL clock. + +This binding uses the common clock binding[1]. It assumes a +register-mapped DPLL with usually two selectable input clocks +(reference clock and bypass clock), with digital phase locked +loop logic for multiplying the input clock to a desired output +clock. This clock also typically supports different operation +modes (locked, low power stop etc.) This binding has several +sub-types, which effectively result in slightly different setup +for the actual DPLL clock. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt + +Required properties: +- compatible : shall be one of: + "ti,omap4-dpll-x2-clock", + "ti,omap3-dpll-clock", + "ti,omap3-dpll-core-clock", + "ti,omap3-dpll-per-clock", + "ti,omap3-dpll-per-j-type-clock", + "ti,omap4-dpll-clock", + "ti,omap4-dpll-core-clock", + "ti,omap4-dpll-m4xen-clock", + "ti,omap4-dpll-j-type-clock", + "ti,omap4-dpll-no-gate-clock", + "ti,omap4-dpll-no-gate-j-type-clock", + +- #clock-cells : from common clock binding; shall be set to 0. +- clocks : link phandles of parent clocks (clk-ref and clk-bypass) +- reg : array of register base addresses for controlling the DPLL (some + of these can also be left as NULL): + reg[0] = control register + reg[1] = idle status register + reg[2] = autoidle register + reg[3] = multiplier / divider set register +- ti,clk-ref : link phandle for the reference clock +- ti,clk-bypass : link phandle for the bypass clock + +Optional properties: +- ti,modes : available modes for the DPLL +- ti,recal-en-bit : recalibration enable bit +- ti,recal-st-bit : recalibration status bit +- ti,auto-recal-bit : auto recalibration enable bit +- ti,clkdm-name : clockdomain name for the DPLL + +Examples: + dpll_core_ck: dpll_core_ck at 44e00490 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-core-clock"; + clocks = <&sys_clkin_ck>; + reg = <0x44e00490 0x4>, <0x44e0045c 0x4>, <0x0 0x4>, + <0x44e00468 0x4>; + ti,clk-ref = <&sys_clkin_ck>; + ti,clk-bypass = <&sys_clkin_ck>; + }; + + dpll2_ck: dpll2_ck at 48004004 { + #clock-cells = <0>; + compatible = "ti,omap3-dpll-clock"; + clocks = <&sys_ck>; + ti,modes = <0xa2>; + ti,clk-bypass = <&dpll2_fck>; + reg = <0x48004004 0x4>, <0x48004024 0x4>, <0x48004034 0x4>, + <0x48004040 0x4>; + ti,clkdm-name = "dpll2_clkdm"; + ti,clk-ref = <&sys_ck>; + ti,recal-en-bit = <0x8>; + ti,auto-recal-bit = <0x3>; + ti,recal-st-bit = <0x8>; + };
arch/arm/mach-omap2/clock.h +1 -143
195 lines not on this page · raw message
arch/arm/mach-omap2/clock3xxx.h +0 -2
@@ -9,8 +9,6 @@#define __ARCH_ARM_MACH_OMAP2_CLOCK3XXX_Hint omap3xxx_clk_init (void ); -int omap3_dpll4_set_rate (struct clk_hw *clk,unsigned long rate, -unsigned long parent_rate);int omap3_core_dpll_m2_set_rate (struct clk_hw *clk,unsigned long rate,unsigned long parent_rate);void omap3_clk_lock_dpll5 (void );
drivers/clk/Makefile +1 -0
@@ -32,6 +32,7 @@ obj-$(CONFIG_ARCH_VT8500) += clk-vt8500.o obj-$(CONFIG_ARCH_ZYNQ) += zynq/ obj-$(CONFIG_ARCH_TEGRA) += tegra/ obj-$(CONFIG_PLAT_SAMSUNG) += samsung/ +obj-$(CONFIG_ARCH_OMAP) += ti/ obj-$(CONFIG_X86) += x86/
drivers/clk/ti/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +ifneq ($(CONFIG_OF),) +obj-y += dpll.o +endif
drivers/clk/ti/dpll.c new file +488 -0
488 lines not on this page · raw message
include/linux/clk/ti.h new file +164 -0
164 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v5 2/31 CLK: TI: Add DPLL clock support
Hi,
Quoted 43 lines · Tero Kristo
The OMAP clock driver now supports DPLL clock type. This patch also adds support for DT DPLL nodes.
Signed-off-by Tero Kristo <[email protected]>--- .../devicetree/bindings/clock/ti/dpll.txt | 70 +++ arch/arm/mach-omap2/clock.h | 144 +----- arch/arm/mach-omap2/clock3xxx.h | 2 - drivers/clk/Makefile | 1 + drivers/clk/ti/Makefile | 3 + drivers/clk/ti/dpll.c | 488 ++++++++++++++++++++ include/linux/clk/ti.h | 164 +++++++ 7 files changed, 727 insertions(+), 145 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/ti/dpll.txt create mode 100644 drivers/clk/ti/Makefile create mode 100644 drivers/clk/ti/dpll.c create mode 100644 include/linux/clk/ti.hDocumentation/devicetree/bindings/clock/ti/dpll.txt new file +19
-0@@ -0,0 +1,70 @@ +Binding for Texas Instruments DPLL clock. + +This binding uses the common clock binding[1]. It assumes a +register-mapped DPLL with usually two selectable input clocks +(reference clock and bypass clock), with digital phase locked +loop logic for multiplying the input clock to a desired output +clock. This clock also typically supports different operation +modes (locked, low power stop etc.) This binding has several +sub-types, which effectively result in slightly different setup +for the actual DPLL clock. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt + +Required properties: +- compatible : shall be one of: + "ti,omap4-dpll-x2-clock", + "ti,omap3-dpll-clock", + "ti,omap3-dpll-core-clock", + "ti,omap3-dpll-per-clock",
Documentation/devicetree/bindings/clock/ti/dpll.txt line 29
Quoted 10 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +10
-0+ "ti,omap3-dpll-per-j-type-clock", + "ti,omap4-dpll-clock", + "ti,omap4-dpll-core-clock", + "ti,omap4-dpll-m4xen-clock", + "ti,omap4-dpll-j-type-clock", + "ti,omap4-dpll-no-gate-clock", + "ti,omap4-dpll-no-gate-j-type-clock", + +- #clock-cells : from common clock binding; shall be set to 0. +- clocks : link phandles of parent clocks (clk-ref and clk-bypass)
It might be a good idea to use clock-names to clarify which clocks are present (I notice your examples contain only one clock input).
Documentation/devicetree/bindings/clock/ti/dpll.txt line 35
Quoted 6 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +6
-0+- reg : array of register base addresses for controlling the DPLL (some + of these can also be left as NULL): + reg[0] = control register + reg[1] = idle status register + reg[2] = autoidle register + reg[3] = multiplier / divider set register
Are all of these always present? Using reg-names seems sensible here.
Documentation/devicetree/bindings/clock/ti/dpll.txt line 37
Quoted 2 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +2
-0+- ti,clk-ref : link phandle for the reference clock +- ti,clk-bypass : link phandle for the bypass clock
You already have these in clocks, why do you need them again here?
Documentation/devicetree/bindings/clock/ti/dpll.txt line 40
Quoted 3 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +3
-0+ +Optional properties: +- ti,modes : available modes for the DPLL
Huh? What type is that property? What does it mean?
Documentation/devicetree/bindings/clock/ti/dpll.txt line 43
Quoted 3 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +3
-0+- ti,recal-en-bit : recalibration enable bit +- ti,recal-st-bit : recalibration status bit +- ti,auto-recal-bit : auto recalibration enable bit
These seem rather low-level, but I see other clock bindings are doing similar things. When are these needed, and why? What type are they?
Documentation/devicetree/bindings/clock/ti/dpll.txt line 44
Quoted 1 line
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +1
-0+- ti,clkdm-name : clockdomain name for the DPLL
Could you elaborate on what this is for? What constitutes a valid name?
I'm not sure a string is the best way to define the linkage of several elements to a domain...
Documentation/devicetree/bindings/clock/ti/dpll.txt line 54
Quoted 10 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +10
-0+ +Examples: + dpll_core_ck: dpll_core_ck at 44e00490 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-core-clock"; + clocks = <&sys_clkin_ck>; + reg = <0x44e00490 0x4>, <0x44e0045c 0x4>, <0x0 0x4>, + <0x44e00468 0x4>; + ti,clk-ref = <&sys_clkin_ck>; + ti,clk-bypass = <&sys_clkin_ck>;
Huh? Why aren't these both in the clocks property?
[...]
Documentation/devicetree/bindings/clock/ti/dpll.txt line 64
Quoted 10 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +10
-0+static inline void __iomem *get_dt_register(struct device_node *node, + int index) +{ + u32 val; + + of_property_read_u32_index(node, "reg", 2 * index, &val); + if (val) + return of_iomap(node, index); + else + return NULL;
NAK. Use reg-names to handle registers being optional.
[...]
Quoted 5 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +5
-0+ clkspec.np = of_parse_phandle(node, "ti,clk-ref", 0); + dd->clk_ref = of_clk_get_from_provider(&clkspec); + if (IS_ERR(dd->clk_ref)) { + pr_err("%s: ti,clk-ref for %s not found\n", __func__, + clk_name);
Documentation/devicetree/bindings/clock/ti/dpll.txt
Quoted 10 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +10
-0+ goto cleanup; + } + + clkspec.np = of_parse_phandle(node, "ti,clk-bypass", 0); + dd->clk_bypass = of_clk_get_from_provider(&clkspec); + if (IS_ERR(dd->clk_bypass)) { + pr_err("%s: ti,clk-bypass for %s not found\n", __func__, + clk_name); + goto cleanup; + }
You can get these from the standard clocks property. Don't do this.
Look at of_clk_get_by_name().
Thanks,
Mark.
PATCH v5 2/31 CLK: TI: Add DPLL clock support
Quoted 51 lines · Mark Rutland
Hi,
Quoted 48 lines · Tero Kristo
The OMAP clock driver now supports DPLL clock type. This patch also adds support for DT DPLL nodes.
Signed-off-by Tero Kristo <[email protected]>--- .../devicetree/bindings/clock/ti/dpll.txt | 70 +++ arch/arm/mach-omap2/clock.h | 144 +----- arch/arm/mach-omap2/clock3xxx.h | 2 - drivers/clk/Makefile | 1 + drivers/clk/ti/Makefile | 3 + drivers/clk/ti/dpll.c | 488 ++++++++++++++++++++ include/linux/clk/ti.h | 164 +++++++ 7 files changed, 727 insertions(+), 145 deletions(-)create mode 100644
Documentation/devicetree/bindings/clock/ti/dpll.txtcreate mode 100644drivers/clk/ti/Makefile
create mode 100644drivers/clk/ti/dpll.c
create mode 100644include/linux/clk/ti.hDocumentation/devicetree/bindings/clock/ti/dpll.txt new file +24
-0@@ -0,0 +1,70 @@ +Binding for Texas Instruments DPLL clock. + +This binding uses the common clock binding[1]. It assumes a +register-mapped DPLL with usually two selectable input clocks +(reference clock and bypass clock), with digital phase locked +loop logic for multiplying the input clock to a desired output +clock. This clock also typically supports different operation +modes (locked, low power stop etc.) This binding has several +sub-types, which effectively result in slightly different setup +for the actual DPLL clock. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt + +Required properties: +- compatible : shall be one of: + "ti,omap4-dpll-x2-clock", + "ti,omap3-dpll-clock", + "ti,omap3-dpll-core-clock", + "ti,omap3-dpll-per-clock", + "ti,omap3-dpll-per-j-type-clock", + "ti,omap4-dpll-clock", + "ti,omap4-dpll-core-clock", + "ti,omap4-dpll-m4xen-clock", + "ti,omap4-dpll-j-type-clock",
Quoted 8 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt line 29
Quoted 5 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +5
-0+ "ti,omap4-dpll-no-gate-clock", + "ti,omap4-dpll-no-gate-j-type-clock", + +- #clock-cells : from common clock binding; shall be set to 0. +- clocks : link phandles of parent clocks (clk-ref and clk-bypass)It might be a good idea to use clock-names to clarify which clocks are present (I notice your examples contain only one clock input).
All DPLLs have both bypass and reference clocks, but these can be the same. Is it better to just list both always (and hence drop clock-names), or provide clock-names always?
Quoted 9 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt line 35
Quoted 7 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +6
-0+- reg : array of register base addresses for controlling the DPLL (some + of these can also be left as NULL): + reg[0] = control register + reg[1] = idle status register + reg[2] = autoidle register + reg[3] = multiplier / divider set registerAre all of these always present? Using reg-names seems sensible here.
Not always, I'll change the code. I am quite new to DT and didn't actually know of the existence of reg-names prop.
Quoted 5 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt line 37
Quoted 3 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +2
-0+- ti,clk-ref : link phandle for the reference clock +- ti,clk-bypass : link phandle for the bypass clockYou already have these in clocks, why do you need them again here?
Yea good point. Will fix based on the above.
Quoted 6 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt line 40
Quoted 4 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +3
-0+ +Optional properties: +- ti,modes : available modes for the DPLLHuh? What type is that property? What does it mean?
Will add some documentation to this.
Quoted 7 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt line 43
Quoted 4 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +3
-0+- ti,recal-en-bit : recalibration enable bit +- ti,recal-st-bit : recalibration status bit +- ti,auto-recal-bit : auto recalibration enable bitThese seem rather low-level, but I see other clock bindings are doing similar things. When are these needed, and why? What type are they?
Bit shift values for the auto recalibration feature. HOWEVER, it seems these are actually legacy, kernel does not have support for these anymore if it ever had.... I think I can just drop these for now as they are unused by the support code even.
Quoted 7 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt line 44
Quoted 2 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +1
-0+- ti,clkdm-name : clockdomain name for the DPLLCould you elaborate on what this is for? What constitutes a valid name?
I'm not sure a string is the best way to define the linkage of several elements to a domain...
Well, I am not sure if we can do this any better at this point, we don't have DT nodes for clockdomain at the moment (I am not sure if we will have those either as there are only a handful of those per SoC) but I'll add some more documentation for this.
Quoted 13 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt line 54
Quoted 11 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +10
-0+ +Examples: + dpll_core_ck: dpll_core_ck at 44e00490 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-core-clock"; + clocks = <&sys_clkin_ck>; + reg = <0x44e00490 0x4>, <0x44e0045c 0x4>, <0x0 0x4>, + <0x44e00468 0x4>; + ti,clk-ref = <&sys_clkin_ck>; + ti,clk-bypass = <&sys_clkin_ck>;Huh? Why aren't these both in the clocks property?
Will fix based on comments above.
Quoted 15 lines
[...]
Documentation/devicetree/bindings/clock/ti/dpll.txt
Quoted 10 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +10
-0+static inline void __iomem *get_dt_register(struct device_node *node, + int index) +{ + u32 val; + + of_property_read_u32_index(node, "reg", 2 * index, &val); + if (val) + return of_iomap(node, index); + else + return NULL;NAK. Use reg-names to handle registers being optional.
Yea will change this.
Quoted 19 lines
[...]
Quoted 5 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +5
-0+ clkspec.np = of_parse_phandle(node, "ti,clk-ref", 0); + dd->clk_ref = of_clk_get_from_provider(&clkspec); + if (IS_ERR(dd->clk_ref)) { + pr_err("%s: ti,clk-ref for %s not found\n", __func__, + clk_name);Documentation/devicetree/bindings/clock/ti/dpll.txt
Quoted 10 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +10
-0+ goto cleanup; + } + + clkspec.np = of_parse_phandle(node, "ti,clk-bypass", 0); + dd->clk_bypass = of_clk_get_from_provider(&clkspec); + if (IS_ERR(dd->clk_bypass)) { + pr_err("%s: ti,clk-bypass for %s not found\n", __func__, + clk_name); + goto cleanup; + }
Quoted 3 lines
You can get these from the standard clocks property. Don't do this.
Look at
of_clk_get_by_name().
Or of_clk_get(node, index), which would be better?
-Tero
Quoted 4 lines
Thanks,
Mark.
PATCH v5 2/31 CLK: TI: Add DPLL clock support
Quoted 61 lines · Tero Kristo
Quoted 51 lines · Mark Rutland
Hi,
Quoted 48 lines · Tero Kristo
The OMAP clock driver now supports DPLL clock type. This patch also adds support for DT DPLL nodes.
Signed-off-by Tero Kristo <[email protected]>--- .../devicetree/bindings/clock/ti/dpll.txt | 70 +++ arch/arm/mach-omap2/clock.h | 144 +----- arch/arm/mach-omap2/clock3xxx.h | 2 - drivers/clk/Makefile | 1 + drivers/clk/ti/Makefile | 3 + drivers/clk/ti/dpll.c | 488 ++++++++++++++++++++ include/linux/clk/ti.h | 164 +++++++ 7 files changed, 727 insertions(+), 145 deletions(-)create mode 100644
Documentation/devicetree/bindings/clock/ti/dpll.txtcreate mode 100644drivers/clk/ti/Makefile
create mode 100644drivers/clk/ti/dpll.c
create mode 100644include/linux/clk/ti.hDocumentation/devicetree/bindings/clock/ti/dpll.txt new file +24
-0@@ -0,0 +1,70 @@ +Binding for Texas Instruments DPLL clock. + +This binding uses the common clock binding[1]. It assumes a +register-mapped DPLL with usually two selectable input clocks +(reference clock and bypass clock), with digital phase locked +loop logic for multiplying the input clock to a desired output +clock. This clock also typically supports different operation +modes (locked, low power stop etc.) This binding has several +sub-types, which effectively result in slightly different setup +for the actual DPLL clock. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt + +Required properties: +- compatible : shall be one of: + "ti,omap4-dpll-x2-clock", + "ti,omap3-dpll-clock", + "ti,omap3-dpll-core-clock", + "ti,omap3-dpll-per-clock", + "ti,omap3-dpll-per-j-type-clock", + "ti,omap4-dpll-clock", + "ti,omap4-dpll-core-clock", + "ti,omap4-dpll-m4xen-clock", + "ti,omap4-dpll-j-type-clock",Quoted 8 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt line 29
Quoted 5 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +5
-0+ "ti,omap4-dpll-no-gate-clock", + "ti,omap4-dpll-no-gate-j-type-clock", + +- #clock-cells : from common clock binding; shall be set to 0. +- clocks : link phandles of parent clocks (clk-ref and clk-bypass)It might be a good idea to use clock-names to clarify which clocks are present (I notice your examples contain only one clock input).
Quoted 3 lines
All DPLLs have both bypass and reference clocks, but these can be the same. Is it better to just list both always (and hence drop clock-names), or provide clock-names always?
If they're separate inputs, it's worth listing both (even if they're fed by the same provider). If it's possible one input might not be wired up, use clock-names.
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +6
-0+- reg : array of register base addresses for controlling the DPLL (some + of these can also be left as NULL): + reg[0] = control register + reg[1] = idle status register + reg[2] = autoidle register + reg[3] = multiplier / divider set register
Quoted 4 lines
Quoted 1 line
Are all of these always present? Using reg-names seems sensible here.
Not always, I'll change the code. I am quite new to DT and didn't actually know of the existence of reg-names prop.
Ok. :)
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +3
-0+- ti,recal-en-bit : recalibration enable bit +- ti,recal-st-bit : recalibration status bit +- ti,auto-recal-bit : auto recalibration enable bit
Quoted 7 lines
Quoted 2 lines
These seem rather low-level, but I see other clock bindings are doing similar things. When are these needed, and why? What type are they?
Bit shift values for the auto recalibration feature. HOWEVER, it seems these are actually legacy, kernel does not have support for these anymore if it ever had.... I think I can just drop these for now as they are unused by the support code even.
Ok.
Quoted 6 lines
Quoted 6 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt line 44
Quoted 3 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +1
-0+- ti,clkdm-name : clockdomain name for the DPLLCould you elaborate on what this is for? What constitutes a valid name?
Quoted 7 lines
Quoted 2 lines
I'm not sure a string is the best way to define the linkage of several elements to a domain...
Well, I am not sure if we can do this any better at this point, we don't have DT nodes for clockdomain at the moment (I am not sure if we will have those either as there are only a handful of those per SoC) but I'll add some more documentation for this.
I'll have to see the documentation, but I'd be very wary of putting that in as-is. Does having the clock domain string link this up to domains in platform data?
I'm not sure how well we'll be able to maintain support for that in future if it requires other platform code to use now, and we're not sure how the domains themselves will be represented in dt.
Quoted 16 lines
Quoted 15 lines
[...]
Documentation/devicetree/bindings/clock/ti/dpll.txt
Quoted 10 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +10
-0+static inline void __iomem *get_dt_register(struct device_node *node, + int index) +{ + u32 val; + + of_property_read_u32_index(node, "reg", 2 * index, &val); + if (val) + return of_iomap(node, index); + else + return NULL;NAK. Use reg-names to handle registers being optional.
Quoted 1 line
Yea will change this.
Cheers.
Quoted 20 lines
Quoted 20 lines
[...]
Quoted 15 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +15
-0+ clkspec.np = of_parse_phandle(node, "ti,clk-ref", 0); + dd->clk_ref = of_clk_get_from_provider(&clkspec); + if (IS_ERR(dd->clk_ref)) { + pr_err("%s: ti,clk-ref for %s not found\n", __func__, + clk_name); + goto cleanup; + } + + clkspec.np = of_parse_phandle(node, "ti,clk-bypass", 0); + dd->clk_bypass = of_clk_get_from_provider(&clkspec); + if (IS_ERR(dd->clk_bypass)) { + pr_err("%s: ti,clk-bypass for %s not found\n", __func__, + clk_name); + goto cleanup; + }
Quoted 5 lines
Quoted 3 lines
You can get these from the standard clocks property. Don't do this.
Look at
of_clk_get_by_name().Or
of_clk_get(node, index), which would be better?
If you know you always have both clocks, then yes.
Cheers,
Mark.
PATCH v5 2/31 CLK: TI: Add DPLL clock support
Quoted 62 lines · Mark Rutland
Quoted 61 lines · Tero Kristo
Quoted 59 lines · Mark Rutland
Hi,
Quoted 43 lines · Tero Kristo
The OMAP clock driver now supports DPLL clock type. This patch also adds support for DT DPLL nodes.
Signed-off-by Tero Kristo <[email protected]>--- .../devicetree/bindings/clock/ti/dpll.txt | 70 +++ arch/arm/mach-omap2/clock.h | 144 +----- arch/arm/mach-omap2/clock3xxx.h | 2 - drivers/clk/Makefile | 1 + drivers/clk/ti/Makefile | 3 + drivers/clk/ti/dpll.c | 488 ++++++++++++++++++++ include/linux/clk/ti.h | 164 +++++++ 7 files changed, 727 insertions(+), 145 deletions(-)create mode 100644
Documentation/devicetree/bindings/clock/ti/dpll.txtcreate mode 100644drivers/clk/ti/Makefile
create mode 100644drivers/clk/ti/dpll.c
create mode 100644include/linux/clk/ti.hDocumentation/devicetree/bindings/clock/ti/dpll.txt new file +19
-0@@ -0,0 +1,70 @@ +Binding for Texas Instruments DPLL clock. + +This binding uses the common clock binding[1]. It assumes a +register-mapped DPLL with usually two selectable input clocks +(reference clock and bypass clock), with digital phase locked +loop logic for multiplying the input clock to a desired output +clock. This clock also typically supports different operation +modes (locked, low power stop etc.) This binding has several +sub-types, which effectively result in slightly different setup +for the actual DPLL clock. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt + +Required properties: +- compatible : shall be one of: + "ti,omap4-dpll-x2-clock", + "ti,omap3-dpll-clock", + "ti,omap3-dpll-core-clock", + "ti,omap3-dpll-per-clock",Documentation/devicetree/bindings/clock/ti/dpll.txt line 29
Quoted 10 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +10
-0+ "ti,omap3-dpll-per-j-type-clock", + "ti,omap4-dpll-clock", + "ti,omap4-dpll-core-clock", + "ti,omap4-dpll-m4xen-clock", + "ti,omap4-dpll-j-type-clock", + "ti,omap4-dpll-no-gate-clock", + "ti,omap4-dpll-no-gate-j-type-clock", + +- #clock-cells : from common clock binding; shall be set to 0. +- clocks : link phandles of parent clocks (clk-ref and clk-bypass)It might be a good idea to use clock-names to clarify which clocks are present (I notice your examples contain only one clock input).
Quoted 7 lines
Quoted 3 lines
All DPLLs have both bypass and reference clocks, but these can be the same. Is it better to just list both always (and hence drop clock-names), or provide clock-names always?
If they're separate inputs, it's worth listing both (even if they're fed by the same provider). If it's possible one input might not be wired up, use clock-names.
Ref and bypass clocks are used currently by all DPLLs (also the APLL) so I guess I just enforce both to be specified.
Quoted 46 lines
Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +6
-0+- reg : array of register base addresses for controlling the DPLL (some + of these can also be left as NULL): + reg[0] = control register + reg[1] = idle status register + reg[2] = autoidle register + reg[3] = multiplier / divider set registerQuoted 4 lines
Quoted 1 line
Are all of these always present? Using reg-names seems sensible here.
Not always, I'll change the code. I am quite new to DT and didn't actually know of the existence of reg-names prop.
Ok. :)
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +3
-0+- ti,recal-en-bit : recalibration enable bit +- ti,recal-st-bit : recalibration status bit +- ti,auto-recal-bit : auto recalibration enable bitQuoted 7 lines
Quoted 2 lines
These seem rather low-level, but I see other clock bindings are doing similar things. When are these needed, and why? What type are they?
Bit shift values for the auto recalibration feature. HOWEVER, it seems these are actually legacy, kernel does not have support for these anymore if it ever had.... I think I can just drop these for now as they are unused by the support code even.
Ok.
Quoted 6 lines
Quoted 6 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt line 44
Quoted 3 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +1
-0+- ti,clkdm-name : clockdomain name for the DPLLCould you elaborate on what this is for? What constitutes a valid name?
Quoted 7 lines
Quoted 2 lines
I'm not sure a string is the best way to define the linkage of several elements to a domain...
Well, I am not sure if we can do this any better at this point, we don't have DT nodes for clockdomain at the moment (I am not sure if we will have those either as there are only a handful of those per SoC) but I'll add some more documentation for this.
Quoted 7 lines
I'll have to see the documentation, but I'd be very wary of putting that in as-is. Does having the clock domain string link this up to domains in platform data?
I'm not sure how well we'll be able to maintain support for that in future if it requires other platform code to use now, and we're not sure how the domains themselves will be represented in dt.
Hmm so, should I add a stub representation for the clockdomains to the DT then for now or how should this be handled? The stubs could then be mapped to the actual clock domains based on their node names.
Quoted 41 lines
Quoted 17 lines
Quoted 4 lines
[...]
Quoted 12 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt
Quoted 10 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +10
-0+static inline void __iomem *get_dt_register(struct device_node *node, + int index) +{ + u32 val; + + of_property_read_u32_index(node, "reg", 2 * index, &val); + if (val) + return of_iomap(node, index); + else + return NULL;NAK. Use reg-names to handle registers being optional.
Quoted 1 line
Yea will change this.
Cheers.
Quoted 20 lines
Quoted 20 lines
[...]
Quoted 15 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +15
-0+ clkspec.np = of_parse_phandle(node, "ti,clk-ref", 0); + dd->clk_ref = of_clk_get_from_provider(&clkspec); + if (IS_ERR(dd->clk_ref)) { + pr_err("%s: ti,clk-ref for %s not found\n", __func__, + clk_name); + goto cleanup; + } + + clkspec.np = of_parse_phandle(node, "ti,clk-bypass", 0); + dd->clk_bypass = of_clk_get_from_provider(&clkspec); + if (IS_ERR(dd->clk_bypass)) { + pr_err("%s: ti,clk-bypass for %s not found\n", __func__, + clk_name); + goto cleanup; + }
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
You can get these from the standard clocks property. Don't do this.
Look at
of_clk_get_by_name().Or
of_clk_get(node, index), which would be better?If you know you always have both clocks, then yes.
Ok, will do it this way then.
-Tero
Quoted 4 lines
Cheers,
Mark.
PATCH v5 2/31 CLK: TI: Add DPLL clock support
Quoted 67 lines · Tero Kristo
Quoted 66 lines · Mark Rutland
Quoted 64 lines · Tero Kristo
Quoted 51 lines · Mark Rutland
Hi,
Quoted 48 lines · Tero Kristo
The OMAP clock driver now supports DPLL clock type. This patch also adds support for DT DPLL nodes.
Signed-off-by Tero Kristo <[email protected]>--- .../devicetree/bindings/clock/ti/dpll.txt | 70 +++ arch/arm/mach-omap2/clock.h | 144 +----- arch/arm/mach-omap2/clock3xxx.h | 2 - drivers/clk/Makefile | 1 + drivers/clk/ti/Makefile | 3 + drivers/clk/ti/dpll.c | 488 ++++++++++++++++++++ include/linux/clk/ti.h | 164 +++++++ 7 files changed, 727 insertions(+), 145 deletions(-)create mode 100644
Documentation/devicetree/bindings/clock/ti/dpll.txtcreate mode 100644drivers/clk/ti/Makefile
create mode 100644drivers/clk/ti/dpll.c
create mode 100644include/linux/clk/ti.hDocumentation/devicetree/bindings/clock/ti/dpll.txt new file +24
-0@@ -0,0 +1,70 @@ +Binding for Texas Instruments DPLL clock. + +This binding uses the common clock binding[1]. It assumes a +register-mapped DPLL with usually two selectable input clocks +(reference clock and bypass clock), with digital phase locked +loop logic for multiplying the input clock to a desired output +clock. This clock also typically supports different operation +modes (locked, low power stop etc.) This binding has several +sub-types, which effectively result in slightly different setup +for the actual DPLL clock. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt + +Required properties: +- compatible : shall be one of: + "ti,omap4-dpll-x2-clock", + "ti,omap3-dpll-clock", + "ti,omap3-dpll-core-clock", + "ti,omap3-dpll-per-clock", + "ti,omap3-dpll-per-j-type-clock", + "ti,omap4-dpll-clock", + "ti,omap4-dpll-core-clock", + "ti,omap4-dpll-m4xen-clock", + "ti,omap4-dpll-j-type-clock",Quoted 8 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt line 29
Quoted 5 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +5
-0+ "ti,omap4-dpll-no-gate-clock", + "ti,omap4-dpll-no-gate-j-type-clock", + +- #clock-cells : from common clock binding; shall be set to 0. +- clocks : link phandles of parent clocks (clk-ref and clk-bypass)It might be a good idea to use clock-names to clarify which clocks are present (I notice your examples contain only one clock input).
All DPLLs have both bypass and reference clocks, but these can be the same. Is it better to just list both always (and hence drop clock-names), or provide clock-names always?
Quoted 6 lines
Quoted 3 lines
If they're separate inputs, it's worth listing both (even if they're fed by the same provider). If it's possible one input might not be wired up, use clock-names.
Ref and bypass clocks are used currently by all DPLLs (also the APLL) so I guess I just enforce both to be specified.
Ok. It's always possible to add clock-names later if a platform doesn't wire an input. We lose the possibility of future compatibility, but backwards compatibility is easy enough to maintain.
Quoted 16 lines
Quoted 16 lines
Quoted 11 lines
Quoted 6 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt line 44
Quoted 1 line
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +1
-0+- ti,clkdm-name : clockdomain name for the DPLLCould you elaborate on what this is for? What constitutes a valid name?
I'm not sure a string is the best way to define the linkage of several elements to a domain...
Well, I am not sure if we can do this any better at this point, we don't have DT nodes for clockdomain at the moment (I am not sure if we will have those either as there are only a handful of those per SoC) but I'll add some more documentation for this.
I'll have to see the documentation, but I'd be very wary of putting that in as-is. Does having the clock domain string link this up to domains in platform data?
Quoted 8 lines
Quoted 3 lines
I'm not sure how well we'll be able to maintain support for that in future if it requires other platform code to use now, and we're not sure how the domains themselves will be represented in dt.
Hmm so, should I add a stub representation for the clockdomains to the DT then for now or how should this be handled? The stubs could then be mapped to the actual clock domains based on their node names.
I unfortunately don't have a good answer here, because I'm not that familiar with how we handle clockdomains for power management purposes.
As I understand it, each clock domain is essentially a clock gate controlling multiple clock signals, so it's possible to describe that with the common clock bindings, with a domain's clocks all coming from a "domain-gate-clock" node (or something like that). That would make the wiring of clocks to a domain explicit and in line with the rest of the common clock bindings. But perhaps I've simplified things a bit too far.
I'm not sure how easy it would be to use that information for power management. I don't know what the kernel logic for clock domain power management needs to know about consumers of the clocks and how it would need to poke those consumers.
Cheers,
Mark.
PATCH v5 2/31 CLK: TI: Add DPLL clock support
Quoted 107 lines · Mark Rutland
Quoted 67 lines · Tero Kristo
Quoted 66 lines · Mark Rutland
Quoted 64 lines · Tero Kristo
Quoted 51 lines · Mark Rutland
Hi,
Quoted 48 lines · Tero Kristo
The OMAP clock driver now supports DPLL clock type. This patch also adds support for DT DPLL nodes.
Signed-off-by Tero Kristo <[email protected]>--- .../devicetree/bindings/clock/ti/dpll.txt | 70 +++ arch/arm/mach-omap2/clock.h | 144 +----- arch/arm/mach-omap2/clock3xxx.h | 2 - drivers/clk/Makefile | 1 + drivers/clk/ti/Makefile | 3 + drivers/clk/ti/dpll.c | 488 ++++++++++++++++++++ include/linux/clk/ti.h | 164 +++++++ 7 files changed, 727 insertions(+), 145 deletions(-)create mode 100644
Documentation/devicetree/bindings/clock/ti/dpll.txtcreate mode 100644drivers/clk/ti/Makefile
create mode 100644drivers/clk/ti/dpll.c
create mode 100644include/linux/clk/ti.hDocumentation/devicetree/bindings/clock/ti/dpll.txt new file +24
-0@@ -0,0 +1,70 @@ +Binding for Texas Instruments DPLL clock. + +This binding uses the common clock binding[1]. It assumes a +register-mapped DPLL with usually two selectable input clocks +(reference clock and bypass clock), with digital phase locked +loop logic for multiplying the input clock to a desired output +clock. This clock also typically supports different operation +modes (locked, low power stop etc.) This binding has several +sub-types, which effectively result in slightly different setup +for the actual DPLL clock. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt + +Required properties: +- compatible : shall be one of: + "ti,omap4-dpll-x2-clock", + "ti,omap3-dpll-clock", + "ti,omap3-dpll-core-clock", + "ti,omap3-dpll-per-clock", + "ti,omap3-dpll-per-j-type-clock", + "ti,omap4-dpll-clock", + "ti,omap4-dpll-core-clock", + "ti,omap4-dpll-m4xen-clock", + "ti,omap4-dpll-j-type-clock",Quoted 8 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt line 29
Quoted 5 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +5
-0+ "ti,omap4-dpll-no-gate-clock", + "ti,omap4-dpll-no-gate-j-type-clock", + +- #clock-cells : from common clock binding; shall be set to 0. +- clocks : link phandles of parent clocks (clk-ref and clk-bypass)It might be a good idea to use clock-names to clarify which clocks are present (I notice your examples contain only one clock input).
All DPLLs have both bypass and reference clocks, but these can be the same. Is it better to just list both always (and hence drop clock-names), or provide clock-names always?
Quoted 6 lines
Quoted 3 lines
If they're separate inputs, it's worth listing both (even if they're fed by the same provider). If it's possible one input might not be wired up, use clock-names.
Ref and bypass clocks are used currently by all DPLLs (also the APLL) so I guess I just enforce both to be specified.
Ok. It's always possible to add clock-names later if a platform doesn't wire an input. We lose the possibility of future compatibility, but backwards compatibility is easy enough to maintain.
Quoted 16 lines
Quoted 16 lines
Quoted 11 lines
Quoted 6 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt line 44
Quoted 1 line
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +1
-0+- ti,clkdm-name : clockdomain name for the DPLLCould you elaborate on what this is for? What constitutes a valid name?
I'm not sure a string is the best way to define the linkage of several elements to a domain...
Well, I am not sure if we can do this any better at this point, we don't have DT nodes for clockdomain at the moment (I am not sure if we will have those either as there are only a handful of those per SoC) but I'll add some more documentation for this.
I'll have to see the documentation, but I'd be very wary of putting that in as-is. Does having the clock domain string link this up to domains in platform data?
Quoted 8 lines
Quoted 3 lines
I'm not sure how well we'll be able to maintain support for that in future if it requires other platform code to use now, and we're not sure how the domains themselves will be represented in dt.
Hmm so, should I add a stub representation for the clockdomains to the DT then for now or how should this be handled? The stubs could then be mapped to the actual clock domains based on their node names.
I unfortunately don't have a good answer here, because I'm not that familiar with how we handle clockdomains for power management purposes.
Quoted 7 lines
As I understand it, each clock domain is essentially a clock gate controlling multiple clock signals, so it's possible to describe that with the common clock bindings, with a domain's clocks all coming from a "domain-gate-clock" node (or something like that). That would make the wiring of clocks to a domain explicit and in line with the rest of the common clock bindings. But perhaps I've simplified things a bit too far.
You got it basically right, but maybe oversimplified it a bit. The root/parent clocks can still cross clockdomain boundaries, so mapping everything under a simple clockdomain gate would not work. Basically each clock has a mapping on the SoC for both its parent clock signal and the clockdomain association, kind of having two parents at the same time. In OMAP case, most of the clockdomains support hardware autoidle type functionality, which puts the domain to idle once all the clocks on it are disabled.
-Tero
Quoted 9 lines
I'm not sure how easy it would be to use that information for power management. I don't know what the kernel logic for clock domain power management needs to know about consumers of the clocks and how it would need to poke those consumers.
Cheers,
Mark.
PATCH v5 2/31 CLK: TI: Add DPLL clock support
Quoting Tero Kristo (2013-08-19 10:06:39)
Quoted 96 lines · Mark Rutland
Quoted 95 lines · Tero Kristo
Quoted 67 lines · Mark Rutland
Quoted 66 lines · Tero Kristo
Quoted 64 lines · Mark Rutland
Quoted 51 lines
Hi,
Quoted 48 lines · Tero Kristo
The OMAP clock driver now supports DPLL clock type. This patch also adds support for DT DPLL nodes.
Signed-off-by Tero Kristo <[email protected]>--- .../devicetree/bindings/clock/ti/dpll.txt | 70 +++ arch/arm/mach-omap2/clock.h | 144 +----- arch/arm/mach-omap2/clock3xxx.h | 2 - drivers/clk/Makefile | 1 + drivers/clk/ti/Makefile | 3 + drivers/clk/ti/dpll.c | 488 ++++++++++++++++++++ include/linux/clk/ti.h | 164 +++++++ 7 files changed, 727 insertions(+), 145 deletions(-)create mode 100644
Documentation/devicetree/bindings/clock/ti/dpll.txtcreate mode 100644drivers/clk/ti/Makefile
create mode 100644drivers/clk/ti/dpll.c
create mode 100644include/linux/clk/ti.hDocumentation/devicetree/bindings/clock/ti/dpll.txt new file +24
-0@@ -0,0 +1,70 @@ +Binding for Texas Instruments DPLL clock. + +This binding uses the common clock binding[1]. It assumes a +register-mapped DPLL with usually two selectable input clocks +(reference clock and bypass clock), with digital phase locked +loop logic for multiplying the input clock to a desired output +clock. This clock also typically supports different operation +modes (locked, low power stop etc.) This binding has several +sub-types, which effectively result in slightly different setup +for the actual DPLL clock. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt + +Required properties: +- compatible : shall be one of: + "ti,omap4-dpll-x2-clock", + "ti,omap3-dpll-clock", + "ti,omap3-dpll-core-clock", + "ti,omap3-dpll-per-clock", + "ti,omap3-dpll-per-j-type-clock", + "ti,omap4-dpll-clock", + "ti,omap4-dpll-core-clock", + "ti,omap4-dpll-m4xen-clock", + "ti,omap4-dpll-j-type-clock",Quoted 8 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt line 29
Quoted 5 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +5
-0+ "ti,omap4-dpll-no-gate-clock", + "ti,omap4-dpll-no-gate-j-type-clock", + +- #clock-cells : from common clock binding; shall be set to 0. +- clocks : link phandles of parent clocks (clk-ref and clk-bypass)It might be a good idea to use clock-names to clarify which clocks are present (I notice your examples contain only one clock input).
All DPLLs have both bypass and reference clocks, but these can be the same. Is it better to just list both always (and hence drop clock-names), or provide clock-names always?
Quoted 6 lines
Quoted 3 lines
If they're separate inputs, it's worth listing both (even if they're fed by the same provider). If it's possible one input might not be wired up, use clock-names.
Ref and bypass clocks are used currently by all DPLLs (also the APLL) so I guess I just enforce both to be specified.
Ok. It's always possible to add clock-names later if a platform doesn't wire an input. We lose the possibility of future compatibility, but backwards compatibility is easy enough to maintain.
Quoted 16 lines
Quoted 16 lines
Quoted 11 lines
Quoted 6 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt line 30
Quoted 1 line
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +1
-0+- ti,clkdm-name : clockdomain name for the DPLLCould you elaborate on what this is for? What constitutes a valid name?
I'm not sure a string is the best way to define the linkage of several elements to a domain...
Well, I am not sure if we can do this any better at this point, we don't have DT nodes for clockdomain at the moment (I am not sure if we will have those either as there are only a handful of those per SoC) but I'll add some more documentation for this.
I'll have to see the documentation, but I'd be very wary of putting that in as-is. Does having the clock domain string link this up to domains in platform data?
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
I'm not sure how well we'll be able to maintain support for that in future if it requires other platform code to use now, and we're not sure how the domains themselves will be represented in dt.
Hmm so, should I add a stub representation for the clockdomains to the DT then for now or how should this be handled? The stubs could then be mapped to the actual clock domains based on their node names.
I'm not sure that this binding should know about the clock domain at all. Maybe the clock domain binding should list the clocks that are within the domain?
Quoted 13 lines
Quoted 5 lines
Quoted 1 line
I unfortunately don't have a good answer here, because I'm not that familiar with how we handle clockdomains for power management purposes.
Quoted 7 lines
As I understand it, each clock domain is essentially a clock gate controlling multiple clock signals, so it's possible to describe that with the common clock bindings, with a domain's clocks all coming from a "domain-gate-clock" node (or something like that). That would make the wiring of clocks to a domain explicit and in line with the rest of the common clock bindings. But perhaps I've simplified things a bit too far.
Quoted 8 lines
You got it basically right, but maybe oversimplified it a bit. The root/parent clocks can still cross clockdomain boundaries, so mapping everything under a simple clockdomain gate would not work. Basically each clock has a mapping on the SoC for both its parent clock signal and the clockdomain association, kind of having two parents at the same time. In OMAP case, most of the clockdomains support hardware autoidle type functionality, which puts the domain to idle once all the clocks on it are disabled.
I always thought that OMAP clock domains were poorly named. Seems to me that they had more to do with the IP/module programming than clocks per se. Again, I'm not sure that putting clkdm data into this binding is correct.
Is it because you want a call to clk_enable to program the clock domain in the .enable callback? I always thought that this was better left to a pm_runtime_get callback...
Regards,
Mike
Quoted 12 lines
-Tero
Quoted 9 lines
I'm not sure how easy it would be to use that information for power management. I don't know what the kernel logic for clock domain power management needs to know about consumers of the clocks and how it would need to poke those consumers.
Cheers,
Mark.
PATCH v5 2/31 CLK: TI: Add DPLL clock support
Quoted 101 lines · Mike Turquette
Quoting Tero Kristo (2013-08-19 10:06:39)
Quoted 100 lines · Mark Rutland
Quoted 99 lines · Tero Kristo
Quoted 67 lines · Mark Rutland
Quoted 66 lines · Tero Kristo
Quoted 64 lines · Mark Rutland
Quoted 51 lines
Hi,
Quoted 48 lines · Tero Kristo
The OMAP clock driver now supports DPLL clock type. This patch also adds support for DT DPLL nodes.
Signed-off-by Tero Kristo <[email protected]>--- .../devicetree/bindings/clock/ti/dpll.txt | 70 +++ arch/arm/mach-omap2/clock.h | 144 +----- arch/arm/mach-omap2/clock3xxx.h | 2 - drivers/clk/Makefile | 1 + drivers/clk/ti/Makefile | 3 + drivers/clk/ti/dpll.c | 488 ++++++++++++++++++++ include/linux/clk/ti.h | 164 +++++++ 7 files changed, 727 insertions(+), 145 deletions(-)create mode 100644
Documentation/devicetree/bindings/clock/ti/dpll.txtcreate mode 100644drivers/clk/ti/Makefile
create mode 100644drivers/clk/ti/dpll.c
create mode 100644include/linux/clk/ti.hDocumentation/devicetree/bindings/clock/ti/dpll.txt new file +24
-0@@ -0,0 +1,70 @@ +Binding for Texas Instruments DPLL clock. + +This binding uses the common clock binding[1]. It assumes a +register-mapped DPLL with usually two selectable input clocks +(reference clock and bypass clock), with digital phase locked +loop logic for multiplying the input clock to a desired output +clock. This clock also typically supports different operation +modes (locked, low power stop etc.) This binding has several +sub-types, which effectively result in slightly different setup +for the actual DPLL clock. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt + +Required properties: +- compatible : shall be one of: + "ti,omap4-dpll-x2-clock", + "ti,omap3-dpll-clock", + "ti,omap3-dpll-core-clock", + "ti,omap3-dpll-per-clock", + "ti,omap3-dpll-per-j-type-clock", + "ti,omap4-dpll-clock", + "ti,omap4-dpll-core-clock", + "ti,omap4-dpll-m4xen-clock", + "ti,omap4-dpll-j-type-clock",Quoted 8 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt line 29
Quoted 5 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +5
-0+ "ti,omap4-dpll-no-gate-clock", + "ti,omap4-dpll-no-gate-j-type-clock", + +- #clock-cells : from common clock binding; shall be set to 0. +- clocks : link phandles of parent clocks (clk-ref and clk-bypass)It might be a good idea to use clock-names to clarify which clocks are present (I notice your examples contain only one clock input).
All DPLLs have both bypass and reference clocks, but these can be the same. Is it better to just list both always (and hence drop clock-names), or provide clock-names always?
Quoted 6 lines
Quoted 3 lines
If they're separate inputs, it's worth listing both (even if they're fed by the same provider). If it's possible one input might not be wired up, use clock-names.
Ref and bypass clocks are used currently by all DPLLs (also the APLL) so I guess I just enforce both to be specified.
Ok. It's always possible to add clock-names later if a platform doesn't wire an input. We lose the possibility of future compatibility, but backwards compatibility is easy enough to maintain.
Quoted 20 lines
Quoted 19 lines
Quoted 11 lines
Quoted 6 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt line 30
Quoted 1 line
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +1
-0+- ti,clkdm-name : clockdomain name for the DPLLCould you elaborate on what this is for? What constitutes a valid name?
I'm not sure a string is the best way to define the linkage of several elements to a domain...
Well, I am not sure if we can do this any better at this point, we don't have DT nodes for clockdomain at the moment (I am not sure if we will have those either as there are only a handful of those per SoC) but I'll add some more documentation for this.
I'll have to see the documentation, but I'd be very wary of putting that in as-is. Does having the clock domain string link this up to domains in platform data?
I'm not sure how well we'll be able to maintain support for that in future if it requires other platform code to use now, and we're not sure how the domains themselves will be represented in dt.
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Hmm so, should I add a stub representation for the clockdomains to the DT then for now or how should this be handled? The stubs could then be mapped to the actual clock domains based on their node names.
I'm not sure that this binding should know about the clock domain at all. Maybe the clock domain binding should list the clocks that are within the domain?
Ok, I experimented with this stuff a bit to have a proper reply, and it looks like I can get this done with a clockdomain mapping, which has its own binding. Something like this:
clockdomains {
usbhost_clkdm: usbhost_clkdm {
compatible = "ti,clockdomain";
clocks = <&usbhost_48m_fck>, <&usbhost_ick>;
};
};Mike, what is your approach on this? Are you okay having the implementation for this under drivers/clk? I recall you mentioned earlier that you don't want clockdomain stuff under drivers/clk, hence I am asking.
Here is the initial implementation for the binding:
void __init of_omap_clockdomain_setup(struct device_node *node)
{
struct clk *clk;
struct clk_hw *clk_hw;
const char *clkdm_name = node->name;
int i;
int num_clks;
num_clks = of_count_phandle_with_args(node, "clocks", "#clock-cells");
for (i = 0; i < num_clks; i++) {
clk = of_clk_get(node, i);
if (__clk_get_flags(clk) & CLK_IS_BASIC) {
pr_warn("%s: can't setup clkdm for basic clk %s\n",
__func__, __clk_get_name(clk));
continue;
}
clk_hw = __clk_get_hw(clk);
to_clk_hw_omap(clk_hw)->clkdm_name = clkdm_name;
omap2_init_clk_clkdm(clk_hw);
}
}CLK_OF_DECLARE(omap_clockdomain, "ti,clockdomain", of_omap_clockdomain_setup);
Quoted 23 lines
Quoted 14 lines
Quoted 6 lines
Quoted 2 lines
I unfortunately don't have a good answer here, because I'm not that familiar with how we handle clockdomains for power management purposes.
Quoted 7 lines
As I understand it, each clock domain is essentially a clock gate controlling multiple clock signals, so it's possible to describe that with the common clock bindings, with a domain's clocks all coming from a "domain-gate-clock" node (or something like that). That would make the wiring of clocks to a domain explicit and in line with the rest of the common clock bindings. But perhaps I've simplified things a bit too far.
Quoted 8 lines
You got it basically right, but maybe oversimplified it a bit. The root/parent clocks can still cross clockdomain boundaries, so mapping everything under a simple clockdomain gate would not work. Basically each clock has a mapping on the SoC for both its parent clock signal and the clockdomain association, kind of having two parents at the same time. In OMAP case, most of the clockdomains support hardware autoidle type functionality, which puts the domain to idle once all the clocks on it are disabled.
Quoted 8 lines
I always thought that OMAP clock domains were poorly named. Seems to me that they had more to do with the IP/module programming than clocks per se. Again, I'm not sure that putting clkdm data into this binding is correct.
Is it because you want a call to
clk_enableto program the clock domain in the .enable callback? I always thought that this was better left to apm_runtime_getcallback...
My guess is that some clocks require the clockdomain itself to be forced on before they are enabled, some of the DPLLs do this for example. I am just trying not to cause any regressions with this set, thus attempting to keep most of the implementation specifics intact.
-Tero
Quoted 16 lines
Regards,
MikeQuoted 12 lines
-Tero
Quoted 9 lines
I'm not sure how easy it would be to use that information for power management. I don't know what the kernel logic for clock domain power management needs to know about consumers of the clocks and how it would need to poke those consumers.
Cheers,
Mark.
PATCH v5 2/31 CLK: TI: Add DPLL clock support
Quoting Tero Kristo (2013-08-21 09:16:45)
Quoted 114 lines · Mike Turquette
Quoted 101 lines
Quoting Tero Kristo (2013-08-19 10:06:39)
Quoted 100 lines · Mark Rutland
Quoted 99 lines · Tero Kristo
Quoted 67 lines · Mark Rutland
Quoted 66 lines · Tero Kristo
Quoted 64 lines · Mark Rutland
Quoted 51 lines
Hi,
Quoted 48 lines · Tero Kristo
The OMAP clock driver now supports DPLL clock type. This patch also adds support for DT DPLL nodes.
Signed-off-by Tero Kristo <[email protected]>--- .../devicetree/bindings/clock/ti/dpll.txt | 70 +++ arch/arm/mach-omap2/clock.h | 144 +----- arch/arm/mach-omap2/clock3xxx.h | 2 - drivers/clk/Makefile | 1 + drivers/clk/ti/Makefile | 3 + drivers/clk/ti/dpll.c | 488 ++++++++++++++++++++ include/linux/clk/ti.h | 164 +++++++ 7 files changed, 727 insertions(+), 145 deletions(-)create mode 100644
Documentation/devicetree/bindings/clock/ti/dpll.txtcreate mode 100644drivers/clk/ti/Makefile
create mode 100644drivers/clk/ti/dpll.c
create mode 100644include/linux/clk/ti.hDocumentation/devicetree/bindings/clock/ti/dpll.txt new file +24
-0@@ -0,0 +1,70 @@ +Binding for Texas Instruments DPLL clock. + +This binding uses the common clock binding[1]. It assumes a +register-mapped DPLL with usually two selectable input clocks +(reference clock and bypass clock), with digital phase locked +loop logic for multiplying the input clock to a desired output +clock. This clock also typically supports different operation +modes (locked, low power stop etc.) This binding has several +sub-types, which effectively result in slightly different setup +for the actual DPLL clock. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt + +Required properties: +- compatible : shall be one of: + "ti,omap4-dpll-x2-clock", + "ti,omap3-dpll-clock", + "ti,omap3-dpll-core-clock", + "ti,omap3-dpll-per-clock", + "ti,omap3-dpll-per-j-type-clock", + "ti,omap4-dpll-clock", + "ti,omap4-dpll-core-clock", + "ti,omap4-dpll-m4xen-clock", + "ti,omap4-dpll-j-type-clock",Quoted 8 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt line 29
Quoted 5 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +5
-0+ "ti,omap4-dpll-no-gate-clock", + "ti,omap4-dpll-no-gate-j-type-clock", + +- #clock-cells : from common clock binding; shall be set to 0. +- clocks : link phandles of parent clocks (clk-ref and clk-bypass)It might be a good idea to use clock-names to clarify which clocks are present (I notice your examples contain only one clock input).
All DPLLs have both bypass and reference clocks, but these can be the same. Is it better to just list both always (and hence drop clock-names), or provide clock-names always?
Quoted 6 lines
Quoted 3 lines
If they're separate inputs, it's worth listing both (even if they're fed by the same provider). If it's possible one input might not be wired up, use clock-names.
Ref and bypass clocks are used currently by all DPLLs (also the APLL) so I guess I just enforce both to be specified.
Ok. It's always possible to add clock-names later if a platform doesn't wire an input. We lose the possibility of future compatibility, but backwards compatibility is easy enough to maintain.
Quoted 20 lines
Quoted 19 lines
Quoted 11 lines
Quoted 6 lines
Documentation/devicetree/bindings/clock/ti/dpll.txt line 30
Quoted 1 line
Documentation/devicetree/bindings/clock/ti/dpll.txt new file +1
-0+- ti,clkdm-name : clockdomain name for the DPLLCould you elaborate on what this is for? What constitutes a valid name?
I'm not sure a string is the best way to define the linkage of several elements to a domain...
Well, I am not sure if we can do this any better at this point, we don't have DT nodes for clockdomain at the moment (I am not sure if we will have those either as there are only a handful of those per SoC) but I'll add some more documentation for this.
I'll have to see the documentation, but I'd be very wary of putting that in as-is. Does having the clock domain string link this up to domains in platform data?
I'm not sure how well we'll be able to maintain support for that in future if it requires other platform code to use now, and we're not sure how the domains themselves will be represented in dt.
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Hmm so, should I add a stub representation for the clockdomains to the DT then for now or how should this be handled? The stubs could then be mapped to the actual clock domains based on their node names.
I'm not sure that this binding should know about the clock domain at all. Maybe the clock domain binding should list the clocks that are within the domain?
Ok, I experimented with this stuff a bit to have a proper reply, and it looks like I can get this done with a clockdomain mapping, which has its own binding. Something like this:
Quoted 6 lines
clockdomains {
usbhost_clkdm: usbhost_clkdm {
compatible = "ti,clockdomain";
clocks = <&usbhost_48m_fck>, <&usbhost_ick>;
};
};Cool, this is much closer to what I had in mind. I guess the clock domain DT binding can be marked as "Unstable - ABI compatibility may be broken in the future" since the binding isn't really fleshed out yet.
Quoted 5 lines
Mike, what is your approach on this? Are you okay having the implementation for this under
drivers/clk? I recall you mentioned earlier that you don't want clockdomain stuff underdrivers/clk, hence I am asking.
I do not want them to live there permanently. There has been some talk about drivers/syscon/ or whatever for a while now, but this clkdm stuff is also not a good candidate for that since none of the clkdm bits here are really fleshed out with an eye towards a reusable core framework. Maybe someday though...
I guess I could take it into drivers/clk/ti/ on a temporary basis, with a commitment to move it out when the right driver infrastructure for clock domains comes along.
Regards,
Mike
Quoted 84 lines
Here is the initial implementation for the binding:
void
__initof_omap_clockdomain_setup(struct device_node *node){ struct clk *clk; struct clk_hw *clk_hw; const char *clkdm_name = node->name; int i; int num_clks; num_clks = of_count_phandle_with_args(node, "clocks","#clock-cells");
for (i = 0; i < num_clks; i++) { clk = of_clk_get(node, i); if (__clk_get_flags(clk) & CLK_IS_BASIC) { pr_warn("%s: can't setup clkdm for basic clk %s\n", __func__, __clk_get_name(clk)); continue; } clk_hw = __clk_get_hw(clk); to_clk_hw_omap(clk_hw)->clkdm_name = clkdm_name; omap2_init_clk_clkdm(clk_hw); } }
CLK_OF_DECLARE(omap_clockdomain, "ti,clockdomain", of_omap_clockdomain_setup);Quoted 23 lines
Quoted 14 lines
Quoted 6 lines
Quoted 2 lines
I unfortunately don't have a good answer here, because I'm not that familiar with how we handle clockdomains for power management purposes.
Quoted 7 lines
As I understand it, each clock domain is essentially a clock gate controlling multiple clock signals, so it's possible to describe that with the common clock bindings, with a domain's clocks all coming from a "domain-gate-clock" node (or something like that). That would make the wiring of clocks to a domain explicit and in line with the rest of the common clock bindings. But perhaps I've simplified things a bit too far.
Quoted 8 lines
You got it basically right, but maybe oversimplified it a bit. The root/parent clocks can still cross clockdomain boundaries, so mapping everything under a simple clockdomain gate would not work. Basically each clock has a mapping on the SoC for both its parent clock signal and the clockdomain association, kind of having two parents at the same time. In OMAP case, most of the clockdomains support hardware autoidle type functionality, which puts the domain to idle once all the clocks on it are disabled.
Quoted 8 lines
I always thought that OMAP clock domains were poorly named. Seems to me that they had more to do with the IP/module programming than clocks per se. Again, I'm not sure that putting clkdm data into this binding is correct.
Is it because you want a call to
clk_enableto program the clock domain in the .enable callback? I always thought that this was better left to apm_runtime_getcallback...My guess is that some clocks require the clockdomain itself to be forced on before they are enabled, some of the DPLLs do this for example. I am just trying not to cause any regressions with this set, thus attempting to keep most of the implementation specifics intact.
-Tero
Quoted 16 lines
Regards,
MikeQuoted 12 lines
-Tero
Quoted 9 lines
I'm not sure how easy it would be to use that information for power management. I don't know what the kernel logic for clock domain power management needs to know about consumers of the clocks and how it would need to poke those consumers.
Cheers,
Mark.
PATCH v5 3/31 CLK: TI: add DT alias clock registration mechanism
In reply to Tero KristoSome devices require their clocks to be available with a specific dev-id con-id mapping. With DT, the clocks can be found by default only with their name, or alternatively through the device node of the consumer. With drivers, that don't support DT fully yet, add mechanism to register specific clock names.
--- drivers/clk/ti/Makefile | 2 +- drivers/clk/ti/clk.c | 37 +++++++++++++++++++++++++++++++++++++ include/linux/clk/ti.h | 23 +++++++++++++++++++++++ 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 drivers/clk/ti/clk.c
drivers/clk/ti/Makefile +1 -1
@@ -1,3 +1,3 @@ ifneq ($(CONFIG_OF),) -obj-y += dpll.o +obj-y += clk.o dpll.o endif
drivers/clk/ti/clk.c new file +37 -0
@@ -0,0 +1,37 @@ +/* +* TI clock support +* +* Copyright (C) 2013 Texas Instruments, Inc. +* +* Tero Kristo <[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. +* +* This program is distributed "as is" WITHOUT ANY WARRANTY of any +* kind, whether express or implied; without even the implied warranty +* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ + +#include <linux/clk-provider.h> +#include <linux/clkdev.h> +#include <linux/clk/ti.h> + +/** +* omap_dt_clocks_register - register DT duplicate clocks during boot +* @oclks: list of clocks to register +* +* Register duplicate or non-standard DT clock entries during boot. By +* default, DT clocks are found based on their node name. If any +* additional con-id / dev-id -> clock mapping is required, use this +* function to list these. +*/ +void __init omap_dt_clocks_register (struct omap_dt_clk oclks[]) +{ +struct omap_dt_clk *c; + +for (c = oclks; c->node_name !=NULL ; c++) +clk_add_alias (c->con_id, c->dev_id, c->node_name,NULL ); +}
include/linux/clk/ti.h +23 -0
@@ -15,6 +15,8 @@#ifndef __LINUX_CLK_TI_H__#define __LINUX_CLK_TI_H__ +#include <linux/clkdev.h> +/** * struct dpll_data - DPLL registers and integration data * @mult_div1_reg: register containing the DPLL M and N bitfields
@@ -138,6 +140,25 @@ struct clk_hw_omap {/* DPLL Type and DCO Selection Flags */ #define DPLL_J_TYPE 0x1 +/** +* struct omap_dt_clk - OMAP DT clock alias declarations +* @dev_id: alias device ID +* @conn_id: alias connection ID +* @node_name: clock DT node to map to +*/ +struct omap_dt_clk { +const char *dev_id; +const char *con_id; +char *node_name; +}; + +#define DT_CLK (dev, con, name) \ + { \ + .dev_id = dev, \ + .con_id = con, \ + .node_name = name, \ + } +void omap2_init_clk_hw_omap_clocks (struct clk *clk);int omap3_noncore_dpll_enable (struct clk_hw *hw);void omap3_noncore_dpll_disable (struct clk_hw *hw);
@@ -158,6 +179,8 @@ unsigned long omap3_clkoutx2_recalc(struct clk_hw *hw,int omap3_dpll4_set_rate (struct clk_hw *clk,unsigned long rate,unsigned long parent_rate); +void omap_dt_clocks_register (struct omap_dt_clk *oclks); +extern const struct clk_hw_omap_ops clkhwops_omap3_dpll;extern const struct clk_hw_omap_ops clkhwops_omap4_dpllmx;
Signature · 1 line
1.7.9.5
PATCH v5 4/31 CLK: TI: add autoidle support
In reply to Tero KristoTI clk driver now routes some of the basic clocks through own registration routine to allow autoidle support. This routine just checks a couple of device node properties and adds autoidle support if required, and just passes the registration forward to basic clocks.
--- .../devicetree/bindings/clock/ti/autoidle.txt | 48 ++++++++ arch/arm/mach-omap2/clock.c | 6 + drivers/clk/ti/Makefile | 2 +- drivers/clk/ti/autoidle.c | 121 ++++++++++++++++++++ include/linux/clk/ti.h | 7 ++ 5 files changed, 183 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/clock/ti/autoidle.txt create mode 100644 drivers/clk/ti/autoidle.c
Documentation/devicetree/bindings/clock/ti/autoidle.txt new file +48 -0
@@ -0,0 +1,48 @@ +Binding for Texas Instruments autoidling clock. + +This binding uses the common clock binding[1]. Autoidle clocks +are inherited clocks from basic divider-clock [2] or +fixed-factor-clock [3] and just add autoidle support on top of +this. Autoidle is an OMAP clock feature, which allows the clock +to gate autonomously by hardware when they are no longer needed. +The autoidle feature must be enabled manually for these clocks. +Otherwise the clocks behave exactly as their base clock type. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt +[2] Documentation/devicetree/bindings/clock/divider-clock.txt +[3] Documentation/devicetree/bindings/clock/fixed-factor-clock.txt + +Required properties: +- compatible : shall be one of: + "ti,divider-clock", + "ti,fixed-factor-clock" +- ti,autoidle-shift : bit shift of the autoidle enable bit for the clock +- reg : base address for the control register of this clock + +Optional properties: +- ti,autoidle-low : autoidle is enabled by setting the bit to 0 + +Other properties as per the base clock type. + +Examples: + dpll_abe_m2x2_ck: dpll_abe_m2x2_ck at 4a0051f0 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_abe_x2_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a0051f0 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; + ti,autoidle-low; + }; + + dpll_usb_clkdcoldo_ck: dpll_usb_clkdcoldo_ck at 4a0081b4 { + #clock-cells = <0>; + compatible = "ti,fixed-factor-clock"; + clocks = <&dpll_usb_ck>; + ti,autoidle-shift = <8>; + clock-div = <1>; + reg = <0x4a0081b4 0x4>; + clock-mult = <1>; + ti,autoidle-low; + };
arch/arm/mach-omap2/clock.c +6 -0
@@ -520,6 +520,9 @@ int omap2_clk_enable_autoidle_all(void)list_for_each_entry (c, &clk_hw_omap_clocks, node)if (c->ops && c->ops->allow_idle) c->ops->allow_idle (c); + +of_omap_clk_allow_autoidle_all (); +return 0 ; }
@@ -539,6 +542,9 @@ int omap2_clk_disable_autoidle_all(void)list_for_each_entry (c, &clk_hw_omap_clocks, node)if (c->ops && c->ops->deny_idle) c->ops->deny_idle (c); + +of_omap_clk_deny_autoidle_all (); +return 0 ; }
drivers/clk/ti/Makefile +1 -1
@@ -1,3 +1,3 @@ ifneq ($(CONFIG_OF),) -obj-y += clk.o dpll.o +obj-y += clk.o dpll.o autoidle.o endif
drivers/clk/ti/autoidle.c new file +121 -0
121 lines not on this page · raw message
include/linux/clk/ti.h +7 -0
@@ -180,6 +180,13 @@ int omap3_dpll4_set_rate(struct clk_hw *clk, unsigned long rate, unsigned long parent_rate);void omap_dt_clocks_register (struct omap_dt_clk *oclks); +#ifdef CONFIG_OF +void of_omap_clk_allow_autoidle_all (void ); +void of_omap_clk_deny_autoidle_all (void ); +#else +static inline void of_omap_clk_allow_autoidle_all (void ) { } +static inline void of_omap_clk_deny_autoidle_all (void ) { } +#endif extern const struct clk_hw_omap_ops clkhwops_omap3_dpll;extern const struct clk_hw_omap_ops clkhwops_omap4_dpllmx;
Signature · 1 line
1.7.9.5
PATCH v5 5/31 CLK: TI: add support for OMAP gate clock
In reply to Tero KristoThis node adds support for a clock node which allows control to the clockdomain enable / disable.
--- .../devicetree/bindings/clock/ti/gate.txt | 41 ++++++++ arch/arm/mach-omap2/clock.h | 9 -- drivers/clk/ti/Makefile | 2 +- drivers/clk/ti/gate.c | 106 ++++++++++++++++++++ include/linux/clk/ti.h | 8 ++ 5 files changed, 156 insertions(+), 10 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/ti/gate.txt create mode 100644 drivers/clk/ti/gate.c
Documentation/devicetree/bindings/clock/ti/gate.txt new file +41 -0
@@ -0,0 +1,41 @@ +Binding for Texas Instruments gate clock. + +This binding uses the common clock binding[1]. This clock is +quite much similar to the basic gate-clock [2], however, +it supports a number of additional features. If no register +is provided for this clock, the code assumes that a clockdomain +will be controlled instead and the corresponding hw-ops for +that is used. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt +[2] Documentation/devicetree/bindings/clock/gate-clock.txt + +Required properties: +- compatible : shall be "ti,gate-clock" +- #clock-cells : from common clock binding; shall be set to 0 +- clocks : link to phandle of parent clock + +Optional properties: +- reg : base address for register controlling adjustable gate +- ti,enable-bit : bit shift for programming the clock gate +- ti,dss-clk : use DSS hardware OPS for the clock +- ti,am35xx-clk : use AM35xx hardware OPS for the clock +- ti,clkdm-name : clockdomain to control this gate + +Examples: + trace_clk_div_ck: trace_clk_div_ck { + #clock-cells = <0>; + compatible = "ti,gate-clock"; + clocks = <&trace_clk_div_div_ck>; + ti,clkdm-name = "emu_sys_clkdm"; + }; + + emac_ick: emac_ick at 4800259c { + #clock-cells = <0>; + compatible = "ti,gate-clock"; + clocks = <&ipss_ick>; + reg = <0x4800259c 0x4>; + ti,clkdm-name = "core_l3_clkdm"; + ti,enable-bit = <1>; + ti,am35xx-clk; + };
arch/arm/mach-omap2/clock.h +0 -9
@@ -260,9 +260,6 @@ extern void omap2_clkt_iclk_deny_idle(struct clk_hw_omap *clk);unsigned long omap2_get_dpll_rate (struct clk_hw_omap *clk); -int omap2_dflt_clk_enable (struct clk_hw *hw); -void omap2_dflt_clk_disable (struct clk_hw *hw); -int omap2_dflt_clk_is_enabled (struct clk_hw *hw);void omap2_clk_dflt_find_companion (struct clk_hw_omap *clk,void __iomem **other_reg,u8 *other_bit);
@@ -292,15 +289,12 @@ extern const struct clksel_rate dsp_ick_rates[];extern struct clk dummy_ck;extern const struct clk_hw_omap_ops clkhwops_iclk_wait; -extern const struct clk_hw_omap_ops clkhwops_wait;extern const struct clk_hw_omap_ops clkhwops_iclk;extern const struct clk_hw_omap_ops clkhwops_omap3430es2_ssi_wait;extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_ssi_wait; -extern const struct clk_hw_omap_ops clkhwops_omap3430es2_dss_usbhost_wait;extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_dss_usbhost_wait;extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_hsotgusb_wait;extern const struct clk_hw_omap_ops clkhwops_omap3430es2_hsotgusb_wait; -extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_module_wait;extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_wait;extern const struct clk_hw_omap_ops clkhwops_apll54;extern const struct clk_hw_omap_ops clkhwops_apll96;
@@ -318,8 +312,5 @@ extern const struct clksel_rate div31_1to31_rates[];extern int am33xx_clk_init (void ); -extern int omap2_clkops_enable_clkdm (struct clk_hw *hw); -extern void omap2_clkops_disable_clkdm (struct clk_hw *hw); -extern void omap_clocks_register (struct omap_clk *oclks,int cnt);#endif
drivers/clk/ti/Makefile +1 -1
@@ -1,3 +1,3 @@ ifneq ($(CONFIG_OF),) -obj-y += clk.o dpll.o autoidle.o +obj-y += clk.o dpll.o autoidle.o gate.o endif
drivers/clk/ti/gate.c new file +106 -0
106 lines not on this page · raw message
include/linux/clk/ti.h +8 -0
@@ -176,8 +176,13 @@ long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate,void omap2_init_clk_clkdm (struct clk_hw *clk);unsigned long omap3_clkoutx2_recalc (struct clk_hw *hw,unsigned long parent_rate); +int omap2_clkops_enable_clkdm (struct clk_hw *hw); +void omap2_clkops_disable_clkdm (struct clk_hw *hw);int omap3_dpll4_set_rate (struct clk_hw *clk,unsigned long rate,unsigned long parent_rate); +int omap2_dflt_clk_enable (struct clk_hw *hw); +void omap2_dflt_clk_disable (struct clk_hw *hw); +int omap2_dflt_clk_is_enabled (struct clk_hw *hw);void omap_dt_clocks_register (struct omap_dt_clk *oclks);#ifdef CONFIG_OF
@@ -190,5 +195,8 @@ static inline void of_omap_clk_deny_autoidle_all(void) { }extern const struct clk_hw_omap_ops clkhwops_omap3_dpll;extern const struct clk_hw_omap_ops clkhwops_omap4_dpllmx; +extern const struct clk_hw_omap_ops clkhwops_wait; +extern const struct clk_hw_omap_ops clkhwops_omap3430es2_dss_usbhost_wait; +extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_module_wait;#endif
Signature · 1 line
1.7.9.5
PATCH v5 5/31 CLK: TI: add support for OMAP gate clock
Quoted 29 lines · Tero Kristo
This node adds support for a clock node which allows control to the clockdomain enable / disable.
Signed-off-by Tero Kristo <[email protected]>--- .../devicetree/bindings/clock/ti/gate.txt | 41 ++++++++ arch/arm/mach-omap2/clock.h | 9 -- drivers/clk/ti/Makefile | 2 +- drivers/clk/ti/gate.c | 106 ++++++++++++++++++++ include/linux/clk/ti.h | 8 ++ 5 files changed, 156 insertions(+), 10 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/ti/gate.txt create mode 100644 drivers/clk/ti/gate.cDocumentation/devicetree/bindings/clock/ti/gate.txt new file +9
-0@@ -0,0 +1,41 @@ +Binding for Texas Instruments gate clock. + +This binding uses the common clock binding[1]. This clock is +quite much similar to the basic gate-clock [2], however, +it supports a number of additional features. If no register +is provided for this clock, the code assumes that a clockdomain +will be controlled instead and the corresponding hw-ops for +that is used. +
Documentation/devicetree/bindings/clock/ti/gate.txt line 19
Quoted 10 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +10
-0+[1] Documentation/devicetree/bindings/clock/clock-bindings.txt +[2] Documentation/devicetree/bindings/clock/gate-clock.txt + +Required properties: +- compatible : shall be "ti,gate-clock" +- #clock-cells : from common clock binding; shall be set to 0 +- clocks : link to phandle of parent clock + +Optional properties: +- reg : base address for register controlling adjustable gate
Optional? That's odd. If I have a clock with registers, but don't specify the register, will it still work? i.e. are registerless clocks really compatible with clocks with registers?.
Documentation/devicetree/bindings/clock/ti/gate.txt line 20
Quoted 1 line
Documentation/devicetree/bindings/clock/ti/gate.txt new file +1
-0+- ti,enable-bit : bit shift for programming the clock gate
Why is this needed? Does the hardware vary wildly, or are several clocks sharing the same register(s)?
Documentation/devicetree/bindings/clock/ti/gate.txt line 22
Quoted 2 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +2
-0+- ti,dss-clk : use DSS hardware OPS for the clock +- ti,am35xx-clk : use AM35xx hardware OPS for the clock
Those last two sounds like the kind of thing that should be derived from the compatible string (e.g. ti,am35xx-gate-clock).
Documentation/devicetree/bindings/clock/ti/gate.txt line 23
Quoted 1 line
Documentation/devicetree/bindings/clock/ti/gate.txt new file +1
-0+- ti,clkdm-name : clockdomain to control this gate
As previously mentioned, I'm not a fan of this property. It would make more sense to describe the domain and have an explicit link to it (either nodes being children of the domain or having a phandle).
[...]
Quoted 18 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +18
-0+void __init of_omap_gate_clk_setup(struct device_node *node) +{ + struct clk *clk; + struct clk_init_data init = { 0 }; + struct clk_hw_omap *clk_hw; + const char *clk_name = node->name; + int num_parents; + const char **parent_names = NULL; + int i; + u32 val; + + clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL); + if (!clk_hw) { + pr_err("%s: could not allocate clk_hw_omap\n", __func__); + return; + } + + clk_hw->hw.init = &init;
Documentation/devicetree/bindings/clock/ti/gate.txt
Quoted 10 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +10
-0+ + of_property_read_string(node, "clock-output-names", &clk_name); + of_property_read_string(node, "ti,clkdm-name", &clk_hw->clkdm_name); + + init.name = clk_name; + init.flags = 0; + + if (of_property_read_u32_index(node, "reg", 0, &val)) { + /* No register, clkdm control only */ + init.ops = &omap_gate_clkdm_clk_ops;
If they're truly compatible, you can just see if you can of_iomap, and if not, continue. Your reg values might be wider than 32 bits, and usig of_property_read_u32 to read this feels wrong.
Documentation/devicetree/bindings/clock/ti/gate.txt
Quoted 5 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +5
-0+ } else { + init.ops = &omap_gate_clk_ops; + clk_hw->enable_reg = of_iomap(node, 0); + of_property_read_u32(node, "ti,enable-bit", &val); + clk_hw->enable_bit = val;
What if of_property_read_u32 failed to read the "ti,enable-bit" property? One might not be present, it's marked as optional in the binding description.
Documentation/devicetree/bindings/clock/ti/gate.txt
Quoted 8 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +8
-0+ + clk_hw->ops = &clkhwops_wait; + + if (of_property_read_bool(node, "ti,dss-clk")) + clk_hw->ops = &clkhwops_omap3430es2_dss_usbhost_wait; + + if (of_property_read_bool(node, "ti,am35xx-clk")) + clk_hw->ops = &clkhwops_am35xx_ipss_module_wait;
I really don't like this. I think this should be done based on the compatible string.
Thanks,
Mark.
PATCH v5 5/31 CLK: TI: add support for OMAP gate clock
Quoted 36 lines · Mark Rutland
Quoted 35 lines · Tero Kristo
This node adds support for a clock node which allows control to the clockdomain enable / disable.
Signed-off-by Tero Kristo <[email protected]>--- .../devicetree/bindings/clock/ti/gate.txt | 41 ++++++++ arch/arm/mach-omap2/clock.h | 9 -- drivers/clk/ti/Makefile | 2 +- drivers/clk/ti/gate.c | 106 ++++++++++++++++++++ include/linux/clk/ti.h | 8 ++ 5 files changed, 156 insertions(+), 10 deletions(-)create mode 100644
Documentation/devicetree/bindings/clock/ti/gate.txtcreate mode 100644drivers/clk/ti/gate.cDocumentation/devicetree/bindings/clock/ti/gate.txt new file +15
-0@@ -0,0 +1,41 @@ +Binding for Texas Instruments gate clock. + +This binding uses the common clock binding[1]. This clock is +quite much similar to the basic gate-clock [2], however, +it supports a number of additional features. If no register +is provided for this clock, the code assumes that a clockdomain +will be controlled instead and the corresponding hw-ops for +that is used. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt +[2] Documentation/devicetree/bindings/clock/gate-clock.txt + +Required properties: +- compatible : shall be "ti,gate-clock" +- #clock-cells : from common clock binding; shall be set to 0
Quoted 8 lines
Documentation/devicetree/bindings/clock/ti/gate.txt line 19
Quoted 4 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +4
-0+- clocks : link to phandle of parent clock + +Optional properties: +- reg : base address for register controlling adjustable gateOptional? That's odd. If I have a clock with registers, but don't specify the register, will it still work? i.e. are registerless clocks really compatible with clocks with registers?.
I think I implemented this in somewhat confusing manner. This could be split to:
ti,gate-clock:
requires reg and ti,enable-bit info
ti,clkdm-clock:
requires ti,clkdm-name
clkdm clock is kind of a master clock for clockdomain, the clock is provided always if the clockdomain is active.
Quoted 5 lines
Documentation/devicetree/bindings/clock/ti/gate.txt line 20
Quoted 2 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +1
-0+- ti,enable-bit : bit shift for programming the clock gateWhy is this needed? Does the hardware vary wildly, or are several clocks sharing the same register(s)?
Yea, same register is shared.
Quoted 6 lines
Documentation/devicetree/bindings/clock/ti/gate.txt line 22
Quoted 3 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +2
-0+- ti,dss-clk : use DSS hardware OPS for the clock +- ti,am35xx-clk : use AM35xx hardware OPS for the clockThose last two sounds like the kind of thing that should be derived from the compatible string (e.g. ti,am35xx-gate-clock).
Hmm yea, I think I can change this and add some sub-types.
Quoted 6 lines
Documentation/devicetree/bindings/clock/ti/gate.txt line 23
Quoted 2 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +1
-0+- ti,clkdm-name : clockdomain to control this gateAs previously mentioned, I'm not a fan of this property. It would make more sense to describe the domain and have an explicit link to it (either nodes being children of the domain or having a phandle).
Same comments as with patch #2.
Quoted 27 lines
[...]
Quoted 24 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +24
-0+void __init of_omap_gate_clk_setup(struct device_node *node) +{ + struct clk *clk; + struct clk_init_data init = { 0 }; + struct clk_hw_omap *clk_hw; + const char *clk_name = node->name; + int num_parents; + const char **parent_names = NULL; + int i; + u32 val; + + clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL); + if (!clk_hw) { + pr_err("%s: could not allocate clk_hw_omap\n", __func__); + return; + } + + clk_hw->hw.init = &init; + + of_property_read_string(node, "clock-output-names", &clk_name); + of_property_read_string(node, "ti,clkdm-name", &clk_hw->clkdm_name); + + init.name = clk_name; + init.flags = 0;
Quoted 8 lines
Documentation/devicetree/bindings/clock/ti/gate.txt
Quoted 4 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +4
-0+ + if (of_property_read_u32_index(node, "reg", 0, &val)) { + /* No register, clkdm control only */ + init.ops = &omap_gate_clkdm_clk_ops;If they're truly compatible, you can just see if you can
of_iomap, and if not, continue. Your reg values might be wider than 32 bits, and usigof_property_read_u32to read this feels wrong.
I'll split this to two separate supported types.
Quoted 10 lines
Documentation/devicetree/bindings/clock/ti/gate.txt
Quoted 6 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +5
-0+ } else { + init.ops = &omap_gate_clk_ops; + clk_hw->enable_reg = of_iomap(node, 0); + of_property_read_u32(node, "ti,enable-bit", &val); + clk_hw->enable_bit = val;What if
of_property_read_u32failed to read the "ti,enable-bit" property? One might not be present, it's marked as optional in the binding description.
I'll make sure this is present in case it is needed.
Quoted 12 lines
Documentation/devicetree/bindings/clock/ti/gate.txt
Quoted 9 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +8
-0+ + clk_hw->ops = &clkhwops_wait; + + if (of_property_read_bool(node, "ti,dss-clk")) + clk_hw->ops = &clkhwops_omap3430es2_dss_usbhost_wait; + + if (of_property_read_bool(node, "ti,am35xx-clk")) + clk_hw->ops = &clkhwops_am35xx_ipss_module_wait;I really don't like this. I think this should be done based on the compatible string.
Yea, will change.
-Tero
PATCH v5 5/31 CLK: TI: add support for OMAP gate clock
Quoted 49 lines · Tero Kristo
Quoted 36 lines · Mark Rutland
Quoted 35 lines · Tero Kristo
This node adds support for a clock node which allows control to the clockdomain enable / disable.
Signed-off-by Tero Kristo <[email protected]>--- .../devicetree/bindings/clock/ti/gate.txt | 41 ++++++++ arch/arm/mach-omap2/clock.h | 9 -- drivers/clk/ti/Makefile | 2 +- drivers/clk/ti/gate.c | 106 ++++++++++++++++++++ include/linux/clk/ti.h | 8 ++ 5 files changed, 156 insertions(+), 10 deletions(-)create mode 100644
Documentation/devicetree/bindings/clock/ti/gate.txtcreate mode 100644drivers/clk/ti/gate.cDocumentation/devicetree/bindings/clock/ti/gate.txt new file +15
-0@@ -0,0 +1,41 @@ +Binding for Texas Instruments gate clock. + +This binding uses the common clock binding[1]. This clock is +quite much similar to the basic gate-clock [2], however, +it supports a number of additional features. If no register +is provided for this clock, the code assumes that a clockdomain +will be controlled instead and the corresponding hw-ops for +that is used. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt +[2] Documentation/devicetree/bindings/clock/gate-clock.txt + +Required properties: +- compatible : shall be "ti,gate-clock" +- #clock-cells : from common clock binding; shall be set to 0Quoted 8 lines
Documentation/devicetree/bindings/clock/ti/gate.txt line 19
Quoted 4 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +4
-0+- clocks : link to phandle of parent clock + +Optional properties: +- reg : base address for register controlling adjustable gateOptional? That's odd. If I have a clock with registers, but don't specify the register, will it still work? i.e. are registerless clocks really compatible with clocks with registers?.
I think I implemented this in somewhat confusing manner. This could be split to:
Quoted 7 lines
ti,gate-clock:
requires reg and ti,enable-bit info
ti,clkdm-clock:
requires ti,clkdm-nameclkdm clock is kind of a master clock for clockdomain, the clock is provided always if the clockdomain is active.
Ok.
Quoted 8 lines
Quoted 6 lines
Documentation/devicetree/bindings/clock/ti/gate.txt line 20
Quoted 3 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +1
-0+- ti,enable-bit : bit shift for programming the clock gateWhy is this needed? Does the hardware vary wildly, or are several clocks sharing the same register(s)?
Yea, same register is shared.
Ok. Are those gate clocks are part of a larger "gate clocks" block, with the register that controls them? or are they really independent? Does the register control other items too?
If they were part of some bigger unit, it might be possible to have a binding like the following (though maybe not):
gate_clks: gate_clks {
compatible = "ti,gate-clocks-block";
reg = <0x4003a000 0x1000>;
#clock-cells = <1>;
/*
* has 4 gate clocks at bit shifts 0,1,2,3,
* corresponding to input clocks 0,1,2,3
*/
clocks = <&clk1 0 23>,
<&clk1 0 4>,
<&clk3 2>,
<&clk3 5>;
};device {
compatible = "vendor,some-device";
clocks = <&gate_clks 1>; /* gate clock with bitshift 1*/
};Quoted 11 lines
Quoted 7 lines
Documentation/devicetree/bindings/clock/ti/gate.txt line 22
Quoted 4 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +2
-0+- ti,dss-clk : use DSS hardware OPS for the clock +- ti,am35xx-clk : use AM35xx hardware OPS for the clockThose last two sounds like the kind of thing that should be derived from the compatible string (e.g. ti,am35xx-gate-clock).
Hmm yea, I think I can change this and add some sub-types.
Quoted 1 line
Quoted 7 lines
Quoted 5 lines
Documentation/devicetree/bindings/clock/ti/gate.txt line 23
Quoted 1 line
Documentation/devicetree/bindings/clock/ti/gate.txt new file +1
-0+- ti,clkdm-name : clockdomain to control this gateAs previously mentioned, I'm not a fan of this property. It would make more sense to describe the domain and have an explicit link to it (either nodes being children of the domain or having a phandle).
Same comments as with patch #2.
Same reply as to patch #2 :)
Quoted 65 lines
Quoted 28 lines
[...]
Quoted 24 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +24
-0+void __init of_omap_gate_clk_setup(struct device_node *node) +{ + struct clk *clk; + struct clk_init_data init = { 0 }; + struct clk_hw_omap *clk_hw; + const char *clk_name = node->name; + int num_parents; + const char **parent_names = NULL; + int i; + u32 val; + + clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL); + if (!clk_hw) { + pr_err("%s: could not allocate clk_hw_omap\n", __func__); + return; + } + + clk_hw->hw.init = &init; + + of_property_read_string(node, "clock-output-names", &clk_name); + of_property_read_string(node, "ti,clkdm-name", &clk_hw->clkdm_name); + + init.name = clk_name; + init.flags = 0;Quoted 8 lines
Documentation/devicetree/bindings/clock/ti/gate.txt
Quoted 4 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +4
-0+ + if (of_property_read_u32_index(node, "reg", 0, &val)) { + /* No register, clkdm control only */ + init.ops = &omap_gate_clkdm_clk_ops;If they're truly compatible, you can just see if you can
of_iomap, and if not, continue. Your reg values might be wider than 32 bits, and usigof_property_read_u32to read this feels wrong.I'll split this to two separate supported types.
Quoted 10 lines
Documentation/devicetree/bindings/clock/ti/gate.txt
Quoted 6 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +5
-0+ } else { + init.ops = &omap_gate_clk_ops; + clk_hw->enable_reg = of_iomap(node, 0); + of_property_read_u32(node, "ti,enable-bit", &val); + clk_hw->enable_bit = val;What if
of_property_read_u32failed to read the "ti,enable-bit" property? One might not be present, it's marked as optional in the binding description.I'll make sure this is present in case it is needed.
Quoted 12 lines
Documentation/devicetree/bindings/clock/ti/gate.txt
Quoted 9 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +8
-0+ + clk_hw->ops = &clkhwops_wait; + + if (of_property_read_bool(node, "ti,dss-clk")) + clk_hw->ops = &clkhwops_omap3430es2_dss_usbhost_wait; + + if (of_property_read_bool(node, "ti,am35xx-clk")) + clk_hw->ops = &clkhwops_am35xx_ipss_module_wait;I really don't like this. I think this should be done based on the compatible string.
Quoted 1 line
Yea, will change.
Cheers!
Mark.
PATCH v5 5/31 CLK: TI: add support for OMAP gate clock
Quoted 64 lines · Mark Rutland
Quoted 49 lines · Tero Kristo
Quoted 36 lines · Mark Rutland
Quoted 35 lines · Tero Kristo
This node adds support for a clock node which allows control to the clockdomain enable / disable.
Signed-off-by Tero Kristo <[email protected]>--- .../devicetree/bindings/clock/ti/gate.txt | 41 ++++++++ arch/arm/mach-omap2/clock.h | 9 -- drivers/clk/ti/Makefile | 2 +- drivers/clk/ti/gate.c | 106 ++++++++++++++++++++ include/linux/clk/ti.h | 8 ++ 5 files changed, 156 insertions(+), 10 deletions(-)create mode 100644
Documentation/devicetree/bindings/clock/ti/gate.txtcreate mode 100644drivers/clk/ti/gate.cDocumentation/devicetree/bindings/clock/ti/gate.txt new file +15
-0@@ -0,0 +1,41 @@ +Binding for Texas Instruments gate clock. + +This binding uses the common clock binding[1]. This clock is +quite much similar to the basic gate-clock [2], however, +it supports a number of additional features. If no register +is provided for this clock, the code assumes that a clockdomain +will be controlled instead and the corresponding hw-ops for +that is used. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt +[2] Documentation/devicetree/bindings/clock/gate-clock.txt + +Required properties: +- compatible : shall be "ti,gate-clock" +- #clock-cells : from common clock binding; shall be set to 0Quoted 8 lines
Documentation/devicetree/bindings/clock/ti/gate.txt line 19
Quoted 4 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +4
-0+- clocks : link to phandle of parent clock + +Optional properties: +- reg : base address for register controlling adjustable gateOptional? That's odd. If I have a clock with registers, but don't specify the register, will it still work? i.e. are registerless clocks really compatible with clocks with registers?.
I think I implemented this in somewhat confusing manner. This could be split to:
Quoted 7 lines
ti,gate-clock:
requires reg and ti,enable-bit info
ti,clkdm-clock:
requires ti,clkdm-nameclkdm clock is kind of a master clock for clockdomain, the clock is provided always if the clockdomain is active.
Ok.
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +1
-0+- ti,enable-bit : bit shift for programming the clock gate
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Why is this needed? Does the hardware vary wildly, or are several clocks sharing the same register(s)?
Yea, same register is shared.
Ok. Are those gate clocks are part of a larger "gate clocks" block, with the register that controls them? or are they really independent? Does the register control other items too?
Not really. Typically they only have the clockdomain in common, and the individual clocks are mostly controlled independently from each other. For example on omap3 we have following register:
CM_FCLKEN_PER
Physical Address 0x4800 5000
BIT31:19 RESERVED Write 0s for future compatibility. Read returns 0. BIT18 EN_UART4 UART4 functional clock control.
BIT17 EN_GPIO6 GPIO6 functional clock control.
BIT16 EN_GPIO5 GPIO5 functional clock control.
BIT15 EN_GPIO4 GPIO4 functional clock control.
BIT14 EN_GPIO3 GPIO3 functional clock control.
BIT13 EN_GPIO2 GPIO2 functional clock control.
BIT12 EN_WDT3 WDT3 functional clock control.
BIT11 EN_UART3 Type UART3 functional clock control.
BIT10 EN_GPT9 GPTIMER 9 functional clock control.
BIT9 EN_GPT8 GPTIMER 8 functional clock control.
BIT8 EN_GPT7 GPTIMER 7 functional clock control.
BIT7 EN_GPT6 GPTIMER 6 functional clock control.
BIT6 EN_GPT5 GPTIMER 5 functional clock control.
BIT5 EN_GPT4 GPTIMER 4 functional clock control.
BIT4 EN_GPT3GPTIMER 3 functional clock control.
BIT3 EN_GPT2 GPTIMER 2 functional clock control.
BIT2 EN_MCBSP4 McBSP 4 functional clock control.
BIT1 EN_MCBSP3 McBSP3 functional clock control.
BIT0 EN_MCBSP2 McBSP 2 functional clock control.
So multiple drivers will be using this register for example.
Quoted 36 lines
If they were part of some bigger unit, it might be possible to have a binding like the following (though maybe not):
gate_clks: gate_clks { compatible = "ti,gate-clocks-block"; reg = <0x4003a000 0x1000>; #clock-cells = <1>; /* * has 4 gate clocks at bit shifts 0,1,2,3, * corresponding to input clocks 0,1,2,3 */ clocks = <&clk1 0 23>, <&clk1 0 4>, <&clk3 2>, <&clk3 5>; };device { compatible = "vendor,some-device"; clocks = <&gate_clks 1>; /* gate clock with bitshift 1*/ };Quoted 13 lines
Quoted 7 lines
Documentation/devicetree/bindings/clock/ti/gate.txt line 22
Quoted 4 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +2
-0+- ti,dss-clk : use DSS hardware OPS for the clock +- ti,am35xx-clk : use AM35xx hardware OPS for the clockThose last two sounds like the kind of thing that should be derived from the compatible string (e.g. ti,am35xx-gate-clock).
Hmm yea, I think I can change this and add some sub-types.
Quoted 3 lines
Quoted 2 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +1
-0+- ti,clkdm-name : clockdomain to control this gate
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
As previously mentioned, I'm not a fan of this property. It would make more sense to describe the domain and have an explicit link to it (either nodes being children of the domain or having a phandle).
Same comments as with patch #2.
Same reply as to patch #2 :)
I'll think of a proper reply there. :)
-Tero
Quoted 72 lines
Quoted 66 lines
Quoted 29 lines
[...]
Quoted 24 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +24
-0+void __init of_omap_gate_clk_setup(struct device_node *node) +{ + struct clk *clk; + struct clk_init_data init = { 0 }; + struct clk_hw_omap *clk_hw; + const char *clk_name = node->name; + int num_parents; + const char **parent_names = NULL; + int i; + u32 val; + + clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL); + if (!clk_hw) { + pr_err("%s: could not allocate clk_hw_omap\n", __func__); + return; + } + + clk_hw->hw.init = &init; + + of_property_read_string(node, "clock-output-names", &clk_name); + of_property_read_string(node, "ti,clkdm-name", &clk_hw->clkdm_name); + + init.name = clk_name; + init.flags = 0;Quoted 8 lines
Documentation/devicetree/bindings/clock/ti/gate.txt
Quoted 4 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +4
-0+ + if (of_property_read_u32_index(node, "reg", 0, &val)) { + /* No register, clkdm control only */ + init.ops = &omap_gate_clkdm_clk_ops;If they're truly compatible, you can just see if you can
of_iomap, and if not, continue. Your reg values might be wider than 32 bits, and usigof_property_read_u32to read this feels wrong.I'll split this to two separate supported types.
Quoted 10 lines
Documentation/devicetree/bindings/clock/ti/gate.txt
Quoted 6 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +5
-0+ } else { + init.ops = &omap_gate_clk_ops; + clk_hw->enable_reg = of_iomap(node, 0); + of_property_read_u32(node, "ti,enable-bit", &val); + clk_hw->enable_bit = val;What if
of_property_read_u32failed to read the "ti,enable-bit" property? One might not be present, it's marked as optional in the binding description.I'll make sure this is present in case it is needed.
Quoted 12 lines
Documentation/devicetree/bindings/clock/ti/gate.txt
Quoted 9 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +8
-0+ + clk_hw->ops = &clkhwops_wait; + + if (of_property_read_bool(node, "ti,dss-clk")) + clk_hw->ops = &clkhwops_omap3430es2_dss_usbhost_wait; + + if (of_property_read_bool(node, "ti,am35xx-clk")) + clk_hw->ops = &clkhwops_am35xx_ipss_module_wait;I really don't like this. I think this should be done based on the compatible string.
Quoted 1 line
Yea, will change.
Cheers!
Mark.
PATCH v5 5/31 CLK: TI: add support for OMAP gate clock
Quoted 70 lines · Tero Kristo
Quoted 69 lines · Mark Rutland
Quoted 49 lines · Tero Kristo
Quoted 36 lines · Mark Rutland
Quoted 35 lines · Tero Kristo
This node adds support for a clock node which allows control to the clockdomain enable / disable.
Signed-off-by Tero Kristo <[email protected]>--- .../devicetree/bindings/clock/ti/gate.txt | 41 ++++++++ arch/arm/mach-omap2/clock.h | 9 -- drivers/clk/ti/Makefile | 2 +- drivers/clk/ti/gate.c | 106 ++++++++++++++++++++ include/linux/clk/ti.h | 8 ++ 5 files changed, 156 insertions(+), 10 deletions(-)create mode 100644
Documentation/devicetree/bindings/clock/ti/gate.txtcreate mode 100644drivers/clk/ti/gate.cDocumentation/devicetree/bindings/clock/ti/gate.txt new file +15
-0@@ -0,0 +1,41 @@ +Binding for Texas Instruments gate clock. + +This binding uses the common clock binding[1]. This clock is +quite much similar to the basic gate-clock [2], however, +it supports a number of additional features. If no register +is provided for this clock, the code assumes that a clockdomain +will be controlled instead and the corresponding hw-ops for +that is used. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt +[2] Documentation/devicetree/bindings/clock/gate-clock.txt + +Required properties: +- compatible : shall be "ti,gate-clock" +- #clock-cells : from common clock binding; shall be set to 0Quoted 8 lines
Documentation/devicetree/bindings/clock/ti/gate.txt line 19
Quoted 4 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +4
-0+- clocks : link to phandle of parent clock + +Optional properties: +- reg : base address for register controlling adjustable gateOptional? That's odd. If I have a clock with registers, but don't specify the register, will it still work? i.e. are registerless clocks really compatible with clocks with registers?.
I think I implemented this in somewhat confusing manner. This could be split to:
Quoted 7 lines
ti,gate-clock:
requires reg and ti,enable-bit info
ti,clkdm-clock:
requires ti,clkdm-nameclkdm clock is kind of a master clock for clockdomain, the clock is provided always if the clockdomain is active.
Ok.
Quoted 8 lines
Quoted 6 lines
Documentation/devicetree/bindings/clock/ti/gate.txt line 20
Quoted 3 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +1
-0+- ti,enable-bit : bit shift for programming the clock gateWhy is this needed? Does the hardware vary wildly, or are several clocks sharing the same register(s)?
Yea, same register is shared.
Quoted 7 lines
Quoted 3 lines
Ok. Are those gate clocks are part of a larger "gate clocks" block, with the register that controls them? or are they really independent? Does the register control other items too?
Not really. Typically they only have the clockdomain in common, and the individual clocks are mostly controlled independently from each other. For example on omap3 we have following register:
You say they typically only have the clockdomain in common. Do you mean that they always have the same clockdomain, but not necessarily other properties, or may they not even have the clockdomain in common?
Quoted 24 lines
CM_FCLKEN_PER
Physical Address0x48005000
BIT31:19 RESERVED Write 0s for future compatibility. Read returns 0. BIT18EN_UART4UART4 functional clock control.
BIT17EN_GPIO6GPIO6 functional clock control.
BIT16EN_GPIO5GPIO5 functional clock control.
BIT15EN_GPIO4GPIO4 functional clock control.
BIT14EN_GPIO3GPIO3 functional clock control.
BIT13EN_GPIO2GPIO2 functional clock control.
BIT12EN_WDT3WDT3 functional clock control.
BIT11EN_UART3Type UART3 functional clock control.
BIT10EN_GPT9GPTIMER 9 functional clock control.
BIT9EN_GPT8GPTIMER 8 functional clock control.
BIT8EN_GPT7GPTIMER 7 functional clock control.
BIT7EN_GPT6GPTIMER 6 functional clock control.
BIT6EN_GPT5GPTIMER 5 functional clock control.
BIT5EN_GPT4GPTIMER 4 functional clock control.
BIT4EN_GPT3GPTIMER3 functional clock control.
BIT3EN_GPT2GPTIMER 2 functional clock control.
BIT2EN_MCBSP4McBSP 4 functional clock control.
BIT1EN_MCBSP3McBSP3 functional clock control.
BIT0EN_MCBSP2McBSP 2 functional clock control.
Quoted 1 line
So multiple drivers will be using this register for example.
The point I was trying to get across is that this looks like a single logical block which controls the (independent) gating of several clocks, along the same lines as multiple swtiches bound together in a DIP switch.
It's equally valid to view that as several clock gates which happen to have their control bits in close proximity in the memory map, as you suggest.
Thanks,
Mark.
PATCH v5 5/31 CLK: TI: add support for OMAP gate clock
Quoted 75 lines · Mark Rutland
Quoted 74 lines · Tero Kristo
Quoted 72 lines · Mark Rutland
Quoted 49 lines · Tero Kristo
Quoted 36 lines · Mark Rutland
Quoted 35 lines · Tero Kristo
This node adds support for a clock node which allows control to the clockdomain enable / disable.
Signed-off-by Tero Kristo <[email protected]>--- .../devicetree/bindings/clock/ti/gate.txt | 41 ++++++++ arch/arm/mach-omap2/clock.h | 9 -- drivers/clk/ti/Makefile | 2 +- drivers/clk/ti/gate.c | 106 ++++++++++++++++++++ include/linux/clk/ti.h | 8 ++ 5 files changed, 156 insertions(+), 10 deletions(-)create mode 100644
Documentation/devicetree/bindings/clock/ti/gate.txtcreate mode 100644drivers/clk/ti/gate.cDocumentation/devicetree/bindings/clock/ti/gate.txt new file +15
-0@@ -0,0 +1,41 @@ +Binding for Texas Instruments gate clock. + +This binding uses the common clock binding[1]. This clock is +quite much similar to the basic gate-clock [2], however, +it supports a number of additional features. If no register +is provided for this clock, the code assumes that a clockdomain +will be controlled instead and the corresponding hw-ops for +that is used. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt +[2] Documentation/devicetree/bindings/clock/gate-clock.txt + +Required properties: +- compatible : shall be "ti,gate-clock" +- #clock-cells : from common clock binding; shall be set to 0Quoted 8 lines
Documentation/devicetree/bindings/clock/ti/gate.txt line 19
Quoted 4 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +4
-0+- clocks : link to phandle of parent clock + +Optional properties: +- reg : base address for register controlling adjustable gateOptional? That's odd. If I have a clock with registers, but don't specify the register, will it still work? i.e. are registerless clocks really compatible with clocks with registers?.
I think I implemented this in somewhat confusing manner. This could be split to:
Quoted 7 lines
ti,gate-clock:
requires reg and ti,enable-bit info
ti,clkdm-clock:
requires ti,clkdm-nameclkdm clock is kind of a master clock for clockdomain, the clock is provided always if the clockdomain is active.
Ok.
Quoted 8 lines
Quoted 6 lines
Documentation/devicetree/bindings/clock/ti/gate.txt line 20
Quoted 3 lines
Documentation/devicetree/bindings/clock/ti/gate.txt new file +1
-0+- ti,enable-bit : bit shift for programming the clock gateWhy is this needed? Does the hardware vary wildly, or are several clocks sharing the same register(s)?
Yea, same register is shared.
Ok. Are those gate clocks are part of a larger "gate clocks" block, with the register that controls them? or are they really independent? Does the register control other items too?
Quoted 7 lines
Quoted 3 lines
Not really. Typically they only have the clockdomain in common, and the individual clocks are mostly controlled independently from each other. For example on omap3 we have following register:
You say they typically only have the clockdomain in common. Do you mean that they always have the same clockdomain, but not necessarily other properties, or may they not even have the clockdomain in common?
Currently it seems if the clocks share a register, they are in the same clockdomain (I guess this is something that might also change in future.) The input clocks can be different (some are using the same), and the outputs are routed to different destinations on the SoC. For the below example, GPTs can have either sys_ck or 32k_ck as parent, UARTs are fed from 48M clock etc.
Quoted 27 lines
Quoted 25 lines
CM_FCLKEN_PER
Physical Address0x48005000
BIT31:19 RESERVED Write 0s for future compatibility. Read returns 0. BIT18EN_UART4UART4 functional clock control.
BIT17EN_GPIO6GPIO6 functional clock control.
BIT16EN_GPIO5GPIO5 functional clock control.
BIT15EN_GPIO4GPIO4 functional clock control.
BIT14EN_GPIO3GPIO3 functional clock control.
BIT13EN_GPIO2GPIO2 functional clock control.
BIT12EN_WDT3WDT3 functional clock control.
BIT11EN_UART3Type UART3 functional clock control.
BIT10EN_GPT9GPTIMER 9 functional clock control.
BIT9EN_GPT8GPTIMER 8 functional clock control.
BIT8EN_GPT7GPTIMER 7 functional clock control.
BIT7EN_GPT6GPTIMER 6 functional clock control.
BIT6EN_GPT5GPTIMER 5 functional clock control.
BIT5EN_GPT4GPTIMER 4 functional clock control.
BIT4EN_GPT3GPTIMER3 functional clock control.
BIT3EN_GPT2GPTIMER 2 functional clock control.
BIT2EN_MCBSP4McBSP 4 functional clock control.
BIT1EN_MCBSP3McBSP3 functional clock control.
BIT0EN_MCBSP2McBSP 2 functional clock control.Quoted 1 line
So multiple drivers will be using this register for example.
Quoted 8 lines
The point I was trying to get across is that this looks like a single logical block which controls the (independent) gating of several clocks, along the same lines as multiple swtiches bound together in a DIP switch.
It's equally valid to view that as several clock gates which happen to have their control bits in close proximity in the memory map, as you suggest.
For clarity, I think it is better to have the clocks as separate nodes, as otherwise specifying the mapping for individual clocks becomes a pain for the layers that are going to use the clock mapping. You would end up with obfuscated name for UART3 / GPTIMER5 for example, and this would be rather error prone approach also if I understand your point correctly.
-Tero
Quoted 4 lines
Thanks,
Mark.
PATCH v5 6/31 ARM: dts: omap4 clock data
In reply to Tero KristoThis patch creates a unique node for each clock in the OMAP4 power, reset and clock manager (PRCM). OMAP443x and OMAP446x have slightly different clock tree which is taken into account in the data.
--- arch/arm/boot/dts/omap443x-clocks.dtsi | 17 + arch/arm/boot/dts/omap443x.dtsi | 8 + arch/arm/boot/dts/omap4460.dtsi | 8 + arch/arm/boot/dts/omap446x-clocks.dtsi | 27 + arch/arm/boot/dts/omap44xx-clocks.dtsi | 1648 ++++++++++++++++++++++++++++++++ 5 files changed, 1708 insertions(+) create mode 100644 arch/arm/boot/dts/omap443x-clocks.dtsi create mode 100644 arch/arm/boot/dts/omap446x-clocks.dtsi create mode 100644 arch/arm/boot/dts/omap44xx-clocks.dtsi
arch/arm/boot/dts/omap443x-clocks.dtsi new file +17 -0
@@ -0,0 +1,17 @@ +/* + * Device Tree Source for OMAP443x clock data + * + * Copyright (C) 2013 Texas Instruments, Inc. + * + * 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. + */ + +bandgap_fclk: bandgap_fclk at 4a307888 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&sys_32k_ck>; + bit-shift = <8>; + reg = <0x4a307888 0x4>; +};
arch/arm/boot/dts/omap443x.dtsi +8 -0
@@ -30,4 +30,12 @@ 0x4a00232C 0x4>; compatible = "ti,omap4430-bandgap"; }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + /include/ "omap44xx-clocks.dtsi" + /include/ "omap443x-clocks.dtsi" + }; };
arch/arm/boot/dts/omap4460.dtsi +8 -0
@@ -38,4 +38,12 @@ interrupts = <0 126 IRQ_TYPE_LEVEL_HIGH>; /* talert */ gpios = <&gpio3 22 0>; /* tshut */ }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + /include/ "omap44xx-clocks.dtsi" + /include/ "omap446x-clocks.dtsi" + }; };
arch/arm/boot/dts/omap446x-clocks.dtsi new file +27 -0
@@ -0,0 +1,27 @@ +/* + * Device Tree Source for OMAP446x clock data + * + * Copyright (C) 2013 Texas Instruments, Inc. + * + * 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. + */ + +div_ts_ck: div_ts_ck at 4a307888 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&l4_wkup_clk_mux_ck>; + bit-shift = <24>; + reg = <0x4a307888 0x4>; + table = < 8 0 >, < 16 1 >, < 32 2 >; + bit-mask = <0x3>; +}; + +bandgap_ts_fclk: bandgap_ts_fclk at 4a307888 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&div_ts_ck>; + bit-shift = <8>; + reg = <0x4a307888 0x4>; +};
arch/arm/boot/dts/omap44xx-clocks.dtsi new file +1648 -0
1,648 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v5 6/31 ARM: dts: omap4 clock data
Quoted 279 lines · On Friday 02 of August 2013 19:25:25 Tero Kristo wrote:
This patch creates a unique node for each clock in the OMAP4 power, reset and clock manager (PRCM). OMAP443x and OMAP446x have slightly different clock tree which is taken into account in the data.
Signed-off-by Tero Kristo <[email protected]>--- arch/arm/boot/dts/omap443x-clocks.dtsi | 17 + arch/arm/boot/dts/omap443x.dtsi | 8 + arch/arm/boot/dts/omap4460.dtsi | 8 + arch/arm/boot/dts/omap446x-clocks.dtsi | 27 + arch/arm/boot/dts/omap44xx-clocks.dtsi | 1648 ++++++++++++++++++++++++++++++++ 5 files changed, 1708 insertions(+) create mode 100644 arch/arm/boot/dts/omap443x-clocks.dtsi create mode 100644 arch/arm/boot/dts/omap446x-clocks.dtsi create mode 100644 arch/arm/boot/dts/omap44xx-clocks.dtsi(quoted diff) +0
-0
b/arch/arm/boot/dts/omap443x-clocks.dtsinew file mode 100644 index 0000000..2bd82b2arch/arm/boot/dts/omap443x-clocks.dtsi new file +7
-0@@ -0,0 +1,17 @@ +/* + * Device Tree Source for OMAP443x clock data + * + * Copyright (C) 2013 Texas Instruments, Inc. + * + * 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.
+ */arch/arm/boot/dts/omap443x-clocks.dtsi new file +8
-0+ +bandgap_fclk: bandgap_fclk at 4a307888 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&sys_32k_ck>; + bit-shift = <8>; + reg = <0x4a307888 0x4>; +};(quoted diff) +0
-0
b/arch/arm/boot/dts/omap443x.dtsiindex bcf455e..dfd648c 100644arch/arm/boot/dts/omap443x.dtsi +8
-0@@ -30,4 +30,12 @@ 0x4a00232C 0x4>; compatible = "ti,omap4430-bandgap"; }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + /include/ "omap44xx-clocks.dtsi" + /include/ "omap443x-clocks.dtsi" + }; };(quoted diff) +0
-0
b/arch/arm/boot/dts/omap4460.dtsiindex c2f0f39..d9d00b2 100644arch/arm/boot/dts/omap4460.dtsi +8
-0@@ -38,4 +38,12 @@ interrupts = <0 126 IRQ_TYPE_LEVEL_HIGH>; /* talert */ gpios = <&gpio3 22 0>; /* tshut */ }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + /include/ "omap44xx-clocks.dtsi" + /include/ "omap446x-clocks.dtsi" + }; };(quoted diff) +0
-0
b/arch/arm/boot/dts/omap446x-clocks.dtsinew file mode 100644 index 0000000..86d0805arch/arm/boot/dts/omap446x-clocks.dtsi new file +7
-0@@ -0,0 +1,27 @@ +/* + * Device Tree Source for OMAP446x clock data + * + * Copyright (C) 2013 Texas Instruments, Inc. + * + * 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.
+ */arch/arm/boot/dts/omap446x-clocks.dtsi new file +18
-0+ +div_ts_ck: div_ts_ck at 4a307888 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&l4_wkup_clk_mux_ck>; + bit-shift = <24>; + reg = <0x4a307888 0x4>; + table = < 8 0 >, < 16 1 >, < 32 2 >; + bit-mask = <0x3>; +}; + +bandgap_ts_fclk: bandgap_ts_fclk at 4a307888 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&div_ts_ck>; + bit-shift = <8>; + reg = <0x4a307888 0x4>; +};(quoted diff) +0
-0
b/arch/arm/boot/dts/omap44xx-clocks.dtsinew file mode 100644 index 0000000..23f623carch/arm/boot/dts/omap44xx-clocks.dtsi new file +7
-0@@ -0,0 +1,1648 @@ +/* + * Device Tree Source for OMAP4 clock data + * + * Copyright (C) 2013 Texas Instruments, Inc. + * + * 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.
+ */arch/arm/boot/dts/omap44xx-clocks.dtsi new file +99
-0+ +extalt_clkin_ck: extalt_clkin_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <59000000>; +}; + +pad_clks_src_ck: pad_clks_src_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <12000000>; +}; + +pad_clks_ck: pad_clks_ck at 4a004108 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&pad_clks_src_ck>; + bit-shift = <8>; + reg = <0x4a004108 0x4>; +}; + +pad_slimbus_core_clks_ck: pad_slimbus_core_clks_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <12000000>; +}; + +secure_32k_clk_src_ck: secure_32k_clk_src_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <32768>; +}; + +slimbus_src_clk: slimbus_src_clk { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <12000000>; +}; + +slimbus_clk: slimbus_clk at 4a004108 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&slimbus_src_clk>; + bit-shift = <10>; + reg = <0x4a004108 0x4>; +}; + +sys_32k_ck: sys_32k_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <32768>; +}; + +virt_12000000_ck: virt_12000000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <12000000>; +}; + +virt_13000000_ck: virt_13000000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <13000000>; +}; + +virt_16800000_ck: virt_16800000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <16800000>; +}; + +virt_19200000_ck: virt_19200000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <19200000>; +}; + +virt_26000000_ck: virt_26000000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <26000000>; +}; + +virt_27000000_ck: virt_27000000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <27000000>; +}; + +virt_38400000_ck: virt_38400000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <38400000>; +}; + +sys_clkin_ck: sys_clkin_ck at 4a306110 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&virt_12000000_ck>, <&virt_13000000_ck>,<
&virt_16800000_ck>, <&virt_19200000_ck>, <&virt_26000000_ck>,
<&virt_27000000_ck>, <&virt_38400000_ck>; + reg = <0x4a3061100x4>;arch/arm/boot/dts/omap44xx-clocks.dtsi new file +56
-0+ bit-mask = <0x7>; + index-starts-at-one; +}; + +tie_low_clock_ck: tie_low_clock_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; +}; + +utmi_phy_clkout_ck: utmi_phy_clkout_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <60000000>; +}; + +xclk60mhsp1_ck: xclk60mhsp1_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <60000000>; +}; + +xclk60mhsp2_ck: xclk60mhsp2_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <60000000>; +}; + +xclk60motg_ck: xclk60motg_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <60000000>; +}; + +abe_dpll_bypass_clk_mux_ck: abe_dpll_bypass_clk_mux_ck at 4a306108 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&sys_clkin_ck>, <&sys_32k_ck>; + bit-shift = <24>; + reg = <0x4a306108 0x4>; + bit-mask = <0x1>; +}; + +abe_dpll_refclk_mux_ck: abe_dpll_refclk_mux_ck at 4a30610c { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&sys_clkin_ck>, <&sys_32k_ck>; + reg = <0x4a30610c 0x4>; + bit-mask = <0x1>; +}; + +dpll_abe_ck: dpll_abe_ck at 4a0041e0 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-m4xen-clock"; + clocks = <&abe_dpll_refclk_mux_ck>, <&abe_dpll_bypass_clk_mux_ck>; + reg = <0x4a0041e0 0x4>, <0x4a0041e4 0x4>, <0x4a0041e8 0x4>,<
0x4a0041ec0x4>; + ti,clk-ref = <&abe_dpll_refclk_mux_ck>;
arch/arm/boot/dts/omap44xx-clocks.dtsi line 167
Quoted 1 line
arch/arm/boot/dts/omap44xx-clocks.dtsi new file +1
-0+ ti,clk-bypass = <&abe_dpll_bypass_clk_mux_ck>;
Hmm, why do you need to pass references to other clocks using private properties? Is there a reason you can't use the clocks and clock-names properties defined by standard clock bindings?
The same for other PLLs defined in this patch.
Best regards,
Tomasz
PATCH v5 6/31 ARM: dts: omap4 clock data
Quoted 286 lines · Tomasz Figa
Quoted 279 lines · On Friday 02 of August 2013 19:25:25 Tero Kristo wrote:
This patch creates a unique node for each clock in the OMAP4 power, reset and clock manager (PRCM). OMAP443x and OMAP446x have slightly different clock tree which is taken into account in the data.
Signed-off-by Tero Kristo <[email protected]>--- arch/arm/boot/dts/omap443x-clocks.dtsi | 17 + arch/arm/boot/dts/omap443x.dtsi | 8 + arch/arm/boot/dts/omap4460.dtsi | 8 + arch/arm/boot/dts/omap446x-clocks.dtsi | 27 + arch/arm/boot/dts/omap44xx-clocks.dtsi | 1648++++++++++++++++++++++++++++++++ 5 files changed, 1708 insertions(+)
create mode 100644arch/arm/boot/dts/omap443x-clocks.dtsicreate mode 100644arch/arm/boot/dts/omap446x-clocks.dtsicreate mode 100644arch/arm/boot/dts/omap44xx-clocks.dtsi(quoted diff) +0
-0
b/arch/arm/boot/dts/omap443x-clocks.dtsinew file mode 100644 index 0000000..2bd82b2arch/arm/boot/dts/omap443x-clocks.dtsi new file +7
-0@@ -0,0 +1,17 @@ +/* + * Device Tree Source for OMAP443x clock data + * + * Copyright (C) 2013 Texas Instruments, Inc. + * + * 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.
+ */arch/arm/boot/dts/omap443x-clocks.dtsi new file +8
-0+ +bandgap_fclk: bandgap_fclk at 4a307888 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&sys_32k_ck>; + bit-shift = <8>; + reg = <0x4a307888 0x4>; +};(quoted diff) +0
-0
b/arch/arm/boot/dts/omap443x.dtsiindex bcf455e..dfd648c 100644arch/arm/boot/dts/omap443x.dtsi +8
-0@@ -30,4 +30,12 @@ 0x4a00232C 0x4>; compatible = "ti,omap4430-bandgap"; }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + /include/ "omap44xx-clocks.dtsi" + /include/ "omap443x-clocks.dtsi" + }; };(quoted diff) +0
-0
b/arch/arm/boot/dts/omap4460.dtsiindex c2f0f39..d9d00b2 100644arch/arm/boot/dts/omap4460.dtsi +8
-0@@ -38,4 +38,12 @@ interrupts = <0 126 IRQ_TYPE_LEVEL_HIGH>; /* talert */ gpios = <&gpio3 22 0>; /* tshut */ }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + /include/ "omap44xx-clocks.dtsi" + /include/ "omap446x-clocks.dtsi" + }; };(quoted diff) +0
-0
b/arch/arm/boot/dts/omap446x-clocks.dtsinew file mode 100644 index 0000000..86d0805arch/arm/boot/dts/omap446x-clocks.dtsi new file +7
-0@@ -0,0 +1,27 @@ +/* + * Device Tree Source for OMAP446x clock data + * + * Copyright (C) 2013 Texas Instruments, Inc. + * + * 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.
+ */arch/arm/boot/dts/omap446x-clocks.dtsi new file +18
-0+ +div_ts_ck: div_ts_ck at 4a307888 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&l4_wkup_clk_mux_ck>; + bit-shift = <24>; + reg = <0x4a307888 0x4>; + table = < 8 0 >, < 16 1 >, < 32 2 >; + bit-mask = <0x3>; +}; + +bandgap_ts_fclk: bandgap_ts_fclk at 4a307888 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&div_ts_ck>; + bit-shift = <8>; + reg = <0x4a307888 0x4>; +};(quoted diff) +0
-0
b/arch/arm/boot/dts/omap44xx-clocks.dtsinew file mode 100644 index 0000000..23f623carch/arm/boot/dts/omap44xx-clocks.dtsi new file +7
-0@@ -0,0 +1,1648 @@ +/* + * Device Tree Source for OMAP4 clock data + * + * Copyright (C) 2013 Texas Instruments, Inc. + * + * 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.
+ */arch/arm/boot/dts/omap44xx-clocks.dtsi new file +99
-0+ +extalt_clkin_ck: extalt_clkin_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <59000000>; +}; + +pad_clks_src_ck: pad_clks_src_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <12000000>; +}; + +pad_clks_ck: pad_clks_ck at 4a004108 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&pad_clks_src_ck>; + bit-shift = <8>; + reg = <0x4a004108 0x4>; +}; + +pad_slimbus_core_clks_ck: pad_slimbus_core_clks_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <12000000>; +}; + +secure_32k_clk_src_ck: secure_32k_clk_src_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <32768>; +}; + +slimbus_src_clk: slimbus_src_clk { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <12000000>; +}; + +slimbus_clk: slimbus_clk at 4a004108 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&slimbus_src_clk>; + bit-shift = <10>; + reg = <0x4a004108 0x4>; +}; + +sys_32k_ck: sys_32k_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <32768>; +}; + +virt_12000000_ck: virt_12000000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <12000000>; +}; + +virt_13000000_ck: virt_13000000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <13000000>; +}; + +virt_16800000_ck: virt_16800000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <16800000>; +}; + +virt_19200000_ck: virt_19200000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <19200000>; +}; + +virt_26000000_ck: virt_26000000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <26000000>; +}; + +virt_27000000_ck: virt_27000000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <27000000>; +}; + +virt_38400000_ck: virt_38400000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <38400000>; +}; + +sys_clkin_ck: sys_clkin_ck at 4a306110 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&virt_12000000_ck>, <&virt_13000000_ck>,<
&virt_16800000_ck>, <&virt_19200000_ck>, <&virt_26000000_ck>,
<&virt_27000000_ck>, <&virt_38400000_ck>; + reg = <0x4a3061100x4>;arch/arm/boot/dts/omap44xx-clocks.dtsi new file +56
-0+ bit-mask = <0x7>; + index-starts-at-one; +}; + +tie_low_clock_ck: tie_low_clock_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; +}; + +utmi_phy_clkout_ck: utmi_phy_clkout_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <60000000>; +}; + +xclk60mhsp1_ck: xclk60mhsp1_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <60000000>; +}; + +xclk60mhsp2_ck: xclk60mhsp2_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <60000000>; +}; + +xclk60motg_ck: xclk60motg_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <60000000>; +}; + +abe_dpll_bypass_clk_mux_ck: abe_dpll_bypass_clk_mux_ck at 4a306108 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&sys_clkin_ck>, <&sys_32k_ck>; + bit-shift = <24>; + reg = <0x4a306108 0x4>; + bit-mask = <0x1>; +}; + +abe_dpll_refclk_mux_ck: abe_dpll_refclk_mux_ck at 4a30610c { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&sys_clkin_ck>, <&sys_32k_ck>; + reg = <0x4a30610c 0x4>; + bit-mask = <0x1>; +}; + +dpll_abe_ck: dpll_abe_ck at 4a0041e0 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-m4xen-clock"; + clocks = <&abe_dpll_refclk_mux_ck>, <&abe_dpll_bypass_clk_mux_ck>; + reg = <0x4a0041e0 0x4>, <0x4a0041e4 0x4>, <0x4a0041e8 0x4>,<
0x4a0041ec0x4>; + ti,clk-ref = <&abe_dpll_refclk_mux_ck>;arch/arm/boot/dts/omap44xx-clocks.dtsi line 167
Quoted 1 line
arch/arm/boot/dts/omap44xx-clocks.dtsi new file +1
-0+ ti,clk-bypass = <&abe_dpll_bypass_clk_mux_ck>;Hmm, why do you need to pass references to other clocks using private properties? Is there a reason you can't use the clocks and clock-names properties defined by standard clock bindings?
Quoted 1 line
The same for other PLLs defined in this patch.
Will be changed for next rev, clk-bypass / clk-ref will be populated from clocks property directly.
-Tero
PATCH v5 7/31 CLK: TI: add omap4 clock init file
In reply to Tero Kristoclk-44xx.c now contains the clock init functionality for omap4, including DT clock registration and adding of static clkdev entries.
--- arch/arm/mach-omap2/clock.h | 1 - drivers/clk/ti/clk-44xx.c | 118 +++++++++++++++++++++++++++++++++++++++++++ include/linux/clk/ti.h | 1 + 3 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 drivers/clk/ti/clk-44xx.c
arch/arm/mach-omap2/clock.h +0 -1
@@ -267,7 +267,6 @@ void omap2_clk_dflt_find_idlest(struct clk_hw_omap *clk,void __iomem **idlest_reg, u8 *idlest_bit, u8 *idlest_val);int omap2_clk_enable_autoidle_all (void ); -int omap2_clk_disable_autoidle_all (void );void omap2_clk_enable_init_clocks (const char **clk_names,u8 num_clocks);int omap2_clk_switch_mpurate_at_boot (const char *mpurate_ck_name); void omap2_clk_print_new_rates(const char *hfclkin_ck_name,
drivers/clk/ti/clk-44xx.c new file +118 -0
118 lines not on this page · raw message
include/linux/clk/ti.h +1 -0
@@ -178,6 +178,7 @@ unsigned long omap3_clkoutx2_recalc(struct clk_hw *hw, unsigned long parent_rate);int omap2_clkops_enable_clkdm (struct clk_hw *hw);void omap2_clkops_disable_clkdm (struct clk_hw *hw); +int omap2_clk_disable_autoidle_all (void );int omap3_dpll4_set_rate (struct clk_hw *clk,unsigned long rate,unsigned long parent_rate);int omap2_dflt_clk_enable (struct clk_hw *hw);
Signature · 1 line
1.7.9.5
Tony Lindgren
maintainerPATCH v5 7/31 CLK: TI: add omap4 clock init file
Quoted 2 lines · Tero Kristo
clk-44xx.cnow contains the clock init functionality for omap4, including DT clock registration and adding of static clkdev entries.
Few comments below from "boot new hardware with old kernels" point of view that seems to be pretty close for clocks.
Quoted 2 lines
drivers/clk/ti/clk-44xx.c new file +0
-0
...
Quoted 28 lines
drivers/clk/ti/clk-44xx.c new file +28
-0+int __init omap4xxx_clk_init (void ) +{ +int rc; +struct clk *abe_dpll_ref, *abe_dpll, *sys_32k_ck, *usb_dpll; + +/* FIXME register clocks from DT first */ +of_clk_init (NULL ); + +omap_dt_clocks_register (omap44xx_clks); + +omap2_clk_disable_autoidle_all (); + +/* +* On OMAP4460 the ABE DPLL fails to turn on if in idle low-power +* state when turning the ABE clock domain. Workaround this by +* locking the ABE DPLL on boot. +* Lock the ABE DPLL in any case to avoid issues with audio. +*/ + abe_dpll_ref =clk_get_sys (NULL ,"abe_dpll_refclk_mux_ck" ); + sys_32k_ck =clk_get_sys (NULL ,"sys_32k_ck" ); + rc =clk_set_parent (abe_dpll_ref, sys_32k_ck); + abe_dpll =clk_get_sys (NULL ,"dpll_abe_ck" ); +if (!rc) + rc =clk_set_rate (abe_dpll,OMAP4_DPLL_ABE_DEFFREQ ); +if (rc) +pr_err ("%s: failed to configure ABE DPLL!\n" , __func__); + +/*
drivers/clk/ti/clk-44xx.c line 118
Quoted 10 lines
drivers/clk/ti/clk-44xx.c new file +10
-0+* Lock USB DPLL on OMAP4 devices so that the L3INIT power +* domain can transition to retention state when not in use. +*/ + usb_dpll =clk_get_sys (NULL ,"dpll_usb_ck" ); + rc =clk_set_rate (usb_dpll,OMAP4_DPLL_USB_DEFFREQ ); +if (rc) +pr_err ("%s: failed to configure USB DPLL!\n" , __func__); + +return 0 ; +}
Maybe try to have a generic init function, then have SoC specific quirk function pointers set up based on the DT compatible property?
Grep for varioius _of_match[] examples in the drivers.
That way you might be able to make clocks work for some new similar hardware with just .dts change and patching in the quirks later on as needed ;)
Regards,
Tony
PATCH v5 7/31 CLK: TI: add omap4 clock init file
Quoted 53 lines · Tony Lindgren
Quoted 2 lines · Tero Kristo
clk-44xx.cnow contains the clock init functionality for omap4, including DT clock registration and adding of static clkdev entries.Few comments below from "boot new hardware with old kernels" point of view that seems to be pretty close for clocks.
Quoted 2 lines
drivers/clk/ti/clk-44xx.c new file +0
-0...
Quoted 28 lines
drivers/clk/ti/clk-44xx.c new file +28
-0+int __init omap4xxx_clk_init (void ) +{ +int rc; +struct clk *abe_dpll_ref, *abe_dpll, *sys_32k_ck, *usb_dpll; + +/* FIXME register clocks from DT first */ +of_clk_init (NULL ); + +omap_dt_clocks_register (omap44xx_clks); + +omap2_clk_disable_autoidle_all (); + +/* +* On OMAP4460 the ABE DPLL fails to turn on if in idle low-power +* state when turning the ABE clock domain. Workaround this by +* locking the ABE DPLL on boot. +* Lock the ABE DPLL in any case to avoid issues with audio. +*/ + abe_dpll_ref =clk_get_sys (NULL ,"abe_dpll_refclk_mux_ck" ); + sys_32k_ck =clk_get_sys (NULL ,"sys_32k_ck" ); + rc =clk_set_parent (abe_dpll_ref, sys_32k_ck); + abe_dpll =clk_get_sys (NULL ,"dpll_abe_ck" ); +if (!rc) + rc =clk_set_rate (abe_dpll,OMAP4_DPLL_ABE_DEFFREQ ); +if (rc) +pr_err ("%s: failed to configure ABE DPLL!\n" , __func__); + +/* drivers/clk/ti/clk-44xx.c line 118
Quoted 10 lines
drivers/clk/ti/clk-44xx.c new file +10
-0+* Lock USB DPLL on OMAP4 devices so that the L3INIT power +* domain can transition to retention state when not in use. +*/ + usb_dpll =clk_get_sys (NULL ,"dpll_usb_ck" ); + rc =clk_set_rate (usb_dpll,OMAP4_DPLL_USB_DEFFREQ ); +if (rc) +pr_err ("%s: failed to configure USB DPLL!\n" , __func__); + +return 0 ; +}Maybe try to have a generic init function, then have SoC specific quirk function pointers set up based on the DT compatible property?
Quoted 5 lines
Grep for varioius _of_match[] examples in the drivers.
That way you might be able to make clocks work for some new similar hardware with just .dts change and patching in the quirks later on as needed ;)
I'll see what can be done for this once I figure out what to do with the clkdev alias stuff. :)
-Tero
Quoted 5 lines
Regards,
Tony
PATCH v5 8/31 ARM: OMAP4: remove old clock data and link in new clock init code
In reply to Tero KristoOMAP4 clocks have now been moved to DT, thus remove the old data file and use the new init code under drivers/clk/omap/clk-44xx.c.
--- arch/arm/mach-omap2/Makefile | 2 +- arch/arm/mach-omap2/cclock44xx_data.c | 1730 --------------------------------- drivers/clk/ti/Makefile | 3 +- 3 files changed, 3 insertions(+), 1732 deletions(-) delete mode 100644 arch/arm/mach-omap2/cclock44xx_data.c
arch/arm/mach-omap2/Makefile +1 -1
@@ -175,7 +175,7 @@ obj-$(CONFIG_ARCH_OMAP3) += clock34xx.o clkt34xx_dpll3m2.o obj-$(CONFIG_ARCH_OMAP3) += clock3517.o clock36xx.o obj-$(CONFIG_ARCH_OMAP3) += dpll3xxx.o cclock3xxx_data.o obj-$(CONFIG_ARCH_OMAP3) += clkt_iclk.o -obj-$(CONFIG_ARCH_OMAP4) += $(clock-common) cclock44xx_data.o +obj-$(CONFIG_ARCH_OMAP4) += $(clock-common) obj-$(CONFIG_ARCH_OMAP4) += dpll3xxx.o dpll44xx.o obj-$(CONFIG_SOC_AM33XX) += $(clock-common) dpll3xxx.o obj-$(CONFIG_SOC_AM33XX) += cclock33xx_data.o
arch/arm/mach-omap2/cclock44xx_data.c deleted +0 -1730
1,730 lines not on this page · raw message
drivers/clk/ti/Makefile +2 -1
@@ -1,3 +1,4 @@ ifneq ($(CONFIG_OF),) -obj-y += clk.o dpll.o autoidle.o gate.o +obj-y += clk.o dpll.o autoidle.o gate.o \ + clk-44xx.o endif
Signature · 1 line
1.7.9.5
PATCH v5 9/31 ARM: dts: omap5 clock data
In reply to Tero KristoThis patch creates a unique node for each clock in the OMAP5 power, reset and clock manager (PRCM).
--- arch/arm/boot/dts/omap5.dtsi | 7 + arch/arm/boot/dts/omap54xx-clocks.dtsi | 1410 ++++++++++++++++++++++++++++++++ 2 files changed, 1417 insertions(+) create mode 100644 arch/arm/boot/dts/omap54xx-clocks.dtsi
arch/arm/boot/dts/omap5.dtsi +7 -0
@@ -713,4 +713,11 @@ compatible = "ti,omap5430-bandgap"; }; }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + /include/ "omap54xx-clocks.dtsi" + }; };
arch/arm/boot/dts/omap54xx-clocks.dtsi new file +1410 -0
1,410 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v5 10/31 CLK: TI: add omap5 clock init file
In reply to Tero Kristoclk-54xx.c now contains the clock init functionality for omap5, including DT clock registration and adding of static clkdev entries.
--- arch/arm/mach-omap2/io.c | 1 + drivers/clk/ti/Makefile | 2 +- drivers/clk/ti/clk-54xx.c | 59 +++++++++++++++++++++++++++++++++++++++++++++ include/linux/clk/ti.h | 2 ++ 4 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 drivers/clk/ti/clk-54xx.c
arch/arm/mach-omap2/io.c +1 -0
@@ -650,6 +650,7 @@ void __init omap5_init_early(void)omap54xx_clockdomains_init ();omap54xx_hwmod_init ();omap_hwmod_init_postsetup (); + omap_clk_init = omap5xxx_clk_init; }#endif
drivers/clk/ti/Makefile +1 -1
@@ -1,4 +1,4 @@ ifneq ($(CONFIG_OF),) obj-y += clk.o dpll.o autoidle.o gate.o \ - clk-44xx.o + clk-44xx.o clk-54xx.o endif
drivers/clk/ti/clk-54xx.c new file +59 -0
59 lines not on this page · raw message
include/linux/clk/ti.h +2 -0
@@ -194,6 +194,8 @@ static inline void of_omap_clk_allow_autoidle_all(void) { }static inline void of_omap_clk_deny_autoidle_all (void ) { }#endif +int omap5xxx_clk_init (void ); +extern const struct clk_hw_omap_ops clkhwops_omap3_dpll;extern const struct clk_hw_omap_ops clkhwops_omap4_dpllmx;extern const struct clk_hw_omap_ops clkhwops_wait;
Signature · 1 line
1.7.9.5
PATCH v5 11/31 CLK: TI: omap5: Initialize USB_DPLL at boot
In reply to Tero KristoFrom: Roger Quadros <[email protected]>
USB_DPLL must be initialized and locked at boot so that USB modules can work.
--- drivers/clk/ti/clk-54xx.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
drivers/clk/ti/clk-54xx.c +17 -1
@@ -19,6 +19,12 @@#define OMAP5_DPLL_ABE_DEFFREQ 98304000 +/* +* OMAP543x TRM, section "3.6.3.9.5 DPLL_USB Preferred Settings" +* states it must be at 960MHz +*/ +#define OMAP5_DPLL_USB_DEFFREQ 960000000 +static struct omap_dt_clk omap54xx_clks[] = {DT_CLK (NULL ,"timer_32k_ck" ,"sys_32k_ck" ),DT_CLK ("omap_timer.1" ,"sys_ck" ,"sys_clkin" ),
@@ -38,7 +44,7 @@ static struct omap_dt_clk omap54xx_clks[] = {int __init omap5xxx_clk_init (void ) {int rc; -struct clk *abe_dpll_ref, *abe_dpll, *sys_32k_ck; +struct clk *abe_dpll_ref, *abe_dpll, *sys_32k_ck, *usb_dpll;of_clk_init (NULL );
@@ -55,5 +61,15 @@ int __init omap5xxx_clk_init(void)if (rc)pr_err ("%s: failed to configure ABE DPLL!\n" , __func__); + usb_dpll =clk_get_sys (NULL ,"dpll_usb_ck" ); + rc =clk_set_rate (usb_dpll,OMAP5_DPLL_USB_DEFFREQ ); +if (rc) +pr_err ("%s: failed to configure USB DPLL!\n" , __func__); + + usb_dpll =clk_get_sys (NULL ,"dpll_usb_m2_ck" ); + rc =clk_set_rate (usb_dpll,OMAP5_DPLL_USB_DEFFREQ /2 ); +if (rc) +pr_err ("%s: failed to set USB_DPLL M2 OUT\n" , __func__); +return 0 ; }
Signature · 1 line
1.7.9.5
PATCH v5 12/31 ARM: dts: dra7 clock data
In reply to Tero KristoThis patch creates a unique node for each clock in the DRA7 power, reset and clock manager (PRCM).
TODO: apll_pcie clock node is still a dummy in this version, and proper support for the APLL should be added.
--- arch/arm/boot/dts/dra7xx-clocks.dtsi | 2073 ++++++++++++++++++++++++++++++++++ 1 file changed, 2073 insertions(+) create mode 100644 arch/arm/boot/dts/dra7xx-clocks.dtsi
arch/arm/boot/dts/dra7xx-clocks.dtsi new file +2073 -0
@@ -0,0 +1,2073 @@ +/* + * Device Tree Source for DRA7xx clock data + * + * Copyright (C) 2013 Texas Instruments, Inc. + * + * 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. + */ + +atl_clkin0_ck: atl_clkin0_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; +}; + +atl_clkin1_ck: atl_clkin1_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; +}; + +atl_clkin2_ck: atl_clkin2_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; +}; + +atlclkin3_ck: atlclkin3_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; +}; + +hdmi_clkin_ck: hdmi_clkin_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; +}; + +mlb_clkin_ck: mlb_clkin_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; +}; + +mlbp_clkin_ck: mlbp_clkin_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; +}; + +pciesref_acs_clk_ck: pciesref_acs_clk_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <100000000>; +}; + +ref_clkin0_ck: ref_clkin0_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; +}; + +ref_clkin1_ck: ref_clkin1_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; +}; + +ref_clkin2_ck: ref_clkin2_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; +}; + +ref_clkin3_ck: ref_clkin3_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; +}; + +rmii_clk_ck: rmii_clk_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; +}; + +sdvenc_clkin_ck: sdvenc_clkin_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; +}; + +secure_32k_clk_src_ck: secure_32k_clk_src_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <32768>; +}; + +sys_32k_ck: sys_32k_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <32768>; +}; + +virt_12000000_ck: virt_12000000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <12000000>; +}; + +virt_13000000_ck: virt_13000000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <13000000>; +}; + +virt_16800000_ck: virt_16800000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <16800000>; +}; + +virt_19200000_ck: virt_19200000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <19200000>; +}; + +virt_20000000_ck: virt_20000000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <20000000>; +}; + +virt_26000000_ck: virt_26000000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <26000000>; +}; + +virt_27000000_ck: virt_27000000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <27000000>; +}; + +virt_38400000_ck: virt_38400000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <38400000>; +}; + +sys_clkin1: sys_clkin1 at 4ae06110 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&virt_12000000_ck>, <&virt_20000000_ck>, <&virt_16800000_ck>, <&virt_19200000_ck>, <&virt_26000000_ck>, <&virt_27000000_ck>, <&virt_38400000_ck>; + reg = <0x4ae06110 0x4>; + bit-mask = <0x7>; + index-starts-at-one; +}; + +sys_clkin2: sys_clkin2 { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <22579200>; +}; + +usb_otg_clkin_ck: usb_otg_clkin_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; +}; + +video1_clkin_ck: video1_clkin_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; +}; + +video1_m2_clkin_ck: video1_m2_clkin_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; +}; + +video2_clkin_ck: video2_clkin_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; +}; + +video2_m2_clkin_ck: video2_m2_clkin_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <0>; +}; + +abe_dpll_sys_clk_mux: abe_dpll_sys_clk_mux at 4ae06118 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&sys_clkin1>, <&sys_clkin2>; + reg = <0x4ae06118 0x4>; + bit-mask = <0x1>; +}; + +abe_dpll_bypass_clk_mux: abe_dpll_bypass_clk_mux at 4ae06114 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&abe_dpll_sys_clk_mux>, <&sys_32k_ck>; + reg = <0x4ae06114 0x4>; + bit-mask = <0x1>; +}; + +abe_dpll_clk_mux: abe_dpll_clk_mux at 4ae0610c { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&abe_dpll_sys_clk_mux>, <&sys_32k_ck>; + reg = <0x4ae0610c 0x4>; + bit-mask = <0x1>; +}; + +dpll_abe_ck: dpll_abe_ck at 4a0051e0 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-m4xen-clock"; + clocks = <&abe_dpll_clk_mux>, <&abe_dpll_bypass_clk_mux>; + reg = <0x4a0051e0 0x4>, <0x4a0051e4 0x4>, <0x4a0051e8 0x4>, <0x4a0051ec 0x4>; + ti,clk-ref = <&abe_dpll_clk_mux>; + ti,clk-bypass = <&abe_dpll_bypass_clk_mux>; +}; + +dpll_abe_x2_ck: dpll_abe_x2_ck { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-x2-clock"; + clocks = <&dpll_abe_ck>; +}; + +dpll_abe_m2x2_ck: dpll_abe_m2x2_ck at 4a0051f0 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_abe_x2_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a0051f0 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; + ti,autoidle-low; +}; + +abe_24m_fclk: abe_24m_fclk at 4ae0611c { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&dpll_abe_m2x2_ck>; + reg = <0x4ae0611c 0x4>; + table = < 8 0 >, < 16 1 >; + bit-mask = <0x1>; +}; + +abe_clk: abe_clk at 4a005108 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&dpll_abe_m2x2_ck>; + reg = <0x4a005108 0x4>; + bit-mask = <0x3>; + index-power-of-two; +}; + +aess_fclk: aess_fclk at 4ae06178 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&abe_clk>; + reg = <0x4ae06178 0x4>; + bit-mask = <0x1>; +}; + +abe_giclk_div: abe_giclk_div at 4ae06174 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&aess_fclk>; + reg = <0x4ae06174 0x4>; + bit-mask = <0x1>; +}; + +abe_lp_clk_div: abe_lp_clk_div at 4ae061d8 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&dpll_abe_m2x2_ck>; + reg = <0x4ae061d8 0x4>; + table = < 16 0 >, < 32 1 >; + bit-mask = <0x1>; +}; + +abe_sys_clk_div: abe_sys_clk_div at 4ae06120 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&sys_clkin1>; + reg = <0x4ae06120 0x4>; + bit-mask = <0x1>; +}; + +adc_gfclk_mux: adc_gfclk_mux at 4ae061dc { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&sys_clkin1>, <&sys_clkin2>, <&sys_32k_ck>; + reg = <0x4ae061dc 0x4>; + bit-mask = <0x7>; +}; + +dpll_pcie_ref_ck: dpll_pcie_ref_ck at 4a008200 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-clock"; + clocks = <&sys_clkin1>; + reg = <0x4a008200 0x4>, <0x4a008204 0x4>, <0x4a008208 0x4>, <0x4a00820c 0x4>; + ti,clk-ref = <&sys_clkin1>; + ti,clk-bypass = <&sys_clkin1>; +}; + +dpll_pcie_ref_m2ldo_ck: dpll_pcie_ref_m2ldo_ck at 4a008210 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_pcie_ref_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a008210 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; + ti,autoidle-low; +}; + +apll_pcie_ck: apll_pcie_ck at 4a008200 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-clock"; + clocks = <&dpll_pcie_ref_ck>; + reg = <0x4a008200 0x4>, <0x4a008204 0x4>, <0x4a008208 0x4>, <0x4a00820c 0x4>; + ti,clk-ref = <&dpll_pcie_ref_ck>; + ti,clk-bypass = <&dpll_pcie_ref_ck>; +}; + +apll_pcie_clkvcoldo: apll_pcie_clkvcoldo { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&apll_pcie_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +apll_pcie_clkvcoldo_div: apll_pcie_clkvcoldo_div { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&apll_pcie_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +apll_pcie_m2_ck: apll_pcie_m2_ck at 4a008224 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&apll_pcie_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a008224 0x4>; + bit-mask = <0x7f>; + index-starts-at-one; + ti,autoidle-low; +}; + +sys_clk1_dclk_div: sys_clk1_dclk_div at 4ae061c8 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&sys_clkin1>; + reg = <0x4ae061c8 0x4>; + bit-mask = <0x7>; + index-power-of-two; +}; + +sys_clk2_dclk_div: sys_clk2_dclk_div at 4ae061cc { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&sys_clkin2>; + reg = <0x4ae061cc 0x4>; + bit-mask = <0x7>; + index-power-of-two; +}; + +dpll_abe_m2_ck: dpll_abe_m2_ck at 4a0051f0 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_abe_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a0051f0 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; + ti,autoidle-low; +}; + +per_abe_x1_dclk_div: per_abe_x1_dclk_div at 4ae061bc { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&dpll_abe_m2_ck>; + reg = <0x4ae061bc 0x4>; + bit-mask = <0x7>; + index-power-of-two; +}; + +dpll_abe_m3x2_ck: dpll_abe_m3x2_ck at 4a0051f4 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_abe_x2_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a0051f4 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dpll_core_ck: dpll_core_ck at 4a005120 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-core-clock"; + clocks = <&sys_clkin1>, <&dpll_abe_m3x2_ck>; + reg = <0x4a005120 0x4>, <0x4a005124 0x4>, <0x4a005128 0x4>, <0x4a00512c 0x4>; + ti,clk-ref = <&sys_clkin1>; + ti,clk-bypass = <&dpll_abe_m3x2_ck>; +}; + +dpll_core_x2_ck: dpll_core_x2_ck { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-x2-clock"; + clocks = <&dpll_core_ck>; +}; + +dpll_core_h12x2_ck: dpll_core_h12x2_ck at 4a00513c { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_core_x2_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a00513c 0x4>; + bit-mask = <0x3f>; + index-starts-at-one; + ti,autoidle-low; +}; + +mpu_dpll_hs_clk_div: mpu_dpll_hs_clk_div { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_core_h12x2_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +dpll_mpu_ck: dpll_mpu_ck at 4a005160 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-clock"; + clocks = <&sys_clkin1>, <&mpu_dpll_hs_clk_div>; + reg = <0x4a005160 0x4>, <0x4a005164 0x4>, <0x4a005168 0x4>, <0x4a00516c 0x4>; + ti,clk-ref = <&sys_clkin1>; + ti,clk-bypass = <&mpu_dpll_hs_clk_div>; +}; + +dpll_mpu_m2_ck: dpll_mpu_m2_ck at 4a005170 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_mpu_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a005170 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; + ti,autoidle-low; +}; + +mpu_dclk_div: mpu_dclk_div { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_mpu_m2_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +dsp_dpll_hs_clk_div: dsp_dpll_hs_clk_div { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_core_h12x2_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +dpll_dsp_ck: dpll_dsp_ck at 4a005234 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-clock"; + clocks = <&sys_clkin1>, <&dsp_dpll_hs_clk_div>; + reg = <0x4a005234 0x4>, <0x4a005238 0x4>, <0x4a00523c 0x4>, <0x4a005240 0x4>; + ti,clk-ref = <&sys_clkin1>; + ti,clk-bypass = <&dsp_dpll_hs_clk_div>; +}; + +dpll_dsp_m2_ck: dpll_dsp_m2_ck at 4a005244 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_dsp_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a005244 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dsp_gclk_div: dsp_gclk_div at 4ae0618c { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&dpll_dsp_m2_ck>; + reg = <0x4ae0618c 0x4>; + bit-mask = <0x7>; + index-power-of-two; +}; + +iva_dpll_hs_clk_div: iva_dpll_hs_clk_div { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_core_h12x2_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +dpll_iva_ck: dpll_iva_ck at 4a0051a0 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-clock"; + clocks = <&sys_clkin1>, <&iva_dpll_hs_clk_div>; + reg = <0x4a0051a0 0x4>, <0x4a0051a4 0x4>, <0x4a0051a8 0x4>, <0x4a0051ac 0x4>; + ti,clk-ref = <&sys_clkin1>; + ti,clk-bypass = <&iva_dpll_hs_clk_div>; +}; + +dpll_iva_m2_ck: dpll_iva_m2_ck at 4a0051b0 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_iva_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a0051b0 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; + ti,autoidle-low; +}; + +iva_dclk: iva_dclk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_iva_m2_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +dpll_gpu_ck: dpll_gpu_ck at 4a0052d8 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-clock"; + clocks = <&sys_clkin1>, <&dpll_abe_m3x2_ck>; + reg = <0x4a0052d8 0x4>, <0x4a0052dc 0x4>, <0x4a0052e0 0x4>, <0x4a0052e4 0x4>; + ti,clk-ref = <&sys_clkin1>; + ti,clk-bypass = <&dpll_abe_m3x2_ck>; +}; + +dpll_gpu_m2_ck: dpll_gpu_m2_ck at 4a0052e8 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_gpu_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a0052e8 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; + ti,autoidle-low; +}; + +gpu_dclk: gpu_dclk at 4ae061a0 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&dpll_gpu_m2_ck>; + reg = <0x4ae061a0 0x4>; + bit-mask = <0x7>; + index-power-of-two; +}; + +dpll_core_m2_ck: dpll_core_m2_ck at 4a005130 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_core_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a005130 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; + ti,autoidle-low; +}; + +core_dpll_out_dclk_div: core_dpll_out_dclk_div { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_core_m2_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +dpll_ddr_ck: dpll_ddr_ck at 4a005210 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-clock"; + clocks = <&sys_clkin1>, <&dpll_abe_m3x2_ck>; + reg = <0x4a005210 0x4>, <0x4a005214 0x4>, <0x4a005218 0x4>, <0x4a00521c 0x4>; + ti,clk-ref = <&sys_clkin1>; + ti,clk-bypass = <&dpll_abe_m3x2_ck>; +}; + +dpll_ddr_m2_ck: dpll_ddr_m2_ck at 4a005220 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_ddr_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a005220 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; + ti,autoidle-low; +}; + +emif_phy_dclk_div: emif_phy_dclk_div at 4ae06190 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&dpll_ddr_m2_ck>; + reg = <0x4ae06190 0x4>; + bit-mask = <0x7>; + index-power-of-two; +}; + +dpll_gmac_ck: dpll_gmac_ck at 4a0052a8 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-clock"; + clocks = <&sys_clkin1>, <&dpll_abe_m3x2_ck>; + reg = <0x4a0052a8 0x4>, <0x4a0052ac 0x4>, <0x4a0052b0 0x4>, <0x4a0052b4 0x4>; + ti,clk-ref = <&sys_clkin1>; + ti,clk-bypass = <&dpll_abe_m3x2_ck>; +}; + +dpll_gmac_m2_ck: dpll_gmac_m2_ck at 4a0052b8 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_gmac_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a0052b8 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; + ti,autoidle-low; +}; + +gmac_250m_dclk_div: gmac_250m_dclk_div at 4ae0619c { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&dpll_gmac_m2_ck>; + reg = <0x4ae0619c 0x4>; + bit-mask = <0x7>; + index-power-of-two; +}; + +video2_dclk_div: video2_dclk_div { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&video2_m2_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +video1_dclk_div: video1_dclk_div { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&video1_m2_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +hdmi_dclk_div: hdmi_dclk_div { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&hdmi_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +per_dpll_hs_clk_div: per_dpll_hs_clk_div { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_abe_m3x2_ck>; + clock-mult = <1>; + clock-div = <2>; +}; + +dpll_per_ck: dpll_per_ck at 4a008140 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-clock"; + clocks = <&sys_clkin1>, <&per_dpll_hs_clk_div>; + reg = <0x4a008140 0x4>, <0x4a008144 0x4>, <0x4a008148 0x4>, <0x4a00814c 0x4>; + ti,clk-ref = <&sys_clkin1>; + ti,clk-bypass = <&per_dpll_hs_clk_div>; +}; + +dpll_per_m2_ck: dpll_per_m2_ck at 4a008150 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_per_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a008150 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; + ti,autoidle-low; +}; + +func_96m_aon_dclk_div: func_96m_aon_dclk_div { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_per_m2_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +usb_dpll_hs_clk_div: usb_dpll_hs_clk_div { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_abe_m3x2_ck>; + clock-mult = <1>; + clock-div = <3>; +}; + +dpll_usb_ck: dpll_usb_ck at 4a008180 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-j-type-clock"; + clocks = <&sys_clkin1>, <&usb_dpll_hs_clk_div>; + ti,clk-bypass = <&usb_dpll_hs_clk_div>; + reg = <0x4a008180 0x4>, <0x4a008184 0x4>, <0x4a008188 0x4>, <0x4a00818c 0x4>; + ti,clk-ref = <&sys_clkin1>; + ti,clkdm-name = "coreaon_clkdm"; + ti,dpll-j-type; +}; + +dpll_usb_m2_ck: dpll_usb_m2_ck at 4a008190 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_usb_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a008190 0x4>; + bit-mask = <0x7f>; + index-starts-at-one; + ti,autoidle-low; +}; + +l3init_480m_dclk_div: l3init_480m_dclk_div at 4ae061ac { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&dpll_usb_m2_ck>; + reg = <0x4ae061ac 0x4>; + bit-mask = <0x7>; + index-power-of-two; +}; + +usb_otg_dclk_div: usb_otg_dclk_div at 4ae06184 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&usb_otg_clkin_ck>; + reg = <0x4ae06184 0x4>; + bit-mask = <0x7>; + index-power-of-two; +}; + +sata_dclk_div: sata_dclk_div at 4ae061c0 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&sys_clkin1>; + reg = <0x4ae061c0 0x4>; + bit-mask = <0x7>; + index-power-of-two; +}; + +dpll_pcie_ref_m2_ck: dpll_pcie_ref_m2_ck at 4a008210 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_pcie_ref_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a008210 0x4>; + bit-mask = <0x7f>; + index-starts-at-one; + ti,autoidle-low; +}; + +pcie2_dclk_div: pcie2_dclk_div at 4ae061b8 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&dpll_pcie_ref_m2_ck>; + reg = <0x4ae061b8 0x4>; + bit-mask = <0x7>; + index-power-of-two; +}; + +pcie_dclk_div: pcie_dclk_div at 4ae061b4 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&apll_pcie_m2_ck>; + reg = <0x4ae061b4 0x4>; + bit-mask = <0x7>; + index-power-of-two; +}; + +emu_dclk_div: emu_dclk_div at 4ae06194 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&sys_clkin1>; + reg = <0x4ae06194 0x4>; + bit-mask = <0x7>; + index-power-of-two; +}; + +secure_32k_dclk_div: secure_32k_dclk_div at 4ae061c4 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&secure_32k_clk_src_ck>; + reg = <0x4ae061c4 0x4>; + bit-mask = <0x7>; + index-power-of-two; +}; + +eve_dpll_hs_clk_div: eve_dpll_hs_clk_div { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_core_h12x2_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +dpll_eve_ck: dpll_eve_ck at 4a005284 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-clock"; + clocks = <&sys_clkin1>, <&eve_dpll_hs_clk_div>; + reg = <0x4a005284 0x4>, <0x4a005288 0x4>, <0x4a00528c 0x4>, <0x4a005290 0x4>; + ti,clk-ref = <&sys_clkin1>; + ti,clk-bypass = <&eve_dpll_hs_clk_div>; +}; + +dpll_eve_m2_ck: dpll_eve_m2_ck at 4a005294 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_eve_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a005294 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; + ti,autoidle-low; +}; + +eve_dclk_div: eve_dclk_div { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_eve_m2_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +clkoutmux0_clk_mux: clkoutmux0_clk_mux at 4ae06158 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&sys_clk1_dclk_div>, <&sys_clk2_dclk_div>, <&per_abe_x1_dclk_div>, <&mpu_dclk_div>, <&dsp_gclk_div>, <&iva_dclk>, <&gpu_dclk>, <&core_dpll_out_dclk_div>, <&emif_phy_dclk_div>, <&gmac_250m_dclk_div>, <&video2_dclk_div>, <&video1_dclk_div>, <&hdmi_dclk_div>, <&func_96m_aon_dclk_div>, <&l3init_480m_dclk_div>, <&usb_otg_dclk_div>, <&sata_dclk_div>, <&pcie2_dclk_div>, <&pcie_dclk_div>, <&emu_dclk_div>, <&secure_32k_dclk_div>, <&eve_dclk_div>; + reg = <0x4ae06158 0x4>; + bit-mask = <0x1f>; +}; + +clkoutmux1_clk_mux: clkoutmux1_clk_mux at 4ae0615c { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&sys_clk1_dclk_div>, <&sys_clk2_dclk_div>, <&per_abe_x1_dclk_div>, <&mpu_dclk_div>, <&dsp_gclk_div>, <&iva_dclk>, <&gpu_dclk>, <&core_dpll_out_dclk_div>, <&emif_phy_dclk_div>, <&gmac_250m_dclk_div>, <&video2_dclk_div>, <&video1_dclk_div>, <&hdmi_dclk_div>, <&func_96m_aon_dclk_div>, <&l3init_480m_dclk_div>, <&usb_otg_dclk_div>, <&sata_dclk_div>, <&pcie2_dclk_div>, <&pcie_dclk_div>, <&emu_dclk_div>, <&secure_32k_dclk_div>, <&eve_dclk_div>; + reg = <0x4ae0615c 0x4>; + bit-mask = <0x1f>; +}; + +clkoutmux2_clk_mux: clkoutmux2_clk_mux at 4ae06160 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&sys_clk1_dclk_div>, <&sys_clk2_dclk_div>, <&per_abe_x1_dclk_div>, <&mpu_dclk_div>, <&dsp_gclk_div>, <&iva_dclk>, <&gpu_dclk>, <&core_dpll_out_dclk_div>, <&emif_phy_dclk_div>, <&gmac_250m_dclk_div>, <&video2_dclk_div>, <&video1_dclk_div>, <&hdmi_dclk_div>, <&func_96m_aon_dclk_div>, <&l3init_480m_dclk_div>, <&usb_otg_dclk_div>, <&sata_dclk_div>, <&pcie2_dclk_div>, <&pcie_dclk_div>, <&emu_dclk_div>, <&secure_32k_dclk_div>, <&eve_dclk_div>; + reg = <0x4ae06160 0x4>; + bit-mask = <0x1f>; +}; + +custefuse_sys_gfclk_div: custefuse_sys_gfclk_div { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&sys_clkin1>; + clock-mult = <1>; + clock-div = <2>; +}; + +dpll_core_h13x2_ck: dpll_core_h13x2_ck at 4a005140 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_core_x2_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a005140 0x4>; + bit-mask = <0x3f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dpll_core_h14x2_ck: dpll_core_h14x2_ck at 4a005144 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_core_x2_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a005144 0x4>; + bit-mask = <0x3f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dpll_core_h22x2_ck: dpll_core_h22x2_ck at 4a005154 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_core_x2_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a005154 0x4>; + bit-mask = <0x3f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dpll_core_h23x2_ck: dpll_core_h23x2_ck at 4a005158 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_core_x2_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a005158 0x4>; + bit-mask = <0x3f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dpll_core_h24x2_ck: dpll_core_h24x2_ck at 4a00515c { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_core_x2_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a00515c 0x4>; + bit-mask = <0x3f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dpll_ddr_x2_ck: dpll_ddr_x2_ck { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-x2-clock"; + clocks = <&dpll_ddr_ck>; +}; + +dpll_ddr_h11x2_ck: dpll_ddr_h11x2_ck at 4a005228 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_ddr_x2_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a005228 0x4>; + bit-mask = <0x3f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dpll_dsp_x2_ck: dpll_dsp_x2_ck { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-x2-clock"; + clocks = <&dpll_dsp_ck>; +}; + +dpll_dsp_m3x2_ck: dpll_dsp_m3x2_ck at 4a005248 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_dsp_x2_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a005248 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dpll_gmac_x2_ck: dpll_gmac_x2_ck { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-x2-clock"; + clocks = <&dpll_gmac_ck>; +}; + +dpll_gmac_h11x2_ck: dpll_gmac_h11x2_ck at 4a0052c0 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_gmac_x2_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a0052c0 0x4>; + bit-mask = <0x3f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dpll_gmac_h12x2_ck: dpll_gmac_h12x2_ck at 4a0052c4 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_gmac_x2_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a0052c4 0x4>; + bit-mask = <0x3f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dpll_gmac_h13x2_ck: dpll_gmac_h13x2_ck at 4a0052c8 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_gmac_x2_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a0052c8 0x4>; + bit-mask = <0x3f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dpll_gmac_m3x2_ck: dpll_gmac_m3x2_ck at 4a0052bc { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_gmac_x2_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a0052bc 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dpll_per_x2_ck: dpll_per_x2_ck { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-x2-clock"; + clocks = <&dpll_per_ck>; +}; + +dpll_per_h11x2_ck: dpll_per_h11x2_ck at 4a008158 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_per_x2_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a008158 0x4>; + bit-mask = <0x3f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dpll_per_h12x2_ck: dpll_per_h12x2_ck at 4a00815c { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_per_x2_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a00815c 0x4>; + bit-mask = <0x3f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dpll_per_h13x2_ck: dpll_per_h13x2_ck at 4a008160 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_per_x2_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a008160 0x4>; + bit-mask = <0x3f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dpll_per_h14x2_ck: dpll_per_h14x2_ck at 4a008164 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_per_x2_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a008164 0x4>; + bit-mask = <0x3f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dpll_per_m2x2_ck: dpll_per_m2x2_ck at 4a008150 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_per_x2_ck>; + ti,autoidle-shift = <8>; + reg = <0x4a008150 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dpll_usb_clkdcoldo: dpll_usb_clkdcoldo { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_usb_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +eve_clk: eve_clk at 4ae06180 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&dpll_eve_m2_ck>, <&dpll_dsp_m3x2_ck>; + reg = <0x4ae06180 0x4>; + bit-mask = <0x1>; +}; + +func_128m_clk: func_128m_clk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_per_h11x2_ck>; + clock-mult = <1>; + clock-div = <2>; +}; + +func_12m_fclk: func_12m_fclk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_per_m2x2_ck>; + clock-mult = <1>; + clock-div = <16>; +}; + +func_24m_clk: func_24m_clk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_per_m2_ck>; + clock-mult = <1>; + clock-div = <4>; +}; + +func_48m_fclk: func_48m_fclk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_per_m2x2_ck>; + clock-mult = <1>; + clock-div = <4>; +}; + +func_96m_fclk: func_96m_fclk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_per_m2x2_ck>; + clock-mult = <1>; + clock-div = <2>; +}; + +gmii_m_clk_div: gmii_m_clk_div { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_gmac_h11x2_ck>; + clock-mult = <1>; + clock-div = <2>; +}; + +hdmi_clk2_div: hdmi_clk2_div { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&hdmi_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +hdmi_div_clk: hdmi_div_clk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&hdmi_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +hdmi_dpll_clk_mux: hdmi_dpll_clk_mux at 4ae061a4 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&sys_clkin1>, <&sys_clkin2>; + reg = <0x4ae061a4 0x4>; + bit-mask = <0x7>; +}; + +l3_iclk_div: l3_iclk_div { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_core_h12x2_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +l3init_60m_fclk: l3init_60m_fclk at 4a008104 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&dpll_usb_m2_ck>; + reg = <0x4a008104 0x4>; + table = < 1 0 >, < 8 1 >; + bit-mask = <0x1>; +}; + +l4_root_clk_div: l4_root_clk_div { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&l3_iclk_div>; + clock-mult = <1>; + clock-div = <1>; +}; + +mlb_clk: mlb_clk at 4ae06134 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&mlb_clkin_ck>; + reg = <0x4ae06134 0x4>; + bit-mask = <0x7>; + index-power-of-two; +}; + +mlbp_clk: mlbp_clk at 4ae06130 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&mlbp_clkin_ck>; + reg = <0x4ae06130 0x4>; + bit-mask = <0x7>; + index-power-of-two; +}; + +per_abe_x1_gfclk2_div: per_abe_x1_gfclk2_div at 4ae06138 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&dpll_abe_m2_ck>; + reg = <0x4ae06138 0x4>; + bit-mask = <0x7>; + index-power-of-two; +}; + +timer_sys_clk_div: timer_sys_clk_div at 4ae06144 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&sys_clkin1>; + reg = <0x4ae06144 0x4>; + bit-mask = <0x1>; +}; + +video1_clk2_div: video1_clk2_div { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&video1_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +video1_div_clk: video1_div_clk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&video1_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +video1_dpll_clk_mux: video1_dpll_clk_mux at 4ae061d0 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&sys_clkin1>, <&sys_clkin2>; + reg = <0x4ae061d0 0x4>; + bit-mask = <0x7>; +}; + +video2_clk2_div: video2_clk2_div { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&video2_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +video2_div_clk: video2_div_clk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&video2_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +video2_dpll_clk_mux: video2_dpll_clk_mux at 4ae061d4 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&sys_clkin1>, <&sys_clkin2>; + reg = <0x4ae061d4 0x4>; + bit-mask = <0x7>; +}; + +wkupaon_iclk_mux: wkupaon_iclk_mux at 4ae06108 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&sys_clkin1>, <&abe_lp_clk_div>; + reg = <0x4ae06108 0x4>; + bit-mask = <0x1>; +}; + +dss_32khz_clk: dss_32khz_clk at 4a009120 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&sys_32k_ck>; + bit-shift = <11>; + reg = <0x4a009120 0x4>; +}; + +dss_48mhz_clk: dss_48mhz_clk at 4a009120 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&func_48m_fclk>; + bit-shift = <9>; + reg = <0x4a009120 0x4>; +}; + +dss_dss_clk: dss_dss_clk at 4a009120 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&dpll_per_h12x2_ck>; + bit-shift = <8>; + reg = <0x4a009120 0x4>; +}; + +dss_hdmi_clk: dss_hdmi_clk at 4a009120 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&hdmi_dpll_clk_mux>; + bit-shift = <10>; + reg = <0x4a009120 0x4>; +}; + +dss_video1_clk: dss_video1_clk at 4a009120 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&video1_dpll_clk_mux>; + bit-shift = <12>; + reg = <0x4a009120 0x4>; +}; + +dss_video2_clk: dss_video2_clk at 4a009120 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&video2_dpll_clk_mux>; + bit-shift = <13>; + reg = <0x4a009120 0x4>; +}; + +gpio1_dbclk: gpio1_dbclk at 4ae07838 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&sys_32k_ck>; + bit-shift = <8>; + reg = <0x4ae07838 0x4>; +}; + +gpio2_dbclk: gpio2_dbclk at 4a009760 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&sys_32k_ck>; + bit-shift = <8>; + reg = <0x4a009760 0x4>; +}; + +gpio3_dbclk: gpio3_dbclk at 4a009768 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&sys_32k_ck>; + bit-shift = <8>; + reg = <0x4a009768 0x4>; +}; + +gpio4_dbclk: gpio4_dbclk at 4a009770 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&sys_32k_ck>; + bit-shift = <8>; + reg = <0x4a009770 0x4>; +}; + +gpio5_dbclk: gpio5_dbclk at 4a009778 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&sys_32k_ck>; + bit-shift = <8>; + reg = <0x4a009778 0x4>; +}; + +gpio6_dbclk: gpio6_dbclk at 4a009780 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&sys_32k_ck>; + bit-shift = <8>; + reg = <0x4a009780 0x4>; +}; + +gpio7_dbclk: gpio7_dbclk at 4a009810 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&sys_32k_ck>; + bit-shift = <8>; + reg = <0x4a009810 0x4>; +}; + +gpio8_dbclk: gpio8_dbclk at 4a009818 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&sys_32k_ck>; + bit-shift = <8>; + reg = <0x4a009818 0x4>; +}; + +mmc1_clk32k: mmc1_clk32k at 4a009328 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&sys_32k_ck>; + bit-shift = <8>; + reg = <0x4a009328 0x4>; +}; + +mmc2_clk32k: mmc2_clk32k at 4a009330 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&sys_32k_ck>; + bit-shift = <8>; + reg = <0x4a009330 0x4>; +}; + +mmc3_clk32k: mmc3_clk32k at 4a009820 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&sys_32k_ck>; + bit-shift = <8>; + reg = <0x4a009820 0x4>; +}; + +mmc4_clk32k: mmc4_clk32k at 4a009828 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&sys_32k_ck>; + bit-shift = <8>; + reg = <0x4a009828 0x4>; +}; + +sata_ref_clk: sata_ref_clk at 4a009388 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&sys_clkin1>; + bit-shift = <8>; + reg = <0x4a009388 0x4>; +}; + +usb_otg_ss1_refclk960m: usb_otg_ss1_refclk960m at 4a0093f0 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&dpll_usb_clkdcoldo>; + bit-shift = <8>; + reg = <0x4a0093f0 0x4>; +}; + +usb_otg_ss2_refclk960m: usb_otg_ss2_refclk960m at 4a009340 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&dpll_usb_clkdcoldo>; + bit-shift = <8>; + reg = <0x4a009340 0x4>; +}; + +usb_phy1_always_on_clk32k: usb_phy1_always_on_clk32k at 4a008640 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&sys_32k_ck>; + bit-shift = <8>; + reg = <0x4a008640 0x4>; +}; + +usb_phy2_always_on_clk32k: usb_phy2_always_on_clk32k at 4a008688 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&sys_32k_ck>; + bit-shift = <8>; + reg = <0x4a008688 0x4>; +}; + +usb_phy3_always_on_clk32k: usb_phy3_always_on_clk32k at 4a008698 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&sys_32k_ck>; + bit-shift = <8>; + reg = <0x4a008698 0x4>; +}; + +atl_dpll_clk_mux: atl_dpll_clk_mux at 4a008c00 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&sys_32k_ck>, <&video1_clkin_ck>, <&video2_clkin_ck>, <&hdmi_clkin_ck>; + bit-shift = <24>; + reg = <0x4a008c00 0x4>; + bit-mask = <0x3>; +}; + +atl_gfclk_mux: atl_gfclk_mux at 4a008c00 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&l3_iclk_div>, <&dpll_abe_m2_ck>, <&atl_dpll_clk_mux>; + bit-shift = <26>; + reg = <0x4a008c00 0x4>; + bit-mask = <0x3>; +}; + +dcan1_sys_clk_mux: dcan1_sys_clk_mux at 4ae07888 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&sys_clkin1>, <&sys_clkin2>; + bit-shift = <24>; + reg = <0x4ae07888 0x4>; + bit-mask = <0x1>; +}; + +gmac_gmii_ref_clk_div: gmac_gmii_ref_clk_div at 4a0093d0 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&dpll_gmac_m2_ck>; + bit-shift = <24>; + reg = <0x4a0093d0 0x4>; + table = < 2 0 >; + bit-mask = <0x1>; +}; + +gmac_rft_clk_mux: gmac_rft_clk_mux at 4a0093d0 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&video1_clkin_ck>, <&video2_clkin_ck>, <&dpll_abe_m2_ck>, <&hdmi_clkin_ck>, <&l3_iclk_div>; + bit-shift = <25>; + reg = <0x4a0093d0 0x4>; + bit-mask = <0x7>; +}; + +gpu_core_gclk_mux: gpu_core_gclk_mux at 4a009220 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&dpll_core_h14x2_ck>, <&dpll_per_h14x2_ck>, <&dpll_gpu_m2_ck>; + bit-shift = <24>; + reg = <0x4a009220 0x4>; + bit-mask = <0x3>; +}; + +gpu_hyd_gclk_mux: gpu_hyd_gclk_mux at 4a009220 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&dpll_core_h14x2_ck>, <&dpll_per_h14x2_ck>, <&dpll_gpu_m2_ck>; + bit-shift = <26>; + reg = <0x4a009220 0x4>; + bit-mask = <0x3>; +}; + +ipu1_gfclk_mux: ipu1_gfclk_mux at 4a005520 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&dpll_abe_m2x2_ck>, <&dpll_core_h22x2_ck>; + bit-shift = <24>; + reg = <0x4a005520 0x4>; + bit-mask = <0x1>; +}; + +l3instr_ts_gclk_div: l3instr_ts_gclk_div at 4a008e50 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&wkupaon_iclk_mux>; + bit-shift = <24>; + reg = <0x4a008e50 0x4>; + table = < 8 0 >, < 16 1 >, < 32 2 >; + bit-mask = <0x3>; +}; + +mcasp1_ahclkr_mux: mcasp1_ahclkr_mux at 4a005550 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&abe_24m_fclk>, <&abe_sys_clk_div>, <&func_24m_clk>, <&atlclkin3_ck>, <&atl_clkin2_ck>, <&atl_clkin1_ck>, <&atl_clkin0_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&mlb_clk>, <&mlbp_clk>; + bit-shift = <28>; + reg = <0x4a005550 0x4>; + bit-mask = <0xf>; +}; + +mcasp1_ahclkx_mux: mcasp1_ahclkx_mux at 4a005550 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&abe_24m_fclk>, <&abe_sys_clk_div>, <&func_24m_clk>, <&atlclkin3_ck>, <&atl_clkin2_ck>, <&atl_clkin1_ck>, <&atl_clkin0_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&mlb_clk>, <&mlbp_clk>; + bit-shift = <24>; + reg = <0x4a005550 0x4>; + bit-mask = <0xf>; +}; + +mcasp1_aux_gfclk_mux: mcasp1_aux_gfclk_mux at 4a005550 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&per_abe_x1_gfclk2_div>, <&video1_clk2_div>, <&video2_clk2_div>, <&hdmi_clk2_div>; + bit-shift = <22>; + reg = <0x4a005550 0x4>; + bit-mask = <0x3>; +}; + +mcasp2_ahclkr_mux: mcasp2_ahclkr_mux at 4a009860 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&abe_24m_fclk>, <&abe_sys_clk_div>, <&func_24m_clk>, <&atlclkin3_ck>, <&atl_clkin2_ck>, <&atl_clkin1_ck>, <&atl_clkin0_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&mlb_clk>, <&mlbp_clk>; + bit-shift = <28>; + reg = <0x4a009860 0x4>; + bit-mask = <0xf>; +}; + +mcasp2_ahclkx_mux: mcasp2_ahclkx_mux at 4a009860 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&abe_24m_fclk>, <&abe_sys_clk_div>, <&func_24m_clk>, <&atlclkin3_ck>, <&atl_clkin2_ck>, <&atl_clkin1_ck>, <&atl_clkin0_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&mlb_clk>, <&mlbp_clk>; + bit-shift = <28>; + reg = <0x4a009860 0x4>; + bit-mask = <0xf>; +}; + +mcasp2_aux_gfclk_mux: mcasp2_aux_gfclk_mux at 4a009860 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&per_abe_x1_gfclk2_div>, <&video1_clk2_div>, <&video2_clk2_div>, <&hdmi_clk2_div>; + bit-shift = <22>; + reg = <0x4a009860 0x4>; + bit-mask = <0x3>; +}; + +mcasp3_ahclkx_mux: mcasp3_ahclkx_mux at 4a009868 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&abe_24m_fclk>, <&abe_sys_clk_div>, <&func_24m_clk>, <&atlclkin3_ck>, <&atl_clkin2_ck>, <&atl_clkin1_ck>, <&atl_clkin0_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&mlb_clk>, <&mlbp_clk>; + bit-shift = <24>; + reg = <0x4a009868 0x4>; + bit-mask = <0xf>; +}; + +mcasp3_aux_gfclk_mux: mcasp3_aux_gfclk_mux at 4a009868 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&per_abe_x1_gfclk2_div>, <&video1_clk2_div>, <&video2_clk2_div>, <&hdmi_clk2_div>; + bit-shift = <22>; + reg = <0x4a009868 0x4>; + bit-mask = <0x3>; +}; + +mcasp4_ahclkx_mux: mcasp4_ahclkx_mux at 4a009898 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&abe_24m_fclk>, <&abe_sys_clk_div>, <&func_24m_clk>, <&atlclkin3_ck>, <&atl_clkin2_ck>, <&atl_clkin1_ck>, <&atl_clkin0_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&mlb_clk>, <&mlbp_clk>; + bit-shift = <24>; + reg = <0x4a009898 0x4>; + bit-mask = <0xf>; +}; + +mcasp4_aux_gfclk_mux: mcasp4_aux_gfclk_mux at 4a009898 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&per_abe_x1_gfclk2_div>, <&video1_clk2_div>, <&video2_clk2_div>, <&hdmi_clk2_div>; + bit-shift = <22>; + reg = <0x4a009898 0x4>; + bit-mask = <0x3>; +}; + +mcasp5_ahclkx_mux: mcasp5_ahclkx_mux at 4a009878 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&abe_24m_fclk>, <&abe_sys_clk_div>, <&func_24m_clk>, <&atlclkin3_ck>, <&atl_clkin2_ck>, <&atl_clkin1_ck>, <&atl_clkin0_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&mlb_clk>, <&mlbp_clk>; + bit-shift = <24>; + reg = <0x4a009878 0x4>; + bit-mask = <0xf>; +}; + +mcasp5_aux_gfclk_mux: mcasp5_aux_gfclk_mux at 4a009878 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&per_abe_x1_gfclk2_div>, <&video1_clk2_div>, <&video2_clk2_div>, <&hdmi_clk2_div>; + bit-shift = <22>; + reg = <0x4a009878 0x4>; + bit-mask = <0x3>; +}; + +mcasp6_ahclkx_mux: mcasp6_ahclkx_mux at 4a009904 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&abe_24m_fclk>, <&abe_sys_clk_div>, <&func_24m_clk>, <&atlclkin3_ck>, <&atl_clkin2_ck>, <&atl_clkin1_ck>, <&atl_clkin0_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&mlb_clk>, <&mlbp_clk>; + bit-shift = <24>; + reg = <0x4a009904 0x4>; + bit-mask = <0xf>; +}; + +mcasp6_aux_gfclk_mux: mcasp6_aux_gfclk_mux at 4a009904 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&per_abe_x1_gfclk2_div>, <&video1_clk2_div>, <&video2_clk2_div>, <&hdmi_clk2_div>; + bit-shift = <22>; + reg = <0x4a009904 0x4>; + bit-mask = <0x3>; +}; + +mcasp7_ahclkx_mux: mcasp7_ahclkx_mux at 4a009908 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&abe_24m_fclk>, <&abe_sys_clk_div>, <&func_24m_clk>, <&atlclkin3_ck>, <&atl_clkin2_ck>, <&atl_clkin1_ck>, <&atl_clkin0_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&mlb_clk>, <&mlbp_clk>; + bit-shift = <24>; + reg = <0x4a009908 0x4>; + bit-mask = <0xf>; +}; + +mcasp7_aux_gfclk_mux: mcasp7_aux_gfclk_mux at 4a009908 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&per_abe_x1_gfclk2_div>, <&video1_clk2_div>, <&video2_clk2_div>, <&hdmi_clk2_div>; + bit-shift = <22>; + reg = <0x4a009908 0x4>; + bit-mask = <0x3>; +}; + +mcasp8_ahclk_mux: mcasp8_ahclk_mux at 4a009890 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&abe_24m_fclk>, <&abe_sys_clk_div>, <&func_24m_clk>, <&atlclkin3_ck>, <&atl_clkin2_ck>, <&atl_clkin1_ck>, <&atl_clkin0_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&mlb_clk>, <&mlbp_clk>; + bit-shift = <22>; + reg = <0x4a009890 0x4>; + bit-mask = <0x3>; +}; + +mcasp8_aux_gfclk_mux: mcasp8_aux_gfclk_mux at 4a009890 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&per_abe_x1_gfclk2_div>, <&video1_clk2_div>, <&video2_clk2_div>, <&hdmi_clk2_div>; + bit-shift = <24>; + reg = <0x4a009890 0x4>; + bit-mask = <0xf>; +}; + +mmc1_fclk_mux: mmc1_fclk_mux at 4a009328 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&func_128m_clk>, <&dpll_per_m2x2_ck>; + bit-shift = <24>; + reg = <0x4a009328 0x4>; + bit-mask = <0x1>; +}; + +mmc1_fclk_div: mmc1_fclk_div at 4a009328 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&mmc1_fclk_mux>; + bit-shift = <25>; + reg = <0x4a009328 0x4>; + bit-mask = <0x3>; + index-power-of-two; +}; + +mmc2_fclk_mux: mmc2_fclk_mux at 4a009330 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&func_128m_clk>, <&dpll_per_m2x2_ck>; + bit-shift = <24>; + reg = <0x4a009330 0x4>; + bit-mask = <0x1>; +}; + +mmc2_fclk_div: mmc2_fclk_div at 4a009330 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&mmc2_fclk_mux>; + bit-shift = <25>; + reg = <0x4a009330 0x4>; + bit-mask = <0x3>; + index-power-of-two; +}; + +mmc3_gfclk_mux: mmc3_gfclk_mux at 4a009820 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&func_48m_fclk>, <&dpll_per_m2x2_ck>; + bit-shift = <24>; + reg = <0x4a009820 0x4>; + bit-mask = <0x1>; +}; + +mmc3_gfclk_div: mmc3_gfclk_div at 4a009820 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&mmc3_gfclk_mux>; + bit-shift = <25>; + reg = <0x4a009820 0x4>; + bit-mask = <0x3>; + index-power-of-two; +}; + +mmc4_gfclk_mux: mmc4_gfclk_mux at 4a009828 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&func_48m_fclk>, <&dpll_per_m2x2_ck>; + bit-shift = <24>; + reg = <0x4a009828 0x4>; + bit-mask = <0x1>; +}; + +mmc4_gfclk_div: mmc4_gfclk_div at 4a009828 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&mmc4_gfclk_mux>; + bit-shift = <25>; + reg = <0x4a009828 0x4>; + bit-mask = <0x3>; + index-power-of-two; +}; + +qspi_gfclk_mux: qspi_gfclk_mux at 4a009838 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&func_128m_clk>, <&dpll_per_h13x2_ck>; + bit-shift = <24>; + reg = <0x4a009838 0x4>; + bit-mask = <0x1>; +}; + +qspi_gfclk_div: qspi_gfclk_div at 4a009838 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&qspi_gfclk_mux>; + bit-shift = <25>; + reg = <0x4a009838 0x4>; + bit-mask = <0x3>; + index-power-of-two; +}; + +timer10_gfclk_mux: timer10_gfclk_mux at 4a009728 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>; + bit-shift = <24>; + reg = <0x4a009728 0x4>; + bit-mask = <0xf>; +}; + +timer11_gfclk_mux: timer11_gfclk_mux at 4a009730 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>; + bit-shift = <24>; + reg = <0x4a009730 0x4>; + bit-mask = <0xf>; +}; + +timer13_gfclk_mux: timer13_gfclk_mux at 4a0097c8 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>; + bit-shift = <24>; + reg = <0x4a0097c8 0x4>; + bit-mask = <0xf>; +}; + +timer14_gfclk_mux: timer14_gfclk_mux at 4a0097d0 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>; + bit-shift = <24>; + reg = <0x4a0097d0 0x4>; + bit-mask = <0xf>; +}; + +timer15_gfclk_mux: timer15_gfclk_mux at 4a0097d8 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>; + bit-shift = <24>; + reg = <0x4a0097d8 0x4>; + bit-mask = <0xf>; +}; + +timer16_gfclk_mux: timer16_gfclk_mux at 4a009830 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>; + bit-shift = <24>; + reg = <0x4a009830 0x4>; + bit-mask = <0xf>; +}; + +timer1_gfclk_mux: timer1_gfclk_mux at 4ae07840 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>; + bit-shift = <24>; + reg = <0x4ae07840 0x4>; + bit-mask = <0xf>; +}; + +timer2_gfclk_mux: timer2_gfclk_mux at 4a009738 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>; + bit-shift = <24>; + reg = <0x4a009738 0x4>; + bit-mask = <0xf>; +}; + +timer3_gfclk_mux: timer3_gfclk_mux at 4a009740 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>; + bit-shift = <24>; + reg = <0x4a009740 0x4>; + bit-mask = <0xf>; +}; + +timer4_gfclk_mux: timer4_gfclk_mux at 4a009748 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>; + bit-shift = <24>; + reg = <0x4a009748 0x4>; + bit-mask = <0xf>; +}; + +timer5_gfclk_mux: timer5_gfclk_mux at 4a005558 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>, <&clkoutmux0_clk_mux>; + bit-shift = <24>; + reg = <0x4a005558 0x4>; + bit-mask = <0xf>; +}; + +timer6_gfclk_mux: timer6_gfclk_mux at 4a005560 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>, <&clkoutmux0_clk_mux>; + bit-shift = <24>; + reg = <0x4a005560 0x4>; + bit-mask = <0xf>; +}; + +timer7_gfclk_mux: timer7_gfclk_mux at 4a005568 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>, <&clkoutmux0_clk_mux>; + bit-shift = <24>; + reg = <0x4a005568 0x4>; + bit-mask = <0xf>; +}; + +timer8_gfclk_mux: timer8_gfclk_mux at 4a005570 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>, <&clkoutmux0_clk_mux>; + bit-shift = <24>; + reg = <0x4a005570 0x4>; + bit-mask = <0xf>; +}; + +timer9_gfclk_mux: timer9_gfclk_mux at 4a009750 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&timer_sys_clk_div>, <&sys_32k_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&abe_giclk_div>, <&video1_div_clk>, <&video2_div_clk>, <&hdmi_div_clk>; + bit-shift = <24>; + reg = <0x4a009750 0x4>; + bit-mask = <0xf>; +}; + +uart10_gfclk_mux: uart10_gfclk_mux at 4ae07880 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&func_48m_fclk>, <&dpll_per_m2x2_ck>; + bit-shift = <24>; + reg = <0x4ae07880 0x4>; + bit-mask = <0x1>; +}; + +uart1_gfclk_mux: uart1_gfclk_mux at 4a009840 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&func_48m_fclk>, <&dpll_per_m2x2_ck>; + bit-shift = <24>; + reg = <0x4a009840 0x4>; + bit-mask = <0x1>; +}; + +uart2_gfclk_mux: uart2_gfclk_mux at 4a009848 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&func_48m_fclk>, <&dpll_per_m2x2_ck>; + bit-shift = <24>; + reg = <0x4a009848 0x4>; + bit-mask = <0x1>; +}; + +uart3_gfclk_mux: uart3_gfclk_mux at 4a009850 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&func_48m_fclk>, <&dpll_per_m2x2_ck>; + bit-shift = <24>; + reg = <0x4a009850 0x4>; + bit-mask = <0x1>; +}; + +uart4_gfclk_mux: uart4_gfclk_mux at 4a009858 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&func_48m_fclk>, <&dpll_per_m2x2_ck>; + bit-shift = <24>; + reg = <0x4a009858 0x4>; + bit-mask = <0x1>; +}; + +uart5_gfclk_mux: uart5_gfclk_mux at 4a009870 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&func_48m_fclk>, <&dpll_per_m2x2_ck>; + bit-shift = <24>; + reg = <0x4a009870 0x4>; + bit-mask = <0x1>; +}; + +uart6_gfclk_mux: uart6_gfclk_mux at 4a005580 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&func_48m_fclk>, <&dpll_per_m2x2_ck>; + bit-shift = <24>; + reg = <0x4a005580 0x4>; + bit-mask = <0x1>; +}; + +uart7_gfclk_mux: uart7_gfclk_mux at 4a0098d0 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&func_48m_fclk>, <&dpll_per_m2x2_ck>; + bit-shift = <24>; + reg = <0x4a0098d0 0x4>; + bit-mask = <0x1>; +}; + +uart8_gfclk_mux: uart8_gfclk_mux at 4a0098e0 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&func_48m_fclk>, <&dpll_per_m2x2_ck>; + bit-shift = <24>; + reg = <0x4a0098e0 0x4>; + bit-mask = <0x1>; +}; + +uart9_gfclk_mux: uart9_gfclk_mux at 4a0098e8 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&func_48m_fclk>, <&dpll_per_m2x2_ck>; + bit-shift = <24>; + reg = <0x4a0098e8 0x4>; + bit-mask = <0x1>; +}; + +vip1_gclk_mux: vip1_gclk_mux at 4a009020 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&l3_iclk_div>, <&dpll_core_h23x2_ck>; + bit-shift = <24>; + reg = <0x4a009020 0x4>; + bit-mask = <0x1>; +}; + +vip2_gclk_mux: vip2_gclk_mux at 4a009028 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&l3_iclk_div>, <&dpll_core_h23x2_ck>; + bit-shift = <24>; + reg = <0x4a009028 0x4>; + bit-mask = <0x1>; +}; + +vip3_gclk_mux: vip3_gclk_mux at 4a009030 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&l3_iclk_div>, <&dpll_core_h23x2_ck>; + bit-shift = <24>; + reg = <0x4a009030 0x4>; + bit-mask = <0x1>; +};
Signature · 1 line
1.7.9.5
PATCH v5 13/31 ARM: dts: clk: Add apll related clocks
In reply to Tero KristoFrom: Keerthy <[email protected]>
The patch adds a mux node to choose the parent of apll_pcie_ck node.
--- arch/arm/boot/dts/dra7xx-clocks.dtsi | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-)
arch/arm/boot/dts/dra7xx-clocks.dtsi +15 -4
@@ -326,13 +326,24 @@ dpll_pcie_ref_m2ldo_ck: dpll_pcie_ref_m2ldo_ck at 4a008210 { ti,autoidle-low; }; +/* APLL_PCIE */ + +/* mux clock to select the reference clock */ +apll_pcie_in_clk_mux: apll_pcie_in_clk_mux at 4ae06118 { + compatible = "mux-clock"; + clocks = <&dpll_pcie_ref_ck>, <&pciesref_acs_clk_ck>; + #clock-cells = <0>; + reg = <0x4a00821c 0x4>; + bit-mask = <0x80>; +}; + apll_pcie_ck: apll_pcie_ck at 4a008200 { #clock-cells = <0>; - compatible = "ti,omap4-dpll-clock"; - clocks = <&dpll_pcie_ref_ck>; - reg = <0x4a008200 0x4>, <0x4a008204 0x4>, <0x4a008208 0x4>, <0x4a00820c 0x4>; - ti,clk-ref = <&dpll_pcie_ref_ck>; + clocks = <&apll_pcie_in_clk_mux>; + reg = <0x4a00821c 0x4>, <0x4a008220 0x4>; ti,clk-bypass = <&dpll_pcie_ref_ck>; + ti,clk-ref = <&apll_pcie_in_clk_mux>; + compatible = "ti,dra7-apll-clock"; }; apll_pcie_clkvcoldo: apll_pcie_clkvcoldo {
Signature · 1 line
1.7.9.5
PATCH v5 14/31 ARM: dts: DRA7: Change apll_pcie_m2_ck to fixed factor clock
In reply to Tero KristoFrom: Keerthy <[email protected]>
This patch changes apll_pcie_m2_ck to fixed factor clock as there are no configurable divider associated to m2.
--- arch/arm/boot/dts/dra7xx-clocks.dtsi | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
arch/arm/boot/dts/dra7xx-clocks.dtsi +3 -6
@@ -364,13 +364,10 @@ apll_pcie_clkvcoldo_div: apll_pcie_clkvcoldo_div { apll_pcie_m2_ck: apll_pcie_m2_ck at 4a008224 { #clock-cells = <0>; - compatible = "ti,divider-clock"; + compatible = "fixed-factor-clock"; clocks = <&apll_pcie_ck>; - ti,autoidle-shift = <8>; - reg = <0x4a008224 0x4>; - bit-mask = <0x7f>; - index-starts-at-one; - ti,autoidle-low; + clock-mult = <1>; + clock-div = <1>; }; sys_clk1_dclk_div: sys_clk1_dclk_div at 4ae061c8 {
Signature · 1 line
1.7.9.5
PATCH v5 15/31 ARM: dts: DRA7: Add PCIe related clock nodes
In reply to Tero KristoFrom: Keerthy <[email protected]>
This patch adds optfclk_pciephy_clk and optfclk_pciephy_div_clk which are used by PCIe phy. It also adds a mux clock to choose the source of optfclk_pciephy_div_clk clock.
--- arch/arm/boot/dts/dra7xx-clocks.dtsi | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
arch/arm/boot/dts/dra7xx-clocks.dtsi +24 -0
@@ -2079,3 +2079,27 @@ vip3_gclk_mux: vip3_gclk_mux at 4a009030 { reg = <0x4a009030 0x4>; bit-mask = <0x1>; }; + +optfclk_pciephy_div: optfclk_pciephy_div at 4a00821c { + compatible = "divider-clock"; + clocks = <&apll_pcie_ck>; + #clock-cells = <0>; + reg = <0x4a00821c 0x4>; + bit-mask = <0x100>; +}; + +optfclk_pciephy_clk: optfclk_pciephy_clk at 4a0093b0 { + compatible = "gate-clock"; + clocks = <&apll_pcie_ck>; + #clock-cells = <0>; + reg = <0x4a0093b0 0x4>; + bit-shift = <9>; +}; + +optfclk_pciephy_div_clk: optfclk_pciephy_div_clk at 4a0093b0 { + compatible = "gate-clock"; + clocks = <&optfclk_pciephy_div>; + #clock-cells = <0>; + reg = <0x4a0093b0 0x4>; + bit-shift = <10>; +};
Signature · 1 line
1.7.9.5
PATCH v5 16/31 CLK: TI: DRA7: Add APLL support
In reply to Tero KristoFrom: Keerthy <[email protected]>
The patch adds support for DRA7 PCIe APLL. The APLL sources the optional functional clocks for PCIe module.
APLL stands for Analog PLL. This is different when comapred with DPLL meaning Digital PLL, the phase detection is done using an analog circuit.
--- .../devicetree/bindings/clock/ti/apll.txt | 32 +++ arch/arm/mach-omap2/clock.h | 1 - drivers/clk/ti/Makefile | 2 +- drivers/clk/ti/apll.c | 209 ++++++++++++++++++++ include/linux/clk/ti.h | 2 + 5 files changed, 244 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/ti/apll.txt create mode 100644 drivers/clk/ti/apll.c
Documentation/devicetree/bindings/clock/ti/apll.txt new file +32 -0
@@ -0,0 +1,32 @@ +Binding for Texas Instruments APLL clock. + +This binding uses the common clock binding[1]. It assumes a +register-mapped APLL with usually two selectable input clocks +(reference clock and bypass clock), with analog phase locked +loop logic for multiplying the input clock to a desired output +clock. This clock also typically supports different operation +modes (locked, low power stop etc.) APLL mostly behaves like +a subtype of a DPLL [2], although a simplified one at that. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt +[2] Documentation/devicetree/bindings/clock/ti/dpll.txt + +Required properties: +- compatible : shall be "ti,dra7-apll-clock" +- #clock-cells : from common clock binding; shall be set to 0. +- clocks : link phandles of parent clocks (clk-ref and clk-bypass) +- reg : array of register base addresses for controlling the APLL: + reg[0] = control register + reg[1] = idle status register +- ti,clk-ref : link phandle for the reference clock +- ti,clk-bypass : link phandle for the bypass clock + +Examples: + apll_pcie_ck: apll_pcie_ck at 4a008200 { + #clock-cells = <0>; + clocks = <&apll_pcie_in_clk_mux>; + reg = <0x4a00821c 0x4>, <0x4a008220 0x4>; + ti,clk-bypass = <&dpll_pcie_ref_ck>; + ti,clk-ref = <&apll_pcie_in_clk_mux>; + compatible = "ti,dra7-apll-clock"; + };
arch/arm/mach-omap2/clock.h +0 -1
@@ -38,7 +38,6 @@ struct omap_clk { }struct clockdomain ; -#define to_clk_hw_omap (_hw) container_of(_hw, struct clk_hw_omap, hw)#define DEFINE_STRUCT_CLK (_name, _parent_array_name, _clkops_name) \ static struct clk _name = { \
drivers/clk/ti/Makefile +1 -1
@@ -1,4 +1,4 @@ ifneq ($(CONFIG_OF),) obj-y += clk.o dpll.o autoidle.o gate.o \ - clk-44xx.o clk-54xx.o + apll.o clk-44xx.o clk-54xx.o endif
drivers/clk/ti/apll.c new file +209 -0
209 lines not on this page · raw message
include/linux/clk/ti.h +2 -0
@@ -159,6 +159,8 @@ struct omap_dt_clk { .node_name = name, \ } +#define to_clk_hw_omap (_hw) container_of(_hw, struct clk_hw_omap, hw) +void omap2_init_clk_hw_omap_clocks (struct clk *clk);int omap3_noncore_dpll_enable (struct clk_hw *hw);void omap3_noncore_dpll_disable (struct clk_hw *hw);
Signature · 1 line
1.7.9.5
PATCH v5 16/31 CLK: TI: DRA7: Add APLL support
Quoted 37 lines · Tero Kristo
From: Keerthy <[email protected]>
The patch adds support for DRA7 PCIe APLL. The APLL sources the optional functional clocks for PCIe module.
APLL stands for Analog PLL. This is different when comapred with DPLL meaning Digital PLL, the phase detection is done using an analog circuit.
Signed-off-by Keerthy <[email protected]>Signed-off-by Tero Kristo <[email protected]>--- .../devicetree/bindings/clock/ti/apll.txt | 32 +++ arch/arm/mach-omap2/clock.h | 1 - drivers/clk/ti/Makefile | 2 +- drivers/clk/ti/apll.c | 209 ++++++++++++++++++++ include/linux/clk/ti.h | 2 + 5 files changed, 244 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/ti/apll.txt create mode 100644 drivers/clk/ti/apll.cDocumentation/devicetree/bindings/clock/ti/apll.txt new file +10
-0@@ -0,0 +1,32 @@ +Binding for Texas Instruments APLL clock. + +This binding uses the common clock binding[1]. It assumes a +register-mapped APLL with usually two selectable input clocks +(reference clock and bypass clock), with analog phase locked +loop logic for multiplying the input clock to a desired output +clock. This clock also typically supports different operation +modes (locked, low power stop etc.) APLL mostly behaves like +a subtype of a DPLL [2], although a simplified one at that. +
Documentation/devicetree/bindings/clock/ti/apll.txt line 20
Quoted 10 lines
Documentation/devicetree/bindings/clock/ti/apll.txt new file +10
-0+[1] Documentation/devicetree/bindings/clock/clock-bindings.txt +[2] Documentation/devicetree/bindings/clock/ti/dpll.txt + +Required properties: +- compatible : shall be "ti,dra7-apll-clock" +- #clock-cells : from common clock binding; shall be set to 0. +- clocks : link phandles of parent clocks (clk-ref and clk-bypass) +- reg : array of register base addresses for controlling the APLL: + reg[0] = control register + reg[1] = idle status register
Using reg-names is likely a good idea here.
Documentation/devicetree/bindings/clock/ti/apll.txt line 22
Quoted 2 lines
Documentation/devicetree/bindings/clock/ti/apll.txt new file +2
-0+- ti,clk-ref : link phandle for the reference clock +- ti,clk-bypass : link phandle for the bypass clock
You don't need this. Use the clocks and clock-names properties.
[...]
Quoted 10 lines
Documentation/devicetree/bindings/clock/ti/apll.txt new file +10
-0+static int dra7_apll_enable(struct clk_hw *hw) +{ + struct clk_hw_omap *clk = to_clk_hw_omap(hw); + int r = 0, i = 0; + struct dpll_data *ad; + const char *clk_name; + u8 state = 1; + u32 v; + + ad = clk->dpll_data;
Documentation/devicetree/bindings/clock/ti/apll.txt
Quoted 10 lines
Documentation/devicetree/bindings/clock/ti/apll.txt new file +10
-0+ if (!ad) + return -EINVAL; + + clk_name = __clk_get_name(clk->hw.clk); + + state <<= __ffs(ad->idlest_mask); + + /* Check is already locked */ + if ((__raw_readl(ad->idlest_reg) & ad->idlest_mask) == state) + return r;
Why __raw_readl rather than raw_readl?
Documentation/devicetree/bindings/clock/ti/apll.txt
Quoted 5 lines
Documentation/devicetree/bindings/clock/ti/apll.txt new file +5
-0+ + v = __raw_readl(ad->control_reg); + v &= ~ad->enable_mask; + v |= APLL_FORCE_LOCK << __ffs(ad->enable_mask); + __raw_writel(v, ad->control_reg);
Why not raw_writel? Do you not need the rmb() provided by writel, here or anywhere else?
[...]
Quoted 27 lines
Documentation/devicetree/bindings/clock/ti/apll.txt new file +27
-0+void __init of_dra7_apll_setup(struct device_node *node) +{ + const struct clk_ops *ops; + struct clk *clk; + const char *clk_name = node->name; + int num_parents; + const char **parent_names = NULL; + struct of_phandle_args clkspec; + u8 apll_flags = 0; + struct dpll_data *ad; + u32 idlest_mask = 0x1; + u32 autoidle_mask = 0x3; + int i; + + ops = &apll_ck_ops; + ad = kzalloc(sizeof(*ad), GFP_KERNEL); + if (!ad) { + pr_err("%s: could not allocate dpll_data\n", __func__); + return; + } + + of_property_read_string(node, "clock-output-names", &clk_name); + + num_parents = of_clk_get_parent_count(node); + if (num_parents < 1) { + pr_err("%s: omap dpll %s must have parent(s)\n", + __func__, node->name);
Documentation/devicetree/bindings/clock/ti/apll.txt
Quoted 10 lines
Documentation/devicetree/bindings/clock/ti/apll.txt new file +10
-0+ goto cleanup; + } + + parent_names = kzalloc(sizeof(char *) * num_parents, GFP_KERNEL); + + for (i = 0; i < num_parents; i++) + parent_names[i] = of_clk_get_parent_name(node, i); + + clkspec.np = of_parse_phandle(node, "ti,clk-ref", 0); + ad->clk_ref = of_clk_get_from_provider(&clkspec);
Use clocks, clock-names, and of_clk_get_by_name().
Thanks,
Mark.
PATCH v5 16/31 CLK: TI: DRA7: Add APLL support
Quoted 42 lines · Mark Rutland
Quoted 41 lines · Tero Kristo
From: Keerthy <[email protected]>
The patch adds support for DRA7 PCIe APLL. The APLL sources the optional functional clocks for PCIe module.
APLL stands for Analog PLL. This is different when comapred with DPLL meaning Digital PLL, the phase detection is done using an analog circuit.
Signed-off-by Keerthy <[email protected]>Signed-off-by Tero Kristo <[email protected]>--- .../devicetree/bindings/clock/ti/apll.txt | 32 +++ arch/arm/mach-omap2/clock.h | 1 - drivers/clk/ti/Makefile | 2 +- drivers/clk/ti/apll.c | 209 ++++++++++++++++++++ include/linux/clk/ti.h | 2 + 5 files changed, 244 insertions(+), 2 deletions(-)create mode 100644
Documentation/devicetree/bindings/clock/ti/apll.txtcreate mode 100644drivers/clk/ti/apll.cDocumentation/devicetree/bindings/clock/ti/apll.txt new file +14
-0@@ -0,0 +1,32 @@ +Binding for Texas Instruments APLL clock. + +This binding uses the common clock binding[1]. It assumes a +register-mapped APLL with usually two selectable input clocks +(reference clock and bypass clock), with analog phase locked +loop logic for multiplying the input clock to a desired output +clock. This clock also typically supports different operation +modes (locked, low power stop etc.) APLL mostly behaves like +a subtype of a DPLL [2], although a simplified one at that. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt +[2] Documentation/devicetree/bindings/clock/ti/dpll.txt + +Required properties:
Quoted 8 lines
Documentation/devicetree/bindings/clock/ti/apll.txt line 20
Quoted 6 lines
Documentation/devicetree/bindings/clock/ti/apll.txt new file +6
-0+- compatible : shall be "ti,dra7-apll-clock" +- #clock-cells : from common clock binding; shall be set to 0. +- clocks : link phandles of parent clocks (clk-ref and clk-bypass) +- reg : array of register base addresses for controlling the APLL: + reg[0] = control register + reg[1] = idle status registerUsing reg-names is likely a good idea here.
I'll change these for next rev to be similar to what was discussed in the DPLL part.
Quoted 5 lines
Documentation/devicetree/bindings/clock/ti/apll.txt line 22
Quoted 3 lines
Documentation/devicetree/bindings/clock/ti/apll.txt new file +2
-0+- ti,clk-ref : link phandle for the reference clock +- ti,clk-bypass : link phandle for the bypass clockYou don't need this. Use the clocks and clock-names properties.
Ditto.
Quoted 17 lines
[...]
Quoted 14 lines
Documentation/devicetree/bindings/clock/ti/apll.txt new file +14
-0+static int dra7_apll_enable(struct clk_hw *hw) +{ + struct clk_hw_omap *clk = to_clk_hw_omap(hw); + int r = 0, i = 0; + struct dpll_data *ad; + const char *clk_name; + u8 state = 1; + u32 v; + + ad = clk->dpll_data; + if (!ad) + return -EINVAL; + + clk_name = __clk_get_name(clk->hw.clk);
Quoted 8 lines
Documentation/devicetree/bindings/clock/ti/apll.txt
Quoted 6 lines
Documentation/devicetree/bindings/clock/ti/apll.txt new file +6
-0+ + state <<= __ffs(ad->idlest_mask); + + /* Check is already locked */ + if ((__raw_readl(ad->idlest_reg) & ad->idlest_mask) == state) + return r;Why
__raw_readlrather thanraw_readl?
Hmm not sure, Keerthy, do you have any comment on this as the patch was originally written by you? :)
Quoted 9 lines
Documentation/devicetree/bindings/clock/ti/apll.txt
Quoted 6 lines
Documentation/devicetree/bindings/clock/ti/apll.txt new file +5
-0+ + v = __raw_readl(ad->control_reg); + v &= ~ad->enable_mask; + v |= APLL_FORCE_LOCK << __ffs(ad->enable_mask); + __raw_writel(v, ad->control_reg);Why not
raw_writel? Do you not need thermb()provided by writel, here or anywhere else?
Same, Keerthy? Probably just legacy copy paste from omap2 code and can be updated based on your comment. Some of these might actually be some old optimizations, but the APLL enable/disable should be called so seldom it shouldn't matter. If no objections, I'll just change these all for next rev.
Quoted 34 lines
[...]
Quoted 31 lines
Documentation/devicetree/bindings/clock/ti/apll.txt new file +31
-0+void __init of_dra7_apll_setup(struct device_node *node) +{ + const struct clk_ops *ops; + struct clk *clk; + const char *clk_name = node->name; + int num_parents; + const char **parent_names = NULL; + struct of_phandle_args clkspec; + u8 apll_flags = 0; + struct dpll_data *ad; + u32 idlest_mask = 0x1; + u32 autoidle_mask = 0x3; + int i; + + ops = &apll_ck_ops; + ad = kzalloc(sizeof(*ad), GFP_KERNEL); + if (!ad) { + pr_err("%s: could not allocate dpll_data\n", __func__); + return; + } + + of_property_read_string(node, "clock-output-names", &clk_name); + + num_parents = of_clk_get_parent_count(node); + if (num_parents < 1) { + pr_err("%s: omap dpll %s must have parent(s)\n", + __func__, node->name); + goto cleanup; + } + + parent_names = kzalloc(sizeof(char *) * num_parents, GFP_KERNEL);
Quoted 8 lines
Documentation/devicetree/bindings/clock/ti/apll.txt
Quoted 6 lines
Documentation/devicetree/bindings/clock/ti/apll.txt new file +6
-0+ + for (i = 0; i < num_parents; i++) + parent_names[i] = of_clk_get_parent_name(node, i); + + clkspec.np = of_parse_phandle(node, "ti,clk-ref", 0); + ad->clk_ref = of_clk_get_from_provider(&clkspec);Use clocks, clock-names, and
of_clk_get_by_name().
Yea, will change.
-Tero
PATCH v5 16/31 CLK: TI: DRA7: Add APLL support
Hi Mark/Tero,
Sorry for responding late.
Quoted 92 lines · Tero Kristo
Quoted 45 lines · Mark Rutland
Quoted 44 lines · Tero Kristo
From: Keerthy <[email protected]>
The patch adds support for DRA7 PCIe APLL. The APLL sources the optional functional clocks for PCIe module.
APLL stands for Analog PLL. This is different when comapred with DPLL meaning Digital PLL, the phase detection is done using an analog circuit.
Signed-off-by Keerthy <[email protected]>Signed-off-by Tero Kristo <[email protected]>--- .../devicetree/bindings/clock/ti/apll.txt | 32 +++ arch/arm/mach-omap2/clock.h | 1 - drivers/clk/ti/Makefile | 2 +- drivers/clk/ti/apll.c | 209 ++++++++++++++++++++ include/linux/clk/ti.h | 2 + 5 files changed, 244 insertions(+), 2 deletions(-)create mode 100644
Documentation/devicetree/bindings/clock/ti/apll.txt
create mode 100644drivers/clk/ti/apll.cDocumentation/devicetree/bindings/clock/ti/apll.txt new file +14
-0@@ -0,0 +1,32 @@ +Binding for Texas Instruments APLL clock. + +This binding uses the common clock binding[1]. It assumes a +register-mapped APLL with usually two selectable input clocks +(reference clock and bypass clock), with analog phase locked +loop logic for multiplying the input clock to a desired output +clock. This clock also typically supports different operation +modes (locked, low power stop etc.) APLL mostly behaves like +a subtype of a DPLL [2], although a simplified one at that. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt +[2] Documentation/devicetree/bindings/clock/ti/dpll.txt + +Required properties:Quoted 8 lines
Documentation/devicetree/bindings/clock/ti/apll.txt line 20
Quoted 6 lines
Documentation/devicetree/bindings/clock/ti/apll.txt new file +6
-0+- compatible : shall be "ti,dra7-apll-clock" +- #clock-cells : from common clock binding; shall be set to 0. +- clocks : link phandles of parent clocks (clk-ref and clk-bypass) +- reg : array of register base addresses for controlling the APLL: + reg[0] = control register + reg[1] = idle status registerUsing reg-names is likely a good idea here.
I'll change these for next rev to be similar to what was discussed in the DPLL part.
Quoted 5 lines
Documentation/devicetree/bindings/clock/ti/apll.txt line 22
Quoted 3 lines
Documentation/devicetree/bindings/clock/ti/apll.txt new file +2
-0+- ti,clk-ref : link phandle for the reference clock +- ti,clk-bypass : link phandle for the bypass clockYou don't need this. Use the clocks and clock-names properties.
Ditto.
Quoted 17 lines
[...]
Quoted 14 lines
Documentation/devicetree/bindings/clock/ti/apll.txt new file +14
-0+static int dra7_apll_enable(struct clk_hw *hw) +{ + struct clk_hw_omap *clk = to_clk_hw_omap(hw); + int r = 0, i = 0; + struct dpll_data *ad; + const char *clk_name; + u8 state = 1; + u32 v; + + ad = clk->dpll_data; + if (!ad) + return -EINVAL; + + clk_name = __clk_get_name(clk->hw.clk);Quoted 8 lines
Documentation/devicetree/bindings/clock/ti/apll.txt
Quoted 6 lines
Documentation/devicetree/bindings/clock/ti/apll.txt new file +6
-0+ + state <<= __ffs(ad->idlest_mask); + + /* Check is already locked */ + if ((__raw_readl(ad->idlest_reg) & ad->idlest_mask) == state) + return r;Why
__raw_readlrather thanraw_readl?
Quoted 2 lines
Hmm not sure, Keerthy, do you have any comment on this as the patch was originally written by you? :)
It was more taking the reference from omap2 code. raw_readl can be used.
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Documentation/devicetree/bindings/clock/ti/apll.txt new file +5
-0+ + v = __raw_readl(ad->control_reg); + v &= ~ad->enable_mask; + v |= APLL_FORCE_LOCK << __ffs(ad->enable_mask); + __raw_writel(v, ad->control_reg);
Quoted 8 lines
Quoted 2 lines
Why not
raw_writel? Do you not need thermb()provided by writel, here or anywhere else?Same, Keerthy? Probably just legacy copy paste from omap2 code and can be updated based on your comment. Some of these might actually be some old optimizations, but the APLL enable/disable should be called so seldom it shouldn't matter. If no objections, I'll just change these all for next rev.
Thanks Tero.
Quoted 45 lines
Quoted 36 lines
[...]
Quoted 32 lines
Documentation/devicetree/bindings/clock/ti/apll.txt new file +31
-0+void __init of_dra7_apll_setup(struct device_node *node) +{ + const struct clk_ops *ops; + struct clk *clk; + const char *clk_name = node->name; + int num_parents; + const char **parent_names = NULL; + struct of_phandle_args clkspec; + u8 apll_flags = 0; + struct dpll_data *ad; + u32 idlest_mask = 0x1; + u32 autoidle_mask = 0x3; + int i; + + ops = &apll_ck_ops; + ad = kzalloc(sizeof(*ad), GFP_KERNEL); + if (!ad) { + pr_err("%s: could not allocate dpll_data\n", __func__); + return; + } + + of_property_read_string(node, "clock-output-names", &clk_name); + + num_parents = of_clk_get_parent_count(node); + if (num_parents < 1) { + pr_err("%s: omap dpll %s must have parent(s)\n", + __func__, node->name); + goto cleanup; + } + + parent_names = kzalloc(sizeof(char *) * num_parents,
GFP_KERNEL);Quoted 8 lines
Documentation/devicetree/bindings/clock/ti/apll.txt
Quoted 6 lines
Documentation/devicetree/bindings/clock/ti/apll.txt new file +6
-0+ + for (i = 0; i < num_parents; i++) + parent_names[i] = of_clk_get_parent_name(node, i); + + clkspec.np = of_parse_phandle(node, "ti,clk-ref", 0); + ad->clk_ref = of_clk_get_from_provider(&clkspec);Use clocks, clock-names, and
of_clk_get_by_name().
Quoted 3 lines
Yea, will change.
-Tero
Regards,
Keerthy
PATCH v5 17/31 CLK: TI: add dra7 clock init file
In reply to Tero Kristoclk-7xx.c now contains the clock init functionality for dra7, including DT clock registration and adding of static clkdev entries.
--- drivers/clk/ti/Makefile | 3 ++- drivers/clk/ti/clk-7xx.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 drivers/clk/ti/clk-7xx.c
drivers/clk/ti/Makefile +2 -1
@@ -1,4 +1,5 @@ ifneq ($(CONFIG_OF),) obj-y += clk.o dpll.o autoidle.o gate.o \ - apll.o clk-44xx.o clk-54xx.o + apll.o clk-44xx.o clk-54xx.o \ + clk-7xx.o endif
drivers/clk/ti/clk-7xx.c new file +67 -0
67 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v5 18/31 CLK: DT: add support for set-rate-parent flag
In reply to Tero KristoAdding set-rate-parent to clock node now allows a node to forward clk_set_rate request to its parent clock.
--- drivers/clk/clk-divider.c | 6 +++++- drivers/clk/clk-fixed-factor.c | 6 +++++- drivers/clk/clk-gate.c | 8 ++++++-- drivers/clk/clk-mux.c | 6 +++++- 4 files changed, 21 insertions(+), 5 deletions(-)
drivers/clk/clk-divider.c +5 -1
@@ -388,6 +388,7 @@ void of_divider_clk_setup(struct device_node *node)u32 mask =0 ;u32 shift =0 ;struct clk_div_table *table; +u32 flags =0 ;of_property_read_string (node,"clock-output-names" , &clk_name);
@@ -418,12 +419,15 @@ void of_divider_clk_setup(struct device_node *node)if (of_property_read_bool (node,"hiword-mask" )) clk_divider_flags |=CLK_DIVIDER_HIWORD_MASK ; +if (of_property_read_bool (node,"set-rate-parent" )) + flags |=CLK_SET_RATE_PARENT ; + table =of_clk_get_div_table (node);if (IS_ERR (table))return ; clk =_register_divider (NULL , clk_name, - parent_name,0 , + parent_name, flags, reg, (u8 ) shift, mask, clk_divider_flags, table,NULL );
drivers/clk/clk-fixed-factor.c +5 -1
@@ -107,6 +107,7 @@ void __init of_fixed_factor_clk_setup(struct device_node *node)const char *clk_name = node->name;const char *parent_name;u32 div, mult; +u32 flags =0 ;if (of_property_read_u32 (node,"clock-div" , &div)) { pr_err("%s Fixed factor clock <%s> must have a clock-div property\n",
@@ -123,7 +124,10 @@ void __init of_fixed_factor_clk_setup(struct device_node *node)of_property_read_string (node,"clock-output-names" , &clk_name); parent_name =of_clk_get_parent_name (node,0 ); - clk =clk_register_fixed_factor (NULL , clk_name, parent_name,0 , +if (of_property_read_bool (node,"set-rate-parent" )) + flags |=CLK_SET_RATE_PARENT ; + + clk =clk_register_fixed_factor (NULL , clk_name, parent_name, flags, mult, div);if (!IS_ERR (clk))of_clk_add_provider (node, of_clk_src_simple_get, clk);
drivers/clk/clk-gate.c +6 -2
@@ -176,6 +176,7 @@ void of_gate_clk_setup(struct device_node *node)const char *parent_name;u8 clk_gate_flags =0 ;u32 bit_idx =0 ; +u32 flags =0 ;of_property_read_string (node,"clock-output-names" , &clk_name);
@@ -195,8 +196,11 @@ void of_gate_clk_setup(struct device_node *node)if (of_property_read_bool (node,"hiword-mask" )) clk_gate_flags |=CLK_GATE_HIWORD_MASK ; - clk =clk_register_gate (NULL , clk_name, parent_name,0 , reg, (u8 ) bit_idx, - clk_gate_flags,NULL ); +if (of_property_read_bool (node,"set-rate-parent" )) + flags |=CLK_SET_RATE_PARENT ; + + clk =clk_register_gate (NULL , clk_name, parent_name, flags, reg, + (u8 ) bit_idx, clk_gate_flags,NULL );if (!IS_ERR (clk))of_clk_add_provider (node, of_clk_src_simple_get, clk);
drivers/clk/clk-mux.c +5 -1
@@ -184,6 +184,7 @@ void of_mux_clk_setup(struct device_node *node)u8 clk_mux_flags =0 ;u32 mask =0 ;u32 shift =0 ; +u32 flags =0 ;of_property_read_string (node,"clock-output-names" , &clk_name);
@@ -219,8 +220,11 @@ void of_mux_clk_setup(struct device_node *node)if (of_property_read_bool (node,"hiword-mask" )) clk_mux_flags |=CLK_MUX_HIWORD_MASK ; +if (of_property_read_bool (node,"set-rate-parent" )) + flags |=CLK_SET_RATE_PARENT ; + clk =clk_register_mux_table (NULL , clk_name, parent_names, num_parents, -0 , reg, (u8 ) shift, mask, clk_mux_flags, + flags, reg, (u8 ) shift, mask, clk_mux_flags,NULL ,NULL );if (!IS_ERR (clk))
Signature · 1 line
1.7.9.5
PATCH v5 18/31 CLK: DT: add support for set-rate-parent flag
Quoted 2 lines · Tero Kristo
Adding set-rate-parent to clock node now allows a node to forward
clk_set_raterequest to its parent clock.
Why do you need this?
Is this a description of the hardware, or configuration for Linux? It feels like the latter, which shouldn't really be in DT.
I'm not that familiar with the internals of the clock framework, and don't understand the implications of this.
If this is necessary, the bindings need to be updated.
Mike, thoughts?
Mark.
Quoted 122 lines
Signed-off-by Tero Kristo <[email protected]>--- drivers/clk/clk-divider.c | 6 +++++- drivers/clk/clk-fixed-factor.c | 6 +++++- drivers/clk/clk-gate.c | 8 ++++++-- drivers/clk/clk-mux.c | 6 +++++- 4 files changed, 21 insertions(+), 5 deletions(-)drivers/clk/clk-divider.c +5
-1@@ -388,6 +388,7 @@ void of_divider_clk_setup(struct device_node *node)u32 mask =0 ;u32 shift =0 ;struct clk_div_table *table; +u32 flags =0 ;of_property_read_string (node,"clock-output-names" , &clk_name);@@ -418,12 +419,15 @@ void of_divider_clk_setup(struct device_node *node)if (of_property_read_bool (node,"hiword-mask" )) clk_divider_flags |=CLK_DIVIDER_HIWORD_MASK ; +if (of_property_read_bool (node,"set-rate-parent" )) + flags |=CLK_SET_RATE_PARENT ; + table =of_clk_get_div_table (node);if (IS_ERR (table))return ; clk =_register_divider (NULL , clk_name, - parent_name,0 , + parent_name, flags, reg, (u8 ) shift, mask, clk_divider_flags, table,NULL );drivers/clk/clk-fixed-factor.c +5
-1@@ -107,6 +107,7 @@ void __init of_fixed_factor_clk_setup(struct device_node *node)const char *clk_name = node->name;const char *parent_name;u32 div, mult; +u32 flags =0 ;if (of_property_read_u32 (node,"clock-div" , &div)) { pr_err("%s Fixed factor clock <%s> must have a clock-div property\n",@@ -123,7 +124,10 @@ void __init of_fixed_factor_clk_setup(struct device_node *node)of_property_read_string (node,"clock-output-names" , &clk_name); parent_name =of_clk_get_parent_name (node,0 ); - clk =clk_register_fixed_factor (NULL , clk_name, parent_name,0 , +if (of_property_read_bool (node,"set-rate-parent" )) + flags |=CLK_SET_RATE_PARENT ; + + clk =clk_register_fixed_factor (NULL , clk_name, parent_name, flags, mult, div);if (!IS_ERR (clk))of_clk_add_provider (node, of_clk_src_simple_get, clk);drivers/clk/clk-gate.c +6
-2@@ -176,6 +176,7 @@ void of_gate_clk_setup(struct device_node *node)const char *parent_name;u8 clk_gate_flags =0 ;u32 bit_idx =0 ; +u32 flags =0 ;of_property_read_string (node,"clock-output-names" , &clk_name);@@ -195,8 +196,11 @@ void of_gate_clk_setup(struct device_node *node)if (of_property_read_bool (node,"hiword-mask" )) clk_gate_flags |=CLK_GATE_HIWORD_MASK ; - clk =clk_register_gate (NULL , clk_name, parent_name,0 , reg, (u8 ) bit_idx, - clk_gate_flags,NULL ); +if (of_property_read_bool (node,"set-rate-parent" )) + flags |=CLK_SET_RATE_PARENT ; + + clk =clk_register_gate (NULL , clk_name, parent_name, flags, reg, + (u8 ) bit_idx, clk_gate_flags,NULL );if (!IS_ERR (clk))of_clk_add_provider (node, of_clk_src_simple_get, clk);drivers/clk/clk-mux.c +5
-1@@ -184,6 +184,7 @@ void of_mux_clk_setup(struct device_node *node)u8 clk_mux_flags =0 ;u32 mask =0 ;u32 shift =0 ; +u32 flags =0 ;of_property_read_string (node,"clock-output-names" , &clk_name);@@ -219,8 +220,11 @@ void of_mux_clk_setup(struct device_node *node)if (of_property_read_bool (node,"hiword-mask" )) clk_mux_flags |=CLK_MUX_HIWORD_MASK ; +if (of_property_read_bool (node,"set-rate-parent" )) + flags |=CLK_SET_RATE_PARENT ; + clk =clk_register_mux_table (NULL , clk_name, parent_names, num_parents, -0 , reg, (u8 ) shift, mask, clk_mux_flags, + flags, reg, (u8 ) shift, mask, clk_mux_flags,NULL ,NULL );if (!IS_ERR (clk))Signature · 7 lines
1.7.9.5 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel at lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v5 19/31 ARM: dts: am33xx clock data
In reply to Tero KristoThis patch creates a unique node for each clock in the AM33xx power, reset and clock manager (PRCM).
--- arch/arm/boot/dts/am33xx-clocks.dtsi | 658 ++++++++++++++++++++++++++++++++++ arch/arm/boot/dts/am33xx.dtsi | 7 + 2 files changed, 665 insertions(+) create mode 100644 arch/arm/boot/dts/am33xx-clocks.dtsi
arch/arm/boot/dts/am33xx-clocks.dtsi new file +658 -0
@@ -0,0 +1,658 @@ +/* + * Device Tree Source for AM33xx clock data + * + * Copyright (C) 2013 Texas Instruments, Inc. + * + * 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. + */ + +clk_32768_ck: clk_32768_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <32768>; +}; + +clk_rc32k_ck: clk_rc32k_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <32000>; +}; + +virt_19200000_ck: virt_19200000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <19200000>; +}; + +virt_24000000_ck: virt_24000000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <24000000>; +}; + +virt_25000000_ck: virt_25000000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <25000000>; +}; + +virt_26000000_ck: virt_26000000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <26000000>; +}; + +sys_clkin_ck: sys_clkin_ck at 44e10040 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&virt_19200000_ck>, <&virt_24000000_ck>, <&virt_25000000_ck>, <&virt_26000000_ck>; + bit-shift = <22>; + reg = <0x44e10040 0x4>; + bit-mask = <0x3>; +}; + +tclkin_ck: tclkin_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <12000000>; +}; + +dpll_core_ck: dpll_core_ck at 44e00490 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-core-clock"; + clocks = <&sys_clkin_ck>; + reg = <0x44e00490 0x4>, <0x44e0045c 0x4>, <0x0 0x4>, <0x44e00468 0x4>; + ti,clk-ref = <&sys_clkin_ck>; + ti,clk-bypass = <&sys_clkin_ck>; +}; + +dpll_core_x2_ck: dpll_core_x2_ck { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-x2-clock"; + clocks = <&dpll_core_ck>; +}; + +dpll_core_m4_ck: dpll_core_m4_ck at 44e00480 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&dpll_core_x2_ck>; + reg = <0x44e00480 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; +}; + +dpll_core_m5_ck: dpll_core_m5_ck at 44e00484 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&dpll_core_x2_ck>; + reg = <0x44e00484 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; +}; + +dpll_core_m6_ck: dpll_core_m6_ck at 44e004d8 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&dpll_core_x2_ck>; + reg = <0x44e004d8 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; +}; + +dpll_mpu_ck: dpll_mpu_ck at 44e00488 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-clock"; + clocks = <&sys_clkin_ck>; + reg = <0x44e00488 0x4>, <0x44e00420 0x4>, <0x0 0x4>, <0x44e0042c 0x4>; + ti,clk-ref = <&sys_clkin_ck>; + ti,clk-bypass = <&sys_clkin_ck>; +}; + +dpll_mpu_m2_ck: dpll_mpu_m2_ck at 44e004a8 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&dpll_mpu_ck>; + reg = <0x44e004a8 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; +}; + +dpll_ddr_ck: dpll_ddr_ck at 44e00494 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-no-gate-clock"; + clocks = <&sys_clkin_ck>; + reg = <0x44e00494 0x4>, <0x44e00434 0x4>, <0x0 0x4>, <0x44e00440 0x4>; + ti,clk-ref = <&sys_clkin_ck>; + ti,clk-bypass = <&sys_clkin_ck>; +}; + +dpll_ddr_m2_ck: dpll_ddr_m2_ck at 44e004a0 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&dpll_ddr_ck>; + reg = <0x44e004a0 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; +}; + +dpll_ddr_m2_div2_ck: dpll_ddr_m2_div2_ck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_ddr_m2_ck>; + clock-mult = <1>; + clock-div = <2>; +}; + +dpll_disp_ck: dpll_disp_ck at 44e00498 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-no-gate-clock"; + clocks = <&sys_clkin_ck>; + reg = <0x44e00498 0x4>, <0x44e00448 0x4>, <0x0 0x4>, <0x44e00454 0x4>; + ti,clk-ref = <&sys_clkin_ck>; + ti,clk-bypass = <&sys_clkin_ck>; +}; + +dpll_disp_m2_ck: dpll_disp_m2_ck at 44e004a4 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&dpll_disp_ck>; + reg = <0x44e004a4 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; + set-rate-parent; +}; + +dpll_per_ck: dpll_per_ck at 44e0048c { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-no-gate-j-type-clock"; + clocks = <&sys_clkin_ck>; + reg = <0x44e0048c 0x4>, <0x44e00470 0x4>, <0x0 0x4>, <0x44e0049c 0x4>; + ti,clk-ref = <&sys_clkin_ck>; + ti,clk-bypass = <&sys_clkin_ck>; +}; + +dpll_per_m2_ck: dpll_per_m2_ck at 44e004ac { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&dpll_per_ck>; + reg = <0x44e004ac 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; +}; + +dpll_per_m2_div4_wkupdm_ck: dpll_per_m2_div4_wkupdm_ck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_per_m2_ck>; + clock-mult = <1>; + clock-div = <4>; +}; + +dpll_per_m2_div4_ck: dpll_per_m2_div4_ck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_per_m2_ck>; + clock-mult = <1>; + clock-div = <4>; +}; + +adc_tsc_fck: adc_tsc_fck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&sys_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +cefuse_fck: cefuse_fck at 44e00a20 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&sys_clkin_ck>; + bit-shift = <1>; + reg = <0x44e00a20 0x4>; +}; + +clk_24mhz: clk_24mhz { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_per_m2_ck>; + clock-mult = <1>; + clock-div = <8>; +}; + +clkdiv32k_ck: clkdiv32k_ck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&clk_24mhz>; + clock-mult = <1>; + clock-div = <732>; +}; + +clkdiv32k_ick: clkdiv32k_ick at 44e0014c { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&clkdiv32k_ck>; + reg = <0x44e0014c 0x4>; + bit-shift = <1>; +}; + +dcan0_fck: dcan0_fck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&sys_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +dcan1_fck: dcan1_fck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&sys_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +l3_gclk: l3_gclk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_core_m4_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +pruss_ocp_gclk: pruss_ocp_gclk at 44e00530 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&l3_gclk>, <&dpll_disp_m2_ck>; + reg = <0x44e00530 0x4>; + bit-mask = <0x1>; +}; + +mcasp0_fck: mcasp0_fck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&sys_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +mcasp1_fck: mcasp1_fck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&sys_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +mmu_fck: mmu_fck at 44e00914 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&dpll_core_m4_ck>; + bit-shift = <1>; + reg = <0x44e00914 0x4>; +}; + +smartreflex0_fck: smartreflex0_fck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&sys_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +smartreflex1_fck: smartreflex1_fck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&sys_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +sha0_fck: sha0_fck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&sys_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +aes0_fck: aes0_fck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&sys_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +timer1_fck: timer1_fck at 44e00528 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&sys_clkin_ck>, <&clkdiv32k_ick>, <&tclkin_ck>, <&clk_rc32k_ck>, <&clk_32768_ck>; + reg = <0x44e00528 0x4>; + bit-mask = <0x7>; +}; + +timer2_fck: timer2_fck at 44e00508 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>; + reg = <0x44e00508 0x4>; + bit-mask = <0x3>; +}; + +timer3_fck: timer3_fck at 44e0050c { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>; + reg = <0x44e0050c 0x4>; + bit-mask = <0x3>; +}; + +timer4_fck: timer4_fck at 44e00510 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>; + reg = <0x44e00510 0x4>; + bit-mask = <0x3>; +}; + +timer5_fck: timer5_fck at 44e00518 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>; + reg = <0x44e00518 0x4>; + bit-mask = <0x3>; +}; + +timer6_fck: timer6_fck at 44e0051c { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>; + reg = <0x44e0051c 0x4>; + bit-mask = <0x3>; +}; + +timer7_fck: timer7_fck at 44e00504 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>; + reg = <0x44e00504 0x4>; + bit-mask = <0x3>; +}; + +usbotg_fck: usbotg_fck at 44e0047c { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&dpll_per_ck>; + bit-shift = <8>; + reg = <0x44e0047c 0x4>; +}; + +dpll_core_m4_div2_ck: dpll_core_m4_div2_ck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_core_m4_ck>; + clock-mult = <1>; + clock-div = <2>; +}; + +ieee5000_fck: ieee5000_fck at 44e000e4 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&dpll_core_m4_div2_ck>; + bit-shift = <1>; + reg = <0x44e000e4 0x4>; +}; + +wdt1_fck: wdt1_fck at 44e00538 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&clk_rc32k_ck>, <&clkdiv32k_ick>; + reg = <0x44e00538 0x4>; + bit-mask = <0x3>; +}; + +l4_rtc_gclk: l4_rtc_gclk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_core_m4_ck>; + clock-mult = <1>; + clock-div = <2>; +}; + +l4hs_gclk: l4hs_gclk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_core_m4_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +l3s_gclk: l3s_gclk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_core_m4_div2_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +l4fw_gclk: l4fw_gclk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_core_m4_div2_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +l4ls_gclk: l4ls_gclk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_core_m4_div2_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +sysclk_div_ck: sysclk_div_ck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_core_m4_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +cpsw_125mhz_gclk: cpsw_125mhz_gclk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_core_m5_ck>; + clock-mult = <1>; + clock-div = <2>; +}; + +cpsw_cpts_rft_clk: cpsw_cpts_rft_clk at 44e00520 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&dpll_core_m5_ck>, <&dpll_core_m4_ck>; + reg = <0x44e00520 0x4>; + bit-mask = <0x1>; +}; + +gpio0_dbclk_mux_ck: gpio0_dbclk_mux_ck at 44e0053c { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&clk_rc32k_ck>, <&clk_32768_ck>, <&clkdiv32k_ick>; + reg = <0x44e0053c 0x4>; + bit-mask = <0x3>; +}; + +gpio0_dbclk: gpio0_dbclk at 44e00408 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&gpio0_dbclk_mux_ck>; + bit-shift = <18>; + reg = <0x44e00408 0x4>; +}; + +gpio1_dbclk: gpio1_dbclk at 44e000ac { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&clkdiv32k_ick>; + bit-shift = <18>; + reg = <0x44e000ac 0x4>; +}; + +gpio2_dbclk: gpio2_dbclk at 44e000b0 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&clkdiv32k_ick>; + bit-shift = <18>; + reg = <0x44e000b0 0x4>; +}; + +gpio3_dbclk: gpio3_dbclk at 44e000b4 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&clkdiv32k_ick>; + bit-shift = <18>; + reg = <0x44e000b4 0x4>; +}; + +lcd_gclk: lcd_gclk at 44e00534 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&dpll_disp_m2_ck>, <&dpll_core_m5_ck>, <&dpll_per_m2_ck>; + reg = <0x44e00534 0x4>; + bit-mask = <0x3>; + set-rate-parent; +}; + +mmc_clk: mmc_clk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_per_m2_ck>; + clock-mult = <1>; + clock-div = <2>; +}; + +gfx_fclk_clksel_ck: gfx_fclk_clksel_ck at 44e0052c { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&dpll_core_m4_ck>, <&dpll_per_m2_ck>; + bit-shift = <1>; + reg = <0x44e0052c 0x4>; + bit-mask = <0x1>; +}; + +gfx_fck_div_ck: gfx_fck_div_ck at 44e0052c { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&gfx_fclk_clksel_ck>; + reg = <0x44e0052c 0x4>; + table = < 1 0 >, < 2 1 >; + bit-mask = <0x1>; +}; + +sysclkout_pre_ck: sysclkout_pre_ck at 44e00700 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&clk_32768_ck>, <&l3_gclk>, <&dpll_ddr_m2_ck>, <&dpll_per_m2_ck>, <&lcd_gclk>; + reg = <0x44e00700 0x4>; + bit-mask = <0x7>; +}; + +clkout2_div_ck: clkout2_div_ck at 44e00700 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&sysclkout_pre_ck>; + bit-shift = <3>; + reg = <0x44e00700 0x4>; + table = < 1 0 >, < 2 1 >, < 3 2 >, < 4 3 >, < 5 4 >, < 6 5 >, < 7 6 >, < 8 7 >; + bit-mask = <0x7>; +}; + +dbg_sysclk_ck: dbg_sysclk_ck at 44e00414 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&sys_clkin_ck>; + bit-shift = <19>; + reg = <0x44e00414 0x4>; +}; + +dbg_clka_ck: dbg_clka_ck at 44e00414 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&dpll_core_m4_ck>; + bit-shift = <30>; + reg = <0x44e00414 0x4>; +}; + +stm_pmd_clock_mux_ck: stm_pmd_clock_mux_ck at 44e00414 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&dbg_sysclk_ck>, <&dbg_clka_ck>; + bit-shift = <22>; + reg = <0x44e00414 0x4>; + bit-mask = <0x3>; +}; + +trace_pmd_clk_mux_ck: trace_pmd_clk_mux_ck at 44e00414 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&dbg_sysclk_ck>, <&dbg_clka_ck>; + bit-shift = <20>; + reg = <0x44e00414 0x4>; + bit-mask = <0x3>; +}; + +stm_clk_div_ck: stm_clk_div_ck at 44e00414 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&stm_pmd_clock_mux_ck>; + bit-shift = <27>; + reg = <0x44e00414 0x4>; + bit-mask = <0x7>; + index-power-of-two; +}; + +trace_clk_div_ck: trace_clk_div_ck at 44e00414 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&trace_pmd_clk_mux_ck>; + bit-shift = <24>; + reg = <0x44e00414 0x4>; + bit-mask = <0x7>; + index-power-of-two; +}; + +clkout2_ck: clkout2_ck at 44e00700 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&clkout2_div_ck>; + bit-shift = <7>; + reg = <0x44e00700 0x4>; +}; + +ehrpwm0_tbclk: ehrpwm0_tbclk at 44e10664 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&dpll_per_m2_ck>; + bit-shift = <0>; + reg = <0x44e10664 0x4>; +}; + +ehrpwm1_tbclk: ehrpwm1_tbclk at 44e10664 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&dpll_per_m2_ck>; + bit-shift = <1>; + reg = <0x44e10664 0x4>; +}; + +ehrpwm2_tbclk: ehrpwm2_tbclk at 44e10664 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&dpll_per_m2_ck>; + bit-shift = <2>; + reg = <0x44e10664 0x4>; +};
arch/arm/boot/dts/am33xx.dtsi +7 -0
@@ -531,4 +531,11 @@ status = "disabled"; }; }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + /include/ "am33xx-clocks.dtsi" + }; };
Signature · 1 line
1.7.9.5
PATCH v5 20/31 CLK: TI: add am33xx clock init file
In reply to Tero Kristoclk-33xx.c now contains the clock init functionality for am33xx, including DT clock registration and adding of static clkdev entries.
This patch also moves the omap2_clk_enable_init_clocks declaration to the driver include, as this is needed by the am33xx clock init code.
--- arch/arm/mach-omap2/clock.h | 1 - drivers/clk/ti/clk-33xx.c | 85 +++++++++++++++++++++++++++++++++++++++++++ include/linux/clk/ti.h | 1 + 3 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 drivers/clk/ti/clk-33xx.c
arch/arm/mach-omap2/clock.h +0 -1
@@ -266,7 +266,6 @@ void omap2_clk_dflt_find_idlest(struct clk_hw_omap *clk,void __iomem **idlest_reg, u8 *idlest_bit, u8 *idlest_val);int omap2_clk_enable_autoidle_all (void ); -void omap2_clk_enable_init_clocks (const char **clk_names,u8 num_clocks);int omap2_clk_switch_mpurate_at_boot (const char *mpurate_ck_name); void omap2_clk_print_new_rates(const char *hfclkin_ck_name, const char *core_ck_name,
drivers/clk/ti/clk-33xx.c new file +85 -0
85 lines not on this page · raw message
include/linux/clk/ti.h +1 -0
@@ -181,6 +181,7 @@ unsigned long omap3_clkoutx2_recalc(struct clk_hw *hw,int omap2_clkops_enable_clkdm (struct clk_hw *hw);void omap2_clkops_disable_clkdm (struct clk_hw *hw);int omap2_clk_disable_autoidle_all (void ); +void omap2_clk_enable_init_clocks (const char **clk_names,u8 num_clocks);int omap3_dpll4_set_rate (struct clk_hw *clk,unsigned long rate,unsigned long parent_rate);int omap2_dflt_clk_enable (struct clk_hw *hw);
Signature · 1 line
1.7.9.5
PATCH v5 21/31 ARM: AM33xx: remove old clock data and link in new clock init code
In reply to Tero KristoAM33xx clocks have now been moved to DT, thus remove the old data file and use the new init code under OMAP clock driver.
--- arch/arm/mach-omap2/Makefile | 1 - arch/arm/mach-omap2/cclock33xx_data.c | 1059 --------------------------------- drivers/clk/ti/Makefile | 2 +- 3 files changed, 1 insertion(+), 1061 deletions(-) delete mode 100644 arch/arm/mach-omap2/cclock33xx_data.c
arch/arm/mach-omap2/Makefile +0 -1
@@ -178,7 +178,6 @@ obj-$(CONFIG_ARCH_OMAP3) += clkt_iclk.o obj-$(CONFIG_ARCH_OMAP4) += $(clock-common) obj-$(CONFIG_ARCH_OMAP4) += dpll3xxx.o dpll44xx.o obj-$(CONFIG_SOC_AM33XX) += $(clock-common) dpll3xxx.o -obj-$(CONFIG_SOC_AM33XX) += cclock33xx_data.o obj-$(CONFIG_SOC_OMAP5) += $(clock-common) obj-$(CONFIG_SOC_OMAP5) += dpll3xxx.o dpll44xx.o
arch/arm/mach-omap2/cclock33xx_data.c deleted +0 -1059
1,059 lines not on this page · raw message
drivers/clk/ti/Makefile +1 -1
@@ -1,5 +1,5 @@ ifneq ($(CONFIG_OF),) obj-y += clk.o dpll.o autoidle.o gate.o \ apll.o clk-44xx.o clk-54xx.o \ - clk-7xx.o + clk-7xx.o clk-33xx.o endif
Signature · 1 line
1.7.9.5
PATCH v5 22/31 CLK: TI: add interface clock support for OMAP3
In reply to Tero KristoOMAP3 has interface clocks in addition to functional clocks, which require special handling for the autoidle and idle status register offsets mainly.
--- .../devicetree/bindings/clock/ti/interface.txt | 45 +++++++++ arch/arm/mach-omap2/clock.h | 6 -- drivers/clk/ti/Makefile | 2 +- drivers/clk/ti/interface.c | 105 ++++++++++++++++++++ include/linux/clk/ti.h | 7 ++ 5 files changed, 158 insertions(+), 7 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/ti/interface.txt create mode 100644 drivers/clk/ti/interface.c
Documentation/devicetree/bindings/clock/ti/interface.txt new file +45 -0
@@ -0,0 +1,45 @@ +Binding for Texas Instruments interface clock. + +This binding uses the common clock binding[1]. This clock is +quite much similar to the basic gate-clock [2], however, +it supports a number of additional features, including +companion clock finding (match corresponding functional gate +clock) and hardware autoidle enable / disable. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt +[2] Documentation/devicetree/bindings/clock/gate-clock.txt + +Required properties: +- compatible : shall be "ti,interface-clock" +- #clock-cells : from common clock binding; shall be set to 0 +- clocks : link to phandle of parent clock +- reg : base address for the control register + +Optional properties: +- ti,enable-bit : bit shift for the bit enabling/disabling the clock + (default 0) +- ti,iclk-no-wait : flag for selecting non-waiting hw-ops +- ti,iclk-hsotgusb : flag for selecting hsotgusb hw-ops +- ti,iclk-dss : flag for selecting DSS interface clock hw-ops +- ti,iclk-ssi : flag for selecting SSI interface clock hw-ops +- ti,am35xx-clk : flag for selecting AM35xx interface clock hw-ops +- ti,clkdm-name : parent clockdomain name + +Examples: + aes1_ick: aes1_ick at 48004a14 { + #clock-cells = <0>; + compatible = "ti,interface-clock"; + clocks = <&security_l4_ick2>; + reg = <0x48004a14 0x4>; + ti,enable-bit = <3>; + }; + + cam_ick: cam_ick at 48004f10 { + #clock-cells = <0>; + compatible = "ti,interface-clock"; + clocks = <&l4_ick>; + reg = <0x48004f10 0x4>; + ti,clkdm-name = "cam_clkdm"; + ti,enable-bit = <0>; + ti,iclk-no-wait; + };
arch/arm/mach-omap2/clock.h +0 -6
@@ -285,14 +285,8 @@ extern const struct clksel_rate gfx_l3_rates[];extern const struct clksel_rate dsp_ick_rates[];extern struct clk dummy_ck; -extern const struct clk_hw_omap_ops clkhwops_iclk_wait; -extern const struct clk_hw_omap_ops clkhwops_iclk;extern const struct clk_hw_omap_ops clkhwops_omap3430es2_ssi_wait; -extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_ssi_wait; -extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_dss_usbhost_wait; -extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_hsotgusb_wait;extern const struct clk_hw_omap_ops clkhwops_omap3430es2_hsotgusb_wait; -extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_wait;extern const struct clk_hw_omap_ops clkhwops_apll54;extern const struct clk_hw_omap_ops clkhwops_apll96;extern const struct clk_hw_omap_ops clkhwops_omap2xxx_dpll;
drivers/clk/ti/Makefile +1 -1
@@ -1,5 +1,5 @@ ifneq ($(CONFIG_OF),) obj-y += clk.o dpll.o autoidle.o gate.o \ apll.o clk-44xx.o clk-54xx.o \ - clk-7xx.o clk-33xx.o + clk-7xx.o clk-33xx.o interface.o endif
drivers/clk/ti/interface.c new file +105 -0
105 lines not on this page · raw message
include/linux/clk/ti.h +7 -0
@@ -204,5 +204,12 @@ extern const struct clk_hw_omap_ops clkhwops_omap4_dpllmx;extern const struct clk_hw_omap_ops clkhwops_wait;extern const struct clk_hw_omap_ops clkhwops_omap3430es2_dss_usbhost_wait;extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_module_wait; +extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_wait; + +extern const struct clk_hw_omap_ops clkhwops_iclk_wait; +extern const struct clk_hw_omap_ops clkhwops_iclk; +extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_ssi_wait; +extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_dss_usbhost_wait; +extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_hsotgusb_wait;#endif
Signature · 1 line
1.7.9.5
PATCH v5 22/31 CLK: TI: add interface clock support for OMAP3
Quoted 24 lines · Tero Kristo
OMAP3 has interface clocks in addition to functional clocks, which require special handling for the autoidle and idle status register offsets mainly.
Signed-off-by Tero Kristo <[email protected]>--- .../devicetree/bindings/clock/ti/interface.txt | 45 +++++++++ arch/arm/mach-omap2/clock.h | 6 -- drivers/clk/ti/Makefile | 2 +- drivers/clk/ti/interface.c | 105 ++++++++++++++++++++ include/linux/clk/ti.h | 7 ++ 5 files changed, 158 insertions(+), 7 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/ti/interface.txt create mode 100644 drivers/clk/ti/interface.cDocumentation/devicetree/bindings/clock/ti/interface.txt new file +3
-0@@ -0,0 +1,45 @@ +Binding for Texas Instruments interface clock. + +This binding uses the common clock binding[1]. This clock is
Documentation/devicetree/bindings/clock/ti/interface.txt line 13
Quoted 10 lines
Documentation/devicetree/bindings/clock/ti/interface.txt new file +10
-0+quite much similar to the basic gate-clock [2], however, +it supports a number of additional features, including +companion clock finding (match corresponding functional gate +clock) and hardware autoidle enable / disable. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt +[2] Documentation/devicetree/bindings/clock/gate-clock.txt + +Required properties: +- compatible : shall be "ti,interface-clock"
It might make sense to be more specific: "ti,omap3-interface-clock".
Documentation/devicetree/bindings/clock/ti/interface.txt line 25
Quoted 12 lines
Documentation/devicetree/bindings/clock/ti/interface.txt new file +12
-0+- #clock-cells : from common clock binding; shall be set to 0 +- clocks : link to phandle of parent clock +- reg : base address for the control register + +Optional properties: +- ti,enable-bit : bit shift for the bit enabling/disabling the clock + (default 0) +- ti,iclk-no-wait : flag for selecting non-waiting hw-ops +- ti,iclk-hsotgusb : flag for selecting hsotgusb hw-ops +- ti,iclk-dss : flag for selecting DSS interface clock hw-ops +- ti,iclk-ssi : flag for selecting SSI interface clock hw-ops +- ti,am35xx-clk : flag for selecting AM35xx interface clock hw-ops
I think these should be selected based on the compatible string. They're mutually exclusive, and incompatible.
Thanks,
Mark.
PATCH v5 22/31 CLK: TI: add interface clock support for OMAP3
Quoted 29 lines · Mark Rutland
Quoted 28 lines · Tero Kristo
OMAP3 has interface clocks in addition to functional clocks, which require special handling for the autoidle and idle status register offsets mainly.
Signed-off-by Tero Kristo <[email protected]>--- .../devicetree/bindings/clock/ti/interface.txt | 45 +++++++++ arch/arm/mach-omap2/clock.h | 6 -- drivers/clk/ti/Makefile | 2 +- drivers/clk/ti/interface.c | 105 ++++++++++++++++++++ include/linux/clk/ti.h | 7 ++ 5 files changed, 158 insertions(+), 7 deletions(-)create mode 100644
Documentation/devicetree/bindings/clock/ti/interface.txtcreate mode 100644drivers/clk/ti/interface.cDocumentation/devicetree/bindings/clock/ti/interface.txt new file +7
-0@@ -0,0 +1,45 @@ +Binding for Texas Instruments interface clock. + +This binding uses the common clock binding[1]. This clock is +quite much similar to the basic gate-clock [2], however, +it supports a number of additional features, including +companion clock finding (match corresponding functional gate +clock) and hardware autoidle enable / disable.
Quoted 8 lines
Documentation/devicetree/bindings/clock/ti/interface.txt line 13
Quoted 6 lines
Documentation/devicetree/bindings/clock/ti/interface.txt new file +6
-0+ +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt +[2] Documentation/devicetree/bindings/clock/gate-clock.txt + +Required properties: +- compatible : shall be "ti,interface-clock"It might make sense to be more specific: "ti,omap3-interface-clock".
Ok.
Quoted 16 lines
Documentation/devicetree/bindings/clock/ti/interface.txt line 25
Quoted 13 lines
Documentation/devicetree/bindings/clock/ti/interface.txt new file +12
-0+- #clock-cells : from common clock binding; shall be set to 0 +- clocks : link to phandle of parent clock +- reg : base address for the control register + +Optional properties: +- ti,enable-bit : bit shift for the bit enabling/disabling the clock + (default 0) +- ti,iclk-no-wait : flag for selecting non-waiting hw-ops +- ti,iclk-hsotgusb : flag for selecting hsotgusb hw-ops +- ti,iclk-dss : flag for selecting DSS interface clock hw-ops +- ti,iclk-ssi : flag for selecting SSI interface clock hw-ops +- ti,am35xx-clk : flag for selecting AM35xx interface clock hw-opsI think these should be selected based on the compatible string. They're mutually exclusive, and incompatible.
Ok, I'll change this for next rev so that each has its own compatible string.
Thanks for your comments Mark.
-Tero
PATCH v5 23/31 ARM: OMAP: hwmod: fix an incorrect clk type cast with _get_clkdm
In reply to Tero KristoIf the main clock for a hwmod is of basic clock type, it is illegal to type cast this to clk_hw_omap and will result in bogus data. Fixed by checking the clock flags before attempting the type cast.
--- arch/arm/mach-omap2/omap_hwmod.c | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/mach-omap2/omap_hwmod.c +2 -0
@@ -656,6 +656,8 @@ static struct clockdomain *_get_clkdm(struct omap_hwmod *oh)if (oh->clkdm) {return oh->clkdm; }else if (oh->_clk) { +if (__clk_get_flags (oh->_clk) &CLK_IS_BASIC ) +return NULL ; clk =to_clk_hw_omap (__clk_get_hw (oh->_clk));return clk->clkdm; }
Signature · 1 line
1.7.9.5
PATCH v5 24/31 CLK: TI: gate: add support for OMAP36xx dpllx_mx_ck:s
In reply to Tero KristoOMAP3630 dpll3_m3_ck, dpll4_m2_ck, dpll4_m3_ck, dpll4_m4_ck, dpll4_m5_ck & dpll4_m6_ck dividers gets loaded with reset value after their respective PWRDN bits are set. Any dummy write (Any other value different from the Read value) to the corresponding CM_CLKSEL register will refresh the dividers.
--- .../devicetree/bindings/clock/ti/gate.txt | 1 + drivers/clk/ti/gate.c | 58 +++++++++++++++++++- 2 files changed, 58 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/clock/ti/gate.txt +1 -0
@@ -21,6 +21,7 @@ Optional properties: - ti,dss-clk : use DSS hardware OPS for the clock - ti,am35xx-clk : use AM35xx hardware OPS for the clock - ti,clkdm-name : clockdomain to control this gate +- ti,hsdiv-restore : restore parent clock HSDIV value with enable Examples: trace_clk_div_ck: trace_clk_div_ck {
drivers/clk/ti/gate.c +57 -1
80 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v5 25/31 ARM: OMAP3: hwmod: initialize clkdm from clkdm_name
In reply to Tero KristoDT clocks are mostly missing clkdm info now, and this causes an issue with counter32k which makes its slave idlemode wrong and prevents core idle.
Fixed by initializing the hwmod clkdm pointers for omap3 also which makes sure the clkdm flag matching logic works properly.
This patch also changes the return value for _init_clkdm to 0 for incorrect clkdm_name, as this a warning, not a fatal error.
--- arch/arm/mach-omap2/omap_hwmod.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-omap2/omap_hwmod.c +2 -1
@@ -1544,7 +1544,7 @@ static int _init_clkdm(struct omap_hwmod *oh)if (!oh->clkdm) {pr_warning ("omap_hwmod: %s: could not associate to clkdm %s\n" , oh->name, oh->clkdm_name); -return -EINVAL ; +return 0 ; } pr_debug("omap_hwmod: %s: associated to clkdm %s\n",
@@ -4115,6 +4115,7 @@ void __init omap_hwmod_init(void) soc_ops.assert_hardreset = _omap2_assert_hardreset; soc_ops.deassert_hardreset = _omap2_deassert_hardreset; soc_ops.is_hardreset_asserted = _omap2_is_hardreset_asserted; + soc_ops.init_clkdm = _init_clkdm; }else if (cpu_is_omap44xx () ||soc_is_omap54xx ()) { soc_ops.enable_module = _omap4_enable_module; soc_ops.disable_module = _omap4_disable_module;
Signature · 1 line
1.7.9.5
PATCH v5 26/31 ARM: dts: omap3 clock data
In reply to Tero KristoThis patch creates a unique node for each clock in the OMAP3 power, reset and clock manager (PRCM).
TODO: add still missing am35xx only clock nodes
--- arch/arm/boot/dts/omap3.dtsi | 7 + arch/arm/boot/dts/omap3430es1-clocks.dtsi | 170 +++ arch/arm/boot/dts/omap34xx-omap36xx-clocks.dtsi | 240 +++ arch/arm/boot/dts/omap34xx.dtsi | 9 + .../omap36xx-am35xx-omap3430es2plus-clocks.dtsi | 214 +++ arch/arm/boot/dts/omap36xx-clocks.dtsi | 91 ++ .../boot/dts/omap36xx-omap3430es2plus-clocks.dtsi | 185 +++ arch/arm/boot/dts/omap36xx.dtsi | 10 + arch/arm/boot/dts/omap3xxx-clocks.dtsi | 1589 ++++++++++++++++++++ 9 files changed, 2515 insertions(+) create mode 100644 arch/arm/boot/dts/omap3430es1-clocks.dtsi create mode 100644 arch/arm/boot/dts/omap34xx-omap36xx-clocks.dtsi create mode 100644 arch/arm/boot/dts/omap36xx-am35xx-omap3430es2plus-clocks.dtsi create mode 100644 arch/arm/boot/dts/omap36xx-clocks.dtsi create mode 100644 arch/arm/boot/dts/omap36xx-omap3430es2plus-clocks.dtsi create mode 100644 arch/arm/boot/dts/omap3xxx-clocks.dtsi
arch/arm/boot/dts/omap3.dtsi +7 -0
@@ -533,4 +533,11 @@ ram-bits = <12>; }; }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + /include/ "omap3xxx-clocks.dtsi" + }; };
arch/arm/boot/dts/omap3430es1-clocks.dtsi new file +170 -0
170 lines not on this page · raw message
arch/arm/boot/dts/omap34xx-omap36xx-clocks.dtsi new file +240 -0
240 lines not on this page · raw message
arch/arm/boot/dts/omap34xx.dtsi +9 -0
@@ -25,4 +25,13 @@ clock-latency = <300000>; /* From legacy driver */ }; }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + /include/ "omap34xx-omap36xx-clocks.dtsi" + /include/ "omap36xx-omap3430es2plus-clocks.dtsi" + /include/ "omap36xx-am35xx-omap3430es2plus-clocks.dtsi" + }; };
arch/arm/boot/dts/omap36xx-am35xx-omap3430es2plus-clocks.dtsi new file +214 -0
214 lines not on this page · raw message
arch/arm/boot/dts/omap36xx-clocks.dtsi new file +91 -0
91 lines not on this page · raw message
arch/arm/boot/dts/omap36xx-omap3430es2plus-clocks.dtsi new file +185 -0
185 lines not on this page · raw message
arch/arm/boot/dts/omap36xx.dtsi +10 -0
@@ -35,4 +35,14 @@ clock-frequency = <48000000>; }; }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + /include/ "omap36xx-clocks.dtsi" + /include/ "omap34xx-omap36xx-clocks.dtsi" + /include/ "omap36xx-omap3430es2plus-clocks.dtsi" + /include/ "omap36xx-am35xx-omap3430es2plus-clocks.dtsi" + }; };
arch/arm/boot/dts/omap3xxx-clocks.dtsi new file +1589 -0
1,589 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v5 27/31 CLK: TI: add omap3 clock init file
In reply to Tero Kristoclk-3xxx.c now contains the clock init functionality for omap3, including DT clock registration and adding of static clkdev entries.
--- arch/arm/mach-omap2/clock3xxx.h | 1 - drivers/clk/ti/Makefile | 3 +- drivers/clk/ti/clk-3xxx.c | 171 +++++++++++++++++++++++++++++++++++++++ include/linux/clk/ti.h | 1 + 4 files changed, 174 insertions(+), 2 deletions(-) create mode 100644 drivers/clk/ti/clk-3xxx.c
arch/arm/mach-omap2/clock3xxx.h +0 -1
@@ -11,7 +11,6 @@int omap3xxx_clk_init (void );int omap3_core_dpll_m2_set_rate (struct clk_hw *clk,unsigned long rate,unsigned long parent_rate); -void omap3_clk_lock_dpll5 (void );extern struct clk *sdrc_ick_p;extern struct clk *arm_fck_p;
drivers/clk/ti/Makefile +2 -1
@@ -1,5 +1,6 @@ ifneq ($(CONFIG_OF),) obj-y += clk.o dpll.o autoidle.o gate.o \ apll.o clk-44xx.o clk-54xx.o \ - clk-7xx.o clk-33xx.o interface.o + clk-7xx.o clk-33xx.o interface.o \ + clk-3xxx.o endif
drivers/clk/ti/clk-3xxx.c new file +171 -0
171 lines not on this page · raw message
include/linux/clk/ti.h +1 -0
@@ -187,6 +187,7 @@ int omap3_dpll4_set_rate(struct clk_hw *clk, unsigned long rate,int omap2_dflt_clk_enable (struct clk_hw *hw);void omap2_dflt_clk_disable (struct clk_hw *hw);int omap2_dflt_clk_is_enabled (struct clk_hw *hw); +void omap3_clk_lock_dpll5 (void );void omap_dt_clocks_register (struct omap_dt_clk *oclks);#ifdef CONFIG_OF
Signature · 1 line
1.7.9.5
PATCH v5 28/31 ARM: dts: AM35xx clock data
In reply to Tero KristoThis patch creates a unique node for each AM35xx specific clock in the AM35xx power, reset and clock manager (PRCM). Most of the AM35xx clock data is shared with OMAP3xxx, this patch only creates the delta.
--- arch/arm/boot/dts/am35xx-clocks.dtsi | 113 ++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 arch/arm/boot/dts/am35xx-clocks.dtsi
arch/arm/boot/dts/am35xx-clocks.dtsi new file +113 -0
@@ -0,0 +1,113 @@ +/* + * Device Tree Source for AM35xx clock data + * + * Copyright (C) 2013 Texas Instruments, Inc. + * + * 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. + */ + +ipss_ick: ipss_ick at 48004a10 { + #clock-cells = <0>; + compatible = "ti,interface-clock"; + clocks = <&core_l3_ick>; + reg = <0x48004a10 0x4>; + ti,clkdm-name = "core_l3_clkdm"; + ti,enable-bit = <4>; + ti,am35xx-clk; +}; + +rmii_ck: rmii_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <50000000>; +}; + +pclk_ck: pclk_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <27000000>; +}; + +emac_ick: emac_ick at 4800259c { + #clock-cells = <0>; + compatible = "ti,gate-clock"; + clocks = <&ipss_ick>; + reg = <0x4800259c 0x4>; + ti,clkdm-name = "core_l3_clkdm"; + ti,enable-bit = <1>; + ti,am35xx-clk; +}; + +emac_fck: emac_fck at 4800259c { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&rmii_ck>; + reg = <0x4800259c 0x4>; + bit-shift = <9>; +}; + +vpfe_ick: vpfe_ick at 4800259c { + #clock-cells = <0>; + compatible = "ti,gate-clock"; + clocks = <&ipss_ick>; + reg = <0x4800259c 0x4>; + ti,clkdm-name = "core_l3_clkdm"; + ti,enable-bit = <2>; + ti,am35xx-clk; +}; + +vpfe_fck: vpfe_fck at 4800259c { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&pclk_ck>; + reg = <0x4800259c 0x4>; + bit-shift = <10>; +}; + +hsotgusb_ick_am35xx: hsotgusb_ick_am35xx at 4800259c { + #clock-cells = <0>; + compatible = "ti,gate-clock"; + clocks = <&ipss_ick>; + reg = <0x4800259c 0x4>; + ti,clkdm-name = "core_l3_clkdm"; + ti,enable-bit = <0>; + ti,am35xx-clk; +}; + +hsotgusb_fck_am35xx: hsotgusb_fck_am35xx at 4800259c { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&sys_ck>; + reg = <0x4800259c 0x4>; + bit-shift = <8>; +}; + +hecc_ck: hecc_ck at 4800259c { + #clock-cells = <0>; + compatible = "ti,gate-clock"; + clocks = <&sys_ck>; + reg = <0x4800259c 0x4>; + ti,clkdm-name = "core_l3_clkdm"; + ti,enable-bit = <3>; + ti,am35xx-clk; +}; + +uart4_ick_am35xx: uart4_ick_am35xx at 48004a10 { + #clock-cells = <0>; + compatible = "ti,interface-clock"; + clocks = <&core_l4_ick>; + reg = <0x48004a10 0x4>; + ti,clkdm-name = "core_l4_clkdm"; + ti,enable-bit = <23>; +}; + +uart4_fck_am35xx: uart4_fck_am35xx at 48004a00 { + #clock-cells = <0>; + compatible = "ti,gate-clock"; + clocks = <&core_48m_fck>; + reg = <0x48004a00 0x4>; + ti,clkdm-name = "core_l4_clkdm"; + ti,enable-bit = <23>; +};
Signature · 1 line
1.7.9.5
PATCH v5 29/31 ARM: dts: AM35xx: use DT clock data
In reply to Tero KristoAM35xx now uses the clock data from device tree. Most of the data is shared with OMAP3xxx, but as there is some delta, a new base .dtsi file is also created for the SoC.
--- arch/arm/boot/dts/am3517-evm.dts | 2 +- arch/arm/boot/dts/am3517.dtsi | 36 +++++++++++++++++++++++++++++++ arch/arm/boot/dts/am3517_mt_ventoux.dts | 2 +- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 arch/arm/boot/dts/am3517.dtsi
arch/arm/boot/dts/am3517-evm.dts +1 -1
@@ -7,7 +7,7 @@ */ /dts-v1/; -#include "omap34xx.dtsi" +#include "am3517.dtsi" / { model = "TI AM3517 EVM (AM3517/05)";
arch/arm/boot/dts/am3517.dtsi new file +36 -0
@@ -0,0 +1,36 @@ +/* + * Device Tree Source for AM3517 SoC + * + * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +#include "omap3.dtsi" + +/ { + cpus { + cpu at 0 { + /* OMAP343x/OMAP35xx variants OPP1-5 */ + operating-points = < + /* kHz uV */ + 125000 975000 + 250000 1075000 + 500000 1200000 + 550000 1270000 + 600000 1350000 + >; + clock-latency = <300000>; /* From legacy driver */ + }; + }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + /include/ "am35xx-clocks.dtsi" + /include/ "omap36xx-am35xx-omap3430es2plus-clocks.dtsi" + }; +};
arch/arm/boot/dts/am3517_mt_ventoux.dts +1 -1
@@ -7,7 +7,7 @@ */ /dts-v1/; -#include "omap34xx.dtsi" +#include "am3517.dtsi" / { model = "TeeJet Mt.Ventoux";
Signature · 1 line
1.7.9.5
PATCH v5 30/31 ARM: OMAP3: use DT clock init if DT data is available
In reply to Tero KristoOMAP3 platforms support both DT and non-DT boot at the moment, make the clock init work according to the used setup.
--- arch/arm/mach-omap2/clock3xxx.h | 4 ++++ arch/arm/mach-omap2/io.c | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-)
arch/arm/mach-omap2/clock3xxx.h +4 -0
@@ -9,6 +9,10 @@#define __ARCH_ARM_MACH_OMAP2_CLOCK3XXX_Hint omap3xxx_clk_init (void ); +int omap3430_clk_init (void ); +int omap3630_clk_init (void ); +int ti81xx_clk_init (void ); +int am35xx_clk_init (void );int omap3_core_dpll_m2_set_rate (struct clk_hw *clk,unsigned long rate,unsigned long parent_rate);
arch/arm/mach-omap2/io.c +12 -1
@@ -488,21 +488,29 @@ void __init omap3_init_early(void)void __init omap3430_init_early (void ) {omap3_init_early (); +if (of_have_populated_dt ()) + omap_clk_init = omap3430_clk_init; }void __init omap35xx_init_early (void ) {omap3_init_early (); +if (of_have_populated_dt ()) + omap_clk_init = omap3430_clk_init; }void __init omap3630_init_early (void ) {omap3_init_early (); +if (of_have_populated_dt ()) + omap_clk_init = omap3630_clk_init; }void __init am35xx_init_early (void ) {omap3_init_early (); +if (of_have_populated_dt ()) + omap_clk_init = am35xx_clk_init; }void __init ti81xx_init_early (void )
@@ -520,7 +528,10 @@ void __init ti81xx_init_early(void)omap3xxx_clockdomains_init ();omap3xxx_hwmod_init ();omap_hwmod_init_postsetup (); - omap_clk_init = omap3xxx_clk_init; +if (of_have_populated_dt ()) + omap_clk_init = ti81xx_clk_init; +else + omap_clk_init = omap3xxx_clk_init; }void __init omap3_init_late (void )
Signature · 1 line
1.7.9.5
PATCH v5 31/31 ARM: dts: am43xx clock data
In reply to Tero KristoThis patch creates a unique node for each clock in the AM43xx power, reset and clock manager (PRCM).
--- arch/arm/boot/dts/am43xx-clocks.dtsi | 671 ++++++++++++++++++++++++++++++++++ 1 file changed, 671 insertions(+) create mode 100644 arch/arm/boot/dts/am43xx-clocks.dtsi
arch/arm/boot/dts/am43xx-clocks.dtsi new file +671 -0
@@ -0,0 +1,671 @@ +/* + * Device Tree Source for AM43xx clock data + * + * Copyright (C) 2013 Texas Instruments, Inc. + * + * 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. + */ + +clk_32768_ck: clk_32768_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <32768>; +}; + +clk_rc32k_ck: clk_rc32k_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <32768>; +}; + +virt_19200000_ck: virt_19200000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <19200000>; +}; + +virt_24000000_ck: virt_24000000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <24000000>; +}; + +virt_25000000_ck: virt_25000000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <25000000>; +}; + +virt_26000000_ck: virt_26000000_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <26000000>; +}; + +sys_clkin_ck: sys_clkin_ck at 44e10040 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&virt_19200000_ck>, <&virt_24000000_ck>, <&virt_25000000_ck>, <&virt_26000000_ck>; + bit-shift = <22>; + reg = <0x44e10040 0x4>; + bit-mask = <0x3>; +}; + +tclkin_ck: tclkin_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <26000000>; +}; + +dpll_core_ck: dpll_core_ck at 44df2d20 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-core-lock"; + clocks = <&sys_clkin_ck>; + reg = <0x44df2d20 0x4>, <0x44df2d24 0x4>, <0x0 0x4>, <0x44df2d2c 0x4>; + ti,clk-ref = <&sys_clkin_ck>; + ti,clk-bypass = <&sys_clkin_ck>; +}; + +dpll_core_x2_ck: dpll_core_x2_ck { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-x2-clock"; + clocks = <&dpll_core_ck>; +}; + +dpll_core_m4_ck: dpll_core_m4_ck at 44df2d38 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_core_x2_ck>; + ti,autoidle-shift = <8>; + reg = <0x44df2d38 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dpll_core_m5_ck: dpll_core_m5_ck at 44df2d3c { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_core_x2_ck>; + ti,autoidle-shift = <8>; + reg = <0x44df2d3c 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dpll_core_m6_ck: dpll_core_m6_ck at 44df2d40 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_core_x2_ck>; + ti,autoidle-shift = <8>; + reg = <0x44df2d40 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dpll_mpu_ck: dpll_mpu_ck at 44df2d60 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-clock"; + clocks = <&sys_clkin_ck>; + reg = <0x44df2d60 0x4>, <0x44df2d64 0x4>, <0x0 0x4>, <0x44df2d6c 0x4>; + ti,clk-ref = <&sys_clkin_ck>; + ti,clk-bypass = <&sys_clkin_ck>; +}; + +dpll_mpu_m2_ck: dpll_mpu_m2_ck at 44df2d70 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_mpu_ck>; + ti,autoidle-shift = <8>; + reg = <0x44df2d70 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dpll_ddr_ck: dpll_ddr_ck at 44df2da0 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-clock"; + clocks = <&sys_clkin_ck>; + reg = <0x44df2da0 0x4>, <0x44df2da4 0x4>, <0x0 0x4>, <0x44df2dac 0x4>; + ti,clk-ref = <&sys_clkin_ck>; + ti,clk-bypass = <&sys_clkin_ck>; +}; + +dpll_ddr_m2_ck: dpll_ddr_m2_ck at 44df2db0 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_ddr_ck>; + ti,autoidle-shift = <8>; + reg = <0x44df2db0 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dpll_disp_ck: dpll_disp_ck at 44df2e20 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-clock"; + clocks = <&sys_clkin_ck>; + reg = <0x44df2e20 0x4>, <0x44df2e24 0x4>, <0x0 0x4>, <0x44df2e2c 0x4>; + ti,clk-ref = <&sys_clkin_ck>; + ti,clk-bypass = <&sys_clkin_ck>; +}; + +dpll_disp_m2_ck: dpll_disp_m2_ck at 44df2e30 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_disp_ck>; + ti,autoidle-shift = <8>; + reg = <0x44df2e30 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dpll_per_ck: dpll_per_ck at 44df2de0 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-j-type-clock"; + clocks = <&sys_clkin_ck>; + reg = <0x44df2de0 0x4>, <0x44df2de4 0x4>, <0x0 0x4>, <0x44df2dec 0x4>; + ti,clk-ref = <&sys_clkin_ck>; + ti,clk-bypass = <&sys_clkin_ck>; +}; + +dpll_per_m2_ck: dpll_per_m2_ck at 44df2df0 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_per_ck>; + ti,autoidle-shift = <8>; + reg = <0x44df2df0 0x4>; + bit-mask = <0x7f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dpll_per_m2_div4_wkupdm_ck: dpll_per_m2_div4_wkupdm_ck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_per_m2_ck>; + clock-mult = <1>; + clock-div = <4>; +}; + +dpll_per_m2_div4_ck: dpll_per_m2_div4_ck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_per_m2_ck>; + clock-mult = <1>; + clock-div = <4>; +}; + +adc_tsc_fck: adc_tsc_fck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&sys_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +clk_24mhz: clk_24mhz { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_per_m2_ck>; + clock-mult = <1>; + clock-div = <8>; +}; + +clkdiv32k_ck: clkdiv32k_ck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&clk_24mhz>; + clock-mult = <1>; + clock-div = <732>; +}; + +clkdiv32k_ick: clkdiv32k_ick at 44df2a38 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&clkdiv32k_ck>; + bit-shift = <8>; + reg = <0x44df2a38 0x4>; +}; + +dcan0_fck: dcan0_fck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&sys_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +dcan1_fck: dcan1_fck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&sys_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +sysclk_div: sysclk_div { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_core_m4_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +pruss_ocp_gclk: pruss_ocp_gclk at 44df4248 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&sysclk_div>, <&dpll_disp_m2_ck>; + reg = <0x44df4248 0x4>; + bit-mask = <0x1>; +}; + +mcasp0_fck: mcasp0_fck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&sys_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +mcasp1_fck: mcasp1_fck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&sys_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +smartreflex0_fck: smartreflex0_fck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&sys_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +smartreflex1_fck: smartreflex1_fck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&sys_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +sha0_fck: sha0_fck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&sys_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +aes0_fck: aes0_fck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&sys_clkin_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +clk_32k_tpm_ck: clk_32k_tpm_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <32768>; +}; + +timer1_fck: timer1_fck at 44df4200 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&sys_clkin_ck>, <&clkdiv32k_ick>, <&tclkin_ck>, <&clk_rc32k_ck>, <&clk_32768_ck>, <&clk_32k_tpm_ck>; + reg = <0x44df4200 0x4>; + bit-mask = <0x7>; +}; + +timer2_fck: timer2_fck at 44df4204 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>; + reg = <0x44df4204 0x4>; + bit-mask = <0x3>; +}; + +timer3_fck: timer3_fck at 44df4208 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>; + reg = <0x44df4208 0x4>; + bit-mask = <0x3>; +}; + +timer4_fck: timer4_fck at 44df420c { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>; + reg = <0x44df420c 0x4>; + bit-mask = <0x3>; +}; + +timer5_fck: timer5_fck at 44df4210 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>; + reg = <0x44df4210 0x4>; + bit-mask = <0x3>; +}; + +timer6_fck: timer6_fck at 44df4214 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>; + reg = <0x44df4214 0x4>; + bit-mask = <0x3>; +}; + +timer7_fck: timer7_fck at 44df4218 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>; + reg = <0x44df4218 0x4>; + bit-mask = <0x3>; +}; + +wdt1_fck: wdt1_fck at 44df422c { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&clk_rc32k_ck>, <&clkdiv32k_ick>; + reg = <0x44df422c 0x4>; + bit-mask = <0x1>; +}; + +l3_gclk: l3_gclk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_core_m4_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +dpll_core_m4_div2_ck: dpll_core_m4_div2_ck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&sysclk_div>; + clock-mult = <1>; + clock-div = <2>; +}; + +l4hs_gclk: l4hs_gclk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_core_m4_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +l3s_gclk: l3s_gclk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_core_m4_div2_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +l4ls_gclk: l4ls_gclk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_core_m4_div2_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +cpsw_125mhz_gclk: cpsw_125mhz_gclk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_core_m5_ck>; + clock-mult = <1>; + clock-div = <2>; +}; + +cpsw_cpts_rft_clk: cpsw_cpts_rft_clk at 44df4238 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&sysclk_div>, <&dpll_core_m5_ck>, <&dpll_disp_m2_ck>; + reg = <0x44df4238 0x4>; + bit-mask = <0x3>; +}; + +clk_32k_mosc_ck: clk_32k_mosc_ck { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <32768>; +}; + +gpio0_dbclk_mux_ck: gpio0_dbclk_mux_ck at 44df4240 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&clk_rc32k_ck>, <&clk_32768_ck>, <&clkdiv32k_ick>, <&clk_32k_mosc_ck>, <&clk_32k_tpm_ck>; + reg = <0x44df4240 0x4>; + bit-mask = <0x7>; +}; + +gpio0_dbclk: gpio0_dbclk at 44df2b68 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&gpio0_dbclk_mux_ck>; + bit-shift = <8>; + reg = <0x44df2b68 0x4>; +}; + +gpio1_dbclk: gpio1_dbclk at 44df8c78 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&clkdiv32k_ick>; + bit-shift = <8>; + reg = <0x44df8c78 0x4>; +}; + +gpio2_dbclk: gpio2_dbclk at 44df8c80 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&clkdiv32k_ick>; + bit-shift = <8>; + reg = <0x44df8c80 0x4>; +}; + +gpio3_dbclk: gpio3_dbclk at 44df8c88 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&clkdiv32k_ick>; + bit-shift = <8>; + reg = <0x44df8c88 0x4>; +}; + +mmc_clk: mmc_clk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_per_m2_ck>; + clock-mult = <1>; + clock-div = <2>; +}; + +gfx_fclk_clksel_ck: gfx_fclk_clksel_ck at 44df423c { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&sysclk_div>, <&dpll_per_m2_ck>; + bit-shift = <1>; + reg = <0x44df423c 0x4>; + bit-mask = <0x1>; +}; + +gfx_fck_div_ck: gfx_fck_div_ck at 44df423c { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&gfx_fclk_clksel_ck>; + reg = <0x44df423c 0x4>; + bit-mask = <0x1>; +}; + +disp_clk: disp_clk at 44df4244 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&dpll_disp_m2_ck>, <&dpll_core_m5_ck>, <&dpll_per_m2_ck>; + reg = <0x44df4244 0x4>; + bit-mask = <0x3>; +}; + +dpll_extdev_ck: dpll_extdev_ck at 44df2e60 { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-clock"; + clocks = <&sys_clkin_ck>; + reg = <0x44df2e60 0x4>, <0x44df2e64 0x4>, <0x0 0x4>, <0x44df2e6c 0x4>; + ti,clk-ref = <&sys_clkin_ck>; + ti,clk-bypass = <&sys_clkin_ck>; +}; + +dpll_extdev_m2_ck: dpll_extdev_m2_ck at 44df2e70 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_extdev_ck>; + ti,autoidle-shift = <8>; + reg = <0x44df2e70 0x4>; + bit-mask = <0x7f>; + index-starts-at-one; + ti,autoidle-low; +}; + +mux_synctimer32k_ck: mux_synctimer32k_ck at 44df4230 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&clk_32768_ck>, <&clk_32k_tpm_ck>, <&clkdiv32k_ick>; + reg = <0x44df4230 0x4>; + bit-mask = <0x3>; +}; + +synctimer_32kclk: synctimer_32kclk at 44df2a30 { + #clock-cells = <0>; + compatible = "gate-clock"; + clocks = <&mux_synctimer32k_ck>; + bit-shift = <8>; + reg = <0x44df2a30 0x4>; +}; + +timer8_fck: timer8_fck at 44df421c { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>, <&clk_32k_tpm_ck>; + reg = <0x44df421c 0x4>; + bit-mask = <0x3>; +}; + +timer9_fck: timer9_fck at 44df4220 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>, <&clk_32k_tpm_ck>; + reg = <0x44df4220 0x4>; + bit-mask = <0x3>; +}; + +timer10_fck: timer10_fck at 44df4224 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>, <&clk_32k_tpm_ck>; + reg = <0x44df4224 0x4>; + bit-mask = <0x3>; +}; + +timer11_fck: timer11_fck at 44df4228 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clkdiv32k_ick>, <&clk_32k_tpm_ck>; + reg = <0x44df4228 0x4>; + bit-mask = <0x3>; +}; + +cpsw_50m_clkdiv: cpsw_50m_clkdiv { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_core_m5_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +cpsw_5m_clkdiv: cpsw_5m_clkdiv { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&cpsw_50m_clkdiv>; + clock-mult = <1>; + clock-div = <10>; +}; + +dpll_ddr_x2_ck: dpll_ddr_x2_ck { + #clock-cells = <0>; + compatible = "ti,omap4-dpll-x2-clock"; + clocks = <&dpll_ddr_ck>; +}; + +dpll_ddr_m4_ck: dpll_ddr_m4_ck at 44df2db8 { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&dpll_ddr_x2_ck>; + ti,autoidle-shift = <8>; + reg = <0x44df2db8 0x4>; + bit-mask = <0x1f>; + index-starts-at-one; + ti,autoidle-low; +}; + +dpll_per_clkdcoldo: dpll_per_clkdcoldo { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_per_ck>; + clock-mult = <1>; + clock-div = <1>; +}; + +dll_aging_clk_div: dll_aging_clk_div at 44df4250 { + #clock-cells = <0>; + compatible = "divider-clock"; + clocks = <&sys_clkin_ck>; + reg = <0x44df4250 0x4>; + table = < 8 0 >, < 16 1 >, < 32 2 >; + bit-mask = <0x3>; +}; + +div_core_25m_ck: div_core_25m_ck { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&sysclk_div>; + clock-mult = <1>; + clock-div = <8>; +}; + +func_12m_clk: func_12m_clk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&dpll_per_m2_ck>; + clock-mult = <1>; + clock-div = <16>; +}; + +vtp_clk_div: vtp_clk_div { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clocks = <&sys_clkin_ck>; + clock-mult = <1>; + clock-div = <2>; +}; + +usbphy_32khz_clkmux: usbphy_32khz_clkmux at 44df4260 { + #clock-cells = <0>; + compatible = "mux-clock"; + clocks = <&clk_32768_ck>, <&clk_32k_tpm_ck>; + reg = <0x44df4260 0x4>; + bit-mask = <0x1>; +};
Signature · 1 line
1.7.9.5