diff options
author | Olof Johansson <olof@lixom.net> | 2014-07-06 17:15:48 -0700 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2014-07-06 17:16:16 -0700 |
commit | 21760aedabc795a6758bf15fafcd59fe0799cd9f (patch) | |
tree | d63b61d178d8a11a085fc3a6497137d85f45b34c | |
parent | 5bf521b813776e983bfc1ef21898391e51773c1d (diff) | |
parent | c1a0f9932b66b2298163c31f8ac3f2844476e1c2 (diff) | |
download | linux-21760aedabc795a6758bf15fafcd59fe0799cd9f.tar.bz2 |
Merge tag 'renesas-r8a7779-multiplatform-for-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/soc
Pull "Renesas ARM Based SoC r8a7779-multiplatform Updates for v3.17" from
Simon Horman:
Move r8a7779 SoC and its Marzen board to use common clocks,
multiplatform and initialise SCIF (serial) devices using DT.
* tag 'renesas-r8a7779-multiplatform-for-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: (32 commits)
ARM: shmobile: marzen: Do not use workaround for scif devices
ARM: shmobile: marzen: Initialise SCIF devices using DT
ARM: shmobile: marzen: Remove early_printk from command line
ARM: shmobile: r8a7779: Add scif nodes to dtsi
ARM: shmobile: r8a7779 dtsi: Correct #address-cells/#size-cells for clocks
ARM: shmobile: r8a7779 dtsi: Update unit-addresses for clocks
ARM: shmobile: r8a7779: Remove unused r8a7779_init_delay()
ARM: shmobile: marzen-reference: Use DT CPU Frequency
ARM: shmobile: r8a7779: Use DT CPU Frequency in common case
ARM: shmobile: r8a7779: Add Maximum CPU Frequency to DTS
ARM: shmobile: marzen-reference: Remove legacy clock support
ARM: shmobile: Remove Marzen reference DTS
ARM: shmobile: Let Marzen multiplatform boot with Marzen DTB
ARM: shmobile: Remove non-multiplatform Marzen reference support
ARM: shmobile: marzen-reference: Instantiate clkdevs for SCIF and TMU
ARM: shmobile: marzen-reference: Initialize CPG device
ARM: shmobile: r8a7779: Initial multiplatform support
ARM: shmobile: marzen-reference: Move clock and OF device initialisation into board code
ARM: shmobile: r8a7779: Move r8a7779_earlytimer_init to clock-r8a7779.c
ARM: shmobile: r8a7779: Add helper to read mode pins
...
Signed-off-by: Olof Johansson <olof@lixom.net>
76 files changed, 557 insertions, 327 deletions
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index adb5ed9e269e..eb280d3483eb 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -327,7 +327,6 @@ dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += r7s72100-genmai.dtb \ r8a7778-bockw-reference.dtb \ r8a7740-armadillo800eva-reference.dtb \ r8a7779-marzen.dtb \ - r8a7779-marzen-reference.dtb \ r8a7791-koelsch.dtb \ r8a7790-lager.dtb \ sh73a0-kzm9g.dtb \ @@ -339,7 +338,8 @@ dtb-$(CONFIG_ARCH_SHMOBILE_MULTI) += emev2-kzm9d.dtb \ r7s72100-genmai.dtb \ r8a7791-henninger.dtb \ r8a7791-koelsch.dtb \ - r8a7790-lager.dtb + r8a7790-lager.dtb \ + r8a7779-marzen.dtb dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_arria5_socdk.dtb \ socfpga_cyclone5_socdk.dtb \ socfpga_cyclone5_sockit.dtb \ diff --git a/arch/arm/boot/dts/r8a7779-marzen-reference.dts b/arch/arm/boot/dts/r8a7779-marzen-reference.dts deleted file mode 100644 index b27c6373ff4d..000000000000 --- a/arch/arm/boot/dts/r8a7779-marzen-reference.dts +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Reference Device Tree Source for the Marzen board - * - * Copyright (C) 2013 Renesas Solutions Corp. - * Copyright (C) 2013 Simon Horman - * - * This file is licensed under the terms of the GNU General Public License - * version 2. This program is licensed "as is" without any warranty of any - * kind, whether express or implied. - */ - -/dts-v1/; -#include "r8a7779.dtsi" -#include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/interrupt-controller/irq.h> - -/ { - model = "marzen"; - compatible = "renesas,marzen-reference", "renesas,r8a7779"; - - chosen { - bootargs = "console=ttySC2,115200 earlyprintk=sh-sci.2,115200 ignore_loglevel root=/dev/nfs ip=on rw"; - }; - - memory { - device_type = "memory"; - reg = <0x60000000 0x40000000>; - }; - - fixedregulator3v3: fixedregulator@0 { - compatible = "regulator-fixed"; - regulator-name = "fixed-3.3V"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - regulator-boot-on; - regulator-always-on; - }; - - lan0@18000000 { - compatible = "smsc,lan9220", "smsc,lan9115"; - reg = <0x18000000 0x100>; - pinctrl-0 = <&lan0_pins>; - pinctrl-names = "default"; - - phy-mode = "mii"; - interrupt-parent = <&irqpin0>; - interrupts = <1 IRQ_TYPE_EDGE_FALLING>; - smsc,irq-push-pull; - reg-io-width = <4>; - vddvario-supply = <&fixedregulator3v3>; - vdd33a-supply = <&fixedregulator3v3>; - }; - - leds { - compatible = "gpio-leds"; - led2 { - gpios = <&gpio4 29 GPIO_ACTIVE_HIGH>; - }; - led3 { - gpios = <&gpio4 30 GPIO_ACTIVE_HIGH>; - }; - led4 { - gpios = <&gpio4 31 GPIO_ACTIVE_HIGH>; - }; - }; -}; - -&irqpin0 { - status = "okay"; -}; - -&pfc { - pinctrl-0 = <&scif2_pins &scif4_pins>; - pinctrl-names = "default"; - - lan0_pins: lan0 { - intc { - renesas,groups = "intc_irq1_b"; - renesas,function = "intc"; - }; - lbsc { - renesas,groups = "lbsc_ex_cs0"; - renesas,function = "lbsc"; - }; - }; - - scif2_pins: serial2 { - renesas,groups = "scif2_data_c"; - renesas,function = "scif2"; - }; - - scif4_pins: serial4 { - renesas,groups = "scif4_data"; - renesas,function = "scif4"; - }; - - sdhi0_pins: sd0 { - renesas,groups = "sdhi0_data4", "sdhi0_ctrl", "sdhi0_cd"; - renesas,function = "sdhi0"; - }; - - hspi0_pins: hspi0 { - renesas,groups = "hspi0"; - renesas,function = "hspi0"; - }; -}; - -&sdhi0 { - pinctrl-0 = <&sdhi0_pins>; - pinctrl-names = "default"; - - vmmc-supply = <&fixedregulator3v3>; - bus-width = <4>; - status = "okay"; -}; - -&hspi0 { - pinctrl-0 = <&hspi0_pins>; - pinctrl-names = "default"; - status = "okay"; -}; diff --git a/arch/arm/boot/dts/r8a7779-marzen.dts b/arch/arm/boot/dts/r8a7779-marzen.dts index a7af2c2371f2..20b176807848 100644 --- a/arch/arm/boot/dts/r8a7779-marzen.dts +++ b/arch/arm/boot/dts/r8a7779-marzen.dts @@ -11,17 +11,131 @@ /dts-v1/; #include "r8a7779.dtsi" +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/interrupt-controller/irq.h> / { model = "marzen"; compatible = "renesas,marzen", "renesas,r8a7779"; + aliases { + serial2 = &scif2; + serial4 = &scif4; + }; + chosen { - bootargs = "console=ttySC2,115200 earlyprintk=sh-sci.2,115200 ignore_loglevel root=/dev/nfs ip=on"; + bootargs = "console=ttySC2,115200 ignore_loglevel root=/dev/nfs ip=on"; }; memory { device_type = "memory"; reg = <0x60000000 0x40000000>; }; + + fixedregulator3v3: fixedregulator@0 { + compatible = "regulator-fixed"; + regulator-name = "fixed-3.3V"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + }; + + lan0@18000000 { + compatible = "smsc,lan9220", "smsc,lan9115"; + reg = <0x18000000 0x100>; + pinctrl-0 = <&lan0_pins>; + pinctrl-names = "default"; + + phy-mode = "mii"; + interrupt-parent = <&irqpin0>; + interrupts = <1 IRQ_TYPE_EDGE_FALLING>; + smsc,irq-push-pull; + reg-io-width = <4>; + vddvario-supply = <&fixedregulator3v3>; + vdd33a-supply = <&fixedregulator3v3>; + }; + + leds { + compatible = "gpio-leds"; + led2 { + gpios = <&gpio4 29 GPIO_ACTIVE_HIGH>; + }; + led3 { + gpios = <&gpio4 30 GPIO_ACTIVE_HIGH>; + }; + led4 { + gpios = <&gpio4 31 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&irqpin0 { + status = "okay"; +}; + +&extal_clk { + clock-frequency = <31250000>; +}; + +&pfc { + lan0_pins: lan0 { + intc { + renesas,groups = "intc_irq1_b"; + renesas,function = "intc"; + }; + lbsc { + renesas,groups = "lbsc_ex_cs0"; + renesas,function = "lbsc"; + }; + }; + + scif2_pins: serial2 { + renesas,groups = "scif2_data_c"; + renesas,function = "scif2"; + }; + + scif4_pins: serial4 { + renesas,groups = "scif4_data"; + renesas,function = "scif4"; + }; + + sdhi0_pins: sd0 { + renesas,groups = "sdhi0_data4", "sdhi0_ctrl", "sdhi0_cd"; + renesas,function = "sdhi0"; + }; + + hspi0_pins: hspi0 { + renesas,groups = "hspi0"; + renesas,function = "hspi0"; + }; +}; + +&scif2 { + pinctrl-0 = <&scif2_pins>; + pinctrl-names = "default"; + + status = "okay"; +}; + +&scif4 { + pinctrl-0 = <&scif4_pins>; + pinctrl-names = "default"; + + status = "okay"; +}; + +&sdhi0 { + pinctrl-0 = <&sdhi0_pins>; + pinctrl-names = "default"; + + vmmc-supply = <&fixedregulator3v3>; + bus-width = <4>; + status = "okay"; +}; + +&hspi0 { + pinctrl-0 = <&hspi0_pins>; + pinctrl-names = "default"; + status = "okay"; }; diff --git a/arch/arm/boot/dts/r8a7779.dtsi b/arch/arm/boot/dts/r8a7779.dtsi index b517c8e6b420..94e2fc836492 100644 --- a/arch/arm/boot/dts/r8a7779.dtsi +++ b/arch/arm/boot/dts/r8a7779.dtsi @@ -11,6 +11,7 @@ /include/ "skeleton.dtsi" +#include <dt-bindings/clock/r8a7779-clock.h> #include <dt-bindings/interrupt-controller/irq.h> / { @@ -25,21 +26,25 @@ device_type = "cpu"; compatible = "arm,cortex-a9"; reg = <0>; + clock-frequency = <1000000000>; }; cpu@1 { device_type = "cpu"; compatible = "arm,cortex-a9"; reg = <1>; + clock-frequency = <1000000000>; }; cpu@2 { device_type = "cpu"; compatible = "arm,cortex-a9"; reg = <2>; + clock-frequency = <1000000000>; }; cpu@3 { device_type = "cpu"; compatible = "arm,cortex-a9"; reg = <3>; + clock-frequency = <1000000000>; }; }; @@ -157,6 +162,7 @@ compatible = "renesas,i2c-r8a7779"; reg = <0xffc70000 0x1000>; interrupts = <0 79 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp0_clks R8A7779_CLK_I2C0>; status = "disabled"; }; @@ -166,6 +172,7 @@ compatible = "renesas,i2c-r8a7779"; reg = <0xffc71000 0x1000>; interrupts = <0 82 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp0_clks R8A7779_CLK_I2C1>; status = "disabled"; }; @@ -175,6 +182,7 @@ compatible = "renesas,i2c-r8a7779"; reg = <0xffc72000 0x1000>; interrupts = <0 80 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp0_clks R8A7779_CLK_I2C2>; status = "disabled"; }; @@ -184,6 +192,67 @@ compatible = "renesas,i2c-r8a7779"; reg = <0xffc73000 0x1000>; interrupts = <0 81 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp0_clks R8A7779_CLK_I2C3>; + status = "disabled"; + }; + + scif0: serial@ffe40000 { + compatible = "renesas,scif-r8a7779", "renesas,scif"; + reg = <0xffe40000 0x100>; + interrupt-parent = <&gic>; + interrupts = <0 88 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cpg_clocks R8A7779_CLK_P>; + clock-names = "sci_ick"; + status = "disabled"; + }; + + scif1: serial@ffe41000 { + compatible = "renesas,scif-r8a7779", "renesas,scif"; + reg = <0xffe41000 0x100>; + interrupt-parent = <&gic>; + interrupts = <0 89 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cpg_clocks R8A7779_CLK_P>; + clock-names = "sci_ick"; + status = "disabled"; + }; + + scif2: serial@ffe42000 { + compatible = "renesas,scif-r8a7779", "renesas,scif"; + reg = <0xffe42000 0x100>; + interrupt-parent = <&gic>; + interrupts = <0 90 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cpg_clocks R8A7779_CLK_P>; + clock-names = "sci_ick"; + status = "disabled"; + }; + + scif3: serial@ffe43000 { + compatible = "renesas,scif-r8a7779", "renesas,scif"; + reg = <0xffe43000 0x100>; + interrupt-parent = <&gic>; + interrupts = <0 91 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cpg_clocks R8A7779_CLK_P>; + clock-names = "sci_ick"; + status = "disabled"; + }; + + scif4: serial@ffe44000 { + compatible = "renesas,scif-r8a7779", "renesas,scif"; + reg = <0xffe44000 0x100>; + interrupt-parent = <&gic>; + interrupts = <0 92 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cpg_clocks R8A7779_CLK_P>; + clock-names = "sci_ick"; + status = "disabled"; + }; + + scif5: serial@ffe45000 { + compatible = "renesas,scif-r8a7779", "renesas,scif"; + reg = <0xffe45000 0x100>; + interrupt-parent = <&gic>; + interrupts = <0 93 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cpg_clocks R8A7779_CLK_P>; + clock-names = "sci_ick"; status = "disabled"; }; @@ -201,12 +270,14 @@ compatible = "renesas,rcar-sata"; reg = <0xfc600000 0x2000>; interrupts = <0 100 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp1_clks R8A7779_CLK_SATA>; }; sdhi0: sd@ffe4c000 { compatible = "renesas,sdhi-r8a7779"; reg = <0xffe4c000 0x100>; interrupts = <0 104 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp3_clks R8A7779_CLK_SDHI0>; cap-sd-highspeed; cap-sdio-irq; status = "disabled"; @@ -216,6 +287,7 @@ compatible = "renesas,sdhi-r8a7779"; reg = <0xffe4d000 0x100>; interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp3_clks R8A7779_CLK_SDHI1>; cap-sd-highspeed; cap-sdio-irq; status = "disabled"; @@ -225,6 +297,7 @@ compatible = "renesas,sdhi-r8a7779"; reg = <0xffe4e000 0x100>; interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp3_clks R8A7779_CLK_SDHI2>; cap-sd-highspeed; cap-sdio-irq; status = "disabled"; @@ -234,6 +307,7 @@ compatible = "renesas,sdhi-r8a7779"; reg = <0xffe4f000 0x100>; interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp3_clks R8A7779_CLK_SDHI3>; cap-sd-highspeed; cap-sdio-irq; status = "disabled"; @@ -245,6 +319,7 @@ interrupts = <0 73 IRQ_TYPE_LEVEL_HIGH>; #address-cells = <1>; #size-cells = <0>; + clocks = <&mstp0_clks R8A7779_CLK_HSPI>; status = "disabled"; }; @@ -254,6 +329,7 @@ interrupts = <0 74 IRQ_TYPE_LEVEL_HIGH>; #address-cells = <1>; #size-cells = <0>; + clocks = <&mstp0_clks R8A7779_CLK_HSPI>; status = "disabled"; }; @@ -263,6 +339,150 @@ interrupts = <0 75 IRQ_TYPE_LEVEL_HIGH>; #address-cells = <1>; #size-cells = <0>; + clocks = <&mstp0_clks R8A7779_CLK_HSPI>; status = "disabled"; }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + /* External root clock */ + extal_clk: extal_clk { + compatible = "fixed-clock"; + #clock-cells = <0>; + /* This value must be overriden by the board. */ + clock-frequency = <0>; + clock-output-names = "extal"; + }; + + /* Special CPG clocks */ + cpg_clocks: clocks@ffc80000 { + compatible = "renesas,r8a7779-cpg-clocks"; + reg = <0xffc80000 0x30>; + clocks = <&extal_clk>; + #clock-cells = <1>; + clock-output-names = "plla", "z", "zs", "s", + "s1", "p", "b", "out"; + }; + + /* Fixed factor clocks */ + i_clk: i_clk { + compatible = "fixed-factor-clock"; + clocks = <&cpg_clocks R8A7779_CLK_PLLA>; + #clock-cells = <0>; + clock-div = <2>; + clock-mult = <1>; + clock-output-names = "i"; + }; + s3_clk: s3_clk { + compatible = "fixed-factor-clock"; + clocks = <&cpg_clocks R8A7779_CLK_PLLA>; + #clock-cells = <0>; + clock-div = <8>; + clock-mult = <1>; + clock-output-names = "s3"; + }; + s4_clk: s4_clk { + compatible = "fixed-factor-clock"; + clocks = <&cpg_clocks R8A7779_CLK_PLLA>; + #clock-cells = <0>; + clock-div = <16>; + clock-mult = <1>; + clock-output-names = "s4"; + }; + g_clk: g_clk { + compatible = "fixed-factor-clock"; + clocks = <&cpg_clocks R8A7779_CLK_PLLA>; + #clock-cells = <0>; + clock-div = <24>; + clock-mult = <1>; + clock-output-names = "g"; + }; + + /* Gate clocks */ + mstp0_clks: clocks@ffc80030 { + compatible = "renesas,r8a7779-mstp-clocks", + "renesas,cpg-mstp-clocks"; + reg = <0xffc80030 4>; + clocks = <&cpg_clocks R8A7779_CLK_S>, + <&cpg_clocks R8A7779_CLK_P>, + <&cpg_clocks R8A7779_CLK_P>, + <&cpg_clocks R8A7779_CLK_P>, + <&cpg_clocks R8A7779_CLK_S>, + <&cpg_clocks R8A7779_CLK_S>, + <&cpg_clocks R8A7779_CLK_S1>, + <&cpg_clocks R8A7779_CLK_S1>, + <&cpg_clocks R8A7779_CLK_S1>, + <&cpg_clocks R8A7779_CLK_S1>, + <&cpg_clocks R8A7779_CLK_S1>, + <&cpg_clocks R8A7779_CLK_S1>, + <&cpg_clocks R8A7779_CLK_P>, + <&cpg_clocks R8A7779_CLK_P>, + <&cpg_clocks R8A7779_CLK_P>, + <&cpg_clocks R8A7779_CLK_P>; + #clock-cells = <1>; + renesas,clock-indices = < + R8A7779_CLK_HSPI R8A7779_CLK_TMU2 + R8A7779_CLK_TMU1 R8A7779_CLK_TMU0 + R8A7779_CLK_HSCIF1 R8A7779_CLK_HSCIF0 + R8A7779_CLK_SCIF5 R8A7779_CLK_SCIF4 + R8A7779_CLK_SCIF3 R8A7779_CLK_SCIF2 + R8A7779_CLK_SCIF1 R8A7779_CLK_SCIF0 + R8A7779_CLK_I2C3 R8A7779_CLK_I2C2 + R8A7779_CLK_I2C1 R8A7779_CLK_I2C0 + >; + clock-output-names = + "hspi", "tmu2", "tmu1", "tmu0", "hscif1", + "hscif0", "scif5", "scif4", "scif3", "scif2", + "scif1", "scif0", "i2c3", "i2c2", "i2c1", + "i2c0"; + }; + mstp1_clks: clocks@ffc80034 { + compatible = "renesas,r8a7779-mstp-clocks", + "renesas,cpg-mstp-clocks"; + reg = <0xffc80034 4>, <0xffc80044 4>; + clocks = <&cpg_clocks R8A7779_CLK_P>, + <&cpg_clocks R8A7779_CLK_P>, + <&cpg_clocks R8A7779_CLK_S>, + <&cpg_clocks R8A7779_CLK_S>, + <&cpg_clocks R8A7779_CLK_S>, + <&cpg_clocks R8A7779_CLK_S>, + <&cpg_clocks R8A7779_CLK_P>, + <&cpg_clocks R8A7779_CLK_P>, + <&cpg_clocks R8A7779_CLK_P>, + <&cpg_clocks R8A7779_CLK_S>; + #clock-cells = <1>; + renesas,clock-indices = < + R8A7779_CLK_USB01 R8A7779_CLK_USB2 + R8A7779_CLK_DU R8A7779_CLK_VIN2 + R8A7779_CLK_VIN1 R8A7779_CLK_VIN0 + R8A7779_CLK_ETHER R8A7779_CLK_SATA + R8A7779_CLK_PCIE R8A7779_CLK_VIN3 + >; + clock-output-names = + "usb01", "usb2", + "du", "vin2", + "vin1", "vin0", + "ether", "sata", + "pcie", "vin3"; + }; + mstp3_clks: clocks@ffc8003c { + compatible = "renesas,r8a7779-mstp-clocks", + "renesas,cpg-mstp-clocks"; + reg = <0xffc8003c 4>; + clocks = <&s4_clk>, <&s4_clk>, <&s4_clk>, <&s4_clk>, + <&s4_clk>, <&s4_clk>; + #clock-cells = <1>; + renesas,clock-indices = < + R8A7779_CLK_SDHI3 R8A7779_CLK_SDHI2 + R8A7779_CLK_SDHI1 R8A7779_CLK_SDHI0 + R8A7779_CLK_MMC1 R8A7779_CLK_MMC0 + >; + clock-output-names = + "sdhi3", "sdhi2", "sdhi1", "sdhi0", + "mmc1", "mmc0"; + }; + }; }; diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index 798073057e51..5ec9c3855624 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig @@ -25,6 +25,11 @@ config ARCH_R7S72100 bool "RZ/A1H (R7S72100)" select SYS_SUPPORTS_SH_MTU2 +config ARCH_R8A7779 + bool "R-Car H1 (R8A77790)" + select RENESAS_INTC_IRQPIN + select SYS_SUPPORTS_SH_TMU + config ARCH_R8A7790 bool "R-Car H2 (R8A77900)" select RENESAS_IRQC @@ -51,6 +56,11 @@ config MACH_LAGER depends on ARCH_R8A7790 select MICREL_PHY if SH_ETH +config MACH_MARZEN + bool "MARZEN board" + depends on ARCH_R8A7779 + select REGULATOR_FIXED_VOLTAGE if REGULATOR + comment "Renesas ARM SoCs System Configuration" endif @@ -234,19 +244,6 @@ config MACH_MARZEN select REGULATOR_FIXED_VOLTAGE if REGULATOR select USE_OF -config MACH_MARZEN_REFERENCE - bool "MARZEN board - Reference Device Tree Implementation" - depends on ARCH_R8A7779 - select ARCH_REQUIRE_GPIOLIB - select REGULATOR_FIXED_VOLTAGE if REGULATOR - select USE_OF - ---help--- - Use reference implementation of Marzen board support - which makes use of device tree at the expense - of not supporting a number of devices. - - This is intended to aid developers - config MACH_LAGER bool "Lager board" depends on ARCH_R8A7790 diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index 1b966da2c81c..d4fd9a98242e 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile @@ -60,6 +60,7 @@ ifdef CONFIG_ARCH_SHMOBILE_MULTI obj-$(CONFIG_MACH_GENMAI) += board-genmai-reference.o obj-$(CONFIG_MACH_KOELSCH) += board-koelsch-reference.o obj-$(CONFIG_MACH_LAGER) += board-lager-reference.o +obj-$(CONFIG_MACH_MARZEN) += board-marzen-reference.o else obj-$(CONFIG_MACH_APE6EVM) += board-ape6evm.o obj-$(CONFIG_MACH_APE6EVM_REFERENCE) += board-ape6evm-reference.o @@ -68,7 +69,6 @@ obj-$(CONFIG_MACH_BOCKW) += board-bockw.o obj-$(CONFIG_MACH_BOCKW_REFERENCE) += board-bockw-reference.o obj-$(CONFIG_MACH_GENMAI) += board-genmai.o obj-$(CONFIG_MACH_MARZEN) += board-marzen.o -obj-$(CONFIG_MACH_MARZEN_REFERENCE) += board-marzen-reference.o obj-$(CONFIG_MACH_LAGER) += board-lager.o obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o obj-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += board-armadillo800eva-reference.o diff --git a/arch/arm/mach-shmobile/Makefile.boot b/arch/arm/mach-shmobile/Makefile.boot index 918fccffa1b6..ebf97d4bcfd8 100644 --- a/arch/arm/mach-shmobile/Makefile.boot +++ b/arch/arm/mach-shmobile/Makefile.boot @@ -13,7 +13,6 @@ loadaddr-$(CONFIG_MACH_KZM9G_REFERENCE) += 0x41008000 loadaddr-$(CONFIG_MACH_LAGER) += 0x40008000 loadaddr-$(CONFIG_MACH_MACKEREL) += 0x40008000 loadaddr-$(CONFIG_MACH_MARZEN) += 0x60008000 -loadaddr-$(CONFIG_MACH_MARZEN_REFERENCE) += 0x60008000 __ZRELADDR := $(sort $(loadaddr-y)) zreladdr-y += $(__ZRELADDR) diff --git a/arch/arm/mach-shmobile/board-ape6evm-reference.c b/arch/arm/mach-shmobile/board-ape6evm-reference.c index 3276afcf3cc9..76e4ff14be68 100644 --- a/arch/arm/mach-shmobile/board-ape6evm-reference.c +++ b/arch/arm/mach-shmobile/board-ape6evm-reference.c @@ -24,10 +24,10 @@ #include <linux/pinctrl/machine.h> #include <linux/platform_device.h> #include <linux/sh_clk.h> -#include <mach/common.h> #include <mach/r8a73a4.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> +#include "common.h" static void __init ape6evm_add_standard_devices(void) { diff --git a/arch/arm/mach-shmobile/board-ape6evm.c b/arch/arm/mach-shmobile/board-ape6evm.c index fe071a9130b7..8f8da25310e7 100644 --- a/arch/arm/mach-shmobile/board-ape6evm.c +++ b/arch/arm/mach-shmobile/board-ape6evm.c @@ -33,11 +33,11 @@ #include <linux/regulator/machine.h> #include <linux/sh_clk.h> #include <linux/smsc911x.h> -#include <mach/common.h> -#include <mach/irqs.h> #include <mach/r8a73a4.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> +#include "common.h" +#include "irqs.h" /* LEDS */ static struct gpio_led ape6evm_leds[] = { diff --git a/arch/arm/mach-shmobile/board-armadillo800eva-reference.c b/arch/arm/mach-shmobile/board-armadillo800eva-reference.c index f660fbb96e0b..368518b3b8ec 100644 --- a/arch/arm/mach-shmobile/board-armadillo800eva-reference.c +++ b/arch/arm/mach-shmobile/board-armadillo800eva-reference.c @@ -24,10 +24,10 @@ #include <linux/kernel.h> #include <linux/gpio.h> #include <linux/io.h> -#include <mach/common.h> #include <mach/r8a7740.h> #include <asm/mach/arch.h> #include <asm/hardware/cache-l2x0.h> +#include "common.h" /* * CON1 Camera Module diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c index 30fcac73a540..53d03e85750a 100644 --- a/arch/arm/mach-shmobile/board-armadillo800eva.c +++ b/arch/arm/mach-shmobile/board-armadillo800eva.c @@ -45,8 +45,6 @@ #include <linux/mmc/sh_mobile_sdhi.h> #include <linux/i2c-gpio.h> #include <linux/reboot.h> -#include <mach/common.h> -#include <mach/irqs.h> #include <mach/r8a7740.h> #include <media/mt9t112.h> #include <media/sh_mobile_ceu.h> @@ -61,7 +59,9 @@ #include <video/sh_mobile_hdmi.h> #include <sound/sh_fsi.h> #include <sound/simple_card.h> - +#include "common.h" +#include "irqs.h" +#include "pm-rmobile.h" #include "sh-gpio.h" /* diff --git a/arch/arm/mach-shmobile/board-bockw-reference.c b/arch/arm/mach-shmobile/board-bockw-reference.c index 027373f8de82..91ff3a27ccc7 100644 --- a/arch/arm/mach-shmobile/board-bockw-reference.c +++ b/arch/arm/mach-shmobile/board-bockw-reference.c @@ -19,9 +19,9 @@ */ #include <linux/of_platform.h> -#include <mach/common.h> #include <mach/r8a7778.h> #include <asm/mach/arch.h> +#include "common.h" /* * see board-bock.c for checking detail of dip-switch diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c index f444be2f241e..8cb057f95c44 100644 --- a/arch/arm/mach-shmobile/board-bockw.c +++ b/arch/arm/mach-shmobile/board-bockw.c @@ -35,12 +35,12 @@ #include <linux/spi/flash.h> #include <linux/usb/renesas_usbhs.h> #include <media/soc_camera.h> -#include <mach/common.h> -#include <mach/irqs.h> #include <mach/r8a7778.h> #include <asm/mach/arch.h> #include <sound/rcar_snd.h> #include <sound/simple_card.h> +#include "common.h" +#include "irqs.h" #define FPGA 0x18200000 #define IRQ0MR 0x30 diff --git a/arch/arm/mach-shmobile/board-genmai-reference.c b/arch/arm/mach-shmobile/board-genmai-reference.c index 2ff6ad6e608e..d341ef09ec37 100644 --- a/arch/arm/mach-shmobile/board-genmai-reference.c +++ b/arch/arm/mach-shmobile/board-genmai-reference.c @@ -20,11 +20,11 @@ #include <linux/kernel.h> #include <linux/of_platform.h> -#include <mach/clock.h> -#include <mach/common.h> #include <mach/r7s72100.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> +#include "clock.h" +#include "common.h" /* * This is a really crude hack to provide clkdev support to platform diff --git a/arch/arm/mach-shmobile/board-genmai.c b/arch/arm/mach-shmobile/board-genmai.c index c94201ee8596..f0a8eca7d10d 100644 --- a/arch/arm/mach-shmobile/board-genmai.c +++ b/arch/arm/mach-shmobile/board-genmai.c @@ -25,11 +25,11 @@ #include <linux/sh_eth.h> #include <linux/spi/rspi.h> #include <linux/spi/spi.h> -#include <mach/common.h> -#include <mach/irqs.h> #include <mach/r7s72100.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> +#include "common.h" +#include "irqs.h" /* Ether */ static const struct sh_eth_plat_data ether_pdata __initconst = { diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c index d322a162b4b0..1d3f67d4ccd6 100644 --- a/arch/arm/mach-shmobile/board-koelsch-reference.c +++ b/arch/arm/mach-shmobile/board-koelsch-reference.c @@ -23,12 +23,12 @@ #include <linux/kernel.h> #include <linux/of_platform.h> #include <linux/platform_data/rcar-du.h> -#include <mach/clock.h> -#include <mach/common.h> -#include <mach/irqs.h> -#include <mach/rcar-gen2.h> #include <mach/r8a7791.h> #include <asm/mach/arch.h> +#include "clock.h" +#include "common.h" +#include "irqs.h" +#include "rcar-gen2.h" /* DU */ static struct rcar_du_encoder_data koelsch_du_encoders[] = { diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c index c6c68892caa3..0d44e7eb6508 100644 --- a/arch/arm/mach-shmobile/board-koelsch.c +++ b/arch/arm/mach-shmobile/board-koelsch.c @@ -45,12 +45,12 @@ #include <linux/spi/flash.h> #include <linux/spi/rspi.h> #include <linux/spi/spi.h> -#include <mach/common.h> -#include <mach/irqs.h> #include <mach/r8a7791.h> -#include <mach/rcar-gen2.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> +#include "common.h" +#include "irqs.h" +#include "rcar-gen2.h" /* DU */ static struct rcar_du_encoder_data koelsch_du_encoders[] = { diff --git a/arch/arm/mach-shmobile/board-kzm9g-reference.c b/arch/arm/mach-shmobile/board-kzm9g-reference.c index a735a1d80c28..e6285de6bc87 100644 --- a/arch/arm/mach-shmobile/board-kzm9g-reference.c +++ b/arch/arm/mach-shmobile/board-kzm9g-reference.c @@ -26,10 +26,10 @@ #include <linux/input.h> #include <linux/of_platform.h> #include <mach/sh73a0.h> -#include <mach/common.h> #include <asm/hardware/cache-l2x0.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> +#include "common.h" static void __init kzm_init(void) { diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c index f94ec8ca42c1..fff330f74925 100644 --- a/arch/arm/mach-shmobile/board-kzm9g.c +++ b/arch/arm/mach-shmobile/board-kzm9g.c @@ -43,13 +43,13 @@ #include <linux/videodev2.h> #include <sound/sh_fsi.h> #include <sound/simple_card.h> -#include <mach/irqs.h> #include <mach/sh73a0.h> -#include <mach/common.h> #include <asm/hardware/cache-l2x0.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <video/sh_mobile_lcdc.h> +#include "common.h" +#include "irqs.h" /* * external GPIO diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c index 749832e3f33c..4f0af91ebc81 100644 --- a/arch/arm/mach-shmobile/board-lager-reference.c +++ b/arch/arm/mach-shmobile/board-lager-reference.c @@ -22,12 +22,12 @@ #include <linux/init.h> #include <linux/of_platform.h> #include <linux/platform_data/rcar-du.h> -#include <mach/clock.h> -#include <mach/common.h> -#include <mach/irqs.h> -#include <mach/rcar-gen2.h> #include <mach/r8a7790.h> #include <asm/mach/arch.h> +#include "clock.h" +#include "common.h" +#include "irqs.h" +#include "rcar-gen2.h" /* DU */ static struct rcar_du_encoder_data lager_du_encoders[] = { diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c index f8b1e05463cc..83bbb5c48863 100644 --- a/arch/arm/mach-shmobile/board-lager.c +++ b/arch/arm/mach-shmobile/board-lager.c @@ -45,8 +45,6 @@ #include <linux/sh_eth.h> #include <linux/usb/phy.h> #include <linux/usb/renesas_usbhs.h> -#include <mach/common.h> -#include <mach/irqs.h> #include <mach/r8a7790.h> #include <media/soc_camera.h> #include <asm/mach-types.h> @@ -58,6 +56,9 @@ #include <linux/spi/spi.h> #include <sound/rcar_snd.h> #include <sound/simple_card.h> +#include "common.h" +#include "irqs.h" +#include "rcar-gen2.h" /* * SSI-AK4643 diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c index 0ff4d8e45cf7..0ece865cbc4d 100644 --- a/arch/arm/mach-shmobile/board-mackerel.c +++ b/arch/arm/mach-shmobile/board-mackerel.c @@ -47,7 +47,7 @@ #include <linux/regulator/fixed.h> #include <linux/regulator/machine.h> #include <linux/smsc911x.h> -#include <linux/sh_intc.h> +#include <linux/sh_clk.h> #include <linux/tca6416_keypad.h> #include <linux/usb/renesas_usbhs.h> #include <linux/dma-mapping.h> @@ -58,14 +58,12 @@ #include <media/soc_camera_platform.h> #include <sound/sh_fsi.h> #include <sound/simple_card.h> - -#include <mach/common.h> -#include <mach/irqs.h> #include <mach/sh7372.h> - #include <asm/mach/arch.h> #include <asm/mach-types.h> - +#include "common.h" +#include "irqs.h" +#include "pm-rmobile.h" #include "sh-gpio.h" /* diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c index 2773936bf7dc..0a000b74ac6d 100644 --- a/arch/arm/mach-shmobile/board-marzen-reference.c +++ b/arch/arm/mach-shmobile/board-marzen-reference.c @@ -19,19 +19,40 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <linux/clk/shmobile.h> +#include <linux/clocksource.h> +#include <linux/of_platform.h> #include <mach/r8a7779.h> -#include <mach/common.h> -#include <mach/irqs.h> #include <asm/irq.h> #include <asm/mach/arch.h> +#include "clock.h" +#include "common.h" +#include "irqs.h" + +static void __init marzen_init_timer(void) +{ + r8a7779_clocks_init(r8a7779_read_mode_pins()); + clocksource_of_init(); +} + +/* + * This is a really crude hack to provide clkdev support to platform + * devices until they get moved to DT. + */ +static const struct clk_name clk_names[] __initconst = { + { "tmu0", "fck", "sh-tmu.0" }, +}; static void __init marzen_init(void) { + shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false); r8a7779_add_standard_devices_dt(); + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); r8a7779_init_irq_extpin_dt(1); /* IRQ1 as individual interrupt */ } static const char *marzen_boards_compat_dt[] __initdata = { + "renesas,marzen", "renesas,marzen-reference", NULL, }; @@ -39,7 +60,8 @@ static const char *marzen_boards_compat_dt[] __initdata = { DT_MACHINE_START(MARZEN, "marzen") .smp = smp_ops(r8a7779_smp_ops), .map_io = r8a7779_map_io, - .init_early = r8a7779_init_delay, + .init_early = shmobile_init_delay, + .init_time = marzen_init_timer, .nr_irqs = NR_IRQS_LEGACY, .init_irq = r8a7779_init_irq_dt, .init_machine = marzen_init, diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c index d832a4477b4b..fe445ef49fb9 100644 --- a/arch/arm/mach-shmobile/board-marzen.c +++ b/arch/arm/mach-shmobile/board-marzen.c @@ -43,11 +43,11 @@ #include <linux/mfd/tmio.h> #include <media/soc_camera.h> #include <mach/r8a7779.h> -#include <mach/common.h> -#include <mach/irqs.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/traps.h> +#include "common.h" +#include "irqs.h" /* Fixed 3.3V regulator to be used by SDHI0 */ static struct regulator_consumer_supply fixed3v3_power_consumers[] = { diff --git a/arch/arm/mach-shmobile/clock-r7s72100.c b/arch/arm/mach-shmobile/clock-r7s72100.c index df187484de5d..457dab0f8fc9 100644 --- a/arch/arm/mach-shmobile/clock-r7s72100.c +++ b/arch/arm/mach-shmobile/clock-r7s72100.c @@ -19,8 +19,8 @@ #include <linux/io.h> #include <linux/sh_clk.h> #include <linux/clkdev.h> -#include <mach/common.h> #include <mach/r7s72100.h> +#include "common.h" /* Frequency Control Registers */ #define FRQCR 0xfcfe0010 diff --git a/arch/arm/mach-shmobile/clock-r8a73a4.c b/arch/arm/mach-shmobile/clock-r8a73a4.c index b5bc22c6a858..0f431498229b 100644 --- a/arch/arm/mach-shmobile/clock-r8a73a4.c +++ b/arch/arm/mach-shmobile/clock-r8a73a4.c @@ -22,8 +22,8 @@ #include <linux/kernel.h> #include <linux/sh_clk.h> #include <linux/clkdev.h> -#include <mach/clock.h> -#include <mach/common.h> +#include "common.h" +#include "clock.h" #define CPG_BASE 0xe6150000 #define CPG_LEN 0x270 diff --git a/arch/arm/mach-shmobile/clock-r8a7740.c b/arch/arm/mach-shmobile/clock-r8a7740.c index 50931e3c97c7..ffefec53b058 100644 --- a/arch/arm/mach-shmobile/clock-r8a7740.c +++ b/arch/arm/mach-shmobile/clock-r8a7740.c @@ -22,9 +22,9 @@ #include <linux/io.h> #include <linux/sh_clk.h> #include <linux/clkdev.h> -#include <mach/clock.h> -#include <mach/common.h> #include <mach/r8a7740.h> +#include "clock.h" +#include "common.h" /* * | MDx | XTAL1/EXTAL1 | System | EXTALR | diff --git a/arch/arm/mach-shmobile/clock-r8a7778.c b/arch/arm/mach-shmobile/clock-r8a7778.c index 13f8f3ab8840..16bbc94a1520 100644 --- a/arch/arm/mach-shmobile/clock-r8a7778.c +++ b/arch/arm/mach-shmobile/clock-r8a7778.c @@ -39,8 +39,8 @@ #include <linux/io.h> #include <linux/sh_clk.h> #include <linux/clkdev.h> -#include <mach/clock.h> -#include <mach/common.h> +#include "clock.h" +#include "common.h" #define MSTPCR0 IOMEM(0xffc80030) #define MSTPCR1 IOMEM(0xffc80034) diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c index a13298bd37a8..e690927f3505 100644 --- a/arch/arm/mach-shmobile/clock-r8a7779.c +++ b/arch/arm/mach-shmobile/clock-r8a7779.c @@ -23,8 +23,10 @@ #include <linux/io.h> #include <linux/sh_clk.h> #include <linux/clkdev.h> -#include <mach/clock.h> -#include <mach/common.h> +#include <linux/sh_timer.h> +#include <mach/r8a7779.h> +#include "clock.h" +#include "common.h" /* * MD1 = 1 MD1 = 0 @@ -52,9 +54,6 @@ #define MSTPCR3 IOMEM(0xffc8003c) #define MSTPSR1 IOMEM(0xffc80044) -#define MODEMR 0xffcc0020 - - /* ioremap() through clock mapping mandatory to avoid * collision with ARM coherent DMA virtual memory range. */ @@ -207,14 +206,9 @@ static struct clk_lookup lookups[] = { void __init r8a7779_clock_init(void) { - void __iomem *modemr = ioremap_nocache(MODEMR, PAGE_SIZE); - u32 mode; + u32 mode = r8a7779_read_mode_pins(); int k, ret = 0; - BUG_ON(!modemr); - mode = ioread32(modemr); - iounmap(modemr); - if (mode & MD(1)) { plla_clk.rate = 1500000000; @@ -268,3 +262,13 @@ void __init r8a7779_clock_init(void) else panic("failed to setup r8a7779 clocks\n"); } + +/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ +void __init __weak r8a7779_register_twd(void) { } + +void __init r8a7779_earlytimer_init(void) +{ + r8a7779_clock_init(); + r8a7779_register_twd(); + shmobile_earlytimer_init(); +} diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c index 296a057109e4..ca980669806f 100644 --- a/arch/arm/mach-shmobile/clock-r8a7790.c +++ b/arch/arm/mach-shmobile/clock-r8a7790.c @@ -22,9 +22,10 @@ #include <linux/kernel.h> #include <linux/sh_clk.h> #include <linux/clkdev.h> -#include <mach/clock.h> -#include <mach/common.h> #include <mach/r8a7790.h> +#include "clock.h" +#include "common.h" +#include "rcar-gen2.h" /* * MD EXTAL PLL0 PLL1 PLL3 diff --git a/arch/arm/mach-shmobile/clock-r8a7791.c b/arch/arm/mach-shmobile/clock-r8a7791.c index e2fdfcc14436..10e193d707f5 100644 --- a/arch/arm/mach-shmobile/clock-r8a7791.c +++ b/arch/arm/mach-shmobile/clock-r8a7791.c @@ -23,9 +23,9 @@ #include <linux/kernel.h> #include <linux/sh_clk.h> #include <linux/clkdev.h> -#include <mach/clock.h> -#include <mach/common.h> -#include <mach/rcar-gen2.h> +#include "clock.h" +#include "common.h" +#include "rcar-gen2.h" /* * MD EXTAL PLL0 PLL1 PLL3 diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c index d16d9ca7f79e..7071676145c4 100644 --- a/arch/arm/mach-shmobile/clock-sh7372.c +++ b/arch/arm/mach-shmobile/clock-sh7372.c @@ -21,8 +21,8 @@ #include <linux/io.h> #include <linux/sh_clk.h> #include <linux/clkdev.h> -#include <mach/clock.h> -#include <mach/common.h> +#include "clock.h" +#include "common.h" /* SH7372 registers */ #define FRQCRA IOMEM(0xe6150000) diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c index 0d9cd1fe0212..37f48383e05a 100644 --- a/arch/arm/mach-shmobile/clock-sh73a0.c +++ b/arch/arm/mach-shmobile/clock-sh73a0.c @@ -22,8 +22,8 @@ #include <linux/sh_clk.h> #include <linux/clkdev.h> #include <asm/processor.h> -#include <mach/clock.h> -#include <mach/common.h> +#include "clock.h" +#include "common.h" #define FRQCRA IOMEM(0xe6150000) #define FRQCRB IOMEM(0xe6150004) diff --git a/arch/arm/mach-shmobile/clock.c b/arch/arm/mach-shmobile/clock.c index e7232a0373b9..806f94038cc4 100644 --- a/arch/arm/mach-shmobile/clock.c +++ b/arch/arm/mach-shmobile/clock.c @@ -25,7 +25,7 @@ #ifdef CONFIG_COMMON_CLK #include <linux/clk.h> #include <linux/clkdev.h> -#include <mach/clock.h> +#include "clock.h" void __init shmobile_clk_workaround(const struct clk_name *clks, int nr_clks, bool enable) @@ -49,8 +49,8 @@ void __init shmobile_clk_workaround(const struct clk_name *clks, #else /* CONFIG_COMMON_CLK */ #include <linux/sh_clk.h> #include <linux/export.h> -#include <mach/clock.h> -#include <mach/common.h> +#include "clock.h" +#include "common.h" unsigned long shmobile_fixed_ratio_clk_recalc(struct clk *clk) { diff --git a/arch/arm/mach-shmobile/include/mach/clock.h b/arch/arm/mach-shmobile/clock.h index 31b6417463e6..31b6417463e6 100644 --- a/arch/arm/mach-shmobile/include/mach/clock.h +++ b/arch/arm/mach-shmobile/clock.h diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/common.h index 921a18ef4dfe..921a18ef4dfe 100644 --- a/arch/arm/mach-shmobile/include/mach/common.h +++ b/arch/arm/mach-shmobile/common.h diff --git a/arch/arm/mach-shmobile/console.c b/arch/arm/mach-shmobile/console.c index 9411a5bf4fd6..f2e79f2376e1 100644 --- a/arch/arm/mach-shmobile/console.c +++ b/arch/arm/mach-shmobile/console.c @@ -19,8 +19,8 @@ #include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> -#include <mach/common.h> #include <asm/mach/map.h> +#include "common.h" void __init shmobile_setup_console(void) { diff --git a/arch/arm/mach-shmobile/include/mach/dma-register.h b/arch/arm/mach-shmobile/dma-register.h index 97c40bd9b94f..97c40bd9b94f 100644 --- a/arch/arm/mach-shmobile/include/mach/dma-register.h +++ b/arch/arm/mach-shmobile/dma-register.h diff --git a/arch/arm/mach-shmobile/include/mach/irqs.h b/arch/arm/mach-shmobile/include/mach/irqs.h index d241bfd6926d..5aee83f079e2 100644 --- a/arch/arm/mach-shmobile/include/mach/irqs.h +++ b/arch/arm/mach-shmobile/include/mach/irqs.h @@ -1,24 +1,10 @@ #ifndef __ASM_MACH_IRQS_H #define __ASM_MACH_IRQS_H -#include <linux/sh_intc.h> - -/* GIC */ -#define gic_spi(nr) ((nr) + 32) -#define gic_iid(nr) (nr) /* ICCIAR / interrupt ID */ - -/* INTCS */ -#define INTCS_VECT_BASE 0x3400 -#define INTCS_VECT(n, vect) INTC_VECT((n), INTCS_VECT_BASE + (vect)) -#define intcs_evt2irq(evt) evt2irq(INTCS_VECT_BASE + (evt)) +/* Stuck here until drivers/pinctl/sh-pfc gets rid of legacy code */ /* External IRQ pins */ #define IRQPIN_BASE 2000 #define irq_pin(nr) ((nr) + IRQPIN_BASE) -/* GPIO IRQ */ -#define _GPIO_IRQ_BASE 2500 -#define GPIO_IRQ_BASE(x) (_GPIO_IRQ_BASE + (32 * x)) -#define GPIO_IRQ(x, y) (_GPIO_IRQ_BASE + (32 * x) + y) - #endif /* __ASM_MACH_IRQS_H */ diff --git a/arch/arm/mach-shmobile/include/mach/r8a7740.h b/arch/arm/mach-shmobile/include/mach/r8a7740.h index 5e3c9ec06303..1d1a5fd78b6b 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7740.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7740.h @@ -19,8 +19,6 @@ #ifndef __ASM_R8A7740_H__ #define __ASM_R8A7740_H__ -#include <mach/pm-rmobile.h> - /* * MD_CKx pin */ diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h index 88eeceaf1088..5415c719dc19 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7779.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h @@ -2,8 +2,6 @@ #define __ASM_R8A7779_H__ #include <linux/sh_clk.h> -#include <linux/pm_domain.h> -#include <mach/pm-rcar.h> /* HPB-DMA slave IDs */ enum { @@ -12,17 +10,6 @@ enum { HPBDMA_SLAVE_SDHI0_RX, }; -struct r8a7779_pm_domain { - struct generic_pm_domain genpd; - struct rcar_sysc_ch ch; -}; - -static inline struct rcar_sysc_ch *to_r8a7779_ch(struct generic_pm_domain *d) -{ - return &container_of(d, struct r8a7779_pm_domain, genpd)->ch; -} - -extern void r8a7779_init_delay(void); extern void r8a7779_init_irq_extpin(int irlm); extern void r8a7779_init_irq_extpin_dt(int irlm); extern void r8a7779_init_irq_dt(void); @@ -32,6 +19,7 @@ extern void r8a7779_add_early_devices(void); extern void r8a7779_add_standard_devices(void); extern void r8a7779_add_standard_devices_dt(void); extern void r8a7779_init_late(void); +extern u32 r8a7779_read_mode_pins(void); extern void r8a7779_clock_init(void); extern void r8a7779_pinmux_init(void); extern void r8a7779_pm_init(void); diff --git a/arch/arm/mach-shmobile/include/mach/r8a7790.h b/arch/arm/mach-shmobile/include/mach/r8a7790.h index 0b95babe84ba..d7555440fc7b 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7790.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7790.h @@ -1,8 +1,6 @@ #ifndef __ASM_R8A7790_H__ #define __ASM_R8A7790_H__ -#include <mach/rcar-gen2.h> - /* DMA slave IDs */ enum { RCAR_DMA_SLAVE_INVALID, diff --git a/arch/arm/mach-shmobile/include/mach/sh7372.h b/arch/arm/mach-shmobile/include/mach/sh7372.h index 854a9f0ca040..4ad960d5075b 100644 --- a/arch/arm/mach-shmobile/include/mach/sh7372.h +++ b/arch/arm/mach-shmobile/include/mach/sh7372.h @@ -11,10 +11,6 @@ #ifndef __ASM_SH7372_H__ #define __ASM_SH7372_H__ -#include <linux/sh_clk.h> -#include <linux/pm_domain.h> -#include <mach/pm-rmobile.h> - /* DMA slave IDs */ enum { SHDMA_SLAVE_INVALID, diff --git a/arch/arm/mach-shmobile/intc-sh7372.c b/arch/arm/mach-shmobile/intc-sh7372.c index a91caad7db7c..e2af00b1bd9d 100644 --- a/arch/arm/mach-shmobile/intc-sh7372.c +++ b/arch/arm/mach-shmobile/intc-sh7372.c @@ -22,11 +22,10 @@ #include <linux/module.h> #include <linux/irq.h> #include <linux/io.h> -#include <linux/sh_intc.h> -#include <mach/intc.h> -#include <mach/irqs.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> +#include "intc.h" +#include "irqs.h" enum { UNUSED_INTCA = 0, diff --git a/arch/arm/mach-shmobile/intc-sh73a0.c b/arch/arm/mach-shmobile/intc-sh73a0.c index 19a26f4579b3..1a8f9a7af983 100644 --- a/arch/arm/mach-shmobile/intc-sh73a0.c +++ b/arch/arm/mach-shmobile/intc-sh73a0.c @@ -22,14 +22,13 @@ #include <linux/module.h> #include <linux/irq.h> #include <linux/io.h> -#include <linux/sh_intc.h> #include <linux/irqchip.h> #include <linux/irqchip/arm-gic.h> -#include <mach/intc.h> -#include <mach/irqs.h> #include <mach/sh73a0.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> +#include "intc.h" +#include "irqs.h" enum { UNUSED = 0, diff --git a/arch/arm/mach-shmobile/include/mach/intc.h b/arch/arm/mach-shmobile/intc.h index a5603c76cfe0..a5603c76cfe0 100644 --- a/arch/arm/mach-shmobile/include/mach/intc.h +++ b/arch/arm/mach-shmobile/intc.h diff --git a/arch/arm/mach-shmobile/irqs.h b/arch/arm/mach-shmobile/irqs.h new file mode 100644 index 000000000000..4ff2d2aa94f0 --- /dev/null +++ b/arch/arm/mach-shmobile/irqs.h @@ -0,0 +1,21 @@ +#ifndef __SHMOBILE_IRQS_H +#define __SHMOBILE_IRQS_H + +#include <linux/sh_intc.h> +#include <mach/irqs.h> + +/* GIC */ +#define gic_spi(nr) ((nr) + 32) +#define gic_iid(nr) (nr) /* ICCIAR / interrupt ID */ + +/* INTCS */ +#define INTCS_VECT_BASE 0x3400 +#define INTCS_VECT(n, vect) INTC_VECT((n), INTCS_VECT_BASE + (vect)) +#define intcs_evt2irq(evt) evt2irq(INTCS_VECT_BASE + (evt)) + +/* GPIO IRQ */ +#define _GPIO_IRQ_BASE 2500 +#define GPIO_IRQ_BASE(x) (_GPIO_IRQ_BASE + (32 * x)) +#define GPIO_IRQ(x, y) (_GPIO_IRQ_BASE + (32 * x) + y) + +#endif /* __SHMOBILE_IRQS_H */ diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c index 8cb641c00fdb..fe648f5d8f06 100644 --- a/arch/arm/mach-shmobile/platsmp-apmu.c +++ b/arch/arm/mach-shmobile/platsmp-apmu.c @@ -16,7 +16,7 @@ #include <asm/cacheflush.h> #include <asm/cp15.h> #include <asm/smp_plat.h> -#include <mach/common.h> +#include "common.h" static struct { void __iomem *iomem; diff --git a/arch/arm/mach-shmobile/platsmp-scu.c b/arch/arm/mach-shmobile/platsmp-scu.c index 673ad6e80869..64663110ab6c 100644 --- a/arch/arm/mach-shmobile/platsmp-scu.c +++ b/arch/arm/mach-shmobile/platsmp-scu.c @@ -15,7 +15,7 @@ #include <asm/cacheflush.h> #include <asm/smp_plat.h> #include <asm/smp_scu.h> -#include <mach/common.h> +#include "common.h" static int shmobile_smp_scu_notifier_call(struct notifier_block *nfb, unsigned long action, void *hcpu) diff --git a/arch/arm/mach-shmobile/platsmp.c b/arch/arm/mach-shmobile/platsmp.c index 9ebc246b8d7d..3923e09e966d 100644 --- a/arch/arm/mach-shmobile/platsmp.c +++ b/arch/arm/mach-shmobile/platsmp.c @@ -13,7 +13,7 @@ #include <linux/init.h> #include <asm/cacheflush.h> #include <asm/smp_plat.h> -#include <mach/common.h> +#include "common.h" extern unsigned long shmobile_smp_fn[]; extern unsigned long shmobile_smp_arg[]; diff --git a/arch/arm/mach-shmobile/pm-r8a7740.c b/arch/arm/mach-shmobile/pm-r8a7740.c index 40b87aa1d448..a0d44d537fa0 100644 --- a/arch/arm/mach-shmobile/pm-r8a7740.c +++ b/arch/arm/mach-shmobile/pm-r8a7740.c @@ -10,8 +10,8 @@ */ #include <linux/console.h> #include <linux/suspend.h> -#include <mach/pm-rmobile.h> -#include <mach/common.h> +#include "common.h" +#include "pm-rmobile.h" #ifdef CONFIG_PM static int r8a7740_pd_a4s_suspend(void) diff --git a/arch/arm/mach-shmobile/pm-r8a7779.c b/arch/arm/mach-shmobile/pm-r8a7779.c index d6fe189b2df6..f0f36cb5ffe7 100644 --- a/arch/arm/mach-shmobile/pm-r8a7779.c +++ b/arch/arm/mach-shmobile/pm-r8a7779.c @@ -13,20 +13,31 @@ #include <linux/suspend.h> #include <linux/err.h> #include <linux/pm_clock.h> +#include <linux/pm_domain.h> #include <linux/platform_device.h> #include <linux/delay.h> #include <linux/irq.h> #include <linux/interrupt.h> #include <linux/console.h> #include <asm/io.h> -#include <mach/common.h> -#include <mach/pm-rcar.h> #include <mach/r8a7779.h> +#include "common.h" +#include "pm-rcar.h" /* SYSC */ #define SYSCIER 0x0c #define SYSCIMR 0x10 +struct r8a7779_pm_domain { + struct generic_pm_domain genpd; + struct rcar_sysc_ch ch; +}; + +static inline struct rcar_sysc_ch *to_r8a7779_ch(struct generic_pm_domain *d) +{ + return &container_of(d, struct r8a7779_pm_domain, genpd)->ch; +} + #if defined(CONFIG_PM) || defined(CONFIG_SMP) static void __init r8a7779_sysc_init(void) diff --git a/arch/arm/mach-shmobile/pm-r8a7790.c b/arch/arm/mach-shmobile/pm-r8a7790.c index fc82839e2c2a..0f1090d851e7 100644 --- a/arch/arm/mach-shmobile/pm-r8a7790.c +++ b/arch/arm/mach-shmobile/pm-r8a7790.c @@ -12,8 +12,8 @@ #include <linux/kernel.h> #include <asm/io.h> -#include <mach/pm-rcar.h> #include <mach/r8a7790.h> +#include "pm-rcar.h" /* SYSC */ #define SYSCIER 0x0c diff --git a/arch/arm/mach-shmobile/pm-rcar.c b/arch/arm/mach-shmobile/pm-rcar.c index 1f465a12d1b1..34b8a5674f85 100644 --- a/arch/arm/mach-shmobile/pm-rcar.c +++ b/arch/arm/mach-shmobile/pm-rcar.c @@ -13,7 +13,7 @@ #include <linux/mm.h> #include <linux/spinlock.h> #include <asm/io.h> -#include <mach/pm-rcar.h> +#include "pm-rcar.h" /* SYSC */ #define SYSCSR 0x00 diff --git a/arch/arm/mach-shmobile/include/mach/pm-rcar.h b/arch/arm/mach-shmobile/pm-rcar.h index ef3a1ef628f1..ef3a1ef628f1 100644 --- a/arch/arm/mach-shmobile/include/mach/pm-rcar.h +++ b/arch/arm/mach-shmobile/pm-rcar.h diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c index f710235aff2f..ebdd16e94a84 100644 --- a/arch/arm/mach-shmobile/pm-rmobile.c +++ b/arch/arm/mach-shmobile/pm-rmobile.c @@ -17,7 +17,7 @@ #include <linux/pm.h> #include <linux/pm_clock.h> #include <asm/io.h> -#include <mach/pm-rmobile.h> +#include "pm-rmobile.h" /* SYSC */ #define SPDCR IOMEM(0xe6180008) diff --git a/arch/arm/mach-shmobile/include/mach/pm-rmobile.h b/arch/arm/mach-shmobile/pm-rmobile.h index 690553a06887..690553a06887 100644 --- a/arch/arm/mach-shmobile/include/mach/pm-rmobile.h +++ b/arch/arm/mach-shmobile/pm-rmobile.h diff --git a/arch/arm/mach-shmobile/pm-sh7372.c b/arch/arm/mach-shmobile/pm-sh7372.c index 0de75fd394b9..7ef9a0126780 100644 --- a/arch/arm/mach-shmobile/pm-sh7372.c +++ b/arch/arm/mach-shmobile/pm-sh7372.c @@ -25,9 +25,9 @@ #include <asm/io.h> #include <asm/tlbflush.h> #include <asm/suspend.h> -#include <mach/common.h> #include <mach/sh7372.h> -#include <mach/pm-rmobile.h> +#include "common.h" +#include "pm-rmobile.h" /* DBG */ #define DBGREG1 IOMEM(0xe6100020) diff --git a/arch/arm/mach-shmobile/pm-sh73a0.c b/arch/arm/mach-shmobile/pm-sh73a0.c index 99086e98fbbc..a7e466817965 100644 --- a/arch/arm/mach-shmobile/pm-sh73a0.c +++ b/arch/arm/mach-shmobile/pm-sh73a0.c @@ -9,7 +9,7 @@ */ #include <linux/suspend.h> -#include <mach/common.h> +#include "common.h" #ifdef CONFIG_SUSPEND static int sh73a0_enter_suspend(suspend_state_t suspend_state) diff --git a/arch/arm/mach-shmobile/include/mach/rcar-gen2.h b/arch/arm/mach-shmobile/rcar-gen2.h index 43f606eb2d82..43f606eb2d82 100644 --- a/arch/arm/mach-shmobile/include/mach/rcar-gen2.h +++ b/arch/arm/mach-shmobile/rcar-gen2.h diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c index d953ff6e78a2..6e4ffa74dad4 100644 --- a/arch/arm/mach-shmobile/setup-emev2.c +++ b/arch/arm/mach-shmobile/setup-emev2.c @@ -20,10 +20,10 @@ #include <linux/kernel.h> #include <linux/init.h> #include <linux/of_platform.h> -#include <mach/common.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> +#include "common.h" static struct map_desc emev2_io_desc[] __initdata = { #ifdef CONFIG_SMP diff --git a/arch/arm/mach-shmobile/setup-r7s72100.c b/arch/arm/mach-shmobile/setup-r7s72100.c index 412e179429cd..17a74d355c5d 100644 --- a/arch/arm/mach-shmobile/setup-r7s72100.c +++ b/arch/arm/mach-shmobile/setup-r7s72100.c @@ -22,10 +22,10 @@ #include <linux/kernel.h> #include <linux/of_platform.h> #include <linux/sh_timer.h> -#include <mach/common.h> -#include <mach/irqs.h> #include <mach/r7s72100.h> #include <asm/mach/arch.h> +#include "common.h" +#include "irqs.h" static struct resource mtu2_resources[] __initdata = { DEFINE_RES_MEM(0xfcff0000, 0x400), diff --git a/arch/arm/mach-shmobile/setup-r8a73a4.c b/arch/arm/mach-shmobile/setup-r8a73a4.c index 9333770cfac2..da94d9b9292e 100644 --- a/arch/arm/mach-shmobile/setup-r8a73a4.c +++ b/arch/arm/mach-shmobile/setup-r8a73a4.c @@ -24,11 +24,11 @@ #include <linux/serial_sci.h> #include <linux/sh_dma.h> #include <linux/sh_timer.h> -#include <mach/common.h> -#include <mach/dma-register.h> -#include <mach/irqs.h> #include <mach/r8a73a4.h> #include <asm/mach/arch.h> +#include "common.h" +#include "dma-register.h" +#include "irqs.h" static const struct resource pfc_resources[] = { DEFINE_RES_MEM(0xe6050000, 0x9000), diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c index 35dec233301e..10170b3560c2 100644 --- a/arch/arm/mach-shmobile/setup-r8a7740.c +++ b/arch/arm/mach-shmobile/setup-r8a7740.c @@ -31,15 +31,15 @@ #include <linux/sh_dma.h> #include <linux/sh_timer.h> #include <linux/platform_data/sh_ipmmu.h> -#include <mach/dma-register.h> #include <mach/r8a7740.h> -#include <mach/pm-rmobile.h> -#include <mach/common.h> -#include <mach/irqs.h> #include <asm/mach-types.h> #include <asm/mach/map.h> #include <asm/mach/arch.h> #include <asm/mach/time.h> +#include "common.h" +#include "dma-register.h" +#include "irqs.h" +#include "pm-rmobile.h" static struct map_desc r8a7740_io_desc[] __initdata = { /* diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c index d311ef903b39..d9f4529d8e40 100644 --- a/arch/arm/mach-shmobile/setup-r8a7778.c +++ b/arch/arm/mach-shmobile/setup-r8a7778.c @@ -37,11 +37,11 @@ #include <linux/usb/ehci_pdriver.h> #include <linux/usb/ohci_pdriver.h> #include <linux/dma-mapping.h> -#include <mach/irqs.h> #include <mach/r8a7778.h> -#include <mach/common.h> #include <asm/mach/arch.h> #include <asm/hardware/cache-l2x0.h> +#include "common.h" +#include "irqs.h" /* SCIF */ #define R8A7778_SCIF(index, baseaddr, irq) \ diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c index aba4ed652d54..2f59b99b9b86 100644 --- a/arch/arm/mach-shmobile/setup-r8a7779.c +++ b/arch/arm/mach-shmobile/setup-r8a7779.c @@ -40,14 +40,14 @@ #include <linux/usb/ehci_pdriver.h> #include <linux/usb/ohci_pdriver.h> #include <linux/pm_runtime.h> -#include <mach/irqs.h> #include <mach/r8a7779.h> -#include <mach/common.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/time.h> #include <asm/mach/map.h> #include <asm/hardware/cache-l2x0.h> +#include "common.h" +#include "irqs.h" static struct map_desc r8a7779_io_desc[] __initdata = { /* 2M entity map for 0xf0000000 (MPCORE) */ @@ -640,16 +640,16 @@ static void __init r8a7779_register_hpb_dmae(void) } static struct platform_device *r8a7779_devices_dt[] __initdata = { + &tmu0_device, +}; + +static struct platform_device *r8a7779_standard_devices[] __initdata = { &scif0_device, &scif1_device, &scif2_device, &scif3_device, &scif4_device, &scif5_device, - &tmu0_device, -}; - -static struct platform_device *r8a7779_standard_devices[] __initdata = { &i2c0_device, &i2c1_device, &i2c2_device, @@ -674,16 +674,6 @@ void __init r8a7779_add_standard_devices(void) r8a7779_register_hpb_dmae(); } -/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ -void __init __weak r8a7779_register_twd(void) { } - -void __init r8a7779_earlytimer_init(void) -{ - r8a7779_clock_init(); - r8a7779_register_twd(); - shmobile_earlytimer_init(); -} - void __init r8a7779_add_early_devices(void) { early_platform_add_devices(r8a7779_devices_dt, @@ -747,19 +737,28 @@ void __init r8a7779_init_irq_dt(void) __raw_writel(0x003fee3f, INT2SMSKCR4); } -void __init r8a7779_init_delay(void) +void __init r8a7779_add_standard_devices_dt(void) { - shmobile_setup_delay(1000, 2, 4); /* Cortex-A9 @ 1000MHz */ + platform_add_devices(r8a7779_devices_dt, + ARRAY_SIZE(r8a7779_devices_dt)); } -void __init r8a7779_add_standard_devices_dt(void) +#define MODEMR 0xffcc0020 + +u32 __init r8a7779_read_mode_pins(void) { - /* clocks are setup late during boot in the case of DT */ - r8a7779_clock_init(); + static u32 mode; + static bool mode_valid; + + if (!mode_valid) { + void __iomem *modemr = ioremap_nocache(MODEMR, PAGE_SIZE); + BUG_ON(!modemr); + mode = ioread32(modemr); + iounmap(modemr); + mode_valid = true; + } - platform_add_devices(r8a7779_devices_dt, - ARRAY_SIZE(r8a7779_devices_dt)); - of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); + return mode; } static const char *r8a7779_compat_dt[] __initdata = { @@ -769,7 +768,7 @@ static const char *r8a7779_compat_dt[] __initdata = { DT_MACHINE_START(R8A7779_DT, "Generic R8A7779 (Flattened Device Tree)") .map_io = r8a7779_map_io, - .init_early = r8a7779_init_delay, + .init_early = shmobile_init_delay, .nr_irqs = NR_IRQS_LEGACY, .init_irq = r8a7779_init_irq_dt, .init_machine = r8a7779_add_standard_devices_dt, diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c index 6bd08b127fa4..4212c8de987a 100644 --- a/arch/arm/mach-shmobile/setup-r8a7790.c +++ b/arch/arm/mach-shmobile/setup-r8a7790.c @@ -26,11 +26,12 @@ #include <linux/serial_sci.h> #include <linux/sh_dma.h> #include <linux/sh_timer.h> -#include <mach/common.h> -#include <mach/dma-register.h> -#include <mach/irqs.h> #include <mach/r8a7790.h> #include <asm/mach/arch.h> +#include "common.h" +#include "dma-register.h" +#include "irqs.h" +#include "rcar-gen2.h" /* Audio-DMAC */ #define AUDIO_DMAC_SLAVE(_id, _addr, t, r) \ diff --git a/arch/arm/mach-shmobile/setup-r8a7791.c b/arch/arm/mach-shmobile/setup-r8a7791.c index 04a96ddb3224..f554cda4a96a 100644 --- a/arch/arm/mach-shmobile/setup-r8a7791.c +++ b/arch/arm/mach-shmobile/setup-r8a7791.c @@ -26,11 +26,11 @@ #include <linux/platform_data/irq-renesas-irqc.h> #include <linux/serial_sci.h> #include <linux/sh_timer.h> -#include <mach/common.h> -#include <mach/irqs.h> #include <mach/r8a7791.h> -#include <mach/rcar-gen2.h> #include <asm/mach/arch.h> +#include "common.h" +#include "irqs.h" +#include "rcar-gen2.h" static const struct resource pfc_resources[] __initconst = { DEFINE_RES_MEM(0xe6060000, 0x250), diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c index 542c5a47173f..fdc714ebc4cd 100644 --- a/arch/arm/mach-shmobile/setup-rcar-gen2.c +++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c @@ -22,9 +22,9 @@ #include <linux/clocksource.h> #include <linux/io.h> #include <linux/kernel.h> -#include <mach/common.h> -#include <mach/rcar-gen2.h> #include <asm/mach/arch.h> +#include "common.h" +#include "rcar-gen2.h" #define MODEMR 0xe6160060 diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c index 2a8b9f2a2f54..5571f867c611 100644 --- a/arch/arm/mach-shmobile/setup-sh7372.c +++ b/arch/arm/mach-shmobile/setup-sh7372.c @@ -29,19 +29,19 @@ #include <linux/io.h> #include <linux/serial_sci.h> #include <linux/sh_dma.h> -#include <linux/sh_intc.h> #include <linux/sh_timer.h> #include <linux/pm_domain.h> #include <linux/dma-mapping.h> #include <linux/platform_data/sh_ipmmu.h> -#include <mach/dma-register.h> -#include <mach/irqs.h> #include <mach/sh7372.h> -#include <mach/common.h> #include <asm/mach/map.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/time.h> +#include "common.h" +#include "dma-register.h" +#include "irqs.h" +#include "pm-rmobile.h" static struct map_desc sh7372_io_desc[] __initdata = { /* create a 1:1 entity map for 0xe6xxxxxx diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c index ad00724a2269..b30bbee6dc65 100644 --- a/arch/arm/mach-shmobile/setup-sh73a0.c +++ b/arch/arm/mach-shmobile/setup-sh73a0.c @@ -29,18 +29,17 @@ #include <linux/io.h> #include <linux/serial_sci.h> #include <linux/sh_dma.h> -#include <linux/sh_intc.h> #include <linux/sh_timer.h> #include <linux/platform_data/sh_ipmmu.h> #include <linux/platform_data/irq-renesas-intc-irqpin.h> -#include <mach/dma-register.h> -#include <mach/irqs.h> #include <mach/sh73a0.h> -#include <mach/common.h> #include <asm/mach-types.h> #include <asm/mach/map.h> #include <asm/mach/arch.h> #include <asm/mach/time.h> +#include "common.h" +#include "dma-register.h" +#include "irqs.h" static struct map_desc sh73a0_io_desc[] __initdata = { /* create a 1:1 entity map for 0xe6xxxxxx diff --git a/arch/arm/mach-shmobile/smp-emev2.c b/arch/arm/mach-shmobile/smp-emev2.c index 2dfd748da7f3..6ff1df1df9a7 100644 --- a/arch/arm/mach-shmobile/smp-emev2.c +++ b/arch/arm/mach-shmobile/smp-emev2.c @@ -23,9 +23,9 @@ #include <linux/spinlock.h> #include <linux/io.h> #include <linux/delay.h> -#include <mach/common.h> #include <asm/smp_plat.h> #include <asm/smp_scu.h> +#include "common.h" #define EMEV2_SCU_BASE 0x1e000000 #define EMEV2_SMU_BASE 0xe0110000 diff --git a/arch/arm/mach-shmobile/smp-r8a7779.c b/arch/arm/mach-shmobile/smp-r8a7779.c index e7a3201473d0..c230fc0c3fef 100644 --- a/arch/arm/mach-shmobile/smp-r8a7779.c +++ b/arch/arm/mach-shmobile/smp-r8a7779.c @@ -23,13 +23,13 @@ #include <linux/spinlock.h> #include <linux/io.h> #include <linux/delay.h> -#include <mach/common.h> -#include <mach/pm-rcar.h> #include <mach/r8a7779.h> #include <asm/cacheflush.h> #include <asm/smp_plat.h> #include <asm/smp_scu.h> #include <asm/smp_twd.h> +#include "common.h" +#include "pm-rcar.h" #define AVECR IOMEM(0xfe700040) #define R8A7779_SCU_BASE 0xf0000000 diff --git a/arch/arm/mach-shmobile/smp-r8a7790.c b/arch/arm/mach-shmobile/smp-r8a7790.c index 591052799e8f..a8ace58c3dd2 100644 --- a/arch/arm/mach-shmobile/smp-r8a7790.c +++ b/arch/arm/mach-shmobile/smp-r8a7790.c @@ -18,9 +18,9 @@ #include <linux/smp.h> #include <linux/io.h> #include <asm/smp_plat.h> -#include <mach/common.h> -#include <mach/pm-rcar.h> #include <mach/r8a7790.h> +#include "common.h" +#include "pm-rcar.h" #define RST 0xe6160000 #define CA15BAR 0x0020 diff --git a/arch/arm/mach-shmobile/smp-r8a7791.c b/arch/arm/mach-shmobile/smp-r8a7791.c index ec979529f30f..2648d68650e4 100644 --- a/arch/arm/mach-shmobile/smp-r8a7791.c +++ b/arch/arm/mach-shmobile/smp-r8a7791.c @@ -18,9 +18,9 @@ #include <linux/smp.h> #include <linux/io.h> #include <asm/smp_plat.h> -#include <mach/common.h> #include <mach/r8a7791.h> -#include <mach/rcar-gen2.h> +#include "common.h" +#include "rcar-gen2.h" #define RST 0xe6160000 #define CA15BAR 0x0020 diff --git a/arch/arm/mach-shmobile/smp-sh73a0.c b/arch/arm/mach-shmobile/smp-sh73a0.c index 13ba36a6831f..bf4aff99ed1c 100644 --- a/arch/arm/mach-shmobile/smp-sh73a0.c +++ b/arch/arm/mach-shmobile/smp-sh73a0.c @@ -22,10 +22,10 @@ #include <linux/smp.h> #include <linux/io.h> #include <linux/delay.h> -#include <mach/common.h> #include <mach/sh73a0.h> #include <asm/smp_plat.h> #include <asm/smp_twd.h> +#include "common.h" #define WUPCR IOMEM(0xe6151010) #define SRESCR IOMEM(0xe6151018) |