Skip to contentSkip to conversation

clk: exynos4/5: migrate to common clock framework

PATCH New Thomas Abraham 8 participants 37 messages Feb 18, 2013 – Mar 25, 2013

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

v6 cover clk: exynos4/5: migrate to common clock framework

Changes since v5:
- Squashed several Exynos4 fixes patch from Tomasz Figa
- Included support for Exynos5250 and Exynos5440, thus converting all Exynos4 and Exynos5 platforms to common clock framework.
- Depends on the following patch series.
- http://www.mail-archive.com/linux-samsung-soc at vger.kernel.org/msg15849.html
- http://www.mail-archive.com/linux-samsung-soc at vger.kernel.org/msg15852.html

Changes since v4:
- Rebased to linux-3.8-rc1.

Changes since v3:
- Includes changes suggested by Tomasz Figa <[email protected]>

This patch series migrates the Samsung Exynos4/5 SoC clock code to adopt the common clock framework. The use of Samsung specific clock structures has been removed and all board support code has been updated. imx-style of clock registration and lookup has been adopted for device tree based exynos4/5 platforms.

#1 lore raw

PATCH v6 1/16 clk: samsung: add common clock framework helper functions for Samsung platforms

All Samsung platforms include different types of clock including fixed-rate, mux, divider and gate clock types. There are typically hundreds of such clocks on each of the Samsung platforms. To enable Samsung platforms to register these clocks using the common clock framework, a bunch of utility functions are introduced here which simplify the clock registration process. The clocks are usually statically instantiated and registered with common clock framework.

---
 drivers/clk/Makefile         |    1 +
 drivers/clk/samsung/Makefile |    5 +
 drivers/clk/samsung/clk.c    |  273 ++++++++++++++++++++++++++++++++++++++++++
 drivers/clk/samsung/clk.h    |  262 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 541 insertions(+), 0 deletions(-)
 create mode 100644 drivers/clk/samsung/Makefile
 create mode 100644 drivers/clk/samsung/clk.c
 create mode 100644 drivers/clk/samsung/clk.h
drivers/clk/Makefile +1 -0
index 0ad642f..1467a48 100644
@@ -26,6 +26,7 @@ obj-$(CONFIG_MACH_LOONGSON1)	+= clk-ls1x.o
 obj-$(CONFIG_ARCH_U8500)	+= ux500/
 obj-$(CONFIG_ARCH_VT8500)	+= clk-vt8500.o
 obj-$(CONFIG_ARCH_ZYNQ)		+= clk-zynq.o
+obj-$(CONFIG_PLAT_SAMSUNG)	+= samsung/
 
 # Chip specific
 obj-$(CONFIG_COMMON_CLK_WM831X) += clk-wm831x.o
drivers/clk/samsung/Makefile new file +5 -0
new file mode 100644
index 0000000..bd920b4
@@ -0,0 +1,5 @@
+#
+# Samsung Clock specific Makefile
+#
+
+obj-$(CONFIG_COMMON_CLK)	+= clk.o
drivers/clk/samsung/clk.c new file +273 -0

273 lines not on this page · raw message

drivers/clk/samsung/clk.h new file +262 -0

262 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#2 lore raw

PATCH v6 1/16 clk: samsung: add common clock framework helper functions for Samsung platforms

Hi,

Am Montag, 18. Februar 2013, 09:21:11 schrieb Thomas Abraham:

Quoted 8 lines

All Samsung platforms include different types of clock including fixed-rate, mux, divider and gate clock types. There are typically hundreds of such clocks on each of the Samsung platforms. To enable Samsung platforms to register these clocks using the common clock framework, a bunch of utility functions are introduced here which simplify the clock registration process. The clocks are usually statically instantiated and registered with common clock framework.

Quoted 7 lines

I'm playing around with this on my s3c2416 platform and it works like a charm for the most part - and the system already comes sort of up again :-) .

So,

But is there an easy way to define more than one alias? On the s3c2416 for example the hsmmc hclk is the "hsmmc" io-clock, as well as the source for the "mmc_busclk.0". Same for the "uart" pclk, that is also a baud clock source.

Thanks
Heiko

#3 lore raw

PATCH v6 1/16 clk: samsung: add common clock framework helper functions for Samsung platforms

Hi,

Quoted 3 lines · Heiko St?bner

But is there an easy way to define more than one alias? On the s3c2416 for example the hsmmc hclk is the "hsmmc" io-clock, as well as the source for the "mmc_busclk.0". Same for the "uart" pclk, that is also a baud clock source.

This driver currently provides for only one additional clkdev lookup entry per a platform clock. I pointed out this desing issue in the early version of the patch set. It's because a machine clock definition is coupled with a clock consumer definition. And IMO various samsung_clock_register_* functions should not have clk_register_clkdev() inside them. I.e. first step could be registering all machine clocks and in the second one clkdev lookup entries could be created. This is how most (all?) existing SoC clock drivers are working.

But those multiple aliases are important only for machines with device tree support, aren't they ?

I hope this patch series gets merged early to linux-next in the 3.10 cycle so the multiple accumulated fixup patches for this clock driver can be merged as well and issues like that you pointed out can be resolved with incremental patches.

Regards,
Sylwester

#4 lore raw

PATCH v6 1/16 clk: samsung: add common clock framework helper functions for Samsung platforms

Hi,

Quoted 17 lines · On Sunday 03 of March 2013 12:17:29 Sylwester Nawrocki wrote:

Hi,

Quoted 4 lines · Heiko St?bner

But is there an easy way to define more than one alias? On the s3c2416 for example the hsmmc hclk is the "hsmmc" io-clock, as well as the source for the "mmc_busclk.0". Same for the "uart" pclk, that is also a baud clock source.

This driver currently provides for only one additional clkdev lookup entry per a platform clock. I pointed out this desing issue in the early version of the patch set. It's because a machine clock definition is coupled with a clock consumer definition. And IMO various samsung_clock_register_* functions should not have clk_register_clkdev() inside them. I.e. first step could be registering all machine clocks and in the second one clkdev lookup entries could be created. This is how most (all?) existing SoC clock drivers are working.

Quoted 2 lines

But those multiple aliases are important only for machines with device tree support, aren't they ?

I suppose you meant _without_ device tree support, right?

Quoted 4 lines

I hope this patch series gets merged early to linux-next in the 3.10 cycle so the multiple accumulated fixup patches for this clock driver can be merged as well and issues like that you pointed out can be resolved with incremental patches.

Yes, I hope so too.

Best regards,
Tomasz

#5 lore raw

PATCH v6 1/16 clk: samsung: add common clock framework helper functions for Samsung platforms

Am Sonntag, 3. M?rz 2013, 12:45:01 schrieb Tomasz Figa:

Quoted 21 lines

Hi,

Quoted 18 lines · On Sunday 03 of March 2013 12:17:29 Sylwester Nawrocki wrote:

Hi,

Quoted 4 lines · Heiko St?bner

But is there an easy way to define more than one alias? On the s3c2416 for example the hsmmc hclk is the "hsmmc" io-clock, as well as the source for the "mmc_busclk.0". Same for the "uart" pclk, that is also a baud clock source.

This driver currently provides for only one additional clkdev lookup entry per a platform clock. I pointed out this desing issue in the early version of the patch set. It's because a machine clock definition is coupled with a clock consumer definition. And IMO various samsung_clock_register_* functions should not have clk_register_clkdev() inside them. I.e. first step could be registering all machine clocks and in the second one clkdev lookup entries could be created. This is how most (all?) existing SoC clock drivers are working.

Quoted 4 lines
Quoted 2 lines

But those multiple aliases are important only for machines with device tree support, aren't they ?

I suppose you meant _without_ device tree support, right?

The aliases are only needed for the non-dt case. But as I think common clk support will be a requirement for dt support in the future, similar to pinctrl, without the correct handling of the aliases it will be hard to incrementally convert the other platforms (i.e. s3c24xx before s3c2443, etc).

For the time being I've added my own register_alias function to Thomas' core code, hijacking the clk_table for this - attached for reference below.

Quoted 6 lines
Quoted 4 lines

I hope this patch series gets merged early to linux-next in the 3.10 cycle so the multiple accumulated fixup patches for this clock driver can be merged as well and issues like that you pointed out can be resolved with incremental patches.

Yes, I hope so too.

me too. Following all this still out-of-tree stuff makes me dizzy :-)

Heiko

drivers/clk/samsung/clk.c +44 -3
index d36cdd5..7f1b5bc 100644
@@ -57,14 +57,15 @@ void __init samsung_clk_init(struct device_node *np, void __iomem *base,
 		unsigned long nr_rdump)
 {
 	reg_base = base;
-	if (!np)
-		return;
 
-#ifdef CONFIG_OF
 	clk_table = kzalloc(sizeof(struct clk *) * nr_clks, GFP_KERNEL);
 	if (!clk_table)
 		panic("could not allocate clock lookup table\n");
 
+	if (!np)
+		return;
+
+#ifdef CONFIG_OF
 	clk_data.clks = clk_table;
 	clk_data.clk_num = nr_clks;
 	of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
@@ -96,6 +97,46 @@ void samsung_clk_add_lookup(struct clk *clk, unsigned int id)
 		clk_table[id] = clk;
 }
 
+/* register a list of aliases */
+void __init samsung_clk_register_alias(struct samsung_clock_alias *list,
+					unsigned int nr_clk)
+{
+	struct clk *clk;
+	unsigned int idx, ret;
+
+	if (!clk_table) {
+		pr_err("%s: clock table missing\n", __func__);
+		return;
+	}
+
+	for (idx = 0; idx < nr_clk; idx++, list++) {
+		if (!list->id) {
+			pr_err("%s: clock id missing for index %d\n", __func__,
+				idx);
+			continue;
+		}
+
+		clk = clk_table[list->id];
+		if (!clk) {
+			pr_err("%s: failed to find clock %d\n", __func__,
+				list->id);
+			continue;
+		}
+
+		/* register a clock lookup only if a clock alias is specified */
+		if (!list->alias) {
+			pr_err("%s: no alias defined for clock %d\n", __func__,
+			       list->id);
+			continue;
+		}
+
+		ret = clk_register_clkdev(clk, list->alias, list->dev_name);
+		if (ret)
+			pr_err("%s: failed to register lookup %s\n",
+					__func__, list->alias);
+	}
+}
+
 /* register a list of fixed clocks */
 void __init samsung_clk_register_fixed_rate(
 		struct samsung_fixed_rate_clock *list, unsigned int nr_clk)
drivers/clk/samsung/clk.h +21 -0
index 175a9d0..8be9248 100644
@@ -23,6 +23,25 @@
 #include <mach/map.h>
 
 /**
+ * struct samsung_clock_alias: information about mux clock
+ * @id: platform specific id of the clock.
+ * @dev_name: name of the device to which this clock belongs.
+ * @alias: optional clock alias name to be assigned to this clock.
+ */
+struct samsung_clock_alias {
+	unsigned int		id;
+	const char		*dev_name;
+	const char		*alias;
+};
+
+#define ALIAS(_id, dname, a)	\
+	{							\
+		.id		= _id,				\
+		.dev_name	= dname,			\
+		.alias		= a,				\
+	}
+
+/**
  * struct samsung_fixed_rate_clock: information about fixed-rate clock
  * @id: platform specific id of the clock.
  * @name: name of this fixed-rate clock.
@@ -260,6 +282,8 @@ extern void __init samsung_clk_of_register_fixed_ext(
 
 extern void samsung_clk_add_lookup(struct clk *clk, unsigned int id);
 
+extern void samsung_clk_register_alias(struct samsung_clock_alias *list,
+		unsigned int nr_clk);
 extern void __init samsung_clk_register_fixed_rate(
 		struct samsung_fixed_rate_clock *clk_list, unsigned int nr_clk);
 extern void __init samsung_clk_register_fixed_factor(
#6 lore raw

PATCH v6 1/16 clk: samsung: add common clock framework helper functions for Samsung platforms

Quoted 22 lines · Heiko St?bner

Am Sonntag, 3. M?rz 2013, 12:45:01 schrieb Tomasz Figa:

Quoted 21 lines · On Sunday 03 of March 2013 12:17:29 Sylwester Nawrocki wrote:
Quoted 16 lines · Heiko St?bner
Quoted 4 lines

But is there an easy way to define more than one alias? On the s3c2416 for example the hsmmc hclk is the "hsmmc" io-clock, as well as the source for the "mmc_busclk.0". Same for the "uart" pclk, that is also a baud clock source.

This driver currently provides for only one additional clkdev lookup entry per a platform clock. I pointed out this desing issue in the early version of the patch set. It's because a machine clock definition is coupled with a clock consumer definition. And IMO various samsung_clock_register_* functions should not have clk_register_clkdev() inside them. I.e. first step could be registering all machine clocks and in the second one clkdev lookup entries could be created. This is how most (all?) existing SoC clock drivers are working.

Quoted 2 lines

But those multiple aliases are important only for machines with device tree support, aren't they ?

I suppose you meant _without_ device tree support, right?

Yes, my mistake, sorry for the confusion.

Quoted 4 lines

The aliases are only needed for the non-dt case. But as I think common clk support will be a requirement for dt support in the future, similar to pinctrl, without the correct handling of the aliases it will be hard to incrementally convert the other platforms (i.e. s3c24xx before s3c2443, etc).

Yes, indeed. That's a very valid point to have the handling of the aliases implemented correctly, not assuming it will be needed temporarily only.

Quoted 2 lines

For the time being I've added my own register_alias function to Thomas' core code, hijacking the clk_table for this - attached for reference below.

The patch looks good to me. It would make sense to handle all clkdev entries like this.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

I hope this patch series gets merged early to linux-next in the 3.10 cycle so the multiple accumulated fixup patches for this clock driver can be merged as well and issues like that you pointed out can be resolved with incremental patches.

Yes, I hope so too.

me too. Following all this still out-of-tree stuff makes me dizzy :-)

Yeah, especially that it is not always clear what tag the patch series are based of off. For a long patch series like these, touching the core subsystems, it would be nice to have a corresponding git tree so it is possible to actually use and test the patches without much trouble.

Quoted 50 lines

Heiko

drivers/clk/samsung/clk.c +24 -3
index d36cdd5..7f1b5bc 100644
@@ -57,14 +57,15 @@ void __init samsung_clk_init(struct device_node *np, void __iomem *base,
  		unsigned long nr_rdump)
  {
  	reg_base = base;
-	if (!np)
-		return;
 
-#ifdef CONFIG_OF
  	clk_table = kzalloc(sizeof(struct clk *) * nr_clks, GFP_KERNEL);
  	if (!clk_table)
  		panic("could not allocate clock lookup table\n");
 
+	if (!np)
+		return;
+
+#ifdef CONFIG_OF
  	clk_data.clks = clk_table;
  	clk_data.clk_num = nr_clks;
  	of_clk_add_provider(np, of_clk_src_onecell_get,&clk_data);
@@ -96,6 +97,46 @@ void samsung_clk_add_lookup(struct clk *clk, unsigned int id)
  		clk_table[id] = clk;
  }
 
+/* register a list of aliases */
+void __init samsung_clk_register_alias(struct samsung_clock_alias *list,
+					unsigned int nr_clk)
+{
+	struct clk *clk;
+	unsigned int idx, ret;
+
+	if (!clk_table) {
+		pr_err("%s: clock table missing\n", __func__);
+		return;
+	}
+
+	for (idx = 0; idx<  nr_clk; idx++, list++) {
+		if (!list->id) {
+			pr_err("%s: clock id missing for index %d\n", __func__,
+				idx);
+			continue;
+		}
+
+		clk = clk_table[list->id];

drivers/clk/samsung/clk.c void samsung_clk_add_lookup(struct clk *clk, unsigned int id) · line 129

Quoted 10 lines
drivers/clk/samsung/clk.c +10 -0
+		if (!clk) {
+			pr_err("%s: failed to find clock %d\n", __func__,
+				list->id);
+			continue;
+		}
+
+		/* register a clock lookup only if a clock alias is specified */
+		if (!list->alias) {
+			pr_err("%s: no alias defined for clock %d\n", __func__,
+			       list->id);

I wouldn't print that error in general. It might be a clock with NULL conn_id.
It's not an error condition.

Quoted 52 lines
drivers/clk/samsung/clk.c +10 -0
+			continue;
+		}
+
+		ret = clk_register_clkdev(clk, list->alias, list->dev_name);
+		if (ret)
+			pr_err("%s: failed to register lookup %s\n",
+					__func__, list->alias);
+	}
+}
+
  /* register a list of fixed clocks */
  void __init samsung_clk_register_fixed_rate(
  		struct samsung_fixed_rate_clock *list, unsigned int nr_clk)
