Merge tag 'imx-soc-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo...
authorOlof Johansson <olof@lixom.net>
Sat, 19 Jul 2014 18:56:39 +0000 (11:56 -0700)
committerOlof Johansson <olof@lixom.net>
Sat, 19 Jul 2014 18:56:39 +0000 (11:56 -0700)
Merge "ARM: imx: SoC changes for 3.17" from Shawn Guo:

The i.MX SoC changes for 3.17:
 - Add devicetree support for i.MX1 and i.MX21 clock driver
 - Use CLOCKSOURCE_OF_DECLARE() to initialize timer for DT targets
 - Use of_clk_init() to initialize i.MX25 and i.MX27 clock driver in
   device tree boot
 - Remove i.MX1 camera support
 - Remove i.MX27 IP Camera and Lite-Kit board support
 - Add suspend and cpuidle support for i.mx6sx
 - Clean up unused clk_register_clkdev() lookups
 - Update imx-weim bus driver to support populating devices on a simple
   bus
 - Switch i.MX27 and i.MX6QDL clock driver to use macro for clock IDs
 - Make i.MX51 a DT only platform and clean up the non-DT support code
 - Support disabling supervisor protect via DT
 - Random defconfig updates

* tag 'imx-soc-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: (69 commits)
  ARM: imx: clk-vf610: fix FlexCAN clock gating
  ARM: i.MX: Use CLOCKSOURCE_OF_DECLARE() for DT targets
  ARM: i.MX53: globally disable supervisor protect
  ARM: i.MX: allow disabling supervisor protect via DT
  ARM: i.MX27 clk: Add 26 MHz oscillator circuit clock gate
  ARM: i.MX27 clk: Remove unused definitions
  ARM: i.MX27 clk: Introduce DT include for clock provider
  ARM: i.MX: Remove Freescale Logic Product Development i.MX27 Lite-Kit board support
  ARM: i.MX: Remove excess symbols ARCH_MX1, ARCH_MX25 and MACH_MX27
  ARM: i.MX: Remove i.MX1 camera support
  ARM: imx: use PTR_ERR_OR_ZERO
  bus: imx-weim: populate devices on a simple bus
  ARM: imx: build cpu_is_imx6sl function conditionally
  ARM: imx: imx6sx uses imx6q cpuidle code
  ARM: imx: drop PL310 errata 588369 and 727915
  ARM: imx_v6_v7_defconfig: add FSL_EDMA and PRINTK_TIME
  ARM: imx: clk-imx6sx: register SSI/SSI_IPG as shared gate clocks
  ARM: imx_v6_v7_defconfig: Enable flexcan driver for can support
  ARM: imx_v6_v7_defconfig: Enable STMPE gpio support
  ARM: imx: mark .dt_compat as const
  ...

Signed-off-by: Olof Johansson <olof@lixom.net>
138 files changed:
Documentation/arm/Marvell/README
Documentation/devicetree/bindings/arm/arm-boards
Documentation/devicetree/bindings/clock/arm-integrator.txt
arch/arm/boot/dts/Makefile
arch/arm/boot/dts/emev2.dtsi
arch/arm/boot/dts/r7s72100.dtsi
arch/arm/boot/dts/r8a7779-marzen-reference.dts [deleted file]
arch/arm/boot/dts/r8a7779-marzen.dts
arch/arm/boot/dts/r8a7779.dtsi
arch/arm/boot/dts/versatile-ab.dts
arch/arm/boot/dts/versatile-pb.dts
arch/arm/common/timer-sp.c
arch/arm/lib/delay.c
arch/arm/mach-berlin/Kconfig
arch/arm/mach-berlin/Makefile
arch/arm/mach-berlin/headsmp.S [new file with mode: 0644]
arch/arm/mach-berlin/platsmp.c [new file with mode: 0644]
arch/arm/mach-integrator/integrator_ap.c
arch/arm/mach-integrator/integrator_cp.c
arch/arm/mach-mvebu/Kconfig
arch/arm/mach-mvebu/Makefile
arch/arm/mach-mvebu/armada-370-xp.h
arch/arm/mach-mvebu/board-v7.c
arch/arm/mach-mvebu/board.h
arch/arm/mach-mvebu/common.h
arch/arm/mach-mvebu/cpu-reset.c
arch/arm/mach-mvebu/hotplug.c [deleted file]
arch/arm/mach-mvebu/kirkwood.c
arch/arm/mach-mvebu/mvebu-soc-id.c
arch/arm/mach-mvebu/netxbig.c [new file with mode: 0644]
arch/arm/mach-mvebu/platsmp-a9.c
arch/arm/mach-mvebu/platsmp.c
arch/arm/mach-mvebu/pmsu.c
arch/arm/mach-mvebu/system-controller.c
arch/arm/mach-shmobile/Kconfig
arch/arm/mach-shmobile/Makefile
arch/arm/mach-shmobile/Makefile.boot
arch/arm/mach-shmobile/board-ape6evm-reference.c
arch/arm/mach-shmobile/board-ape6evm.c
arch/arm/mach-shmobile/board-armadillo800eva-reference.c
arch/arm/mach-shmobile/board-armadillo800eva.c
arch/arm/mach-shmobile/board-bockw-reference.c
arch/arm/mach-shmobile/board-bockw.c
arch/arm/mach-shmobile/board-genmai-reference.c
arch/arm/mach-shmobile/board-genmai.c
arch/arm/mach-shmobile/board-koelsch-reference.c
arch/arm/mach-shmobile/board-koelsch.c
arch/arm/mach-shmobile/board-kzm9g-reference.c
arch/arm/mach-shmobile/board-kzm9g.c
arch/arm/mach-shmobile/board-lager-reference.c
arch/arm/mach-shmobile/board-lager.c
arch/arm/mach-shmobile/board-mackerel.c
arch/arm/mach-shmobile/board-marzen-reference.c
arch/arm/mach-shmobile/board-marzen.c
arch/arm/mach-shmobile/clock-r7s72100.c
arch/arm/mach-shmobile/clock-r8a73a4.c
arch/arm/mach-shmobile/clock-r8a7740.c
arch/arm/mach-shmobile/clock-r8a7778.c
arch/arm/mach-shmobile/clock-r8a7779.c
arch/arm/mach-shmobile/clock-r8a7790.c
arch/arm/mach-shmobile/clock-r8a7791.c
arch/arm/mach-shmobile/clock-sh7372.c
arch/arm/mach-shmobile/clock-sh73a0.c
arch/arm/mach-shmobile/clock.c
arch/arm/mach-shmobile/clock.h [new file with mode: 0644]
arch/arm/mach-shmobile/common.h [new file with mode: 0644]
arch/arm/mach-shmobile/console.c
arch/arm/mach-shmobile/cpufreq.c [new file with mode: 0644]
arch/arm/mach-shmobile/dma-register.h [new file with mode: 0644]
arch/arm/mach-shmobile/headsmp.S
arch/arm/mach-shmobile/include/mach/clock.h [deleted file]
arch/arm/mach-shmobile/include/mach/common.h [deleted file]
arch/arm/mach-shmobile/include/mach/dma-register.h [deleted file]
arch/arm/mach-shmobile/include/mach/intc.h [deleted file]
arch/arm/mach-shmobile/include/mach/irqs.h
arch/arm/mach-shmobile/include/mach/pm-rcar.h [deleted file]
arch/arm/mach-shmobile/include/mach/pm-rmobile.h [deleted file]
arch/arm/mach-shmobile/include/mach/r7s72100.h [deleted file]
arch/arm/mach-shmobile/include/mach/r8a73a4.h [deleted file]
arch/arm/mach-shmobile/include/mach/r8a7740.h [deleted file]
arch/arm/mach-shmobile/include/mach/r8a7778.h [deleted file]
arch/arm/mach-shmobile/include/mach/r8a7779.h [deleted file]
arch/arm/mach-shmobile/include/mach/r8a7790.h [deleted file]
arch/arm/mach-shmobile/include/mach/r8a7791.h [deleted file]
arch/arm/mach-shmobile/include/mach/rcar-gen2.h [deleted file]
arch/arm/mach-shmobile/include/mach/sh7372.h [deleted file]
arch/arm/mach-shmobile/include/mach/sh73a0.h [deleted file]
arch/arm/mach-shmobile/intc-sh7372.c
arch/arm/mach-shmobile/intc-sh73a0.c
arch/arm/mach-shmobile/intc.h [new file with mode: 0644]
arch/arm/mach-shmobile/irqs.h [new file with mode: 0644]
arch/arm/mach-shmobile/platsmp-apmu.c
arch/arm/mach-shmobile/platsmp-scu.c
arch/arm/mach-shmobile/platsmp.c
arch/arm/mach-shmobile/pm-r8a7740.c
arch/arm/mach-shmobile/pm-r8a7779.c
arch/arm/mach-shmobile/pm-r8a7790.c
arch/arm/mach-shmobile/pm-r8a7791.c [new file with mode: 0644]
arch/arm/mach-shmobile/pm-rcar.c
arch/arm/mach-shmobile/pm-rcar.h [new file with mode: 0644]
arch/arm/mach-shmobile/pm-rmobile.c
arch/arm/mach-shmobile/pm-rmobile.h [new file with mode: 0644]
arch/arm/mach-shmobile/pm-sh7372.c
arch/arm/mach-shmobile/pm-sh73a0.c
arch/arm/mach-shmobile/r7s72100.h [new file with mode: 0644]
arch/arm/mach-shmobile/r8a73a4.h [new file with mode: 0644]
arch/arm/mach-shmobile/r8a7740.h [new file with mode: 0644]
arch/arm/mach-shmobile/r8a7778.h [new file with mode: 0644]
arch/arm/mach-shmobile/r8a7779.h [new file with mode: 0644]
arch/arm/mach-shmobile/r8a7790.h [new file with mode: 0644]
arch/arm/mach-shmobile/r8a7791.h [new file with mode: 0644]
arch/arm/mach-shmobile/rcar-gen2.h [new file with mode: 0644]
arch/arm/mach-shmobile/setup-emev2.c
arch/arm/mach-shmobile/setup-r7s72100.c
arch/arm/mach-shmobile/setup-r8a73a4.c
arch/arm/mach-shmobile/setup-r8a7740.c
arch/arm/mach-shmobile/setup-r8a7778.c
arch/arm/mach-shmobile/setup-r8a7779.c
arch/arm/mach-shmobile/setup-r8a7790.c
arch/arm/mach-shmobile/setup-r8a7791.c
arch/arm/mach-shmobile/setup-rcar-gen2.c
arch/arm/mach-shmobile/setup-sh7372.c
arch/arm/mach-shmobile/setup-sh73a0.c
arch/arm/mach-shmobile/sh7372.h [new file with mode: 0644]
arch/arm/mach-shmobile/sh73a0.h [new file with mode: 0644]
arch/arm/mach-shmobile/smp-emev2.c
arch/arm/mach-shmobile/smp-r8a7779.c
arch/arm/mach-shmobile/smp-r8a7790.c
arch/arm/mach-shmobile/smp-r8a7791.c
arch/arm/mach-shmobile/smp-sh73a0.c
arch/arm/mach-shmobile/timer.c
arch/arm/mach-versatile/versatile_dt.c
drivers/clk/versatile/Makefile
drivers/clk/versatile/clk-integrator.c [deleted file]
drivers/clk/versatile/clk-versatile.c [new file with mode: 0644]
drivers/clocksource/tegra20_timer.c
drivers/irqchip/irq-versatile-fpga.c
init/calibrate.c

index 2cce5401e323ff0bc88ed98557babbd2a963234e..1af3a5d5621d26ac932ca527ed3cce7ef519b83a 100644 (file)
@@ -83,7 +83,9 @@ EBU Armada family
         88F6710
         88F6707
         88F6W11
-    Product Brief: http://www.marvell.com/embedded-processors/armada-300/assets/Marvell_ARMADA_370_SoC.pdf
+    Product Brief:   http://www.marvell.com/embedded-processors/armada-300/assets/Marvell_ARMADA_370_SoC.pdf
+    Hardware Spec:   http://www.marvell.com/embedded-processors/armada-300/assets/ARMADA370-datasheet.pdf
+    Functional Spec: http://www.marvell.com/embedded-processors/armada-300/assets/ARMADA370-FunctionalSpec-datasheet.pdf
 
   Armada 375 Flavors:
        88F6720
index 3509707f932085a8380576ee4c6b63a453dab1a7..c554ed3d44fb7c77f8ae19c441a57f5d05853ef8 100644 (file)
@@ -86,3 +86,9 @@ Interrupt controllers:
        compatible = "arm,versatile-sic";
        interrupt-controller;
        #interrupt-cells = <1>;
+
+Required nodes:
+
+- core-module: the root node to the Versatile platforms must have
+  a core-module with regs and the compatible strings
+  "arm,core-module-versatile", "syscon"
index 652914b17b9557cb8a6e9721e15b6ace744b5791..ecc69520bceaa11542e8b7905dc3a52e1dc754a5 100644 (file)
@@ -1,4 +1,4 @@
-Clock bindings for ARM Integrator Core Module clocks
+Clock bindings for ARM Integrator and Versatile Core Module clocks
 
 Auxilary Oscillator Clock
 
@@ -12,7 +12,7 @@ parent node.
 
 
 Required properties:
-- compatible: must be "arm,integrator-cm-auxosc"
+- compatible: must be "arm,integrator-cm-auxosc" or "arm,versatile-cm-auxosc"
 - #clock-cells: must be <0>
 
 Optional properties:
index adb5ed9e269e196a55c380002d266062fd06c3b7..eb280d3483eb3111cd369df4fbd121462f27b0b7 100644 (file)
@@ -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 \
index e37985fa10e2b6aca96f047f788f9674ddf0bf9f..00eeed3721b63bfeb0bad99169557f660a03f1cc 100644 (file)
                        device_type = "cpu";
                        compatible = "arm,cortex-a9";
                        reg = <0>;
+                       clock-frequency = <533000000>;
                };
                cpu@1 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a9";
                        reg = <1>;
+                       clock-frequency = <533000000>;
                };
        };
 
index f50fbc8f3bd9584a5d8a74fb9fb55c4bfe01225b..bdee225411895f75b7e8477527496ff696074cf3 100644 (file)
                        device_type = "cpu";
                        compatible = "arm,cortex-a9";
                        reg = <0>;
+                       clock-frequency = <400000000>;
                };
        };
 
diff --git a/arch/arm/boot/dts/r8a7779-marzen-reference.dts b/arch/arm/boot/dts/r8a7779-marzen-reference.dts
deleted file mode 100644 (file)
index b27c637..0000000
+++ /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";
-};
index a7af2c2371f2581b6e9f8e1e43a064eef46bc60e..5745555df9433fb4573aebba1f8ec3578b6f45d1 100644 (file)
 
 /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";
 };
index b517c8e6b42094c5637a1aae27a4eec4a0f83b82..94e2fc83649250f90cd18163be3ef321c881a401 100644 (file)
@@ -11,6 +11,7 @@
 
 /include/ "skeleton.dtsi"
 
+#include <dt-bindings/clock/r8a7779-clock.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 
 / {
                        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>;
                };
        };
 
                compatible = "renesas,i2c-r8a7779";
                reg = <0xffc70000 0x1000>;
                interrupts = <0 79 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp0_clks R8A7779_CLK_I2C0>;
                status = "disabled";
        };
 
                compatible = "renesas,i2c-r8a7779";
                reg = <0xffc71000 0x1000>;
                interrupts = <0 82 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp0_clks R8A7779_CLK_I2C1>;
                status = "disabled";
        };
 
                compatible = "renesas,i2c-r8a7779";
                reg = <0xffc72000 0x1000>;
                interrupts = <0 80 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp0_clks R8A7779_CLK_I2C2>;
                status = "disabled";
        };
 
                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";
        };
 
                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";
                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";
                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";
                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";
                interrupts = <0 73 IRQ_TYPE_LEVEL_HIGH>;
                #address-cells = <1>;
                #size-cells = <0>;
+               clocks = <&mstp0_clks R8A7779_CLK_HSPI>;
                status = "disabled";
        };
 
                interrupts = <0 74 IRQ_TYPE_LEVEL_HIGH>;
                #address-cells = <1>;
                #size-cells = <0>;
+               clocks = <&mstp0_clks R8A7779_CLK_HSPI>;
                status = "disabled";
        };
 
                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";
+               };
+       };
 };
index e01e5a081def6fd6d47619461ae7da851ed4af29..36c771a2d765de67cb5ccf80c1fcd629db96fd71 100644 (file)
                reg = <0x0 0x08000000>;
        };
 
+       xtal24mhz: xtal24mhz@24M {
+               #clock-cells = <0>;
+               compatible = "fixed-clock";
+               clock-frequency = <24000000>;
+       };
+
+       core-module@10000000 {
+               compatible = "arm,core-module-versatile", "syscon";
+               reg = <0x10000000 0x200>;
+
+               /* OSC1 on AB, OSC4 on PB */
+               osc1: cm_aux_osc@24M {
+                       #clock-cells = <0>;
+                       compatible = "arm,versatile-cm-auxosc";
+                       clocks = <&xtal24mhz>;
+               };
+
+               /* The timer clock is the 24 MHz oscillator divided to 1MHz */
+               timclk: timclk@1M {
+                       #clock-cells = <0>;
+                       compatible = "fixed-factor-clock";
+                       clock-div = <24>;
+                       clock-mult = <1>;
+                       clocks = <&xtal24mhz>;
+               };
+
+               pclk: pclk@24M {
+                       #clock-cells = <0>;
+                       compatible = "fixed-factor-clock";
+                       clock-div = <1>;
+                       clock-mult = <1>;
+                       clocks = <&xtal24mhz>;
+               };
+       };
+
        flash@34000000 {
                compatible = "arm,versatile-flash";
                reg = <0x34000000 0x4000000>;
@@ -59,6 +94,8 @@
                        interrupt-controller;
                        #interrupt-cells = <1>;
                        reg = <0x10140000 0x1000>;
+                       clear-mask = <0xffffffff>;
+                       valid-mask = <0xffffffff>;
                };
 
                sic: intc@10003000 {
                        reg = <0x10003000 0x1000>;
                        interrupt-parent = <&vic>;
                        interrupts = <31>; /* Cascaded to vic */
+                       clear-mask = <0xffffffff>;
+                       valid-mask = <0xffc203f8>;
                };
 
                dma@10130000 {
                        compatible = "arm,pl081", "arm,primecell";
                        reg = <0x10130000 0x1000>;
                        interrupts = <17>;
+                       clocks = <&pclk>;
+                       clock-names = "apb_pclk";
                };
 
                uart0: uart@101f1000 {
                        compatible = "arm,pl011", "arm,primecell";
                        reg = <0x101f1000 0x1000>;
                        interrupts = <12>;
+                       clocks = <&xtal24mhz>, <&pclk>;
+                       clock-names = "uartclk", "apb_pclk";
                };
 
                uart1: uart@101f2000 {
                        compatible = "arm,pl011", "arm,primecell";
                        reg = <0x101f2000 0x1000>;
                        interrupts = <13>;
+                       clocks = <&xtal24mhz>, <&pclk>;
+                       clock-names = "uartclk", "apb_pclk";
                };
 
                uart2: uart@101f3000 {
                        compatible = "arm,pl011", "arm,primecell";
                        reg = <0x101f3000 0x1000>;
                        interrupts = <14>;
+                       clocks = <&xtal24mhz>, <&pclk>;
+                       clock-names = "uartclk", "apb_pclk";
                };
 
                smc@10100000 {
                        compatible = "arm,primecell";
                        reg = <0x10100000 0x1000>;
+                       clocks = <&pclk>;
+                       clock-names = "apb_pclk";
                };
 
                mpmc@10110000 {
                        compatible = "arm,primecell";
                        reg = <0x10110000 0x1000>;
+                       clocks = <&pclk>;
+                       clock-names = "apb_pclk";
                };
 
                display@10120000 {
                        compatible = "arm,pl110", "arm,primecell";
                        reg = <0x10120000 0x1000>;
                        interrupts = <16>;
+                       clocks = <&osc1>, <&pclk>;
+                       clock-names = "clcd", "apb_pclk";
                };
 
                sctl@101e0000 {
                        compatible = "arm,primecell";
                        reg = <0x101e0000 0x1000>;
+                       clocks = <&pclk>;
+                       clock-names = "apb_pclk";
                };
 
                watchdog@101e1000 {
                        compatible = "arm,primecell";
                        reg = <0x101e1000 0x1000>;
                        interrupts = <0>;
+                       clocks = <&pclk>;
+                       clock-names = "apb_pclk";
                };
 
                timer@101e2000 {
                        compatible = "arm,sp804", "arm,primecell";
                        reg = <0x101e2000 0x1000>;
                        interrupts = <4>;
+                       clocks = <&timclk>, <&timclk>, <&pclk>;
+                       clock-names = "timer0", "timer1", "apb_pclk";
                };
 
                timer@101e3000 {
                        compatible = "arm,sp804", "arm,primecell";
                        reg = <0x101e3000 0x1000>;
                        interrupts = <5>;
+                       clocks = <&timclk>, <&timclk>, <&pclk>;
+                       clock-names = "timer0", "timer1", "apb_pclk";
                };
 
                gpio0: gpio@101e4000 {
                        #gpio-cells = <2>;
                        interrupt-controller;
                        #interrupt-cells = <2>;
+                       clocks = <&pclk>;
+                       clock-names = "apb_pclk";
                };
 
                gpio1: gpio@101e5000 {
                        #gpio-cells = <2>;
                        interrupt-controller;
                        #interrupt-cells = <2>;
+                       clocks = <&pclk>;
+                       clock-names = "apb_pclk";
                };
 
                rtc@101e8000 {
                        compatible = "arm,pl030", "arm,primecell";
                        reg = <0x101e8000 0x1000>;
                        interrupts = <10>;
+                       clocks = <&pclk>;
+                       clock-names = "apb_pclk";
                };
 
                sci@101f0000 {
                        compatible = "arm,primecell";
                        reg = <0x101f0000 0x1000>;
                        interrupts = <15>;
+                       clocks = <&pclk>;
+                       clock-names = "apb_pclk";
                };
 
                ssp@101f4000 {
                        compatible = "arm,pl022", "arm,primecell";
                        reg = <0x101f4000 0x1000>;
                        interrupts = <11>;
+                       clocks = <&xtal24mhz>, <&pclk>;
+                       clock-names = "SSPCLK", "apb_pclk";
                };
 
                fpga {
                                compatible = "arm,primecell";
                                reg = <0x4000 0x1000>;
                                interrupts = <24>;
+                               clocks = <&pclk>;
+                               clock-names = "apb_pclk";
                        };
                        mmc@5000 {
-                               compatible = "arm,primecell";
+                               compatible = "arm,pl180", "arm,primecell";
                                reg = < 0x5000 0x1000>;
                                interrupts-extended = <&vic 22 &sic 2>;
+                               clocks = <&xtal24mhz>, <&pclk>;
+                               clock-names = "mclk", "apb_pclk";
                        };
                        kmi@6000 {
                                compatible = "arm,pl050", "arm,primecell";
                                reg = <0x6000 0x1000>;
                                interrupt-parent = <&sic>;
                                interrupts = <3>;
+                               clocks = <&xtal24mhz>, <&pclk>;
+                               clock-names = "KMIREFCLK", "apb_pclk";
                        };
                        kmi@7000 {
                                compatible = "arm,pl050", "arm,primecell";
                                reg = <0x7000 0x1000>;
                                interrupt-parent = <&sic>;
                                interrupts = <4>;
+                               clocks = <&xtal24mhz>, <&pclk>;
+                               clock-names = "KMIREFCLK", "apb_pclk";
                        };
                };
        };
index 65f6577113235749c3635dc30d321fa3c775b1c0..d025048119d3078ee1730531071a3e3ca5189d37 100644 (file)
@@ -13,6 +13,8 @@
                        #gpio-cells = <2>;
                        interrupt-controller;
                        #interrupt-cells = <2>;
+                       clocks = <&pclk>;
+                       clock-names = "apb_pclk";
                };
 
                gpio3: gpio@101e7000 {
@@ -23,6 +25,8 @@
                        #gpio-cells = <2>;
                        interrupt-controller;
                        #interrupt-cells = <2>;
+                       clocks = <&pclk>;
+                       clock-names = "apb_pclk";
                };
 
                fpga {
                                reg = <0x9000 0x1000>;
                                interrupt-parent = <&sic>;
                                interrupts = <6>;
+                               clocks = <&xtal24mhz>, <&pclk>;
+                               clock-names = "uartclk", "apb_pclk";
                        };
                        sci@a000 {
                                compatible = "arm,primecell";
                                reg = <0xa000 0x1000>;
                                interrupt-parent = <&sic>;
                                interrupts = <5>;
+                               clocks = <&xtal24mhz>;
+                               clock-names = "apb_pclk";
                        };
                        mmc@b000 {
-                               compatible = "arm,primecell";
+                               compatible = "arm,pl180", "arm,primecell";
                                reg = <0xb000 0x1000>;
                                interrupts-extended = <&vic 23 &sic 2>;
+                               clocks = <&xtal24mhz>, <&pclk>;
+                               clock-names = "mclk", "apb_pclk";
                        };
                };
        };
index fd6bff0c5b967a7503c8912c8ef2a52101e4c7eb..19211324772f387c4925984e58fe29b4682fed38 100644 (file)
@@ -233,13 +233,13 @@ static void __init sp804_of_init(struct device_node *np)
        if (IS_ERR(clk1))
                clk1 = NULL;
 
-       /* Get the 2nd clock if the timer has 2 timer clocks */
+       /* Get the 2nd clock if the timer has 3 timer clocks */
        if (of_count_phandle_with_args(np, "clocks", "#clock-cells") == 3) {
                clk2 = of_clk_get(np, 1);
                if (IS_ERR(clk2)) {
                        pr_err("sp804: %s clock not found: %d\n", np->name,
                                (int)PTR_ERR(clk2));
-                       goto err;
+                       clk2 = NULL;
                }
        } else
                clk2 = clk1;
index 5306de35013397994ec6873f2a713af5d47867a4..312d43eb686a0254543258efdc3185c340bde82c 100644 (file)
@@ -19,6 +19,7 @@
  * Author: Will Deacon <will.deacon@arm.com>
  */
 
