All of lore.kernel.org
 help / color / mirror / Atom feed
From: thomas.petazzoni@free-electrons.com (Thomas Petazzoni)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] arm: Add basic support for new Marvell Armada 370 and Armada XP SoC
Date: Wed, 13 Jun 2012 18:14:08 +0200	[thread overview]
Message-ID: <20120613181408.7e03fcae@skate> (raw)
In-Reply-To: <201206121349.27696.arnd@arndb.de>

Hello Arnd,

Le Tue, 12 Jun 2012 13:49:27 +0000,
Arnd Bergmann <arnd@arndb.de> a ?crit :

> > Andrew Lunn asked for refactoring the _restart() function to being used by
> > any MVEBU SOC, but we didn't find a nice way to do it. Indeed the registers
> > mapping differs between the SOC and the bit mask too. A solution could be to
> > get this mapping through the device tree, but we are not sure it was a good
> > usage of the device tree.
> 
> As I suggested in my reply to patch 4/8, I think this can be encapsulated
> in one file that acts as a driver for the generic ("bridge regs") registers
> and provides functions for that based on the "compatible" property.

The problem here is that those registers are part of a random set of
registers, that do not really constitute a sort of coherent "device",
as we have for other IP blocks (SATA controllers, SPI controllers,
etc.). First of all, the "bridge regs" name was unfortunate and a
left-over from early versions of the code, the datasheet does not refer
to them as "bridge registers" in any location.

On the Armada 370, the registers needed to restart the machine are part
of a "Miscellaneous Registers" section in the list of register
sections. This Miscellaneous Registers are 32 bits registers organized
as follows:

 * SoC Control Register
 * SoC Device Mux Register
 * Power Management Memory Power Down 2 Register
 * Power Management Memory Power Down 3 Register
 * Power Management Memory Power Down 4 Register
 * Power Management Memory Power Down 5 Register
 * Power Management Clock Gating Control Register
 * Power Management Memory Power Down 6 Register
 * Sample at Reset Register
 * Sample at Register High Register
 * Device ID Register
 * CPU SoC ID Register 
 * SYSRSTn Length Counter Register
 * RSTOUTn Mask Register -- this one needed for restart
 * System Soft Reset Register -- this one needed for restart
 * Shared SERDES 063 selectors Register
 * Boot ROM Routine and Error Code Register
 * PCI Express Boot Address Register

This registers are more or less contiguous, from offset 0x18204 to
0x182D4. As you can see, the purpose of those registers are very
different from one register to another, so it's kind of odd to create a
"driver" that would span those registers.

On the Armada XP, we have a "System Registers" area, subdivided by the
datasheet in "Configuration and Control", "QSGMII Control and Status",
"SERDES", "Power Management and Memory Power Down", "Thermal Manager",
"BootROM", "Interrupt, "Design for Testability". But from an
offset/address perspective, some registers of the "Power Management and
Memory Power Down" subsection are in the middle of the registers of the
"Configuration and Control" registers.

For the restart problem on Armada XP, the two registers of interest are
within the "Configuration and Control" subsection.

Our biggest problem is that all those registers do not really match
very well with a device/driver representation, so we don't know how to
nicely represent them in the device tree. How would you recommend to
handle these?

If further details are needed on the registers organization in order to
find the best solution, I'll be happy to provide them.

Thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

  parent reply	other threads:[~2012-06-13 16:14 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-11 16:52 [PATCH v2] arm: Add basic support for new Marvell Armada 370 and Armada XP SoC Gregory CLEMENT
2012-06-11 16:52 ` [PATCH v2 1/8] arm: mach-mvebu: add header Gregory CLEMENT
2012-06-11 17:11   ` Andrew Lunn
2012-06-11 16:52 ` [PATCH v2 2/8] arm: mach-mvebu: add source files Gregory CLEMENT
2012-06-12  8:45   ` Arnd Bergmann
2012-06-12 12:56     ` Gregory CLEMENT
2012-06-12 13:35       ` Arnd Bergmann
2012-06-12 15:50       ` Nicolas Pitre
2012-06-11 16:53 ` [PATCH v2 3/8] arm: mach-mvebu: add compilation/configuration change Gregory CLEMENT
2012-06-12  8:39   ` Arnd Bergmann
2012-06-12 13:01     ` Gregory CLEMENT
2012-06-11 16:53 ` [PATCH v2 4/8] arm: mach-mvebu: add support for Armada 370 and Armada XP with DT Gregory CLEMENT
2012-06-12 13:09   ` Arnd Bergmann
2012-06-11 16:53 ` [PATCH v2 5/8] arm: mach-mvebu: add documentation for new device tree bindings Gregory CLEMENT
2012-06-11 16:53 ` [PATCH v2 6/8] arm: mach-mvebu: add defconfig Gregory CLEMENT
2012-06-11 16:53 ` [PATCH v2 7/8] arm: mach-mvebu: add entry to MAINTAINERS Gregory CLEMENT
2012-06-11 16:53 ` [PATCH v2 8/8] ARM: mvebu: MPIC: read number of interrupts from control register Gregory CLEMENT
2012-06-11 20:44 ` [PATCH v2] arm: Add basic support for new Marvell Armada 370 and Armada XP SoC David Marlin
2012-06-12  7:35   ` Gregory CLEMENT
2012-06-12  8:04     ` Andrew Lunn
2012-06-12  8:09   ` Arnd Bergmann
2012-06-12 13:49 ` Arnd Bergmann
2012-06-12 13:56   ` Gregory CLEMENT
2012-06-12 14:06   ` Andrew Lunn
2012-06-12 14:24     ` Jason Cooper
2012-06-12 14:59       ` Arnd Bergmann
2012-06-12 15:40         ` Jason Cooper
2012-06-12 17:39           ` Arnd Bergmann
2012-06-13 16:14   ` Thomas Petazzoni [this message]
2012-06-13 19:19     ` Arnd Bergmann
2012-06-13 15:06 ` Jon Masters
2012-06-13 15:14   ` Gregory CLEMENT
2012-06-13 15:24   ` Arnd Bergmann
2012-06-13 15:48   ` Jason Cooper
2012-06-13 16:12     ` Arnaud Patard (Rtp)
2012-06-13 15:56   ` 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=20120613181408.7e03fcae@skate \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.