drivers/clk/samsung/clk.h +21 -0
index 175a9d0..8be9248 100644
@@ -23,6 +23,25 @@
  #include<mach/map.h>
 
  /**
+ * struct samsung_clock_alias: information about mux clock
+ * @id: platform specific id of the clock.
+ * @dev_name: name of the device to which this clock belongs.
+ * @alias: optional clock alias name to be assigned to this clock.
+ */
+struct samsung_clock_alias {
+	unsigned int		id;
+	const char		*dev_name;
+	const char		*alias;
+};
+
+#define ALIAS(_id, dname, a)	\
+	{							\
+		.id		= _id,				\
+		.dev_name	= dname,			\
+		.alias		= a,				\
+	}
+
+/**
   * struct samsung_fixed_rate_clock: information about fixed-rate clock
   * @id: platform specific id of the clock.
   * @name: name of this fixed-rate clock.
@@ -260,6 +282,8 @@ extern void __init samsung_clk_of_register_fixed_ext(
 
  extern void samsung_clk_add_lookup(struct clk *clk, unsigned int id);
 
+extern void samsung_clk_register_alias(struct samsung_clock_alias *list,
+		unsigned int nr_clk);
  extern void __init samsung_clk_register_fixed_rate(
  		struct samsung_fixed_rate_clock *clk_list, unsigned int nr_clk);
  extern void __init samsung_clk_register_fixed_factor(
#7 lore raw

PATCH v6 1/16 clk: samsung: add common clock framework helper functions for Samsung platforms

In reply to Tomasz Figa
Quoted 24 lines · Tomasz Figa

Hi,

Quoted 17 lines · On Sunday 03 of March 2013 12:17:29 Sylwester Nawrocki wrote:

Hi,

Quoted 4 lines · Heiko St?bner

But is there an easy way to define more than one alias? On the s3c2416 for example the hsmmc hclk is the "hsmmc" io-clock, as well as the source for the "mmc_busclk.0". Same for the "uart" pclk, that is also a baud clock source.

This driver currently provides for only one additional clkdev lookup entry per a platform clock. I pointed out this desing issue in the early version of the patch set. It's because a machine clock definition is coupled with a clock consumer definition. And IMO various samsung_clock_register_* functions should not have clk_register_clkdev() inside them. I.e. first step could be registering all machine clocks and in the second one clkdev lookup entries could be created. This is how most (all?) existing SoC clock drivers are working.

Quoted 2 lines

But those multiple aliases are important only for machines with device tree support, aren't they ?

Quoted 9 lines

I suppose you meant _without_ device tree support, right?

Quoted 4 lines

I hope this patch series gets merged early to linux-next in the 3.10 cycle so the multiple accumulated fixup patches for this clock driver can be merged as well and issues like that you pointed out can be resolved with incremental patches.

Yes, I hope so too.

Yes, I will in this weekend.

Note, I will modify [07/16] for universal_c210 as per Kyungmin's request, I'm not sure about universal_c210 though.

Thanks.

- Kukjin

#8 lore raw

PATCH v6 1/16 clk: samsung: add common clock framework helper functions for Samsung platforms

In reply to Tomasz Figa

Kukjin Kim wrote:

[...]

Thomas,

As I said, I applied this whole series into Samsung tree, following error happens with exynos4_defconfig(non-DT) though.

drivers/clk/samsung/clk.c: In function 'samsung_clk_of_register_fixed_ext':
drivers/clk/samsung/clk.c:251:2: error: implicit declaration of function 'for_each_matching_node_and_match' [-Werror=implicit-function-declaration] drivers/clk/samsung/clk.c:251:60: error: expected ';' before '{' token drivers/clk/samsung/clk.c:249:6: warning: unused variable 'freq' [-Wunused-variable]
cc1: some warnings being treated as errors
make[3]: *** [drivers/clk/samsung/clk.o] Error 1
make[2]: *** [drivers/clk/samsung] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [drivers/clk] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [drivers] Error 2
make: *** Waiting for unfinished jobs....

I think, it's time to decide to support non-DT exynos continuously, above compilation error can be fixed though.

Hey guys, how do you think?

- Kukjin

#9 lore raw

PATCH v6 1/16 clk: samsung: add common clock framework helper functions for Samsung platforms

In reply to Sylwester Nawrocki
Quoted 7 lines · Sylwester Nawrocki
Quoted 6 lines · Heiko St?bner

But is there an easy way to define more than one alias? On the s3c2416 for
example the hsmmc hclk is the "hsmmc" io-clock, as well as the source for the
"mmc_busclk.0". Same for the "uart" pclk, that is also a baud clock source.

[...]

Quoted 1 line

But those multiple aliases are important only for machines with device

                                                              ^^^^^

Sorry, this should have read "without". Also please note that due to representing original struct clk_clksrc objects (mux + div + gate clock) with separate primitive clocks device drivers may not work as before where clk_{set/get}_parent() was called. I.e. a separate consumer clock id needs to be used to control a clock mux. Hmm, however this issue doesn't affect anything on s3c24xx, since such composite clocks have been introduced only starting from s3c64xx.

I guess to create multiple aliases now a new helper function could be created that takes as an argument a clock index (as in enum exynos4_clks) and adds a clkdev lookup entry to a matched clk object. Probably it wouldn't be difficult to rework the driver to be registering all clkdev entries like this.

Do you have your source tree in any public git available ? ;) Perhaps I could find a time to adjust and try it with s3c2440 based board.

Quoted 1 line

tree support, aren't they ?

#10 lore raw

PATCH v6 1/16 clk: samsung: add common clock framework helper functions for Samsung platforms

Am Sonntag, 3. M?rz 2013, 12:59:03 schrieb Sylwester Nawrocki:

Quoted 22 lines · Sylwester Nawrocki
Quoted 7 lines · Heiko St?bner
Quoted 6 lines

But is there an easy way to define more than one alias? On the s3c2416 for
example the hsmmc hclk is the "hsmmc" io-clock, as well as the source for the
"mmc_busclk.0". Same for the "uart" pclk, that is also a baud clock source.

[...]

Quoted 1 line

But those multiple aliases are important only for machines with device

                                                              ^^^^^

Sorry, this should have read "without". Also please note that due to representing original struct clk_clksrc objects (mux + div + gate clock) with separate primitive clocks device drivers may not work as before where clk_{set/get}_parent() was called. I.e. a separate consumer clock id needs to be used to control a clock mux. Hmm, however this issue doesn't affect anything on s3c24xx, since such composite clocks have been introduced only starting from s3c64xx.

Quoted 8 lines

I guess to create multiple aliases now a new helper function could be created that takes as an argument a clock index (as in enum exynos4_clks) and adds a clkdev lookup entry to a matched clk object. Probably it wouldn't be difficult to rework the driver to be registering all clkdev entries like this.

Do you have your source tree in any public git available ? ;) Perhaps I could find a time to adjust and try it with s3c2440 based board.

It's all quite messy still :-) ... I just managed to fix my last boot issues with adding the baud clock aliases.

As I'm currently working on a linux-next variant with a lot of pending patches merged in, there is no public git tree of it. But I've attached an archive of the changes I did. As always I'm doing s3c2416 and s3c2443 as they are quite similar, but as always there is a big difference to SoCs earlier than s3c2443.

Heiko
-------------- next part --------------
A non-text attachment was scrubbed...
Name: s3c2416-clk.tar.gz
Type: application/x-compressed-tar
Size: 16112 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130303/e235bf90/attachment.bin>

#11 lore raw

PATCH v6 2/16 clk: samsung: add pll clock registration helper functions

In reply to Thomas Abraham

There are several types of pll clocks used in Samsung SoC's and these pll clocks can be represented as Samsung specific pll clock types and registered with the common clock framework. Add support for pll35xx, pll36xx, pll45xx, pll46xx and pll2550x clock types and helper functions to register them.

---
 drivers/clk/samsung/Makefile  |    2 +-
 drivers/clk/samsung/clk-pll.c |  499 +++++++++++++++++++++++++++++++++++++++++
 drivers/clk/samsung/clk-pll.h |   41 ++++
 3 files changed, 541 insertions(+), 1 deletions(-)
 create mode 100644 drivers/clk/samsung/clk-pll.c
 create mode 100644 drivers/clk/samsung/clk-pll.h
drivers/clk/samsung/Makefile +1 -1
index bd920b4..78e5aaa 100644
@@ -2,4 +2,4 @@
 # Samsung Clock specific Makefile
 #
 
-obj-$(CONFIG_COMMON_CLK)	+= clk.o
+obj-$(CONFIG_COMMON_CLK)	+= clk.o clk-pll.o
drivers/clk/samsung/clk-pll.c new file +499 -0

499 lines not on this page · raw message

drivers/clk/samsung/clk-pll.h new file +41 -0

41 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#12 lore raw

PATCH v6 3/16 clk: exynos4: register clocks using common clock framework

In reply to Thomas Abraham

The Exynos4 clocks are statically listed and registered using the Samsung specific common clock helper functions. Both device tree based clock lookup and clkdev based clock lookups are supported.

---
 .../devicetree/bindings/clock/exynos4-clock.txt    |  215 +++++
 drivers/clk/samsung/Makefile                       |    1 +
 drivers/clk/samsung/clk-exynos4.c                  |  843 ++++++++++++++++++++
 3 files changed, 1059 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/clock/exynos4-clock.txt
 create mode 100644 drivers/clk/samsung/clk-exynos4.c
Documentation/devicetree/bindings/clock/exynos4-clock.txt new file +215 -0
new file mode 100644
index 0000000..e874add
@@ -0,0 +1,215 @@
+* Samsung Exynos4 Clock Controller
+
+The Exynos4 clock controller generates and supplies clock to various controllers
+within the Exynos4 SoC. The clock binding described here is applicable to all
+SoC's in the Exynos4 family.
+
+Required Properties:
+
+- comptible: should be one of the following.
+  - "samsung,exynos4210-clock" - controller compatible with Exynos4210 SoC.
+  - "samsung,exynos4412-clock" - controller compatible with Exynos4412 SoC.
+
+- reg: physical base address of the controller and length of memory mapped
+  region.
+
+- #clock-cells: should be 1.
+
+The following is the list of clocks generated by the controller. Each clock is
+assigned an identifier and client nodes use this identifier to specify the
+clock which they consume. Some of the clocks are available only on a particular
+Exynos4 SoC and this is specified where applicable.
+
+
+		 [Core Clocks]
+
+  Clock               ID      SoC (if specific)
+  -----------------------------------------------
+
+  xxti                1
+  xusbxti             2
+  fin_pll             3
+  fout_apll           4
+  fout_mpll           5
+  fout_epll           6
+  fout_vpll           7
+  sclk_apll           8
+  sclk_mpll           9
+  sclk_epll           10
+  sclk_vpll           11
+  arm_clk             12
+  aclk200             13
+  aclk100             14
+  aclk160             15
+  aclk133             16
+
+
+            [Clock Gate for Special Clocks]
+
+  Clock               ID      SoC (if specific)
+  -----------------------------------------------
+
+  sclk_fimc0          128
+  sclk_fimc1          129
+  sclk_fimc2          130
+  sclk_fimc3          131
+  sclk_cam0           132
+  sclk_cam1           133
+  sclk_csis0          134
+  sclk_csis1          135
+  sclk_hdmi           136
+  sclk_mixer          137
+  sclk_dac            138
+  sclk_pixel          139
+  sclk_fimd0          140
+  sclk_mdnie0         141     Exynos4412
+  sclk_mdnie_pwm0 12  142     Exynos4412
+  sclk_mipi0          143
+  sclk_audio0         144
+  sclk_mmc0           145
+  sclk_mmc1           146
+  sclk_mmc2           147
+  sclk_mmc3           148
+  sclk_mmc4           149
+  sclk_sata           150     Exynos4210
+  sclk_uart0          151
+  sclk_uart1          152
+  sclk_uart2          153
+  sclk_uart3          154
+  sclk_uart4          155
+  sclk_audio1         156
+  sclk_audio2         157
+  sclk_spdif          158
+  sclk_spi0           159
+  sclk_spi1           160
+  sclk_spi2           161
+  sclk_slimbus        162
+  sclk_fimd1          163     Exynos4210
+  sclk_mipi1          164     Exynos4210
+  sclk_pcm1           165
+  sclk_pcm2           166
+  sclk_i2s1           167
+  sclk_i2s2           168
+  sclk_mipihsi        169     Exynos4412
+
+
+	      [Peripheral Clock Gates]
+
+  Clock               ID      SoC (if specific)
+  -----------------------------------------------
+
+  fimc0               256
+  fimc1               257
+  fimc2               258
+  fimc3               259
+  csis0               260
+  csis1               261
+  jpeg                262
+  smmu_fimc0          263
+  smmu_fimc1          264
+  smmu_fimc2          265
+  smmu_fimc3          266
+  smmu_jpeg           267
+  vp                  268
+  mixer               269
+  tvenc               270     Exynos4210
+  hdmi                271
+  smmu_tv             272
+  mfc                 273
+  smmu_mfcl           274
+  smmu_mfcr           275
+  g3d                 276
+  g2d                 277     Exynos4210
+  rotator             278     Exynos4210
+  mdma                279     Exynos4210
+  smmu_g2d            280     Exynos4210
+  smmu_rotator        281     Exynos4210
+  smmu_mdma           282     Exynos4210
+  fimd0               283
+  mie0                284
+  mdnie0              285     Exynos4412
+  dsim0               286
+  smmu_fimd0          287
+  fimd1               288     Exynos4210
+  mie1                289     Exynos4210
+  dsim1               290     Exynos4210
+  smmu_fimd1          291     Exynos4210
+  pdma0               292
+  pdma1               293
+  pcie_phy            294
+  sata_phy            295     Exynos4210
+  tsi                 296
+  sdmmc0              297
+  sdmmc1              298
+  sdmmc2              299
+  sdmmc3              300
+  sdmmc4              301
+  sata                302     Exynos4210
+  sromc               303
+  usb_host            304
+  usb_device          305
+  pcie                306
+  onenand             307
+  nfcon               308
+  smmu_pcie           309
+  gps                 310
+  smmu_gps            311
+  uart0               312
+  uart1               313
+  uart2               314
+  uart3               315
+  uart4               316
+  i2c0                317
+  i2c1                318
+  i2c2                319
+  i2c3                320
+  i2c4                321
+  i2c5                322
+  i2c6                323
+  i2c7                324
+  i2c_hdmi            325
+  tsadc               326
+  spi0                327
+  spi1                328
+  spi2                329
+  i2s1                330
+  i2s2                331
+  pcm0                332
+  i2s0                333
+  pcm1                334
+  pcm2                335
+  pwm                 336
+  slimbus             337
+  spdif               338
+  ac97                339
+  modemif             340
+  chipid              341
+  sysreg              342
+  hdmi_cec            343
+  mct                 344
+  wdt                 345
+  rtc                 346
+  keyif               347
+  audss               348
+  mipi_hsi            349     Exynos4210
+  mdma2               350     Exynos4210
+
+Example 1: An example of a clock controller node is listed below.
+
+	clock: clock-controller at 0x10030000 {
+		compatible = "samsung,exynos4210-clock";
+		reg = <0x10030000 0x20000>;
+		#clock-cells = <1>;
+	};
+
+Example 2: UART controller node that consumes the clock generated by the clock
+	   controller. Refer to the standard clock bindings for information
+	   about 'clocks' and 'clock-names' property.
+
+	serial at 13820000 {
+		compatible = "samsung,exynos4210-uart";
+		reg = <0x13820000 0x100>;
+		interrupts = <0 54 0>;
+		clocks = <&clock 314>, <&clock 153>;
+		clock-names = "uart", "clk_uart_baud0";
+	};
drivers/clk/samsung/Makefile +1 -0
index 78e5aaa..8862f0d 100644
@@ -3,3 +3,4 @@
 #
 
 obj-$(CONFIG_COMMON_CLK)	+= clk.o clk-pll.o
+obj-$(CONFIG_ARCH_EXYNOS4)	+= clk-exynos4.o
drivers/clk/samsung/clk-exynos4.c new file +843 -0

843 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#13 lore raw

PATCH v6 4/16 clk: exynos5250: register clocks using common clock framework

In reply to Thomas Abraham

The Exynos5250 clocks are statically listed and registered using the Samsung specific common clock helper functions. Both device tree based clock lookup and clkdev based clock lookups are supported.

Cc Mike Turquette <[email protected]>
Cc Kukjin Kim <[email protected]>
---
 .../devicetree/bindings/clock/exynos5250-clock.txt |  171 +++++++
 drivers/clk/samsung/Makefile                       |    1 +
 drivers/clk/samsung/clk-exynos5250.c               |  514 ++++++++++++++++++++
 3 files changed, 686 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/clock/exynos5250-clock.txt
 create mode 100644 drivers/clk/samsung/clk-exynos5250.c
Documentation/devicetree/bindings/clock/exynos5250-clock.txt new file +171 -0
new file mode 100644
index 0000000..7104f02
@@ -0,0 +1,171 @@
+* Samsung Exynos5250 Clock Controller
+
+The Exynos5250 clock controller generates and supplies clock to various
+controllers within the Exynos5250 SoC.
+
+Required Properties:
+
+- comptible: should be one of the following.
+  - "samsung,exynos5250-clock" - controller compatible with Exynos5250 SoC.
+
+- reg: physical base address of the controller and length of memory mapped
+  region.
+
+- #clock-cells: should be 1.
+
+The following is the list of clocks generated by the controller. Each clock is
+assigned an identifier and client nodes use this identifier to specify the
+clock which they consume.
+
+
+       [Core Clocks]
+
+  Clock			ID
+  ----------------------------
+
+  fin_pll		1
+
+  [Clock Gate for Special Clocks]
+
+  Clock			ID
+  ----------------------------
+
+  sclk_cam_bayer	128
+  sclk_cam0		129
+  sclk_cam1		130
+  sclk_gscl_wa		131
+  sclk_gscl_wb		132
+  sclk_fimd1		133
+  sclk_mipi1		134
+  sclk_dp		135
+  sclk_hdmi		136
+  sclk_pixel		137
+  sclk_audio0		138
+  sclk_mmc0		139
+  sclk_mmc1		140
+  sclk_mmc2		141
+  sclk_mmc3		142
+  sclk_sata		143
+  sclk_usb3		144
+  sclk_jpeg		145
+  sclk_uart0		146
+  sclk_uart1		147
+  sclk_uart2		148
+  sclk_uart3		149
+  sclk_pwm		150
+  sclk_audio1		151
+  sclk_audio2		152
+  sclk_spdif		153
+  sclk_spi0		154
+  sclk_spi1		155
+  sclk_spi2		156
+
+
+   [Peripheral Clock Gates]
+
+  Clock			ID
+  ----------------------------
+
+  gscl0			256
+  gscl1			257
+  gscl2			258
+  gscl3			259
+  gscl_wa		260
+  gscl_wb		261
+  smmu_gscl0		262
+  smmu_gscl1		263
+  smmu_gscl2		264
+  smmu_gscl3		265
+  mfc			266
+  smmu_mfcl		267
+  smmu_mfcr		268
+  rotator		269
+  jpeg			270
+  mdma1			271
+  smmu_rotator		272
+  smmu_jpeg		273
+  smmu_mdma1		274
+  pdma0			275
+  pdma1			276
+  sata			277
+  usbotg		278
+  mipi_hsi		279
+  sdmmc0		280
+  sdmmc1		281
+  sdmmc2		282
+  sdmmc3		283
+  sromc			284
+  usb2			285
+  usb3			286
+  sata_phyctrl		287
+  sata_phyi2c		288
+  uart0			289
+  uart1			290
+  uart2			291
+  uart3			292
+  uart4			293
+  i2c0			294
+  i2c1			295
+  i2c2			296
+  i2c3			297
+  i2c4			298
+  i2c5			299
+  i2c6			300
+  i2c7			301
+  i2c_hdmi		302
+  adc			303
+  spi0			304
+  spi1			305
+  spi2			306
+  i2s1			307
+  i2s2			308
+  pcm1			309
+  pcm2			310
+  pwm			311
+  spdif			312
+  ac97			313
+  hsi2c0		314
+  hsi2c1		315
+  hs12c2		316
+  hs12c3		317
+  chipid		318
+  sysreg		319
+  pmu			320
+  cmu_top		321
+  cmu_core		322
+  cmu_mem		323
+  tzpc0			324
+  tzpc1			325
+  tzpc2			326
+  tzpc3			327
+  tzpc4			328
+  tzpc5			329
+  tzpc6			330
+  tzpc7			331
+  tzpc8			332
+  tzpc9			333
+  hdmi_cec		334
+  mct			335
+  wdt			336
+  rtc			337
+  tmu			338
+
+Example 1: An example of a clock controller node is listed below.
+
+	clock: clock-controller at 0x10010000 {
+		compatible = "samsung,exynos5250-clock";
+		reg = <0x10010000 0x30000>;
+		#clock-cells = <1>;
+	};
+
+Example 2: UART controller node that consumes the clock generated by the clock
+	   controller. Refer to the standard clock bindings for information
+	   about 'clocks' and 'clock-names' property.
+
+	serial at 13820000 {
+		compatible = "samsung,exynos4210-uart";
+		reg = <0x13820000 0x100>;
+		interrupts = <0 54 0>;
+		clocks = <&clock 314>, <&clock 153>;
+		clock-names = "uart", "clk_uart_baud0";
+	};
drivers/clk/samsung/Makefile +1 -0
index 8862f0d..f18fb07 100644
@@ -4,3 +4,4 @@
 
 obj-$(CONFIG_COMMON_CLK)	+= clk.o clk-pll.o
 obj-$(CONFIG_ARCH_EXYNOS4)	+= clk-exynos4.o
+obj-$(CONFIG_SOC_EXYNOS5250)	+= clk-exynos5250.o
drivers/clk/samsung/clk-exynos5250.c new file +514 -0

514 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#14 lore raw

PATCH v6 5/16 clk: exynos5440: register clocks using common clock framework

In reply to Thomas Abraham

The Exynos5440 clocks are statically listed and registered using the Samsung specific common clock helper functions.

Cc Mike Turquette <[email protected]>
Cc Kukjin Kim <[email protected]>
---
 .../devicetree/bindings/clock/exynos5440-clock.txt |   61 +++++++++
 drivers/clk/samsung/Makefile                       |    1 +
 drivers/clk/samsung/clk-exynos5440.c               |  139 ++++++++++++++++++++
 3 files changed, 201 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/clock/exynos5440-clock.txt
 create mode 100644 drivers/clk/samsung/clk-exynos5440.c
Documentation/devicetree/bindings/clock/exynos5440-clock.txt new file +61 -0
new file mode 100644
index 0000000..9dbf0a4
@@ -0,0 +1,61 @@
+* Samsung Exynos5440 Clock Controller
+
+The Exynos5440 clock controller generates and supplies clock to various
+controllers within the Exynos5440 SoC.
+
+Required Properties:
+
+- comptible: should be "samsung,exynos5440-clock".
+
+- reg: physical base address of the controller and length of memory mapped
+  region.
+
+- #clock-cells: should be 1.
+
+The following is the list of clocks generated by the controller. Each clock is
+assigned an identifier and client nodes use this identifier to specify the
+clock which they consume.
+
+
+       [Core Clocks]
+
+  Clock			ID
+  ----------------------------
+
+  xtal			1
+  arm_clk		2
+
+   [Peripheral Clock Gates]
+
+  Clock			ID
+  ----------------------------
+
+  spi_baud		16
+  pb0_250		17
+  pr0_250		18
+  pr1_250		19
+  b_250			20
+  b_125			21
+  b_200			22
+  sata			23
+  usb			24
+  gmac0			25
+  cs250			26
+  pb0_250_o		27
+  pr0_250_o		28
+  pr1_250_o		29
+  b_250_o		30
+  b_125_o		31
+  b_200_o		32
+  sata_o		33
+  usb_o			34
+  gmac0_o		35
+  cs250_o		36
+
+Example: An example of a clock controller node is listed below.
+
+	clock: clock-controller at 0x10010000 {
+		compatible = "samsung,exynos5440-clock";
+		reg = <0x160000 0x10000>;
+		#clock-cells = <1>;
+	};
drivers/clk/samsung/Makefile +1 -0
index f18fb07..b7c232e 100644
@@ -5,3 +5,4 @@
 obj-$(CONFIG_COMMON_CLK)	+= clk.o clk-pll.o
 obj-$(CONFIG_ARCH_EXYNOS4)	+= clk-exynos4.o
 obj-$(CONFIG_SOC_EXYNOS5250)	+= clk-exynos5250.o
+obj-$(CONFIG_SOC_EXYNOS5440)	+= clk-exynos5440.o
drivers/clk/samsung/clk-exynos5440.c new file +139 -0

139 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#15 lore raw

PATCH v6 7/16 ARM: Exynos: Initialize the clocks prior to timer initialization

In reply to Thomas Abraham

Since the clock initialization should be completed prior to the mct timer initialization, create a new function 'exynos_init_time' that first sets up the clock and then invokes the timer initialization function. The 'init_time' callback in the board files are updated to invoke this new wrapper function.

---
 arch/arm/mach-exynos/common.c              |   16 ++++++++++++++++
 arch/arm/mach-exynos/mach-armlex4210.c     |    2 +-
 arch/arm/mach-exynos/mach-exynos4-dt.c     |    2 +-
 arch/arm/mach-exynos/mach-exynos5-dt.c     |    2 +-
 arch/arm/mach-exynos/mach-nuri.c           |    2 +-
 arch/arm/mach-exynos/mach-origen.c         |    2 +-
 arch/arm/mach-exynos/mach-smdk4x12.c       |    4 ++--
 arch/arm/mach-exynos/mach-smdkv310.c       |    4 ++--
 arch/arm/mach-exynos/mach-universal_c210.c |    8 +++++++-
 9 files changed, 32 insertions(+), 10 deletions(-)
arch/arm/mach-exynos/common.c +16 -0
index 8e4a25c..64585af 100644
@@ -23,6 +23,8 @@
 #include <linux/export.h>
 #include <linux/irqdomain.h>
 #include <linux/of_address.h>
+#include <linux/clocksource.h>
+#include <linux/clk-provider.h>
 
 #include <asm/proc-fns.h>
 #include <asm/exception.h>
@@ -436,6 +438,20 @@ static void __init exynos5440_map_io(void)
 	iotable_init(exynos5440_iodesc0, ARRAY_SIZE(exynos5440_iodesc0));
 }
 
+void __init exynos_init_time(void)
+{
+	if (of_have_populated_dt()) {
+#ifdef CONFIG_OF
+		of_clk_init(NULL);
+		clocksource_of_init();
+#endif
+	} else {
+		/* todo: remove after migrating legacy E4 platforms to dt */
+		exynos4_clk_init(NULL);
+		mct_init();
+	}
+}
+
 #define COMBINER_ENABLE_SET	0x0
 #define COMBINER_ENABLE_CLEAR	0x4
 #define COMBINER_INT_STATUS	0xC
