firefly-linux-kernel-4.4.55.git
10 years agoARM: shmobile: r7s72100: remove SPI DT clocks from legacy clock support
Wolfram Sang [Wed, 14 May 2014 01:10:14 +0000 (03:10 +0200)]
ARM: shmobile: r7s72100: remove SPI DT clocks from legacy clock support

Not used anymore since we switched to CCF.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r7s72100: add spi clocks to dtsi
Wolfram Sang [Wed, 14 May 2014 01:10:13 +0000 (03:10 +0200)]
ARM: shmobile: r7s72100: add spi clocks to dtsi

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r7s72100: remove I2C DT clocks from legacy clock support
Wolfram Sang [Wed, 14 May 2014 01:10:12 +0000 (03:10 +0200)]
ARM: shmobile: r7s72100: remove I2C DT clocks from legacy clock support

Not used anymore since we switched to CCF.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r7s72100: add i2c clocks to dtsi
Wolfram Sang [Wed, 14 May 2014 01:10:11 +0000 (03:10 +0200)]
ARM: shmobile: r7s72100: add i2c clocks to dtsi

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r7s72100: genmai: platform scif devices only for legacy support
Wolfram Sang [Wed, 14 May 2014 01:10:10 +0000 (03:10 +0200)]
ARM: shmobile: r7s72100: genmai: platform scif devices only for legacy support

We have now DT support for SCIF, so use the platform_device
initialization only for the legacy support.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r7s72100: genmai: add uart alias and activate scif2 as console
Wolfram Sang [Wed, 14 May 2014 01:10:09 +0000 (03:10 +0200)]
ARM: shmobile: r7s72100: genmai: add uart alias and activate scif2 as console

We keep the UART naming backwards compatible with the legacy version.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r7s72100: add scif nodes to dtsi
Wolfram Sang [Wed, 14 May 2014 01:10:08 +0000 (03:10 +0200)]
ARM: shmobile: r7s72100: add scif nodes to dtsi

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r7s72100: genmai: populate nodes for external clocks
Wolfram Sang [Wed, 14 May 2014 01:10:07 +0000 (03:10 +0200)]
ARM: shmobile: r7s72100: genmai: populate nodes for external clocks

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r7s72100: add essential clock nodes to dtsi
Wolfram Sang [Wed, 14 May 2014 01:10:06 +0000 (03:10 +0200)]
ARM: shmobile: r7s72100: add essential clock nodes to dtsi

Only essential clocks are added for now. Other clocks will be added when
needed.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r7s72100: document MSTP clock support
Wolfram Sang [Wed, 14 May 2014 01:10:05 +0000 (03:10 +0200)]
ARM: shmobile: r7s72100: document MSTP clock support

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r7s72100: Switch to new style MTU2 device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:22 +0000 (13:15 +0200)]
ARM: shmobile: r7s72100: Switch to new style MTU2 device

The MTU2 (Multi-Function Timer Pulse Unit 2) driver implements a new
style of platform data that handles the timer as a single device with
multiple channel. Switch from the old-style platform data to the
new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agosh: Switch to new style MTU2 device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:21 +0000 (13:15 +0200)]
sh: Switch to new style MTU2 device

The MTU2 (Multi-Function Timer Pulse Unit 2) driver implements a new
style of platform data that handles the timer as a single device with
multiple channel. Switch from the old-style platform data to the
new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a7779: Switch to new style TMU device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:20 +0000 (13:15 +0200)]
ARM: shmobile: r8a7779: Switch to new style TMU device

The TMU (Timer Unit) driver implements a new style of platform data that
handles the timer as a single device with multiple channel. Switch from
the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a7778: Switch to new style TMU device
Laurent Pinchart [Fri, 2 May 2014 18:21:25 +0000 (20:21 +0200)]
ARM: shmobile: r8a7778: Switch to new style TMU device

The TMU (Timer Unit) driver implements a new style of platform data that
handles the timer as a single device with multiple channel. Switch from
the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a7740: Switch to new style TMU device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:18 +0000 (13:15 +0200)]
ARM: shmobile: r8a7740: Switch to new style TMU device

The TMU (Timer Unit) driver implements a new style of platform data that
handles the timer as a single device with multiple channel. Switch from
the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: sh73a0: Switch to new style TMU device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:17 +0000 (13:15 +0200)]
ARM: shmobile: sh73a0: Switch to new style TMU device

The TMU (Timer Unit) driver implements a new style of platform data that
handles the timer as a single device with multiple channel. Switch from
the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: sh7372: Switch to new style TMU device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:16 +0000 (13:15 +0200)]
ARM: shmobile: sh7372: Switch to new style TMU device

