]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
11 years agoARM: shmobile: sh73a0: Use DEFINE_RES_MEM*() everywhere
Simon Horman [Tue, 23 Apr 2013 02:27:15 +0000 (02:27 +0000)]
ARM: shmobile: sh73a0: Use DEFINE_RES_MEM*() everywhere

Convert code to use DEFINE_RES_MEM*() macros.
These macros were already used in this file,
this change makes their usage consistent throughout the file.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: sh73a0: add CPUFreq support
Guennadi Liakhovetski [Fri, 5 Apr 2013 10:00:38 +0000 (12:00 +0200)]
ARM: shmobile: sh73a0: add CPUFreq support

This patch enables the use of the generic cpufreq-cpu0 driver on sh73a0.
Providing a regulator, a list of OPPs in DT, combined with a virtual
cpufreq-cpu0 platform device and a clock, attached to it is everything,
the cpufreq-cpu0 driver needs. The first sh73a0 platform, implementing
such CPUFreq support is kzm9g-reference.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: sh73a0: add support for adjusting CPU frequency
Guennadi Liakhovetski [Fri, 5 Apr 2013 10:00:36 +0000 (12:00 +0200)]
ARM: shmobile: sh73a0: add support for adjusting CPU frequency

On SH73A0 the output of PLL0 is supplied to two dividers, feeding clock to
the CPU core and SGX. Lower CPU frequencies allow the use of lower supply
voltages and thus reduce power consumption.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: mach-shmobile: sh73a0: Setup the timer CMT10 using DT
Bastian Hecht [Thu, 11 Apr 2013 11:24:01 +0000 (13:24 +0200)]
ARM: mach-shmobile: sh73a0: Setup the timer CMT10 using DT

We can now use the Device Tree for bringing up our timer device CMT10 on
the SoC sh73a0.

Signed-off-by: Bastian Hecht <hechtb+renesas@gmail.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: sh73a0: Add timer DT names to clock list
Bastian Hecht [Thu, 11 Apr 2013 11:24:00 +0000 (13:24 +0200)]
ARM: shmobile: sh73a0: Add timer DT names to clock list

This adds temporarily the alternative device names to the clock list
that are used when booting via Device Tree setup.

Signed-off-by: Bastian Hecht <hechtb+renesas@gmail.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: sh73a0 pinmux platform device cleanup
Magnus Damm [Wed, 3 Apr 2013 06:33:28 +0000 (15:33 +0900)]
ARM: shmobile: sh73a0 pinmux platform device cleanup

Use DEFINE_RES_MEM() and platform_device_register_simple()
to save a couple of lines of code.

Signed-off-by: Magnus Damm <damm@opensource.se>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoMerge branch 'clocksource' into soc-sh73a0-base
Simon Horman [Mon, 22 Apr 2013 05:51:07 +0000 (14:51 +0900)]
Merge branch 'clocksource' into soc-sh73a0-base

11 years agoclocksource: sh_tmu: Add OF support
Bastian Hecht [Thu, 11 Apr 2013 11:23:59 +0000 (13:23 +0200)]
clocksource: sh_tmu: Add OF support

We add the capabilty to probe SH CMT timer devices using Device Tree
setup.

Signed-off-by: Bastian Hecht <hechtb+renesas@gmail.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoclocksource: sh_cmt: Add OF support
Bastian Hecht [Thu, 11 Apr 2013 11:23:58 +0000 (13:23 +0200)]
clocksource: sh_cmt: Add OF support

We add the capabilty to probe SH CMT timer devices using Device Tree
setup.

Signed-off-by: Bastian Hecht <hechtb+renesas@gmail.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: Define DT bindings for timer devices
Bastian Hecht [Thu, 11 Apr 2013 11:23:57 +0000 (13:23 +0200)]
ARM: shmobile: Define DT bindings for timer devices

The SH mobile series currently features 3 timer devices in the kernel:
Compare Match Timer (CMT), Timer Unit (TMU) and MTU2. These devices
share register layout characteristics amongst each that enable us to
define common DT bindings for them.

Signed-off-by: Bastian Hecht <hechtb+renesas@gmail.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: r8a7790 SoC 64-bit DT support
Takashi Yoshii [Fri, 29 Mar 2013 07:49:17 +0000 (16:49 +0900)]
ARM: shmobile: r8a7790 SoC 64-bit DT support

The r8a7790 SoC supports LPAE and has memory window up to
0x2ffffffff. Convert to 64-bit addresses by enlarging
#addr-cells and #size-cells to 2.

Signed-off-by: Takashi Yoshii <takashi.yoshii.zj@renesas.com>
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: r8a73a4 SoC 64-bit DT support
Takashi Yoshii [Fri, 29 Mar 2013 07:45:56 +0000 (16:45 +0900)]
ARM: shmobile: r8a73a4 SoC 64-bit DT support

The r8a73a4 SoC supports LPAE and has memory window up to
0x2ffffffff. Convert to 64-bit addresses by enlarging
#addr-cells and #size-cells to 2.

Signed-off-by: Takashi Yoshii <takashi.yoshii.zj@renesas.com>
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: r8a7790 PFC support
Magnus Damm [Wed, 27 Mar 2013 15:50:03 +0000 (00:50 +0900)]
ARM: shmobile: r8a7790 PFC support

Add a platform device for the r8a7790 PFC.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: r8a7790 IRQC support
Magnus Damm [Wed, 27 Mar 2013 15:49:54 +0000 (00:49 +0900)]
ARM: shmobile: r8a7790 IRQC support

Add IRQC interrupt controller support to r8a7790 by
hooking up a single IRQC instances to handle 4 external
IRQ signals. The IRQC controller is tied to SPIs of
the GIC. On r8a7790 the external IRQ pins routing is
handled by the PFC which is excluded from this patch.

Both platform devices and DT devices are added in this
patch. The platform device versions are used to provide
a static interrupt map configuration for board code
written in C.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: r8a7790 SCIF support
Magnus Damm [Wed, 27 Mar 2013 15:49:44 +0000 (00:49 +0900)]
ARM: shmobile: r8a7790 SCIF support