arch/arm/mach-exynos/mach-armlex4210.c +1 -1
index e45b4b4..3518ac8 100644
@@ -203,6 +203,6 @@ MACHINE_START(ARMLEX4210, "ARMLEX4210")
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= armlex4210_machine_init,
 	.init_late	= exynos_init_late,
-	.init_time	= mct_init,
+	.init_time	= exynos_init_time,
 	.restart	= exynos4_restart,
 MACHINE_END
arch/arm/mach-exynos/mach-exynos4-dt.c +1 -1
index 2c25f2c..6c5e068 100644
@@ -127,7 +127,7 @@ DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)")
 	.init_early	= exynos_firmware_init,
 	.init_machine	= exynos4_dt_machine_init,
 	.init_late	= exynos_init_late,
-	.init_time	= clocksource_of_init,
+	.init_time	= exynos_init_time,
 	.dt_compat	= exynos4_dt_compat,
 	.restart        = exynos4_restart,
 	.reserve	= exynos4_reserve,
arch/arm/mach-exynos/mach-exynos5-dt.c +1 -1
index b5f9549..dfe51ee 100644
@@ -179,7 +179,7 @@ DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)")
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= exynos5_dt_machine_init,
 	.init_late	= exynos_init_late,
-	.init_time	= clocksource_of_init,
+	.init_time	= exynos_init_time,
 	.dt_compat	= exynos5_dt_compat,
 	.restart        = exynos5_restart,
 	.reserve	= exynos5_reserve,
