From: Finn Thain <fthain@linux-m68k.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Brad Boyer <flar@allandria.com>, Greg Ungerer <gerg@kernel.org>,
Daniel Palmer <daniel@0x0f.com>,
linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 0/3] m68k goes DT
Date: Tue, 14 Jan 2025 11:42:00 +1100 (AEDT) [thread overview]
Message-ID: <9cdb0b92-2bd5-6e0e-9a37-571538d79735@linux-m68k.org> (raw)
In-Reply-To: <CAMuHMdVSGQNpsy7wtPVDksq01jW3QVRBR=zwmvOYddb1wdfAYw@mail.gmail.com>
On Thu, 9 Jan 2025, Geert Uytterhoeven wrote:
> On Mon, Jan 6, 2025,Finn Thain wrote:
> > On Mon, 6 Jan 2025, Brad Boyer wrote:
> > > There are a few drivers where we could eliminate complexity and
> > > #ifdef trickery if it was all device tree based.
> >
> > Ideally, yes. But how would we get there from here?
> >
> > Should the kernel synthesize a device tree from the bootinfo data, so
> > that an ideal no-ifdef pmac_zilog could work? (This seems like a
> > maximum bloat solution.)
>
> We can add a wrapper that starts from a basic Amiga/Atari/Mac/... FDT
> and extends/modifies that, based on the bootinfo.
> Modification can be done using libfdt, even from assembler.
> See e.g. arch/arm/boot/compressed/*fdt*.
>
> > Or should the mac platform abandon bootinfo, and require a new
> > bootloader for all kernel releases after device tree adoption? (This
> > seems maximally difficult, since it requires simultaneously merging
> > many patches to many subsystems, even if the bootloader changes could
> > be done in advance...)
>
> Drivers can easily support both DT and non-DT, assuming they use proper
> platform devices. That means no more MACH_IS_* and *HW_PRESENT() checks
> in the drivers themselves, but proper platform data setup in
> arch/m68k/<mach>/*.
>
In the case of pmac_zilog, we still have to avoid pmac_call_feature() and
the macio_dev stuff, so many ifdefs would remain.
If DT compatibility was needed in pmac_zilog in order to port Linux/m68k
to new hardware (e.g. Mac Classic II) then I'd be in favour of such a
driver patch. I don't have time to write it though.
> > I wonder whether any other architectures have attempted to retrofit
> > device tree support (?)
>
> ARM is the classical example.
> Until recently, there was code under drivers/staging/board/ to support
> mixed DT/non-DT systems, but I don't suggest going that way.
> Conversion of SH to DT is still WIP (except for J-Core, which is
> DT-only).
>
> The largest initial step is usually irqchip, clocksource, and clock
> drivers and DT bindings. Existing drivers "just" need DT bindings
> and DT support.
>
> For e.g. Amiga, the clock driver would be rather simple.
> Clocksource is much more complicated, as the timers are provided by
> the CIAs, which are really multi-function-devices (MFD), providing
> timer, gpio,spi, and irqchip functionalities.
>
That's a lot of work. The old drivers would end up being more portable
when converted to DT, but is there a need for those drivers on new
platforms?
MVME147 is different in that Daniel is proposing new drivers to support
boards that are presently unsupported. (Not unlike the hypothetical Mac
Classic II example I gave.)
Supporting new hardware is good, but any benefit from retro-fitting DT
onto existing drivers is dubious, if those drivers will only end up being
used on systems on which they are already being used...
next prev parent reply other threads:[~2025-01-14 0:41 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-05 7:14 Daniel Palmer
2025-01-05 7:14 ` [RFC PATCH 1/3] m68k: bootinfo: Add tag for FDT address Daniel Palmer
2025-01-05 7:14 ` [RFC PATCH 2/3] m68k: bootinfo: Add generic machine type Daniel Palmer
2025-01-05 7:14 ` [RFC PATCH 3/3] m68k: Add dt support (proof of concept) Daniel Palmer
2025-01-05 9:40 ` [RFC PATCH 0/3] m68k goes DT Finn Thain
2025-01-05 11:00 ` Daniel Palmer
2025-01-06 3:28 ` Finn Thain
2025-01-06 15:51 ` Josh Juran
2025-01-07 0:57 ` Bootloaders, was " Finn Thain
2025-03-04 10:43 ` Daniel Palmer
2025-03-05 3:42 ` Finn Thain
2025-01-09 10:06 ` Geert Uytterhoeven
2025-01-05 14:59 ` Greg Ungerer
2025-01-06 2:10 ` Daniel Palmer
2025-01-06 11:37 ` Brad Boyer
2025-01-06 22:14 ` Finn Thain
2025-01-09 10:29 ` Geert Uytterhoeven
2025-01-14 0:42 ` Finn Thain [this message]
2025-01-09 10:31 ` Geert Uytterhoeven
2025-01-09 14:08 ` Daniel Palmer
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=9cdb0b92-2bd5-6e0e-9a37-571538d79735@linux-m68k.org \
--to=fthain@linux-m68k.org \
--cc=daniel@0x0f.com \
--cc=flar@allandria.com \
--cc=geert@linux-m68k.org \
--cc=gerg@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.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
all inboxes | Powered by JetHome®