Add SCIF serial port support to the r8a7790 SoC by
adding platform devices for SCIFA0 -> SCIFA2 as well
as SCIFB0 -> SCIFB2 and SCIF0 -> SCIF1 together with
clock bindings. DT device description is excluded at
this point since such bindings are still under
development.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: Initial r8a7790 SoC support
Magnus Damm [Wed, 27 Mar 2013 15:49:34 +0000 (00:49 +0900)]
ARM: shmobile: Initial r8a7790 SoC support

Add initial support for the r8a7790 SoC including:
 - Single Cortex-A15 CPU Core
 - GIC
 - Architecture timer

No static virtual mappings are used, all the components
make use of ioremap(). DT_MACHINE_START is still wrapped
in CONFIG_USE_OF to match other mach-shmobile code.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: r8a7779: move global functions to r8a7779.h
Kuninori Morimoto [Thu, 28 Mar 2013 08:49:27 +0000 (01:49 -0700)]
ARM: shmobile: r8a7779: move global functions to r8a7779.h

There is no reason each CPU's own function has to exist in common.h.
r8a7779_xxx() go to r8a7779.h

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: r8a7740: move global functions to r8a7740.h
Kuninori Morimoto [Thu, 28 Mar 2013 08:49:15 +0000 (01:49 -0700)]
ARM: shmobile: r8a7740: move global functions to r8a7740.h

There is no reason each CPU's own function has to exist in common.h.
r8a7740_xxx() go to r8a7740.h

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: sh73a0: move global functions to sh73a0.h
Kuninori Morimoto [Thu, 28 Mar 2013 08:48:30 +0000 (01:48 -0700)]
ARM: shmobile: sh73a0: move global functions to sh73a0.h

There is no reason each CPU's own function has to exist in common.h.
sh73a0_xxx() go to sh73a0.h

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: sh7372: move global functions to sh7372.h
Kuninori Morimoto [Thu, 28 Mar 2013 08:48:19 +0000 (01:48 -0700)]
ARM: shmobile: sh7372: move global functions to sh7372.h

There is no reason each CPU's own function has to exist in common.h.
sh7372_xxx() go to sh7372.h

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: r8a7779: remove DIV4 clocks and use fixed ratio clock
Kuninori Morimoto [Wed, 27 Mar 2013 07:57:38 +0000 (00:57 -0700)]
ARM: shmobile: r8a7779: remove DIV4 clocks and use fixed ratio clock

R-Car H1 has many clocks, and it is possible to read/use clock ratio
of these clocks from FRQMRx as DIV4 clocks.
But, these ratio are fixed value and these are decided
by MD pin status.
This means that we can use fixed ratio clock via MD pin status,
instead of DIV4 clocks.

This patch reads MD pin status, and sets PLLA clock (= root clock),
and used fixed ratio clock for other clocks.
It was tesed on marzen board.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: r8a7740: use fixed ratio clock
Kuninori Morimoto [Wed, 27 Mar 2013 07:56:57 +0000 (00:56 -0700)]
ARM: shmobile: r8a7740: use fixed ratio clock

Current clock-r8a7740 is using own implement
for each divX clocks.
This patch switches to use fixed ratio clock,
and was tesed on armadillo board.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: r8a7740: tidyup comment/implementation mismatch
Kuninori Morimoto [Wed, 27 Mar 2013 07:56:40 +0000 (00:56 -0700)]
ARM: shmobile: r8a7740: tidyup comment/implementation mismatch

Current clock-r8a7740's DIV4/DIV6/MSTP implemented area and
its comment are mismatching.
This patch tidyup its comment/implementation area.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: sh73a0: use fixed ratio clock
Kuninori Morimoto [Wed, 27 Mar 2013 07:56:14 +0000 (00:56 -0700)]
ARM: shmobile: sh73a0: use fixed ratio clock

Current clock-sh73a0 is using own implement
for each divX clocks.
This patch switches to use fixed ratio clock,
and was tesed on kzm9g board.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: sh7372: use fixed ratio clock
Kuninori Morimoto [Wed, 27 Mar 2013 07:55:54 +0000 (00:55 -0700)]
ARM: shmobile: sh7372: use fixed ratio clock

Current clock-sh7372 is using own implement
for each divX clocks.
This patch switches to use fixed ratio clock,
and was tesed on mackerel board.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: add struct clk_ratio and fixed ratio clock macro
Kuninori Morimoto [Wed, 27 Mar 2013 07:55:41 +0000 (00:55 -0700)]
ARM: shmobile: add struct clk_ratio and fixed ratio clock macro

Renesas chip has many clocks inside,
and some of them are using fixed ratio via parent clock.
Current shmobile clock code is using own divX_recalc function
and divX_clk_ops.
This patch can reduce these code

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: sh7372: remove DIV4_ZT* clocks
Kuninori Morimoto [Wed, 27 Mar 2013 07:55:24 +0000 (00:55 -0700)]
ARM: shmobile: sh7372: remove DIV4_ZT* clocks

DIV4_ZT* clocks are for debugging and trace bus clock.
It is not necessary to control it from Linux/Software.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: sh73a0: remove DIV4_ZT* clocks
Kuninori Morimoto [Wed, 27 Mar 2013 07:55:07 +0000 (00:55 -0700)]
ARM: shmobile: sh73a0: remove DIV4_ZT* clocks

DIV4_ZT* clocks are for debugging and trace bus clock.
It is not necessary to control it from Linux/Software.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: sh73a0: add a TWD clock
Guennadi Liakhovetski [Thu, 7 Mar 2013 19:00:48 +0000 (20:00 +0100)]
ARM: shmobile: sh73a0: add a TWD clock

Add a TWD clock on sh73a0 for the smp_twd driver to properly update the
clock's frequency upon cpufreq events.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: r8a7740: Migrate from INTC to GIC
Bastian Hecht [Wed, 27 Mar 2013 13:54:04 +0000 (14:54 +0100)]
ARM: shmobile: r8a7740: Migrate from INTC to GIC

