ARM: shmobile: lager: Add VIN1 SoC camera support

This adds VIN1 SoC camera along with ADV7180 subdevice support to Lager.
VIN0 camera is not registered because it has ADV7612 I2C subdevice
which is not supported yet.

Changes in V2:
* made lager_add_vin_device function static.

Changes in V3:
* capitalized ARM in the subject.

Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 094a804aa6943de0e9939e1c48341e87be93b3d2)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: kzm9d: Use common clock framework

Use common clock framework version of clock
 drivers/clk/shmobile/clk-emev2.c
instead of sh-clkfwk version
 arch/arm/mach-shmobile/clock-emev2.c
when it is configured as a part of multi-platform.

Signed-off-by: Takashi Yoshii <takasi-y@ops.dti.ne.jp>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit ef5ecd1f20de2d1919714f029f5016bf6d061e66)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: lager: Make spi_flash_data const

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit d422c451a9795c7a10c3ae1ab7ca87ce7518546b)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: lager: Add SATA support

This adds SATA support to Lager board. Only SATA1 port is available.

Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
Acked-by: Magnus Damm <damm@opensource.se>
[horms+renesas@verge.net.au: resolved trivial conflicts]
[horms+renesas@verge.net.au: capitalised "ARM" in subject]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

(cherry picked from commit 1e0d2c495316862fa3da73150ee86ba30c9faf0c)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: koelsch: Add SATA0 support

This adds SATA0 support to Koelsch board.
SATA1 is not available since its pinmux
configuration is fixed to PCIe.

Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 4fc0a0b93f178c0b077201ab70a53e1be6a69054)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: ape6evm: Conditionally select SMSC_PHY

The ape6evm board uses has an SMSC911X ethernet controller which uses an
SMSC phy. Select SMSC_PHY for ape6evm if SMSC911X is enabled to make use of the
SMSC-specific phy driver rather than relying on the generic phy driver.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 9edaca863ea6807aca7bb8aa5c7791f7387f6022)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: armadillo800eva: Conditionally select SMSC_PHY

The armadillo800eva board uses has an SH ethernet controller which uses an
SMSC phy. Select SMSC_PHY for koelsch if SH_ETH is enabled to make use of the
SMSC-specific phy driver rather than relying on the generic phy driver.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 6a517b114d007a35fc264ef16b09db35548f0290)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: bockw: Sort Kconfig node's selections

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 2b2fd2755182d43e149259330c7b1fe0aa3243d6)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: r8a7779: Wait for status on selected MSTP clocks

When enabling some of the module clocks by clearing stop bits in the
MSTP control registers, the CPG requires waiting for the status
registers to signal that the clocks have started. Failure to do so will
result in returning from the clk_enable() call with the clock
potentially still disabled, leading to various race conditions and
difficult to debug errors.

Enable status wait for all the r8a7779 MSTP clocks that report their
status.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 017410f686b8d9928ce30e4eb146175ea672f4c9)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: r8a7790: Wait for status on all MSTP clocks

When enabling a module clock by clearing its bit in the MSTP control
register, the CPG requires waiting for the status register to signal
that the clock has started. Failure to do so will result in returning
from the clk_enable() call with the clock potentially still disabled,
leading to various race conditions and difficult to debug errors.

Enable status wait for all MSTP clocks on the r8a7790.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit cb9ec3adf882688831cdc9e7b84bb388f215f8ce)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: r8a7791: Add I2C clocks

This adds I2C[0-5] clock support to R8A7791 SoC.

Changes in V2:
* Capitalized ARM in the subject.

Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 106c0e8fa3a2f7a40d25583e193e34af3861564d)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: r8a7791: Add VIN clocks

This adds VIN[0-2] clock support to R8A7791 SoC.

Changes in V2:
* none.

Changes in V3:
* capitalized ARM in the subject.

Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 5f3fbe63b39923294cfd4bce84ab16948467d30f)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: Remove duplicate shmobile_invalidate_start() declaration

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 891fa525dc29cbed3ef0b74d5e0ab2fb5233f9a6)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: r8a7779: Remove unused clock constants

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
(cherry picked from commit d690f4681ceddeb3f077c661a19af0b8e0411ae7)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: emev2: Use __initconst for const init definition

__initconst must be used instead of __initdata for
const init definitions.

This problem was introduced by 3d5de27174955702 ("mach-shmobile: Emma
Mobile EV2 DT support V3") in v3.4-rc7.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit d24d1780c340777942061ef3445edcf228e8d35b)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: r8a7791: Wait for status on all MSTP clocks

When enabling a module clock by clearing its bit in the MSTP control
register, the CPG requires waiting for the status register to signal
that the clock has started. Failure to do so will result in returning
from the clk_enable() call with the clock potentially still disabled,
leading to various race conditions and difficult to debug errors.

Enable status wait for all MSTP clocks on the r8a7791.

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>
(cherry picked from commit dd6fc76d2f61e732a14f3592bdd83c2c0b7d2dcc)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: r8a7790: add Audio DMAC clock

Audio DMAC can be controlled via sh-dma-engine

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit f5b2947e4a6589f07d485ca149d606283294979f)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: r8a7790: add Audio DMAC support

R-Car H2 has many DMACs
(ex SYS-DMAC, 2D-DMAC, Audio-DMAC, USB-DMAC etc)
and, these DMAEngine needs DMA slave IDs to use it.

This patch adds new DMA slave ID list for r8a7790.
There, common part has RCAR_DMA_xxx prefix,
and Audio DMAC part has AUDIO_DMAC_SLAVE_xxx prefix.

Audio DMAC can be controlled via sh-dma-engine

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 2c578a1be846bde49cb0a916c20f526f27b59e89)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: r8a7790: Add VIN clock support

This adds VIN[0-3] clock support to R8A7790 SoC.

Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
[horms+renesas@verge.net.au: manually applied]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

(cherry picked from commit b89dfdfad949798e1624dd2ff494bdb7ac943b04)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: r8a7790: Add SATA clocks

This adds SATA[01] clock support to R8A7790 SoC.

Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
[horms+renesas@verge.net.au: resolved trivial conflicts]
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

(cherry picked from commit 64b7f9aca549db8a8bbcf68c911e9bd24efe76f7)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>