The TMU (Timer Unit) driver implements a new style of platform data that
handles the timer as a single device with multiple channel. Switch from
the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agosh: Switch to new style TMU device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:15 +0000 (13:15 +0200)]
sh: Switch to new style TMU device

The TMU (Timer Unit) driver implements a new style of platform data that
handles the timer as a single device with multiple channel. Switch from
the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a7791: Switch to new style CMT device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:14 +0000 (13:15 +0200)]
ARM: shmobile: r8a7791: Switch to new style CMT device

The CMT (Compare Match Timer) driver implements a new style of platform
data that handles the timer as a single device with multiple channel.
Switch from the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
[horms+renesas@verge.net.au resolved conflict: use clk_names]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a7790: Switch to new style CMT device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:13 +0000 (13:15 +0200)]
ARM: shmobile: r8a7790: Switch to new style CMT device

The CMT (Compare Match Timer) driver implements a new style of platform
data that handles the timer as a single device with multiple channel.
Switch from the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
[horms+renesas@verge.net.au resolved conflict: use clk_names]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a7740: Switch to new style CMT device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:12 +0000 (13:15 +0200)]
ARM: shmobile: r8a7740: Switch to new style CMT device

The CMT (Compare Match Timer) driver implements a new style of platform
data that handles the timer as a single device with multiple channel.
Switch from the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a73a4: Switch to new style CMT device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:11 +0000 (13:15 +0200)]
ARM: shmobile: r8a73a4: Switch to new style CMT device

The CMT (Compare Match Timer) driver implements a new style of platform
data that handles the timer as a single device with multiple channel.
Switch from the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: sh73a0: Switch to new style CMT device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:10 +0000 (13:15 +0200)]
ARM: shmobile: sh73a0: Switch to new style CMT device

The CMT (Compare Match Timer) driver implements a new style of platform
data that handles the timer as a single device with multiple channel.
Switch from the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: sh7372: Switch to new style CMT device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:09 +0000 (13:15 +0200)]
ARM: shmobile: sh7372: Switch to new style CMT device

The CMT (Compare Match Timer) driver implements a new style of platform
data that handles the timer as a single device with multiple channel.
Switch from the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agosh: Switch to new style CMT device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:08 +0000 (13:15 +0200)]
sh: Switch to new style CMT device

The CMT (Compare Match Timer) driver implements a new style of platform
data that handles the timer as a single device with multiple channel.
Switch from the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoMerge branch 'clockevents/cmt-mtu2-tmu-cleanups' of git://git.linaro.org/people/danie...
Simon Horman [Wed, 23 Apr 2014 01:01:02 +0000 (10:01 +0900)]
Merge branch 'clockevents/cmt-mtu2-tmu-cleanups' of git://git.linaro.org/people/daniel.lezcano/linux into cmt-mtu2-tmu-cleanups-for-v3.16

10 years agoMerge tag 'renesas-clock-for-v3.16' into cmt-mtu2-tmu-cleanups-for-v3.16
Simon Horman [Wed, 23 Apr 2014 00:59:40 +0000 (09:59 +0900)]
Merge tag 'renesas-clock-for-v3.16' into cmt-mtu2-tmu-cleanups-for-v3.16

Renesas ARM Based SoC Clock Updates for v3.16

SH Mobile shared clock code
* Introduce shmobile_clk_workaround()

r8a7791 (R-Car M2) SoC
* Rename VSP1_SY clocks to VSP1_S
* Correct the I2C clocks parents

r8a7790 (R-Car H2) SoC
* Remove old style audio clock
* Rename VSP1_(SY|RT) clocks to VSP1_(S|R)
* Fix the I2C clocks parents

r8a7778 (R-Car M1) SoC
* Remove old style audio clock

10 years agoclocksource: sh_mtu2: Sort headers alphabetically
Laurent Pinchart [Tue, 4 Mar 2014 13:11:47 +0000 (14:11 +0100)]
clocksource: sh_mtu2: Sort headers alphabetically

This helps locating duplicates and inserting new headers.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Remove FSF mail address from GPL notice
Laurent Pinchart [Tue, 4 Mar 2014 13:12:32 +0000 (14:12 +0100)]
clocksource: sh_mtu2: Remove FSF mail address from GPL notice

Do not include the paragraph about writing to the Free Software
Foundation's mailing address from the sample GPL notice. The FSF has
changed addresses in the past, and may do so again. Linux already
includes a copy of the GPL.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Rename clock to "fck" in the non-legacy case
Laurent Pinchart [Tue, 4 Mar 2014 17:09:15 +0000 (18:09 +0100)]
clocksource: sh_mtu2: Rename clock to "fck" in the non-legacy case