+#include <linux/clocksource.h>
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -36,6 +37,7 @@ struct arm_delay_ops arm_delay_ops = {
 
 static const struct delay_timer *delay_timer;
 static bool delay_calibrated;
+static u64 delay_res;
 
 int read_current_timer(unsigned long *timer_val)
 {
@@ -47,6 +49,11 @@ int read_current_timer(unsigned long *timer_val)
 }
 EXPORT_SYMBOL_GPL(read_current_timer);
 
+static inline u64 cyc_to_ns(u64 cyc, u32 mult, u32 shift)
+{
+       return (cyc * mult) >> shift;
+}
+
 static void __timer_delay(unsigned long cycles)
 {
        cycles_t start = get_cycles();
@@ -69,18 +76,24 @@ static void __timer_udelay(unsigned long usecs)
 
 void __init register_current_timer_delay(const struct delay_timer *timer)
 {
-       if (!delay_calibrated) {
-               pr_info("Switching to timer-based delay loop\n");
+       u32 new_mult, new_shift;
+       u64 res;
+
+       clocks_calc_mult_shift(&new_mult, &new_shift, timer->freq,
+                              NSEC_PER_SEC, 3600);
+       res = cyc_to_ns(1ULL, new_mult, new_shift);
+
+       if (!delay_calibrated && (!delay_res || (res < delay_res))) {
+               pr_info("Switching to timer-based delay loop, resolution %lluns\n", res);
                delay_timer                     = timer;
                lpj_fine                        = timer->freq / HZ;
+               delay_res                       = res;
 
                /* cpufreq may scale loops_per_jiffy, so keep a private copy */
                arm_delay_ops.ticks_per_jiffy   = lpj_fine;
                arm_delay_ops.delay             = __timer_delay;
                arm_delay_ops.const_udelay      = __timer_const_udelay;
                arm_delay_ops.udelay            = __timer_udelay;
-
-               delay_calibrated                = true;
        } else {
                pr_info("Ignoring duplicate/late registration of read_current_timer delay\n");
        }
@@ -91,3 +104,8 @@ unsigned long calibrate_delay_is_known(void)
        delay_calibrated = true;
        return lpj_fine;
 }
+
+void calibration_delay_done(void)
+{
+       delay_calibrated = true;
+}
index 2631cfc5ab0d5e21cc6c957a52ab7f0f0dfb60a8..24f85be71671080cc9234c7677eefd8c56682c20 100644 (file)
@@ -13,7 +13,9 @@ config MACH_BERLIN_BG2
        bool "Marvell Armada 1500 (BG2)"
        select CACHE_L2X0
        select CPU_PJ4B
+       select HAVE_ARM_SCU if SMP
        select HAVE_ARM_TWD if SMP
+       select HAVE_SMP
        select PINCTRL_BERLIN_BG2
 
 config MACH_BERLIN_BG2CD
@@ -25,6 +27,7 @@ config MACH_BERLIN_BG2CD
 config MACH_BERLIN_BG2Q
        bool "Marvell Armada 1500 Pro (BG2-Q)"
        select CACHE_L2X0
+       select HAVE_ARM_SCU if SMP
        select HAVE_ARM_TWD if SMP
        select PINCTRL_BERLIN_BG2Q
 
index ab69fe956f4929258135dfb08c440e64b2838cf9..c0719ecd189044a70d3d7585e05fcd6674c26ca9 100644 (file)
@@ -1 +1,2 @@
-obj-y += berlin.o
+obj-y                  += berlin.o
+obj-$(CONFIG_SMP)      += headsmp.o platsmp.o
diff --git a/arch/arm/mach-berlin/headsmp.S b/arch/arm/mach-berlin/headsmp.S
new file mode 100644 (file)
index 0000000..4a4c56a
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2014 Marvell Technology Group Ltd.
+ *
+ * Antoine Ténart <antoine.tenart@free-electrons.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/linkage.h>
+#include <linux/init.h>
+#include <asm/assembler.h>
+
+ENTRY(berlin_secondary_startup)
+ ARM_BE8(setend be)
+       bl      v7_invalidate_l1
+       b       secondary_startup
+ENDPROC(berlin_secondary_startup)
+
+/*
+ * If the following instruction is set in the reset exception vector, CPUs
+ * will fetch the value of the software reset address vector when being
+ * reset.
+ */
+.global boot_inst
+boot_inst:
+       ldr     pc, [pc, #140]
+
+       .align
diff --git a/arch/arm/mach-berlin/platsmp.c b/arch/arm/mach-berlin/platsmp.c
new file mode 100644 (file)
index 0000000..702e798
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2014 Marvell Technology Group Ltd.
+ *
+ * Antoine Ténart <antoine.tenart@free-electrons.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/io.h>
+#include <linux/delay.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+
+#include <asm/cacheflush.h>
+#include <asm/smp_plat.h>
+#include <asm/smp_scu.h>
+
+#define CPU_RESET              0x00
+
+#define RESET_VECT             0x00
+#define SW_RESET_ADDR          0x94
+
+extern void berlin_secondary_startup(void);
+extern u32 boot_inst;
+
+static void __iomem *cpu_ctrl;
+
+static inline void berlin_perform_reset_cpu(unsigned int cpu)
+{
+       u32 val;
+
+       val = readl(cpu_ctrl + CPU_RESET);
+       val |= BIT(cpu_logical_map(cpu));
+       writel(val, cpu_ctrl + CPU_RESET);
+}
+
+static int berlin_boot_secondary(unsigned int cpu, struct task_struct *idle)
+{
+       if (!cpu_ctrl)
+               return -EFAULT;
+
+       /*
+        * Reset the CPU, making it to execute the instruction in the reset
+        * exception vector.
+        */
+       berlin_perform_reset_cpu(cpu);
+
+       return 0;
+}
+
+static void __init berlin_smp_prepare_cpus(unsigned int max_cpus)
+{
+       struct device_node *np;
+       void __iomem *scu_base;
+       void __iomem *vectors_base;
+
+       np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu");
+       scu_base = of_iomap(np, 0);
+       of_node_put(np);
+       if (!scu_base)
+               return;
+
+       np = of_find_compatible_node(NULL, NULL, "marvell,berlin-cpu-ctrl");
+       cpu_ctrl = of_iomap(np, 0);
+       of_node_put(np);
+       if (!cpu_ctrl)
+               goto unmap_scu;
+
+       vectors_base = ioremap(CONFIG_VECTORS_BASE, SZ_32K);
+       if (!vectors_base)
+               goto unmap_scu;
+
+       scu_enable(scu_base);
+       flush_cache_all();
+
+       /*
+        * Write the first instruction the CPU will execute after being reset
+        * in the reset exception vector.
+        */
+       writel(boot_inst, vectors_base + RESET_VECT);
+
+       /*
+        * Write the secondary startup address into the SW reset address
+        * vector. This is used by boot_inst.
+        */
+       writel(virt_to_phys(berlin_secondary_startup), vectors_base + SW_RESET_ADDR);
+
+       iounmap(vectors_base);
+unmap_scu:
+       iounmap(scu_base);
+}
+
+static struct smp_operations berlin_smp_ops __initdata = {
+       .smp_prepare_cpus       = berlin_smp_prepare_cpus,
+       .smp_boot_secondary     = berlin_boot_secondary,
+};
+CPU_METHOD_OF_DECLARE(berlin_smp, "marvell,berlin-smp", &berlin_smp_ops);
index 660ca6feff4024fe8cd51bea46463be542ebf38e..8ca290b479b1ffb04eb931db39183999caa1b7d8 100644 (file)
@@ -31,7 +31,7 @@
 #include <linux/clockchips.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
-#include <linux/irqchip/versatile-fpga.h>
+#include <linux/irqchip.h>
 #include <linux/mtd/physmap.h>
 #include <linux/clk.h>
 #include <linux/platform_data/clk-integrator.h>
@@ -439,15 +439,10 @@ static void __init ap_of_timer_init(void)
        integrator_clockevent_init(rate, base, irq);
 }
 
-static const struct of_device_id fpga_irq_of_match[] __initconst = {
-       { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, },
-       { /* Sentinel */ }
-};
-
 static void __init ap_init_irq_of(void)
 {
        cm_init();
-       of_irq_init(fpga_irq_of_match);
+       irqchip_init();
 }
 
 /* For the Device Tree, add in the UART callbacks as AUXDATA */
@@ -558,7 +553,6 @@ DT_MACHINE_START(INTEGRATOR_AP_DT, "ARM Integrator/AP (Device Tree)")
        .map_io         = ap_map_io,
        .init_early     = ap_init_early,
        .init_irq       = ap_init_irq_of,
-       .handle_irq     = fpga_handle_irq,
        .init_time      = ap_of_timer_init,
        .init_machine   = ap_init_of,
        .restart        = integrator_restart,
index 0e57f8f820a54ec040270449e8d16487c7a8edc9..5236ebee249c27c997a483761529064c3ae8401d 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/amba/clcd.h>
 #include <linux/amba/mmci.h>
 #include <linux/io.h>
-#include <linux/irqchip/versatile-fpga.h>
+#include <linux/irqchip.h>
 #include <linux/gfp.h>
 #include <linux/mtd/physmap.h>
 #include <linux/of_irq.h>
@@ -235,15 +235,10 @@ static void __init intcp_init_early(void)
        sched_clock_register(intcp_read_sched_clock, 32, 24000000);
 }
 
-static const struct of_device_id fpga_irq_of_match[] __initconst = {
-       { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, },
-       { /* Sentinel */ }
-};
-
 static void __init intcp_init_irq_of(void)
 {
        cm_init();
-       of_irq_init(fpga_irq_of_match);
+       irqchip_init();
 }
 
 /*
@@ -329,7 +324,6 @@ DT_MACHINE_START(INTEGRATOR_CP_DT, "ARM Integrator/CP (Device Tree)")
        .map_io         = intcp_map_io,
        .init_early     = intcp_init_early,
        .init_irq       = intcp_init_irq_of,
-       .handle_irq     = fpga_handle_irq,
        .init_machine   = intcp_init_of,
        .restart        = integrator_restart,
        .dt_compat      = intcp_dt_board_compat,
index b9bc599a5fd04fa8bc4b7b6e13ad1073fb4c513a..955d4a3afabdf08a991490c1ec8a6d7cad685d05 100644 (file)
@@ -96,4 +96,11 @@ config MACH_KIRKWOOD
          Say 'Y' here if you want your kernel to support boards based
          on the Marvell Kirkwood device tree.
 
+config MACH_NETXBIG
+       bool "LaCie 2Big and 5Big Network v2"
+       depends on MACH_KIRKWOOD
+       help
+         Say 'Y' here if you want your kernel to support the
+         LaCie 2Big and 5Big Network v2
+
 endif
index 2ecb828e4a8bd223ef086a3787cd7980f557ab78..90bcd5327312e680f393edf85f400b61c2276c1a 100644 (file)
@@ -9,8 +9,8 @@ obj-y                            += system-controller.o mvebu-soc-id.o
 ifeq ($(CONFIG_MACH_MVEBU_V7),y)
 obj-y                           += cpu-reset.o board-v7.o coherency.o coherency_ll.o pmsu.o
 obj-$(CONFIG_SMP)               += platsmp.o headsmp.o platsmp-a9.o headsmp-a9.o
-obj-$(CONFIG_HOTPLUG_CPU)       += hotplug.o
 endif
 
 obj-$(CONFIG_MACH_DOVE)                 += dove.o
 obj-$(CONFIG_MACH_KIRKWOOD)     += kirkwood.o kirkwood-pm.o
+obj-$(CONFIG_MACH_NETXBIG)      += netxbig.o
index c3465f5b12500fb74e6975ce46c9a8a34c1871f3..52c1603a4f9255f70010a4ce2d8563be403ec594 100644 (file)
@@ -24,4 +24,7 @@ void armada_xp_secondary_startup(void);
 extern struct smp_operations armada_xp_smp_ops;
 #endif
 
+int armada_370_xp_pmsu_idle_enter(unsigned long deepidle);
+void armada_370_xp_pmsu_idle_exit(void);
+
 #endif /* __MACH_ARMADA_370_XP_H */
index 8bb742fdf5cabd9974a3da2e9e1f802f4620bb13..a04675e2ec995f771c9d0b8b674801b461123287 100644 (file)
@@ -118,8 +118,16 @@ static void __init thermal_quirk(void)
 {
        struct device_node *np;
        u32 dev, rev;
+       int res;
 
-       if (mvebu_get_soc_id(&dev, &rev) == 0 && rev > ARMADA_375_Z1_REV)
+       /*
+        * The early SoC Z1 revision needs a quirk to be applied in order
+        * for the thermal controller to work properly. This quirk breaks
+        * the thermal support if applied on a SoC that doesn't need it,
+        * so we enforce the SoC revision to be known.
+        */
+       res = mvebu_get_soc_id(&dev, &rev);
+       if (res < 0 || (res == 0 && rev > ARMADA_375_Z1_REV))
                return;
 
        for_each_compatible_node(np, NULL, "marvell,armada375-thermal") {
@@ -153,7 +161,8 @@ static void __init thermal_quirk(void)
 
                /*
                 * The thermal controller needs some quirk too, so let's change
-                * the compatible string to reflect this.
+                * the compatible string to reflect this and allow the driver
+                * the take the necessary action.
                 */
                prop = kzalloc(sizeof(*prop), GFP_KERNEL);
                prop->name = kstrdup("compatible", GFP_KERNEL);
index 9c7bb4386f8bc92574a0723ebd7ea303e9028201..98e32cc2ef3dac4388e1fd5c06d444fa20734d02 100644 (file)
@@ -13,4 +13,9 @@
 #ifndef __ARCH_MVEBU_BOARD_H
 #define __ARCH_MVEBU_BOARD_H
 
+#ifdef CONFIG_MACH_NETXBIG
+void netxbig_init(void);
+#else
+static inline void netxbig_init(void) {};
+#endif
 #endif
index b67fb7a10d8b466086672170c5615de4583f009f..a97778e28bf655e54eed958d3dc2500e5bbd6b91 100644 (file)
@@ -21,7 +21,6 @@ void mvebu_restart(enum reboot_mode mode, const char *cmd);
 int mvebu_cpu_reset_deassert(int cpu);
 void mvebu_pmsu_set_cpu_boot_addr(int hw_cpu, void *boot_addr);
 void mvebu_system_controller_set_cpu_boot_addr(void *boot_addr);
-
-void armada_xp_cpu_die(unsigned int cpu);
+int mvebu_system_controller_get_soc_id(u32 *dev, u32 *rev);
 
 #endif
index 4a8f9eebebead591f9c13970d818e2283dd07642..60fb537870047d2850e8681a57e92f3e4a399460 100644 (file)
@@ -67,7 +67,7 @@ static int mvebu_cpu_reset_map(struct device_node *np, int res_idx)
        return 0;
 }
 
-int __init mvebu_cpu_reset_init(void)
+static int __init mvebu_cpu_reset_init(void)
 {
        struct device_node *np;
        int res_idx;
diff --git a/arch/arm/mach-mvebu/hotplug.c b/arch/arm/mach-mvebu/hotplug.c
deleted file mode 100644 (file)
index d95e910..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Symmetric Multi Processing (SMP) support for Armada XP
- *
- * Copyright (C) 2012 Marvell
- *
- * Lior Amsalem <alior@marvell.com>
- * Gregory CLEMENT <gregory.clement@free-electrons.com>
- * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
- *
- * 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.
- */
-#include <linux/kernel.h>
-#include <linux/errno.h>
-#include <linux/smp.h>
-#include <asm/proc-fns.h>
-#include "common.h"
-
-/*
- * platform-specific code to shutdown a CPU
- *
- * Called with IRQs disabled
- */
-void __ref armada_xp_cpu_die(unsigned int cpu)
-{
-       cpu_do_idle();
-
-       /* We should never return from idle */
-       panic("mvebu: cpu %d unexpectedly exit from shutdown\n", cpu);
-}
index 46f105913c84b75e6b6c7b1095cdf485f015af5d..6b5310828eb2e7fa95fda207492ff0cc014803ab 100644 (file)
@@ -180,6 +180,9 @@ static void __init kirkwood_dt_init(void)
        kirkwood_pm_init();
        kirkwood_dt_eth_fixup();
 
+       if (of_machine_is_compatible("lacie,netxbig"))
+               netxbig_init();
+
        of_platform_populate(NULL, of_default_bus_match_table, auxdata, NULL);
 }
 
index d0f35b4d4a234af8ff826c30b0bf6e8dfaea19b0..a99434bcee849bc2654e356a2f0148d09fbcc039 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/of_address.h>
 #include <linux/slab.h>
 #include <linux/sys_soc.h>
+#include "common.h"
 #include "mvebu-soc-id.h"
 
 #define PCIE_DEV_ID_OFF                0x0
@@ -51,10 +52,10 @@ int mvebu_get_soc_id(u32 *dev, u32 *rev)
                *rev = soc_rev;
                return 0;
        } else
-               return -1;
+               return -ENODEV;
 }
 
-static int __init mvebu_soc_id_init(void)
+static int __init get_soc_id_by_pci(void)
 {
        struct device_node *np;
        int ret = 0;
@@ -129,6 +130,22 @@ clk_err:
 
        return ret;
 }
+
+static int __init mvebu_soc_id_init(void)
+{
+
+       /*
+        * First try to get the ID and the revision by the system
+        * register and use PCI registers only if it is not possible
+        */
+       if (!mvebu_system_controller_get_soc_id(&soc_dev_id, &soc_rev)) {
+               is_id_valid = true;
+               pr_info("MVEBU SoC ID=0x%X, Rev=0x%X\n", soc_dev_id, soc_rev);
+               return 0;
+       }
+
+       return get_soc_id_by_pci();
+}
 early_initcall(mvebu_soc_id_init);
 
 static int __init mvebu_soc_device(void)
diff --git a/arch/arm/mach-mvebu/netxbig.c b/arch/arm/mach-mvebu/netxbig.c
new file mode 100644 (file)
index 0000000..94b11b6
--- /dev/null
@@ -0,0 +1,191 @@
+/*
+ * arch/arm/mach-mvbu/board-netxbig.c
+ *
+ * LaCie 2Big and 5Big Network v2 board setup
+ *
+ * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/kernel.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/platform_data/leds-kirkwood-netxbig.h>
+#include "common.h"
+
+/*****************************************************************************
+ * GPIO extension LEDs
+ ****************************************************************************/
+
+/*
+ * The LEDs are controlled by a CPLD and can be configured through a GPIO
+ * extension bus:
+ *
+ * - address register : bit [0-2] -> GPIO [47-49]
+ * - data register    : bit [0-2] -> GPIO [44-46]
+ * - enable register  : GPIO 29
+ */
+
+static int netxbig_v2_gpio_ext_addr[] = { 47, 48, 49 };
+static int netxbig_v2_gpio_ext_data[] = { 44, 45, 46 };
+
+static struct netxbig_gpio_ext netxbig_v2_gpio_ext = {
+       .addr           = netxbig_v2_gpio_ext_addr,
+       .num_addr       = ARRAY_SIZE(netxbig_v2_gpio_ext_addr),
+       .data           = netxbig_v2_gpio_ext_data,
+       .num_data       = ARRAY_SIZE(netxbig_v2_gpio_ext_data),
+       .enable         = 29,
+};
+
+/*
+ * Address register selection:
+ *
+ * addr | register
+ * ----------------------------
+ *   0  | front LED
+ *   1  | front LED brightness
+ *   2  | SATA LED brightness
+ *   3  | SATA0 LED
+ *   4  | SATA1 LED
+ *   5  | SATA2 LED
+ *   6  | SATA3 LED
+ *   7  | SATA4 LED
+ *
+ * Data register configuration:
+ *
+ * data | LED brightness
+ * -------------------------------------------------
+ *   0  | min (off)
+ *   -  | -
+ *   7  | max
+ *
+ * data | front LED mode
+ * -------------------------------------------------
+ *   0  | fix off
+ *   1  | fix blue on
+ *   2  | fix red on
+ *   3  | blink blue on=1 sec and blue off=1 sec
+ *   4  | blink red on=1 sec and red off=1 sec
+ *   5  | blink blue on=2.5 sec and red on=0.5 sec
+ *   6  | blink blue on=1 sec and red on=1 sec
+ *   7  | blink blue on=0.5 sec and blue off=2.5 sec
+ *
+ * data | SATA LED mode
+ * -------------------------------------------------
+ *   0  | fix off
+ *   1  | SATA activity blink
+ *   2  | fix red on
+ *   3  | blink blue on=1 sec and blue off=1 sec
+ *   4  | blink red on=1 sec and red off=1 sec
+ *   5  | blink blue on=2.5 sec and red on=0.5 sec
+ *   6  | blink blue on=1 sec and red on=1 sec
+ *   7  | fix blue on
+ */
+
+static int netxbig_v2_red_mled[NETXBIG_LED_MODE_NUM] = {
+       [NETXBIG_LED_OFF]       = 0,
+       [NETXBIG_LED_ON]        = 2,
+       [NETXBIG_LED_SATA]      = NETXBIG_LED_INVALID_MODE,
+       [NETXBIG_LED_TIMER1]    = 4,
+       [NETXBIG_LED_TIMER2]    = NETXBIG_LED_INVALID_MODE,
+};
+
+static int netxbig_v2_blue_pwr_mled[NETXBIG_LED_MODE_NUM] = {
+       [NETXBIG_LED_OFF]       = 0,
+       [NETXBIG_LED_ON]        = 1,
+       [NETXBIG_LED_SATA]      = NETXBIG_LED_INVALID_MODE,
+       [NETXBIG_LED_TIMER1]    = 3,
+       [NETXBIG_LED_TIMER2]    = 7,
+};
+
+static int netxbig_v2_blue_sata_mled[NETXBIG_LED_MODE_NUM] = {
+       [NETXBIG_LED_OFF]       = 0,
+       [NETXBIG_LED_ON]        = 7,
+       [NETXBIG_LED_SATA]      = 1,
+       [NETXBIG_LED_TIMER1]    = 3,
+       [NETXBIG_LED_TIMER2]    = NETXBIG_LED_INVALID_MODE,
+};
+
+static struct netxbig_led_timer netxbig_v2_led_timer[] = {
+       [0] = {
+               .delay_on       = 500,
+               .delay_off      = 500,
+               .mode           = NETXBIG_LED_TIMER1,
+       },
+       [1] = {
+               .delay_on       = 500,
+               .delay_off      = 1000,
+               .mode           = NETXBIG_LED_TIMER2,
+       },
+};
+
+#define NETXBIG_LED(_name, maddr, mval, baddr)                 \
+       { .name         = _name,                                \
+         .mode_addr    = maddr,                                \
+         .mode_val     = mval,                                 \
+         .bright_addr  = baddr }
+
+static struct netxbig_led net2big_v2_leds_ctrl[] = {
+       NETXBIG_LED("net2big-v2:blue:power", 0, netxbig_v2_blue_pwr_mled,  1),
+       NETXBIG_LED("net2big-v2:red:power",  0, netxbig_v2_red_mled,       1),
+       NETXBIG_LED("net2big-v2:blue:sata0", 3, netxbig_v2_blue_sata_mled, 2),
+       NETXBIG_LED("net2big-v2:red:sata0",  3, netxbig_v2_red_mled,       2),
+       NETXBIG_LED("net2big-v2:blue:sata1", 4, netxbig_v2_blue_sata_mled, 2),
+       NETXBIG_LED("net2big-v2:red:sata1",  4, netxbig_v2_red_mled,       2),
+};
+
+static struct netxbig_led_platform_data net2big_v2_leds_data = {
+       .gpio_ext       = &netxbig_v2_gpio_ext,
+       .timer          = netxbig_v2_led_timer,
+       .num_timer      = ARRAY_SIZE(netxbig_v2_led_timer),
+       .leds           = net2big_v2_leds_ctrl,
+       .num_leds       = ARRAY_SIZE(net2big_v2_leds_ctrl),
+};
+
+static struct netxbig_led net5big_v2_leds_ctrl[] = {
+       NETXBIG_LED("net5big-v2:blue:power", 0, netxbig_v2_blue_pwr_mled,  1),
+       NETXBIG_LED("net5big-v2:red:power",  0, netxbig_v2_red_mled,       1),
+       NETXBIG_LED("net5big-v2:blue:sata0", 3, netxbig_v2_blue_sata_mled, 2),
+       NETXBIG_LED("net5big-v2:red:sata0",  3, netxbig_v2_red_mled,       2),
+       NETXBIG_LED("net5big-v2:blue:sata1", 4, netxbig_v2_blue_sata_mled, 2),
+       NETXBIG_LED("net5big-v2:red:sata1",  4, netxbig_v2_red_mled,       2),
+       NETXBIG_LED("net5big-v2:blue:sata2", 5, netxbig_v2_blue_sata_mled, 2),
+       NETXBIG_LED("net5big-v2:red:sata2",  5, netxbig_v2_red_mled,       2),
+       NETXBIG_LED("net5big-v2:blue:sata3", 6, netxbig_v2_blue_sata_mled, 2),
+       NETXBIG_LED("net5big-v2:red:sata3",  6, netxbig_v2_red_mled,       2),
+       NETXBIG_LED("net5big-v2:blue:sata4", 7, netxbig_v2_blue_sata_mled, 2),
+       NETXBIG_LED("net5big-v2:red:sata4",  7, netxbig_v2_red_mled,       2),
+};
+
+static struct netxbig_led_platform_data net5big_v2_leds_data = {
+       .gpio_ext       = &netxbig_v2_gpio_ext,
+       .timer          = netxbig_v2_led_timer,
+       .num_timer      = ARRAY_SIZE(netxbig_v2_led_timer),
+       .leds           = net5big_v2_leds_ctrl,
+       .num_leds       = ARRAY_SIZE(net5big_v2_leds_ctrl),
+};
+
+static struct platform_device netxbig_v2_leds = {
+       .name           = "leds-netxbig",
+       .id             = -1,
+       .dev            = {
+               .platform_data  = &net2big_v2_leds_data,
+       },
+};
+
+void __init netxbig_init(void)
+{
+
+       if (of_machine_is_compatible("lacie,net5big_v2"))
+               netxbig_v2_leds.dev.platform_data = &net5big_v2_leds_data;
+       platform_device_register(&netxbig_v2_leds);
+}
index 96c2c59e34b67bc108d05f8f81c1255faa9f9174..43aaf3fa75ee1a493319771d2e578d927ae14697 100644 (file)
@@ -33,7 +33,7 @@
 extern unsigned char armada_375_smp_cpu1_enable_code_end;
 extern unsigned char armada_375_smp_cpu1_enable_code_start;
 
-void armada_375_smp_cpu1_enable_wa(void)
+static void armada_375_smp_cpu1_enable_wa(void)
 {
        void __iomem *sram_virt_base;
 
@@ -91,9 +91,6 @@ static int __cpuinit mvebu_cortex_a9_boot_secondary(unsigned int cpu,
 
 static struct smp_operations mvebu_cortex_a9_smp_ops __initdata = {
        .smp_boot_secondary     = mvebu_cortex_a9_boot_secondary,
-#ifdef CONFIG_HOTPLUG_CPU
-       .cpu_die                = armada_xp_cpu_die,
-#endif
 };
 
 CPU_METHOD_OF_DECLARE(mvebu_armada_375_smp, "marvell,armada-375-smp",
index 88b976b317198f7733b4945eaad440c195175aaa..b6fa9f0c98b896efa7534c502c981962281af402 100644 (file)
@@ -78,6 +78,17 @@ static int armada_xp_boot_secondary(unsigned int cpu, struct task_struct *idle)
 
        hw_cpu = cpu_logical_map(cpu);
        mvebu_pmsu_set_cpu_boot_addr(hw_cpu, armada_xp_secondary_startup);
+
+       /*
+        * This is needed to wake up CPUs in the offline state after
+        * using CPU hotplug.
+        */
+       arch_send_wakeup_ipi_mask(cpumask_of(cpu));
+
+       /*
+        * This is needed to take secondary CPUs out of reset on the
+        * initial boot.
+        */
        ret = mvebu_cpu_reset_deassert(hw_cpu);
        if (ret) {
                pr_warn("unable to boot CPU: %d\n", ret);
@@ -87,6 +98,19 @@ static int armada_xp_boot_secondary(unsigned int cpu, struct task_struct *idle)
        return 0;
 }
 
+/*
+ * When a CPU is brought back online, either through CPU hotplug, or
+ * because of the boot of a kexec'ed kernel, the PMSU configuration
+ * for this CPU might be in the deep idle state, preventing this CPU
+ * from receiving interrupts. Here, we therefore take out the current
+ * CPU from this state, which was entered by armada_xp_cpu_die()
+ * below.
+ */
+static void armada_xp_secondary_init(unsigned int cpu)
+{
+       armada_370_xp_pmsu_idle_exit();
+}
+
 static void __init armada_xp_smp_init_cpus(void)
 {
        unsigned int ncores = num_possible_cpus();
@@ -122,12 +146,36 @@ static void __init armada_xp_smp_prepare_cpus(unsigned int max_cpus)
                panic("The address for the BootROM is incorrect");
 }
 
+#ifdef CONFIG_HOTPLUG_CPU
+static void armada_xp_cpu_die(unsigned int cpu)
+{
+       /*
+        * CPU hotplug is implemented by putting offline CPUs into the
+        * deep idle sleep state.
+        */
+       armada_370_xp_pmsu_idle_enter(true);
+}
+
+/*
+ * We need a dummy function, so that platform_can_cpu_hotplug() knows
+ * we support CPU hotplug. However, the function does not need to do
+ * anything, because CPUs going offline can enter the deep idle state
+ * by themselves, without any help from a still alive CPU.
+ */
+static int armada_xp_cpu_kill(unsigned int cpu)
+{
+       return 1;
+}
+#endif
+
 struct smp_operations armada_xp_smp_ops __initdata = {
        .smp_init_cpus          = armada_xp_smp_init_cpus,
        .smp_prepare_cpus       = armada_xp_smp_prepare_cpus,
        .smp_boot_secondary     = armada_xp_boot_secondary,
+       .smp_secondary_init     = armada_xp_secondary_init,
 #ifdef CONFIG_HOTPLUG_CPU
        .cpu_die                = armada_xp_cpu_die,
+       .cpu_kill               = armada_xp_cpu_kill,
 #endif
 };
 
index 53a55c8520bf9a1fbab97919457af791f202ca2d..9c819d65b337bb682db10a4844b44aff2b3bbd61 100644 (file)
@@ -148,13 +148,13 @@ static void armada_370_xp_cpu_resume(void)
 }
 
 /* No locking is needed because we only access per-CPU registers */
-void armada_370_xp_pmsu_idle_prepare(bool deepidle)
+int armada_370_xp_pmsu_idle_enter(unsigned long deepidle)
 {
        unsigned int hw_cpu = cpu_logical_map(smp_processor_id());
        u32 reg;
 
        if (pmsu_mp_base == NULL)
-               return;
+               return -EINVAL;
 
        /*
         * Adjust the PMSU configuration to wait for WFI signal, enable
@@ -183,11 +183,6 @@ void armada_370_xp_pmsu_idle_prepare(bool deepidle)
        reg = readl(pmsu_mp_base + PMSU_CPU_POWER_DOWN_CONTROL(hw_cpu));
        reg |= PMSU_CPU_POWER_DOWN_DIS_SNP_Q_SKIP;
        writel(reg, pmsu_mp_base + PMSU_CPU_POWER_DOWN_CONTROL(hw_cpu));
-}
-
-static noinline int do_armada_370_xp_cpu_suspend(unsigned long deepidle)
-{
-       armada_370_xp_pmsu_idle_prepare(deepidle);
 
        v7_exit_coherency_flush(all);
 
@@ -220,11 +215,11 @@ static noinline int do_armada_370_xp_cpu_suspend(unsigned long deepidle)
 
 static int armada_370_xp_cpu_suspend(unsigned long deepidle)
 {
-       return cpu_suspend(deepidle, do_armada_370_xp_cpu_suspend);
+       return cpu_suspend(deepidle, armada_370_xp_pmsu_idle_enter);
 }
 
 /* No locking is needed because we only access per-CPU registers */
-static noinline void armada_370_xp_pmsu_idle_restore(void)
+void armada_370_xp_pmsu_idle_exit(void)
 {
        unsigned int hw_cpu = cpu_logical_map(smp_processor_id());
        u32 reg;
@@ -253,7 +248,7 @@ static int armada_370_xp_cpu_pm_notify(struct notifier_block *self,
                unsigned int hw_cpu = cpu_logical_map(smp_processor_id());
                mvebu_pmsu_set_cpu_boot_addr(hw_cpu, armada_370_xp_cpu_resume);
        } else if (action == CPU_PM_EXIT) {
-               armada_370_xp_pmsu_idle_restore();
+               armada_370_xp_pmsu_idle_exit();
        }
 
        return NOTIFY_OK;
@@ -263,7 +258,7 @@ static struct notifier_block armada_370_xp_cpu_pm_notifier = {
        .notifier_call = armada_370_xp_cpu_pm_notify,
 };
 
-int __init armada_370_xp_cpu_pm_init(void)
+static int __init armada_370_xp_cpu_pm_init(void)
 {
        struct device_node *np;
 
index 0c5524ac75b75c4b00b1cb2ba2814e94be35bc2a..b2b4e3d6558c56324da418ec6e4ca128e6832ae5 100644 (file)
@@ -39,6 +39,9 @@ struct mvebu_system_controller {
        u32 system_soft_reset;
 
        u32 resume_boot_addr;
+
+       u32 dev_id;
+       u32 rev_id;
 };
 static struct mvebu_system_controller *mvebu_sc;
 
@@ -47,6 +50,8 @@ static const struct mvebu_system_controller armada_370_xp_system_controller = {
        .system_soft_reset_offset = 0x64,
        .rstoutn_mask_reset_out_en = 0x1,
        .system_soft_reset = 0x1,
+       .dev_id = 0x38,
+       .rev_id = 0x3c,
 };
 
 static const struct mvebu_system_controller armada_375_system_controller = {
@@ -55,6 +60,8 @@ static const struct mvebu_system_controller armada_375_system_controller = {
        .rstoutn_mask_reset_out_en = 0x1,
        .system_soft_reset = 0x1,
        .resume_boot_addr = 0xd4,
+       .dev_id = 0x38,
+       .rev_id = 0x3c,
 };
 
 static const struct mvebu_system_controller orion_system_controller = {
@@ -101,6 +108,18 @@ void mvebu_restart(enum reboot_mode mode, const char *cmd)
                ;
 }
 
+int mvebu_system_controller_get_soc_id(u32 *dev, u32 *rev)
+{
+       if (of_machine_is_compatible("marvell,armada380") &&
+               system_controller_base) {
+               *dev = readl(system_controller_base + mvebu_sc->dev_id) >> 16;
+               *rev = (readl(system_controller_base + mvebu_sc->rev_id) >> 8)
+                       & 0xF;
+               return 0;
+       } else
+               return -ENODEV;
+}
+
 #ifdef CONFIG_SMP
 void mvebu_system_controller_set_cpu_boot_addr(void *boot_addr)
 {
index 798073057e51f8d44afa6e20bac7567533f2b636..4508643cca32b9b7b1ddb5755f451d572d95fbda 100644 (file)
@@ -12,6 +12,7 @@ menuconfig ARCH_SHMOBILE_MULTI
        select NO_IOPORT_MAP
        select PINCTRL
        select ARCH_REQUIRE_GPIOLIB
+       select ARCH_HAS_OPP
 
 if ARCH_SHMOBILE_MULTI
 
@@ -25,6 +26,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 +57,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 +245,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
index 38d5fe825e934688b2ef51fadc97ed1a7bdaf060..fe3878a1a69a04a063ac7c4c129d93d0193ff987 100644 (file)
@@ -34,31 +34,39 @@ obj-$(CONFIG_ARCH_R8A7791)  += clock-r8a7791.o
 obj-$(CONFIG_ARCH_R7S72100)    += clock-r7s72100.o
 endif
 
+# CPU reset vector handling objects
+cpu-y                          := platsmp.o headsmp.o
+cpu-$(CONFIG_ARCH_R8A7790)     += platsmp-apmu.o
+cpu-$(CONFIG_ARCH_R8A7791)     += platsmp-apmu.o
+
 # SMP objects
-smp-y                          := platsmp.o headsmp.o
+smp-y                          := $(cpu-y)
 smp-$(CONFIG_ARCH_SH73A0)      += smp-sh73a0.o headsmp-scu.o platsmp-scu.o
 smp-$(CONFIG_ARCH_R8A7779)     += smp-r8a7779.o headsmp-scu.o platsmp-scu.o
-smp-$(CONFIG_ARCH_R8A7790)     += smp-r8a7790.o platsmp-apmu.o
-smp-$(CONFIG_ARCH_R8A7791)     += smp-r8a7791.o platsmp-apmu.o
+smp-$(CONFIG_ARCH_R8A7790)     += smp-r8a7790.o
+smp-$(CONFIG_ARCH_R8A7791)     += smp-r8a7791.o
 smp-$(CONFIG_ARCH_EMEV2)       += smp-emev2.o headsmp-scu.o platsmp-scu.o
 
-# IRQ objects
-obj-$(CONFIG_ARCH_SH7372)      += entry-intc.o
-
 # PM objects
 obj-$(CONFIG_SUSPEND)          += suspend.o
 obj-$(CONFIG_CPU_IDLE)         += cpuidle.o
+obj-$(CONFIG_CPU_FREQ)         += cpufreq.o
 obj-$(CONFIG_ARCH_SH7372)      += pm-sh7372.o sleep-sh7372.o pm-rmobile.o
 obj-$(CONFIG_ARCH_SH73A0)      += pm-sh73a0.o
 obj-$(CONFIG_ARCH_R8A7740)     += pm-r8a7740.o pm-rmobile.o
 obj-$(CONFIG_ARCH_R8A7779)     += pm-r8a7779.o pm-rcar.o
-obj-$(CONFIG_ARCH_R8A7790)     += pm-r8a7790.o pm-rcar.o
+obj-$(CONFIG_ARCH_R8A7790)     += pm-r8a7790.o pm-rcar.o $(cpu-y)
+obj-$(CONFIG_ARCH_R8A7791)     += pm-r8a7791.o pm-rcar.o $(cpu-y)
+
+# IRQ objects
+obj-$(CONFIG_ARCH_SH7372)      += entry-intc.o
 
 # Board objects
 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
@@ -67,7 +75,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
index 918fccffa1b6211b8ea3bd0dc8a5c341f3b538f7..ebf97d4bcfd88b6931ca25e8e24f8adfc5904ffb 100644 (file)
@@ -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)
index 3276afcf3cc92de2c0ab94548a7f9d6bac039e37..2f7723e5fe91ba1f7adb5e10d38e342277a9fd10 100644 (file)
 #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"
+#include "r8a73a4.h"
+
 static void __init ape6evm_add_standard_devices(void)
 {
 
index fe071a9130b78d2986faecabfa7fb2f208166d4e..485567876d392ae40a4d99bd3a27e2465c2482c5 100644 (file)
 #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"
+#include "r8a73a4.h"
+
 /* LEDS */
 static struct gpio_led ape6evm_leds[] = {
        {
index f660fbb96e0b4b3d0dc5bf9a3901e0039a324888..208576667b223326fb84f3f862c00a3a0b5b4cfd 100644 (file)
 #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"
+#include "r8a7740.h"
+
 /*
  * CON1                Camera Module
  * CON2                Extension Bus
index 30fcac73a540f84b8a47e00ac3fa2abc755b4d90..32339cf6ee7b71928bb38e6f9b2565e20747dcfb 100644 (file)
@@ -45,9 +45,7 @@
 #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>
 #include <media/soc_camera.h>
 #include <sound/sh_fsi.h>
 #include <sound/simple_card.h>
 
+#include "common.h"
+#include "irqs.h"
+#include "pm-rmobile.h"
+#include "r8a7740.h"
 #include "sh-gpio.h"
 
 /*
index 027373f8de8215a74dc2b757e25d6e638416e7c8..ba840cd333b9d2dd25fbfeff9a723bb3aa14f980 100644 (file)
  */
 
 #include <linux/of_platform.h>
-#include <mach/common.h>
-#include <mach/r8a7778.h>
+
 #include <asm/mach/arch.h>
 
+#include "common.h"
+#include "r8a7778.h"
+
 /*
  *     see board-bock.c for checking detail of dip-switch
  */
index f444be2f241ed5ca7b1f38a970042272937ba246..b4e4789017bcec1ae5183d5d4f0d5e706dbbd5b2 100644 (file)
 #include <linux/spi/spi.h>
 #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"
+#include "r8a7778.h"
+
 #define FPGA   0x18200000
 #define IRQ0MR 0x30
 #define COMCTLR        0x101c
index 2ff6ad6e608edff34c9b98c6883f451eb4e7afec..e5448f7b868ad7bb5bed67fbd743a14a2d422548 100644 (file)
 
 #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"
+#include "r7s72100.h"
+
 /*
  * This is a really crude hack to provide clkdev support to platform
  * devices until they get moved to DT.
@@ -47,7 +49,7 @@ static const char * const genmai_boards_compat_dt[] __initconst = {
 };
 
 DT_MACHINE_START(GENMAI_DT, "genmai")
-       .init_early     = r7s72100_init_early,
+       .init_early     = shmobile_init_delay,
        .init_machine   = genmai_add_standard_devices,
        .dt_compat      = genmai_boards_compat_dt,
 MACHINE_END
index c94201ee859633f840e7dfba19aa466b5067ad6a..e2a3ba4871c3e2695c3adc0724f3c56d375c41d5 100644 (file)
 #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"
+#include "r7s72100.h"
+
 /* Ether */
 static const struct sh_eth_plat_data ether_pdata __initconst = {
        .phy                    = 0x00, /* PD60610 */
@@ -154,7 +156,7 @@ static const char * const genmai_boards_compat_dt[] __initconst = {
 };
 
 DT_MACHINE_START(GENMAI_DT, "genmai")
-       .init_early     = r7s72100_init_early,
+       .init_early     = shmobile_init_delay,
        .init_machine   = genmai_add_standard_devices,
        .dt_compat      = genmai_boards_compat_dt,
 MACHINE_END
index d322a162b4b01f75ad52a92a496f9f43cdf8ac2c..0b1fb2345aa18af3649986836e8099aab11f3fbd 100644 (file)
 #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 "r8a7791.h"
+#include "rcar-gen2.h"
+
 /* DU */
 static struct rcar_du_encoder_data koelsch_du_encoders[] = {
        {
index c6c68892caa3a96f251075a1038d2b52f60bc0ad..e698b90ae7611f4632bce3554975d8b810891f6a 100644 (file)
 #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 "r8a7791.h"
+#include "rcar-gen2.h"
+
 /* DU */
 static struct rcar_du_encoder_data koelsch_du_encoders[] = {
        {
index a735a1d80c285b95a097ef6128c8e54a2d022cee..5d2621f202d1b483a6ed530f8adc22a487a6db1a 100644 (file)
 #include <linux/irq.h>
 #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"
+#include "sh73a0.h"
+
 static void __init kzm_init(void)
 {
        sh73a0_add_standard_devices_dt();
index f94ec8ca42c1eb81bf913e8c22600dc90b925d46..1320e9d063b1d11515734522e50a80fcf7ff7468 100644 (file)
 #include <linux/usb/r8a66597.h>
 #include <linux/usb/renesas_usbhs.h>
 #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"
+#include "sh73a0.h"
+
 /*
  * external GPIO
  */
index 749832e3f33c64aa52ad1d5295297a8f7120938a..8dcff51a8f45a2a8c001d520a4faacfac965302f 100644 (file)
 #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 "r8a7790.h"
+#include "rcar-gen2.h"
+
 /* DU */
 static struct rcar_du_encoder_data lager_du_encoders[] = {
        {
@@ -129,7 +131,7 @@ static const char *lager_boards_compat_dt[] __initdata = {
 
 DT_MACHINE_START(LAGER_DT, "lager")
        .smp            = smp_ops(r8a7790_smp_ops),
-       .init_early     = r8a7790_init_early,
+       .init_early     = shmobile_init_delay,
        .init_time      = rcar_gen2_timer_init,
        .init_machine   = lager_add_standard_devices,
        .init_late      = shmobile_init_late,
index f8b1e05463ccde8e0c835affdb1fe7b49b13038c..bfd9e4846fc937fd536f1177a01deecdbfed4bd6 100644 (file)
@@ -31,6 +31,8 @@
 #include <linux/mmc/host.h>
 #include <linux/mmc/sh_mmcif.h>
 #include <linux/mmc/sh_mobile_sdhi.h>
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/mtd.h>
 #include <linux/pinctrl/machine.h>
 #include <linux/platform_data/camera-rcar.h>
 #include <linux/platform_data/gpio-rcar.h>
 #include <linux/regulator/gpio-regulator.h>
 #include <linux/regulator/machine.h>
 #include <linux/sh_eth.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/rspi.h>
+#include <linux/spi/spi.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>
 #include <asm/mach/arch.h>
-#include <linux/mtd/partitions.h>
-#include <linux/mtd/mtd.h>
-#include <linux/spi/flash.h>
-#include <linux/spi/rspi.h>
-#include <linux/spi/spi.h>
 #include <sound/rcar_snd.h>
 #include <sound/simple_card.h>
 
+#include "common.h"
+#include "irqs.h"
+#include "r8a7790.h"
+#include "rcar-gen2.h"
+
 /*
  * SSI-AK4643
  *
@@ -886,7 +889,7 @@ static const char * const lager_boards_compat_dt[] __initconst = {
 
 DT_MACHINE_START(LAGER_DT, "lager")
        .smp            = smp_ops(r8a7790_smp_ops),
-       .init_early     = r8a7790_init_early,
+       .init_early     = shmobile_init_delay,
        .init_time      = rcar_gen2_timer_init,
        .init_machine   = lager_init,
        .init_late      = shmobile_init_late,
index 0ff4d8e45cf7d9a2a7dc5974756b43d14256b1c8..304b76f3bf4a11cc6a2e8496578f6546e19aa469 100644 (file)
 #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>
+
 #include <video/sh_mobile_hdmi.h>
 #include <video/sh_mobile_lcdc.h>
 #include <media/sh_mobile_ceu.h>
 #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"
+#include "sh7372.h"
 
 /*
  * Address     Interface               BusWidth        note
index 2773936bf7dcffab9be79f2c8e7deed9c12e8093..21b3e1ca226159e7a87e5ddd71565a7278dd2db6 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <mach/r8a7779.h>
-#include <mach/common.h>
-#include <mach/irqs.h>
+#include <linux/clk/shmobile.h>
+#include <linux/clocksource.h>
+#include <linux/of_platform.h>
+
 #include <asm/irq.h>
 #include <asm/mach/arch.h>
 
+#include "clock.h"
+#include "common.h"
+#include "irqs.h"
+#include "r8a7779.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 +62,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,
index d832a4477b4bdb8e46970c49ed1b45843405cf45..25a1037e289d9f76e161b0e3984796eac3057090 100644 (file)
 #include <linux/mmc/host.h>
 #include <linux/mmc/sh_mobile_sdhi.h>
 #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"
+#include "r8a7779.h"
+
 /* Fixed 3.3V regulator to be used by SDHI0 */
 static struct regulator_consumer_supply fixed3v3_power_consumers[] = {
        REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
index df187484de5d52289ecbe9dc0fa23f6fa1e16886..3eb2ec401e0cb13329d1c4e33abf1f8a7f175758 100644 (file)
@@ -19,8 +19,9 @@
 #include <linux/io.h>
 #include <linux/sh_clk.h>
 #include <linux/clkdev.h>
-#include <mach/common.h>
-#include <mach/r7s72100.h>
+
+#include "common.h"
+#include "r7s72100.h"
 
 /* Frequency Control Registers */
 #define FRQCR          0xfcfe0010
index b5bc22c6a8589815c5b47df9b4576c3c7a273bf8..49d139748aa6d17e2158482a784f29cd0af3bc34 100644 (file)
@@ -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
@@ -574,11 +574,17 @@ static struct clk_lookup lookups[] = {
 
        /* MSTP */
        CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]),
+       CLKDEV_DEV_ID("e6c40000.serial", &mstp_clks[MSTP204]),
        CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]),
+       CLKDEV_DEV_ID("e6c50000.serial", &mstp_clks[MSTP203]),
        CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP206]),
+       CLKDEV_DEV_ID("e6c20000.serial", &mstp_clks[MSTP206]),
        CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP207]),
+       CLKDEV_DEV_ID("e6c30000.serial", &mstp_clks[MSTP207]),
        CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP216]),
+       CLKDEV_DEV_ID("e6ce0000.serial", &mstp_clks[MSTP216]),
        CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP217]),
+       CLKDEV_DEV_ID("e6cf0000.serial", &mstp_clks[MSTP217]),
        CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]),
        CLKDEV_DEV_ID("e6700020.dma-controller", &mstp_clks[MSTP218]),
        CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]),
index 50931e3c97c776b07c627584cfd206295dbbc52d..a60c324df64e1fc7db188cba48eb4e78c02393b4 100644 (file)
 #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"
+#include "r8a7740.h"
 
 /*
  *        |  MDx  |  XTAL1/EXTAL1   |  System   | EXTALR |
@@ -555,27 +556,27 @@ static struct clk_lookup lookups[] = {
        CLKDEV_DEV_ID("sh_mobile_ceu.1",        &mstp_clks[MSTP128]),
 
        CLKDEV_DEV_ID("sh-sci.4",               &mstp_clks[MSTP200]),
-       CLKDEV_DEV_ID("e6c80000.sci",           &mstp_clks[MSTP200]),
+       CLKDEV_DEV_ID("e6c80000.serial",        &mstp_clks[MSTP200]),
        CLKDEV_DEV_ID("sh-sci.3",               &mstp_clks[MSTP201]),
-       CLKDEV_DEV_ID("e6c70000.sci",           &mstp_clks[MSTP201]),
+       CLKDEV_DEV_ID("e6c70000.serial",        &mstp_clks[MSTP201]),
        CLKDEV_DEV_ID("sh-sci.2",               &mstp_clks[MSTP202]),
-       CLKDEV_DEV_ID("e6c60000.sci",           &mstp_clks[MSTP202]),
+       CLKDEV_DEV_ID("e6c60000.serial",        &mstp_clks[MSTP202]),
        CLKDEV_DEV_ID("sh-sci.1",               &mstp_clks[MSTP203]),
-       CLKDEV_DEV_ID("e6c50000.sci",           &mstp_clks[MSTP203]),
+       CLKDEV_DEV_ID("e6c50000.serial",        &mstp_clks[MSTP203]),
        CLKDEV_DEV_ID("sh-sci.0",               &mstp_clks[MSTP204]),
-       CLKDEV_DEV_ID("e6c40000.sci",           &mstp_clks[MSTP204]),
+       CLKDEV_DEV_ID("e6c40000.serial",        &mstp_clks[MSTP204]),
        CLKDEV_DEV_ID("sh-sci.8",               &mstp_clks[MSTP206]),
-       CLKDEV_DEV_ID("e6c30000.sci",           &mstp_clks[MSTP206]),
+       CLKDEV_DEV_ID("e6c30000.serial",        &mstp_clks[MSTP206]),
        CLKDEV_DEV_ID("sh-sci.5",               &mstp_clks[MSTP207]),
-       CLKDEV_DEV_ID("e6cb0000.sci",           &mstp_clks[MSTP207]),
+       CLKDEV_DEV_ID("e6cb0000.serial",        &mstp_clks[MSTP207]),
        CLKDEV_DEV_ID("sh-dma-engine.3",        &mstp_clks[MSTP214]),
        CLKDEV_DEV_ID("sh-dma-engine.2",        &mstp_clks[MSTP216]),
        CLKDEV_DEV_ID("sh-dma-engine.1",        &mstp_clks[MSTP217]),
        CLKDEV_DEV_ID("sh-dma-engine.0",        &mstp_clks[MSTP218]),
        CLKDEV_DEV_ID("sh-sci.7",               &mstp_clks[MSTP222]),
-       CLKDEV_DEV_ID("e6cd0000.sci",           &mstp_clks[MSTP222]),
+       CLKDEV_DEV_ID("e6cd0000.serial",        &mstp_clks[MSTP222]),
        CLKDEV_DEV_ID("sh-sci.6",               &mstp_clks[MSTP230]),
-       CLKDEV_DEV_ID("e6cc0000.sci",           &mstp_clks[MSTP230]),
+       CLKDEV_DEV_ID("e6cc0000.serial",        &mstp_clks[MSTP230]),
 
        CLKDEV_DEV_ID("sh_fsi2",                &mstp_clks[MSTP328]),
        CLKDEV_DEV_ID("fe1f0000.sound",         &mstp_clks[MSTP328]),
index 13f8f3ab884021d30dbaa10b1daab4200aefe5e1..95579073cfcefa67d9dda9dfdedd8655bb0f24d6 100644 (file)
@@ -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)
@@ -202,11 +202,17 @@ static struct clk_lookup lookups[] = {
        CLKDEV_DEV_ID("i2c-rcar.3", &mstp_clks[MSTP027]), /* I2C3 */
        CLKDEV_DEV_ID("ffc73000.i2c", &mstp_clks[MSTP027]), /* I2C3 */
        CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP026]), /* SCIF0 */
+       CLKDEV_DEV_ID("ffe40000.serial", &mstp_clks[MSTP026]), /* SCIF0 */
        CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP025]), /* SCIF1 */
+       CLKDEV_DEV_ID("ffe41000.serial", &mstp_clks[MSTP025]), /* SCIF1 */
        CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP024]), /* SCIF2 */