With the added capabilty of the intc_irqpin driver to handle shared
external IRQs, all prerequisites are fulfilled and we are ready to
migrate completely to GIC. This includes the following steps:

- Kconfig: select ARM_GIC and RENESAS_INTC_IRQPIN
- intc-r8a7740: Throw out all legacy INTC code and init the GIC. We need
   to mask out all shared IRQs as it is needed by the
shared intc_irqpin driver.
- setup-r8a7740: Add 4 irqpin devices to handle external IRQs and update
all IRQ numbers to point to the GIC SPI.
- board-armadillo: Update all IRQ numbers to point to the GIC SPI.
- pfc-r8a7740: Update all IRQ numbers of the GPIOs to point to the GIC
SPI.

Signed-off-by: Bastian Hecht <hechtb+renesas@gmail.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: r8a73a4: add thermal driver support
Kuninori Morimoto [Tue, 26 Mar 2013 06:18:15 +0000 (23:18 -0700)]
ARM: shmobile: r8a73a4: add thermal driver support

You can get current thermal by
> cat /sys/class/thermal/thermal_zone?/temp

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: Disallow PINCTRL without GPIOLIB
Magnus Damm [Mon, 18 Mar 2013 13:58:18 +0000 (22:58 +0900)]
ARM: shmobile: Disallow PINCTRL without GPIOLIB

Modify mach-shmobile to only select PINCTRL in case of
ARCH_WANT_OPTIONAL_GPIOLIB is set.

This fixes a build error triggered when adding a new SoC
lacking GPIO software support (ARCH_WANT_OPTIONAL_GPIOLIB=n):

 CC      drivers/tty/vt/keyboard.o
In file included from drivers/pinctrl/core.c:30:0:
include/asm-generic/gpio.h: In function 'gpio_get_value_cansleep':
include/asm-generic/gpio.h:270:2: error: implicit declaration of function '__gpio_get_value'
include/asm-generic/gpio.h: In function 'gpio_set_value_cansleep':
include/asm-generic/gpio.h:276:2: error: implicit declaration of function '__gpio_set_value'
drivers/pinctrl/core.c: In function 'pinctrl_ready_for_gpio_range':
drivers/pinctrl/core.c:297:9: error: implicit declaration of function 'gpio_to_chip'
drivers/pinctrl/core.c:297:27: warning: initialization makes pointer from integer without a cast
drivers/pinctrl/core.c:304:45: error: dereferencing pointer to incomplete type
drivers/pinctrl/core.c:305:26: error: dereferencing pointer to incomplete type
drivers/pinctrl/core.c:305:39: error: dereferencing pointer to incomplete type
make[2]: *** [drivers/pinctrl/core.o] Error 1
make[1]: *** [drivers/pinctrl] Error 2
make[1]: *** Waiting for unfinished jobs....
  LD      drivers/sh/built-in.o

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: sh73a0: add irqpin DT nodes
Guennadi Liakhovetski [Thu, 21 Mar 2013 16:05:40 +0000 (17:05 +0100)]
ARM: shmobile: sh73a0: add irqpin DT nodes

Add DT nodes for the 4 irqpin interrupt controllers on sh73a0. We add them
to sh73a0.dtsi, which is also used by configurations, doing all their
device instantiation from board the .c code. We rely on the fact, that
such configurations don't instantiate devices from the device-tree.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: r8a7778 SCIF support
Kuninori Morimoto [Thu, 21 Mar 2013 10:02:38 +0000 (03:02 -0700)]
ARM: shmobile: r8a7778 SCIF support

Add SCIF serial port support to the r8a7778 SoC by
adding platform devices together with clock bindings.
DT device description is excluded at this point since
such bindings are still under development.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: add R8A7778 basis support
Kuninori Morimoto [Thu, 21 Mar 2013 10:01:36 +0000 (03:01 -0700)]
ARM: shmobile: add R8A7778 basis support

Add initial support for the R8A7778 R-Car M1A SoC.
No static virtual mappings are used, all the components
make use of ioremap().
DT_MACHINE_START is still wrapped
in CONFIG_USE_OF to match other mach-shmobile code.

It is based on v1.0 datasheet

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: sh73a0: wait for completion when kicking the clock
Guennadi Liakhovetski [Thu, 28 Feb 2013 12:21:58 +0000 (13:21 +0100)]
ARM: shmobile: sh73a0: wait for completion when kicking the clock

To reconfigure clocks, controlled by FRQCRA and FRQCRB, a kick bit has to
be set and to make sure the setting has taken effect, it has to be read
back repeatedly until it is cleared by the hardware. This patch adds the
waiting part, that was missing until now.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Magnus Damm <damm@opensource.se
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: r8a73a4 PFC support
Magnus Damm [Tue, 26 Mar 2013 01:34:52 +0000 (10:34 +0900)]
ARM: shmobile: r8a73a4 PFC support

Add a platform device for the r8a73a4 PFC.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: r8a73a4 IRQC support V2
Magnus Damm [Tue, 26 Mar 2013 01:34:42 +0000 (10:34 +0900)]
ARM: shmobile: r8a73a4 IRQC support V2

Add IRQC interrupt controller support to r8a73a4 by
hooking up two IRQC instances to handle 58 external
IRQ signals. There IRQC controllers are tied to SPIs
of the GIC. On r8a73a4 exact IRQ pin routing is handled
by the PFC which is excluded from this patch.

Both platform devices and DT devices are added in this
patch. The platform device versions are used to provide
a static interrupt map configuration for board code
written in C.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: r8a73a4 SCIF support V3
Magnus Damm [Tue, 26 Mar 2013 01:34:33 +0000 (10:34 +0900)]
ARM: shmobile: r8a73a4 SCIF support V3

V3 of SCIF serial port support for the r8a73a4 SoC.
This is done by adding platform devices for SCIFA0
-> SCIFA1 as well as SCIFB0 -> SCIFB3 together with
clock bindings. DT device description is excluded at
this point since such bindings are still under
development.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: Initial r8a73a4 SoC support V3
Magnus Damm [Tue, 26 Mar 2013 01:34:24 +0000 (10:34 +0900)]
ARM: shmobile: Initial r8a73a4 SoC support V3