The sh_mtu2 driver gets the MTU2 functional clock using a connection ID
of "mtu2_fck". While all SH SoCs create clock lookup entries with a NULL
device ID and a "mtu2_fck" connection ID, the ARM SoCs use the device ID
only with a NULL connection ID. This works on legacy platforms but will
break on ARM with DT boot.

Fix the situation by using a connection ID of "fck" in the non-legacy
platform data case. Clock lookup entries will be renamed to use the
device ID as well as the connection ID as platforms get moved to new
platform data. The legacy code will eventually be dropped, leaving us
with device ID based clock lookup, compatible with DT boot.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Add support for multiple channels per device
Laurent Pinchart [Tue, 4 Mar 2014 17:05:45 +0000 (18:05 +0100)]
clocksource: sh_mtu2: Add support for multiple channels per device

MTU2 hardware devices can support multiple channels, with global
registers and per-channel registers. The sh_mtu2 driver currently models
the hardware with one Linux device per channel. This model makes it
difficult to handle global registers in a clean way.

Add support for a new model that uses one Linux device per timer with
multiple channels per device. This requires changes to platform data,
add new channel configuration fields.

Support for the legacy model is kept and will be removed after all
platforms switch to the new model.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Hardcode MTU2 clock event rating to 200
Laurent Pinchart [Tue, 4 Mar 2014 14:19:41 +0000 (15:19 +0100)]
clocksource: sh_mtu2: Hardcode MTU2 clock event rating to 200

All boards use clock event ratings of 200 for the MTU2, hardcode it in
the driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Set cpumask to cpu_possible_mask
Laurent Pinchart [Tue, 4 Mar 2014 14:22:19 +0000 (15:22 +0100)]
clocksource: sh_mtu2: Set cpumask to cpu_possible_mask

The MTU2 is not tied to CPU0, make it usable on any CPU.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Replace hardcoded register values with macros
Laurent Pinchart [Tue, 4 Mar 2014 14:16:25 +0000 (15:16 +0100)]
clocksource: sh_mtu2: Replace hardcoded register values with macros

Define symbolic macros for all used registers bits.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Allocate channels dynamically
Laurent Pinchart [Tue, 4 Mar 2014 13:23:00 +0000 (14:23 +0100)]
clocksource: sh_mtu2: Allocate channels dynamically

This prepares the driver for multi-channel support.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Replace kmalloc + memset with kzalloc
Laurent Pinchart [Tue, 4 Mar 2014 13:10:55 +0000 (14:10 +0100)]
clocksource: sh_mtu2: Replace kmalloc + memset with kzalloc

One kzalloc a day keeps the bugs away.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Add index to struct sh_mtu2_channel
Laurent Pinchart [Tue, 4 Mar 2014 13:17:26 +0000 (14:17 +0100)]
clocksource: sh_mtu2: Add index to struct sh_mtu2_channel

Use the index as the timer start/stop bit and when printing messages to
identify the channel.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Add memory base to sh_mtu2_channel structure
Laurent Pinchart [Tue, 4 Mar 2014 13:04:24 +0000 (14:04 +0100)]
clocksource: sh_mtu2: Add memory base to sh_mtu2_channel structure

The channel memory base is channel-specific, add it to the channel
structure in preparation for support of multiple channels per device.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Constify name argument to sh_mtu2_register()
Laurent Pinchart [Tue, 4 Mar 2014 12:57:14 +0000 (13:57 +0100)]
clocksource: sh_mtu2: Constify name argument to sh_mtu2_register()

The name argument is assigned to const structure fields only, constify
it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Split channel setup to separate function
Laurent Pinchart [Tue, 4 Mar 2014 12:11:23 +0000 (13:11 +0100)]
clocksource: sh_mtu2: Split channel setup to separate function

Move the channel setup code from sh_mtu2_setup to a new
sh_mtu2_setup_channel function and call it from sh_mtu2_setup.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Rename struct sh_mtu2_priv to sh_mtu2_device
Laurent Pinchart [Tue, 4 Mar 2014 12:04:48 +0000 (13:04 +0100)]
clocksource: sh_mtu2: Rename struct sh_mtu2_priv to sh_mtu2_device

Channel data is private as well, rename priv to device to make the
distrinction between the core device and the channels clearer.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Split channel fields from sh_mtu2_priv
Laurent Pinchart [Tue, 4 Mar 2014 11:58:30 +0000 (12:58 +0100)]
clocksource: sh_mtu2: Split channel fields from sh_mtu2_priv