arch/arm/mach-exynos/mach-nuri.c +1 -1
index c49ec9d..cdae74b 100644
@@ -1381,7 +1381,7 @@ MACHINE_START(NURI, "NURI")
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= nuri_machine_init,
 	.init_late	= exynos_init_late,
-	.init_time	= mct_init,
+	.init_time	= exynos_init_time,
 	.reserve        = &nuri_reserve,
 	.restart	= exynos4_restart,
 MACHINE_END
arch/arm/mach-exynos/mach-origen.c +1 -1
index 656967d..e9ab921 100644
@@ -816,7 +816,7 @@ MACHINE_START(ORIGEN, "ORIGEN")
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= origen_machine_init,
 	.init_late	= exynos_init_late,
-	.init_time	= mct_init,
+	.init_time	= exynos_init_time,
 	.reserve	= &origen_reserve,
 	.restart	= exynos4_restart,
 MACHINE_END
arch/arm/mach-exynos/mach-smdk4x12.c +2 -2
index c56cc21..71422ad 100644
@@ -377,7 +377,7 @@ MACHINE_START(SMDK4212, "SMDK4212")
 	.map_io		= smdk4x12_map_io,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= smdk4x12_machine_init,
-	.init_time	= mct_init,
+	.init_time	= exynos_init_time,
 	.restart	= exynos4_restart,
 	.reserve	= &smdk4x12_reserve,
 MACHINE_END
@@ -392,7 +392,7 @@ MACHINE_START(SMDK4412, "SMDK4412")
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= smdk4x12_machine_init,
 	.init_late	= exynos_init_late,
-	.init_time	= mct_init,
+	.init_time	= exynos_init_time,
 	.restart	= exynos4_restart,
 	.reserve	= &smdk4x12_reserve,
 MACHINE_END
arch/arm/mach-exynos/mach-smdkv310.c +2 -2
index 9d511f5..eb51c06 100644
@@ -424,7 +424,7 @@ MACHINE_START(SMDKV310, "SMDKV310")
 	.map_io		= smdkv310_map_io,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= smdkv310_machine_init,
-	.init_time	= mct_init,
+	.init_time	= exynos_init_time,
 	.reserve	= &smdkv310_reserve,
 	.restart	= exynos4_restart,
 MACHINE_END
@@ -438,7 +438,7 @@ MACHINE_START(SMDKC210, "SMDKC210")
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= smdkv310_machine_init,
 	.init_late	= exynos_init_late,
-	.init_time	= mct_init,
+	.init_time	= exynos_init_time,
 	.reserve	= &smdkv310_reserve,
 	.restart	= exynos4_restart,
 MACHINE_END
arch/arm/mach-exynos/mach-universal_c210.c +7 -1
index 3998c81..53de074 100644
@@ -1144,6 +1144,12 @@ static void __init universal_machine_init(void)
 	platform_add_devices(universal_devices, ARRAY_SIZE(universal_devices));
 }
 
+static void __init universal_init_time(void)
+{
+	exynos4_clk_init(NULL);
+	mct_init();
+}
+
 MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
 	/* Maintainer: Kyungmin Park <[email protected]> */
 	.atag_offset	= 0x100,
@@ -1153,7 +1159,7 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= universal_machine_init,
 	.init_late	= exynos_init_late,
-	.init_time	= samsung_timer_init,
+	.init_time	= universal_init_time,
 	.reserve        = &universal_reserve,
 	.restart	= exynos4_restart,
 MACHINE_END
Signature · 1 line
1.7.5.4
#16 lore raw

PATCH v6 7/16 ARM: Exynos: Initialize the clocks prior to timer initialization

Quoted 166 lines · Thomas Abraham

Since the clock initialization should be completed prior to the mct timer initialization, create a new function 'exynos_init_time' that first sets up the clock and then invokes the timer initialization function. The 'init_time' callback in the board files are updated to invoke this new wrapper function.

---
 arch/arm/mach-exynos/common.c              |   16 ++++++++++++++++
 arch/arm/mach-exynos/mach-armlex4210.c     |    2 +-
 arch/arm/mach-exynos/mach-exynos4-dt.c     |    2 +-
 arch/arm/mach-exynos/mach-exynos5-dt.c     |    2 +-
 arch/arm/mach-exynos/mach-nuri.c           |    2 +-
 arch/arm/mach-exynos/mach-origen.c         |    2 +-
 arch/arm/mach-exynos/mach-smdk4x12.c       |    4 ++--
 arch/arm/mach-exynos/mach-smdkv310.c       |    4 ++--
 arch/arm/mach-exynos/mach-universal_c210.c |    8 +++++++-
 9 files changed, 32 insertions(+), 10 deletions(-)
arch/arm/mach-exynos/common.c +16 -0
index 8e4a25c..64585af 100644
@@ -23,6 +23,8 @@
 #include <linux/export.h>
 #include <linux/irqdomain.h>
 #include <linux/of_address.h>
+#include <linux/clocksource.h>
+#include <linux/clk-provider.h>
 
 #include <asm/proc-fns.h>
 #include <asm/exception.h>
@@ -436,6 +438,20 @@ static void __init exynos5440_map_io(void)
        iotable_init(exynos5440_iodesc0, ARRAY_SIZE(exynos5440_iodesc0));
 }
 
+void __init exynos_init_time(void)
+{
+       if (of_have_populated_dt()) {
+#ifdef CONFIG_OF
+               of_clk_init(NULL);
+               clocksource_of_init();
+#endif
+       } else {
+               /* todo: remove after migrating legacy E4 platforms to dt */
+               exynos4_clk_init(NULL);
+               mct_init();
+       }
+}
+
 #define COMBINER_ENABLE_SET    0x0
 #define COMBINER_ENABLE_CLEAR  0x4
 #define COMBINER_INT_STATUS    0xC
arch/arm/mach-exynos/mach-armlex4210.c +1 -1
index e45b4b4..3518ac8 100644
@@ -203,6 +203,6 @@ MACHINE_START(ARMLEX4210, "ARMLEX4210")
        .handle_irq     = gic_handle_irq,
        .init_machine   = armlex4210_machine_init,
        .init_late      = exynos_init_late,
-       .init_time      = mct_init,
+       .init_time      = exynos_init_time,
        .restart        = exynos4_restart,
 MACHINE_END
arch/arm/mach-exynos/mach-exynos4-dt.c +1 -1
index 2c25f2c..6c5e068 100644
@@ -127,7 +127,7 @@ DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)")
        .init_early     = exynos_firmware_init,
        .init_machine   = exynos4_dt_machine_init,
        .init_late      = exynos_init_late,
-       .init_time      = clocksource_of_init,
+       .init_time      = exynos_init_time,
        .dt_compat      = exynos4_dt_compat,
        .restart        = exynos4_restart,
        .reserve        = exynos4_reserve,
arch/arm/mach-exynos/mach-exynos5-dt.c +1 -1
index b5f9549..dfe51ee 100644
@@ -179,7 +179,7 @@ DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)")
        .handle_irq     = gic_handle_irq,
        .init_machine   = exynos5_dt_machine_init,
        .init_late      = exynos_init_late,
-       .init_time      = clocksource_of_init,
+       .init_time      = exynos_init_time,
        .dt_compat      = exynos5_dt_compat,
        .restart        = exynos5_restart,
        .reserve        = exynos5_reserve,
arch/arm/mach-exynos/mach-nuri.c +1 -1
index c49ec9d..cdae74b 100644
@@ -1381,7 +1381,7 @@ MACHINE_START(NURI, "NURI")
        .handle_irq     = gic_handle_irq,
        .init_machine   = nuri_machine_init,
        .init_late      = exynos_init_late,
-       .init_time      = mct_init,
+       .init_time      = exynos_init_time,
        .reserve        = &nuri_reserve,
        .restart        = exynos4_restart,
 MACHINE_END
arch/arm/mach-exynos/mach-origen.c +1 -1
index 656967d..e9ab921 100644
@@ -816,7 +816,7 @@ MACHINE_START(ORIGEN, "ORIGEN")
        .handle_irq     = gic_handle_irq,
        .init_machine   = origen_machine_init,
        .init_late      = exynos_init_late,
-       .init_time      = mct_init,
+       .init_time      = exynos_init_time,
        .reserve        = &origen_reserve,
        .restart        = exynos4_restart,
 MACHINE_END
arch/arm/mach-exynos/mach-smdk4x12.c +2 -2
index c56cc21..71422ad 100644
@@ -377,7 +377,7 @@ MACHINE_START(SMDK4212, "SMDK4212")
        .map_io         = smdk4x12_map_io,
        .handle_irq     = gic_handle_irq,
        .init_machine   = smdk4x12_machine_init,
-       .init_time      = mct_init,
+       .init_time      = exynos_init_time,
        .restart        = exynos4_restart,
        .reserve        = &smdk4x12_reserve,
 MACHINE_END
@@ -392,7 +392,7 @@ MACHINE_START(SMDK4412, "SMDK4412")
        .handle_irq     = gic_handle_irq,
        .init_machine   = smdk4x12_machine_init,
        .init_late      = exynos_init_late,
-       .init_time      = mct_init,
+       .init_time      = exynos_init_time,
        .restart        = exynos4_restart,
        .reserve        = &smdk4x12_reserve,
 MACHINE_END
arch/arm/mach-exynos/mach-smdkv310.c +2 -2
index 9d511f5..eb51c06 100644
@@ -424,7 +424,7 @@ MACHINE_START(SMDKV310, "SMDKV310")
        .map_io         = smdkv310_map_io,
        .handle_irq     = gic_handle_irq,
        .init_machine   = smdkv310_machine_init,
-       .init_time      = mct_init,
+       .init_time      = exynos_init_time,
        .reserve        = &smdkv310_reserve,
        .restart        = exynos4_restart,
 MACHINE_END
@@ -438,7 +438,7 @@ MACHINE_START(SMDKC210, "SMDKC210")
        .handle_irq     = gic_handle_irq,
        .init_machine   = smdkv310_machine_init,
        .init_late      = exynos_init_late,
-       .init_time      = mct_init,
+       .init_time      = exynos_init_time,
        .reserve        = &smdkv310_reserve,
        .restart        = exynos4_restart,
 MACHINE_END
arch/arm/mach-exynos/mach-universal_c210.c +0 -0
index 3998c81..53de074 100644

arch/arm/mach-exynos/mach-universal_c210.c static void __init universal_machine_init(void) · line 1150

Quoted 7 lines
arch/arm/mach-exynos/mach-universal_c210.c +4 -0
@@ -1144,6 +1144,12 @@ static void __init universal_machine_init(void)
        platform_add_devices(universal_devices, ARRAY_SIZE(universal_devices));
 }
 
+static void __init universal_init_time(void)
+{
+       exynos4_clk_init(NULL);
+       mct_init();

No, It's not support MCT timer at universal board, please don't modify universal board at this time.
Others are okay.

Thank you,
Kyungmin Park

Quoted 22 lines
arch/arm/mach-exynos/mach-universal_c210.c +3 -2
+}
+
 MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
        /* Maintainer: Kyungmin Park <[email protected]> */
        .atag_offset    = 0x100,
@@ -1153,7 +1159,7 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
        .handle_irq     = gic_handle_irq,
        .init_machine   = universal_machine_init,
        .init_late      = exynos_init_late,
-       .init_time      = samsung_timer_init,
+       .init_time      = universal_init_time,
        .reserve        = &universal_reserve,
        .restart        = exynos4_restart,
 MACHINE_END
--

1.7.5.4

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#17 lore raw

PATCH v6 8/16 ARM: Exynos4: allow legacy board support to specify xxti and xusbxti clock speed

In reply to Thomas Abraham

The clock speed of xxti and xusbxti clocks depends on the oscillator used on the board to generate these clocks. For non-dt platforms, allow the board support for those platforms to set the clock frequency of xxti and xusbxti clocks.

---
 arch/arm/mach-exynos/common.c              |    3 +++
 arch/arm/mach-exynos/common.h              |    1 +
 arch/arm/mach-exynos/mach-nuri.c           |    2 ++
 arch/arm/mach-exynos/mach-origen.c         |    2 ++
 arch/arm/mach-exynos/mach-smdkv310.c       |    2 ++
 arch/arm/mach-exynos/mach-universal_c210.c |    2 ++
 6 files changed, 12 insertions(+), 0 deletions(-)
arch/arm/mach-exynos/common.c +3 -0
index 64585af..974978b 100644
@@ -68,6 +68,8 @@ static void exynos5440_map_io(void);
 static void exynos4_init_uarts(struct s3c2410_uartcfg *cfg, int no);
 static int exynos_init(void);
 
+unsigned long xxti_f = 0, xusbxti_f = 0;
+
 static struct cpu_table cpu_ids[] __initdata = {
 	{
 		.idcode		= EXYNOS4210_CPU_ID,
@@ -448,6 +450,7 @@ void __init exynos_init_time(void)
 	} else {
 		/* todo: remove after migrating legacy E4 platforms to dt */
 		exynos4_clk_init(NULL);
+		exynos4_clk_register_fixed_ext(xxti_f, xusbxti_f);
 		mct_init();
 	}
 }