V3 of initial support for the r8a73a4 SoC including:
 - Single Cortex-A15 CPU Core
 - GIC
 - Architecture timer

No static virtual mappings are used, all the components
make use of ioremap(). DT_MACHINE_START is still wrapped
in CONFIG_USE_OF to match other mach-shmobile code.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoMerge tag 'renesas-intc-external-irq2-for-v3.10' into soc-base
Simon Horman [Tue, 2 Apr 2013 01:55:57 +0000 (10:55 +0900)]
Merge tag 'renesas-intc-external-irq2-for-v3.10' into soc-base

Update for Renesas INTC External IRQ pin driver for v3.10

This adds support for shared interrupt lines to the
Renesas INTC External IRQ pin driver which has already
been queued up for v3.10 (tag renesas-intc-external-irq-for-v3.10).

The patch "irqchip: intc-irqpin: Add support for shared interrupt lines"
in renesas-intc-external-irq2-for-v3.10 is a dependency for
"ARM: shmobile: r8a7740: Migrate from INTC to GIC". That dependency is
the reason for this merge.

11 years agoirqchip: intc-irqpin: Add support for shared interrupt lines
Bastian Hecht [Wed, 27 Mar 2013 13:54:03 +0000 (14:54 +0100)]
irqchip: intc-irqpin: Add support for shared interrupt lines

On some hardware we don't have a 1-1 mapping from the external
interrupts coming from INTC to the GIC SPI pins. We can however
share lines to demux incoming IRQs on these SoCs.

This patch enables the intc_irqpin driver to detect requests for shared
interrupt lines and demuxes them properly by querying the INTC INTREQx0A
registers.

If you need multiple shared intc_irqpin device instances, be sure to mask
out all interrupts on the INTC that share the one line before you start
to register them. Else you run into IRQ floods that would be caused by
interrupts for which no handler has been set up yet when the first
intc_irqpin device is registered.

Signed-off-by: Bastian Hecht <hechtb+renesas@gmail.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoirqchip: irqc: Add DT support
Magnus Damm [Wed, 6 Mar 2013 06:23:39 +0000 (15:23 +0900)]
irqchip: irqc: Add DT support

Add DT support to the IRQC External IRQ Pin driver.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoirqchip: intc-irqpin: Initial DT support
Magnus Damm [Wed, 6 Mar 2013 06:16:08 +0000 (15:16 +0900)]
irqchip: intc-irqpin: Initial DT support

Add initial DT support to the INTC External IRQ Pin
driver. At this point only hardware with 4-bit wide
sense registers is supported via DT.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: Make r8a7779 INTC irqpin platform data static
Magnus Damm [Wed, 6 Mar 2013 06:10:06 +0000 (15:10 +0900)]
ARM: shmobile: Make r8a7779 INTC irqpin platform data static

The platform data for the INTC irq pin driver
seems to be global symbols, make it static to
allow multi-soc build.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: Make sh73a0 INTC irqpin platform data static
Magnus Damm [Wed, 6 Mar 2013 06:08:31 +0000 (15:08 +0900)]
ARM: shmobile: Make sh73a0 INTC irqpin platform data static

The platform data for the INTC irq pin driver
seems to be global symbols, make it static to
allow multi-soc build.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoirqchip: Renesas IRQC driver
Magnus Damm [Wed, 27 Feb 2013 08:15:01 +0000 (17:15 +0900)]
irqchip: Renesas IRQC driver

This patch adds a driver for external IRQ pins connected
to the IRQC hardware block on recent SoCs from Renesas.

The IRQC hardware block is used together with more
recent ARM based SoCs using the GIC. As usual the GIC
requires external IRQ trigger setup somewhere else
which in this particular case happens to be IRQC.

This driver implements the glue code needed to configure
IRQ trigger and also handle mask/unmask and demux of
external IRQ pins hooked up from the IRQC to the GIC.

Tested on r8a73a4 but is designed to work with a wide
range of SoCs. The driver requires one GIC SPI per
external IRQ pin to operate.  Each driver instance
will handle up to 32 external IRQ pins.

The SoCs using this driver are currently mainly used
together with regular platform devices so this driver
allows configuration via platform data to support things
like static interrupt base address. DT support will
be added incrementally in the not so distant future.

Signed-off-by: Magnus Damm <damm@opensource.se>
Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoirqchip: intc-irqpin: GPL header for platform data
Magnus Damm [Tue, 26 Feb 2013 11:59:23 +0000 (20:59 +0900)]
irqchip: intc-irqpin: GPL header for platform data

Add GPL header to platform data include file.

Signed-off-by: Magnus Damm <damm@opensource.se>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoirqchip: intc-irqpin: Make use of devm functions
Magnus Damm [Tue, 26 Feb 2013 11:59:13 +0000 (20:59 +0900)]
irqchip: intc-irqpin: Make use of devm functions

Use devm_kzalloc(), devm_ioremap_nocache()
and devm_request_irq() to simplify error
handling.

Signed-off-by: Magnus Damm <damm@opensource.se>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoirqchip: intc-irqpin: Add force comments
Magnus Damm [Tue, 26 Feb 2013 11:59:04 +0000 (20:59 +0900)]
irqchip: intc-irqpin: Add force comments

Add comments to describe the special case for
"force" versions of enable and disable functions.

Signed-off-by: Magnus Damm <damm@opensource.se>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoirqchip: intc-irqpin: Cache mapped IRQ
Magnus Damm [Tue, 26 Feb 2013 11:58:54 +0000 (20:58 +0900)]
irqchip: intc-irqpin: Cache mapped IRQ

Cache IRQ in domain_irq variable instead of
making use of irq_find_mapping(). While at it
rename the irq variable to requested_irq.

Signed-off-by: Magnus Damm <damm@opensource.se>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoirqchip: intc-irqpin: Whitespace fixes
Magnus Damm [Tue, 26 Feb 2013 11:58:44 +0000 (20:58 +0900)]
irqchip: intc-irqpin: Whitespace fixes

