Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1661242 > unrolled thread
| Started by | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| First post | 2017-06-08 15:50 +0200 |
| Last post | 2017-06-20 11:30 +0200 |
| Articles | 7 — 5 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] arm: aspeed: Add clock-names property to timer node Daniel Lezcano <daniel.lezcano@linaro.org> - 2017-06-08 15:50 +0200
Re: [PATCH] arm: aspeed: Add clock-names property to timer node Arnd Bergmann <arnd@arndb.de> - 2017-06-08 16:40 +0200
[PATCH] arm: aspeed: Add Aspeed board file with clocksource devicetree fixup Andrew Jeffery <andrew@aj.id.au> - 2017-06-09 09:40 +0200
Re: [PATCH] arm: aspeed: Add Aspeed board file with clocksource devicetree fixup Arnd Bergmann <arnd@arndb.de> - 2017-06-09 11:20 +0200
Re: [PATCH] arm: aspeed: Add Aspeed board file with clocksource devicetree fixup Andrew Jeffery <andrew@aj.id.au> - 2017-06-09 15:00 +0200
Re: [PATCH] arm: aspeed: Add Aspeed board file with clocksource devicetree fixup Linus Walleij <linus.walleij@linaro.org> - 2017-06-20 10:10 +0200
Re: [PATCH] arm: aspeed: Add Aspeed board file with clocksource devicetree fixup Jonas Jensen <jonas.jensen@gmail.com> - 2017-06-20 11:30 +0200
| From | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| Date | 2017-06-08 15:50 +0200 |
| Subject | Re: [PATCH] arm: aspeed: Add clock-names property to timer node |
| Message-ID | <tQ5Z2-4WL-63@gated-at.bofh.it> |
On Wed, Jun 07, 2017 at 04:29:50PM +0200, Arnd Bergmann wrote: > On Wed, Jun 7, 2017 at 2:52 PM, Daniel Lezcano > <daniel.lezcano@linaro.org> wrote: > > On Tue, Jun 06, 2017 at 11:41:11AM +0200, Arnd Bergmann wrote: > >> On Mon, Jun 5, 2017 at 10:59 AM, Joel Stanley <joel@jms.id.au> wrote: > >> > On Mon, Jun 5, 2017 at 5:18 PM, Andrew Jeffery <andrew@aj.id.au> wrote: > >> >> The merging of a number of clocksource drivers into fttmr010 means we > >> >> require clock-names to be specified in the Aspeed timer node, else the > >> >> clocksource fails to probe and boot hangs. > >> > > >> > Arnd, > >> > > >> > Linus' reworked timer driver will go into 4.13. > >> > > >> > Can we get this patch merged into 4.12 as a fix so we don't end up > >> > with a broken boot at any stage? > >> > >> Hmm, can't we make the driver backward-compatible and have it fall > >> back on the first clock if no clk named "PCLK" is found? Otherwise > >> you still have an incompatible change in the DT binding and it will > >> break if someone uses an older dtb with a newer kernel. > > > > I would like to avoid to hack the kernel code for backward DT compatible > > things. > > How about a fixup in the platform code to add the property then? Dunno, do you have an example? -- <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
[toc] | [next] | [standalone]
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2017-06-08 16:40 +0200 |
| Message-ID | <tQ6Lo-5sD-23@gated-at.bofh.it> |
| In reply to | #1661242 |
On Thu, Jun 8, 2017 at 3:26 PM, Daniel Lezcano
<daniel.lezcano@linaro.org> wrote:
> On Wed, Jun 07, 2017 at 04:29:50PM +0200, Arnd Bergmann wrote:
>> On Wed, Jun 7, 2017 at 2:52 PM, Daniel Lezcano
>> <daniel.lezcano@linaro.org> wrote:
>> > On Tue, Jun 06, 2017 at 11:41:11AM +0200, Arnd Bergmann wrote:
>> >> On Mon, Jun 5, 2017 at 10:59 AM, Joel Stanley <joel@jms.id.au> wrote:
>> >> > On Mon, Jun 5, 2017 at 5:18 PM, Andrew Jeffery <andrew@aj.id.au> wrote:
>> >> >> The merging of a number of clocksource drivers into fttmr010 means we
>> >> >> require clock-names to be specified in the Aspeed timer node, else the
>> >> >> clocksource fails to probe and boot hangs.
>> >> >
>> >> > Arnd,
>> >> >
>> >> > Linus' reworked timer driver will go into 4.13.
>> >> >
>> >> > Can we get this patch merged into 4.12 as a fix so we don't end up
>> >> > with a broken boot at any stage?
>> >>
>> >> Hmm, can't we make the driver backward-compatible and have it fall
>> >> back on the first clock if no clk named "PCLK" is found? Otherwise
>> >> you still have an incompatible change in the DT binding and it will
>> >> break if someone uses an older dtb with a newer kernel.
>> >
>> > I would like to avoid to hack the kernel code for backward DT compatible
>> > things.
>>
>> How about a fixup in the platform code to add the property then?
>
> Dunno, do you have an example?
armada_375_380_coherency_init() adds a "arm,io-coherent" property on
some machines, when the DT might be lacking this.
Arnd
[toc] | [prev] | [next] | [standalone]
| From | Andrew Jeffery <andrew@aj.id.au> |
|---|---|
| Date | 2017-06-09 09:40 +0200 |
| Subject | [PATCH] arm: aspeed: Add Aspeed board file with clocksource devicetree fixup |
| Message-ID | <tQmGu-75y-19@gated-at.bofh.it> |
| In reply to | #1661341 |
Add the clock-names property in init_timer() to work-around Aspeed
devicetrees from times prior to merging the Moxart/Aspeed and Faraday
drivers.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
---
Well, here's an implementation I knocked up. It's a fair chunk of code for
marginal benefit. Joel is against it.
At least it's something to debate.
Tested under QEMU for both AST2400 and AST2500 SoCs.
Cheers,
Andrew
arch/arm/Makefile | 1 +
arch/arm/mach-aspeed/Makefile | 1 +
arch/arm/mach-aspeed/aspeed.c | 73 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 75 insertions(+)
create mode 100644 arch/arm/mach-aspeed/Makefile
create mode 100644 arch/arm/mach-aspeed/aspeed.c
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index ab30cc634d02..f3ed359e5b28 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -154,6 +154,7 @@ textofs-$(CONFIG_ARCH_AXXIA) := 0x00308000
machine-$(CONFIG_ARCH_ALPINE) += alpine
machine-$(CONFIG_ARCH_ARTPEC) += artpec
machine-$(CONFIG_ARCH_AT91) += at91
+machine-$(CONFIG_ARCH_ASPEED) += aspeed
machine-$(CONFIG_ARCH_AXXIA) += axxia
machine-$(CONFIG_ARCH_BCM) += bcm
machine-$(CONFIG_ARCH_BERLIN) += berlin
diff --git a/arch/arm/mach-aspeed/Makefile b/arch/arm/mach-aspeed/Makefile
new file mode 100644
index 000000000000..de8cd76fcf5d
--- /dev/null
+++ b/arch/arm/mach-aspeed/Makefile
@@ -0,0 +1 @@
+obj-y += aspeed.o
diff --git a/arch/arm/mach-aspeed/aspeed.c b/arch/arm/mach-aspeed/aspeed.c
new file mode 100644
index 000000000000..feaac8eb5d2d
--- /dev/null
+++ b/arch/arm/mach-aspeed/aspeed.c
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2017 IBM Corporation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#include <linux/clk-provider.h>
+#include <linux/clocksource.h>
+#include <linux/init.h>
+#include <linux/of.h>
+#include <linux/slab.h>
+#include <asm/mach/arch.h>
+
+const char *aspeed_timer_compatibles[] = {
+ "aspeed,ast2400-timer",
+ "aspeed,ast2500-timer",
+ NULL,
+};
+
+/*
+ * For backwards compatibility with pre-4.13 devicetrees, populate the
+ * clock-names property in the clocksource node
+ */
+static void __init aspeed_timer_set_clock_names(void)
+{
+ const char **compatible = aspeed_timer_compatibles;
+ struct device_node *np;
+
+ while (*compatible) {
+ for_each_compatible_node(np, NULL, *compatible) {
+ struct property *clock_names;
+ int rc;
+
+ rc = of_property_count_strings(np, "clock-names");
+ if (rc != -EINVAL)
+ continue;
+
+ clock_names = kzalloc(sizeof(*clock_names), GFP_KERNEL);
+
+ clock_names->name = kstrdup("clock-names", GFP_KERNEL);
+ clock_names->length = sizeof("PCLK");
+ clock_names->value = kstrdup("PCLK", GFP_KERNEL);
+
+ of_add_property(np, clock_names);
+ }
+
+ compatible++;
+ }
+}
+
+static void __init aspeed_init_time(void)
+{
+ aspeed_timer_set_clock_names();
+
+#ifdef CONFIG_COMMON_CLK
+ of_clk_init(NULL);
+#endif
+ timer_probe();
+}
+
+static const char *const aspeed_dt_match[] __initconst = {
+ "aspeed,ast2400",
+ "aspeed,ast2500",
+ NULL,
+};
+
+DT_MACHINE_START(aspeed_dt, "Aspeed SoC")
+ .init_time = aspeed_init_time,
+ .dt_compat = aspeed_dt_match,
+MACHINE_END
--
2.11.0
[toc] | [prev] | [next] | [standalone]
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2017-06-09 11:20 +0200 |
| Subject | Re: [PATCH] arm: aspeed: Add Aspeed board file with clocksource devicetree fixup |
| Message-ID | <tQofh-88B-53@gated-at.bofh.it> |
| In reply to | #1662027 |
On Fri, Jun 9, 2017 at 9:30 AM, Andrew Jeffery <andrew@aj.id.au> wrote:
> Add the clock-names property in init_timer() to work-around Aspeed
> devicetrees from times prior to merging the Moxart/Aspeed and Faraday
> drivers.
>
> Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
> ---
> Well, here's an implementation I knocked up. It's a fair chunk of code for
> marginal benefit. Joel is against it.
>
> At least it's something to debate.
>
> Tested under QEMU for both AST2400 and AST2500 SoCs.
Right, I think having the one-line fixup in the driver makes way more sense
here, and that is what we usually do, but we could do this if Daniel has good
reasons to keep the driver free of backwards-compatibility support.
It also depends a bit on how common the old binding version already
is, and if anyone is shipping systems with that.
Arnd
[toc] | [prev] | [next] | [standalone]
| From | Andrew Jeffery <andrew@aj.id.au> |
|---|---|
| Date | 2017-06-09 15:00 +0200 |
| Subject | Re: [PATCH] arm: aspeed: Add Aspeed board file with clocksource devicetree fixup |
| Message-ID | <tQrG9-1DE-5@gated-at.bofh.it> |
| In reply to | #1662167 |
[Multipart message — attachments visible in raw view] — view raw
On Fri, 2017-06-09 at 11:19 +0200, Arnd Bergmann wrote:
> > On Fri, Jun 9, 2017 at 9:30 AM, Andrew Jeffery <andrew@aj.id.au> wrote:
> > Add the clock-names property in init_timer() to work-around Aspeed
> > devicetrees from times prior to merging the Moxart/Aspeed and Faraday
> > drivers.
> >
> > > > Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
> > ---
> > Well, here's an implementation I knocked up. It's a fair chunk of code for
> > marginal benefit. Joel is against it.
> >
> > At least it's something to debate.
> >
> > Tested under QEMU for both AST2400 and AST2500 SoCs.
>
> Right, I think having the one-line fixup in the driver makes way more sense
> here, and that is what we usually do, but we could do this if Daniel has good
> reasons to keep the driver free of backwards-compatibility support.
Yeah, choosing between the two with no further information I'd prefer
adding support to the driver.
>
> It also depends a bit on how common the old binding version already
> is, and if anyone is shipping systems with that.
So the fttmr010 bindings describe the clocks and clock-names properties
as optional (a little confusingly, "Optionally required properties").
I guess keeping in mind the bindings describe the hardware and not the
driver this might be reasonable, but the driver fails init if they're
not present. arch/arm/boot/dts/moxart.dtsi doesn't specify clock-names
either so I would have thought systems based on it would also fail.
However, Linus' fttmr010 series has Tested-by tags from Jonas, so maybe
I've missed something.
Regardless, if it's the case that Moxa systems now fail to init the
clocksource then the Aspeed-specific init_time() solution is even less
attractive. moxart.dtsi dates back to December 2013 ("448e7edefa92 ARM:
moxart: add MOXA ART SoC device tree files").
The old binding is less of a problem for Aspeed systems as we don't yet
have a clk driver upstream. Joel only recently added fixed-clock nodes
in 4.12 so Aspeed systems could boot without DTS modifications.
Andrew
[toc] | [prev] | [next] | [standalone]
| From | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| Date | 2017-06-20 10:10 +0200 |
| Subject | Re: [PATCH] arm: aspeed: Add Aspeed board file with clocksource devicetree fixup |
| Message-ID | <tUmox-63S-3@gated-at.bofh.it> |
| In reply to | #1662387 |
On Fri, Jun 9, 2017 at 2:52 PM, Andrew Jeffery <andrew@aj.id.au> wrote:
> So the fttmr010 bindings describe the clocks and clock-names properties
> as optional (a little confusingly, "Optionally required properties").
We should remove that. The timer frequency is strictly required.
> I guess keeping in mind the bindings describe the hardware and not the
> driver this might be reasonable, but the driver fails init if they're
> not present. arch/arm/boot/dts/moxart.dtsi doesn't specify clock-names
> either so I would have thought systems based on it would also fail.
It was added in
commit f46b563f2f270e451b2e1cee78573508cc1de256
"ARM: dts: augment Moxa and Aspeed DTS for FTTMR010"
Moxart only uses DT for boot, and Jonas controls all deployments of the
mainline kernel.
> Regardless, if it's the case that Moxa systems now fail to init the
> clocksource then the Aspeed-specific init_time() solution is even less
> attractive. moxart.dtsi dates back to December 2013 ("448e7edefa92 ARM:
> moxart: add MOXA ART SoC device tree files").
Moxart is deploying the DTBs with the kernel, they go hand-in-hand.
Backward compatibility with old DTBs here would just be an academic
exercise.
> The old binding is less of a problem for Aspeed systems as we don't yet
> have a clk driver upstream. Joel only recently added fixed-clock nodes
> in 4.12 so Aspeed systems could boot without DTS modifications.
The mentioned commit also adds the clocks to Aspeed AFAICT, is there
any problem in the real world, like did I miss some Aspeed platform?
Patching around drivers to make old DTBs work is something we should
only do when there are wide deployments for common users, such as people
buying products with a DTB inside them. Until such devices are shipped,
I consider the DT bindings still in flux.
Yours,
Linus Walleij
[toc] | [prev] | [next] | [standalone]
| From | Jonas Jensen <jonas.jensen@gmail.com> |
|---|---|
| Date | 2017-06-20 11:30 +0200 |
| Subject | Re: [PATCH] arm: aspeed: Add Aspeed board file with clocksource devicetree fixup |
| Message-ID | <tUnDY-6Ll-17@gated-at.bofh.it> |
| In reply to | #1670394 |
On 20 June 2017 at 10:06, Linus Walleij <linus.walleij@linaro.org> wrote: > Moxart is deploying the DTBs with the kernel, they go hand-in-hand. > Backward compatibility with old DTBs here would just be an academic > exercise. I've used CONFIG_ARM_APPENDED_DTB=y since the beginning mainly because UC-7112-LX's proprietary bootloader lacks DTB capabilities (that I'm aware of). Compiling both (kernel and dtb) at the same time always made sense to me, and it does, even when the hardware has a sane bootloader (i.e. DTB enabled). Jonas
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web