Create a new sh_mtu2_channel structure to hold the channel-specific
fields in preparation for multiple channels per device support.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Turn sh_mtu2_priv fields into local variables
Laurent Pinchart [Tue, 4 Mar 2014 11:59:54 +0000 (12:59 +0100)]
clocksource: sh_mtu2: Turn sh_mtu2_priv fields into local variables

The rate and periodic fields are used in a single function only, as
local variables. Remove them from the structure.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Use request_irq() instead of setup_irq()
Laurent Pinchart [Mon, 17 Feb 2014 10:27:49 +0000 (11:27 +0100)]
clocksource: sh_mtu2: Use request_irq() instead of setup_irq()

The driver claims it needs to register an interrupt handler too early
for request_irq(). This might have been true in the past, but the only
meaningful difference between request_irq() and setup_irq() today is an
additional kzalloc() call in request_irq(). As the driver calls
kmalloc() itself we know that the slab allocator is available, we can
thus switch to request_irq().

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_tmu: Sort headers alphabetically
Laurent Pinchart [Wed, 12 Feb 2014 15:56:44 +0000 (16:56 +0100)]
clocksource: sh_tmu: Sort headers alphabetically

This helps locating duplicates and inserting new headers.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Remove FSF mail address from GPL notice
Laurent Pinchart [Fri, 14 Feb 2014 00:25:50 +0000 (01:25 +0100)]
clocksource: sh_tmu: Remove FSF mail address from GPL notice

Do not include the paragraph about writing to the Free Software
Foundation's mailing address from the sample GPL notice. The FSF has
changed addresses in the past, and may do so again. Linux already
includes a copy of the GPL.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Rename clock to "fck" in the non-legacy case
Laurent Pinchart [Thu, 13 Feb 2014 23:35:18 +0000 (00:35 +0100)]
clocksource: sh_tmu: Rename clock to "fck" in the non-legacy case

The sh_tmu driver gets the TMU functional clock using a connection ID of
"tmu_fck". While all SH SoCs create clock lookup entries with a NULL
device ID and a "tmu_fck" connection ID, the ARM SoCs use the device ID
only with a NULL connection ID. This works on legacy platforms but will
break on ARM with DT boot.

Fix the situation by using a connection ID of "fck" in the non-legacy
platform data case. Clock lookup entries will be renamed to use the
device ID as well as the connection ID as platforms get moved to new
platform data. The legacy code will eventually be dropped, leaving us
with device ID based clock lookup, compatible with DT boot.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Add support for multiple channels per device
Laurent Pinchart [Tue, 28 Jan 2014 11:36:48 +0000 (12:36 +0100)]
clocksource: sh_tmu: Add support for multiple channels per device

TMU hardware devices can support multiple channels, with global
registers and per-channel registers. The sh_tmu driver currently models
the hardware with one Linux device per channel. This model makes it
difficult to handle global registers in a clean way.

Add support for a new model that uses one Linux device per timer with
multiple channels per device. This requires changes to platform data,
add new channel configuration fields.

Support for the legacy model is kept and will be removed after all
platforms switch to the new model.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Hardcode TMU clock event and source ratings to 200
Laurent Pinchart [Wed, 19 Feb 2014 16:00:31 +0000 (17:00 +0100)]
clocksource: sh_tmu: Hardcode TMU clock event and source ratings to 200

All boards use clock event and clock source ratings of 200 for the TMU,
hardcode it in the driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Replace hardcoded register values with macros
Laurent Pinchart [Tue, 28 Jan 2014 23:33:08 +0000 (00:33 +0100)]
clocksource: sh_tmu: Replace hardcoded register values with macros

Define symbolic macros for all used registers bits.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Allocate channels dynamically
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_tmu: Allocate channels dynamically

This prepares the driver for multi-channel support.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Replace kmalloc + memset with kzalloc
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_tmu: Replace kmalloc + memset with kzalloc

One kzalloc a day keeps the bugs away.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Add index to struct sh_tmu_channel
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_tmu: Add index to struct sh_tmu_channel

Use the index as the timer start/stop bit and when printing messages to
identify the channel.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Add memory base to sh_tmu_channel structure
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_tmu: Add memory base to sh_tmu_channel structure

The channel memory base is channel-specific, add it to the channel
structure in preparation for support of multiple channels per device.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Constify name argument to sh_tmu_register()
Laurent Pinchart [Mon, 17 Feb 2014 15:04:16 +0000 (16:04 +0100)]
clocksource: sh_tmu: Constify name argument to sh_tmu_register()