+       CLKDEV_DEV_ID("ffe42000.serial", &mstp_clks[MSTP024]), /* SCIF2 */
        CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP023]), /* SCIF3 */
+       CLKDEV_DEV_ID("ffe43000.serial", &mstp_clks[MSTP023]), /* SCIF3 */
        CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP022]), /* SCIF4 */
+       CLKDEV_DEV_ID("ffe44000.serial", &mstp_clks[MSTP022]), /* SCIF4 */
        CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP021]), /* SCIF6 */
+       CLKDEV_DEV_ID("ffe45000.serial", &mstp_clks[MSTP021]), /* SCIF5 */
        CLKDEV_DEV_ID("sh-hspi.0", &mstp_clks[MSTP007]), /* HSPI0 */
        CLKDEV_DEV_ID("fffc7000.spi", &mstp_clks[MSTP007]), /* HSPI0 */
        CLKDEV_DEV_ID("sh-hspi.1", &mstp_clks[MSTP007]), /* HSPI1 */
index a13298bd37a85777ea6135eaa451cebc7105898d..c51f9db3f66fb2f9408094cc112b52c3d716d534 100644 (file)
 #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 "clock.h"
+#include "common.h"
+#include "r8a7779.h"
 
 /*
  *             MD1 = 1                 MD1 = 0
@@ -52,9 +55,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 +207,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 +263,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();
+}
index 296a057109e42b7ad621843b44d7f525b9ddcfe0..17435c1aa2fe318ceeb4692632bd986ce5484655 100644 (file)
 #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 "r8a7790.h"
+#include "rcar-gen2.h"
 
 /*
  *   MD                EXTAL           PLL0    PLL1    PLL3
index e2fdfcc14436a109946413e9855cafad27fdff38..10e193d707f531216776695b5da2cf0c65de418a 100644 (file)
@@ -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
index d16d9ca7f79ea958716f0f4ce65c4351556adddf..7071676145c497ae911fd7199b721692c71c2b8e 100644 (file)
@@ -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)
index 0d9cd1fe02124fdb8573bf66da0cbc8b5a33e9c7..9433a4e2c88e94f8bcb374c4e6641a6a9027afb7 100644 (file)
@@ -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)
@@ -638,16 +638,25 @@ static struct clk_lookup lookups[] = {
        CLKDEV_DEV_ID("e6820000.i2c", &mstp_clks[MSTP116]), /* I2C0 */
        CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), /* LCDC0 */
        CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP219]), /* SCIFA7 */
+       CLKDEV_DEV_ID("e6cd0000.serial", &mstp_clks[MSTP219]), /* SCIFA7 */
        CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]), /* SY-DMAC */
        CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[MSTP217]), /* MP-DMAC */
        CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */
+       CLKDEV_DEV_ID("e6cb0000.serial", &mstp_clks[MSTP207]), /* SCIFA5 */
        CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP206]), /* SCIFB */
+       CLKDEV_DEV_ID("0xe6c3000.serial", &mstp_clks[MSTP206]), /* SCIFB */
        CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */
+       CLKDEV_DEV_ID("e6c40000.serial", &mstp_clks[MSTP204]), /* SCIFA0 */
        CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), /* SCIFA1 */
+       CLKDEV_DEV_ID("e6c50000.serial", &mstp_clks[MSTP203]), /* SCIFA1 */
        CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP202]), /* SCIFA2 */
+       CLKDEV_DEV_ID("e6c60000.serial", &mstp_clks[MSTP202]), /* SCIFA2 */
        CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP201]), /* SCIFA3 */
+       CLKDEV_DEV_ID("e6c70000.serial", &mstp_clks[MSTP201]), /* SCIFA3 */
        CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */
