ARM: shmobile: APMU: Fix warnings due to improper printk formats

Use the %pr printk specifier to print resource variables. This fixes
warnings on platforms where resource_size_t has a different size than
int.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 56ff873122c4baab43df241c7701d043b8ec8a8e)
(Queued by Simon Horman for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: r7s72100: fix bus clock calculation

The picture in the datasheet is a little misleading, yet the divider of
the bus_clk is 1/3 and not 2/3.

Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit d93023f81d2c79595e64e4f516f03af4e4c73c13)
(Queued by Simon Horman for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: Update r8a7791 CPU freq to 1500MHz in DTS

The correct maximum CPU frequency for r8a7791 is 1500 MHz
so update the r8a7791 SoC DTS to reflect this.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit d11c28b11cbb387f709648fa8a8b63cc0088173d)
(Queued by Simon Horman for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: r8a7790/lager dts: Rename label spi to qspi, add spi0 alias

Prepare for the advent of MSIOF SPI, which will be spi1 to spi4.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 4f95d4358c24080be67c9898619daaa5c7855e25)
(Queued by Simon Horman for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: r8a7791/koelsch dts: Rename label spi to qspi, add spi0 alias

Prepare for the advent of MSIOF SPI, which will be spi1 to spi3.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 257168c94ab1a7b87a6a5ea4571a295d225765af)
(Queued by Simon Horman for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: r8a7790 dtsi: Add MSIOF nodes and aliases

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit a1d8744332e5ed89f84b55d6b31ecd72ee21ab6c)
(Queued by Simon Horman for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: r8a7791 dtsi: Add MSIOF nodes and aliases

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit c54c55deb94407271837931fd77bc04cd790be61)
(Queued by Simon Horman for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: lager dts: Add MSIOF nodes

Add pinctrl and SPI device for MSIOF on Lager.
On this board, only MSIOF1 is in use. Its bus contains a single device
(a Renesas R2A11302FT PMIC), for which no bindings are defined yet.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 3acfe7a65ec6929259c2852cbc0ad37e876c7b06)
(Queued by Simon Horman for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: koelsch dts: Add MSIOF nodes

Add pinctrl and SPI device for MSIOF on Koelsch.
On this board, only MSIOF0 is in use. Its bus contains a single device
(a Renesas R2A11302FT PMIC), for which no bindings are defined yet.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 71448e7321e60b93150510ce7d3f63c05b90a64c)
(Queued by Simon Horman for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: multiplatform: Enable MSIOF in defconfig

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit eb72b7a60ba8882aff6cdcd2681df2e7b6a68120)
(Queued by Simon Horman for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: Update r8a7791 CPU freq to 1500MHz in C

The correct maximum CPU frequency for r8a7791 is 1500 MHz
so update the r8a7791 SoC C code to reflect this.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit f6c4357378b45fd6d2a3af093d3037f3d06dd4dd)
(Queued by Simon Horman for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: Add shared shmobile_init_delay()

Introduce shmobile_init_delay() that gets CPU specific
parameters from DT and sets up the early delay from
there. This allows us to both remove frequency information
from the C code and consolidate existing code.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 311d21fe5d0da6127973512ce393da1dd61ec584)
(Queued by Simon Horman for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: Remove legacy EMEV2 SoC support

Get rid of legacy EMEV2 SoC code including the legacy clock
framework implementation. The multiplatform implementation
together with DT board support shall be used instead.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 4771c0a28cbe23be0670620ce33f364fc64b4f7e)
(Queued by Simon Horman for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

Conflicts:
	arch/arm/boot/dts/Makefile
ARM: shmobile: Remove EMEV2 header file

There is no C board code left for the EMEV2 SoC, so
get rid of the emev2.h include file to save some lines.
While at it make functions static.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 5e50a059010d2f2f95a684a393a45891e33b33a0)
(Queued by Simon Horman for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: Make use of r8a7790_add_standard_devices()

Move non-PFC and non-GPIO devices off from r8a7790_pinmux_init()
and into r8a7790_add_standard_devices() which is the normal place
to keep regular devices in the legacy case.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit a3d1148b473c741505b024dd8043622d1ead9e6d)
(Queued by Simon Horman for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
gpio: rcar: Add r8a7791 support to the DT bindings

The r8a7791 (R-Car M2) has a GPIO controller with additional features
compared to the generic renesas,gpio-rcar compatible devices. Add a
model-specific string to let the driver enable these features.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 612575255635f67f09f6261114f58965f2062584)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
pinctrl: sh-pfc: r8a7790: Add QSPI pin groups

A QSPI function set consists of 3 groups:
  - qspi_ctrl (2 control wires)
  - qspi_data2 (2 data wires, for Single/Dual SPI)
  - qspi_data4 (4 data wires, for Quad SPI)

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 202909cdf117743bdbf8abc0f817950c8955c8cf)
(Queued by Linus Walleij for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
pinctrl: sh-pfc: r8a7790: Add alternative MSIOF pin groups

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 7033168da51e43ebba7870f089d275b4589df0c5)
(Queued by Linus Walleij for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
pinctrl: sh-pfc: r8a7791: Add alternative MSIOF pin groups

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit e6fae2d03dc4f9172db88ad18a577c2a45b9e8ac)
(Queued by Linus Walleij for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
spi: rspi: Remove empty rspi_cleanup()

If spi_master.cleanup() is not needed, it can be left unimplemented.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit ab98fcba962a57cee9fdb97aff2b25248c93cea5)
(Queued by Mark Brown or mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>