The name argument is assigned to const structure fields only, constify
it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Split channel setup to separate function
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_tmu: Split channel setup to separate function

Move the channel setup code from sh_tmu_setup to a new
sh_tmu_setup_channel function and call it from sh_tmu_setup.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Rename struct sh_tmu_priv to sh_tmu_device
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_tmu: Rename struct sh_tmu_priv to sh_tmu_device

Channel data is private as well, rename priv to device to make the
distrinction between the core device and the channels clearer.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Split channel fields from sh_tmu_priv
Laurent Pinchart [Mon, 27 Jan 2014 14:29:19 +0000 (15:29 +0100)]
clocksource: sh_tmu: Split channel fields from sh_tmu_priv

Create a new sh_tmu_channel structure to hold the channel-specific
field in preparation for multiple channels per device support.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Use request_irq() instead of setup_irq()
Laurent Pinchart [Mon, 17 Feb 2014 10:27:49 +0000 (11:27 +0100)]
clocksource: sh_tmu: Use request_irq() instead of setup_irq()

The driver claims it needs to register an interrupt handler too early
for request_irq(). This might have been true in the past, but the only
meaningful difference between request_irq() and setup_irq() today is an
additional kzalloc() call in request_irq(). As the driver calls
kmalloc() itself we know that the slab allocator is available, we can
thus switch to request_irq().

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Request IRQ for clock event device only
Laurent Pinchart [Fri, 21 Feb 2014 00:24:47 +0000 (01:24 +0100)]
clocksource: sh_cmt: Request IRQ for clock event device only

Clock sources don't need an IRQ, request the IRQ only for channels used
as clock event devices.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Sort headers alphabetically
Laurent Pinchart [Wed, 12 Feb 2014 15:56:44 +0000 (16:56 +0100)]
clocksource: sh_cmt: Sort headers alphabetically

This helps locating duplicates and inserting new headers.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Remove FSF mail address from GPL notice
Laurent Pinchart [Fri, 14 Feb 2014 00:25:50 +0000 (01:25 +0100)]
clocksource: sh_cmt: Remove FSF mail address from GPL notice

Do not include the paragraph about writing to the Free Software
Foundation's mailing address from the sample GPL notice. The FSF has
changed addresses in the past, and may do so again. Linux already
includes a copy of the GPL.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Rename clock to "fck" in the non-legacy case
Laurent Pinchart [Thu, 13 Feb 2014 23:35:18 +0000 (00:35 +0100)]
clocksource: sh_cmt: Rename clock to "fck" in the non-legacy case

The sh_cmt driver gets the CMT functional clock using a connection ID of
"cmt_fck". While all SH SoCs create clock lookup entries with a NULL
device ID and a "cmt_fck" connection ID, the ARM SoCs use the device ID
only with a NULL connection ID. This works on legacy platforms but will
break on ARM with DT boot.

Fix the situation by using a connection ID of "fck" in the non-legacy
platform data case. Clock lookup entries will be renamed to use the
device ID as well as the connection ID as platforms get moved to new
platform data. The legacy code will eventually be dropped, leaving us
with device ID based clock lookup, compatible with DT boot.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Add support for multiple channels per device
Laurent Pinchart [Tue, 28 Jan 2014 11:36:48 +0000 (12:36 +0100)]
clocksource: sh_cmt: Add support for multiple channels per device

CMT hardware devices can support multiple channels, with global
registers and per-channel registers. The sh_cmt driver currently models
the hardware with one Linux device per channel. This model makes it
difficult to handle global registers in a clean way.

Add support for a new model that uses one Linux device per timer with
multiple channels per device. This requires changes to platform data,
add new channel configuration fields.

Support for the legacy model is kept and will be removed after all
platforms switch to the new model.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Hardcode CMT clock source rating to 125
Laurent Pinchart [Wed, 19 Feb 2014 16:00:31 +0000 (17:00 +0100)]
clocksource: sh_cmt: Hardcode CMT clock source rating to 125

All boards use or should use a clock source rating of 125 for the CMT,
hardcode it in the driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Hardcode CMT clock event rating to 125
Laurent Pinchart [Wed, 19 Feb 2014 16:00:31 +0000 (17:00 +0100)]
clocksource: sh_cmt: Hardcode CMT clock event rating to 125