Remove whitespace damage and add newline
between variables and code.

Signed-off-by: Magnus Damm <damm@opensource.se>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: INTC External IRQ pin driver on r8a7779
Magnus Damm [Tue, 26 Feb 2013 03:01:18 +0000 (12:01 +0900)]
ARM: shmobile: INTC External IRQ pin driver on r8a7779

Update the r8a7779 IRQ code to make use of the
INTC External IRQ pin driver for external
interrupt pins IRQ0 -> IRQ3.

The r8a7779 SoC can like older SH SoCs configure
to use the IRQ0 -> IRQ3 signals as individual
interrupts or a combined IRL mode.

Without this patch the r8a7779 SoC code does
not fully support external IRQ pins in individual
IRQ mode. The r8a7779 PFC code does not yet have
gpio_to_irq() support so no need to update such
code.

At this point the DT reference implementations
are not covered. In the future such code shall
tie in the INTC External IRQ pin driver via
DT, so this kind of verbose code is not needed
for the long term DT case.

Signed-off-by: Magnus Damm <damm@opensource.se>
Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: INTC External IRQ pin driver on sh73a0
Magnus Damm [Tue, 26 Feb 2013 03:01:09 +0000 (12:01 +0900)]
ARM: shmobile: INTC External IRQ pin driver on sh73a0

Adjust the sh73a0 IRQ code to make use of the
INTC External IRQ pin driver for external
interrupt pins IRQ0 -> IRQ31.

This removes quite a bit of special-case code
in intc-sh73a0.c but the number of lines get
replaced with platform device information in
setup-sh73a0.c. The PFC code is also adjusted
to make gpio_to_irq() return the correct
interrupt number.

At this point the DT reference implementations
are not covered. In the future such code shall
tie in the INTC External IRQ pin driver via
DT, so this kind of verbose code is not needed
for the long term DT case.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: irq_pin() for static IRQ pin assignment
Magnus Damm [Tue, 26 Feb 2013 03:00:59 +0000 (12:00 +0900)]
ARM: shmobile: irq_pin() for static IRQ pin assignment

Add the macro irq_pin() to let board-specific code using
platform devices tie in external IRQn pins in a common way.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoirqchip: Renesas INTC External IRQ pin driver
Magnus Damm [Mon, 18 Feb 2013 14:28:34 +0000 (23:28 +0900)]
irqchip: Renesas INTC External IRQ pin driver

This patch adds a driver for external IRQ pins connected
to the INTC block on recent SoCs from Renesas.

The INTC hardware block usually contains a rather wide
range of features ranging from external IRQ pin handling
to legacy interrupt controller support. On older SoCs
the INTC is used as a general purpose interrupt controller
both for external IRQ pins and on-chip devices.

On more recent ARM based SoCs with Cortex-A9 the main
interrupt controller is the GIC, but IRQ trigger setup
still need to happen in the INTC hardware block.

This driver implements the glue code needed to configure
IRQ trigger and also handle mask/unmask and demux of
external IRQ pins hooked up from the INTC to the GIC.

Tested on sh73a0 and r8a7779. The hardware varies quite
a bit with SoC model, for instance register width and
bitfield widths vary wildly. The driver requires one GIC
SPI per external IRQ pin to operate.  Each driver instance
will handle up to 8 external IRQ pins.

The SoCs using this driver are currently mainly used
together with regular platform devices so this driver
allows configuration via platform data to support things
like static interrupt base address. DT support will
be added incrementally in the not so distant future.

Signed-off-by: Magnus Damm <damm@opensource.se>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agor8a7779: Add Display Unit clock support
Phil Edworthy [Thu, 31 Jan 2013 01:45:01 +0000 (02:45 +0100)]
r8a7779: Add Display Unit clock support

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
[Rename device from to rcarfb to rcar-du]
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
[Manual conflict resolution]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoclocksource: sh_mtu2: Set initcall level to subsys
Simon Horman [Tue, 5 Mar 2013 06:40:42 +0000 (15:40 +0900)]
clocksource: sh_mtu2: Set initcall level to subsys

The reason for this is to ensure that MTU2 is probed earlier
than with its previous initcall level, module init.

This came up as a problem with using CMT as a clock source kzm9g-reference
which does not make use of early timers or devices. In that scenario
initialisation of SDHI and MMCIF both stall on msleep() calls due to the
absence of a initialised clock source.

The purpose of this change is to keep the MTU2 code in sync with the CMT code
which has been modified in a similar manner..

Compile tested only using se7206_defconfig.
I do not believe I have any boards that support the MTU2.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoclocksource: em_sti: Set initcall level to subsys
Simon Horman [Tue, 5 Mar 2013 06:40:42 +0000 (15:40 +0900)]
clocksource: em_sti: Set initcall level to subsys

The reason for this is to ensure that STI is probed earlier
than with its previous initcall level, module init.

This came up as a problem with using CMT as a clock source kzm9g-reference
which does not make use of early timers or devices. In that scenario
initialisation of SDHI and MMCIF both stall on msleep() calls due to the
absence of a initialised clock source.

The purpose of this change is to keep the STI code in sync with the CMT code
which has been modified in a similar manner..

Boot tested on: kzm9d.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoclocksource: sh_tmu: Set initcall level to subsys
Simon Horman [Tue, 5 Mar 2013 06:40:42 +0000 (15:40 +0900)]
clocksource: sh_tmu: Set initcall level to subsys

The reason for this is to ensure that TMU is probed earlier
than with its previous initcall level, module init.

This came up as a problem with using CMT as a clock source kzm9g-reference
which does not make use of early timers or devices. In that scenario
initialisation of SDHI and MMCIF both stall on msleep() calls due to the
absence of a initialised clock source.

The purpose of this change is to keep the TMU code in sync with the CMT code
which has been modified in a similar manner..

Boot tested on: mackerel.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoclocksource: sh_cmt: Set initcall level to subsys
Simon Horman [Tue, 5 Mar 2013 06:40:42 +0000 (15:40 +0900)]
clocksource: sh_cmt: Set initcall level to subsys

The reason for this is to ensure that CMT is probed earlier
than with its previous initcall level, module init.