arch/arm/mach-exynos/common.h +1 -0
index 2c3cdae..8d9ae73 100644
@@ -16,6 +16,7 @@
 
 extern void mct_init(void);
 void exynos_init_time(void);
+extern unsigned long xxti_f, xusbxti_f;
 
 struct map_desc;
 void exynos_init_io(struct map_desc *mach_desc, int size);
arch/arm/mach-exynos/mach-nuri.c +2 -0
index cdae74b..abe36ec 100644
@@ -1332,6 +1332,8 @@ static void __init nuri_map_io(void)
 {
 	exynos_init_io(NULL, 0);
 	s3c24xx_init_uarts(nuri_uartcfgs, ARRAY_SIZE(nuri_uartcfgs));
+	xxti_f = 0;
+	xusbxti_f = 24000000;
 }
 
 static void __init nuri_reserve(void)
arch/arm/mach-exynos/mach-origen.c +2 -0
index e9ab921..e7b36ca 100644
@@ -756,6 +756,8 @@ static void __init origen_map_io(void)
 {
 	exynos_init_io(NULL, 0);
 	s3c24xx_init_uarts(origen_uartcfgs, ARRAY_SIZE(origen_uartcfgs));
+	xxti_f = 0;
+	xusbxti_f = 24000000;
 }
 
 static void __init origen_power_init(void)
arch/arm/mach-exynos/mach-smdkv310.c +2 -0
index eb51c06..d146393 100644
@@ -373,6 +373,8 @@ static void __init smdkv310_map_io(void)
 {
 	exynos_init_io(NULL, 0);
 	s3c24xx_init_uarts(smdkv310_uartcfgs, ARRAY_SIZE(smdkv310_uartcfgs));
+	xxti_f = 12000000;
+	xusbxti_f = 24000000;
 }
 
 static void __init smdkv310_reserve(void)
arch/arm/mach-exynos/mach-universal_c210.c +2 -0
index 53de074..8cc315e 100644
@@ -1095,6 +1095,8 @@ static void __init universal_map_io(void)
 	exynos_init_io(NULL, 0);
 	s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs));
 	samsung_set_timer_source(SAMSUNG_PWM2, SAMSUNG_PWM4);
+	xxti_f = 0;
+	xusbxti_f = 24000000;
 }
 
 static void s5p_tv_setup(void)
Signature · 1 line
1.7.5.4
#18 lore raw

PATCH v6 9/16 ARM: Exynos: remove auxdata table from exynos4/5 dt machine file

In reply to Thomas Abraham

With support for device tree based clock lookup now available, remove the auxdata table from exynos4/5 dt-enabled machine file.

---
 arch/arm/mach-exynos/mach-exynos4-dt.c |   69 +----------------------
 arch/arm/mach-exynos/mach-exynos5-dt.c |   98 +-------------------------------
 2 files changed, 3 insertions(+), 164 deletions(-)
arch/arm/mach-exynos/mach-exynos4-dt.c +2 -67
index 6c5e068..809c274 100644
@@ -11,6 +11,7 @@
  * published by the Free Software Foundation.
 */
 
+#include <linux/kernel.h>
 #include <linux/of_platform.h>
 #include <linux/of_fdt.h>
 #include <linux/serial_core.h>
@@ -19,75 +20,10 @@
 
 #include <asm/mach/arch.h>
 #include <asm/hardware/gic.h>
-#include <mach/map.h>
-
-#include <plat/cpu.h>
-#include <plat/regs-serial.h>
 #include <plat/mfc.h>
 
 #include "common.h"
 
-/*
- * The following lookup table is used to override device names when devices
- * are registered from device tree. This is temporarily added to enable
- * device tree support addition for the Exynos4 architecture.
- *
- * For drivers that require platform data to be provided from the machine
- * file, a platform data pointer can also be supplied along with the
- * devices names. Usually, the platform data elements that cannot be parsed
- * from the device tree by the drivers (example: function pointers) are
- * supplied. But it should be noted that this is a temporary mechanism and
- * at some point, the drivers should be capable of parsing all the platform
- * data from the device tree.
- */
-static const struct of_dev_auxdata exynos4_auxdata_lookup[] __initconst = {
-	OF_DEV_AUXDATA("samsung,exynos4210-uart", EXYNOS4_PA_UART0,
-				"exynos4210-uart.0", NULL),
-	OF_DEV_AUXDATA("samsung,exynos4210-uart", EXYNOS4_PA_UART1,
-				"exynos4210-uart.1", NULL),
-	OF_DEV_AUXDATA("samsung,exynos4210-uart", EXYNOS4_PA_UART2,
-				"exynos4210-uart.2", NULL),
-	OF_DEV_AUXDATA("samsung,exynos4210-uart", EXYNOS4_PA_UART3,
-				"exynos4210-uart.3", NULL),
-	OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(0),
-				"exynos4-sdhci.0", NULL),
-	OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(1),
-				"exynos4-sdhci.1", NULL),
-	OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(2),
-				"exynos4-sdhci.2", NULL),
-	OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(3),
-				"exynos4-sdhci.3", NULL),
-	OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(0),
-				"s3c2440-i2c.0", NULL),
-	OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(1),
-				"s3c2440-i2c.1", NULL),
-	OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(2),
-				"s3c2440-i2c.2", NULL),
-	OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(3),
-				"s3c2440-i2c.3", NULL),
-	OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(4),
-				"s3c2440-i2c.4", NULL),
-	OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(5),
-				"s3c2440-i2c.5", NULL),
-	OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(6),
-				"s3c2440-i2c.6", NULL),
-	OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(7),
-				"s3c2440-i2c.7", NULL),
-	OF_DEV_AUXDATA("samsung,exynos4210-spi", EXYNOS4_PA_SPI0,
-				"exynos4210-spi.0", NULL),
-	OF_DEV_AUXDATA("samsung,exynos4210-spi", EXYNOS4_PA_SPI1,
-				"exynos4210-spi.1", NULL),
-	OF_DEV_AUXDATA("samsung,exynos4210-spi", EXYNOS4_PA_SPI2,
-				"exynos4210-spi.2", NULL),
-	OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_PDMA0, "dma-pl330.0", NULL),
-	OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_PDMA1, "dma-pl330.1", NULL),
-	OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_MDMA1, "dma-pl330.2", NULL),
-	OF_DEV_AUXDATA("samsung,exynos4210-tmu", EXYNOS4_PA_TMU,
-				"exynos-tmu", NULL),
-	OF_DEV_AUXDATA("samsung,mfc-v5", 0x13400000, "s5p-mfc", NULL),
-	{},
-};
-
 static void __init exynos4_dt_map_io(void)
 {
 	exynos_init_io(NULL, 0);
@@ -95,8 +31,7 @@ static void __init exynos4_dt_map_io(void)
 
 static void __init exynos4_dt_machine_init(void)
 {
-	of_platform_populate(NULL, of_default_bus_match_table,
-				exynos4_auxdata_lookup, NULL);
+	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
 static char const *exynos4_dt_compat[] __initdata = {
arch/arm/mach-exynos/mach-exynos5-dt.c +1 -97

123 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#19 lore raw

PATCH v6 10/16 clocksource: mct: use fin_pll clock as the tick clock source for mct

In reply to Thomas Abraham

With the migration of Exynos4 clocks to use common clock framework, the old styled 'xtal' clock is not used anymore. Instead, the clock 'fin_pll' is used as the tick clock for mct controller.

---
 drivers/clocksource/exynos_mct.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
drivers/clocksource/exynos_mct.c +6 -3
index e067130..8f84c42 100644
@@ -480,10 +480,13 @@ static struct local_timer_ops exynos4_mct_tick_ops __cpuinitdata = {
 
 static void __init exynos4_timer_resources(struct device_node *np)
 {
-	struct clk *mct_clk;
-	mct_clk = clk_get(NULL, "xtal");
+	struct clk *tick_clk;
 
-	clk_rate = clk_get_rate(mct_clk);
+	tick_clk = np ? of_clk_get_by_name(np, "fin_pll") :
+				clk_get(NULL, "fin_pll");
+	if (IS_ERR(tick_clk))
+		panic("%s: unable to determine tick clock rate\n", __func__);
+	clk_rate = clk_get_rate(tick_clk);
 
 	reg_base = np ? of_iomap(np, 0) : S5P_VA_SYSTIMER;
 	if (!reg_base)
Signature · 1 line
1.7.5.4
#20 lore raw

PATCH v6 11/16 clocksource: mct: add support for mct clock setup

In reply to Thomas Abraham

Add support for mct clock lookup and setup to ensure that the mct clock is has been turned on.

---
 drivers/clocksource/exynos_mct.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
drivers/clocksource/exynos_mct.c +6 -1
index 8f84c42..43e39b5 100644
@@ -480,7 +480,7 @@ static struct local_timer_ops exynos4_mct_tick_ops __cpuinitdata = {
 
 static void __init exynos4_timer_resources(struct device_node *np)
 {
-	struct clk *tick_clk;
+	struct clk *mct_clk, *tick_clk;
 
 	tick_clk = np ? of_clk_get_by_name(np, "fin_pll") :
 				clk_get(NULL, "fin_pll");
@@ -488,6 +488,11 @@ static void __init exynos4_timer_resources(struct device_node *np)
 		panic("%s: unable to determine tick clock rate\n", __func__);
 	clk_rate = clk_get_rate(tick_clk);
 
+	mct_clk = np ? of_clk_get_by_name(np, "mct") : clk_get(NULL, "mct");
+	if (IS_ERR(mct_clk))
+		panic("%s: unable to retrieve mct clock instance\n", __func__);
+	clk_prepare_enable(mct_clk);
+
 	reg_base = np ? of_iomap(np, 0) : S5P_VA_SYSTIMER;
 	if (!reg_base)
 		panic("%s: unable to ioremap mct address space\n", __func__);
Signature · 1 line
1.7.5.4
#21 lore raw

PATCH v6 12/16 ARM: dts: add Exynos4 and Exynos5 clock controller nodes

In reply to Thomas Abraham

Add clock controller nodes for Exynos4210, Exynos4x12, Exynos5250 and Exynos5440 SoC.

---
 arch/arm/boot/dts/exynos4210.dtsi |    6 ++++++
 arch/arm/boot/dts/exynos4x12.dtsi |    6 ++++++
 arch/arm/boot/dts/exynos5250.dtsi |    6 ++++++
 arch/arm/boot/dts/exynos5440.dtsi |    6 ++++++
 4 files changed, 24 insertions(+), 0 deletions(-)
arch/arm/boot/dts/exynos4210.dtsi +6 -0
index 0e16a34..6b25095 100644
@@ -69,6 +69,12 @@
 		};
 	};
 
+	clock: clock-controller at 0x10030000 {
+		compatible = "samsung,exynos4210-clock";
+		reg = <0x10030000 0x20000>;
+		#clock-cells = <1>;
+	};
+
 	pmu {
 		compatible = "arm,cortex-a9-pmu";
 		interrupt-parent = <&combiner>;
arch/arm/boot/dts/exynos4x12.dtsi +6 -0
index 022a839..75be8f5 100644
@@ -36,6 +36,12 @@
 			     <0 16 0>, <0 17 0>, <0 18 0>, <0 19 0>;
 	};
 
+	clock: clock-controller at 0x10030000 {
+		compatible = "samsung,exynos4412-clock";
+		reg = <0x10030000 0x20000>;
+		#clock-cells = <1>;
+	};
+
 	pinctrl_0: pinctrl at 11400000 {
 		compatible = "samsung,exynos4x12-pinctrl";
 		reg = <0x11400000 0x1000>;
arch/arm/boot/dts/exynos5250.dtsi +6 -0
index 2bb558e..d3eae4e 100644
@@ -60,6 +60,12 @@
 		compatible = "samsung,exynos4210-pd";
 		reg = <0x10044040 0x20>;
 	};
+
+	clock: clock-controller at 0x10010000 {
+		compatible = "samsung,exynos5250-clock";
+		reg = <0x10010000 0x30000>;
+		#clock-cells = <1>;
+	};
 
 	gic:interrupt-controller at 10481000 {
 		compatible = "arm,cortex-a9-gic";
arch/arm/boot/dts/exynos5440.dtsi +6 -0
index 5c5a699..f5834d0 100644
@@ -16,6 +16,12 @@
 
 	interrupt-parent = <&gic>;
 
+	clock: clock-controller at 0x160000 {
+		compatible = "samsung,exynos5440-clock";
+		reg = <0x160000 0x1000>;
+		#clock-cells = <1>;
+	};
+
 	gic:interrupt-controller at 2E0000 {
 		compatible = "arm,cortex-a15-gic";
 		#interrupt-cells = <3>;
Signature · 1 line
1.7.5.4
#22 lore raw

PATCH v6 13/16 ARM: dts: add clock provider information for all controllers in Exynos4 SoCs

In reply to Thomas Abraham

For all supported peripheral controllers on Exynos4 SoCs, add clock lookup information.

---
 arch/arm/boot/dts/exynos4.dtsi    |   50 +++++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/exynos4210.dtsi |    2 +
 arch/arm/boot/dts/exynos4412.dtsi |    2 +
 3 files changed, 54 insertions(+), 0 deletions(-)
arch/arm/boot/dts/exynos4.dtsi +50 -0
index 1a02189..621f331 100644
@@ -91,6 +91,8 @@
 		compatible = "samsung,s3c2410-wdt";
 		reg = <0x10060000 0x100>;
 		interrupts = <0 43 0>;
+		clocks = <&clock 345>;
+		clock-names = "watchdog";
 		status = "disabled";
 	};
 
@@ -98,6 +100,8 @@
 		compatible = "samsung,s3c6410-rtc";
 		reg = <0x10070000 0x100>;
 		interrupts = <0 44 0>, <0 45 0>;
+		clocks = <&clock 346>;
+		clock-names = "rtc";
 		status = "disabled";
 	};
 
@@ -105,6 +109,8 @@
 		compatible = "samsung,s5pv210-keypad";
 		reg = <0x100A0000 0x100>;
 		interrupts = <0 109 0>;
+		clocks = <&clock 347>;
+		clock-names = "keypad";
 		status = "disabled";
 	};
 
@@ -112,6 +118,8 @@
 		compatible = "samsung,exynos4210-sdhci";
 		reg = <0x12510000 0x100>;
 		interrupts = <0 73 0>;
+		clocks = <&clock 297>, <&clock 145>;
+		clock-names = "hsmmc", "mmc_busclk.2";
 		status = "disabled";
 	};
 
@@ -119,6 +127,8 @@
 		compatible = "samsung,exynos4210-sdhci";
 		reg = <0x12520000 0x100>;
 		interrupts = <0 74 0>;
+		clocks = <&clock 298>, <&clock 146>;
+		clock-names = "hsmmc", "mmc_busclk.2";
 		status = "disabled";
 	};
 
@@ -126,6 +136,8 @@
 		compatible = "samsung,exynos4210-sdhci";
 		reg = <0x12530000 0x100>;
 		interrupts = <0 75 0>;
+		clocks = <&clock 299>, <&clock 147>;
+		clock-names = "hsmmc", "mmc_busclk.2";
 		status = "disabled";
 	};
 
@@ -133,6 +145,8 @@
 		compatible = "samsung,exynos4210-sdhci";
 		reg = <0x12540000 0x100>;
 		interrupts = <0 76 0>;
+		clocks = <&clock 300>, <&clock 148>;
+		clock-names = "hsmmc", "mmc_busclk.2";
 		status = "disabled";
 	};
 