+       CLKDEV_DEV_ID("e6c80000.serial", &mstp_clks[MSTP200]), /* SCIFA4 */
        CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP331]), /* SCIFA6 */
+       CLKDEV_DEV_ID("e6cc0000.serial", &mstp_clks[MSTP331]), /* SCIFA6 */
        CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI */
        CLKDEV_DEV_ID("ec230000.sound", &mstp_clks[MSTP328]), /* FSI */
        CLKDEV_DEV_ID("sh_irda.0", &mstp_clks[MSTP325]), /* IrDA */
index e7232a0373b9f51719f8391bff63d0bb40e1ab65..806f94038cc49a8421f85d305a018113a59009b8 100644 (file)
@@ -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/clock.h b/arch/arm/mach-shmobile/clock.h
new file mode 100644 (file)
index 0000000..31b6417
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef CLOCK_H
+#define CLOCK_H
+
+#ifdef CONFIG_COMMON_CLK
+/* temporary clock configuration helper for platform devices */
+
+struct clk_name {
+       const char *clk;
+       const char *con_id;
+       const char *dev_id;
+};
+
+void shmobile_clk_workaround(const struct clk_name *clks, int nr_clks,
+                            bool enable);
+
+#else /* CONFIG_COMMON_CLK */
+/* legacy clock implementation */
+
+struct clk;
+unsigned long shmobile_fixed_ratio_clk_recalc(struct clk *clk);
+extern struct sh_clk_ops shmobile_fixed_ratio_clk_ops;
+
+/* clock ratio */
+struct clk_ratio {
+       int mul;
+       int div;
+};
+
+#define SH_CLK_RATIO(name, m, d)               \
+static struct clk_ratio name ##_ratio = {      \
+       .mul = m,                               \
+       .div = d,                               \
+}
+
+#define SH_FIXED_RATIO_CLKg(name, p, r)        \
+struct clk name = {                    \
+       .parent = &p,                           \
+       .ops    = &shmobile_fixed_ratio_clk_ops,\
+       .priv   = &r ## _ratio,                 \
+}
+
+#define SH_FIXED_RATIO_CLK(name, p, r)         \
+static SH_FIXED_RATIO_CLKg(name, p, r)
+
+#define SH_FIXED_RATIO_CLK_SET(name, p, m, d)  \
+       SH_CLK_RATIO(name, m, d);               \
+       SH_FIXED_RATIO_CLK(name, p, name)
+
+#define SH_CLK_SET_RATIO(p, m, d)      \
+do {                   \
+       (p)->mul = m;   \
+       (p)->div = d;   \
+} while (0)
+
+#endif /* CONFIG_COMMON_CLK */
+#endif
diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h
new file mode 100644 (file)
index 0000000..9805608
--- /dev/null
@@ -0,0 +1,65 @@
+#ifndef __ARCH_MACH_COMMON_H
+#define __ARCH_MACH_COMMON_H
+
+extern void shmobile_earlytimer_init(void);
+extern void shmobile_setup_delay(unsigned int max_cpu_core_mhz,
+                        unsigned int mult, unsigned int div);
+extern void shmobile_init_delay(void);
+struct twd_local_timer;
+extern void shmobile_setup_console(void);
+extern void shmobile_boot_vector(void);
+extern unsigned long shmobile_boot_fn;
+extern unsigned long shmobile_boot_arg;
+extern unsigned long shmobile_boot_size;
+extern void shmobile_smp_boot(void);
+extern void shmobile_smp_sleep(void);
+extern void shmobile_smp_hook(unsigned int cpu, unsigned long fn,
+                             unsigned long arg);
+extern int shmobile_smp_cpu_disable(unsigned int cpu);
+extern void shmobile_invalidate_start(void);
+extern void shmobile_boot_scu(void);
+extern void shmobile_smp_scu_prepare_cpus(unsigned int max_cpus);
+extern void shmobile_smp_scu_cpu_die(unsigned int cpu);
+extern int shmobile_smp_scu_cpu_kill(unsigned int cpu);
+extern void shmobile_smp_apmu_prepare_cpus(unsigned int max_cpus);
+extern int shmobile_smp_apmu_boot_secondary(unsigned int cpu,
+                                           struct task_struct *idle);
+extern void shmobile_smp_apmu_cpu_die(unsigned int cpu);
+extern int shmobile_smp_apmu_cpu_kill(unsigned int cpu);
+struct clk;
+extern int shmobile_clk_init(void);
+extern void shmobile_handle_irq_intc(struct pt_regs *);
+extern struct platform_suspend_ops shmobile_suspend_ops;
+struct cpuidle_driver;
+extern void shmobile_cpuidle_set_driver(struct cpuidle_driver *drv);
+
+#ifdef CONFIG_SUSPEND
+int shmobile_suspend_init(void);
+void shmobile_smp_apmu_suspend_init(void);
+#else
+static inline int shmobile_suspend_init(void) { return 0; }
+static inline void shmobile_smp_apmu_suspend_init(void) { }
+#endif
+
+#ifdef CONFIG_CPU_IDLE
+int shmobile_cpuidle_init(void);
+#else
+static inline int shmobile_cpuidle_init(void) { return 0; }
+#endif
+
+#ifdef CONFIG_CPU_FREQ
+int shmobile_cpufreq_init(void);
+#else
+static inline int shmobile_cpufreq_init(void) { return 0; }
+#endif
+
+extern void __iomem *shmobile_scu_base;
+
+static inline void __init shmobile_init_late(void)
+{
+       shmobile_suspend_init();
+       shmobile_cpuidle_init();
+       shmobile_cpufreq_init();
+}
+
+#endif /* __ARCH_MACH_COMMON_H */
index 9411a5bf4fd6ede59d8f939b9074727c23543aa8..f2e79f2376e19f6f0a227af94bf2e4fc3be76409 100644 (file)
@@ -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/cpufreq.c b/arch/arm/mach-shmobile/cpufreq.c
new file mode 100644 (file)
index 0000000..8a24b2b
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * CPUFreq support code for SH-Mobile ARM
+ *
+ *  Copyright (C) 2014 Gaku Inami
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+#include <linux/platform_device.h>
+
+int __init shmobile_cpufreq_init(void)
+{
+       platform_device_register_simple("cpufreq-cpu0", -1, NULL, 0);
+       return 0;
+}
diff --git a/arch/arm/mach-shmobile/dma-register.h b/arch/arm/mach-shmobile/dma-register.h
new file mode 100644 (file)
index 0000000..97c40bd
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * SH-ARM CPU-specific DMA definitions, used by both DMA drivers
+ *
+ * Copyright (C) 2012 Renesas Solutions Corp
+ *
+ * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+ *
+ * Based on arch/sh/include/cpu-sh4/cpu/dma-register.h
+ * Copyright (C) 2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef DMA_REGISTER_H
+#define DMA_REGISTER_H
+
+/*
+ *             Direct Memory Access Controller
+ */
+
+/* Transmit sizes and respective CHCR register values */
+enum {
+       XMIT_SZ_8BIT            = 0,
+       XMIT_SZ_16BIT           = 1,
+       XMIT_SZ_32BIT           = 2,
+       XMIT_SZ_64BIT           = 7,
+       XMIT_SZ_128BIT          = 3,
+       XMIT_SZ_256BIT          = 4,
+       XMIT_SZ_512BIT          = 5,
+};
+
+/* log2(size / 8) - used to calculate number of transfers */
+static const unsigned int dma_ts_shift[] = {
+       [XMIT_SZ_8BIT]          = 0,
+       [XMIT_SZ_16BIT]         = 1,
+       [XMIT_SZ_32BIT]         = 2,
+       [XMIT_SZ_64BIT]         = 3,
+       [XMIT_SZ_128BIT]        = 4,
+       [XMIT_SZ_256BIT]        = 5,
+       [XMIT_SZ_512BIT]        = 6,
+};
+
+#define TS_LOW_BIT     0x3 /* --xx */
+#define TS_HI_BIT      0xc /* xx-- */
+
+#define TS_LOW_SHIFT   (3)
+#define TS_HI_SHIFT    (20 - 2)        /* 2 bits for shifted low TS */
+
+#define TS_INDEX2VAL(i) \
+       ((((i) & TS_LOW_BIT) << TS_LOW_SHIFT) |\
+        (((i) & TS_HI_BIT)  << TS_HI_SHIFT))
+
+#define CHCR_TX(xmit_sz) (DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL((xmit_sz)))
+#define CHCR_RX(xmit_sz) (DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL((xmit_sz)))
+
+
+/*
+ *             USB High-Speed DMAC
+ */
+/* Transmit sizes and respective CHCR register values */
+enum {
+       USBTS_XMIT_SZ_8BYTE             = 0,
+       USBTS_XMIT_SZ_16BYTE            = 1,
+       USBTS_XMIT_SZ_32BYTE            = 2,
+};
+
+/* log2(size / 8) - used to calculate number of transfers */
+static const unsigned int dma_usbts_shift[] = {
+       [USBTS_XMIT_SZ_8BYTE]   = 3,
+       [USBTS_XMIT_SZ_16BYTE]  = 4,
+       [USBTS_XMIT_SZ_32BYTE]  = 5,
+};
+
+#define USBTS_LOW_BIT  0x3 /* --xx */
+#define USBTS_HI_BIT   0x0 /* ---- */
+
+#define USBTS_LOW_SHIFT        6
+#define USBTS_HI_SHIFT 0
+
+#define USBTS_INDEX2VAL(i) (((i) & 3) << 6)
+
+#endif /* DMA_REGISTER_H */
index e5be5c88644b70aa8bb6196807bff7f000085658..faf82144a2629e307c64480f1a232a2035f48719 100644 (file)
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/linkage.h>
+#include <linux/threads.h>
 #include <asm/memory.h>
 
+#ifdef CONFIG_SMP
 ENTRY(shmobile_invalidate_start)
        bl      v7_invalidate_l1
        b       secondary_startup
 ENDPROC(shmobile_invalidate_start)
