From: Florian Fainelli <florian@openwrt.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: olof@lixom.net, devicetree-discuss@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/8] ARM: MCS814x: add Device Tree based MCS8140 board support
Date: Tue, 17 Jul 2012 15:34:47 +0200 [thread overview]
Message-ID: <6873084.DUBYG1ACKX@flexo> (raw)
In-Reply-To: <201207171319.43593.arnd@arndb.de>
On Tuesday 17 July 2012 13:19:43 Arnd Bergmann wrote:
> On Sunday 15 July 2012, Florian Fainelli wrote:
>
> > +
> > + uart0: serial@400dc000 {
> > + compatible = "ns16550";
> > + reg = <0x400dc000 0x20>;
> > + clock-frequency = <50000000>;
> > + reg-shift = <2>;
> > + interrupts = <21>;
> > + status = "okay";
> > + };
>
> We often mark stuff like the uart as status="disabled" in the .dtsi file
> and only enable it in the board specific .dts file when it's actually
> connected. For components that are always present and usable, that's
> of course not necessary.
Ok, I thought it could be handy to have the uart enabled by default to avoid
mixing with the status property, I don't mind setting it to "disabled" by
default.
>
> > +
> > + adc {
> > + compatible = "simple-bus";
> > + #address-cells = <2>;
> > + #size-cells = <1>;
> > + // 8 64MB chip-selects
> > + ranges = <0 0 0x00000000 0x4000000 // sdram
> > + 1 0 0x04000000 0x4000000 // sdram
> > + 2 0 0x08000000 0x4000000 // reserved
> > + 3 0 0x0c000000 0x4000000 //
flash/localbus
> > + 4 0 0x10000000 0x4000000 //
flash/localbus
> > + 5 0 0x14000000 0x4000000 //
flash/localbus
> > + 6 0 0x18000000 0x4000000 //
flash/localbus
> > + 7 0 0x1c000000 0x4000000>; //
flash/localbus
> > +
> > + sdram: memory@0,0 {
> > + reg = <0 0 0>;
> > + };
> > +
> > + nor: flash@7,0 {
> > + reg = <7 0 0x4000000>;
> > + compatible = "cfi-flash";
> > + bank-width = <1>; // 8-bit external
flash
> > + #address-cells = <1>;
> > + #size-cells = <1>;
> > + };
> > + };
>
> Nice representation of the external buses. It does seem however that at
> least the nor flash entry is board specific and should be moved into the
> board .dts file.
In fact, MCS8140 only supports 8-bit CFI Flash chips, so this really is the
common point of all MCS8140-based boards. As you can see in the following
board-specific DTS patches, only the partition layout is different.
> I would probably do the same for the memory node, but that one is less
> obvious as it seems that there is not much choice here.
The memory node is also overridden by the board-specific DTS files in subsequent
patches.
>
> > + usb0: ehci@400fc000 {
> > + compatible = "moschip,mcs814x-ehci", "usb-ehci";
> > + reg = <0x400fc000 0x74>;
> > + interrupts = <2>;
> > + };
> > +
> > + usb1: ohci@400fd000 {
> > + compatible = "moschip,mcs814x-ohci", "ohci-le";
> > + reg = <0x400fd000 0x74>;
> > + interrupts = <11>;
> > + };
> > +
> > + usb2: ohci@400fe000 {
> > + compatible = "moschip,mcs814x-ohci", "ohci-le";
> > + reg = <0x400fe000 0x74>;
> > + interrupts = <12>;
> > + };
> > +
> > + usb3: otg@400ff000 {
> > + compatible = "moschip,msc814x-otg", "usb-otg";
> > + reg = <0x400ff000 0x1000>;
> > + interrupts = <13>;
> > + };
>
> same comment as for the uart, I would mark these as disabled and only
> enable the ones that are connected on a give board.
>
> > +
> > +static void __init mcs814x_dt_device_init(void)
> > +{
> > + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
> > + mcs814x_init_machine();
> > +}
> > +
> > +static const char *mcs8140_dt_board_compat[] __initdata = {
> > + "moschip,mcs8140",
> > + NULL, /* sentinel */
> > +};
> > +
> > +DT_MACHINE_START(mcs8140_dt, "Moschip MCS8140 board")
> > + /* Maintainer: Florian Fainelli <florian@openwrt.org> */
> > + .timer = &mcs814x_timer,
> > + .map_io = mcs814x_map_io,
> > + .init_early = mcs814x_clk_init,
> > + .init_irq = mcs814x_of_irq_init,
> > + .init_machine = mcs814x_dt_device_init,
> > + .restart = mcs814x_restart,
> > + .dt_compat = mcs8140_dt_board_compat,
> > +MACHINE_END
>
> Not much to see here. Just move this into the common.c file. There is no
> need to have a separate board file when all boards use the same one.
Allright.
>
> Arnd
next prev parent reply other threads:[~2012-07-17 13:34 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-15 14:49 [PATCH 0/8] ARM: support for Moschip MCS814x SoCs Florian Fainelli
2012-07-15 14:49 ` [PATCH 1/8] " Florian Fainelli
2012-07-16 12:29 ` Thomas Petazzoni
2012-07-16 12:43 ` Florian Fainelli
2012-07-16 15:55 ` Arnd Bergmann
2012-07-16 17:57 ` Nicolas Pitre
2012-07-23 19:11 ` Florian Fainelli
2012-07-27 22:42 ` Linus Walleij
[not found] ` <1342363754-30808-2-git-send-email-florian-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
2012-07-16 15:54 ` Arnd Bergmann
[not found] ` <201207161554.04812.arnd-r2nGTMty4D4@public.gmane.org>
2012-07-16 20:47 ` Turquette, Mike
2012-07-17 9:41 ` Florian Fainelli
2012-07-17 10:47 ` Florian Fainelli
2012-07-16 22:12 ` Linus Walleij
2012-07-17 9:35 ` Florian Fainelli
2012-07-17 9:34 ` Florian Fainelli
2012-07-17 13:07 ` Arnd Bergmann
2012-07-17 13:32 ` Florian Fainelli
2012-07-17 13:45 ` Arnd Bergmann
2012-07-17 10:16 ` Thomas Petazzoni
2012-07-17 13:12 ` Arnd Bergmann
2012-07-17 13:28 ` Thomas Petazzoni
2012-07-17 13:51 ` Arnd Bergmann
2012-07-16 22:06 ` Linus Walleij
2012-07-15 14:49 ` [PATCH 2/8] ARM: MCS814x: add Device Tree based MCS8140 board support Florian Fainelli
[not found] ` <1342363754-30808-3-git-send-email-florian-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
2012-07-17 13:19 ` Arnd Bergmann
2012-07-17 13:34 ` Florian Fainelli [this message]
2012-07-17 13:53 ` Arnd Bergmann
2012-07-17 13:57 ` Florian Fainelli
2012-07-15 14:49 ` [PATCH 3/8] ARM: MCS814x: add Device Tree bindings documentation Florian Fainelli
[not found] ` <1342363754-30808-4-git-send-email-florian-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
2012-07-17 13:24 ` Arnd Bergmann
2012-07-17 13:35 ` Florian Fainelli
2012-07-15 14:49 ` [PATCH 4/8] ARM: MCS814X: add DTS file for Tigal/Robotech RBT-832 Florian Fainelli
[not found] ` <1342363754-30808-5-git-send-email-florian-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
2012-07-17 13:27 ` Arnd Bergmann
2012-07-15 14:49 ` [PATCH 5/8] ARM: MCS814x: add DTS file for Devolo dLAN USB Extender Florian Fainelli
2012-07-15 14:49 ` [PATCH 6/8] ARM: MCS814x: provide a sample defconfig file Florian Fainelli
2012-07-15 14:49 ` [PATCH 7/8] ARM: MSC814X: add Kconfig and Makefile to arch/arm Florian Fainelli
2012-07-15 14:49 ` [PATCH 8/8] ARM: MSC814x: add MAINTAINERS entry Florian Fainelli
[not found] ` <1342363754-30808-1-git-send-email-florian-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
2012-07-15 19:59 ` [PATCH 0/8] ARM: support for Moschip MCS814x SoCs Arnd Bergmann
2012-07-16 8:16 ` Florian Fainelli
[not found] ` <201207151959.19620.arnd-r2nGTMty4D4@public.gmane.org>
2012-07-16 18:09 ` Nicolas Pitre
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=6873084.DUBYG1ACKX@flexo \
--to=florian@openwrt.org \
--cc=arnd@arndb.de \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=olof@lixom.net \
/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).