This came up as a problem with using kzm9g-reference which does
not make use of early timers or devices. In that scenario initialisation
of SDHI and MMCIF both stall on msleep() calls due to the absence
of a initialised clock source.

Boot tested on: armadillo800eva, mackerel and kzm9g

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoclocksource: sh_cmt: Add CMT register layout comment
Magnus Damm [Fri, 14 Dec 2012 05:54:37 +0000 (14:54 +0900)]
clocksource: sh_cmt: Add CMT register layout comment

Add a comment about different register layouts
supported by the CMT driver.

Signed-off-by: Magnus Damm <damm@opensource.se>
Acked-by: John Stultz <john.stultz@linaro.org>
Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoclocksource: sh_cmt: Add control register callbacks
Magnus Damm [Fri, 14 Dec 2012 05:54:28 +0000 (14:54 +0900)]
clocksource: sh_cmt: Add control register callbacks

This patch adds control register callbacks for the CMT
driver. At this point only 16-bit access is supported
but in the future this will be updated to allow 32-bit
access as well.

Signed-off-by: Magnus Damm <damm@opensource.se>
Acked-by: John Stultz <john.stultz@linaro.org>
Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoclocksource: sh_cmt: CMCNT and CMCOR register access update
Magnus Damm [Fri, 14 Dec 2012 05:54:19 +0000 (14:54 +0900)]
clocksource: sh_cmt: CMCNT and CMCOR register access update

Break out the CMCNT and CMCOR register access code
into separate 16-bit and 32-bit functions that are
hooked into callbacks at init time. This reduces
the amount of software calculations happening at
runtime.

Signed-off-by: Magnus Damm <damm@opensource.se>
Acked-by: John Stultz <john.stultz@linaro.org>
Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoclocksource: sh_cmt: CMSTR and CMCSR register access update
Magnus Damm [Fri, 14 Dec 2012 05:54:10 +0000 (14:54 +0900)]
clocksource: sh_cmt: CMSTR and CMCSR register access update

Update hardware register access code for CMSTR and CMCSR
from using sh_cmt_read() and sh_cmt_write() to make use
of 16-bit register access functions such as sh_cmt_read16()
and sh_cmt_write16(). Also update sh_cmt_read() and
sh_cmt_write() now when the special cases are gone.

This patch moves us one step closer to the goal of separating
counter register access functions from control control register
functions.

Signed-off-by: Magnus Damm <damm@opensource.se>
Acked-by: John Stultz <john.stultz@linaro.org>
Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoclocksource: sh_cmt: Consolidate platform_set_drvdata() call
Magnus Damm [Fri, 14 Dec 2012 05:53:51 +0000 (14:53 +0900)]
clocksource: sh_cmt: Consolidate platform_set_drvdata() call

Cleanup the use of platform_set_drvdata() to reduce code size

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Magnus Damm <damm@opensource.se>
Acked-by: John Stultz <john.stultz@linaro.org>
Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoclocksource: sh_cmt: Introduce per-register functions
Magnus Damm [Fri, 14 Dec 2012 05:54:00 +0000 (14:54 +0900)]
clocksource: sh_cmt: Introduce per-register functions

Introduce sh_cmt_read_cmstr/cmcsr/cmcnt() and
sh_cmt_write_cmstr/cmcsr/cmcnt/cmcor() to in the
future allow us to split counter registers from
control registers and reduce code complexity by
removing sh_cmt_read() and sh_cmt_write().

Signed-off-by: Magnus Damm <damm@opensource.se>
Acked-by: John Stultz <john.stultz@linaro.org>
Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoclocksource: sh_cmt: Initialize 'max_match_value' and 'lock' in sh_cmt_setup()
Magnus Damm [Fri, 14 Dec 2012 05:53:41 +0000 (14:53 +0900)]
clocksource: sh_cmt: Initialize 'max_match_value' and 'lock' in sh_cmt_setup()

Move the setup of spinlock and max_match_value to sh_cmt_setup().
There's no need to defer those steps until sh_cmt_register().

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Magnus Damm <damm@opensource.se>
Acked-by: John Stultz <john.stultz@linaro.org>
Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoclocksource: sh_cmt: Take care of clk_put() when setup_irq() fails
Magnus Damm [Fri, 14 Dec 2012 05:53:32 +0000 (14:53 +0900)]
clocksource: sh_cmt: Take care of clk_put() when setup_irq() fails

Make sure clk_put() is called in case of failure in sh_cmt_setup().

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Magnus Damm <damm@opensource.se>
Acked-by: John Stultz <john.stultz@linaro.org>
Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: R8A7779: use gic_iid() in SATA IRQ resource
Sergei Shtylyov [Thu, 7 Mar 2013 23:31:03 +0000 (02:31 +0300)]
ARM: shmobile: R8A7779: use gic_iid() in SATA IRQ resource

Commit "ARM: shmobile: r8a7779: use gic_iid macro" switched R8A7779 platform
devices to using gic_iid() macro instead of gic_spi() but commit "ARM: mach-
shmobile: r8a7779: add SATA support" added another use of gic_spi(). Convert
the SATA IRQ resource to using gic_iid().

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: mach-shmobile: r8a7779: add SATA support
Vladimir Barinov [Wed, 27 Feb 2013 20:39:14 +0000 (23:39 +0300)]
ARM: mach-shmobile: r8a7779: add SATA support

Add SATA clock for r8a7779 SoC (for both device tree and usual cases).
Register SATA controller as a "late" platform device on r8a7779 SoC.

Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: mach-shmobile: r8a7779: SATA DT configuration
Vladimir Barinov [Wed, 27 Feb 2013 20:34:36 +0000 (23:34 +0300)]
ARM: mach-shmobile: r8a7779: SATA DT configuration

Allow configuration of the r8a7779 SoC SATA controller using a flattened device
tree.

Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: r8a7779: add Thermal support on DT
Kuninori Morimoto [Mon, 4 Mar 2013 08:32:16 +0000 (00:32 -0800)]
ARM: shmobile: r8a7779: add Thermal support on DT