@@ -148,6 +162,8 @@
 		compatible = "samsung,exynos4210-uart";
 		reg = <0x13800000 0x100>;
 		interrupts = <0 52 0>;
+		clocks = <&clock 312>, <&clock 151>;
+		clock-names = "uart", "clk_uart_baud0";
 		status = "disabled";
 	};
 
@@ -155,6 +171,8 @@
 		compatible = "samsung,exynos4210-uart";
 		reg = <0x13810000 0x100>;
 		interrupts = <0 53 0>;
+		clocks = <&clock 313>, <&clock 152>;
+		clock-names = "uart", "clk_uart_baud0";
 		status = "disabled";
 	};
 
@@ -162,6 +180,8 @@
 		compatible = "samsung,exynos4210-uart";
 		reg = <0x13820000 0x100>;
 		interrupts = <0 54 0>;
+		clocks = <&clock 314>, <&clock 153>;
+		clock-names = "uart", "clk_uart_baud0";
 		status = "disabled";
 	};
 
@@ -169,6 +189,8 @@
 		compatible = "samsung,exynos4210-uart";
 		reg = <0x13830000 0x100>;
 		interrupts = <0 55 0>;
+		clocks = <&clock 315>, <&clock 154>;
+		clock-names = "uart", "clk_uart_baud0";
 		status = "disabled";
 	};
 
@@ -178,6 +200,8 @@
 		compatible = "samsung,s3c2440-i2c";
 		reg = <0x13860000 0x100>;
 		interrupts = <0 58 0>;
+		clocks = <&clock 317>;
+		clock-names = "i2c";
 		status = "disabled";
 	};
 
@@ -187,6 +211,8 @@
 		compatible = "samsung,s3c2440-i2c";
 		reg = <0x13870000 0x100>;
 		interrupts = <0 59 0>;
+		clocks = <&clock 318>;
+		clock-names = "i2c";
 		status = "disabled";
 	};
 
@@ -196,6 +222,8 @@
 		compatible = "samsung,s3c2440-i2c";
 		reg = <0x13880000 0x100>;
 		interrupts = <0 60 0>;
+		clocks = <&clock 319>;
+		clock-names = "i2c";
 		status = "disabled";
 	};
 
@@ -205,6 +233,8 @@
 		compatible = "samsung,s3c2440-i2c";
 		reg = <0x13890000 0x100>;
 		interrupts = <0 61 0>;
+		clocks = <&clock 320>;
+		clock-names = "i2c";
 		status = "disabled";
 	};
 
@@ -214,6 +244,8 @@
 		compatible = "samsung,s3c2440-i2c";
 		reg = <0x138A0000 0x100>;
 		interrupts = <0 62 0>;
+		clocks = <&clock 321>;
+		clock-names = "i2c";
 		status = "disabled";
 	};
 
@@ -223,6 +255,8 @@
 		compatible = "samsung,s3c2440-i2c";
 		reg = <0x138B0000 0x100>;
 		interrupts = <0 63 0>;
+		clocks = <&clock 322>;
+		clock-names = "i2c";
 		status = "disabled";
 	};
 
@@ -232,6 +266,8 @@
 		compatible = "samsung,s3c2440-i2c";
 		reg = <0x138C0000 0x100>;
 		interrupts = <0 64 0>;
+		clocks = <&clock 323>;
+		clock-names = "i2c";
 		status = "disabled";
 	};
 
@@ -241,6 +277,8 @@
 		compatible = "samsung,s3c2440-i2c";
 		reg = <0x138D0000 0x100>;
 		interrupts = <0 65 0>;
+		clocks = <&clock 324>;
+		clock-names = "i2c";
 		status = "disabled";
 	};
 
@@ -252,6 +290,8 @@
 		rx-dma-channel = <&pdma0 6>; /* preliminary */
 		#address-cells = <1>;
 		#size-cells = <0>;
+		clocks = <&clock 327>, <&clock 159>;
+		clock-names = "spi", "spi_busclk0";
 		status = "disabled";
 	};
 
@@ -263,6 +303,8 @@
 		rx-dma-channel = <&pdma1 6>; /* preliminary */
 		#address-cells = <1>;
 		#size-cells = <0>;
+		clocks = <&clock 328>, <&clock 160>;
+		clock-names = "spi", "spi_busclk0";
 		status = "disabled";
 	};
 
@@ -274,6 +316,8 @@
 		rx-dma-channel = <&pdma0 8>; /* preliminary */
 		#address-cells = <1>;
 		#size-cells = <0>;
+		clocks = <&clock 329>, <&clock 161>;
+		clock-names = "spi", "spi_busclk0";
 		status = "disabled";
 	};
 
@@ -288,18 +332,24 @@
 			compatible = "arm,pl330", "arm,primecell";
 			reg = <0x12680000 0x1000>;
 			interrupts = <0 35 0>;
+			clocks = <&clock 292>;
+			clock-names = "apb_pclk";
 		};
 
 		pdma1: pdma at 12690000 {
 			compatible = "arm,pl330", "arm,primecell";
 			reg = <0x12690000 0x1000>;
 			interrupts = <0 36 0>;
+			clocks = <&clock 293>;
+			clock-names = "apb_pclk";
 		};
 
 		mdma1: mdma at 12850000 {
 			compatible = "arm,pl330", "arm,primecell";
 			reg = <0x12850000 0x1000>;
 			interrupts = <0 34 0>;
+			clocks = <&clock 279>;
+			clock-names = "apb_pclk";
 		};
 	};
 };
arch/arm/boot/dts/exynos4210.dtsi +2 -0
index 6b25095..072d3b2 100644
@@ -55,6 +55,8 @@
 		interrupt-parent = <&mct_map>;
 		interrupts = <0 0>, <1 0>, <2 0>, <3 0>,
 			     <4 0>, <5 0>;
+		clocks = <&clock 3>, <&clock 344>;
+		clock-names = "fin_pll", "mct";
 
 		mct_map: mct-map {
 			#interrupt-cells = <2>;
arch/arm/boot/dts/exynos4412.dtsi +2 -0
index 821c9fd..1ecc28d 100644
@@ -34,6 +34,8 @@
 		interrupt-parent = <&mct_map>;
 		interrupts = <0 0>, <1 0>, <2 0>, <3 0>,
 			     <4 0>, <5 0>, <6 0>, <7 0>;
+		clocks = <&clock 3>, <&clock 344>;
+		clock-names = "fin_pll", "mct";
 
 		mct_map: mct-map {
 			#interrupt-cells = <2>;
Signature · 1 line
1.7.5.4
#23 lore raw

PATCH v6 14/16 ARM: dts: add clock provider information for all controllers in Exynos5250 SoC

In reply to Thomas Abraham

For all supported peripheral controllers on Exynos5250, add clock lookup information.

---
 arch/arm/boot/dts/exynos5250.dtsi |   72 +++++++++++++++++++++++++++++++++++++
 1 files changed, 72 insertions(+), 0 deletions(-)
arch/arm/boot/dts/exynos5250.dtsi +72 -0
index d3eae4e..d7a49a3 100644
@@ -98,6 +98,8 @@
 		interrupt-parent = <&mct_map>;
 		interrupts = <0 0>, <1 0>, <2 0>, <3 0>,
 			     <4 0>, <5 0>;
+		clocks = <&clock 1>, <&clock 335>;
+		clock-names = "fin_pll", "mct";
 
 		mct_map: mct-map {
 			#interrupt-cells = <2>;
@@ -122,6 +124,8 @@
 		compatible = "samsung,s3c2410-wdt";
 		reg = <0x101D0000 0x100>;
 		interrupts = <0 42 0>;
+		clocks = <&clock 336>;
+		clock-names = "watchdog";
 	};
 
 	mfc: codec at 11000000 {
@@ -135,42 +139,56 @@
 		compatible = "samsung,s3c6410-rtc";
 		reg = <0x101E0000 0x100>;
 		interrupts = <0 43 0>, <0 44 0>;
+		clocks = <&clock 337>;
+		clock-names = "rtc";
 	};
 
 	tmu at 10060000 {
 		compatible = "samsung,exynos5250-tmu";
 		reg = <0x10060000 0x100>;
 		interrupts = <0 65 0>;
+		clocks = <&clock 338>;
+		clock-names = "tmu_apbif";
 	};
 
 	serial at 12C00000 {
 		compatible = "samsung,exynos4210-uart";
 		reg = <0x12C00000 0x100>;
 		interrupts = <0 51 0>;
+		clocks = <&clock 289>, <&clock 146>;
+		clock-names = "uart", "clk_uart_baud0";
 	};
 
 	serial at 12C10000 {
 		compatible = "samsung,exynos4210-uart";
 		reg = <0x12C10000 0x100>;
 		interrupts = <0 52 0>;
+		clocks = <&clock 290>, <&clock 147>;
+		clock-names = "uart", "clk_uart_baud0";
 	};
 
 	serial at 12C20000 {
 		compatible = "samsung,exynos4210-uart";
 		reg = <0x12C20000 0x100>;
 		interrupts = <0 53 0>;
+		clocks = <&clock 291>, <&clock 148>;
+		clock-names = "uart", "clk_uart_baud0";
 	};
 
 	serial at 12C30000 {
 		compatible = "samsung,exynos4210-uart";
 		reg = <0x12C30000 0x100>;
 		interrupts = <0 54 0>;
+		clocks = <&clock 292>, <&clock 149>;
+		clock-names = "uart", "clk_uart_baud0";
 	};
 
 	sata at 122F0000 {
 		compatible = "samsung,exynos5-sata-ahci";
 		reg = <0x122F0000 0x1ff>;
 		interrupts = <0 115 0>;
+		clocks = <&clock 277>, <&clock 143>;
+		clock-names = "sata", "sclk_sata";
 	};
 
 	sata-phy at 12170000 {
@@ -184,6 +202,8 @@
 		interrupts = <0 56 0>;
 		#address-cells = <1>;
 		#size-cells = <0>;
+		clocks = <&clock 294>;
+		clock-names = "i2c";
 	};
 
 	i2c_1: i2c at 12C70000 {
@@ -192,6 +212,8 @@
 		interrupts = <0 57 0>;
 		#address-cells = <1>;
 		#size-cells = <0>;
+		clocks = <&clock 295>;
+		clock-names = "i2c";
 	};
 
 	i2c_2: i2c at 12C80000 {
@@ -200,6 +222,8 @@
 		interrupts = <0 58 0>;
 		#address-cells = <1>;
 		#size-cells = <0>;
+		clocks = <&clock 296>;
+		clock-names = "i2c";
 	};
 
 	i2c_3: i2c at 12C90000 {
@@ -208,6 +232,8 @@
 		interrupts = <0 59 0>;
 		#address-cells = <1>;
 		#size-cells = <0>;
+		clocks = <&clock 297>;
+		clock-names = "i2c";
 	};
 
 	i2c_4: i2c at 12CA0000 {
@@ -216,6 +242,8 @@
 		interrupts = <0 60 0>;
 		#address-cells = <1>;
 		#size-cells = <0>;
+		clocks = <&clock 298>;
+		clock-names = "i2c";
 	};
 
 	i2c_5: i2c at 12CB0000 {
@@ -224,6 +252,8 @@
 		interrupts = <0 61 0>;
 		#address-cells = <1>;
 		#size-cells = <0>;
+		clocks = <&clock 299>;
+		clock-names = "i2c";
 	};
 
 	i2c_6: i2c at 12CC0000 {
@@ -232,6 +262,8 @@
 		interrupts = <0 62 0>;
 		#address-cells = <1>;
 		#size-cells = <0>;
+		clocks = <&clock 300>;
+		clock-names = "i2c";
 	};
 
 	i2c_7: i2c at 12CD0000 {
@@ -240,6 +272,8 @@
 		interrupts = <0 63 0>;
 		#address-cells = <1>;
 		#size-cells = <0>;
+		clocks = <&clock 301>;
+		clock-names = "i2c";
 	};
 
 	i2c_8: i2c at 12CE0000 {
@@ -248,6 +282,8 @@
 		interrupts = <0 64 0>;
 		#address-cells = <1>;
 		#size-cells = <0>;
+		clocks = <&clock 302>;
+		clock-names = "i2c";
 	};
 
 	i2c at 121D0000 {
@@ -255,6 +291,8 @@
                 reg = <0x121D0000 0x100>;
                 #address-cells = <1>;
                 #size-cells = <0>;
+		clocks = <&clock 288>;
+		clock-names = "i2c";
 	};
 
 	spi_0: spi at 12d20000 {
@@ -265,6 +303,8 @@
 		rx-dma-channel = <&pdma0 4>; /* preliminary */
 		#address-cells = <1>;
 		#size-cells = <0>;
+		clocks = <&clock 304>, <&clock 154>;
+		clock-names = "spi", "spi_busclk0";
 	};
 
 	spi_1: spi at 12d30000 {
@@ -275,6 +315,8 @@
 		rx-dma-channel = <&pdma1 4>; /* preliminary */
 		#address-cells = <1>;
 		#size-cells = <0>;
+		clocks = <&clock 305>, <&clock 155>;
+		clock-names = "spi", "spi_busclk0";
 	};
 
 	spi_2: spi at 12d40000 {
@@ -285,6 +327,8 @@
 		rx-dma-channel = <&pdma0 6>; /* preliminary */
 		#address-cells = <1>;
 		#size-cells = <0>;
+		clocks = <&clock 306>, <&clock 156>;
+		clock-names = "spi", "spi_busclk0";
 	};
 
 	dwmmc_0: dwmmc0 at 12200000 {
@@ -293,6 +337,8 @@
 		interrupts = <0 75 0>;
 		#address-cells = <1>;
 		#size-cells = <0>;
+		clocks = <&clock 280>, <&clock 139>;
+		clock-names = "biu", "ciu";
 	};
 
 	dwmmc_1: dwmmc1 at 12210000 {
@@ -301,6 +347,8 @@
 		interrupts = <0 76 0>;
 		#address-cells = <1>;
 		#size-cells = <0>;
+		clocks = <&clock 281>, <&clock 140>;
+		clock-names = "biu", "ciu";
 	};
 
 	dwmmc_2: dwmmc2 at 12220000 {
@@ -309,6 +357,8 @@
 		interrupts = <0 77 0>;
 		#address-cells = <1>;
 		#size-cells = <0>;
+		clocks = <&clock 282>, <&clock 141>;
+		clock-names = "biu", "ciu";
 	};
 
 	dwmmc_3: dwmmc3 at 12230000 {
@@ -317,6 +367,8 @@
 		interrupts = <0 78 0>;
 		#address-cells = <1>;
 		#size-cells = <0>;
+		clocks = <&clock 283>, <&clock 142>;
+		clock-names = "biu", "ciu";
 	};
 
 	usb at 12110000 {
@@ -342,24 +394,32 @@
 			compatible = "arm,pl330", "arm,primecell";
 			reg = <0x121A0000 0x1000>;
 			interrupts = <0 34 0>;
+			clocks = <&clock 275>;
+			clock-names = "apb_pclk";
 		};
 
 		pdma1: pdma at 121B0000 {
 			compatible = "arm,pl330", "arm,primecell";
 			reg = <0x121B0000 0x1000>;
 			interrupts = <0 35 0>;
+			clocks = <&clock 276>;
+			clock-names = "apb_pclk";
 		};
 
 		mdma0: mdma at 10800000 {
 			compatible = "arm,pl330", "arm,primecell";
 			reg = <0x10800000 0x1000>;
 			interrupts = <0 33 0>;
+			clocks = <&clock 271>;
+			clock-names = "apb_pclk";
 		};
 
 		mdma1: mdma at 11C10000 {
 			compatible = "arm,pl330", "arm,primecell";
 			reg = <0x11C10000 0x1000>;
 			interrupts = <0 124 0>;
+			clocks = <&clock 271>;
+			clock-names = "apb_pclk";
 		};
 	};
 
@@ -616,6 +676,8 @@
 		reg = <0x13e00000 0x1000>;
 		interrupts = <0 85 0>;
 		samsung,power-domain = <&pd_gsc>;
+		clocks = <&clock 256>;
+		clock-names = "gscl";
 	};
 
 	gsc_1:  gsc at 0x13e10000 {
@@ -623,6 +685,8 @@
 		reg = <0x13e10000 0x1000>;
 		interrupts = <0 86 0>;
 		samsung,power-domain = <&pd_gsc>;
+		clocks = <&clock 257>;
+		clock-names = "gscl";
 	};
 
 	gsc_2:  gsc at 0x13e20000 {
@@ -630,6 +694,8 @@
 		reg = <0x13e20000 0x1000>;
 		interrupts = <0 87 0>;
 		samsung,power-domain = <&pd_gsc>;
+		clocks = <&clock 258>;
+		clock-names = "gscl";
 	};
 
 	gsc_3:  gsc at 0x13e30000 {
@@ -637,12 +703,18 @@
 		reg = <0x13e30000 0x1000>;
 		interrupts = <0 88 0>;
 		samsung,power-domain = <&pd_gsc>;
+		clocks = <&clock 259>;
+		clock-names = "gscl";
 	};
 
 	hdmi {
 		compatible = "samsung,exynos5-hdmi";
 		reg = <0x14530000 0x70000>;
 		interrupts = <0 95 0>;
+		clocks = <&clock 333>, <&clock 136>, <&clock 137>,
+				<&clock 333>, <&clock 333>;
+		clock-names = "hdmi", "sclk_hdmi", "sclk_pixel",
+				"sclk_hdmiphy", "hdmiphy";
 	};
 
 	mixer: mixer {
Signature · 1 line
1.7.5.4
#24 lore raw

PATCH v6 15/16 ARM: dts: add clock provider information for all controllers in Exynos5440 SoC

In reply to Thomas Abraham

For all supported peripheral controllers on Exynos5440, add clock lookup information.

---
 arch/arm/boot/dts/exynos5440.dtsi |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
arch/arm/boot/dts/exynos5440.dtsi +18 -0
index f5834d0..a54c4ab 100644
@@ -65,12 +65,16 @@
 		compatible = "samsung,exynos4210-uart";
 		reg = <0xB0000 0x1000>;
 		interrupts = <0 2 0>;
+		clocks = <&clock 21>, <&clock 21>;
+		clock-names = "uart", "clk_uart_baud0";
 	};
 
 	serial at C0000 {
 		compatible = "samsung,exynos4210-uart";
 		reg = <0xC0000 0x1000>;
 		interrupts = <0 3 0>;
+		clocks = <&clock 21>, <&clock 21>;
+		clock-names = "uart", "clk_uart_baud0";
 	};
 
 	spi {
@@ -81,6 +85,8 @@
 		rx-dma-channel = <&pdma0 4>; /* preliminary */
 		#address-cells = <1>;
 		#size-cells = <0>;
+		clocks = <&clock 21>, <&clock 16>;
+		clock-names = "spi", "spi_busclk0";
 	};
 
 	pinctrl {
@@ -113,6 +119,8 @@
 		interrupts = <0 5 0>;
 		#address-cells = <1>;
 		#size-cells = <0>;
+		clocks = <&clock 21>;
+		clock-names = "i2c";
 	};
 
 	i2c at 100000 {
@@ -121,12 +129,16 @@
 		interrupts = <0 6 0>;
 		#address-cells = <1>;
 		#size-cells = <0>;
+		clocks = <&clock 21>;
+		clock-names = "i2c";
 	};
 
 	watchdog {
 		compatible = "samsung,s3c2410-wdt";
 		reg = <0x110000 0x1000>;
 		interrupts = <0 1 0>;
+		clocks = <&clock 21>;
+		clock-names = "watchdog";
 	};
 
 	amba {
@@ -140,12 +152,16 @@
 			compatible = "arm,pl330", "arm,primecell";
 			reg = <0x120000 0x1000>;
 			interrupts = <0 34 0>;
+			clocks = <&clock 21>;
+			clock-names = "apb_pclk";
 		};
 
 		pdma1: pdma at 121B0000 {
 			compatible = "arm,pl330", "arm,primecell";
 			reg = <0x121000 0x1000>;
 			interrupts = <0 35 0>;
+			clocks = <&clock 21>;
+			clock-names = "apb_pclk";
 		};
 	};
 
