From: Arnd Bergmann <arnd@arndb.de>
To: Feng Kan <fkan@apm.com>
Cc: "linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Mark Rutland <mark.rutland@arm.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>
Subject: Re: [PATCH V2 1/6] Documentation: add dts binding for X-Gene reboot dts node.
Date: Mon, 13 Jan 2014 16:19:34 +0100 [thread overview]
Message-ID: <201401131619.35030.arnd@arndb.de> (raw)
In-Reply-To: <CAL85gmA5Ob+kp-+5seO-wcB8tx4jyiOeFMyCsZWFBLdX09nZDg@mail.gmail.com>
On Thursday 09 January 2014, Feng Kan wrote:
> On Wed, Jan 8, 2014 at 2:08 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Wednesday 08 January 2014 10:05:50 Mark Rutland wrote:
> >> > +
> >> > +Example:
> >> > +
> >> > + reboot@0 {
> >> > + compatible = "apm,xgene-reboot";
> >> > + reg = <0x0 0x17000014 0x0 0x4>;
> >> > + };
> >>
> >> Given this seems to be a 64-bit address, the unit address should
> >> preferably be 0,17000014 rather than just 0.
> >
> > I also wonder about the size and location of the register.
> > Are you sure the device is just a single 4-byte register at offset
> > 0x14, rather than a complex device that happens to contain the
> > reset register?
>
> FKAN: this is a single 4 byte register when clicked perform the system
> reset of the platform.
That is not what I was asking about.
The problem with your binding is that it doesn't seem to describe
the hardware structure at all, but rather try to invent devices
because of how it's convenient for how you write the Linux drivers.
This is never a good idea and it will become a problem once you
try to port a different operating system, or when the structure
of the Linux drivers changes. Remember that in Linux we can freely
reorganize our code as requirements change, but the bindings have
to remain stable to allow running new kernels with an older device
tree that may be shipped with the firmware.
(Side note: if you end up doing an ACPI driver for this after all,
the problem is even worse because it's basically impossible to update
the ACPI tables in field, while with DT you can at least override
them in the firmware if something goes really wrong.)
On most SoCs I've seen, the system reset registers are part of
some on-chip device, most likely one of
- A SoC-specific system control register set containing various
global registers that may be of interest to other parts of the
kernel.
- A watchdog timer device that will reset the system after a crash,
or when explicit requested by the OS
- A dedicated reset controller that has registers for individually
resetting a number of subsystems of the SoC, or all at once in
case of system reboot.
- an interface to an external or integrated power management IC
that controls voltages and/or clock frequencies provided to
the SoC and other parts of the system.
In each of those cases, we already have a subsystem that is supposed
to handle the entire register set and provide a system reset method
as one of the things it does. Given that your register is at offset
0x14 from the start of a larger MMIO range, I strongly suspect
that the same is true here.
Arnd
next prev parent reply other threads:[~2014-01-13 15:20 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-07 22:50 [PATCH V2 0/6] Enable X-Gene platform reboot driver Feng Kan
2014-01-07 22:50 ` [PATCH V2 1/6] Documentation: add dts binding for X-Gene reboot dts node Feng Kan
2014-01-08 10:05 ` Mark Rutland
2014-01-08 10:08 ` Arnd Bergmann
2014-01-09 22:51 ` Feng Kan
2014-01-13 15:19 ` Arnd Bergmann [this message]
2014-01-13 19:25 ` Feng Kan
2014-01-13 19:43 ` Arnd Bergmann
2014-01-14 0:42 ` Feng Kan
2014-01-14 6:06 ` Arnd Bergmann
2014-01-14 18:35 ` Feng Kan
2014-01-14 18:42 ` Arnd Bergmann
2014-01-11 1:11 ` Feng Kan
2014-01-07 22:50 ` [PATCH V2 2/6] arm64: add missing dts entry for X-Gene platform Feng Kan
2014-01-07 22:50 ` [PATCH V2 3/6] arm64: Enable system reset via arch Kconfig for X-Gene system Feng Kan
[not found] ` <1389135041-16062-1-git-send-email-fkan-qTEPVZfXA3Y@public.gmane.org>
2014-01-07 22:50 ` [PATCH V2 4/6] power: reset: removed use of the dts mask and use fixed value for reset Feng Kan
2014-01-08 21:45 ` Arnd Bergmann
2014-01-07 22:50 ` [PATCH V2 5/6] power: reset: change xgene reboot driver to use both acpi and dts resource for reboot Feng Kan
2014-01-08 21:43 ` Arnd Bergmann
2014-01-09 22:48 ` Feng Kan
2014-01-13 15:03 ` Arnd Bergmann
2014-01-07 22:50 ` [PATCH V2 6/6] acpi: platform: add ACPI code for X-Gene reboot platform driver Feng Kan
2014-01-14 16:07 ` [PATCH V2 0/6] Enable X-Gene platform reboot driver Matthew Garrett
2014-01-15 17:39 ` Feng Kan
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=201401131619.35030.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=devicetree@vger.kernel.org \
--cc=fkan@apm.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
/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).