76cc1887496fe80138c6b07c37d7f81e4cf27cde
(thermal: rcar: add Device Tree support)
supported rcar_thermal DT probing.

rcar thermal driver doesn't support IRQ on r8a7779 chip
since it is using old design IRQ.
R-Car/R-Mobile next generation chips are using new design IRQ,
and rcar thermal driver is supporting these.

This patch adds rcar_thermal DT support for r8a7779 without IRQ.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: tidyup chip series definition order for r8a7740/r8a7779
Kuninori Morimoto [Mon, 4 Mar 2013 07:30:19 +0000 (23:30 -0800)]
ARM: shmobile: tidyup chip series definition order for r8a7740/r8a7779

move r8a7740_meram_workaround() to r8a7740 area
from r8a7779 area

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: r8a7779: use gic_iid macro
Kuninori Morimoto [Mon, 4 Mar 2013 07:11:41 +0000 (23:11 -0800)]
ARM: shmobile: r8a7779: use gic_iid macro

"ARM: shmobile: add gic_iid macro for ICCIAR / interrupt ID"
enabled to use gic_iid macro.
This patch exchange current GIC interrupt setting
from gic_spi() to gic_iid()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
[ horms+renesas@verge.net.au: Updated git commit id in changelog ]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: r8a7779: fixup DT machine name
Kuninori Morimoto [Mon, 4 Mar 2013 07:11:20 +0000 (23:11 -0800)]
ARM: shmobile: r8a7779: fixup DT machine name

r8a7779 is not sh73a0

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: r8a7779: fixup dtsi typo
Kuninori Morimoto [Mon, 4 Mar 2013 07:11:03 +0000 (23:11 -0800)]
ARM: shmobile: r8a7779: fixup dtsi typo

r8a7779 is not r8a7740 chip

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: add gic_iid macro for ICCIAR / interrupt ID
Kuninori Morimoto [Mon, 25 Feb 2013 09:39:44 +0000 (01:39 -0800)]
ARM: shmobile: add gic_iid macro for ICCIAR / interrupt ID

R-Car H1 datasheet GIC number is indicating
GIC ICCIAR / interrupt ID number, not SPI number,
but current marzen board code is using gic_spi() with
un-understandable calculation.

This patch adds new gic_iid() macro which means
ICCIAR / interrupt ID, and used the number
currently written on datasheet.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
[ horms+renesas@verge.net.au: Split board-marzen.c portion into a separate patch ]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: mach-shmobile: r8a7740: Add DT names to clock list
Bastian Hecht [Tue, 26 Feb 2013 17:03:27 +0000 (11:03 -0600)]
ARM: mach-shmobile: r8a7740: Add DT names to clock list

This adds temporarily the alternative device names to the clock list
that are used when booting via Device Tree setup.

Signed-off-by: Bastian Hecht <hechtb+renesas@gmail.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: Remove unused hotplug.c
Magnus Damm [Mon, 18 Feb 2013 13:48:03 +0000 (22:48 +0900)]
ARM: shmobile: Remove unused hotplug.c

Each CPU Hotplug implementation for mach-shmobile
is now self-contained, so this change removes unused
helper code in hotplug.c. The two CPU Hotplug capable
SoCs sh73a0 and r8a7779 remain unchanged.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: Rearrange r8a7779 cpu hotplug code
Magnus Damm [Mon, 18 Feb 2013 13:47:54 +0000 (22:47 +0900)]
ARM: shmobile: Rearrange r8a7779 cpu hotplug code

Update the r8a7779 SMP code and CPU Hotplug in particular
to follow the same style as sh73a0. This means dropping
__maybe_unused for #ifdef CONFIG_HOTPLUG_CPU.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: Use sh73a0-specific cpu disable code
Magnus Damm [Mon, 18 Feb 2013 13:47:44 +0000 (22:47 +0900)]
ARM: shmobile: Use sh73a0-specific cpu disable code

Convert the sh73a0 CPU Hotplug code to use a local
implementation of ->cpu_disable(). With this change
in place the sh73a0 SMP code does no longer depend
on hotplug.c.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: Update r8a7779 to use scu_power_mode()
Magnus Damm [Mon, 18 Feb 2013 13:47:35 +0000 (22:47 +0900)]
ARM: shmobile: Update r8a7779 to use scu_power_mode()

Update the SMP code for R8A7779 to make use of the
shared SCU function scu_power_mode() together with
the early setup code in shmobile_secondary_vector_scu.

With this patch in place the secondary CPUs modify the
SCU setting during early boot instead of letting other
CPUs deal with the coherency setting before boot. In
other words, we used to setup coherency before boot
in r8a7779_boot_secondary() but that bit is now instead
handled by the code in shmobile_secondary_vector_scu.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: Update r8a7779 to check SCU for hotplug
Magnus Damm [Mon, 18 Feb 2013 13:47:25 +0000 (22:47 +0900)]
ARM: shmobile: Update r8a7779 to check SCU for hotplug

Update the r8a7779 CPU Hotplug code to use SCU PSR
to wait for the target CPU core. Previously the
shared code in hotplug.c was used to let cpu_kill()
wait for cpu_die(). With this change in place the
r8a7779 SMP code does not depend on hotplug.c anymore.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: Use R8A7779_SCU_BASE with TWD
Magnus Damm [Mon, 18 Feb 2013 13:47:16 +0000 (22:47 +0900)]
ARM: shmobile: Use R8A7779_SCU_BASE with TWD

Rework the IOMEM() usage for the SCU base address in the
case of r8a7779. Adjusts the TWD to use R8A7779_SCU_BASE.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: Rework SH73A0_SCU_BASE IOMEM() usage
Magnus Damm [Mon, 18 Feb 2013 13:47:07 +0000 (22:47 +0900)]
ARM: shmobile: Rework SH73A0_SCU_BASE IOMEM() usage

Rework the IOMEM() usage for the SCU base address in the
case of sh73a0. Removes recently introduced build warnings:

