From: Stefan Agner <stefan-XLVq0VzYD2Y@public.gmane.org>
To: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Cc: shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org,
marcel-mitwqZ+T+m9Wk0Htik3J/w@public.gmane.org,
linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [RFC 4/7] ARM: dts: add support for Vybrid running on Cortex-M4
Date: Mon, 13 Oct 2014 12:41:31 +0200 [thread overview]
Message-ID: <806cb97553e446d52761bd66306036a9@agner.ch> (raw)
In-Reply-To: <2195665.D7cJPYcoOh@wuerfel>
Am 2014-10-12 20:56, schrieb Arnd Bergmann:
> On Sunday 12 October 2014 20:13:58 Stefan Agner wrote:
>> This adds an initial device tree to run Linux on the Cortex-M4 on
>> Vybrid.
>>
>> HACK: Because we include armv7-m.dtsi, the soc node happens to
>> be before the clock node. This is a problem for vf610-clk.c, which
>> tries to optain the fixed clocks defined in the clock nodes. But
>> because clock drivers are initialized sequencially, and we do not
>> have support for deferred probing, the clock initialization fails
>> horrible.
>
> I thought that was fixed recently.
Unless it was very recently, it didn't solve my case.
Both, clk-fixed-rate as well as clk-vf610 are initialized using
CLK_OF_DECLARE. So I guess its the dt order. Or is it compile time
order? But I think driver code is linked before arch code.
>
>> Move the armv7-m.dtsi include to the bottom to temporarily work
>> work around this...
>>
>> Signed-off-by: Stefan Agner <stefan-XLVq0VzYD2Y@public.gmane.org>
>> ---
>> Maybe a dummy soc entry in armv7-m.dtsi also helps here. But a
>> hack as well. Is it common acceptable that the kernel depends
>> on DTS order?
>
> Generally speaking, the kernel should not rely on the order of
> nodes in the dtb.
>
>> diff --git a/arch/arm/boot/dts/vf610m4.dts b/arch/arm/boot/dts/vf610m4.dts
>> new file mode 100644
>> index 0000000..61488fe
>> --- /dev/null
>> +++ b/arch/arm/boot/dts/vf610m4.dts
>> @@ -0,0 +1,144 @@
>> +/*
>> + * Device tree for VF610 Cortex-M4 support
>> + */
>> +
>> +/dts-v1/;
>> +#include "skeleton.dtsi"
>> +#include "vf610-pinfunc.h"
>> +#include <dt-bindings/clock/vf610-clock.h>
>> +
>> +/ {
>> + model = "VF610 Cortex-M4";
>> + compatible = "fsl,vf610m4";
>> +
>> + chosen {
>> + bootargs = "console=ttyLP0,115200 ignore_loglevel ihash_entries=64 dhash_entries=64 earlyprintk clk_ignore_unused init=/linuxrc root=/dev/mmcblk0p2 rootwait";
>> + };
>> +
>> + memory {
>> + reg = <0x88000000 0x2000000>;
>> + };
>> +
>> + aliases {
>> + serial0 = &uart2;
>> + };
>
> All of these are board specific, the common way to handle this is to make
> a vf610m4.dtsi file and include that from a v6610m4-myboard.dts file
> which sets the properties.
>
> The command line should actually be set by the boot loader.
Hm, this would then be a feature needed in the small boot loader I plan
to integrate with m4boot.
> Also, it would be good to make the UART driver handle the early console
> setup through the stdout-path property.
Ok, having a look at that. Do I see things right that this is somewhat
like a default "console=" argument? But probably not picked up by
user-space (systemd) later on...
>
>> +
>> + soc {
>> + aips0: aips-bus@40000000 {
>> + compatible = "fsl,aips-bus", "simple-bus";
>> + #address-cells = <1>;
>> + #size-cells = <1>;
>> + reg = <0x40000000 0x70000>;
>> + ranges;
>> +
>> +/*
>> + uart0: serial@40027000 {
>> + compatible = "fsl,vf610-lpuart";
>> + reg = <0x40027000 0x1000>;
>> + interrupts = <61>;
>> + clocks = <&clks VF610_CLK_UART0>;
>> + clock-names = "ipg";
>> + status = "okay";
>> + };
>> +
>> + uart1: serial@40028000 {
>> + compatible = "fsl,vf610-lpuart";
>> + reg = <0x40028000 0x1000>;
>> + interrupts = <62>;
>> + clocks = <&clks VF610_CLK_UART1>;
>> + clock-names = "ipg";
>> + status = "okay";
>> + };
>> +*/
>
> Don't comment out nodes, just make them as 'status="disabled"'.
>
> For any peripherals that are accessible to both the m4 and the a5
> core, it might be nice to put them into a shared .dtsi file.
Hm, actually all peripherals are accessible from both core. However,
since we do have different interrupt controllers, the interrupt property
looks different. But I guess it's perfectly ok to add this property in
the m4 and a5 specific dtsi.
We already discussed the shared dtsi issue for Vybird in a different
thread (VF500 support). Considering we want to create a shared dtsi for
both cores and all variants, I guess it would something look like that:
vfxxx.dtsi => vf500.dtsi (Cortex-A5, single core)
=> vf600m4.dtsi (Cortex-M4)
=> vf600.dtsi (Cortex-A5)
=> vf610.dtsi (Cortex-A5 with L2 Cache)
Or do we want the core included on all dtsi?
vfxxx.dtsi => vf500a5.dtsi (Cortex-A5, single core)
=> vf600m4.dtsi (Cortex-M4)
=> vf600a5.dtsi (Cortex-A5)
=> vf610a5.dtsi (Cortex-A5 with L2 Cache)
--
Stefan
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-10-13 10:41 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-12 18:13 [RFC 0/7] ARM: vf610m4: Add Vybrid Cortex-M4 support Stefan Agner
[not found] ` <cover.1413136383.git.stefan-XLVq0VzYD2Y@public.gmane.org>
2014-10-12 18:13 ` [RFC 1/7] ARM: vf610: add low level debug support for !MMU Stefan Agner
[not found] ` <331b5f06d72890ac348adcd8cce616db576eb10e.1413136383.git.stefan-XLVq0VzYD2Y@public.gmane.org>
2014-10-12 18:48 ` Arnd Bergmann
2014-10-13 9:26 ` Stefan Agner
2014-10-12 18:13 ` [RFC 2/7] clocksource: add dependencies for Vybrid pit clocksource Stefan Agner
[not found] ` <603e0f51e88b5643cb42e966cbb1b80b21a55ecf.1413136383.git.stefan-XLVq0VzYD2Y@public.gmane.org>
2014-10-12 18:18 ` Uwe Kleine-König
[not found] ` <20141012181821.GQ31554-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2014-10-13 9:46 ` Stefan Agner
[not found] ` <98ca2b7a76dc786a36cf6c4113ca751f-XLVq0VzYD2Y@public.gmane.org>
2014-10-13 10:57 ` Uwe Kleine-König
2014-10-12 18:13 ` [RFC 3/7] ARM: vf610m4: add new machine and SoC for Vybrid on Cortex-M4 Stefan Agner
[not found] ` <d1b3670556c7c7a11092834abf52eedb22c332b7.1413136383.git.stefan-XLVq0VzYD2Y@public.gmane.org>
2014-10-12 18:51 ` Arnd Bergmann
2014-10-13 10:03 ` Stefan Agner
[not found] ` <776a06abd938d507d7798670e6ad27d1-XLVq0VzYD2Y@public.gmane.org>
2014-10-13 10:57 ` Arnd Bergmann
2014-10-12 18:13 ` [RFC 4/7] ARM: dts: add support for Vybrid running " Stefan Agner
[not found] ` <b3dd902655e9cc4496170a05a907fcce5a687427.1413136383.git.stefan-XLVq0VzYD2Y@public.gmane.org>
2014-10-12 18:56 ` Arnd Bergmann
2014-10-13 10:41 ` Stefan Agner [this message]
2014-10-13 10:32 ` Mark Rutland
2014-10-13 11:08 ` Stefan Agner
[not found] ` <fadc1e22c016f4259819d87ba06d0d99-XLVq0VzYD2Y@public.gmane.org>
2014-10-13 11:24 ` Arnd Bergmann
2014-10-13 16:11 ` Stefan Agner
[not found] ` <e7425f34e2149aa495a2e3611854e952-XLVq0VzYD2Y@public.gmane.org>
2014-10-13 19:54 ` Arnd Bergmann
2014-10-13 21:20 ` Stefan Agner
[not found] ` <7c474d8f876cbf9adaec55af1dffd6c2-XLVq0VzYD2Y@public.gmane.org>
2014-10-14 10:01 ` Arnd Bergmann
2014-10-12 18:13 ` [RFC 5/7] irqchip: nvic: increase number of external interrupts to 112 Stefan Agner
2014-10-12 18:14 ` [RFC 6/7] ARM: vf610m4: HACK: get dtb pointer from SRC_GPR3 Stefan Agner
[not found] ` <2bdc44912522eb02db2e4612738fe9f0545b36d9.1413136383.git.stefan-XLVq0VzYD2Y@public.gmane.org>
2014-10-12 19:00 ` Arnd Bergmann
2014-10-13 10:10 ` Stefan Agner
2014-10-12 18:14 ` [RFC 7/7] ARM: vf610m4: add defconfig for Linux on Vybrids Cortex-M4 Stefan Agner
2014-11-28 14:17 ` [RFC 0/7] ARM: vf610m4: Add Vybrid Cortex-M4 support Andreas Färber
[not found] ` <54788417.6020408-l3A5Bk7waGM@public.gmane.org>
2014-11-28 16:00 ` Stefan Agner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=806cb97553e446d52761bd66306036a9@agner.ch \
--to=stefan-xlvq0vzyd2y@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
--cc=marcel-mitwqZ+T+m9Wk0Htik3J/w@public.gmane.org \
--cc=olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org \
--cc=shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).