+#endif
 
 /*
  * Reset vector for secondary CPUs.
@@ -68,7 +71,7 @@ shmobile_smp_boot_find_mpidr:
 
 shmobile_smp_boot_next:
        add     r1, r1, #1
-       cmp     r1, #CONFIG_NR_CPUS
+       cmp     r1, #NR_CPUS
        blo     shmobile_smp_boot_find_mpidr
 
        b       shmobile_smp_sleep
@@ -85,10 +88,10 @@ ENDPROC(shmobile_smp_sleep)
 
        .globl  shmobile_smp_mpidr
 shmobile_smp_mpidr:
-1:     .space  CONFIG_NR_CPUS * 4
+1:     .space  NR_CPUS * 4
        .globl  shmobile_smp_fn
 shmobile_smp_fn:
-2:     .space  CONFIG_NR_CPUS * 4
+2:     .space  NR_CPUS * 4
        .globl  shmobile_smp_arg
 shmobile_smp_arg:
-3:     .space  CONFIG_NR_CPUS * 4
+3:     .space  NR_CPUS * 4
diff --git a/arch/arm/mach-shmobile/include/mach/clock.h b/arch/arm/mach-shmobile/include/mach/clock.h
deleted file mode 100644 (file)
index 31b6417..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef CLOCK_H
-#define CLOCK_H
-
-#ifdef CONFIG_COMMON_CLK
-/* temporary clock configuration helper for platform devices */
-
-struct clk_name {
-       const char *clk;
-       const char *con_id;
-       const char *dev_id;
-};
-
-void shmobile_clk_workaround(const struct clk_name *clks, int nr_clks,
-                            bool enable);
-
-#else /* CONFIG_COMMON_CLK */
-/* legacy clock implementation */
-
-struct clk;
-unsigned long shmobile_fixed_ratio_clk_recalc(struct clk *clk);
-extern struct sh_clk_ops shmobile_fixed_ratio_clk_ops;
-
-/* clock ratio */
-struct clk_ratio {
-       int mul;
-       int div;
-};
-
-#define SH_CLK_RATIO(name, m, d)               \
-static struct clk_ratio name ##_ratio = {      \
-       .mul = m,                               \
-       .div = d,                               \
-}
-
-#define SH_FIXED_RATIO_CLKg(name, p, r)        \
-struct clk name = {                    \
-       .parent = &p,                           \
-       .ops    = &shmobile_fixed_ratio_clk_ops,\
-       .priv   = &r ## _ratio,                 \
-}
-
-#define SH_FIXED_RATIO_CLK(name, p, r)         \
-static SH_FIXED_RATIO_CLKg(name, p, r)
-
-#define SH_FIXED_RATIO_CLK_SET(name, p, m, d)  \
-       SH_CLK_RATIO(name, m, d);               \
-       SH_FIXED_RATIO_CLK(name, p, name)
-
-#define SH_CLK_SET_RATIO(p, m, d)      \
-do {                   \
-       (p)->mul = m;   \
-       (p)->div = d;   \
-} while (0)
-
-#endif /* CONFIG_COMMON_CLK */
-#endif
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
deleted file mode 100644 (file)
index f7a360e..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef __ARCH_MACH_COMMON_H
-#define __ARCH_MACH_COMMON_H
-
-extern void shmobile_earlytimer_init(void);
-extern void shmobile_setup_delay(unsigned int max_cpu_core_mhz,
-                        unsigned int mult, unsigned int div);
-extern void shmobile_init_delay(void);
-struct twd_local_timer;
-extern void shmobile_setup_console(void);
-extern void shmobile_boot_vector(void);
-extern unsigned long shmobile_boot_fn;
-extern unsigned long shmobile_boot_arg;
-extern unsigned long shmobile_boot_size;
-extern void shmobile_smp_boot(void);
-extern void shmobile_smp_sleep(void);
-extern void shmobile_smp_hook(unsigned int cpu, unsigned long fn,
-                             unsigned long arg);
-extern int shmobile_smp_cpu_disable(unsigned int cpu);
-extern void shmobile_invalidate_start(void);
-extern void shmobile_boot_scu(void);
-extern void shmobile_smp_scu_prepare_cpus(unsigned int max_cpus);
-extern void shmobile_smp_scu_cpu_die(unsigned int cpu);
-extern int shmobile_smp_scu_cpu_kill(unsigned int cpu);
-extern void shmobile_smp_apmu_prepare_cpus(unsigned int max_cpus);
-extern int shmobile_smp_apmu_boot_secondary(unsigned int cpu,
-                                           struct task_struct *idle);
-extern void shmobile_smp_apmu_cpu_die(unsigned int cpu);
-extern int shmobile_smp_apmu_cpu_kill(unsigned int cpu);
-struct clk;
-extern int shmobile_clk_init(void);
-extern void shmobile_handle_irq_intc(struct pt_regs *);
-extern struct platform_suspend_ops shmobile_suspend_ops;
-struct cpuidle_driver;
-extern void shmobile_cpuidle_set_driver(struct cpuidle_driver *drv);
-
-#ifdef CONFIG_SUSPEND
-int shmobile_suspend_init(void);
-#else
-static inline int shmobile_suspend_init(void) { return 0; }
-#endif
-
-#ifdef CONFIG_CPU_IDLE
-int shmobile_cpuidle_init(void);
-#else
-static inline int shmobile_cpuidle_init(void) { return 0; }
-#endif
-
-extern void __iomem *shmobile_scu_base;
-
-static inline void __init shmobile_init_late(void)
-{
-       shmobile_suspend_init();
-       shmobile_cpuidle_init();
-}
-
-#endif /* __ARCH_MACH_COMMON_H */
diff --git a/arch/arm/mach-shmobile/include/mach/dma-register.h b/arch/arm/mach-shmobile/include/mach/dma-register.h
deleted file mode 100644 (file)
index 97c40bd..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * SH-ARM CPU-specific DMA definitions, used by both DMA drivers
- *
- * Copyright (C) 2012 Renesas Solutions Corp
- *
- * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
- *
- * Based on arch/sh/include/cpu-sh4/cpu/dma-register.h
- * Copyright (C) 2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef DMA_REGISTER_H
-#define DMA_REGISTER_H
-
-/*
- *             Direct Memory Access Controller
- */
-
-/* Transmit sizes and respective CHCR register values */
-enum {
-       XMIT_SZ_8BIT            = 0,
-       XMIT_SZ_16BIT           = 1,
-       XMIT_SZ_32BIT           = 2,
-       XMIT_SZ_64BIT           = 7,
-       XMIT_SZ_128BIT          = 3,
-       XMIT_SZ_256BIT          = 4,
-       XMIT_SZ_512BIT          = 5,
-};
-
-/* log2(size / 8) - used to calculate number of transfers */
-static const unsigned int dma_ts_shift[] = {
-       [XMIT_SZ_8BIT]          = 0,
-       [XMIT_SZ_16BIT]         = 1,
-       [XMIT_SZ_32BIT]         = 2,
-       [XMIT_SZ_64BIT]         = 3,
-       [XMIT_SZ_128BIT]        = 4,
-       [XMIT_SZ_256BIT]        = 5,
-       [XMIT_SZ_512BIT]        = 6,
-};
-
-#define TS_LOW_BIT     0x3 /* --xx */
-#define TS_HI_BIT      0xc /* xx-- */
-
-#define TS_LOW_SHIFT   (3)
-#define TS_HI_SHIFT    (20 - 2)        /* 2 bits for shifted low TS */
-
-#define TS_INDEX2VAL(i) \
-       ((((i) & TS_LOW_BIT) << TS_LOW_SHIFT) |\
-        (((i) & TS_HI_BIT)  << TS_HI_SHIFT))
-
-#define CHCR_TX(xmit_sz) (DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL((xmit_sz)))
-#define CHCR_RX(xmit_sz) (DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL((xmit_sz)))
-
-
-/*
- *             USB High-Speed DMAC
- */
-/* Transmit sizes and respective CHCR register values */
-enum {
-       USBTS_XMIT_SZ_8BYTE             = 0,
-       USBTS_XMIT_SZ_16BYTE            = 1,
-       USBTS_XMIT_SZ_32BYTE            = 2,
-};
-
-/* log2(size / 8) - used to calculate number of transfers */
-static const unsigned int dma_usbts_shift[] = {
-       [USBTS_XMIT_SZ_8BYTE]   = 3,
-       [USBTS_XMIT_SZ_16BYTE]  = 4,
-       [USBTS_XMIT_SZ_32BYTE]  = 5,
-};
-
-#define USBTS_LOW_BIT  0x3 /* --xx */
-#define USBTS_HI_BIT   0x0 /* ---- */
-
-#define USBTS_LOW_SHIFT        6
-#define USBTS_HI_SHIFT 0
-
-#define USBTS_INDEX2VAL(i) (((i) & 3) << 6)
-
-#endif /* DMA_REGISTER_H */
diff --git a/arch/arm/mach-shmobile/include/mach/intc.h b/arch/arm/mach-shmobile/include/mach/intc.h
deleted file mode 100644 (file)
index a5603c7..0000000
+++ /dev/null
@@ -1,290 +0,0 @@
-#ifndef __ASM_MACH_INTC_H
-#define __ASM_MACH_INTC_H
-#include <linux/sh_intc.h>
-
-#define INTC_IRQ_PINS_ENUM_16L(p)                              \
-       p ## _IRQ0, p ## _IRQ1, p ## _IRQ2, p ## _IRQ3,         \
-       p ## _IRQ4, p ## _IRQ5, p ## _IRQ6, p ## _IRQ7,         \
-       p ## _IRQ8, p ## _IRQ9, p ## _IRQ10, p ## _IRQ11,       \
-       p ## _IRQ12, p ## _IRQ13, p ## _IRQ14, p ## _IRQ15
-
-#define INTC_IRQ_PINS_ENUM_16H(p)                              \
-       p ## _IRQ16, p ## _IRQ17, p ## _IRQ18, p ## _IRQ19,     \
-       p ## _IRQ20, p ## _IRQ21, p ## _IRQ22, p ## _IRQ23,     \
-       p ## _IRQ24, p ## _IRQ25, p ## _IRQ26, p ## _IRQ27,     \
-       p ## _IRQ28, p ## _IRQ29, p ## _IRQ30, p ## _IRQ31
-
-#define INTC_IRQ_PINS_VECT_16L(p, vect)                                \
-       vect(p ## _IRQ0, 0x0200), vect(p ## _IRQ1, 0x0220),     \
-       vect(p ## _IRQ2, 0x0240), vect(p ## _IRQ3, 0x0260),     \
-       vect(p ## _IRQ4, 0x0280), vect(p ## _IRQ5, 0x02a0),     \
-       vect(p ## _IRQ6, 0x02c0), vect(p ## _IRQ7, 0x02e0),     \
-       vect(p ## _IRQ8, 0x0300), vect(p ## _IRQ9, 0x0320),     \
-       vect(p ## _IRQ10, 0x0340), vect(p ## _IRQ11, 0x0360),   \
-       vect(p ## _IRQ12, 0x0380), vect(p ## _IRQ13, 0x03a0),   \
-       vect(p ## _IRQ14, 0x03c0), vect(p ## _IRQ15, 0x03e0)
-
-#define INTC_IRQ_PINS_VECT_16H(p, vect)                                \
-       vect(p ## _IRQ16, 0x3200), vect(p ## _IRQ17, 0x3220),   \
-       vect(p ## _IRQ18, 0x3240), vect(p ## _IRQ19, 0x3260),   \
-       vect(p ## _IRQ20, 0x3280), vect(p ## _IRQ21, 0x32a0),   \
-       vect(p ## _IRQ22, 0x32c0), vect(p ## _IRQ23, 0x32e0),   \
-       vect(p ## _IRQ24, 0x3300), vect(p ## _IRQ25, 0x3320),   \
-       vect(p ## _IRQ26, 0x3340), vect(p ## _IRQ27, 0x3360),   \
-       vect(p ## _IRQ28, 0x3380), vect(p ## _IRQ29, 0x33a0),   \
-       vect(p ## _IRQ30, 0x33c0), vect(p ## _IRQ31, 0x33e0)
-
-#define INTC_IRQ_PINS_MASK_16L(p, base)                                        \
-       { base + 0x40, base + 0x60, 8, /* INTMSK00A / INTMSKCLR00A */   \
-         { p ## _IRQ0, p ## _IRQ1, p ## _IRQ2, p ## _IRQ3,             \
-           p ## _IRQ4, p ## _IRQ5, p ## _IRQ6, p ## _IRQ7 } },         \
-       { base + 0x44, base + 0x64, 8, /* INTMSK10A / INTMSKCLR10A */   \
-         { p ## _IRQ8, p ## _IRQ9, p ## _IRQ10, p ## _IRQ11,           \
-           p ## _IRQ12, p ## _IRQ13, p ## _IRQ14, p ## _IRQ15 } }
-
-#define INTC_IRQ_PINS_MASK_16H(p, base)                                        \
-       { base + 0x48, base + 0x68, 8, /* INTMSK20A / INTMSKCLR20A */   \
-         { p ## _IRQ16, p ## _IRQ17, p ## _IRQ18, p ## _IRQ19,         \
-           p ## _IRQ20, p ## _IRQ21, p ## _IRQ22, p ## _IRQ23 } },     \
-       { base + 0x4c, base + 0x6c, 8, /* INTMSK30A / INTMSKCLR30A */   \
-         { p ## _IRQ24, p ## _IRQ25, p ## _IRQ26, p ## _IRQ27,         \
-           p ## _IRQ28, p ## _IRQ29, p ## _IRQ30, p ## _IRQ31 } }
-
-#define INTC_IRQ_PINS_PRIO_16L(p, base)                                        \
-       { base + 0x10, 0, 32, 4, /* INTPRI00A */                        \
-         { p ## _IRQ0, p ## _IRQ1, p ## _IRQ2, p ## _IRQ3,             \
-           p ## _IRQ4, p ## _IRQ5, p ## _IRQ6, p ## _IRQ7 } },         \
-       { base + 0x14, 0, 32, 4, /* INTPRI10A */                        \
-         { p ## _IRQ8, p ## _IRQ9, p ## _IRQ10, p ## _IRQ11,           \
-           p ## _IRQ12, p ## _IRQ13, p ## _IRQ14, p ## _IRQ15 } }
-
-#define INTC_IRQ_PINS_PRIO_16H(p, base)                                        \
-       { base + 0x18, 0, 32, 4, /* INTPRI20A */                        \
-         { p ## _IRQ16, p ## _IRQ17, p ## _IRQ18, p ## _IRQ19,         \
-           p ## _IRQ20, p ## _IRQ21, p ## _IRQ22, p ## _IRQ23 } },     \
-       { base + 0x1c, 0, 32, 4, /* INTPRI30A */                        \
-         { p ## _IRQ24, p ## _IRQ25, p ## _IRQ26, p ## _IRQ27,         \
-           p ## _IRQ28, p ## _IRQ29, p ## _IRQ30, p ## _IRQ31 } }
-
-#define INTC_IRQ_PINS_SENSE_16L(p, base)                               \
-       { base + 0x00, 32, 4, /* ICR1A */                               \
-         { p ## _IRQ0, p ## _IRQ1, p ## _IRQ2, p ## _IRQ3,             \
-           p ## _IRQ4, p ## _IRQ5, p ## _IRQ6, p ## _IRQ7 } },         \
-       { base + 0x04, 32, 4, /* ICR2A */                               \
-         { p ## _IRQ8, p ## _IRQ9, p ## _IRQ10, p ## _IRQ11,           \
-           p ## _IRQ12, p ## _IRQ13, p ## _IRQ14, p ## _IRQ15 } }
-
-#define INTC_IRQ_PINS_SENSE_16H(p, base)                               \
-       { base + 0x08, 32, 4, /* ICR3A */                               \
-         { p ## _IRQ16, p ## _IRQ17, p ## _IRQ18, p ## _IRQ19,         \
-           p ## _IRQ20, p ## _IRQ21, p ## _IRQ22, p ## _IRQ23 } },     \
-       { base + 0x0c, 32, 4, /* ICR4A */                               \
-         { p ## _IRQ24, p ## _IRQ25, p ## _IRQ26, p ## _IRQ27,         \
-           p ## _IRQ28, p ## _IRQ29, p ## _IRQ30, p ## _IRQ31 } }
-
-#define INTC_IRQ_PINS_ACK_16L(p, base)                                 \
-       { base + 0x20, 0, 8, /* INTREQ00A */                            \
-         { p ## _IRQ0, p ## _IRQ1, p ## _IRQ2, p ## _IRQ3,             \
-           p ## _IRQ4, p ## _IRQ5, p ## _IRQ6, p ## _IRQ7 } },         \
-       { base + 0x24, 0, 8, /* INTREQ10A */                            \
-         { p ## _IRQ8, p ## _IRQ9, p ## _IRQ10, p ## _IRQ11,           \
-           p ## _IRQ12, p ## _IRQ13, p ## _IRQ14, p ## _IRQ15 } }
-
-#define INTC_IRQ_PINS_ACK_16H(p, base)                                 \
-       { base + 0x28, 0, 8, /* INTREQ20A */                            \
-         { p ## _IRQ16, p ## _IRQ17, p ## _IRQ18, p ## _IRQ19,         \
-           p ## _IRQ20, p ## _IRQ21, p ## _IRQ22, p ## _IRQ23 } },     \
-       { base + 0x2c, 0, 8, /* INTREQ30A */                            \
-         { p ## _IRQ24, p ## _IRQ25, p ## _IRQ26, p ## _IRQ27,         \
-           p ## _IRQ28, p ## _IRQ29, p ## _IRQ30, p ## _IRQ31 } }
-
-#define INTC_IRQ_PINS_16(p, base, vect, str)                           \
-                                                                       \
-static struct resource p ## _resources[] __initdata = {                        \
-       [0] = {                                                         \
-               .start  = base,                                         \
-               .end    = base + 0x64,                                  \
-               .flags  = IORESOURCE_MEM,                               \
-       },                                                              \
-};                                                                     \
-                                                                       \
-enum {                                                                 \
-       p ## _UNUSED = 0,                                               \
-       INTC_IRQ_PINS_ENUM_16L(p),                                      \
-};                                                                     \
-                                                                       \
-static struct intc_vect p ## _vectors[] __initdata = {                 \
-       INTC_IRQ_PINS_VECT_16L(p, vect),                                \
-};                                                                     \
-                                                                       \
-static struct intc_mask_reg p ## _mask_registers[] __initdata = {      \
-       INTC_IRQ_PINS_MASK_16L(p, base),                                \
-};                                                                     \
-                                                                       \
-static struct intc_prio_reg p ## _prio_registers[] __initdata = {      \
-       INTC_IRQ_PINS_PRIO_16L(p, base),                                \
-};                                                                     \
-                                                                       \
-static struct intc_sense_reg p ## _sense_registers[] __initdata = {    \
-       INTC_IRQ_PINS_SENSE_16L(p, base),                               \
-};                                                                     \
-                                                                       \
-static struct intc_mask_reg p ## _ack_registers[] __initdata = {       \
-       INTC_IRQ_PINS_ACK_16L(p, base),                                 \
-};                                                                     \
-                                                                       \
-static struct intc_desc p ## _desc __initdata = {                      \
-       .name = str,                                                    \
-       .resource = p ## _resources,                                    \
-       .num_resources = ARRAY_SIZE(p ## _resources),                   \
-       .hw = INTC_HW_DESC(p ## _vectors, NULL,                         \
-                            p ## _mask_registers, p ## _prio_registers, \
-                            p ## _sense_registers, p ## _ack_registers) \
-}
-
-#define INTC_IRQ_PINS_16H(p, base, vect, str)                          \
-                                                                       \
-static struct resource p ## _resources[] __initdata = {                        \
-       [0] = {                                                         \
-               .start  = base,                                         \
-               .end    = base + 0x64,                                  \
-               .flags  = IORESOURCE_MEM,                               \
-       },                                                              \
-};                                                                     \
-                                                                       \
-enum {                                                                 \
-       p ## _UNUSED = 0,                                               \
-       INTC_IRQ_PINS_ENUM_16H(p),                                      \
-};                                                                     \
-                                                                       \
-static struct intc_vect p ## _vectors[] __initdata = {                 \
-       INTC_IRQ_PINS_VECT_16H(p, vect),                                \
-};                                                                     \
-                                                                       \
-static struct intc_mask_reg p ## _mask_registers[] __initdata = {      \
-       INTC_IRQ_PINS_MASK_16H(p, base),                                \
-};                                                                     \
-                                                                       \
-static struct intc_prio_reg p ## _prio_registers[] __initdata = {      \
-       INTC_IRQ_PINS_PRIO_16H(p, base),                                \
-};                                                                     \
-                                                                       \
-static struct intc_sense_reg p ## _sense_registers[] __initdata = {    \
-       INTC_IRQ_PINS_SENSE_16H(p, base),                               \
-};                                                                     \
-                                                                       \
-static struct intc_mask_reg p ## _ack_registers[] __initdata = {       \
-       INTC_IRQ_PINS_ACK_16H(p, base),                                 \
-};                                                                     \
-                                                                       \
-static struct intc_desc p ## _desc __initdata = {                      \
-       .name = str,                                                    \
-       .resource = p ## _resources,                                    \
-       .num_resources = ARRAY_SIZE(p ## _resources),                   \
-       .hw = INTC_HW_DESC(p ## _vectors, NULL,                         \
-                            p ## _mask_registers, p ## _prio_registers, \
-                            p ## _sense_registers, p ## _ack_registers) \
-}
-
-#define INTC_IRQ_PINS_32(p, base, vect, str)                           \
-                                                                       \
-static struct resource p ## _resources[] __initdata = {                        \
-       [0] = {                                                         \
-               .start  = base,                                         \
-               .end    = base + 0x6c,                                  \
-               .flags  = IORESOURCE_MEM,                               \
-       },                                                              \
-};                                                                     \
-                                                                       \
-enum {                                                                 \
-       p ## _UNUSED = 0,                                               \
-       INTC_IRQ_PINS_ENUM_16L(p),                                      \
-       INTC_IRQ_PINS_ENUM_16H(p),                                      \
-};                                                                     \
-                                                                       \
-static struct intc_vect p ## _vectors[] __initdata = {                 \
-       INTC_IRQ_PINS_VECT_16L(p, vect),                                \
-       INTC_IRQ_PINS_VECT_16H(p, vect),                                \
-};                                                                     \
-                                                                       \
-static struct intc_mask_reg p ## _mask_registers[] __initdata = {      \
-       INTC_IRQ_PINS_MASK_16L(p, base),                                \
-       INTC_IRQ_PINS_MASK_16H(p, base),                                \
-};                                                                     \
-                                                                       \
-static struct intc_prio_reg p ## _prio_registers[] __initdata = {      \
-       INTC_IRQ_PINS_PRIO_16L(p, base),                                \
-       INTC_IRQ_PINS_PRIO_16H(p, base),                                \
-};                                                                     \
-                                                                       \
-static struct intc_sense_reg p ## _sense_registers[] __initdata = {    \
-       INTC_IRQ_PINS_SENSE_16L(p, base),                               \
-       INTC_IRQ_PINS_SENSE_16H(p, base),                               \
-};                                                                     \
-                                                                       \
-static struct intc_mask_reg p ## _ack_registers[] __initdata = {       \
-       INTC_IRQ_PINS_ACK_16L(p, base),                                 \
-       INTC_IRQ_PINS_ACK_16H(p, base),                                 \
-};                                                                     \
-                                                                       \
-static struct intc_desc p ## _desc __initdata = {                      \
-       .name = str,                                                    \
-       .resource = p ## _resources,                                    \
-       .num_resources = ARRAY_SIZE(p ## _resources),                   \
-       .hw = INTC_HW_DESC(p ## _vectors, NULL,                         \
-                            p ## _mask_registers, p ## _prio_registers, \
-                            p ## _sense_registers, p ## _ack_registers) \
-}
-
-#define INTC_PINT_E_EMPTY
-#define INTC_PINT_E_NONE 0, 0, 0, 0, 0, 0, 0, 0,
-#define INTC_PINT_E(p)                                                 \
-       PINT ## p ## 0, PINT ## p ## 1, PINT ## p ## 2, PINT ## p ## 3, \
-       PINT ## p ## 4, PINT ## p ## 5, PINT ## p ## 6, PINT ## p ## 7,
-
-#define INTC_PINT_V_NONE
-#define INTC_PINT_V(p, vect)                                   \
-       vect(PINT ## p ## 0, 0), vect(PINT ## p ## 1, 1),       \
-       vect(PINT ## p ## 2, 2), vect(PINT ## p ## 3, 3),       \
-       vect(PINT ## p ## 4, 4), vect(PINT ## p ## 5, 5),       \
-       vect(PINT ## p ## 6, 6), vect(PINT ## p ## 7, 7),
-
-#define INTC_PINT(p, mask_reg, sense_base, str,                                \
-       enums_1, enums_2, enums_3, enums_4,                             \
-       vect_1, vect_2, vect_3, vect_4,                                 \
-       mask_a, mask_b, mask_c, mask_d,                                 \
-       sense_a, sense_b, sense_c, sense_d)                             \
-                                                                       \
-enum {                                                                 \
-       PINT ## p ## _UNUSED = 0,                                       \
-       enums_1 enums_2 enums_3 enums_4                                 \
-};                                                                     \
-                                                                       \
-static struct intc_vect p ## _vectors[] __initdata = {                 \
-       vect_1 vect_2 vect_3 vect_4                                     \
-};                                                                     \
-                                                                       \
-static struct intc_mask_reg p ## _mask_registers[] __initdata = {      \
-       { mask_reg, 0, 32, /* PINTER */                                 \
-         { mask_a mask_b mask_c mask_d } }                             \
-};                                                                     \
-                                                                       \
-static struct intc_sense_reg p ## _sense_registers[] __initdata = {    \
-       { sense_base + 0x00, 16, 2, /* PINTCR */                        \
-         { sense_a } },                                                \
-       { sense_base + 0x04, 16, 2, /* PINTCR */                        \
-         { sense_b } },                                                \
-       { sense_base + 0x08, 16, 2, /* PINTCR */                        \
-         { sense_c } },                                                \
-       { sense_base + 0x0c, 16, 2, /* PINTCR */                        \
-         { sense_d } },                                                \
-};                                                                     \
-                                                                       \
-static struct intc_desc p ## _desc __initdata = {                      \
-       .name = str,                                                    \
-       .hw = INTC_HW_DESC(p ## _vectors, NULL,                         \
-                            p ## _mask_registers, NULL,                \
-                            p ## _sense_registers, NULL),              \
-}
-
-#endif  /* __ASM_MACH_INTC_H */
index d241bfd6926de3d4f9fddaed6aa6ab19e9158383..5aee83f079e2251e1b0c7df3d6b1c4692ef7b93c 100644 (file)
@@ -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/pm-rcar.h b/arch/arm/mach-shmobile/include/mach/pm-rcar.h
deleted file mode 100644 (file)
index ef3a1ef..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef PM_RCAR_H
-#define PM_RCAR_H
-
-struct rcar_sysc_ch {
-       unsigned long chan_offs;
-       unsigned int chan_bit;
-       unsigned int isr_bit;
-};
-
-int rcar_sysc_power_down(struct rcar_sysc_ch *sysc_ch);
-int rcar_sysc_power_up(struct rcar_sysc_ch *sysc_ch);
-bool rcar_sysc_power_is_off(struct rcar_sysc_ch *sysc_ch);
-void __iomem *rcar_sysc_init(phys_addr_t base);
-
-#endif /* PM_RCAR_H */
diff --git a/arch/arm/mach-shmobile/include/mach/pm-rmobile.h b/arch/arm/mach-shmobile/include/mach/pm-rmobile.h
deleted file mode 100644 (file)
index 690553a..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2012 Renesas Solutions Corp.
- *
- * Kuninori Morimoto <morimoto.kuninori@renesas.com>
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#ifndef PM_RMOBILE_H
-#define PM_RMOBILE_H
-
-#include <linux/pm_domain.h>
-
-#define DEFAULT_DEV_LATENCY_NS 250000
-
-struct platform_device;
-
-struct rmobile_pm_domain {
-       struct generic_pm_domain genpd;
-       struct dev_power_governor *gov;
-       int (*suspend)(void);
-       void (*resume)(void);
-       unsigned int bit_shift;
-       bool no_debug;
-};
-
-static inline
-struct rmobile_pm_domain *to_rmobile_pd(struct generic_pm_domain *d)
-{
-       return container_of(d, struct rmobile_pm_domain, genpd);
-}
-
-struct pm_domain_device {
-       const char *domain_name;
-       struct platform_device *pdev;
-};
-
-#ifdef CONFIG_PM
-extern void rmobile_init_domains(struct rmobile_pm_domain domains[], int num);
-extern void rmobile_add_device_to_domain_td(const char *domain_name,
-                                           struct platform_device *pdev,
-                                           struct gpd_timing_data *td);
-
-static inline void rmobile_add_device_to_domain(const char *domain_name,
-                                               struct platform_device *pdev)
-{
-       rmobile_add_device_to_domain_td(domain_name, pdev, NULL);
-}
-
-extern void rmobile_add_devices_to_domains(struct pm_domain_device data[],
-                                          int size);
-#else
-
-#define rmobile_init_domains(domains, num) do { } while (0)
-#define rmobile_add_device_to_domain_td(name, pdev, td) do { } while (0)
-#define rmobile_add_device_to_domain(name, pdev) do { } while (0)
-
-static inline void rmobile_add_devices_to_domains(struct pm_domain_device d[],
-                                                 int size) {}
-#endif /* CONFIG_PM */
-
-#endif /* PM_RMOBILE_H */
diff --git a/arch/arm/mach-shmobile/include/mach/r7s72100.h b/arch/arm/mach-shmobile/include/mach/r7s72100.h
deleted file mode 100644 (file)
index 5f34b20..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __ASM_R7S72100_H__
-#define __ASM_R7S72100_H__
-
-void r7s72100_add_dt_devices(void);
-void r7s72100_clock_init(void);
-void r7s72100_init_early(void);
-
-#endif /* __ASM_R7S72100_H__ */
diff --git a/arch/arm/mach-shmobile/include/mach/r8a73a4.h b/arch/arm/mach-shmobile/include/mach/r8a73a4.h
deleted file mode 100644 (file)
index ce8bdd1..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef __ASM_R8A73A4_H__
-#define __ASM_R8A73A4_H__
-
-/* DMA slave IDs */
-enum {
-       SHDMA_SLAVE_INVALID,
-       SHDMA_SLAVE_MMCIF0_TX,
-       SHDMA_SLAVE_MMCIF0_RX,
-       SHDMA_SLAVE_MMCIF1_TX,
-       SHDMA_SLAVE_MMCIF1_RX,
-};
-
-void r8a73a4_add_standard_devices(void);
-void r8a73a4_add_dt_devices(void);
-void r8a73a4_clock_init(void);
-void r8a73a4_pinmux_init(void);
-void r8a73a4_init_early(void);
-
-#endif /* __ASM_R8A73A4_H__ */
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7740.h b/arch/arm/mach-shmobile/include/mach/r8a7740.h
deleted file mode 100644 (file)
index 5e3c9ec..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2011  Renesas Solutions Corp.
- * Copyright (C) 2011  Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#ifndef __ASM_R8A7740_H__
-#define __ASM_R8A7740_H__
-
-#include <mach/pm-rmobile.h>
-
-/*
- * MD_CKx pin
- */
-#define MD_CK2 (1 << 2)
-#define MD_CK1 (1 << 1)
-#define MD_CK0 (1 << 0)
-
-/* DMA slave IDs */
-enum {
-       SHDMA_SLAVE_INVALID,
-       SHDMA_SLAVE_SDHI0_RX,
-       SHDMA_SLAVE_SDHI0_TX,
-       SHDMA_SLAVE_SDHI1_RX,
-       SHDMA_SLAVE_SDHI1_TX,
-       SHDMA_SLAVE_SDHI2_RX,
-       SHDMA_SLAVE_SDHI2_TX,
-       SHDMA_SLAVE_FSIA_RX,
-       SHDMA_SLAVE_FSIA_TX,
-       SHDMA_SLAVE_FSIB_TX,
-       SHDMA_SLAVE_USBHS_TX,
-       SHDMA_SLAVE_USBHS_RX,
-       SHDMA_SLAVE_MMCIF_TX,
-       SHDMA_SLAVE_MMCIF_RX,
-};
-
-extern void r8a7740_meram_workaround(void);
-extern void r8a7740_init_irq_of(void);
-extern void r8a7740_map_io(void);
-extern void r8a7740_add_early_devices(void);
-extern void r8a7740_add_standard_devices(void);
-extern void r8a7740_add_standard_devices_dt(void);
-extern void r8a7740_clock_init(u8 md_ck);
-extern void r8a7740_pinmux_init(void);
-extern void r8a7740_pm_init(void);
-
-#ifdef CONFIG_PM
-extern void __init r8a7740_init_pm_domains(void);
-#else
-static inline void r8a7740_init_pm_domains(void) {}
-#endif /* CONFIG_PM */
-
-#endif /* __ASM_R8A7740_H__ */
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7778.h b/arch/arm/mach-shmobile/include/mach/r8a7778.h
deleted file mode 100644 (file)
index f4076a5..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2013  Renesas Solutions Corp.
- * Copyright (C) 2013  Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
- * Copyright (C) 2013  Cogent Embedded, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-#ifndef __ASM_R8A7778_H__
-#define __ASM_R8A7778_H__
-
-#include <linux/sh_eth.h>
-
-/* HPB-DMA slave IDs */
-enum {
-       HPBDMA_SLAVE_DUMMY,
-       HPBDMA_SLAVE_SDHI0_TX,
-       HPBDMA_SLAVE_SDHI0_RX,
-       HPBDMA_SLAVE_SSI0_TX,
-       HPBDMA_SLAVE_SSI0_RX,
-       HPBDMA_SLAVE_SSI1_TX,
-       HPBDMA_SLAVE_SSI1_RX,
-       HPBDMA_SLAVE_SSI2_TX,
-       HPBDMA_SLAVE_SSI2_RX,
-       HPBDMA_SLAVE_SSI3_TX,
-       HPBDMA_SLAVE_SSI3_RX,
-       HPBDMA_SLAVE_SSI4_TX,
-       HPBDMA_SLAVE_SSI4_RX,
-       HPBDMA_SLAVE_SSI5_TX,
-       HPBDMA_SLAVE_SSI5_RX,
-       HPBDMA_SLAVE_SSI6_TX,
-       HPBDMA_SLAVE_SSI6_RX,
-       HPBDMA_SLAVE_SSI7_TX,
-       HPBDMA_SLAVE_SSI7_RX,
-       HPBDMA_SLAVE_SSI8_TX,
-       HPBDMA_SLAVE_SSI8_RX,
-       HPBDMA_SLAVE_HPBIF0_TX,
-       HPBDMA_SLAVE_HPBIF0_RX,
-       HPBDMA_SLAVE_HPBIF1_TX,
-       HPBDMA_SLAVE_HPBIF1_RX,
-       HPBDMA_SLAVE_HPBIF2_TX,
-       HPBDMA_SLAVE_HPBIF2_RX,
-       HPBDMA_SLAVE_HPBIF3_TX,
-       HPBDMA_SLAVE_HPBIF3_RX,
-       HPBDMA_SLAVE_HPBIF4_TX,
-       HPBDMA_SLAVE_HPBIF4_RX,
-       HPBDMA_SLAVE_HPBIF5_TX,
-       HPBDMA_SLAVE_HPBIF5_RX,
-       HPBDMA_SLAVE_HPBIF6_TX,
-       HPBDMA_SLAVE_HPBIF6_RX,
-       HPBDMA_SLAVE_HPBIF7_TX,
-       HPBDMA_SLAVE_HPBIF7_RX,
-       HPBDMA_SLAVE_HPBIF8_TX,
-       HPBDMA_SLAVE_HPBIF8_RX,
-       HPBDMA_SLAVE_USBFUNC_TX,
-       HPBDMA_SLAVE_USBFUNC_RX,
-};
-
-extern void r8a7778_add_standard_devices(void);
-extern void r8a7778_add_standard_devices_dt(void);
-extern void r8a7778_add_dt_devices(void);
-
-extern void r8a7778_init_late(void);
-extern void r8a7778_init_delay(void);
-extern void r8a7778_init_irq_dt(void);
-extern void r8a7778_clock_init(void);
-extern void r8a7778_init_irq_extpin(int irlm);
-extern void r8a7778_init_irq_extpin_dt(int irlm);
-extern void r8a7778_pinmux_init(void);
-
-extern int r8a7778_usb_phy_power(bool enable);
-
-#endif /* __ASM_R8A7778_H__ */
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h
deleted file mode 100644 (file)
index 88eecea..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#ifndef __ASM_R8A7779_H__
-#define __ASM_R8A7779_H__
-
-#include <linux/sh_clk.h>
-#include <linux/pm_domain.h>
-#include <mach/pm-rcar.h>
-
-/* HPB-DMA slave IDs */
-enum {
-       HPBDMA_SLAVE_DUMMY,
-       HPBDMA_SLAVE_SDHI0_TX,
-       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);
-extern void r8a7779_map_io(void);
-extern void r8a7779_earlytimer_init(void);
-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 void r8a7779_clock_init(void);
-extern void r8a7779_pinmux_init(void);
-extern void r8a7779_pm_init(void);
-extern void r8a7779_register_twd(void);
-
-#ifdef CONFIG_PM
-extern void __init r8a7779_init_pm_domains(void);
-#else
-static inline void r8a7779_init_pm_domains(void) {}
-#endif /* CONFIG_PM */
-
-extern struct smp_operations r8a7779_smp_ops;
-
-#endif /* __ASM_R8A7779_H__ */
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7790.h b/arch/arm/mach-shmobile/include/mach/r8a7790.h
deleted file mode 100644 (file)
index 0b95bab..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef __ASM_R8A7790_H__
-#define __ASM_R8A7790_H__
-
-#include <mach/rcar-gen2.h>
-
-/* DMA slave IDs */
-enum {
-       RCAR_DMA_SLAVE_INVALID,
-       AUDIO_DMAC_SLAVE_SSI0_TX,
-       AUDIO_DMAC_SLAVE_SSI0_RX,
-       AUDIO_DMAC_SLAVE_SSI1_TX,
-       AUDIO_DMAC_SLAVE_SSI1_RX,
-       AUDIO_DMAC_SLAVE_SSI2_TX,
-       AUDIO_DMAC_SLAVE_SSI2_RX,
-       AUDIO_DMAC_SLAVE_SSI3_TX,
-       AUDIO_DMAC_SLAVE_SSI3_RX,
-       AUDIO_DMAC_SLAVE_SSI4_TX,
-       AUDIO_DMAC_SLAVE_SSI4_RX,
-       AUDIO_DMAC_SLAVE_SSI5_TX,
-       AUDIO_DMAC_SLAVE_SSI5_RX,
-       AUDIO_DMAC_SLAVE_SSI6_TX,
-       AUDIO_DMAC_SLAVE_SSI6_RX,
-       AUDIO_DMAC_SLAVE_SSI7_TX,
-       AUDIO_DMAC_SLAVE_SSI7_RX,
-       AUDIO_DMAC_SLAVE_SSI8_TX,
-       AUDIO_DMAC_SLAVE_SSI8_RX,
-       AUDIO_DMAC_SLAVE_SSI9_TX,
-       AUDIO_DMAC_SLAVE_SSI9_RX,
-};
-
-void r8a7790_add_standard_devices(void);
-void r8a7790_add_dt_devices(void);
-void r8a7790_clock_init(void);
-void r8a7790_pinmux_init(void);
-void r8a7790_pm_init(void);
-void r8a7790_init_early(void);
-extern struct smp_operations r8a7790_smp_ops;
-
-#endif /* __ASM_R8A7790_H__ */
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7791.h b/arch/arm/mach-shmobile/include/mach/r8a7791.h
deleted file mode 100644 (file)
index 664274c..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef __ASM_R8A7791_H__
-#define __ASM_R8A7791_H__
-
-void r8a7791_add_standard_devices(void);
-void r8a7791_add_dt_devices(void);
-void r8a7791_clock_init(void);
-void r8a7791_pinmux_init(void);
-extern struct smp_operations r8a7791_smp_ops;
-
-#endif /* __ASM_R8A7791_H__ */
diff --git a/arch/arm/mach-shmobile/include/mach/rcar-gen2.h b/arch/arm/mach-shmobile/include/mach/rcar-gen2.h
deleted file mode 100644 (file)
index 43f606e..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __ASM_RCAR_GEN2_H__
-#define __ASM_RCAR_GEN2_H__
-
-void rcar_gen2_timer_init(void);
-#define MD(nr) BIT(nr)
-u32 rcar_gen2_read_mode_pins(void);
-
-#endif /* __ASM_RCAR_GEN2_H__ */
diff --git a/arch/arm/mach-shmobile/include/mach/sh7372.h b/arch/arm/mach-shmobile/include/mach/sh7372.h
deleted file mode 100644 (file)
index 854a9f0..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (C) 2010 Renesas Solutions Corp.
- *
- * Kuninori Morimoto <morimoto.kuninori@renesas.com>
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-
-#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,
-       SHDMA_SLAVE_SCIF0_TX,
-       SHDMA_SLAVE_SCIF0_RX,
-       SHDMA_SLAVE_SCIF1_TX,
-       SHDMA_SLAVE_SCIF1_RX,
-       SHDMA_SLAVE_SCIF2_TX,
-       SHDMA_SLAVE_SCIF2_RX,
-       SHDMA_SLAVE_SCIF3_TX,
-       SHDMA_SLAVE_SCIF3_RX,
-       SHDMA_SLAVE_SCIF4_TX,
-       SHDMA_SLAVE_SCIF4_RX,
-       SHDMA_SLAVE_SCIF5_TX,
-       SHDMA_SLAVE_SCIF5_RX,
-       SHDMA_SLAVE_SCIF6_TX,
-       SHDMA_SLAVE_SCIF6_RX,
-       SHDMA_SLAVE_FLCTL0_TX,
-       SHDMA_SLAVE_FLCTL0_RX,
-       SHDMA_SLAVE_FLCTL1_TX,
-       SHDMA_SLAVE_FLCTL1_RX,
-       SHDMA_SLAVE_SDHI0_RX,
-       SHDMA_SLAVE_SDHI0_TX,
-       SHDMA_SLAVE_SDHI1_RX,
-       SHDMA_SLAVE_SDHI1_TX,
-       SHDMA_SLAVE_SDHI2_RX,
-       SHDMA_SLAVE_SDHI2_TX,
-       SHDMA_SLAVE_FSIA_RX,
-       SHDMA_SLAVE_FSIA_TX,
-       SHDMA_SLAVE_MMCIF_RX,
-       SHDMA_SLAVE_MMCIF_TX,
-       SHDMA_SLAVE_USB0_TX,
-       SHDMA_SLAVE_USB0_RX,
-       SHDMA_SLAVE_USB1_TX,
-       SHDMA_SLAVE_USB1_RX,
-};
-
-extern struct clk sh7372_extal1_clk;
-extern struct clk sh7372_extal2_clk;
-extern struct clk sh7372_dv_clki_clk;
-extern struct clk sh7372_dv_clki_div2_clk;
-extern struct clk sh7372_pllc2_clk;
-
-extern void sh7372_init_irq(void);
-extern void sh7372_map_io(void);
-extern void sh7372_earlytimer_init(void);
-extern void sh7372_add_early_devices(void);
-extern void sh7372_add_standard_devices(void);
-extern void sh7372_add_early_devices_dt(void);
-extern void sh7372_add_standard_devices_dt(void);
-extern void sh7372_clock_init(void);
-extern void sh7372_pinmux_init(void);
-extern void sh7372_pm_init(void);
-extern void sh7372_resume_core_standby_sysc(void);
-extern int  sh7372_do_idle_sysc(unsigned long sleep_mode);
-extern void sh7372_intcs_suspend(void);
-extern void sh7372_intcs_resume(void);
-extern void sh7372_intca_suspend(void);
-extern void sh7372_intca_resume(void);
-
-extern unsigned long sh7372_cpu_resume;
-
-#ifdef CONFIG_PM
-extern void __init sh7372_init_pm_domains(void);
-#else
-static inline void sh7372_init_pm_domains(void) {}
-#endif
-
-extern void __init sh7372_pm_init_late(void);
-
-#endif /* __ASM_SH7372_H__ */
diff --git a/arch/arm/mach-shmobile/include/mach/sh73a0.h b/arch/arm/mach-shmobile/include/mach/sh73a0.h
deleted file mode 100644 (file)
index 359b582..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-#ifndef __ASM_SH73A0_H__
-#define __ASM_SH73A0_H__
-
-/* DMA slave IDs */
-enum {
-       SHDMA_SLAVE_INVALID,
-       SHDMA_SLAVE_SCIF0_TX,
-       SHDMA_SLAVE_SCIF0_RX,
-       SHDMA_SLAVE_SCIF1_TX,
-       SHDMA_SLAVE_SCIF1_RX,
-       SHDMA_SLAVE_SCIF2_TX,
-       SHDMA_SLAVE_SCIF2_RX,
-       SHDMA_SLAVE_SCIF3_TX,
-       SHDMA_SLAVE_SCIF3_RX,
-       SHDMA_SLAVE_SCIF4_TX,
-       SHDMA_SLAVE_SCIF4_RX,
-       SHDMA_SLAVE_SCIF5_TX,
-       SHDMA_SLAVE_SCIF5_RX,
-       SHDMA_SLAVE_SCIF6_TX,
-       SHDMA_SLAVE_SCIF6_RX,
-       SHDMA_SLAVE_SCIF7_TX,
-       SHDMA_SLAVE_SCIF7_RX,
-       SHDMA_SLAVE_SCIF8_TX,
-       SHDMA_SLAVE_SCIF8_RX,
-       SHDMA_SLAVE_SDHI0_TX,
-       SHDMA_SLAVE_SDHI0_RX,
-       SHDMA_SLAVE_SDHI1_TX,
-       SHDMA_SLAVE_SDHI1_RX,
-       SHDMA_SLAVE_SDHI2_TX,
-       SHDMA_SLAVE_SDHI2_RX,
-       SHDMA_SLAVE_MMCIF_TX,
-       SHDMA_SLAVE_MMCIF_RX,
-       SHDMA_SLAVE_FSI2A_TX,
-       SHDMA_SLAVE_FSI2A_RX,
-       SHDMA_SLAVE_FSI2B_TX,
-       SHDMA_SLAVE_FSI2B_RX,
-       SHDMA_SLAVE_FSI2C_TX,
-       SHDMA_SLAVE_FSI2C_RX,
-       SHDMA_SLAVE_FSI2D_RX,
-};
-
-/*
- *             SH73A0 IRQ LOCATION TABLE
- *
- * 416 -----------------------------------------
- *             IRQ0-IRQ15
- * 431 -----------------------------------------
- * ...
- * 448 -----------------------------------------
- *             sh73a0-intcs
- *             sh73a0-intca-irq-pins
- * 680 -----------------------------------------
- * ...
- * 700 -----------------------------------------
- *             sh73a0-pint0
- * 731 -----------------------------------------
- * 732 -----------------------------------------
- *             sh73a0-pint1
- * 739 -----------------------------------------
- * ...
- * 800 -----------------------------------------
- *             IRQ16-IRQ31
- * 815 -----------------------------------------
- * ...
- * 928 -----------------------------------------
- *             sh73a0-intca-irq-pins
- * 943 -----------------------------------------
- */
-
-/* PINT interrupts are located at Linux IRQ 700 and up */
-#define SH73A0_PINT0_IRQ(irq) ((irq) + 700)
-#define SH73A0_PINT1_IRQ(irq) ((irq) + 732)
-
-extern void sh73a0_init_delay(void);
-extern void sh73a0_init_irq(void);
-extern void sh73a0_init_irq_dt(void);
-extern void sh73a0_map_io(void);
-extern void sh73a0_earlytimer_init(void);
-extern void sh73a0_add_early_devices(void);
-extern void sh73a0_add_standard_devices(void);
-extern void sh73a0_add_standard_devices_dt(void);
-extern void sh73a0_clock_init(void);
-extern void sh73a0_pinmux_init(void);
-extern void sh73a0_pm_init(void);
-extern struct clk sh73a0_extal1_clk;
-extern struct clk sh73a0_extal2_clk;
-extern struct clk sh73a0_extcki_clk;
-extern struct clk sh73a0_extalr_clk;
-extern struct smp_operations sh73a0_smp_ops;
-
-#endif /* __ASM_SH73A0_H__ */
index a91caad7db7c9bb18b340744634b73e423a1fad7..e2af00b1bd9dc465eefec06ad84398b41dda1657 100644 (file)
 #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,
index 19a26f4579b31e47b2437b2fe4128c7dc7dd6a3d..44457a94897b28708c83cbb12a394ab857b860f1 100644 (file)
 #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"
+#include "sh73a0.h"
+
 enum {
        UNUSED = 0,
 
diff --git a/arch/arm/mach-shmobile/intc.h b/arch/arm/mach-shmobile/intc.h
new file mode 100644 (file)
index 0000000..a5603c7
--- /dev/null
@@ -0,0 +1,290 @@
+#ifndef __ASM_MACH_INTC_H
+#define __ASM_MACH_INTC_H
+#include <linux/sh_intc.h>
+
+#define INTC_IRQ_PINS_ENUM_16L(p)                              \
+       p ## _IRQ0, p ## _IRQ1, p ## _IRQ2, p ## _IRQ3,         \
+       p ## _IRQ4, p ## _IRQ5, p ## _IRQ6, p ## _IRQ7,         \
+       p ## _IRQ8, p ## _IRQ9, p ## _IRQ10, p ## _IRQ11,       \
+       p ## _IRQ12, p ## _IRQ13, p ## _IRQ14, p ## _IRQ15
+
+#define INTC_IRQ_PINS_ENUM_16H(p)                              \
+       p ## _IRQ16, p ## _IRQ17, p ## _IRQ18, p ## _IRQ19,     \
+       p ## _IRQ20, p ## _IRQ21, p ## _IRQ22, p ## _IRQ23,     \
+       p ## _IRQ24, p ## _IRQ25, p ## _IRQ26, p ## _IRQ27,     \
+       p ## _IRQ28, p ## _IRQ29, p ## _IRQ30, p ## _IRQ31
+
+#define INTC_IRQ_PINS_VECT_16L(p, vect)                                \
+       vect(p ## _IRQ0, 0x0200), vect(p ## _IRQ1, 0x0220),     \
+       vect(p ## _IRQ2, 0x0240), vect(p ## _IRQ3, 0x0260),     \
+       vect(p ## _IRQ4, 0x0280), vect(p ## _IRQ5, 0x02a0),     \
+       vect(p ## _IRQ6, 0x02c0), vect(p ## _IRQ7, 0x02e0),     \
+       vect(p ## _IRQ8, 0x0300), vect(p ## _IRQ9, 0x0320),     \
+       vect(p ## _IRQ10, 0x0340), vect(p ## _IRQ11, 0x0360),   \
+       vect(p ## _IRQ12, 0x0380), vect(p ## _IRQ13, 0x03a0),   \
+       vect(p ## _IRQ14, 0x03c0), vect(p ## _IRQ15, 0x03e0)
+
+#define INTC_IRQ_PINS_VECT_16H(p, vect)                                \
+       vect(p ## _IRQ16, 0x3200), vect(p ## _IRQ17, 0x3220),   \
+       vect(p ## _IRQ18, 0x3240), vect(p ## _IRQ19, 0x3260),   \
+       vect(p ## _IRQ20, 0x3280), vect(p ## _IRQ21, 0x32a0),   \
+       vect(p ## _IRQ22, 0x32c0), vect(p ## _IRQ23, 0x32e0),   \
+       vect(p ## _IRQ24, 0x3300), vect(p ## _IRQ25, 0x3320),   \
+       vect(p ## _IRQ26, 0x3340), vect(p ## _IRQ27, 0x3360),   \
+       vect(p ## _IRQ28, 0x3380), vect(p ## _IRQ29, 0x33a0),   \
+       vect(p ## _IRQ30, 0x33c0), vect(p ## _IRQ31, 0x33e0)
+
+#define INTC_IRQ_PINS_MASK_16L(p, base)                                        \
+       { base + 0x40, base + 0x60, 8, /* INTMSK00A / INTMSKCLR00A */   \
+         { p ## _IRQ0, p ## _IRQ1, p ## _IRQ2, p ## _IRQ3,             \
+           p ## _IRQ4, p ## _IRQ5, p ## _IRQ6, p ## _IRQ7 } },         \
+       { base + 0x44, base + 0x64, 8, /* INTMSK10A / INTMSKCLR10A */   \
+         { p ## _IRQ8, p ## _IRQ9, p ## _IRQ10, p ## _IRQ11,           \
+           p ## _IRQ12, p ## _IRQ13, p ## _IRQ14, p ## _IRQ15 } }
+
+#define INTC_IRQ_PINS_MASK_16H(p, base)                                        \
+       { base + 0x48, base + 0x68, 8, /* INTMSK20A / INTMSKCLR20A */   \
+         { p ## _IRQ16, p ## _IRQ17, p ## _IRQ18, p ## _IRQ19,         \
+           p ## _IRQ20, p ## _IRQ21, p ## _IRQ22, p ## _IRQ23 } },     \
+       { base + 0x4c, base + 0x6c, 8, /* INTMSK30A / INTMSKCLR30A */   \
+         { p ## _IRQ24, p ## _IRQ25, p ## _IRQ26, p ## _IRQ27,         \
+           p ## _IRQ28, p ## _IRQ29, p ## _IRQ30, p ## _IRQ31 } }
+
+#define INTC_IRQ_PINS_PRIO_16L(p, base)                                        \
+       { base + 0x10, 0, 32, 4, /* INTPRI00A */                        \
+         { p ## _IRQ0, p ## _IRQ1, p ## _IRQ2, p ## _IRQ3,             \
+           p ## _IRQ4, p ## _IRQ5, p ## _IRQ6, p ## _IRQ7 } },         \
+       { base + 0x14, 0, 32, 4, /* INTPRI10A */                        \
+         { p ## _IRQ8, p ## _IRQ9, p ## _IRQ10, p ## _IRQ11,           \
+           p ## _IRQ12, p ## _IRQ13, p ## _IRQ14, p ## _IRQ15 } }
+
+#define INTC_IRQ_PINS_PRIO_16H(p, base)                                        \
+       { base + 0x18, 0, 32, 4, /* INTPRI20A */                        \
+         { p ## _IRQ16, p ## _IRQ17, p ## _IRQ18, p ## _IRQ19,         \
+           p ## _IRQ20, p ## _IRQ21, p ## _IRQ22, p ## _IRQ23 } },     \
+       { base + 0x1c, 0, 32, 4, /* INTPRI30A */                        \
+         { p ## _IRQ24, p ## _IRQ25, p ## _IRQ26, p ## _IRQ27,         \
+           p ## _IRQ28, p ## _IRQ29, p ## _IRQ30, p ## _IRQ31 } }
+
+#define INTC_IRQ_PINS_SENSE_16L(p, base)                               \
+       { base + 0x00, 32, 4, /* ICR1A */                               \
+         { p ## _IRQ0, p ## _IRQ1, p ## _IRQ2, p ## _IRQ3,             \
+           p ## _IRQ4, p ## _IRQ5, p ## _IRQ6, p ## _IRQ7 } },         \
+       { base + 0x04, 32, 4, /* ICR2A */                               \
+         { p ## _IRQ8, p ## _IRQ9, p ## _IRQ10, p ## _IRQ11,           \
+           p ## _IRQ12, p ## _IRQ13, p ## _IRQ14, p ## _IRQ15 } }
+
+#define INTC_IRQ_PINS_SENSE_16H(p, base)                               \
+       { base + 0x08, 32, 4, /* ICR3A */                               \
+         { p ## _IRQ16, p ## _IRQ17, p ## _IRQ18, p ## _IRQ19,         \
+           p ## _IRQ20, p ## _IRQ21, p ## _IRQ22, p ## _IRQ23 } },     \
+       { base + 0x0c, 32, 4, /* ICR4A */                               \
+         { p ## _IRQ24, p ## _IRQ25, p ## _IRQ26, p ## _IRQ27,         \
+           p ## _IRQ28, p ## _IRQ29, p ## _IRQ30, p ## _IRQ31 } }
+
+#define INTC_IRQ_PINS_ACK_16L(p, base)                                 \
+       { base + 0x20, 0, 8, /* INTREQ00A */                            \
+         { p ## _IRQ0, p ## _IRQ1, p ## _IRQ2, p ## _IRQ3,             \
+           p ## _IRQ4, p ## _IRQ5, p ## _IRQ6, p ## _IRQ7 } },         \
+       { base + 0x24, 0, 8, /* INTREQ10A */                            \
+         { p ## _IRQ8, p ## _IRQ9, p ## _IRQ10, p ## _IRQ11,           \
+           p ## _IRQ12, p ## _IRQ13, p ## _IRQ14, p ## _IRQ15 } }
+
+#define INTC_IRQ_PINS_ACK_16H(p, base)                                 \
+       { base + 0x28, 0, 8, /* INTREQ20A */                            \
+         { p ## _IRQ16, p ## _IRQ17, p ## _IRQ18, p ## _IRQ19,         \
+           p ## _IRQ20, p ## _IRQ21, p ## _IRQ22, p ## _IRQ23 } },     \
+       { base + 0x2c, 0, 8, /* INTREQ30A */                            \
+         { p ## _IRQ24, p ## _IRQ25, p ## _IRQ26, p ## _IRQ27,         \
+           p ## _IRQ28, p ## _IRQ29, p ## _IRQ30, p ## _IRQ31 } }
+
+#define INTC_IRQ_PINS_16(p, base, vect, str)                           \
+                                                                       \
+static struct resource p ## _resources[] __initdata = {                        \
+       [0] = {                                                         \
+               .start  = base,                                         \
+               .end    = base + 0x64,                                  \
+               .flags  = IORESOURCE_MEM,                               \
+       },                                                              \
+};                                                                     \
+                                                                       \
+enum {                                                                 \
+       p ## _UNUSED = 0,                                               \
+       INTC_IRQ_PINS_ENUM_16L(p),                                      \
+};                                                                     \
+                                                                       \
+static struct intc_vect p ## _vectors[] __initdata = {                 \
+       INTC_IRQ_PINS_VECT_16L(p, vect),                                \
+};                                                                     \
+                                                                       \
+static struct intc_mask_reg p ## _mask_registers[] __initdata = {      \
+       INTC_IRQ_PINS_MASK_16L(p, base),                                \
+};                                                                     \
+                                                                       \
+static struct intc_prio_reg p ## _prio_registers[] __initdata = {      \
+       INTC_IRQ_PINS_PRIO_16L(p, base),                                \
+};                                                                     \
+                                                                       \
+static struct intc_sense_reg p ## _sense_registers[] __initdata = {    \
+       INTC_IRQ_PINS_SENSE_16L(p, base),                               \
+};                                                                     \
+                                                                       \
+static struct intc_mask_reg p ## _ack_registers[] __initdata = {       \
+       INTC_IRQ_PINS_ACK_16L(p, base),                                 \
+};                                                                     \
+                                                                       \
+static struct intc_desc p ## _desc __initdata = {                      \
+       .name = str,                                                    \
+       .resource = p ## _resources,                                    \
+       .num_resources = ARRAY_SIZE(p ## _resources),                   \
+       .hw = INTC_HW_DESC(p ## _vectors, NULL,                         \
+                            p ## _mask_registers, p ## _prio_registers, \
+                            p ## _sense_registers, p ## _ack_registers) \
+}
+
+#define INTC_IRQ_PINS_16H(p, base, vect, str)                          \
+                                                                       \
+static struct resource p ## _resources[] __initdata = {                        \
+       [0] = {                                                         \
+               .start  = base,                                         \
+               .end    = base + 0x64,                                  \
+               .flags  = IORESOURCE_MEM,                               \
+       },                                                              \
+};                                                                     \
+                                                                       \
+enum {                                                                 \
+       p ## _UNUSED = 0,                                               \
+       INTC_IRQ_PINS_ENUM_16H(p),                                      \
+};                                                                     \
+                                                                       \
+static struct intc_vect p ## _vectors[] __initdata = {                 \
+       INTC_IRQ_PINS_VECT_16H(p, vect),                                \
+};                                                                     \
+                                                                       \
+static struct intc_mask_reg p ## _mask_registers[] __initdata = {      \
+       INTC_IRQ_PINS_MASK_16H(p, base),                                \
+};                                                                     \
+                                                                       \
+static struct intc_prio_reg p ## _prio_registers[] __initdata = {      \
+       INTC_IRQ_PINS_PRIO_16H(p, base),                                \
+};                                                                     \
+                                                                       \
+static struct intc_sense_reg p ## _sense_registers[] __initdata = {    \
+       INTC_IRQ_PINS_SENSE_16H(p, base),                               \
+};                                                                     \
+                                                                       \
+static struct intc_mask_reg p ## _ack_registers[] __initdata = {       \
+       INTC_IRQ_PINS_ACK_16H(p, base),                                 \
+};                                                                     \
+                                                                       \
+static struct intc_desc p ## _desc __initdata = {                      \
+       .name = str,                                                    \
+       .resource = p ## _resources,                                    \
+       .num_resources = ARRAY_SIZE(p ## _resources),                   \
+       .hw = INTC_HW_DESC(p ## _vectors, NULL,                         \
+                            p ## _mask_registers, p ## _prio_registers, \
+                            p ## _sense_registers, p ## _ack_registers) \
+}
+
+#define INTC_IRQ_PINS_32(p, base, vect, str)                           \
+                                                                       \
+static struct resource p ## _resources[] __initdata = {                        \
+       [0] = {                                                         \
+               .start  = base,                                         \
+               .end    = base + 0x6c,                                  \
+               .flags  = IORESOURCE_MEM,                               \
+       },                                                              \
+};                                                                     \
+                                                                       \
+enum {                                                                 \
+       p ## _UNUSED = 0,                                               \
+       INTC_IRQ_PINS_ENUM_16L(p),                                      \
+       INTC_IRQ_PINS_ENUM_16H(p),                                      \
+};                                                                     \
+                                                                       \
+static struct intc_vect p ## _vectors[] __initdata = {                 \
+       INTC_IRQ_PINS_VECT_16L(p, vect),                                \
+       INTC_IRQ_PINS_VECT_16H(p, vect),                                \
+};                                                                     \
+                                                                       \
+static struct intc_mask_reg p ## _mask_registers[] __initdata = {      \
+       INTC_IRQ_PINS_MASK_16L(p, base),                                \
+       INTC_IRQ_PINS_MASK_16H(p, base),                                \
+};                                                                     \
+                                                                       \
+static struct intc_prio_reg p ## _prio_registers[] __initdata = {      \
+       INTC_IRQ_PINS_PRIO_16L(p, base),                                \
+       INTC_IRQ_PINS_PRIO_16H(p, base),                                \
+};                                                                     \
+                                                                       \
+static struct intc_sense_reg p ## _sense_registers[] __initdata = {    \
+       INTC_IRQ_PINS_SENSE_16L(p, base),                               \
+       INTC_IRQ_PINS_SENSE_16H(p, base),                               \
+};                                                                     \
+                                                                       \
+static struct intc_mask_reg p ## _ack_registers[] __initdata = {       \
+       INTC_IRQ_PINS_ACK_16L(p, base),                                 \
+       INTC_IRQ_PINS_ACK_16H(p, base),                                 \
+};                                                                     \
+                                                                       \
+static struct intc_desc p ## _desc __initdata = {                      \
+       .name = str,                                                    \
+       .resource = p ## _resources,                                    \
+       .num_resources = ARRAY_SIZE(p ## _resources),                   \
+       .hw = INTC_HW_DESC(p ## _vectors, NULL,                         \
+                            p ## _mask_registers, p ## _prio_registers, \
+                            p ## _sense_registers, p ## _ack_registers) \
+}
+
+#define INTC_PINT_E_EMPTY
+#define INTC_PINT_E_NONE 0, 0, 0, 0, 0, 0, 0, 0,
+#define INTC_PINT_E(p)                                                 \
+       PINT ## p ## 0, PINT ## p ## 1, PINT ## p ## 2, PINT ## p ## 3, \
+       PINT ## p ## 4, PINT ## p ## 5, PINT ## p ## 6, PINT ## p ## 7,
+
+#define INTC_PINT_V_NONE
+#define INTC_PINT_V(p, vect)                                   \
+       vect(PINT ## p ## 0, 0), vect(PINT ## p ## 1, 1),       \
+       vect(PINT ## p ## 2, 2), vect(PINT ## p ## 3, 3),       \
+       vect(PINT ## p ## 4, 4), vect(PINT ## p ## 5, 5),       \
+       vect(PINT ## p ## 6, 6), vect(PINT ## p ## 7, 7),
+
+#define INTC_PINT(p, mask_reg, sense_base, str,                                \
+       enums_1, enums_2, enums_3, enums_4,                             \
+       vect_1, vect_2, vect_3, vect_4,                                 \
+       mask_a, mask_b, mask_c, mask_d,                                 \
+       sense_a, sense_b, sense_c, sense_d)                             \
+                                                                       \
+enum {                                                                 \
+       PINT ## p ## _UNUSED = 0,                                       \
+       enums_1 enums_2 enums_3 enums_4                                 \
+};                                                                     \
+                                                                       \
+static struct intc_vect p ## _vectors[] __initdata = {                 \
+       vect_1 vect_2 vect_3 vect_4                                     \
+};                                                                     \
+                                                                       \
+static struct intc_mask_reg p ## _mask_registers[] __initdata = {      \
+       { mask_reg, 0, 32, /* PINTER */                                 \
+         { mask_a mask_b mask_c mask_d } }                             \
+};                                                                     \
+                                                                       \
+static struct intc_sense_reg p ## _sense_registers[] __initdata = {    \
+       { sense_base + 0x00, 16, 2, /* PINTCR */                        \
+         { sense_a } },                                                \
+       { sense_base + 0x04, 16, 2, /* PINTCR */                        \
+         { sense_b } },                                                \
+       { sense_base + 0x08, 16, 2, /* PINTCR */                        \
+         { sense_c } },                                                \
+       { sense_base + 0x0c, 16, 2, /* PINTCR */                        \
+         { sense_d } },                                                \
+};                                                                     \
+                                                                       \
+static struct intc_desc p ## _desc __initdata = {                      \
+       .name = str,                                                    \
+       .hw = INTC_HW_DESC(p ## _vectors, NULL,                         \
+                            p ## _mask_registers, NULL,                \
+                            p ## _sense_registers, NULL),              \
+}
+
+#endif  /* __ASM_MACH_INTC_H */
diff --git a/arch/arm/mach-shmobile/irqs.h b/arch/arm/mach-shmobile/irqs.h
new file mode 100644 (file)
index 0000000..4ff2d2a
--- /dev/null
@@ -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 */
index 8cb641c00fdb1f68b4ddd4cc3ad516a3bb994699..2c06810d3a70e5af46dc8adc06dea0d66d19114f 100644 (file)
@@ -7,27 +7,32 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+#include <linux/cpu_pm.h>
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/io.h>
 #include <linux/ioport.h>
 #include <linux/of_address.h>
 #include <linux/smp.h>
+#include <linux/suspend.h>
+#include <linux/threads.h>
 #include <asm/cacheflush.h>
 #include <asm/cp15.h>
+#include <asm/proc-fns.h>
 #include <asm/smp_plat.h>
-#include <mach/common.h>
+#include <asm/suspend.h>
+#include "common.h"
 
 static struct {
        void __iomem *iomem;
        int bit;
-} apmu_cpus[CONFIG_NR_CPUS];
+} apmu_cpus[NR_CPUS];
 
 #define WUPCR_OFFS 0x10
 #define PSTR_OFFS 0x40
 #define CPUNCR_OFFS(n) (0x100 + (0x10 * (n)))
 
-static int apmu_power_on(void __iomem *p, int bit)
+static int __maybe_unused apmu_power_on(void __iomem *p, int bit)
 {
        /* request power on */
        writel_relaxed(BIT(bit), p + WUPCR_OFFS);
@@ -46,7 +51,7 @@ static int apmu_power_off(void __iomem *p, int bit)
        return 0;
 }
 
-static int apmu_power_off_poll(void __iomem *p, int bit)
+static int __maybe_unused apmu_power_off_poll(void __iomem *p, int bit)
 {
        int k;
 
@@ -69,7 +74,7 @@ static int apmu_wrap(int cpu, int (*fn)(void __iomem *p, int cpu))
 
 static void apmu_init_cpu(struct resource *res, int cpu, int bit)
 {
-       if (apmu_cpus[cpu].iomem)
+       if ((cpu >= ARRAY_SIZE(apmu_cpus)) || apmu_cpus[cpu].iomem)
                return;
 
        apmu_cpus[cpu].iomem = ioremap_nocache(res->start, resource_size(res));
@@ -133,6 +138,7 @@ void __init shmobile_smp_apmu_prepare_cpus(unsigned int max_cpus)
        apmu_parse_cfg(apmu_init_cpu);
 }
 
+#ifdef CONFIG_SMP
 int shmobile_smp_apmu_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
        /* For this particular CPU register boot vector */
@@ -140,8 +146,9 @@ int shmobile_smp_apmu_boot_secondary(unsigned int cpu, struct task_struct *idle)
 
        return apmu_wrap(cpu, apmu_power_on);
 }
+#endif
 
-#ifdef CONFIG_HOTPLUG_CPU
+#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_SUSPEND)
 /* nicked from arch/arm/mach-exynos/hotplug.c */
 static inline void cpu_enter_lowpower_a15(void)
 {
@@ -172,16 +179,40 @@ static inline void cpu_enter_lowpower_a15(void)
        dsb();
 }
 
-void shmobile_smp_apmu_cpu_die(unsigned int cpu)
+void shmobile_smp_apmu_cpu_shutdown(unsigned int cpu)
 {
-       /* For this particular CPU deregister boot vector */
-       shmobile_smp_hook(cpu, 0, 0);
 
        /* Select next sleep mode using the APMU */
        apmu_wrap(cpu, apmu_power_off);
 
        /* Do ARM specific CPU shutdown */
        cpu_enter_lowpower_a15();
+}
+
+static inline void cpu_leave_lowpower(void)
+{
+       unsigned int v;
+
+       asm volatile("mrc    p15, 0, %0, c1, c0, 0\n"
+                    "       orr     %0, %0, %1\n"
+                    "       mcr     p15, 0, %0, c1, c0, 0\n"
+                    "       mrc     p15, 0, %0, c1, c0, 1\n"
+                    "       orr     %0, %0, %2\n"
+                    "       mcr     p15, 0, %0, c1, c0, 1\n"
+                    : "=&r" (v)
+                    : "Ir" (CR_C), "Ir" (0x40)
+                    : "cc");
+}
+#endif
+
+#if defined(CONFIG_HOTPLUG_CPU)
+void shmobile_smp_apmu_cpu_die(unsigned int cpu)
+{
+       /* For this particular CPU deregister boot vector */
+       shmobile_smp_hook(cpu, 0, 0);
+
+       /* Shutdown CPU core */
+       shmobile_smp_apmu_cpu_shutdown(cpu);
 
        /* jump to shared mach-shmobile sleep / reset code */
        shmobile_smp_sleep();
@@ -192,3 +223,25 @@ int shmobile_smp_apmu_cpu_kill(unsigned int cpu)
        return apmu_wrap(cpu, apmu_power_off_poll);
 }
 #endif
+
+#if defined(CONFIG_SUSPEND)
+static int shmobile_smp_apmu_do_suspend(unsigned long cpu)
+{
+       shmobile_smp_hook(cpu, virt_to_phys(cpu_resume), 0);
+       shmobile_smp_apmu_cpu_shutdown(cpu);
+       cpu_do_idle(); /* WFI selects Core Standby */
+       return 1;
+}
+
+static int shmobile_smp_apmu_enter_suspend(suspend_state_t state)
+{
+       cpu_suspend(smp_processor_id(), shmobile_smp_apmu_do_suspend);
+       cpu_leave_lowpower();
+       return 0;
+}
+
+void __init shmobile_smp_apmu_suspend_init(void)
+{
+       shmobile_suspend_ops.enter = shmobile_smp_apmu_enter_suspend;
+}
+#endif
index 673ad6e808694f1cab787fe6430090900efc8150..64663110ab6ca0e1d8f06cc04e69175165e2cace 100644 (file)
@@ -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)
index 9ebc246b8d7dd7fc46505ba40691a0ff8e4dbb4f..3923e09e966d5031cab8aa82fb304305c284e9ce 100644 (file)
@@ -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[];
index 40b87aa1d44859e1295451a944254254b77823c7..a0d44d537fa0bc87327e662cf74e3e8de0a02be0 100644 (file)
@@ -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)
index d6fe189b2df6e4176d343b33630085bff7d071c7..69f70b7f7fb2ee406bcf0b0d75fd16c7378aabf8 100644 (file)
 #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"
+#include "r8a7779.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)
index fc82839e2c2a1b68e4adaa31f1fe5db1b68cc963..80e8d95e54d3b8846c52f91c0d2d89f1907d6a39 100644 (file)
  */
 
 #include <linux/kernel.h>
+#include <linux/smp.h>
 #include <asm/io.h>
-#include <mach/pm-rcar.h>
-#include <mach/r8a7790.h>
+#include "common.h"
+#include "pm-rcar.h"
+#include "r8a7790.h"
+
+/* RST */
+#define RST            0xe6160000
+#define CA15BAR                0x0020
+#define CA7BAR         0x0030
+#define CA15RESCNT     0x0040
+#define CA7RESCNT      0x0044
+
+/* On-chip RAM */
+#define MERAM          0xe8080000
 
 /* SYSC */
 #define SYSCIER 0x0c
@@ -38,8 +50,33 @@ static inline void r8a7790_sysc_init(void) {}
 
 void __init r8a7790_pm_init(void)
 {
+       void __iomem *p;
+       u32 bar;
        static int once;
 
-       if (!once++)
-               r8a7790_sysc_init();
+       if (once++)
+               return;
+
+       /* MERAM for jump stub, because BAR requires 256KB aligned address */
+       p = ioremap_nocache(MERAM, shmobile_boot_size);
+       memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size);
+       iounmap(p);
+
+       /* setup reset vectors */
+       p = ioremap_nocache(RST, 0x63);
+       bar = (MERAM >> 8) & 0xfffffc00;
+       writel_relaxed(bar, p + CA15BAR);
+       writel_relaxed(bar, p + CA7BAR);
+       writel_relaxed(bar | 0x10, p + CA15BAR);
+       writel_relaxed(bar | 0x10, p + CA7BAR);
+
+       /* de-assert reset for all CPUs */
+       writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | 0xa5a50000,
+                      p + CA15RESCNT);
+       writel_relaxed((readl_relaxed(p + CA7RESCNT) & ~0x0f) | 0x5a5a0000,
+                      p + CA7RESCNT);
+       iounmap(p);
+
+       r8a7790_sysc_init();
+       shmobile_smp_apmu_suspend_init();
 }
diff --git a/arch/arm/mach-shmobile/pm-r8a7791.c b/arch/arm/mach-shmobile/pm-r8a7791.c
new file mode 100644 (file)
index 0000000..25f107b
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * r8a7791 Power management support
+ *
+ * Copyright (C) 2014  Renesas Electronics Corporation
+ * Copyright (C) 2011  Renesas Solutions Corp.
+ * Copyright (C) 2011  Magnus Damm
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+#include <linux/kernel.h>
+#include <linux/smp.h>
+#include <asm/io.h>
+#include "common.h"
+#include "pm-rcar.h"
+#include "r8a7791.h"
+
+#define RST            0xe6160000
+#define CA15BAR                0x0020
+#define CA15RESCNT     0x0040
+#define RAM            0xe6300000
+
+/* SYSC */
+#define SYSCIER 0x0c
+#define SYSCIMR 0x10
+
+#if defined(CONFIG_SMP)
+
+static void __init r8a7791_sysc_init(void)
+{
+       void __iomem *base = rcar_sysc_init(0xe6180000);
+
+       /* enable all interrupt sources, but do not use interrupt handler */
+       iowrite32(0x0131000e, base + SYSCIER);
+       iowrite32(0, base + SYSCIMR);
+}
+
+#else /* CONFIG_SMP */
+
+static inline void r8a7791_sysc_init(void) {}
+
+#endif /* CONFIG_SMP */
+
+void __init r8a7791_pm_init(void)
+{
+       void __iomem *p;
+       u32 bar;
+       static int once;
+
+       if (once++)
+               return;
+
+       /* RAM for jump stub, because BAR requires 256KB aligned address */
+       p = ioremap_nocache(RAM, shmobile_boot_size);
+       memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size);
+       iounmap(p);
+
+       /* setup reset vectors */
+       p = ioremap_nocache(RST, 0x63);
+       bar = (RAM >> 8) & 0xfffffc00;
+       writel_relaxed(bar, p + CA15BAR);
+       writel_relaxed(bar | 0x10, p + CA15BAR);
+
+       /* enable clocks to all CPUs */
+       writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | 0xa5a50000,
+                      p + CA15RESCNT);
+       iounmap(p);
+
+       r8a7791_sysc_init();
+       shmobile_smp_apmu_suspend_init();
+}
index 1f465a12d1b1932422935e35a1c8f3f7bb2a4b1b..34b8a5674f85e9d9c7437be76f243026269b2857 100644 (file)
@@ -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/pm-rcar.h b/arch/arm/mach-shmobile/pm-rcar.h
new file mode 100644 (file)
index 0000000..ef3a1ef
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef PM_RCAR_H
+#define PM_RCAR_H
+
+struct rcar_sysc_ch {
+       unsigned long chan_offs;
+       unsigned int chan_bit;
+       unsigned int isr_bit;
+};
+
+int rcar_sysc_power_down(struct rcar_sysc_ch *sysc_ch);
+int rcar_sysc_power_up(struct rcar_sysc_ch *sysc_ch);
+bool rcar_sysc_power_is_off(struct rcar_sysc_ch *sysc_ch);
+void __iomem *rcar_sysc_init(phys_addr_t base);
+
+#endif /* PM_RCAR_H */
index f710235aff2fad5addfb2f0a65363ccf26bfa93f..ebdd16e94a84f5d674f691edfc99e6712d7cee28 100644 (file)
@@ -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/pm-rmobile.h b/arch/arm/mach-shmobile/pm-rmobile.h
new file mode 100644 (file)
index 0000000..690553a
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2012 Renesas Solutions Corp.
+ *
+ * Kuninori Morimoto <morimoto.kuninori@renesas.com>
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#ifndef PM_RMOBILE_H
+#define PM_RMOBILE_H
+
+#include <linux/pm_domain.h>
+
+#define DEFAULT_DEV_LATENCY_NS 250000
+
+struct platform_device;
+
+struct rmobile_pm_domain {
+       struct generic_pm_domain genpd;
+       struct dev_power_governor *gov;
+       int (*suspend)(void);
+       void (*resume)(void);
+       unsigned int bit_shift;
+       bool no_debug;
+};
+
+static inline
+struct rmobile_pm_domain *to_rmobile_pd(struct generic_pm_domain *d)
+{
+       return container_of(d, struct rmobile_pm_domain, genpd);
+}
+
+struct pm_domain_device {
+       const char *domain_name;
+       struct platform_device *pdev;
+};
+
+#ifdef CONFIG_PM
+extern void rmobile_init_domains(struct rmobile_pm_domain domains[], int num);
+extern void rmobile_add_device_to_domain_td(const char *domain_name,
+                                           struct platform_device *pdev,
+                                           struct gpd_timing_data *td);
+
+static inline void rmobile_add_device_to_domain(const char *domain_name,
+                                               struct platform_device *pdev)
+{
+       rmobile_add_device_to_domain_td(domain_name, pdev, NULL);
+}
+
+extern void rmobile_add_devices_to_domains(struct pm_domain_device data[],
+                                          int size);
+#else
+
+#define rmobile_init_domains(domains, num) do { } while (0)
+#define rmobile_add_device_to_domain_td(name, pdev, td) do { } while (0)
+#define rmobile_add_device_to_domain(name, pdev) do { } while (0)
+
+static inline void rmobile_add_devices_to_domains(struct pm_domain_device d[],
+                                                 int size) {}
+#endif /* CONFIG_PM */
+
+#endif /* PM_RMOBILE_H */
index 0de75fd394b9cb654470a591dbb9ec08d0c6d361..7e5c2676c48902f17138c242c0cd097a28d4044c 100644 (file)
 #include <linux/irq.h>
 #include <linux/bitrev.h>
 #include <linux/console.h>
+
 #include <asm/cpuidle.h>
 #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"
+#include "sh7372.h"
 
 /* DBG */
 #define DBGREG1 IOMEM(0xe6100020)
index 99086e98fbbc66d621132cb3a6dcd07dee36bc51..a7e466817965e3b8d974ccc5af166226bef7e048 100644 (file)
@@ -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/r7s72100.h b/arch/arm/mach-shmobile/r7s72100.h
new file mode 100644 (file)
index 0000000..efb723c
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef __ASM_R7S72100_H__
+#define __ASM_R7S72100_H__
+
+void r7s72100_add_dt_devices(void);
+void r7s72100_clock_init(void);
+
+#endif /* __ASM_R7S72100_H__ */
diff --git a/arch/arm/mach-shmobile/r8a73a4.h b/arch/arm/mach-shmobile/r8a73a4.h
new file mode 100644 (file)
index 0000000..ce8bdd1
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef __ASM_R8A73A4_H__
+#define __ASM_R8A73A4_H__
+
+/* DMA slave IDs */
+enum {
+       SHDMA_SLAVE_INVALID,
+       SHDMA_SLAVE_MMCIF0_TX,
+       SHDMA_SLAVE_MMCIF0_RX,
+       SHDMA_SLAVE_MMCIF1_TX,
+       SHDMA_SLAVE_MMCIF1_RX,
+};
+
+void r8a73a4_add_standard_devices(void);
+void r8a73a4_add_dt_devices(void);
+void r8a73a4_clock_init(void);
+void r8a73a4_pinmux_init(void);
+void r8a73a4_init_early(void);
+
+#endif /* __ASM_R8A73A4_H__ */
diff --git a/arch/arm/mach-shmobile/r8a7740.h b/arch/arm/mach-shmobile/r8a7740.h
new file mode 100644 (file)
index 0000000..1d1a5fd
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2011  Renesas Solutions Corp.
+ * Copyright (C) 2011  Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef __ASM_R8A7740_H__
+#define __ASM_R8A7740_H__
+
+/*
+ * MD_CKx pin
+ */
+#define MD_CK2 (1 << 2)
+#define MD_CK1 (1 << 1)
+#define MD_CK0 (1 << 0)
+
+/* DMA slave IDs */
+enum {
+       SHDMA_SLAVE_INVALID,
+       SHDMA_SLAVE_SDHI0_RX,
+       SHDMA_SLAVE_SDHI0_TX,
+       SHDMA_SLAVE_SDHI1_RX,
+       SHDMA_SLAVE_SDHI1_TX,
+       SHDMA_SLAVE_SDHI2_RX,
+       SHDMA_SLAVE_SDHI2_TX,
+       SHDMA_SLAVE_FSIA_RX,
+       SHDMA_SLAVE_FSIA_TX,
+       SHDMA_SLAVE_FSIB_TX,
+       SHDMA_SLAVE_USBHS_TX,
+       SHDMA_SLAVE_USBHS_RX,
+       SHDMA_SLAVE_MMCIF_TX,
+       SHDMA_SLAVE_MMCIF_RX,
+};
+
+extern void r8a7740_meram_workaround(void);
+extern void r8a7740_init_irq_of(void);
+extern void r8a7740_map_io(void);
+extern void r8a7740_add_early_devices(void);
+extern void r8a7740_add_standard_devices(void);
+extern void r8a7740_add_standard_devices_dt(void);
+extern void r8a7740_clock_init(u8 md_ck);
+extern void r8a7740_pinmux_init(void);
+extern void r8a7740_pm_init(void);
+
+#ifdef CONFIG_PM
+extern void __init r8a7740_init_pm_domains(void);
+#else
+static inline void r8a7740_init_pm_domains(void) {}
+#endif /* CONFIG_PM */
+
+#endif /* __ASM_R8A7740_H__ */
diff --git a/arch/arm/mach-shmobile/r8a7778.h b/arch/arm/mach-shmobile/r8a7778.h
new file mode 100644 (file)
index 0000000..f4076a5
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2013  Renesas Solutions Corp.
+ * Copyright (C) 2013  Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+ * Copyright (C) 2013  Cogent Embedded, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#ifndef __ASM_R8A7778_H__
+#define __ASM_R8A7778_H__
+
+#include <linux/sh_eth.h>
+
+/* HPB-DMA slave IDs */
+enum {
+       HPBDMA_SLAVE_DUMMY,
+       HPBDMA_SLAVE_SDHI0_TX,
+       HPBDMA_SLAVE_SDHI0_RX,
+       HPBDMA_SLAVE_SSI0_TX,
+       HPBDMA_SLAVE_SSI0_RX,
+       HPBDMA_SLAVE_SSI1_TX,
+       HPBDMA_SLAVE_SSI1_RX,
+       HPBDMA_SLAVE_SSI2_TX,
+       HPBDMA_SLAVE_SSI2_RX,
+       HPBDMA_SLAVE_SSI3_TX,
+       HPBDMA_SLAVE_SSI3_RX,
+       HPBDMA_SLAVE_SSI4_TX,
+       HPBDMA_SLAVE_SSI4_RX,
+       HPBDMA_SLAVE_SSI5_TX,
+       HPBDMA_SLAVE_SSI5_RX,
+       HPBDMA_SLAVE_SSI6_TX,
+       HPBDMA_SLAVE_SSI6_RX,
+       HPBDMA_SLAVE_SSI7_TX,
+       HPBDMA_SLAVE_SSI7_RX,
+       HPBDMA_SLAVE_SSI8_TX,
+       HPBDMA_SLAVE_SSI8_RX,
+       HPBDMA_SLAVE_HPBIF0_TX,
+       HPBDMA_SLAVE_HPBIF0_RX,
+       HPBDMA_SLAVE_HPBIF1_TX,
+       HPBDMA_SLAVE_HPBIF1_RX,
+       HPBDMA_SLAVE_HPBIF2_TX,
+       HPBDMA_SLAVE_HPBIF2_RX,
+       HPBDMA_SLAVE_HPBIF3_TX,
+       HPBDMA_SLAVE_HPBIF3_RX,
+       HPBDMA_SLAVE_HPBIF4_TX,
+       HPBDMA_SLAVE_HPBIF4_RX,
+       HPBDMA_SLAVE_HPBIF5_TX,
+       HPBDMA_SLAVE_HPBIF5_RX,
+       HPBDMA_SLAVE_HPBIF6_TX,
+       HPBDMA_SLAVE_HPBIF6_RX,
+       HPBDMA_SLAVE_HPBIF7_TX,
+       HPBDMA_SLAVE_HPBIF7_RX,
+       HPBDMA_SLAVE_HPBIF8_TX,
+       HPBDMA_SLAVE_HPBIF8_RX,
+       HPBDMA_SLAVE_USBFUNC_TX,
+       HPBDMA_SLAVE_USBFUNC_RX,
+};
+
+extern void r8a7778_add_standard_devices(void);
+extern void r8a7778_add_standard_devices_dt(void);
+extern void r8a7778_add_dt_devices(void);
+
+extern void r8a7778_init_late(void);
+extern void r8a7778_init_delay(void);
+extern void r8a7778_init_irq_dt(void);
+extern void r8a7778_clock_init(void);
+extern void r8a7778_init_irq_extpin(int irlm);
+extern void r8a7778_init_irq_extpin_dt(int irlm);
+extern void r8a7778_pinmux_init(void);
+
+extern int r8a7778_usb_phy_power(bool enable);
+
+#endif /* __ASM_R8A7778_H__ */
diff --git a/arch/arm/mach-shmobile/r8a7779.h b/arch/arm/mach-shmobile/r8a7779.h
new file mode 100644 (file)
index 0000000..5415c71
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef __ASM_R8A7779_H__
+#define __ASM_R8A7779_H__
+
+#include <linux/sh_clk.h>
+
+/* HPB-DMA slave IDs */
+enum {
+       HPBDMA_SLAVE_DUMMY,
+       HPBDMA_SLAVE_SDHI0_TX,
+       HPBDMA_SLAVE_SDHI0_RX,
+};
+
+extern void r8a7779_init_irq_extpin(int irlm);
+extern void r8a7779_init_irq_extpin_dt(int irlm);
+extern void r8a7779_init_irq_dt(void);
+extern void r8a7779_map_io(void);
+extern void r8a7779_earlytimer_init(void);
+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);
+extern void r8a7779_register_twd(void);
+
+#ifdef CONFIG_PM
+extern void __init r8a7779_init_pm_domains(void);
+#else
+static inline void r8a7779_init_pm_domains(void) {}
+#endif /* CONFIG_PM */
+
+extern struct smp_operations r8a7779_smp_ops;
+
+#endif /* __ASM_R8A7779_H__ */
diff --git a/arch/arm/mach-shmobile/r8a7790.h b/arch/arm/mach-shmobile/r8a7790.h
new file mode 100644 (file)
index 0000000..459827f
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef __ASM_R8A7790_H__
+#define __ASM_R8A7790_H__
+
+/* DMA slave IDs */
+enum {
+       RCAR_DMA_SLAVE_INVALID,
+       AUDIO_DMAC_SLAVE_SSI0_TX,
+       AUDIO_DMAC_SLAVE_SSI0_RX,
+       AUDIO_DMAC_SLAVE_SSI1_TX,
+       AUDIO_DMAC_SLAVE_SSI1_RX,
+       AUDIO_DMAC_SLAVE_SSI2_TX,
+       AUDIO_DMAC_SLAVE_SSI2_RX,
+       AUDIO_DMAC_SLAVE_SSI3_TX,
+       AUDIO_DMAC_SLAVE_SSI3_RX,
+       AUDIO_DMAC_SLAVE_SSI4_TX,
+       AUDIO_DMAC_SLAVE_SSI4_RX,
+       AUDIO_DMAC_SLAVE_SSI5_TX,
+       AUDIO_DMAC_SLAVE_SSI5_RX,
+       AUDIO_DMAC_SLAVE_SSI6_TX,
+       AUDIO_DMAC_SLAVE_SSI6_RX,
+       AUDIO_DMAC_SLAVE_SSI7_TX,
+       AUDIO_DMAC_SLAVE_SSI7_RX,
+       AUDIO_DMAC_SLAVE_SSI8_TX,
+       AUDIO_DMAC_SLAVE_SSI8_RX,
+       AUDIO_DMAC_SLAVE_SSI9_TX,
+       AUDIO_DMAC_SLAVE_SSI9_RX,
+};
+
+void r8a7790_add_standard_devices(void);
+void r8a7790_add_dt_devices(void);
+void r8a7790_clock_init(void);
+void r8a7790_pinmux_init(void);
+void r8a7790_pm_init(void);
+extern struct smp_operations r8a7790_smp_ops;
+
+#endif /* __ASM_R8A7790_H__ */
diff --git a/arch/arm/mach-shmobile/r8a7791.h b/arch/arm/mach-shmobile/r8a7791.h
new file mode 100644 (file)
index 0000000..86eae7b
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef __ASM_R8A7791_H__
+#define __ASM_R8A7791_H__
+
+void r8a7791_add_standard_devices(void);
+void r8a7791_add_dt_devices(void);
+void r8a7791_clock_init(void);
+void r8a7791_pinmux_init(void);
+void r8a7791_pm_init(void);
+extern struct smp_operations r8a7791_smp_ops;
+
+#endif /* __ASM_R8A7791_H__ */
diff --git a/arch/arm/mach-shmobile/rcar-gen2.h b/arch/arm/mach-shmobile/rcar-gen2.h
new file mode 100644 (file)
index 0000000..ce53cb5
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef __ASM_RCAR_GEN2_H__
+#define __ASM_RCAR_GEN2_H__
+
+void rcar_gen2_timer_init(void);
+#define MD(nr) BIT(nr)
+u32 rcar_gen2_read_mode_pins(void);
+void rcar_gen2_reserve(void);
+
+#endif /* __ASM_RCAR_GEN2_H__ */
index d953ff6e78a29d884754548f9ea6af974ae74b20..b06a9e8f59a5fb7a232f00a747e1715bc23b5a71 100644 (file)
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include <linux/clk-provider.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/of_platform.h>
-#include <mach/common.h>
+#include <linux/mm.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
@@ -42,17 +41,6 @@ static void __init emev2_map_io(void)
        iotable_init(emev2_io_desc, ARRAY_SIZE(emev2_io_desc));
 }
 
-static void __init emev2_init_delay(void)
-{
-       shmobile_setup_delay(533, 1, 3); /* Cortex-A9 @ 533MHz */
-}
-
-static void __init emev2_add_standard_devices_dt(void)
-{
-       of_clk_init(NULL);
-       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
-}
-
 static const char *emev2_boards_compat_dt[] __initconst = {
        "renesas,emev2",
        NULL,
@@ -63,8 +51,7 @@ extern struct smp_operations emev2_smp_ops;
 DT_MACHINE_START(EMEV2_DT, "Generic Emma Mobile EV2 (Flattened Device Tree)")
        .smp            = smp_ops(emev2_smp_ops),
        .map_io         = emev2_map_io,
-       .init_early     = emev2_init_delay,
-       .init_machine   = emev2_add_standard_devices_dt,
+       .init_early     = shmobile_init_delay,
        .init_late      = shmobile_init_late,
        .dt_compat      = emev2_boards_compat_dt,
 MACHINE_END
index 412e179429cd7d28f35e6603685c4419d4307374..4a98b232d3161d25afd53f83cef3d39c5029551b 100644 (file)
 #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"
+#include "r7s72100.h"
+
 static struct resource mtu2_resources[] __initdata = {
        DEFINE_RES_MEM(0xfcff0000, 0x400),
        DEFINE_RES_IRQ_NAMED(gic_iid(139), "tgi0a"),
@@ -43,11 +45,6 @@ void __init r7s72100_add_dt_devices(void)
        r7s72100_register_mtu2();
 }
 
-void __init r7s72100_init_early(void)
-{
-       shmobile_setup_delay(400, 1, 3); /* Cortex-A9 @ 400MHz */
-}
-
 #ifdef CONFIG_USE_OF
 static const char *r7s72100_boards_compat_dt[] __initdata = {
        "renesas,r7s72100",
@@ -55,7 +52,7 @@ static const char *r7s72100_boards_compat_dt[] __initdata = {
 };
 
 DT_MACHINE_START(R7S72100_DT, "Generic R7S72100 (Flattened Device Tree)")
-       .init_early     = r7s72100_init_early,
+       .init_early     = shmobile_init_delay,
        .dt_compat      = r7s72100_boards_compat_dt,
 MACHINE_END
 #endif /* CONFIG_USE_OF */
index 9333770cfac2eed4e14787a4f60d6c1d7a6f4657..f470b3cc0b7b8b2959fbb351bf8c8bc08a9903d8 100644 (file)
 #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"
+#include "r8a73a4.h"
+
 static const struct resource pfc_resources[] = {
        DEFINE_RES_MEM(0xe6050000, 0x9000),
 };
index 35dec233301e9711e7a612e537c8a85aa260307c..348af358a239dc6c31e08a1e497eca965fe17695 100644 (file)
 #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"
+#include "r8a7740.h"
+
 static struct map_desc r8a7740_io_desc[] __initdata = {
         /*
          * for CPGA/INTC/PFC
index d311ef903b393603d4e15a3f38b074142d4bbf33..2ccc0128b469b30a9a7070ab5008975d442f8f05 100644 (file)
 #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"
+#include "r8a7778.h"
+
 /* SCIF */
 #define R8A7778_SCIF(index, baseaddr, irq)                     \
 static struct plat_sci_port scif##index##_platform_data = {    \
index aba4ed652d5413024fd59841443f78ed012cf7a6..8dbc407f4c8d7a3ffedfe360244cebb431b2e7f6 100644 (file)
 #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"
+#include "r8a7779.h"
+
 static struct map_desc r8a7779_io_desc[] __initdata = {
        /* 2M entity map for 0xf0000000 (MPCORE) */
        {
@@ -640,16 +642,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 +676,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 +739,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 +770,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,
index 6bd08b127fa4edce8f457ed3af91c5c8de8b6686..c37d82d38617ff9685e2480e5c0d426e5c2fe08b 100644 (file)
 #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 "r8a7790.h"
+#include "rcar-gen2.h"
+
 /* Audio-DMAC */
 #define AUDIO_DMAC_SLAVE(_id, _addr, t, r)                     \
 {                                                              \
@@ -307,13 +310,6 @@ void __init r8a7790_add_standard_devices(void)
        r8a7790_register_audio_dmac(1);
 }
 
-void __init r8a7790_init_early(void)
-{
-#ifndef CONFIG_ARM_ARCH_TIMER
-       shmobile_setup_delay(1300, 2, 4); /* Cortex-A15 @ 1300MHz */
-#endif
-}
-
 #ifdef CONFIG_USE_OF
 
 static const char * const r8a7790_boards_compat_dt[] __initconst = {
@@ -323,8 +319,10 @@ static const char * const r8a7790_boards_compat_dt[] __initconst = {
 
 DT_MACHINE_START(R8A7790_DT, "Generic R8A7790 (Flattened Device Tree)")
        .smp            = smp_ops(r8a7790_smp_ops),
-       .init_early     = r8a7790_init_early,
+       .init_early     = shmobile_init_delay,
        .init_time      = rcar_gen2_timer_init,
+       .init_late      = shmobile_init_late,
+       .reserve        = rcar_gen2_reserve,
        .dt_compat      = r8a7790_boards_compat_dt,
 MACHINE_END
 #endif /* CONFIG_USE_OF */
index 04a96ddb32241ddede0a5c43f3bb085339b500c4..8823324ac5a9753b59403bbd6d9a09961ec93f29 100644 (file)
 #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 "r8a7791.h"
+#include "rcar-gen2.h"
+
 static const struct resource pfc_resources[] __initconst = {
        DEFINE_RES_MEM(0xe6060000, 0x250),
 };
@@ -217,6 +219,8 @@ DT_MACHINE_START(R8A7791_DT, "Generic R8A7791 (Flattened Device Tree)")
        .smp            = smp_ops(r8a7791_smp_ops),
        .init_early     = shmobile_init_delay,
        .init_time      = rcar_gen2_timer_init,
+       .init_late      = shmobile_init_late,
+       .reserve        = rcar_gen2_reserve,
        .dt_compat      = r8a7791_boards_compat_dt,
 MACHINE_END
 #endif /* CONFIG_USE_OF */
index 542c5a47173f9e8a9794a07d39b765704b9c0d75..42d5b43089235375e1a1d75b440a32d8940ac1ed 100644 (file)
 
 #include <linux/clk/shmobile.h>
 #include <linux/clocksource.h>
+#include <linux/device.h>
+#include <linux/dma-contiguous.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
-#include <mach/common.h>
-#include <mach/rcar-gen2.h>
+#include <linux/of_fdt.h>
 #include <asm/mach/arch.h>
+#include "common.h"
+#include "rcar-gen2.h"
 
 #define MODEMR 0xe6160060
 
@@ -110,3 +113,72 @@ void __init rcar_gen2_timer_init(void)
 #endif
        clocksource_of_init();
 }
+
+struct memory_reserve_config {
+       u64 reserved;
+       u64 base, size;
+};
+
+static int __init rcar_gen2_scan_mem(unsigned long node, const char *uname,
+                                    int depth, void *data)
+{
+       const char *type = of_get_flat_dt_prop(node, "device_type", NULL);
+       const __be32 *reg, *endp;
+       int l;
+       struct memory_reserve_config *mrc = data;
+       u64 lpae_start = 1ULL << 32;
+
+       /* We are scanning "memory" nodes only */
+       if (type == NULL || strcmp(type, "memory"))
+               return 0;
+
+       reg = of_get_flat_dt_prop(node, "linux,usable-memory", &l);
+       if (reg == NULL)
+               reg = of_get_flat_dt_prop(node, "reg", &l);
+       if (reg == NULL)
+               return 0;
+
+       endp = reg + (l / sizeof(__be32));
+       while ((endp - reg) >= (dt_root_addr_cells + dt_root_size_cells)) {
+               u64 base, size;
+
+               base = dt_mem_next_cell(dt_root_addr_cells, &reg);
+               size = dt_mem_next_cell(dt_root_size_cells, &reg);
+
+               if (base >= lpae_start)
+                       continue;
+
+               if ((base + size) >= lpae_start)
+                       size = lpae_start - base;
+
+               if (size < mrc->reserved)
+                       continue;
+
+               if (base < mrc->base)
+                       continue;
+
+               /* keep the area at top near the 32-bit legacy limit */
+               mrc->base = base + size - mrc->reserved;
+               mrc->size = mrc->reserved;
+       }
+
+       return 0;
+}
+
+struct cma *rcar_gen2_dma_contiguous;
+
+void __init rcar_gen2_reserve(void)
+{
+       struct memory_reserve_config mrc;
+
+       /* reserve 256 MiB at the top of the physical legacy 32-bit space */
+       memset(&mrc, 0, sizeof(mrc));
+       mrc.reserved = SZ_256M;
+
+       of_scan_flat_dt(rcar_gen2_scan_mem, &mrc);
+#ifdef CONFIG_DMA_CMA
+       if (mrc.size)
+               dma_contiguous_reserve_area(mrc.size, mrc.base, 0,
+                                           &rcar_gen2_dma_contiguous, true);
+#endif
+}
index 2a8b9f2a2f549e1737aa8040e9ce5e4e90ac7b80..9cdfcdfd38fc4b6625a96f1515e7ce0e9834f988 100644 (file)
 #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"
+#include "sh7372.h"
+
 static struct map_desc sh7372_io_desc[] __initdata = {
        /* create a 1:1 entity map for 0xe6xxxxxx
         * used by CPGA, INTC and PFC.
index ad00724a2269ffd5ce8daa68c5a829a5473bf7b1..2248821516678d611731767b16e6e24c775a11b0 100644 (file)
 #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"
+#include "sh73a0.h"
+
 static struct map_desc sh73a0_io_desc[] __initdata = {
        /* create a 1:1 entity map for 0xe6xxxxxx
         * used by CPGA, INTC and PFC.
diff --git a/arch/arm/mach-shmobile/sh7372.h b/arch/arm/mach-shmobile/sh7372.h
new file mode 100644 (file)
index 0000000..4ad960d
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2010 Renesas Solutions Corp.
+ *
+ * Kuninori Morimoto <morimoto.kuninori@renesas.com>
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+#ifndef __ASM_SH7372_H__
+#define __ASM_SH7372_H__
+
+/* DMA slave IDs */
+enum {
+       SHDMA_SLAVE_INVALID,
+       SHDMA_SLAVE_SCIF0_TX,
+       SHDMA_SLAVE_SCIF0_RX,
+       SHDMA_SLAVE_SCIF1_TX,
+       SHDMA_SLAVE_SCIF1_RX,
+       SHDMA_SLAVE_SCIF2_TX,
+       SHDMA_SLAVE_SCIF2_RX,
+       SHDMA_SLAVE_SCIF3_TX,
+       SHDMA_SLAVE_SCIF3_RX,
+       SHDMA_SLAVE_SCIF4_TX,
+       SHDMA_SLAVE_SCIF4_RX,
+       SHDMA_SLAVE_SCIF5_TX,
+       SHDMA_SLAVE_SCIF5_RX,
+       SHDMA_SLAVE_SCIF6_TX,
+       SHDMA_SLAVE_SCIF6_RX,
+       SHDMA_SLAVE_FLCTL0_TX,
+       SHDMA_SLAVE_FLCTL0_RX,
+       SHDMA_SLAVE_FLCTL1_TX,
+       SHDMA_SLAVE_FLCTL1_RX,
+       SHDMA_SLAVE_SDHI0_RX,
+       SHDMA_SLAVE_SDHI0_TX,
+       SHDMA_SLAVE_SDHI1_RX,
+       SHDMA_SLAVE_SDHI1_TX,
+       SHDMA_SLAVE_SDHI2_RX,
+       SHDMA_SLAVE_SDHI2_TX,
+       SHDMA_SLAVE_FSIA_RX,
+       SHDMA_SLAVE_FSIA_TX,
+       SHDMA_SLAVE_MMCIF_RX,
+       SHDMA_SLAVE_MMCIF_TX,
+       SHDMA_SLAVE_USB0_TX,
+       SHDMA_SLAVE_USB0_RX,
+       SHDMA_SLAVE_USB1_TX,
+       SHDMA_SLAVE_USB1_RX,
+};
+
+extern struct clk sh7372_extal1_clk;
+extern struct clk sh7372_extal2_clk;
+extern struct clk sh7372_dv_clki_clk;
+extern struct clk sh7372_dv_clki_div2_clk;
+extern struct clk sh7372_pllc2_clk;
+
+extern void sh7372_init_irq(void);
+extern void sh7372_map_io(void);
+extern void sh7372_earlytimer_init(void);
+extern void sh7372_add_early_devices(void);
+extern void sh7372_add_standard_devices(void);
+extern void sh7372_add_early_devices_dt(void);
+extern void sh7372_add_standard_devices_dt(void);
+extern void sh7372_clock_init(void);
+extern void sh7372_pinmux_init(void);
+extern void sh7372_pm_init(void);
+extern void sh7372_resume_core_standby_sysc(void);
+extern int  sh7372_do_idle_sysc(unsigned long sleep_mode);
+extern void sh7372_intcs_suspend(void);
+extern void sh7372_intcs_resume(void);
+extern void sh7372_intca_suspend(void);
+extern void sh7372_intca_resume(void);
+
+extern unsigned long sh7372_cpu_resume;
+
+#ifdef CONFIG_PM
+extern void __init sh7372_init_pm_domains(void);
+#else
+static inline void sh7372_init_pm_domains(void) {}
+#endif
+
+extern void __init sh7372_pm_init_late(void);
+
+#endif /* __ASM_SH7372_H__ */
diff --git a/arch/arm/mach-shmobile/sh73a0.h b/arch/arm/mach-shmobile/sh73a0.h
new file mode 100644 (file)
index 0000000..359b582
--- /dev/null
@@ -0,0 +1,91 @@
+#ifndef __ASM_SH73A0_H__
+#define __ASM_SH73A0_H__
+
+/* DMA slave IDs */
+enum {
+       SHDMA_SLAVE_INVALID,
+       SHDMA_SLAVE_SCIF0_TX,
+       SHDMA_SLAVE_SCIF0_RX,
+       SHDMA_SLAVE_SCIF1_TX,
+       SHDMA_SLAVE_SCIF1_RX,
+       SHDMA_SLAVE_SCIF2_TX,
+       SHDMA_SLAVE_SCIF2_RX,
+       SHDMA_SLAVE_SCIF3_TX,
+       SHDMA_SLAVE_SCIF3_RX,
+       SHDMA_SLAVE_SCIF4_TX,
+       SHDMA_SLAVE_SCIF4_RX,
+       SHDMA_SLAVE_SCIF5_TX,
+       SHDMA_SLAVE_SCIF5_RX,
+       SHDMA_SLAVE_SCIF6_TX,
+       SHDMA_SLAVE_SCIF6_RX,
+       SHDMA_SLAVE_SCIF7_TX,
+       SHDMA_SLAVE_SCIF7_RX,
+       SHDMA_SLAVE_SCIF8_TX,
+       SHDMA_SLAVE_SCIF8_RX,
+       SHDMA_SLAVE_SDHI0_TX,
+       SHDMA_SLAVE_SDHI0_RX,
+       SHDMA_SLAVE_SDHI1_TX,
+       SHDMA_SLAVE_SDHI1_RX,
+       SHDMA_SLAVE_SDHI2_TX,
+       SHDMA_SLAVE_SDHI2_RX,
+       SHDMA_SLAVE_MMCIF_TX,
+       SHDMA_SLAVE_MMCIF_RX,
+       SHDMA_SLAVE_FSI2A_TX,
+       SHDMA_SLAVE_FSI2A_RX,
+       SHDMA_SLAVE_FSI2B_TX,
+       SHDMA_SLAVE_FSI2B_RX,
+       SHDMA_SLAVE_FSI2C_TX,
+       SHDMA_SLAVE_FSI2C_RX,
+       SHDMA_SLAVE_FSI2D_RX,
+};
+
+/*
+ *             SH73A0 IRQ LOCATION TABLE
+ *
+ * 416 -----------------------------------------
+ *             IRQ0-IRQ15
+ * 431 -----------------------------------------
+ * ...
+ * 448 -----------------------------------------
+ *             sh73a0-intcs
+ *             sh73a0-intca-irq-pins
+ * 680 -----------------------------------------
+ * ...
+ * 700 -----------------------------------------
+ *             sh73a0-pint0
+ * 731 -----------------------------------------
+ * 732 -----------------------------------------
+ *             sh73a0-pint1
+ * 739 -----------------------------------------
+ * ...
+ * 800 -----------------------------------------
+ *             IRQ16-IRQ31
+ * 815 -----------------------------------------
+ * ...
+ * 928 -----------------------------------------
+ *             sh73a0-intca-irq-pins
+ * 943 -----------------------------------------
+ */
+
+/* PINT interrupts are located at Linux IRQ 700 and up */
+#define SH73A0_PINT0_IRQ(irq) ((irq) + 700)
+#define SH73A0_PINT1_IRQ(irq) ((irq) + 732)
+
+extern void sh73a0_init_delay(void);
+extern void sh73a0_init_irq(void);
+extern void sh73a0_init_irq_dt(void);
+extern void sh73a0_map_io(void);
+extern void sh73a0_earlytimer_init(void);
+extern void sh73a0_add_early_devices(void);
+extern void sh73a0_add_standard_devices(void);
+extern void sh73a0_add_standard_devices_dt(void);
+extern void sh73a0_clock_init(void);
+extern void sh73a0_pinmux_init(void);
+extern void sh73a0_pm_init(void);
+extern struct clk sh73a0_extal1_clk;
+extern struct clk sh73a0_extal2_clk;
+extern struct clk sh73a0_extcki_clk;
+extern struct clk sh73a0_extalr_clk;
+extern struct smp_operations sh73a0_smp_ops;
+
+#endif /* __ASM_SH73A0_H__ */
index 2dfd748da7f374156e13374251bcdd9fe4a65f31..6ff1df1df9a752c313514284a09a0e747e906c4c 100644 (file)
@@ -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
index e7a3201473d0733579e57475886624343125727a..3100e355c3fde4e589aa015a50a68e7b1f57da85 100644 (file)
 #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"
+#include "r8a7779.h"
+
 #define AVECR IOMEM(0xfe700040)
 #define R8A7779_SCU_BASE 0xf0000000
 
index 591052799e8f31fa3dcd7c73360a874a9db2b791..2311694636e123a984fe8f1480d2a9efb7c9a412 100644 (file)
 #include <linux/init.h>
 #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>
 
-#define RST            0xe6160000
-#define CA15BAR                0x0020
-#define CA7BAR         0x0030
-#define CA15RESCNT     0x0040
-#define CA7RESCNT      0x0044
-#define MERAM          0xe8080000
+#include "common.h"
+#include "pm-rcar.h"
+#include "r8a7790.h"
 
 static struct rcar_sysc_ch r8a7790_ca15_scu = {
        .chan_offs = 0x180, /* PWRSR5 .. PWRER5 */
@@ -41,32 +36,9 @@ static struct rcar_sysc_ch r8a7790_ca7_scu = {
 
 static void __init r8a7790_smp_prepare_cpus(unsigned int max_cpus)
 {
-       void __iomem *p;
-       u32 bar;
-
        /* let APMU code install data related to shmobile_boot_vector */
        shmobile_smp_apmu_prepare_cpus(max_cpus);
 
-       /* MERAM for jump stub, because BAR requires 256KB aligned address */
-       p = ioremap_nocache(MERAM, shmobile_boot_size);
-       memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size);
-       iounmap(p);
-
-       /* setup reset vectors */
-       p = ioremap_nocache(RST, 0x63);
-       bar = (MERAM >> 8) & 0xfffffc00;
-       writel_relaxed(bar, p + CA15BAR);
-       writel_relaxed(bar, p + CA7BAR);
-       writel_relaxed(bar | 0x10, p + CA15BAR);
-       writel_relaxed(bar | 0x10, p + CA7BAR);
-
-       /* enable clocks to all CPUs */
-       writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | 0xa5a50000,
-                      p + CA15RESCNT);
-       writel_relaxed((readl_relaxed(p + CA7RESCNT) & ~0x0f) | 0x5a5a0000,
-                      p + CA7RESCNT);
-       iounmap(p);
-
        /* turn on power to SCU */
        r8a7790_pm_init();
        rcar_sysc_power_up(&r8a7790_ca15_scu);
index ec979529f30f5b00c3cc94030d67fb5b27efb9c8..f743386166fb72608e69049610f52c9b96a93103 100644 (file)
 #include <linux/init.h>
 #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>
 
-#define RST            0xe6160000
-#define CA15BAR                0x0020
-#define CA15RESCNT     0x0040
-#define RAM            0xe6300000
+#include "common.h"
+#include "r8a7791.h"
+#include "rcar-gen2.h"
 
 static void __init r8a7791_smp_prepare_cpus(unsigned int max_cpus)
 {
-       void __iomem *p;
-       u32 bar;
-
        /* let APMU code install data related to shmobile_boot_vector */
        shmobile_smp_apmu_prepare_cpus(max_cpus);
 
-       /* RAM for jump stub, because BAR requires 256KB aligned address */
-       p = ioremap_nocache(RAM, shmobile_boot_size);
-       memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size);
-       iounmap(p);
-
-       /* setup reset vectors */
-       p = ioremap_nocache(RST, 0x63);
-       bar = (RAM >> 8) & 0xfffffc00;
-       writel_relaxed(bar, p + CA15BAR);
-       writel_relaxed(bar | 0x10, p + CA15BAR);
-
-       /* enable clocks to all CPUs */
-       writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | 0xa5a50000,
-                      p + CA15RESCNT);
-       iounmap(p);
+       r8a7791_pm_init();
 }
 
 static int r8a7791_smp_boot_secondary(unsigned int cpu,
index 13ba36a6831fb2374ff62dcfc967cf426b98ae3c..22d8f87b23e9006b206a3c04fe9720a384926c81 100644 (file)
 #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"
+#include "sh73a0.h"
+
 #define WUPCR          IOMEM(0xe6151010)
 #define SRESCR         IOMEM(0xe6151018)
 #define PSTR           IOMEM(0xe6151040)
index 68bc0b82226d18f3af3448010d2e3cc653420972..942efdc82a620e72f93046c7c61ca0f0713d5e55 100644 (file)
@@ -59,29 +59,37 @@ void __init shmobile_setup_delay(unsigned int max_cpu_core_mhz,
 
 void __init shmobile_init_delay(void)
 {
-       struct device_node *np, *parent;
-       u32 max_freq, freq;
-
-       max_freq = 0;
-
-       parent = of_find_node_by_path("/cpus");
-       if (parent) {
-               for_each_child_of_node(parent, np) {
-                       if (!of_property_read_u32(np, "clock-frequency", &freq))
-                               max_freq = max(max_freq, freq);
-               }
-               of_node_put(parent);
-       }
+       struct device_node *np, *cpus;
+       bool is_a8_a9 = false;
+       bool is_a15 = false;
+       u32 max_freq = 0;
+
+       cpus = of_find_node_by_path("/cpus");
+       if (!cpus)
+               return;
+
+       for_each_child_of_node(cpus, np) {
+               u32 freq;
+
+               if (!of_property_read_u32(np, "clock-frequency", &freq))
+                       max_freq = max(max_freq, freq);
 
-       if (max_freq) {
-               if (of_find_compatible_node(NULL, NULL, "arm,cortex-a8"))
-                       shmobile_setup_delay_hz(max_freq, 1, 3);
-               else if (of_find_compatible_node(NULL, NULL, "arm,cortex-a9"))
-                       shmobile_setup_delay_hz(max_freq, 1, 3);
-               else if (of_find_compatible_node(NULL, NULL, "arm,cortex-a15"))
-                       if (!IS_ENABLED(CONFIG_ARM_ARCH_TIMER))
-                               shmobile_setup_delay_hz(max_freq, 2, 4);
+               if (of_device_is_compatible(np, "arm,cortex-a8") ||
+                   of_device_is_compatible(np, "arm,cortex-a9"))
+                       is_a8_a9 = true;
+               else if (of_device_is_compatible(np, "arm,cortex-a15"))
+                       is_a15 = true;
        }
+
+       of_node_put(cpus);
+
+       if (!max_freq)
+               return;
+
+       if (is_a8_a9)
+               shmobile_setup_delay_hz(max_freq, 1, 3);
+       else if (is_a15 && !IS_ENABLED(CONFIG_ARM_ARCH_TIMER))
+               shmobile_setup_delay_hz(max_freq, 2, 4);
 }
 
 static void __init shmobile_late_time_init(void)
index 3621b000a0f6ea04ce2d0de62ed5ffde114003d0..9f9bc61ca64bc6af4ddf2e7bfe7e2d6ccac3fe55 100644 (file)
@@ -44,7 +44,6 @@ static const char *versatile_dt_match[] __initconst = {
 DT_MACHINE_START(VERSATILE_PB, "ARM-Versatile (Device Tree Support)")
        .map_io         = versatile_map_io,
        .init_early     = versatile_init_early,
-       .init_irq       = versatile_init_irq,
        .init_machine   = versatile_dt_init,
        .dt_compat      = versatile_dt_match,
        .restart        = versatile_restart,
index fd449f9b006dc96b9747f354827e8f5c9541bdcb..162e519cb0f98aa664fd3363300ddeda68be35ef 100644 (file)
@@ -1,6 +1,5 @@
 # Makefile for Versatile-specific clocks
-obj-$(CONFIG_ICST)             += clk-icst.o
-obj-$(CONFIG_ARCH_INTEGRATOR)  += clk-integrator.o
+obj-$(CONFIG_ICST)             += clk-icst.o clk-versatile.o
 obj-$(CONFIG_INTEGRATOR_IMPD1) += clk-impd1.o
 obj-$(CONFIG_ARCH_REALVIEW)    += clk-realview.o
 obj-$(CONFIG_ARCH_VEXPRESS)    += clk-vexpress.o
diff --git a/drivers/clk/versatile/clk-integrator.c b/drivers/clk/versatile/clk-integrator.c
deleted file mode 100644 (file)
index 734c4b8..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Clock driver for the ARM Integrator/AP and Integrator/CP boards
- * Copyright (C) 2012 Linus Walleij
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#include <linux/clk-provider.h>
-#include <linux/clk.h>
-#include <linux/clkdev.h>
-#include <linux/err.h>
-#include <linux/of.h>
-#include <linux/of_address.h>
-
-#include "clk-icst.h"
-
-#define INTEGRATOR_HDR_LOCK_OFFSET     0x14
-
-/* Base offset for the core module */
-static void __iomem *cm_base;
-
-static const struct icst_params cp_auxosc_params = {
-       .vco_max        = ICST525_VCO_MAX_5V,
-       .vco_min        = ICST525_VCO_MIN,
-       .vd_min         = 8,
-       .vd_max         = 263,
-       .rd_min         = 3,
-       .rd_max         = 65,
-       .s2div          = icst525_s2div,
-       .idx2s          = icst525_idx2s,
-};
-
-static const struct clk_icst_desc __initdata cm_auxosc_desc = {
-       .params = &cp_auxosc_params,
-       .vco_offset = 0x1c,
-       .lock_offset = INTEGRATOR_HDR_LOCK_OFFSET,
-};
-
-static void __init of_integrator_cm_osc_setup(struct device_node *np)
-{
-       struct clk *clk = ERR_PTR(-EINVAL);
-       const char *clk_name = np->name;
-       const struct clk_icst_desc *desc = &cm_auxosc_desc;
-       const char *parent_name;
-
-       if (!cm_base) {
-               /* Remap the core module base if not done yet */
-               struct device_node *parent;
-
-               parent = of_get_parent(np);
-               if (!np) {
-                       pr_err("no parent on core module clock\n");
-                       return;
-               }
-               cm_base = of_iomap(parent, 0);
-               if (!cm_base) {
-                       pr_err("could not remap core module base\n");
-                       return;
-               }
-       }
-
-       parent_name = of_clk_get_parent_name(np, 0);
-       clk = icst_clk_register(NULL, desc, clk_name, parent_name, cm_base);
-       if (!IS_ERR(clk))
-               of_clk_add_provider(np, of_clk_src_simple_get, clk);
-}
-CLK_OF_DECLARE(integrator_cm_auxosc_clk,
-       "arm,integrator-cm-auxosc", of_integrator_cm_osc_setup);
diff --git a/drivers/clk/versatile/clk-versatile.c b/drivers/clk/versatile/clk-versatile.c
new file mode 100644 (file)
index 0000000..a76981e
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * Clock driver for the ARM Integrator/AP, Integrator/CP, Versatile AB and
+ * Versatile PB boards.
+ * Copyright (C) 2012 Linus Walleij
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/clk-provider.h>
+#include <linux/clk.h>
+#include <linux/clkdev.h>
+#include <linux/err.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+
+#include "clk-icst.h"
+
+#define INTEGRATOR_HDR_LOCK_OFFSET     0x14
+
+#define VERSATILE_SYS_OSCCLCD_OFFSET   0x1c
+#define VERSATILE_SYS_LOCK_OFFSET      0x20
+
+/* Base offset for the core module */
+static void __iomem *cm_base;
+
+static const struct icst_params cp_auxosc_params = {
+       .vco_max        = ICST525_VCO_MAX_5V,
+       .vco_min        = ICST525_VCO_MIN,
+       .vd_min         = 8,
+       .vd_max         = 263,
+       .rd_min         = 3,
+       .rd_max         = 65,
+       .s2div          = icst525_s2div,
+       .idx2s          = icst525_idx2s,
+};
+
+static const struct clk_icst_desc __initdata cm_auxosc_desc = {
+       .params = &cp_auxosc_params,
+       .vco_offset = 0x1c,
+       .lock_offset = INTEGRATOR_HDR_LOCK_OFFSET,
+};
+
+static const struct icst_params versatile_auxosc_params = {
+       .vco_max        = ICST307_VCO_MAX,
+       .vco_min        = ICST307_VCO_MIN,
+       .vd_min         = 4 + 8,
+       .vd_max         = 511 + 8,
+       .rd_min         = 1 + 2,
+       .rd_max         = 127 + 2,
+       .s2div          = icst307_s2div,
+       .idx2s          = icst307_idx2s,
+};
+
+static const struct clk_icst_desc versatile_auxosc_desc __initconst = {
+       .params = &versatile_auxosc_params,
+       .vco_offset = VERSATILE_SYS_OSCCLCD_OFFSET,
+       .lock_offset = VERSATILE_SYS_LOCK_OFFSET,
+};
+static void __init cm_osc_setup(struct device_node *np,
+                               const struct clk_icst_desc *desc)
+{
+       struct clk *clk = ERR_PTR(-EINVAL);
+       const char *clk_name = np->name;
+       const char *parent_name;
+
+       if (!cm_base) {
+               /* Remap the core module base if not done yet */
+               struct device_node *parent;
+
+               parent = of_get_parent(np);
+               if (!np) {
+                       pr_err("no parent on core module clock\n");
+                       return;
+               }
+               cm_base = of_iomap(parent, 0);
+               if (!cm_base) {
+                       pr_err("could not remap core module base\n");
+                       return;
+               }
+       }
+
+       parent_name = of_clk_get_parent_name(np, 0);
+       clk = icst_clk_register(NULL, desc, clk_name, parent_name, cm_base);
+       if (!IS_ERR(clk))
+               of_clk_add_provider(np, of_clk_src_simple_get, clk);
+}
+
+static void __init of_integrator_cm_osc_setup(struct device_node *np)
+{
+       cm_osc_setup(np, &cm_auxosc_desc);
+}
+CLK_OF_DECLARE(integrator_cm_auxosc_clk,
+       "arm,integrator-cm-auxosc", of_integrator_cm_osc_setup);
+
+static void __init of_versatile_cm_osc_setup(struct device_node *np)
+{
+       cm_osc_setup(np, &versatile_auxosc_desc);
+}
+CLK_OF_DECLARE(versatile_cm_auxosc_clk,
+              "arm,versatile-cm-auxosc", of_versatile_cm_osc_setup);
index d1869f02051cbe9ccfa23a0dec7d235d5d0d3f02..d2616ef167701526a13efe7ef896f3cca2c8668a 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
 #include <linux/sched_clock.h>
+#include <linux/delay.h>
 
 #include <asm/mach/time.h>
 #include <asm/smp_twd.h>
@@ -53,6 +54,8 @@ static void __iomem *rtc_base;
 static struct timespec persistent_ts;
 static u64 persistent_ms, last_persistent_ms;
 
+static struct delay_timer tegra_delay_timer;
+
 #define timer_writel(value, reg) \
        __raw_writel(value, timer_reg_base + (reg))
 #define timer_readl(reg) \
@@ -139,6 +142,11 @@ static void tegra_read_persistent_clock(struct timespec *ts)
        *ts = *tsp;
 }
 
+static unsigned long tegra_delay_timer_read_counter_long(void)
+{
+       return readl(timer_reg_base + TIMERUS_CNTR_1US);
+}
+
 static irqreturn_t tegra_timer_interrupt(int irq, void *dev_id)
 {
        struct clock_event_device *evt = (struct clock_event_device *)dev_id;
@@ -206,6 +214,11 @@ static void __init tegra20_init_timer(struct device_node *np)
                BUG();
        }
 
+       tegra_delay_timer.read_current_timer =
+                       tegra_delay_timer_read_counter_long;
+       tegra_delay_timer.freq = 1000000;
+       register_current_timer_delay(&tegra_delay_timer);
+
        ret = setup_irq(tegra_timer_irq.irq, &tegra_timer_irq);
        if (ret) {
                pr_err("Failed to register timer IRQ: %d\n", ret);
index 3ae2bb8d9cf22e04cc967468823133f952e5c4ea..ccf58548b1612a4012219d7873a05b89a14a5ece 100644 (file)
@@ -14,6 +14,8 @@
 #include <asm/exception.h>
 #include <asm/mach/irq.h>
 
+#include "irqchip.h"
+
 #define IRQ_STATUS             0x00
 #define IRQ_RAW_STATUS         0x04
 #define IRQ_ENABLE_SET         0x08
@@ -26,6 +28,8 @@
 #define FIQ_ENABLE_SET         0x28
 #define FIQ_ENABLE_CLEAR       0x2C
 
+#define PIC_ENABLES             0x20   /* set interrupt pass through bits */
+
 /**
  * struct fpga_irq_data - irq data container for the FPGA IRQ controller
  * @base: memory offset in virtual memory
@@ -201,14 +205,26 @@ int __init fpga_irq_of_init(struct device_node *node,
 
        /* Some chips are cascaded from a parent IRQ */
        parent_irq = irq_of_parse_and_map(node, 0);
-       if (!parent_irq)
+       if (!parent_irq) {
+               set_handle_irq(fpga_handle_irq);
                parent_irq = -1;
+       }
 
        fpga_irq_init(base, node->name, 0, parent_irq, valid_mask, node);
 
        writel(clear_mask, base + IRQ_ENABLE_CLEAR);
        writel(clear_mask, base + FIQ_ENABLE_CLEAR);
 
+       /*
+        * On Versatile AB/PB, some secondary interrupts have a direct
+        * pass-thru to the primary controller for IRQs 20 and 22-31 which need
+        * to be enabled. See section 3.10 of the Versatile AB user guide.
+        */
+       if (of_device_is_compatible(node, "arm,versatile-sic"))
+               writel(0xffd00000, base + PIC_ENABLES);
+
        return 0;
 }
+IRQCHIP_DECLARE(arm_fpga, "arm,versatile-fpga-irq", fpga_irq_of_init);
+IRQCHIP_DECLARE(arm_fpga_sic, "arm,versatile-sic", fpga_irq_of_init);
 #endif
index 520702db9accd25ff2e66579bfee4d231d5fa0e4..ce635dccf3d96921249a2e20084d9f67b5361b33 100644 (file)
@@ -262,6 +262,15 @@ unsigned long __attribute__((weak)) calibrate_delay_is_known(void)
        return 0;
 }
 
+/*
+ * Indicate the cpu delay calibration is done. This can be used by
+ * architectures to stop accepting delay timer registrations after this point.
+ */
+
+void __attribute__((weak)) calibration_delay_done(void)
+{
+}
+
 void calibrate_delay(void)
 {
        unsigned long lpj;
@@ -301,4 +310,6 @@ void calibrate_delay(void)
 
        loops_per_jiffy = lpj;
        printed = true;
+
+       calibration_delay_done();
 }