arch/arm/mach-shmobile/smp-sh73a0.c:45:15: warning: initialization makes integer from pointer without a cast [enabled by default]
arch/arm/mach-shmobile/smp-sh73a0.c:45:15: warning: (near initialization for 'twd_local_timer.res[0].start') [enabled by default]
arch/arm/mach-shmobile/smp-sh73a0.c:45:15: warning: initialization makes integer from pointer without a cast [enabled by default]
/arch/arm/mach-shmobile/smp-sh73a0.c:45:15: warning: (near initialization for 'twd_local_timer.res[0].end') [enabled by default]

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: Fix base address readout in headsmp-scu.S
Magnus Damm [Mon, 18 Feb 2013 13:46:57 +0000 (22:46 +0900)]
ARM: shmobile: Fix base address readout in headsmp-scu.S

Rework the early SCU setup code in headsmp-scu.S to read
the base address in the same way as we use to fetch the
address of the invalidation function.

Reported-by: Bastian Hecht <hechtb@gmail.com>
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: r8a7779: Remove lan from dtsi
Simon Horman [Tue, 19 Feb 2013 02:32:36 +0000 (11:32 +0900)]
ARM: shmobile: r8a7779: Remove lan from dtsi

The ethernet controller is not part of the r8a7779 SoC.

Cc: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: r8a7779: Do not initialise i2c as an early device
Simon Horman [Tue, 19 Feb 2013 01:53:05 +0000 (10:53 +0900)]
ARM: shmobile: r8a7779: Do not initialise i2c as an early device

It is sufficient to initialise i2c as a late device.

Cc: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: r8a7779: Do not use early devices with DT reference
Simon Horman [Tue, 19 Feb 2013 01:53:05 +0000 (10:53 +0900)]
ARM: shmobile: r8a7779: Do not use early devices with DT reference

Do not initialise any early devices when using the minimal DT reference
code. Only the delay needs to be initialised.

Cc: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: sh73a0: Do not use early devices with DT reference
Simon Horman [Tue, 19 Feb 2013 01:53:05 +0000 (10:53 +0900)]
ARM: shmobile: sh73a0: Do not use early devices with DT reference

Do not initialise any early devices when using the minimal DT reference
code. Only the delay needs to be initialised.

Cc: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: sh73a0: Remove warning about SMP
Simon Horman [Fri, 15 Feb 2013 12:38:20 +0000 (21:38 +0900)]
ARM: shmobile: sh73a0: Remove warning about SMP

Remove warning about SMP not working with the
clock initialisation sheme used for reference DT.

This is resolved by not selecting CONFIG_PREEMPT.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: sh73a0: Add smp ops to DT_MACHINE_START
Simon Horman [Fri, 15 Feb 2013 12:38:20 +0000 (21:38 +0900)]
ARM: shmobile: sh73a0: Add smp ops to DT_MACHINE_START

This a board to be brought up with SMP enabled
without a board file present.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: sh73a0: Remove sh73a0_init_irq_dt()
Simon Horman [Fri, 15 Feb 2013 12:38:20 +0000 (21:38 +0900)]
ARM: shmobile: sh73a0: Remove sh73a0_init_irq_dt()

This is not needed as irq_set_wake is
only used for suspend to ram which is not
a requirement for bringing up boards using DT.

Reported-by: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: sh73a0: fix Z and ZG clock hierarchy
Guennadi Liakhovetski [Fri, 22 Feb 2013 17:17:51 +0000 (18:17 +0100)]
ARM: shmobile: sh73a0: fix Z and ZG clock hierarchy

Z and ZG clocks on sh73a0 have pll0 as their parent, not pll1.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: Make EMEV2 setup functions static
Magnus Damm [Wed, 13 Feb 2013 13:49:47 +0000 (22:49 +0900)]
ARM: shmobile: Make EMEV2 setup functions static

Adjust emev2_init_delay() and emev2_add_standard_devices_dt()
to become static. They are not used outside this file anyway.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: Update EMEV2 to use scu_power_mode()
Magnus Damm [Wed, 13 Feb 2013 13:47:27 +0000 (22:47 +0900)]
ARM: shmobile: Update EMEV2 to use scu_power_mode()

Update the SMP code for EMEV2 to make use of the
shared SCU function scu_power_mode() together with
the early setup code in shmobile_secondary_vector_scu.

With this patch in place the secondary CPUs modify the
SCU setting during early boot instead of letting other
CPUs deal with the coherency setting before boot. In
other words, we used to setup coherency before boot
in emev2_boot_secondary() but that bit is now instead
handled by the code in shmobile_secondary_vector_scu.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: Common shmobile_scu_base in headsmp-scu.S
Magnus Damm [Wed, 13 Feb 2013 13:47:17 +0000 (22:47 +0900)]
ARM: shmobile: Common shmobile_scu_base in headsmp-scu.S

Update the code in headsmp-scu.S to use a global
shmobile_scu_base variable both for convenient SCU
base address storage and for the early SCU setup
code in shmobile_secondary_vector_scu.

With this patch applied r8a7779, sh73a0 and EMEV2
all make use of the global shmobile_scu_base
variable. However only sh73a0 makes use of the SCU
bring up code in shmobile_secondary_vector_scu.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: Move headsmp-sh73a0.S to headsmp-scu.S
Magnus Damm [Wed, 13 Feb 2013 13:47:07 +0000 (22:47 +0900)]
ARM: shmobile: Move headsmp-sh73a0.S to headsmp-scu.S

Rename headsmp-sh73a0.S into headsmp-scu.S and
introduce shmobile_secondary_vector_scu().

The goal is to be able to share the function
above between all mach-shmobile SoCs that use
SCU for SMP. So far only sh73a0 use this.

At this time the SCU base address is still hard
coded in headsmp-scu.S to 0xf0000000, but this
will be changed in the future.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
11 years agoARM: shmobile: Rework EMEV2 scu_base variable
Magnus Damm [Wed, 13 Feb 2013 13:46:57 +0000 (22:46 +0900)]
ARM: shmobile: Rework EMEV2 scu_base variable

Rename the static scu_base variable into shmobile_scu_base.

Later in the series the shmobile_scu_base variable will be
made into a global variable so this is preparation only.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>