Subject: [PATCH] ARM: mach-moxart: platform port for MOXA ART SoC

From: [email-masked] (Arnd Bergmann)
Date: Thu, 16 May 2013 16:52:55 +0200

On Thursday 16 May 2013 15:37:16 Jonas Jensen wrote:
> On 15 May 2013 15:16, Arnd Bergmann <[email-masked]> wrote:
> > The part that I don't understand at all is the "timer0" part. Is that a string
> > from the data sheet?
> 
> I have next to no data sheets or documentation on the SoC itself. What
> I know is from looking at old sources, which suggest there are more
> than one timer (the rest were never implemented).
> 
> It only needs one for timer_tick? Does it make sense to just call it "timer"?

Yes, I think just "moxa,moxart-timer" is fine. Chances are that if you have
more of them, they are actually compatible with one another. If they are not
and you need more than one, you can always pick a different name
if you need another one.

> > Can you provide some more detail why what PMU registers are used here? Is that
> > a "Performance Measurement Unit", "Power Management Unit" or something else?
> > Are you sure that those registers are only ever needed for GPIO?
> 
> It's "Power Management Unit". The MMC driver uses it to read system
> clock and write it to clock control, but I suspect it can be removed.
> It's code under #ifdef MSD_SUPPORT_GET_CLOCK but I think the else is
> perfectly acceptable.
> GPIO uses it only to enable or disable pins.

It sounds like this is used for what should be separate drivers/clk and
drivers/pinctrl drivers:

A pinctrl driver is often the superset of a gpio driver and can control
more aspects of a pin than the gpio interface can.

The clk driver is supposed to give an abstraction of the clock tree
to be used with interfaces like clk_get() and clk_set_rate(). It
can probably be really simple in case of moxart. Is the mmc driver
the only one that needs access to clocks?

Are the pinctrl and clk registers in different parts of the PMU, or are
they intermixed? In the former case, you can just turn it into separate
devices that have their own distinct "reg" properties, in the second
case, the best solution is likely to mark the pmu 'compatible="syscon"'
and use the drivers/mfd/syscon.c driver to get a regmap that is used
by the clock and pinctrl drivers, respectively.

	Arnd