All boards use or should use a clock event rating of 125 for the CMT,
hardcode it in the driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Set cpumask to cpu_possible_mask
Laurent Pinchart [Wed, 19 Feb 2014 15:19:44 +0000 (16:19 +0100)]
clocksource: sh_cmt: Set cpumask to cpu_possible_mask

The CMT is a global timer not restricted to a single CPU. It has a lower
rating than the TMU or ARM architected timer, but is still useful on
systems where the other timers are stopped during CPU sleep.

When multiple timers are available the timers core selects which timer
to use based on timer ratings.

On SMP systems where timer broadcasting is required, one dummy timer is
instantiated per CPU with a rating of 100. On those systems the CMT
timer has a rating of 80, which makes the dummy timer selected by
default on all CPUs. The CMT is then available, and will be used as a
broadcast timer.

On UP systems no dummy timer is instantiated. The CMT timer has a rating
of 125 on those systems and is used directly as a clock event device for
CPU0 without broadcasting.

The CMT rating shouldn't depend on whether we boot a UP or SMP system.
We can't raise the CMT rating to 125 on SMP systems. This would select
CMT as the clock event device for CPU0 as its rating is higher than the
dummy timer rating, and would leave the system without a broadcast
timer. We could instead lower the rating to 80 on all systems, but that
wouldn't reflect reality as ratings between 1 and 99 are documented as
"unfit for real use".

We should raise the rating above 99 and still have the CMT selected as a
broadcast timer. This can be done by changing the cpumask from
cpumask_of(0) to cpu_possible_mask. In that case the timer selection
logic will prefer the previously probed and already selected dummy timer
for all CPUs based on the fact that already selected per-cpu timers are
preferred over new global timers, regardless of their respective
ratings. This also better reflects reality, as the CMT is not tied to
the boot CPU.

Ideally the timer selection logic should realize that the CMT needs to
be used as a broadcast timer on SMP systems as no other broadcast timer
is available, regardless of the cpumask and rating.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Replace hardcoded register values with macros
Laurent Pinchart [Tue, 28 Jan 2014 23:33:08 +0000 (00:33 +0100)]
clocksource: sh_cmt: Replace hardcoded register values with macros

Define symbolic macros for all used registers bits.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Split static information from sh_cmt_device
Laurent Pinchart [Tue, 11 Feb 2014 22:46:48 +0000 (23:46 +0100)]
clocksource: sh_cmt: Split static information from sh_cmt_device

Create a new sh_cmt_info structure to hold static information about the
device model and reference that structure from the sh_cmt_device
structure.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Allocate channels dynamically
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_cmt: Allocate channels dynamically

This prepares the driver for multi-channel support.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Replace kmalloc + memset with kzalloc
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_cmt: Replace kmalloc + memset with kzalloc

One kzalloc a day keeps the bugs away.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Add index to struct sh_cmt_channel
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_cmt: Add index to struct sh_cmt_channel

Use the index when printing messages to identify the channel.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Add memory base to sh_cmt_channel structure
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_cmt: Add memory base to sh_cmt_channel structure

The channel memory base is channel-specific, add it to the channel
structure in preparation for support of multiple channels per device.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Rename mapbase/mapbase_str to mapbase_ch/mapbase
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_cmt: Rename mapbase/mapbase_str to mapbase_ch/mapbase

The mapbase variable points to the mapped base address of the channel,
rename it to mapbase_sh. mapbase_str points to the mapped base address
of the CMT device, rename it to mapbase.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Constify name argument to sh_cmt_register()
Laurent Pinchart [Mon, 17 Feb 2014 15:04:16 +0000 (16:04 +0100)]
clocksource: sh_cmt: Constify name argument to sh_cmt_register()

The name argument is assigned to const structure fields only, constify
it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Split channel setup to separate function
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_cmt: Split channel setup to separate function

Move the channel setup code from sh_cmt_setup to a new
sh_cmt_setup_channel function and call it from sh_cmt_setup.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Rename struct sh_cmt_priv to sh_cmt_device
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_cmt: Rename struct sh_cmt_priv to sh_cmt_device

Channel data is private as well, rename priv to device to make the
distrinction between the core device and the channels clearer.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Split channel fields from sh_cmt_priv
Laurent Pinchart [Mon, 27 Jan 2014 14:29:19 +0000 (15:29 +0100)]
clocksource: sh_cmt: Split channel fields from sh_cmt_priv

Create a new sh_cmt_channel structure to hold the channel-specific
field in preparation for multiple channels per device support.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Use request_irq() instead of setup_irq()
Laurent Pinchart [Mon, 17 Feb 2014 10:27:49 +0000 (11:27 +0100)]
clocksource: sh_cmt: Use request_irq() instead of setup_irq()

