public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Marc C <marc.ceeeee@gmail.com>
Cc: Russell King <linux@arm.linux.org.uk>,
	Christian Daudt <bcm@fixthebug.org>,
	Florian Fainelli <f.fainelli@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/6] ARM: brcmstb: add infrastructure for ARM-based Broadcom STB SoCs
Date: Fri, 6 Dec 2013 18:00:42 +0100	[thread overview]
Message-ID: <201312061800.42563.arnd@arndb.de> (raw)
In-Reply-To: <52A1717D.7000001@gmail.com>

On Friday 06 December 2013, Marc C wrote:

> > This seems like stuff that should go into the device drivers for the
> > respective hardware blocks, not into platform code.
> 
> Understood. I'm not sure if you recall this [1] conversation, but short
> of having a big array of registers offsets per chip ID (which will
> probably grow to 10 or more), leveraging the DT to let the bootloader
> tell the kernel these randomly-located registers are proved to be very
> lightweight.

Right, but I didn't expect the code to look at these registers to be
outside of a device-driver context.
 
> Seems like there's one thing I could possibly factor out into a separate
> driver... the registers that assert a chip reset (sw-master-reset-reg).
> Maybe I could register a reset-controller driver specifically for this
> purpose?

I have not followed the latest developments regarding system-reset and
where that is supposed to be handled, but I'm sure it's in some driver,
probably drivers/power or drivers/reset.

> > We try hard to avoid having register available this early and outside
> > of device drivers. Can you try to make at least some (if not all) of
> > these more regular, and provide specific comments in the code why this
> > is not possible for the others?
> 
> Just to be sure, you're asking to reduce our dependence on touching
> these machine-specific registers?

Not touching them at all would be preferred (e.g. if the boot loader
could set them up to the correct per-board setting), but of course that
doesn't work for run-time settings or system-reset.

The most important part of my comment above is to have as little as
possible done "early", i.e. before init_machine(). Beyond that, the
preferred way to do any kind of register access from a device driver
with an abstract platform-independent interface. We have added a number
of new subsystems in the past few years (clk, irqchip, pinctrl, reset,
clocksource, regmap, syscon, ...) along these lines, to the extent where
most new platforms can now have an empty machine descriptor (if they
can use the standard psci_smp_ops, I mentioned already that we need
some more work to get non-standard smp_ops merged with cpuidle).

Chances are that a lot of the registers you are trying to map here
already have a subsystem that they can fit in as a device driver,
or that they do something generic enough that we should add another
subsystem to abstract them. If you need help figuring out which
subsystem they should use, we should take a closer look at the actual
register descriptions together. Is there a manual that is publically
available?

	Arnd

  reply	other threads:[~2013-12-06 17:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-27  0:22 [PATCH v2 0/6] ARM: brcmstb: Add Broadcom STB SoC support Marc Carino
2013-11-27  0:22 ` [PATCH v2 1/6] ARM: brcmstb: add infrastructure for ARM-based Broadcom STB SoCs Marc Carino
2013-12-03 15:01   ` Arnd Bergmann
2013-12-05 18:48     ` Florian Fainelli
2013-12-05 20:07       ` Arnd Bergmann
2013-12-06 22:12         ` Florian Fainelli
2013-12-06 22:50           ` Arnd Bergmann
2013-12-06  6:41     ` Marc C
2013-12-06 17:00       ` Arnd Bergmann [this message]
2013-12-13 14:10   ` Matt Porter
2013-11-27  0:22 ` [PATCH v2 2/6] ARM: do CPU-specific init for Broadcom Brahma15 cores Marc Carino
2013-11-27  0:22 ` [PATCH v2 3/6] ARM: brcmstb: add CPU binding for Broadcom Brahma15 Marc Carino
2013-11-27  0:22 ` [PATCH v2 4/6] ARM: brcmstb: add misc. DT bindings for brcm,brcmstb Marc Carino
2013-12-13 14:23   ` Matt Porter
2013-11-27  0:22 ` [PATCH v2 5/6] ARM: brcmstb: gic: add compatible string for Broadcom Brahma15 Marc Carino
2013-11-27  0:22 ` [PATCH v2 6/6] ARM: brcmstb: dts: add a reference DTS for Broadcom 7445 Marc Carino
2013-12-13 14:40   ` Matt Porter

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=201312061800.42563.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=bcm@fixthebug.org \
    --cc=f.fainelli@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=marc.ceeeee@gmail.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