@@ -153,5 +169,7 @@
 		compatible = "samsung,s3c6410-rtc";
 		reg = <0x130000 0x1000>;
 		interrupts = <0 17 0>, <0 16 0>;
+		clocks = <&clock 21>;
+		clock-names = "rtc";
 	};
 };
Signature · 1 line
1.7.5.4
#25 lore raw

PATCH v6 16/16 ARM: dts: add board specific fixed rate clock nodes for Exynos based platforms

In reply to Thomas Abraham

The clock frequency of xxti and xusbxti clocks is dependent on the frequency of the on-board oscillator that is used to generate these clocks. So allow the frequency of these clocks to be specfied from device tree.

---
 arch/arm/boot/dts/exynos4210-origen.dts   |   12 ++++++++++++
 arch/arm/boot/dts/exynos4210-smdkv310.dts |   12 ++++++++++++
 arch/arm/boot/dts/exynos4210-trats.dts    |   12 ++++++++++++
 arch/arm/boot/dts/exynos4412-odroidx.dts  |   12 ++++++++++++
 arch/arm/boot/dts/exynos4412-origen.dts   |   12 ++++++++++++
 arch/arm/boot/dts/exynos4412-smdk4412.dts |   12 ++++++++++++
 arch/arm/boot/dts/exynos5250-arndale.dts  |    7 +++++++
 arch/arm/boot/dts/exynos5250-smdk5250.dts |    7 +++++++
 arch/arm/boot/dts/exynos5250-snow.dts     |    7 +++++++
 arch/arm/boot/dts/exynos5440-ssdk5440.dts |    7 +++++++
 10 files changed, 100 insertions(+), 0 deletions(-)
arch/arm/boot/dts/exynos4210-origen.dts +12 -0
index 052606b..1b30bc8 100644
@@ -127,4 +127,16 @@
 			linux,default-trigger = "heartbeat";
 		};
 	};
+
+	fixed-rate-clocks {
+		xxti {
+			compatible = "samsung,clock-xxti";
+			clock-frequency = <0>;
+		};
+
+		xusbxti {
+			compatible = "samsung,clock-xusbxti";
+			clock-frequency = <24000000>;
+		};
+	};
 };
arch/arm/boot/dts/exynos4210-smdkv310.dts +12 -0
index 2b1e03a..f52c86e 100644
@@ -195,4 +195,16 @@
 			};
 		};
 	};
+
+	fixed-rate-clocks {
+		xxti {
+			compatible = "samsung,clock-xxti";
+			clock-frequency = <12000000>;
+		};
+
+		xusbxti {
+			compatible = "samsung,clock-xusbxti";
+			clock-frequency = <24000000>;
+		};
+	};
 };
arch/arm/boot/dts/exynos4210-trats.dts +12 -0
index c346b64..9a14484 100644
@@ -289,4 +289,16 @@
 			};
 		};
 	};
+
+	fixed-rate-clocks {
+		xxti {
+			compatible = "samsung,clock-xxti";
+			clock-frequency = <0>;
+		};
+
+		xusbxti {
+			compatible = "samsung,clock-xusbxti";
+			clock-frequency = <24000000>;
+		};
+	};
 };
arch/arm/boot/dts/exynos4412-odroidx.dts +12 -0
index 0084d95..15dc0a3 100644
@@ -94,4 +94,16 @@
 	serial at 13830000 {
 		status = "okay";
 	};
+
+	fixed-rate-clocks {
+		xxti {
+			compatible = "samsung,clock-xxti";
+			clock-frequency = <0>;
+		};
+
+		xusbxti {
+			compatible = "samsung,clock-xusbxti";
+			clock-frequency = <24000000>;
+		};
+	};
 };
arch/arm/boot/dts/exynos4412-origen.dts +12 -0
index 31e14c4..a944611 100644
@@ -415,4 +415,16 @@
 			};
 		};
 	};
+
+	fixed-rate-clocks {
+		xxti {
+			compatible = "samsung,clock-xxti";
+			clock-frequency = <0>;
+		};
+
+		xusbxti {
+			compatible = "samsung,clock-xusbxti";
+			clock-frequency = <24000000>;
+		};
+	};
 };
arch/arm/boot/dts/exynos4412-smdk4412.dts +12 -0
index 6ae4276..874beea 100644
@@ -55,4 +55,16 @@
 	serial at 13830000 {
 		status = "okay";
 	};
+
+	fixed-rate-clocks {
+		xxti {
+			compatible = "samsung,clock-xxti";
+			clock-frequency = <0>;
+		};
+
+		xusbxti {
+			compatible = "samsung,clock-xusbxti";
+			clock-frequency = <24000000>;
+		};
+	};
 };
arch/arm/boot/dts/exynos5250-arndale.dts +7 -0
index 63572f9..5de019c 100644
@@ -119,4 +119,11 @@
 	spi_2: spi at 12d40000 {
 		status = "disabled";
 	};
+
+	fixed-rate-clocks {
+		xxti {
+			compatible = "samsung,clock-xxti";
+			clock-frequency = <24000000>;
+		};
+	};
 };
arch/arm/boot/dts/exynos5250-smdk5250.dts +7 -0
index 1391c31..f77bf3a 100644
@@ -217,4 +217,11 @@
 		samsung,link-rate = <0x0a>;
 		samsung,lane-count = <4>;
 	};
+
+	fixed-rate-clocks {
+		xxti {
+			compatible = "samsung,clock-xxti";
+			clock-frequency = <24000000>;
+		};
+	};
 };
arch/arm/boot/dts/exynos5250-snow.dts +7 -0
index 47b6b84..babd9f9 100644
@@ -44,4 +44,11 @@
 	usb at 12110000 {
 		samsung,vbus-gpio = <&gpx1 1 1 3 3>;
 	};
+
+	fixed-rate-clocks {
+		xxti {
+			compatible = "samsung,clock-xxti";
+			clock-frequency = <24000000>;
+		};
+	};
 };
arch/arm/boot/dts/exynos5440-ssdk5440.dts +7 -0
index ee60c57..a21eb4c 100644
@@ -27,4 +27,11 @@
 	spi {
 		status = "disabled";
 	};
+
+	fixed-rate-clocks {
+		xtal {
+			compatible = "samsung,clock-xtal";
+			clock-frequency = <50000000>;
+		};
+	};
 };
Signature · 1 line
1.7.5.4
#26 lore raw

PATCH v6 16/16 ARM: dts: add board specific fixed rate clock nodes for Exynos based platforms

Hi,

Quoted 29 lines · Thomas Abraham

The clock frequency of xxti and xusbxti clocks is dependent on the frequency of the on-board oscillator that is used to generate these clocks. So allow the frequency of these clocks to be specfied from device tree.

---
 arch/arm/boot/dts/exynos4210-origen.dts   |   12 ++++++++++++
 arch/arm/boot/dts/exynos4210-smdkv310.dts |   12 ++++++++++++
 arch/arm/boot/dts/exynos4210-trats.dts    |   12 ++++++++++++
 arch/arm/boot/dts/exynos4412-odroidx.dts  |   12 ++++++++++++
 arch/arm/boot/dts/exynos4412-origen.dts   |   12 ++++++++++++
 arch/arm/boot/dts/exynos4412-smdk4412.dts |   12 ++++++++++++
 arch/arm/boot/dts/exynos5250-arndale.dts  |    7 +++++++
 arch/arm/boot/dts/exynos5250-smdk5250.dts |    7 +++++++
 arch/arm/boot/dts/exynos5250-snow.dts     |    7 +++++++
 arch/arm/boot/dts/exynos5440-ssdk5440.dts |    7 +++++++
 10 files changed, 100 insertions(+), 0 deletions(-)
arch/arm/boot/dts/exynos4210-origen.dts +2 -0
index 052606b..1b30bc8 100644
@@ -127,4 +127,16 @@
                        linux,default-trigger = "heartbeat";
                };
        };
+
+       fixed-rate-clocks {

arch/arm/boot/dts/exynos4210-origen.dts line 141

Quoted 10 lines
arch/arm/boot/dts/exynos4210-origen.dts +10 -0
+               xxti {
+                       compatible = "samsung,clock-xxti";
+                       clock-frequency = <0>;
+               };
+
+               xusbxti {
+                       compatible = "samsung,clock-xusbxti";
+                       clock-frequency = <24000000>;
+               };
+       };