The driver claims it needs to register an interrupt handler too early
for request_irq(). This might have been true in the past, but the only
meaningful difference between request_irq() and setup_irq() today is an
additional kzalloc() call in request_irq(). As the driver calls
kmalloc() itself we know that the slab allocator is available, we can
thus switch to request_irq().

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoARM: shmobile: lager legacy: Enable Quad SPI transfers for the SPI FLASH
Geert Uytterhoeven [Mon, 14 Apr 2014 17:35:59 +0000 (19:35 +0200)]
ARM: shmobile: lager legacy: Enable Quad SPI transfers for the SPI FLASH

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: koelsch legacy: Enable Quad SPI transfers for the SPI FLASH
Geert Uytterhoeven [Mon, 14 Apr 2014 17:35:57 +0000 (19:35 +0200)]
ARM: shmobile: koelsch legacy: Enable Quad SPI transfers for the SPI FLASH

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: lager: switch to use dai info for R-Car sound
Kuninori Morimoto [Mon, 14 Apr 2014 00:57:12 +0000 (17:57 -0700)]
ARM: shmobile: lager: switch to use dai info for R-Car sound

Now, R-Car sound driver supports dai info settings.
switch to use it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: bockw: switch to use dai info for R-Car sound
Kuninori Morimoto [Mon, 14 Apr 2014 00:57:05 +0000 (17:57 -0700)]
ARM: shmobile: bockw: switch to use dai info for R-Car sound

Now, R-Car sound driver supports dai info settings.
switch to use it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: bockw: remove old style audio clock
Kuninori Morimoto [Mon, 14 Apr 2014 00:56:57 +0000 (17:56 -0700)]
ARM: shmobile: bockw: remove old style audio clock

Current audio clock didn't have dependency to device/driver,
but, it was not good design for DT support.
To avoid branch merge conflict issue,
it is using this load map, and this patch is 3) part.
 1) add new style clock in platform
 2) add new style clock method in driver
 3) remove old tyle clock from platform

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a7790: remove old style audio clock
Kuninori Morimoto [Mon, 14 Apr 2014 00:56:50 +0000 (17:56 -0700)]
ARM: shmobile: r8a7790: remove old style audio clock

Current sound driver moves to new style clock,
but is keeping compatiblity at this point.
Move to new style on r8a7790

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a7778: remove old style audio clock
Kuninori Morimoto [Mon, 14 Apr 2014 00:56:42 +0000 (17:56 -0700)]
ARM: shmobile: r8a7778: remove old style audio clock

Current sound driver moves to new style clock,
but is keeping compatiblity at this point.
Move to new style on r8a7778

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: Add Koelsch clock workarounds for SDHI
Magnus Damm [Tue, 18 Mar 2014 12:54:34 +0000 (21:54 +0900)]
ARM: shmobile: Add Koelsch clock workarounds for SDHI

Add SDHI0, SDHI1 and SDHI2 to the clock workaround list for
Koelsch multiplatform. Without these additional lines wakeup
from Suspend-to-RAM never happens.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: Add Lager clock workarounds for SDHI and MMCIF
Magnus Damm [Tue, 18 Mar 2014 12:52:47 +0000 (21:52 +0900)]
ARM: shmobile: Add Lager clock workarounds for SDHI and MMCIF

Add MMCIF1, SDHI0 and SDHI2 to the clock workaround list for
Lager multiplatform. Without these additional lines wakeup
from Suspend-to-RAM never happens.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: lager-reference: Work around core clock issues
Simon Horman [Mon, 17 Mar 2014 02:18:56 +0000 (11:18 +0900)]
ARM: shmobile: lager-reference: Work around core clock issues

Due to issues with runtime PM clock management, clocks not explicitly
managed by their drivers may not be enabled at all, or be inadvertently
disabled by the clk_disable_unused() late initcall.

Until this is fixed, add a temporary workaround, calling
shmobile_clk_workaround() with enable == true.

For now this enables the clocks for: ether, msiof1, qspi_mod, and
thermal. More clocks can be added if needed.

Based on work for the koelsch board by Geert Uytterhoeven.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
10 years agoARM: shmobile: koelsch-reference: Annotate clk_enables as __initconst
Simon Horman [Mon, 17 Mar 2014 02:19:56 +0000 (11:19 +0900)]
ARM: shmobile: koelsch-reference: Annotate clk_enables as __initconst

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
10 years agoARM: shmobile: koelsch-reference: Work around core clock issues
Geert Uytterhoeven [Thu, 13 Mar 2014 14:29:30 +0000 (15:29 +0100)]
ARM: shmobile: koelsch-reference: Work around core clock issues