Looks like xxti = 0 and xusbxti = 24MHz is the common frequencies on nearly all boards. It probably makes sense to add that to the defaults in dtsi, and override on the boards where it isn't the case. Saves some boilerplate code in the .dts files.

-Olof

#27 lore raw

v6 cover clk: exynos4/5: migrate to common clock framework

In reply to Thomas Abraham

Quoting Thomas Abraham (2013-02-18 00:21:10)

Quoted 11 lines

Changes since v5:
- Squashed several Exynos4 fixes patch from Tomasz Figa
- Included support for Exynos5250 and Exynos5440, thus converting all Exynos4 and Exynos5 platforms to common clock framework.
- Depends on the following patch series.
- http://www.mail-archive.com/linux-samsung-soc at vger.kernel.org/msg15849.html
- http://www.mail-archive.com/linux-samsung-soc at vger.kernel.org/msg15852.html

Changes since v4:
- Rebased to linux-3.8-rc1.

Quoted 8 lines

Changes since v3:
- Includes changes suggested by Tomasz Figa <[email protected]>

This patch series migrates the Samsung Exynos4/5 SoC clock code to adopt the common clock framework. The use of Samsung specific clock structures has been removed and all board support code has been updated. imx-style of clock registration and lookup has been adopted for device tree based exynos4/5 platforms.

Thomas,

Are you planning a V7 series which includes the clock alias bits from patch #1?

Regards,
Mike

#28 lore raw

v6 cover clk: exynos4/5: migrate to common clock framework

Am Dienstag, 19. M?rz 2013, 19:49:38 schrieb Mike Turquette:

Quoted 28 lines

Quoting Thomas Abraham (2013-02-18 00:21:10)

Quoted 17 lines

Changes since v5:
- Squashed several Exynos4 fixes patch from Tomasz Figa
- Included support for Exynos5250 and Exynos5440, thus converting all

Exynos4 and Exynos5 platforms to common clock framework.

- Depends on the following patch series.

-
http://www.mail-archive.com/linux-samsung-soc at vger.kernel.org/msg15849 .html -
http://www.mail-archive.com/linux-samsung-soc at vger.kernel.org/msg15852 .html

Changes since v4:
- Rebased to linux-3.8-rc1.

Quoted 8 lines

Changes since v3:
- Includes changes suggested by Tomasz Figa <[email protected]>

This patch series migrates the Samsung Exynos4/5 SoC clock code to adopt the common clock framework. The use of Samsung specific clock structures has been removed and all board support code has been updated. imx-style of clock registration and lookup has been adopted for device tree based exynos4/5 platforms.

Quoted 4 lines

Thomas,

Are you planning a V7 series which includes the clock alias bits from patch #1?

Kukjin has already applied this series into the linux-samsung tree [0].

The alias changes are available in the series "clk: samsung: pm fixes and multiple aliases" from last wednesday to on top, which you should hopefully also have received.

This v2 series implements the changes discussed in the previous v1 "clk: samsung: small fixes and enhancements" from 2013-03-12, but didn't get any responses yet.

Heiko

[0] https://git.kernel.org/cgit/linux/kernel/git/kgene/linux-samsung.git/log/?h=next/clk-exynos

#29 lore raw

v6 cover clk: exynos4/5: migrate to common clock framework

Quoting Heiko St?bner (2013-03-19 14:12:16)

Quoted 29 lines

Am Dienstag, 19. M?rz 2013, 19:49:38 schrieb Mike Turquette:

Quoted 28 lines

Quoting Thomas Abraham (2013-02-18 00:21:10)

Quoted 25 lines

Changes since v5:
- Squashed several Exynos4 fixes patch from Tomasz Figa
- Included support for Exynos5250 and Exynos5440, thus converting all

Exynos4 and Exynos5 platforms to common clock framework.

- Depends on the following patch series.

-
http://www.mail-archive.com/linux-samsung-soc at vger.kernel.org/msg15849 .html -
http://www.mail-archive.com/linux-samsung-soc at vger.kernel.org/msg15852 .html

Changes since v4:
- Rebased to linux-3.8-rc1.

Changes since v3:
- Includes changes suggested by Tomasz Figa <[email protected]>

This patch series migrates the Samsung Exynos4/5 SoC clock code to adopt the common clock framework. The use of Samsung specific clock structures has been removed and all board support code has been updated. imx-style of clock registration and lookup has been adopted for device tree based exynos4/5 platforms.

Quoted 7 lines
Quoted 4 lines

Thomas,

Are you planning a V7 series which includes the clock alias bits from patch #1?

Kukjin has already applied this series into the linux-samsung tree [0].

That really is too much code to go into drivers/clk without my ACK. I have not made much noise about this in the past but there has been more and more "bonus" code slipping into drivers/clk each merge window. Let's not do that any more.

Regards,
Mike

Quoted 13 lines

The alias changes are available in the series "clk: samsung: pm fixes and multiple aliases" from last wednesday to on top, which you should hopefully also have received.

This v2 series implements the changes discussed in the previous v1 "clk: samsung: small fixes and enhancements" from 2013-03-12, but didn't get any responses yet.

Heiko

[0] https://git.kernel.org/cgit/linux/kernel/git/kgene/linux-samsung.git/log/?h=next/clk-exynos

#30 lore raw

v6 cover clk: exynos4/5: migrate to common clock framework

Quoted 1 line · Mike Turquette

[...]

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

Thomas,

Are you planning a V7 series which includes the clock alias bits from patch #1?

Kukjin has already applied this series into the linux-samsung tree [0].

Thanks, Heiko.

Mike, yes I did, as we discussed before. Since I missed in last window for v3.9, so I merged every common clock stuff for exynos into samsung tree in the early 3.9-rc time for v3.10.

Quoted 6 lines

That really is too much code to go into drivers/clk without my ACK. I have not made much noise about this in the past but there has been more and more "bonus" code slipping into drivers/clk each merge window. Let's not do that any more.

Hmm, I remember you already agreed on previous version, and I thought if any further codes are required, we could do it on top of that.
http://lists.infradead.org/pipermail/linux-arm-kernel/2013-January/143429.html

However, if you don't want current codes to be sent to upstream, let me know, but I don't think it would be better to us though.

Thanks.

- Kukjin

#31 lore raw

v6 cover clk: exynos4/5: migrate to common clock framework

Quoting Kukjin Kim (2013-03-19 17:00:09)

Quoted 16 lines
Quoted 1 line · Mike Turquette

[...]

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

Thomas,

Are you planning a V7 series which includes the clock alias bits from patch #1?

Kukjin has already applied this series into the linux-samsung tree [0].

Thanks, Heiko.

Mike, yes I did, as we discussed before. Since I missed in last window for v3.9, so I merged every common clock stuff for exynos into samsung tree in the early 3.9-rc time for v3.10.

Quoted 1 line
Quoted 9 lines
Quoted 5 lines

That really is too much code to go into drivers/clk without my ACK. I have not made much noise about this in the past but there has been more and more "bonus" code slipping into drivers/clk each merge window. Let's not do that any more.

Hmm, I remember you already agreed on previous version, and I thought if any further codes are required, we could do it on top of that.
http://lists.infradead.org/pipermail/linux-arm-kernel/2013-January/143429.html

In the email you linked to my use of the word "merged" did not imply an ACK. I was asking about merging the two separate exynos4 and exynos5 ccf development efforts together.

Furthermore if I *had* agreed on the previous version it would still have been appropriate to put my Acked-by on those patches, which is clearly missing today.

Quoted 1 line

However, if you don't want current codes to be sent to upstream, let me know, but I don't think it would be better to us though.

No, I am not asking you to revert/drop the patches, but I am using this as a public example.

Regards,
Mike

Quoted 4 lines

Thanks.

- Kukjin

#32 lore raw

v6 cover clk: exynos4/5: migrate to common clock framework

Quoted 27 lines · Mike Turquette

Quoting Kukjin Kim (2013-03-19 17:00:09)

Quoted 7 lines
Quoted 1 line · Mike Turquette

[...]

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Thomas,

Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

Are you planning a V7 series which includes the clock alias bits from patch #1?

Kukjin has already applied this series into the linux-samsung tree [0].

Thanks, Heiko.

Mike, yes I did, as we discussed before. Since I missed in last window for

v3.9, so I merged every common clock stuff for exynos into samsung tree in the early 3.9-rc time for v3.10.

Quoted 8 lines
Quoted 6 lines

That really is too much code to go into drivers/clk without my ACK. I have not made much noise about this in the past but there has been more and more "bonus" code slipping into drivers/clk each merge window. Let's not do that any more.

Hmm, I remember you already agreed on previous version, and I thought if any

Quoted 9 lines

further codes are required, we could do it on top of that.

Quoted 1 line

http://lists.infradead.org/pipermail/linux-arm-kernel/2013-

January/143429.html

Quoted 1 line

In the email you linked to my use of the word "merged" did not imply an ACK. I was asking about merging the two separate exynos4 and exynos5 ccf development efforts together.

OK, I see.

Quoted 4 lines

Furthermore if I *had* agreed on the previous version it would still have been appropriate to put my Acked-by on those patches, which is clearly missing today.

BTW, how about following?

http://www.spinics.net/lists/arm-kernel/msg210266.html

In my understanding, it should be your agreement, it cannot be 'ack' though.

Quoted 6 lines
Quoted 1 line

However, if you don't want current codes to be sent to upstream, let me know,

but I don't think it would be better to us though.

No, I am not asking you to revert/drop the patches, but I am using this as a public example.

What's the 'public example'?

As I linked, you already said 'sounds good to me' on my asking.

- Kukjin

#33 lore raw

v6 cover clk: exynos4/5: migrate to common clock framework

Quoting Kukjin Kim (2013-03-19 21:50:05)

Quoted 43 lines
Quoted 27 lines · Mike Turquette

Quoting Kukjin Kim (2013-03-19 17:00:09)

Quoted 7 lines
Quoted 1 line · Mike Turquette

[...]

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Thomas,

Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

Are you planning a V7 series which includes the clock alias bits from patch #1?

Kukjin has already applied this series into the linux-samsung tree [0].

Thanks, Heiko.

Mike, yes I did, as we discussed before. Since I missed in last window for

v3.9, so I merged every common clock stuff for exynos into samsung tree in the early 3.9-rc time for v3.10.

Quoted 8 lines
Quoted 6 lines

That really is too much code to go into drivers/clk without my ACK. I have not made much noise about this in the past but there has been more and more "bonus" code slipping into drivers/clk each merge window. Let's not do that any more.

Hmm, I remember you already agreed on previous version, and I thought if any

Quoted 9 lines

further codes are required, we could do it on top of that.

Quoted 1 line

http://lists.infradead.org/pipermail/linux-arm-kernel/2013-

January/143429.html

Quoted 1 line

In the email you linked to my use of the word "merged" did not imply an ACK. I was asking about merging the two separate exynos4 and exynos5 ccf development efforts together.

OK, I see.

Quoted 4 lines

Furthermore if I *had* agreed on the previous version it would still have been appropriate to put my Acked-by on those patches, which is clearly missing today.

Quoted 6 lines

BTW, how about following?

http://www.spinics.net/lists/arm-kernel/msg210266.html

In my understanding, it should be your agreement, it cannot be 'ack' though.

I had forgotten about that email from November. Still my ack should have been added. If necessary I'll be painfully explicit in the future about adding my acked-by. It's a simple and good rule to follow.

Thanks,
Mike

Quoted 11 lines
Quoted 6 lines
Quoted 1 line

However, if you don't want current codes to be sent to upstream, let me know,

but I don't think it would be better to us though.

No, I am not asking you to revert/drop the patches, but I am using this as a public example.

What's the 'public example'?

As I linked, you already said 'sounds good to me' on my asking.

- Kukjin

#34 lore raw

v6 cover clk: exynos4/5: migrate to common clock framework

Mike Turquette wrote:

[...]

Quoted 7 lines
Quoted 7 lines
Quoted 5 lines

Furthermore if I *had* agreed on the previous version it would still have been appropriate to put my Acked-by on those patches, which is clearly missing today.

BTW, how about following?

Quoted 7 lines
Quoted 4 lines

http://www.spinics.net/lists/arm-kernel/msg210266.html

In my understanding, it should be your agreement, it cannot be 'ack' though.

I had forgotten about that email from November. Still my ack should have been added. If necessary I'll be painfully explicit in the future

Agreed.

Quoted 2 lines

about adding my acked-by. It's a simple and good rule to follow.

Yeah, I know. So if you want to add your ack on drivers/clk stuff for this series in samsung tree, please let me know.

Thanks, Mike.

- Kukjin

#35 lore raw

v6 cover clk: exynos4/5: migrate to common clock framework

Quoting Kukjin Kim (2013-03-21 16:26:24)

Quoted 15 lines

Mike Turquette wrote:

[...]

Quoted 12 lines
Quoted 11 lines
Quoted 5 lines

Furthermore if I *had* agreed on the previous version it would still have been appropriate to put my Acked-by on those patches, which is clearly missing today.

BTW, how about following?

http://www.spinics.net/lists/arm-kernel/msg210266.html

In my understanding, it should be your agreement, it cannot be 'ack' though.

Quoted 9 lines
Quoted 2 lines

I had forgotten about that email from November. Still my ack should have been added. If necessary I'll be painfully explicit in the future

Agreed.

Quoted 2 lines

about adding my acked-by. It's a simple and good rule to follow.

Yeah, I know. So if you want to add your ack on drivers/clk stuff for this series in samsung tree, please let me know.

The patches are in pretty good shape. Please add my ack if you are able to rebase comfortably. But if rebasing causes you and your downstream users a lot of pain then don't do it.

Regards,
Mike

Quoted 3 lines

Thanks, Mike.

- Kukjin

#36 lore raw

v6 cover clk: exynos4/5: migrate to common clock framework

Mike Turquette wrote:

[...]

Quoted 5 lines
Quoted 1 line

Yeah, I know. So if you want to add your ack on drivers/clk stuff for

this series in samsung tree, please let me know.

Quoted 1 line

The patches are in pretty good shape. Please add my ack if you are able

OK, I will.

Quoted 3 lines

to rebase comfortably. But if rebasing causes you and your downstream users a lot of pain then don't do it.

Yes it can be, but it can be handled easily because of no-changing codes.

Note, please check Heiko's follow-up clk/samsung patches.
<http://comments.gmane.org/gmane.linux.kernel.samsung-soc/16817>

I'm fine on that and if you're ok, I'd like to take that with this series.

Thanks.

- Kukjin