Due to issues with runtime PM clock management, clocks not explicitly
managed by their drivers may not be enabled at all, or be inadvertently
disabled by the clk_disable_unused() late initcall.

Until this is fixed, add a temporary workaround, calling
shmobile_clk_workaround() with enable == true.

For now this enables the clocks for: ether, i2c2, msiof0, qspi_mod, and
thermal. More clocks can be added if needed.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: lager: Annotate clk_names with __initconst
Simon Horman [Thu, 13 Mar 2014 06:29:58 +0000 (15:29 +0900)]
ARM: shmobile: lager: Annotate clk_names with __initconst

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
10 years agoARM: shmobile: koelsch: Annotate clk_names with __initconst
Simon Horman [Thu, 13 Mar 2014 06:29:57 +0000 (15:29 +0900)]
ARM: shmobile: koelsch: Annotate clk_names with __initconst

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
10 years agoARM: shmobile: Use shmobile_clk_workaround() on Koelsch
Magnus Damm [Wed, 12 Mar 2014 23:36:35 +0000 (08:36 +0900)]
ARM: shmobile: Use shmobile_clk_workaround() on Koelsch

Convert the Koelsch DT reference code to use the newly introduced
function shmobile_clk_workaround().

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: Use shmobile_clk_workaround() on Lager
Magnus Damm [Wed, 12 Mar 2014 23:36:26 +0000 (08:36 +0900)]
ARM: shmobile: Use shmobile_clk_workaround() on Lager

Convert the Lager DT reference code to use the newly introduced
function shmobile_clk_workaround().

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a7791: Rename VSP1_SY clocks to VSP1_S
Laurent Pinchart [Wed, 2 Apr 2014 14:31:47 +0000 (16:31 +0200)]
ARM: shmobile: r8a7791: Rename VSP1_SY clocks to VSP1_S

The r8a7791 has three VSP1 instances, one of them being named VSPS (which
stands for "VSP Standard"). The clock section in the SoC datasheet
misunderstood the abbreviation as meaning VSP System, and named the
corresponding clock VSP1(SY). This mistake has been carried over to the
kernel code.

Fix this by renaming the VSP1_SY clock to VSP1_S.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a7790: Rename VSP1_(SY|RT) clocks to VSP1_(S|R)
Laurent Pinchart [Wed, 2 Apr 2014 14:31:46 +0000 (16:31 +0200)]
ARM: shmobile: r8a7790: Rename VSP1_(SY|RT) clocks to VSP1_(S|R)

The r8a7790 has four VSP1 instances, two of them being named VSPS (which
stands for "VSP Standard") and VSPR (which stands for "VSP for
Resizing"). The clock section in the SoC datasheet misunderstood the
abbreviations as meaning VSP System and VSP Realtime, and named the
corresponding clocks VSP1(SY) and VSP1(RT). This mistake has been
carried over to the kernel code.

Fix this by renaming the VSP1_SY and VSP1_RT clocks to VSP1_S and VSP1_R.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a7791: Fix the I2C clocks parents in legacy code
Laurent Pinchart [Tue, 1 Apr 2014 11:02:16 +0000 (13:02 +0200)]
ARM: shmobile: r8a7791: Fix the I2C clocks parents in legacy code

All I2C clocks derive from the HP clock, not from the P clock. Fix them.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Wolfram Sang <wsa@sang-engineering.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a7790: Fix the I2C clocks parents in legacy code
Laurent Pinchart [Tue, 1 Apr 2014 11:02:15 +0000 (13:02 +0200)]
ARM: shmobile: r8a7790: Fix the I2C clocks parents in legacy code

All I2C clocks derive from the HP clock, not from the P clock. Fix them.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Wolfram Sang <wsa@sang-engineering.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: Introduce shmobile_clk_workaround()
Magnus Damm [Wed, 12 Mar 2014 23:36:17 +0000 (08:36 +0900)]
ARM: shmobile: Introduce shmobile_clk_workaround()

Introduce a new clock workaround function used by DT reference
code on the mach-shmobile subarchitecture. The new function
shmobile_clk_workaround() is used to configure clkdev to
allow DT and platform devices to coexist. It is possible for
the DT reference board code to also request enabling of the clock
in case the driver does not implement clock control.

Signed-off-by: Magnus Damm <damm@opensource.se>
[horms+renesas@verge.net.au: Removed trailing blank line]
Reviewed-by: Wolfram Sang <wsa@sang-engineering.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>