]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'arm-soc/for-next'
authorStephen Rothwell <sfr@canb.auug.org.au>
Wed, 21 May 2014 00:01:00 +0000 (10:01 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 21 May 2014 00:01:00 +0000 (10:01 +1000)
326 files changed:
Documentation/arm/sti/stih407-overview.txt [new file with mode: 0644]
Documentation/devicetree/bindings/arm/armada-370-xp-pmsu.txt
Documentation/devicetree/bindings/arm/armada-cpu-reset.txt [new file with mode: 0644]
Documentation/devicetree/bindings/arm/coherency-fabric.txt
Documentation/devicetree/bindings/arm/cpus.txt
Documentation/devicetree/bindings/arm/rockchip.txt [new file with mode: 0644]
Documentation/devicetree/bindings/arm/sti.txt [new file with mode: 0644]
Documentation/devicetree/bindings/clock/altr_socfpga.txt
Documentation/devicetree/bindings/clock/at91-clock.txt
Documentation/devicetree/bindings/memory-controllers/mvebu-devbus.txt
Documentation/devicetree/bindings/reset/socfpga-reset.txt [moved from Documentation/devicetree/bindings/arm/altera/socfpga-reset.txt with 85% similarity]
Documentation/devicetree/bindings/vendor-prefixes.txt
MAINTAINERS
arch/arm/Kconfig
arch/arm/arm-soc-for-next-contents.txt [new file with mode: 0644]
arch/arm/boot/dts/Makefile
arch/arm/boot/dts/armada-370-db.dts
arch/arm/boot/dts/armada-370-mirabox.dts
arch/arm/boot/dts/armada-370-netgear-rn102.dts
arch/arm/boot/dts/armada-370-netgear-rn104.dts
arch/arm/boot/dts/armada-370-rd.dts
arch/arm/boot/dts/armada-370-xp.dtsi
arch/arm/boot/dts/armada-370.dtsi
arch/arm/boot/dts/armada-375-db.dts
arch/arm/boot/dts/armada-375.dtsi
arch/arm/boot/dts/armada-380.dtsi
arch/arm/boot/dts/armada-385-db.dts
arch/arm/boot/dts/armada-385-rd.dts
arch/arm/boot/dts/armada-385.dtsi
arch/arm/boot/dts/armada-38x.dtsi
arch/arm/boot/dts/armada-xp-axpwifiap.dts
arch/arm/boot/dts/armada-xp-db.dts
arch/arm/boot/dts/armada-xp-gp.dts
arch/arm/boot/dts/armada-xp-matrix.dts
arch/arm/boot/dts/armada-xp-mv78230.dtsi
arch/arm/boot/dts/armada-xp-mv78260.dtsi
arch/arm/boot/dts/armada-xp-mv78460.dtsi
arch/arm/boot/dts/armada-xp-netgear-rn2120.dts
arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
arch/arm/boot/dts/armada-xp.dtsi
arch/arm/boot/dts/at91-cosino_mega2560.dts
arch/arm/boot/dts/at91-sama5d3_xplained.dts
arch/arm/boot/dts/at91sam9261.dtsi
arch/arm/boot/dts/at91sam9261ek.dts
arch/arm/boot/dts/at91sam9g45.dtsi
arch/arm/boot/dts/at91sam9m10g45ek.dts
arch/arm/boot/dts/at91sam9rl.dtsi
arch/arm/boot/dts/at91sam9rlek.dts
arch/arm/boot/dts/atlas6.dtsi
arch/arm/boot/dts/exynos5420-arndale-octa.dts
arch/arm/boot/dts/exynos5420.dtsi
arch/arm/boot/dts/k2e-evm.dts
arch/arm/boot/dts/k2hk-evm.dts
arch/arm/boot/dts/k2l-evm.dts
arch/arm/boot/dts/keystone.dtsi
arch/arm/boot/dts/kirkwood-6192.dtsi
arch/arm/boot/dts/kirkwood-6281.dtsi
arch/arm/boot/dts/kirkwood-6282.dtsi
arch/arm/boot/dts/kirkwood-98dx4122.dtsi
arch/arm/boot/dts/kirkwood-b3.dts
arch/arm/boot/dts/kirkwood-cloudbox.dts
arch/arm/boot/dts/kirkwood-db.dtsi
arch/arm/boot/dts/kirkwood-dns320.dts
arch/arm/boot/dts/kirkwood-dns325.dts
arch/arm/boot/dts/kirkwood-dnskw.dtsi
arch/arm/boot/dts/kirkwood-dockstar.dts
arch/arm/boot/dts/kirkwood-dreamplug.dts
arch/arm/boot/dts/kirkwood-ds109.dts
arch/arm/boot/dts/kirkwood-ds110jv10.dts
arch/arm/boot/dts/kirkwood-ds111.dts
arch/arm/boot/dts/kirkwood-ds112.dts
arch/arm/boot/dts/kirkwood-ds209.dts
arch/arm/boot/dts/kirkwood-ds210.dts
arch/arm/boot/dts/kirkwood-ds212.dts
arch/arm/boot/dts/kirkwood-ds212j.dts
arch/arm/boot/dts/kirkwood-ds409.dts
arch/arm/boot/dts/kirkwood-ds409slim.dts
arch/arm/boot/dts/kirkwood-ds411.dts
arch/arm/boot/dts/kirkwood-ds411j.dts
arch/arm/boot/dts/kirkwood-ds411slim.dts
arch/arm/boot/dts/kirkwood-goflexnet.dts
arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts
arch/arm/boot/dts/kirkwood-ib62x0.dts
arch/arm/boot/dts/kirkwood-iconnect.dts
arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts
arch/arm/boot/dts/kirkwood-km_kirkwood.dts
arch/arm/boot/dts/kirkwood-laplug.dts
arch/arm/boot/dts/kirkwood-lsxl.dtsi
arch/arm/boot/dts/kirkwood-mplcec4.dts
arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts
arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts
arch/arm/boot/dts/kirkwood-netgear_readynas_nv+_v2.dts
arch/arm/boot/dts/kirkwood-ns2-common.dtsi
arch/arm/boot/dts/kirkwood-nsa310.dts
arch/arm/boot/dts/kirkwood-nsa310a.dts
arch/arm/boot/dts/kirkwood-nsa320.dts [new file with mode: 0644]
arch/arm/boot/dts/kirkwood-nsa3x0-common.dtsi [moved from arch/arm/boot/dts/kirkwood-nsa310-common.dtsi with 58% similarity]
arch/arm/boot/dts/kirkwood-openblocks_a6.dts
arch/arm/boot/dts/kirkwood-openblocks_a7.dts
arch/arm/boot/dts/kirkwood-rd88f6192.dts
arch/arm/boot/dts/kirkwood-rd88f6281.dtsi
arch/arm/boot/dts/kirkwood-rs212.dts
arch/arm/boot/dts/kirkwood-rs409.dts
arch/arm/boot/dts/kirkwood-rs411.dts
arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi
arch/arm/boot/dts/kirkwood-synology.dtsi
arch/arm/boot/dts/kirkwood-t5325.dts
arch/arm/boot/dts/kirkwood-topkick.dts
arch/arm/boot/dts/kirkwood-ts219-6281.dts
arch/arm/boot/dts/kirkwood-ts219-6282.dts
arch/arm/boot/dts/kirkwood-ts219.dtsi
arch/arm/boot/dts/kirkwood-ts419.dtsi
arch/arm/boot/dts/kirkwood.dtsi
arch/arm/boot/dts/orion5x-lacie-d2-network.dts [new file with mode: 0644]
arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts
arch/arm/boot/dts/orion5x-maxtor-shared-storage-2.dts [new file with mode: 0644]
arch/arm/boot/dts/orion5x-mv88f5182.dtsi [new file with mode: 0644]
arch/arm/boot/dts/orion5x-rd88f5182-nas.dts [new file with mode: 0644]
arch/arm/boot/dts/orion5x.dtsi
arch/arm/boot/dts/prima2.dtsi
arch/arm/boot/dts/r8a73a4.dtsi
arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts
arch/arm/boot/dts/r8a7740.dtsi
arch/arm/boot/dts/r8a7778-bockw-reference.dts
arch/arm/boot/dts/r8a7778.dtsi
arch/arm/boot/dts/r8a7779-marzen-reference.dts
arch/arm/boot/dts/r8a7779.dtsi
arch/arm/boot/dts/r8a7790-lager.dts
arch/arm/boot/dts/r8a7790.dtsi
arch/arm/boot/dts/r8a7791-henninger.dts [new file with mode: 0644]
arch/arm/boot/dts/r8a7791-koelsch.dts
arch/arm/boot/dts/r8a7791.dtsi
arch/arm/boot/dts/rk3066a-bqcurie2.dts
arch/arm/boot/dts/rk3066a.dtsi
arch/arm/boot/dts/rk3188-radxarock.dts
arch/arm/boot/dts/rk3188.dtsi
arch/arm/boot/dts/rk3xxx.dtsi
arch/arm/boot/dts/sama5d3.dtsi
arch/arm/boot/dts/sama5d3xcm.dtsi
arch/arm/boot/dts/sama5d3xmb.dtsi
arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
arch/arm/boot/dts/socfpga.dtsi
arch/arm/boot/dts/socfpga_arria5.dtsi
arch/arm/boot/dts/socfpga_arria5_socdk.dts
arch/arm/boot/dts/socfpga_cyclone5.dtsi
arch/arm/boot/dts/socfpga_cyclone5_socdk.dts
arch/arm/boot/dts/socfpga_cyclone5_sockit.dts
arch/arm/boot/dts/socfpga_cyclone5_socrates.dts [new file with mode: 0644]
arch/arm/boot/dts/socfpga_vt.dts
arch/arm/configs/at91sam9g45_defconfig
arch/arm/configs/at91sam9rl_defconfig
arch/arm/configs/dove_defconfig
arch/arm/configs/exynos_defconfig
arch/arm/configs/kirkwood_defconfig
arch/arm/configs/multi_v5_defconfig
arch/arm/configs/multi_v7_defconfig
arch/arm/configs/mvebu_v5_defconfig
arch/arm/configs/mvebu_v7_defconfig
arch/arm/configs/realview-smp_defconfig
arch/arm/configs/realview_defconfig
arch/arm/configs/sama5_defconfig
arch/arm/configs/shmobile_defconfig
arch/arm/configs/versatile_defconfig
arch/arm/mach-at91/at91rm9200_devices.c
arch/arm/mach-at91/at91sam9260_devices.c
arch/arm/mach-at91/at91sam9261_devices.c
arch/arm/mach-at91/at91sam9263_devices.c
arch/arm/mach-at91/at91sam9g45.c
arch/arm/mach-at91/at91sam9g45_devices.c
arch/arm/mach-at91/at91sam9rl.c
arch/arm/mach-at91/at91sam9rl_devices.c
arch/arm/mach-at91/board-1arm.c
arch/arm/mach-at91/board-afeb-9260v1.c
arch/arm/mach-at91/board-cam60.c
arch/arm/mach-at91/board-carmeva.c
arch/arm/mach-at91/board-cpu9krea.c
arch/arm/mach-at91/board-cpuat91.c
arch/arm/mach-at91/board-csb337.c
arch/arm/mach-at91/board-csb637.c
arch/arm/mach-at91/board-eb9200.c
arch/arm/mach-at91/board-ecbat91.c
arch/arm/mach-at91/board-eco920.c
arch/arm/mach-at91/board-flexibity.c
arch/arm/mach-at91/board-foxg20.c
arch/arm/mach-at91/board-gsia18s.c
arch/arm/mach-at91/board-kafa.c
arch/arm/mach-at91/board-kb9202.c
arch/arm/mach-at91/board-pcontrol-g20.c
arch/arm/mach-at91/board-picotux200.c
arch/arm/mach-at91/board-rm9200ek.c
arch/arm/mach-at91/board-rsi-ews.c
arch/arm/mach-at91/board-sam9-l9260.c
arch/arm/mach-at91/board-sam9260ek.c
arch/arm/mach-at91/board-sam9261ek.c
arch/arm/mach-at91/board-sam9263ek.c
arch/arm/mach-at91/board-sam9g20ek.c
arch/arm/mach-at91/board-sam9m10g45ek.c
arch/arm/mach-at91/board-sam9rlek.c
arch/arm/mach-at91/board-snapper9260.c
arch/arm/mach-at91/board-stamp9g20.c
arch/arm/mach-at91/board-yl-9200.c
arch/arm/mach-at91/board.h
arch/arm/mach-at91/gpio.c
arch/arm/mach-at91/gpio.h [moved from arch/arm/mach-at91/include/mach/gpio.h with 96% similarity]
arch/arm/mach-at91/include/mach/at91_adc.h [deleted file]
arch/arm/mach-at91/include/mach/hardware.h
arch/arm/mach-at91/leds.c
arch/arm/mach-at91/pm.c
arch/arm/mach-bcm/Kconfig
arch/arm/mach-dove/irq.c
arch/arm/mach-exynos/firmware.c
arch/arm/mach-kirkwood/board-dt.c
arch/arm/mach-kirkwood/irq.c
arch/arm/mach-mvebu/Kconfig
arch/arm/mach-mvebu/Makefile
arch/arm/mach-mvebu/armada-370-xp.h
arch/arm/mach-mvebu/board-t5325.c [deleted file]
arch/arm/mach-mvebu/board-v7.c
arch/arm/mach-mvebu/board.h
arch/arm/mach-mvebu/coherency.c
arch/arm/mach-mvebu/coherency.h
arch/arm/mach-mvebu/coherency_ll.S
arch/arm/mach-mvebu/common.h
arch/arm/mach-mvebu/cpu-reset.c [new file with mode: 0644]
arch/arm/mach-mvebu/dove.c
arch/arm/mach-mvebu/headsmp-a9.S [new file with mode: 0644]
arch/arm/mach-mvebu/headsmp.S
arch/arm/mach-mvebu/kirkwood.c
arch/arm/mach-mvebu/mvebu-soc-id.c
arch/arm/mach-mvebu/mvebu-soc-id.h
arch/arm/mach-mvebu/platsmp-a9.c [new file with mode: 0644]
arch/arm/mach-mvebu/platsmp.c
arch/arm/mach-mvebu/pmsu.c
arch/arm/mach-mvebu/system-controller.c
arch/arm/mach-orion5x/Kconfig
arch/arm/mach-orion5x/Makefile
arch/arm/mach-orion5x/board-d2net.c [new file with mode: 0644]
arch/arm/mach-orion5x/board-dt.c
arch/arm/mach-orion5x/board-mss2.c [new file with mode: 0644]
arch/arm/mach-orion5x/board-rd88f5182.c [new file with mode: 0644]
arch/arm/mach-orion5x/common.h
arch/arm/mach-orion5x/d2net-setup.c [deleted file]
arch/arm/mach-orion5x/edmini_v2-setup.c [deleted file]
arch/arm/mach-orion5x/irq.c
arch/arm/mach-orion5x/mss2-setup.c [deleted file]
arch/arm/mach-prima2/rstc.c
arch/arm/mach-qcom/Kconfig
arch/arm/mach-realview/core.c
arch/arm/mach-realview/core.h
arch/arm/mach-realview/realview_eb.c
arch/arm/mach-realview/realview_pb1176.c
arch/arm/mach-realview/realview_pb11mp.c
arch/arm/mach-realview/realview_pba8.c
arch/arm/mach-realview/realview_pbx.c
arch/arm/mach-shmobile/Kconfig
arch/arm/mach-shmobile/Makefile
arch/arm/mach-shmobile/board-armadillo800eva-reference.c
arch/arm/mach-shmobile/board-armadillo800eva.c
arch/arm/mach-shmobile/board-bockw.c
arch/arm/mach-shmobile/board-koelsch-reference.c
arch/arm/mach-shmobile/board-koelsch.c
arch/arm/mach-shmobile/board-lager-reference.c
arch/arm/mach-shmobile/board-lager.c
arch/arm/mach-shmobile/clock-emev2.c [deleted file]
arch/arm/mach-shmobile/clock-r8a7740.c
arch/arm/mach-shmobile/clock-r8a7778.c
arch/arm/mach-shmobile/clock-r8a7790.c
arch/arm/mach-shmobile/clock-r8a7791.c
arch/arm/mach-shmobile/clock.c
arch/arm/mach-shmobile/include/mach/clock.h
arch/arm/mach-shmobile/include/mach/common.h
arch/arm/mach-shmobile/include/mach/emev2.h [deleted file]
arch/arm/mach-shmobile/include/mach/r8a7740.h
arch/arm/mach-shmobile/include/mach/r8a7791.h
arch/arm/mach-shmobile/pm-rmobile.c
arch/arm/mach-shmobile/setup-emev2.c
arch/arm/mach-shmobile/setup-r8a7740.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/smp-emev2.c
arch/arm/mach-shmobile/smp-r8a7791.c
arch/arm/mach-shmobile/timer.c
arch/arm/mach-sti/board-dt.c
arch/arm/mach-versatile/core.c
arch/arm/plat-orion/gpio.c
arch/arm/plat-orion/include/plat/irq.h
arch/arm/plat-orion/include/plat/orion-gpio.h
arch/arm/plat-orion/irq.c
arch/arm/plat-versatile/Kconfig
arch/arm/plat-versatile/Makefile
drivers/bus/mvebu-mbus.c
drivers/clk/at91/Makefile
drivers/clk/at91/clk-main.c
drivers/clk/at91/clk-slow.c [new file with mode: 0644]
drivers/clk/at91/pmc.c
drivers/clk/at91/pmc.h
drivers/clk/at91/sckc.c [new file with mode: 0644]
drivers/clk/at91/sckc.h [new file with mode: 0644]
drivers/clocksource/timer-marco.c
drivers/clocksource/timer-prima2.c
drivers/cpuidle/Kconfig.arm
drivers/cpuidle/Makefile
drivers/cpuidle/cpuidle-armada-370-xp.c [new file with mode: 0644]
drivers/iio/adc/at91_adc.c
drivers/input/touchscreen/Kconfig
drivers/input/touchscreen/Makefile
drivers/input/touchscreen/atmel_tsadcc.c [deleted file]
drivers/irqchip/irq-armada-370-xp.c
drivers/irqchip/irq-orion.c
drivers/irqchip/irq-sirfsoc.c
drivers/leds/Kconfig
drivers/leds/Makefile
drivers/leds/leds-versatile.c [moved from arch/arm/plat-versatile/leds.c with 68% similarity]
drivers/memory/mvebu-devbus.c
drivers/reset/Makefile
drivers/reset/reset-socfpga.c [new file with mode: 0644]
include/dt-bindings/clock/r8a7790-clock.h
include/dt-bindings/clock/r8a7791-clock.h
include/dt-bindings/reset/altr,rst-mgr.h [new file with mode: 0644]
include/linux/clk/at91_pmc.h
include/linux/mbus.h
include/linux/platform_data/at91_adc.h
include/linux/platform_data/atmel.h
sound/soc/atmel/sam9g20_wm8731.c

diff --git a/Documentation/arm/sti/stih407-overview.txt b/Documentation/arm/sti/stih407-overview.txt
new file mode 100644 (file)
index 0000000..3343f32
--- /dev/null
@@ -0,0 +1,18 @@
+                       STiH407 Overview
+                       ================
+
+Introduction
+------------
+
+    The STiH407 is the new generation of SoC for Multi-HD, AVC set-top boxes
+    and server/connected client application for satellite, cable, terrestrial
+    and IP-STB markets.
+
+    Features
+    - ARM Cortex-A9 1.5 GHz dual core CPU (28nm)
+    - SATA2, USB 3.0, PCIe, Gbit Ethernet
+
+  Document Author
+  ---------------
+
+  Maxime Coquelin <maxime.coquelin@st.com>, (c) 2014 ST Microelectronics
index 926b4d6aae7e0e3e8cb3eb8031e8d95abec39e05..26799ef562df1a00451df7426b3df70ef9e84363 100644 (file)
@@ -1,20 +1,21 @@
 Power Management Service Unit(PMSU)
 -----------------------------------
-Available on Marvell SOCs: Armada 370 and Armada XP
+Available on Marvell SOCs: Armada 370, Armada 38x and Armada XP
 
 Required properties:
 
-- compatible: "marvell,armada-370-xp-pmsu"
+- compatible: should be one of:
+  - "marvell,armada-370-pmsu" for Armada 370 or Armada XP
+  - "marvell,armada-380-pmsu" for Armada 38x
+  - "marvell,armada-370-xp-pmsu" was used for Armada 370/XP but is now
+    deprecated and will be removed
 
-- reg: Should contain PMSU registers location and length. First pair
-  for the per-CPU SW Reset Control registers, second pair for the
-  Power Management Service Unit.
+- reg: Should contain PMSU registers location and length.
 
 Example:
 
-armada-370-xp-pmsu@d0022000 {
-       compatible = "marvell,armada-370-xp-pmsu";
-       reg = <0xd0022100 0x430>,
-             <0xd0020800 0x20>;
+armada-370-xp-pmsu@22000 {
+       compatible = "marvell,armada-370-pmsu";
+       reg = <0x22000 0x1000>;
 };
 
diff --git a/Documentation/devicetree/bindings/arm/armada-cpu-reset.txt b/Documentation/devicetree/bindings/arm/armada-cpu-reset.txt
new file mode 100644 (file)
index 0000000..b63a7b6
--- /dev/null
@@ -0,0 +1,14 @@
+Marvell Armada CPU reset controller
+===================================
+
+Required properties:
+
+- compatible: Should be "marvell,armada-370-cpu-reset".
+
+- reg: should be register base and length as documented in the
+  datasheet for the CPU reset registers
+
+cpurst: cpurst@20800 {
+       compatible = "marvell,armada-370-cpu-reset";
+       reg = <0x20800 0x20>;
+};
index 17d8cd107559981a5a6de1ba7f80f45874c62105..8dd46617c889afa3f05f1e578ddc34bc76d94cc8 100644 (file)
@@ -1,16 +1,33 @@
 Coherency fabric
 ----------------
-Available on Marvell SOCs: Armada 370 and Armada XP
+Available on Marvell SOCs: Armada 370, Armada 375, Armada 38x and Armada XP
 
 Required properties:
 
-- compatible: "marvell,coherency-fabric"
+- compatible: the possible values are:
+
+ * "marvell,coherency-fabric", to be used for the coherency fabric of
+   the Armada 370 and Armada XP.
+
+ * "marvell,armada-375-coherency-fabric", for the Armada 375 coherency
+   fabric.
+
+ * "marvell,armada-380-coherency-fabric", for the Armada 38x coherency
+   fabric.
 
 - reg: Should contain coherency fabric registers location and
-  length. First pair for the coherency fabric registers, second pair
-  for the per-CPU fabric registers registers.
+  length.
+
+ * For "marvell,coherency-fabric", the first pair for the coherency
+   fabric registers, second pair for the per-CPU fabric registers.
 
-Example:
+ * For "marvell,armada-375-coherency-fabric", only one pair is needed
+   for the per-CPU fabric registers.
+
+ * For "marvell,armada-380-coherency-fabric", only one pair is needed
+   for the per-CPU fabric registers.
+
+Examples:
 
 coherency-fabric@d0020200 {
        compatible = "marvell,coherency-fabric";
@@ -19,3 +36,8 @@ coherency-fabric@d0020200 {
 
 };
 
+coherency-fabric@21810 {
+       compatible = "marvell,armada-375-coherency-fabric";
+       reg = <0x21810 0x1c>;
+};
+
index 333f4aea30291e7a2882c8f2f67d1ec417307ef5..4bbcf4fb7583ab42f917275f068a037c347bd989 100644 (file)
@@ -185,6 +185,9 @@ nodes to be present and contain the properties described below.
                            "qcom,gcc-msm8660"
                            "qcom,kpss-acc-v1"
                            "qcom,kpss-acc-v2"
+                           "marvell,armada-375-smp"
+                           "marvell,armada-380-smp"
+                           "marvell,armada-xp-smp"
 
        - cpu-release-addr
                Usage: required for systems that have an "enable-method"
diff --git a/Documentation/devicetree/bindings/arm/rockchip.txt b/Documentation/devicetree/bindings/arm/rockchip.txt
new file mode 100644 (file)
index 0000000..857f126
--- /dev/null
@@ -0,0 +1,10 @@
+Rockchip platforms device tree bindings
+---------------------------------------
+
+- bq Curie 2 tablet:
+    Required root node properties:
+      - compatible = "mundoreader,bq-curie2", "rockchip,rk3066a";
+
+- Radxa Rock board:
+    Required root node properties:
+      - compatible = "radxa,rock", "rockchip,rk3188";
diff --git a/Documentation/devicetree/bindings/arm/sti.txt b/Documentation/devicetree/bindings/arm/sti.txt
new file mode 100644 (file)
index 0000000..92f16c7
--- /dev/null
@@ -0,0 +1,15 @@
+ST STi Platforms Device Tree Bindings
+---------------------------------------
+
+Boards with the ST STiH415 SoC shall have the following properties:
+Required root node property:
+compatible = "st,stih415";
+
+Boards with the ST STiH416 SoC shall have the following properties:
+Required root node property:
+compatible = "st,stih416";
+
+Boards with the ST STiH407 SoC shall have the following properties:
+Required root node property:
+compatible = "st,stih407";
+
index 5dfd145d3ccf673492e91eee8f9b43d94a3faee0..f72e80e0dade820adb35db2498566c487e51b40a 100644 (file)
@@ -21,8 +21,8 @@ Optional properties:
 - fixed-divider : If clocks have a fixed divider value, use this property.
 - clk-gate : For "socfpga-gate-clk", clk-gate contains the gating register
         and the bit index.
-- div-reg : For "socfpga-gate-clk", div-reg contains the divider register, bit shift,
-        and width.
+- div-reg : For "socfpga-gate-clk" and "socfpga-periph-clock", div-reg contains
+       the divider register, bit shift, and width.
 - clk-phase : For the sdmmc_clk, contains the value of the clock phase that controls
        the SDMMC CIU clock. The first value is the clk_sample(smpsel), and the second
        value is the cclk_in_drv(drvsel). The clk-phase is used to enable the correct
index 6794cdc96d8fdf44513a4ad2310fe67a2a93712d..b3d544ca522a5465755846f6f59e19c2f8cc7e40 100644 (file)
@@ -6,6 +6,16 @@ This binding uses the common clock binding[1].
 
 Required properties:
 - compatible : shall be one of the following:
+       "atmel,at91sam9x5-sckc":
+               at91 SCKC (Slow Clock Controller)
+               This node contains the slow clock definitions.
+
+       "atmel,at91sam9x5-clk-slow-osc":
+               at91 slow oscillator
+
+       "atmel,at91sam9x5-clk-slow-rc-osc":
+               at91 internal slow RC oscillator
+
        "atmel,at91rm9200-pmc" or
        "atmel,at91sam9g45-pmc" or
        "atmel,at91sam9n12-pmc" or
@@ -15,8 +25,18 @@ Required properties:
                All at91 specific clocks (clocks defined below) must be child
                node of the PMC node.
 
+       "atmel,at91sam9x5-clk-slow" (under sckc node)
+       or
+       "atmel,at91sam9260-clk-slow" (under pmc node):
+               at91 slow clk
+
+       "atmel,at91rm9200-clk-main-osc"
+       "atmel,at91sam9x5-clk-main-rc-osc"
+               at91 main clk sources
+
+       "atmel,at91sam9x5-clk-main"
        "atmel,at91rm9200-clk-main":
-               at91 main oscillator
+               at91 main clock
 
        "atmel,at91rm9200-clk-master" or
        "atmel,at91sam9x5-clk-master":
@@ -54,6 +74,63 @@ Required properties:
        "atmel,at91sam9x5-clk-utmi":
                at91 utmi clock
 
+Required properties for SCKC node:
+- reg : defines the IO memory reserved for the SCKC.
+- #size-cells : shall be 0 (reg is used to encode clk id).
+- #address-cells : shall be 1 (reg is used to encode clk id).
+
+
+For example:
+       sckc: sckc@fffffe50 {
+               compatible = "atmel,sama5d3-pmc";
+               reg = <0xfffffe50 0x4>
+               #size-cells = <0>;
+               #address-cells = <1>;
+
+               /* put at91 slow clocks here */
+       };
+
+
+Required properties for internal slow RC oscillator:
+- #clock-cells : from common clock binding; shall be set to 0.
+- clock-frequency : define the internal RC oscillator frequency.
+
+Optional properties:
+- clock-accuracy : define the internal RC oscillator accuracy.
+
+For example:
+       slow_rc_osc: slow_rc_osc {
+               compatible = "atmel,at91sam9x5-clk-slow-rc-osc";
+               clock-frequency = <32768>;
+               clock-accuracy = <50000000>;
+       };
+
+Required properties for slow oscillator:
+- #clock-cells : from common clock binding; shall be set to 0.
+- clocks : shall encode the main osc source clk sources (see atmel datasheet).
+
+Optional properties:
+- atmel,osc-bypass : boolean property. Set this when a clock signal is directly
+  provided on XIN.
+
+For example:
+       slow_osc: slow_osc {
+               compatible = "atmel,at91rm9200-clk-slow-osc";
+               #clock-cells = <0>;
+               clocks = <&slow_xtal>;
+       };
+
+Required properties for slow clock:
+- #clock-cells : from common clock binding; shall be set to 0.
+- clocks : shall encode the slow clk sources (see atmel datasheet).
+
+For example:
+       clk32k: slck {
+               compatible = "atmel,at91sam9x5-clk-slow";
+               #clock-cells = <0>;
+               clocks = <&slow_rc_osc &slow_osc>;
+       };
+
 Required properties for PMC node:
 - reg : defines the IO memory reserved for the PMC.
 - #size-cells : shall be 0 (reg is used to encode clk id).
@@ -85,24 +162,57 @@ For example:
                /* put at91 clocks here */
        };
 
+Required properties for main clock internal RC oscillator:
+- interrupt-parent : must reference the PMC node.
+- interrupts : shall be set to "<0>".
+- clock-frequency : define the internal RC oscillator frequency.
+
+Optional properties:
+- clock-accuracy : define the internal RC oscillator accuracy.
+
+For example:
+       main_rc_osc: main_rc_osc {
+               compatible = "atmel,at91sam9x5-clk-main-rc-osc";
+               interrupt-parent = <&pmc>;
+               interrupts = <0>;
+               clock-frequency = <12000000>;
+               clock-accuracy = <50000000>;
+       };
+
+Required properties for main clock oscillator:
+- interrupt-parent : must reference the PMC node.
+- interrupts : shall be set to "<0>".
+- #clock-cells : from common clock binding; shall be set to 0.
+- clocks : shall encode the main osc source clk sources (see atmel datasheet).
+
+Optional properties:
+- atmel,osc-bypass : boolean property. Specified if a clock signal is provided
+  on XIN.
+
+  clock signal is directly provided on XIN pin.
+
+For example:
+       main_osc: main_osc {
+               compatible = "atmel,at91rm9200-clk-main-osc";
+               interrupt-parent = <&pmc>;
+               interrupts = <0>;
+               #clock-cells = <0>;
+               clocks = <&main_xtal>;
+       };
+
 Required properties for main clock:
 - interrupt-parent : must reference the PMC node.
 - interrupts : shall be set to "<0>".
 - #clock-cells : from common clock binding; shall be set to 0.
-- clocks (optional if clock-frequency is provided) : shall be the slow clock
-       phandle. This clock is used to calculate the main clock rate if
-       "clock-frequency" is not provided.
-- clock-frequency : the main oscillator frequency.Prefer the use of
-       "clock-frequency" over automatic clock rate calculation.
+- clocks : shall encode the main clk sources (see atmel datasheet).
 
 For example:
        main: mainck {
-               compatible = "atmel,at91rm9200-clk-main";
+               compatible = "atmel,at91sam9x5-clk-main";
                interrupt-parent = <&pmc>;
                interrupts = <0>;
                #clock-cells = <0>;
-               clocks = <&ck32k>;
-               clock-frequency = <18432000>;
+               clocks = <&main_rc_osc &main_osc>;
        };
 
 Required properties for master clock:
index 653c90c34a71bdeae7f6029a4c4e0106300a98c8..1ee3bc09f31982d3bf554e22972e4a6768920501 100644 (file)
@@ -6,10 +6,11 @@ The actual devices are instantiated from the child nodes of a Device Bus node.
 
 Required properties:
 
- - compatible:          Currently only Armada 370/XP SoC are supported,
-                        with this compatible string:
+ - compatible:          Armada 370/XP SoC are supported using the
+                        "marvell,mvebu-devbus" compatible string.
 
-                        marvell,mvebu-devbus
+                        Orion5x SoC are supported using the
+                        "marvell,orion-devbus" compatible string.
 
  - reg:                 A resource specifier for the register space.
                         This is the base address of a chip select within
@@ -22,7 +23,14 @@ Required properties:
                         integer values for each chip-select line in use:
                         0 <physical address of mapping> <size>
 
-Mandatory timing properties for child nodes:
+Optional properties:
+
+ - devbus,keep-config   This property can optionally be used to keep
+                        using the timing parameters set by the
+                        bootloader. It makes all the timing properties
+                        described below unused.
+
+Timing properties for child nodes:
 
 Read parameters:
 
@@ -30,21 +38,26 @@ Read parameters:
                         drive the AD bus after the completion of a device read.
                         This prevents contentions on the Device Bus after a read
                         cycle from a slow device.
+                        Mandatory, except if devbus,keep-config is used.
 
- - devbus,bus-width:    Defines the bus width (e.g. <16>)
+ - devbus,bus-width:    Defines the bus width, in bits (e.g. <16>).
+                        Mandatory, except if devbus,keep-config is used.
 
  - devbus,badr-skew-ps: Defines the time delay from from A[2:0] toggle,
                         to read data sample. This parameter is useful for
                         synchronous pipelined devices, where the address
                         precedes the read data by one or two cycles.
+                        Mandatory, except if devbus,keep-config is used.
 
  - devbus,acc-first-ps: Defines the time delay from the negation of
                         ALE[0] to the cycle that the first read data is sampled
                         by the controller.
+                        Mandatory, except if devbus,keep-config is used.
 
  - devbus,acc-next-ps:  Defines the time delay between the cycle that
                         samples data N and the cycle that samples data N+1
                         (in burst accesses).
+                        Mandatory, except if devbus,keep-config is used.
 
  - devbus,rd-setup-ps:  Defines the time delay between DEV_CSn assertion to
                        DEV_OEn assertion. If set to 0 (default),
@@ -52,6 +65,8 @@ Read parameters:
                         This parameter has no affect on <acc-first-ps> parameter
                         (no affect on first data sample). Set <rd-setup-ps>
                         to a value smaller than <acc-first-ps>.
+                        Mandatory for "marvell,mvebu-devbus" compatible string,
+                        except if devbus,keep-config is used.
 
  - devbus,rd-hold-ps:   Defines the time between the last data sample to the
                        de-assertion of DEV_CSn. If set to 0 (default),
@@ -62,16 +77,20 @@ Read parameters:
                         last data sampled. Also this parameter has no
                         affect on <turn-off-ps> parameter.
                         Set <rd-hold-ps> to a value smaller than <turn-off-ps>.
+                        Mandatory for "marvell,mvebu-devbus" compatible string,
+                        except if devbus,keep-config is used.
 
 Write parameters:
 
  - devbus,ale-wr-ps:    Defines the time delay from the ALE[0] negation cycle
                        to the DEV_WEn assertion.
+                        Mandatory.
 
  - devbus,wr-low-ps:    Defines the time during which DEV_WEn is active.
                         A[2:0] and Data are kept valid as long as DEV_WEn
                         is active. This parameter defines the setup time of
                         address and data to DEV_WEn rise.
+                        Mandatory.
 
  - devbus,wr-high-ps:   Defines the time during which DEV_WEn is kept
                         inactive (high) between data beats of a burst write.
@@ -79,10 +98,13 @@ Write parameters:
                         <wr-high-ps> - <tick> ps.
                        This parameter defines the hold time of address and
                        data after DEV_WEn rise.
+                        Mandatory.
 
  - devbus,sync-enable: Synchronous device enable.
                        1: True
                        0: False
+                       Mandatory for "marvell,mvebu-devbus" compatible string,
+                       except if devbus,keep-config is used.
 
 An example for an Armada XP GP board, with a 16 MiB NOR device as child
 is showed below. Note that the Device Bus driver is in charge of allocating
similarity index 85%
rename from Documentation/devicetree/bindings/arm/altera/socfpga-reset.txt
rename to Documentation/devicetree/bindings/reset/socfpga-reset.txt
index ecdb57d69dbfbe90f2796be9aeea5bb6115e32aa..32c1c8bfd5dc55ea813275bf71c5b96699bf279b 100644 (file)
@@ -3,9 +3,11 @@ Altera SOCFPGA Reset Manager
 Required properties:
 - compatible : "altr,rst-mgr"
 - reg : Should contain 1 register ranges(address and length)
+- #reset-cells: 1
 
 Example:
         rstmgr@ffd05000 {
+               #reset-cells = <1>;
                compatible = "altr,rst-mgr";
                reg = <0xffd05000 0x1000>;
        };
index abc308083acb204c7625c5d53ed58d546c65f755..53bd92f80314b2703912c723c759d4624af4baf4 100644 (file)
@@ -79,6 +79,7 @@ microchip     Microchip Technology Inc.
 mosaixtech     Mosaix Technologies, Inc.
 moxa   Moxa
 mpl    MPL AG
+mundoreader    Mundo Reader S.L.
 mxicy  Macronix International Co., Ltd.
 national       National Semiconductor
 neonode                Neonode Inc.
@@ -98,6 +99,7 @@ powervr       PowerVR (deprecated, use img)
 qca    Qualcomm Atheros, Inc.
 qcom   Qualcomm Technologies, Inc
 qnap   QNAP Systems, Inc.
+radxa  Radxa
 raidsonic      RaidSonic Technology GmbH
 ralink Mediatek/Ralink Technology Corp.
 ramtron        Ramtron International
index 37c00193b9aa2fd6bbee15cc23535f5419d3ec69..62ad8e54489b2ab99b88d4af8363f969e4652a77 100644 (file)
@@ -1617,12 +1617,6 @@ S:       Supported
 F:     drivers/misc/atmel_tclib.c
 F:     drivers/clocksource/tcb_clksrc.c
 
-ATMEL TSADCC DRIVER
-M:     Josh Wu <josh.wu@atmel.com>
-L:     linux-input@vger.kernel.org
-S:     Supported
-F:     drivers/input/touchscreen/atmel_tsadcc.c
-
 ATMEL USBA UDC DRIVER
 M:     Nicolas Ferre <nicolas.ferre@atmel.com>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
index 696e993da7e390be2262dcab5dcc09890689b40e..216ecbdfddf408db6fbbf99e00d0f4d2f2985411 100644 (file)
@@ -376,7 +376,6 @@ config ARCH_AT91
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
        select IRQ_DOMAIN
-       select NEED_MACH_GPIO_H
        select NEED_MACH_IO_H if PCCARD
        select PINCTRL
        select PINCTRL_AT91 if USE_OF
diff --git a/arch/arm/arm-soc-for-next-contents.txt b/arch/arm/arm-soc-for-next-contents.txt
new file mode 100644 (file)
index 0000000..eb6d2eb
--- /dev/null
@@ -0,0 +1,84 @@
+next/fixes-non-critical
+
+next/cleanup
+       versatile/leds
+               git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator tags/versatile-leds
+       cleanup/kconfig
+               git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux tags/kconfig-cleanups
+               contains randconfig-fixes
+       renesas/cleanup
+               git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas tags/renesas-cleanup-for-v3.16
+       patch
+               leds: Fix build for LEDS_CLASS=m on versatile
+       sirf/soc
+               git://git.kernel.org/pub/scm/linux/kernel/git/baohua/linux tags/sirf-soc-for-3.16
+
+next/soc
+       renesas/soc
+               git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas tags/renesas-soc-for-v3.16
+       renesas/clock
+               git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas tags/renesas-clock-for-v3.16
+       renesas/soc2
+               git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas tags/renesas-soc2-for-v3.16
+       at91/cleanup
+               git://github.com/at91linux/linux-at91 tags/at91-cleanup
+       mvebu/soc-orion5x
+               git://git.infradead.org/linux-mvebu tags/mvebu-soc-orion5x-3.16
+       mvebu/soc
+               git://git.infradead.org/linux-mvebu tags/mvebu-soc-3.16
+               contains depends/irqchip-mvebu
+       cleanup/kconfig
+               Merge branch 'cleanup/kconfig' into next/soc
+       renesas/clock2
+               git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas tags/renesas-clock2-for-v3.16
+       renesas/soc-cleanup
+               git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas tags/renesas-soc-cleanup-for-v3.16
+       sti/soc
+               git://git.stlinux.com/devel/kernel/linux-sti tags/sti-soc-for-v3.16
+
+next/boards
+       shmobile/defconfig
+               git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas tags/renesas-defconfig-for-v3.16
+       patch
+               ARM: multi_v7: enable AT24C EEPROM driver
+               ARM: multi_v7_defconfig: select CONFIG_GPIO_DWAPB
+               ARM: multi_v7_defconfig: Select CONFIG_MACH_BERLIN_BG2Q
+       renesas/clock
+               Merge branch 'renesas/clock' into next/boards
+       renesas/boards
+               git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas tags/renesas-boards-for-v3.16
+       patch
+               ARM: configs: add CONFIG_MMC_SDHCI_PXAV3 to the multi_v7_defconfig
+               ARM: configs: enable XHCI mvebu support in multi_v7_defconfig
+       mvebu/defconfig
+               git://git.infradead.org/linux-mvebu tags/mvebu-defconfig-3.16
+       renesas/boards2
+               git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas tags/renesas-boards2-for-v3.16
+       patch
+               ARM: add drivers for Colibri T30 to multi_v7_defconfig
+
+next/dt
+       at91/dt
+               git://github.com/at91linux/linux-at91 tags/at91-dt
+       renesas/dt
+               git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas tags/renesas-dt-for-v3.16
+       renesas/dt2
+               git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas tags/renesas-dt2-for-v3.16
+       socfpga/dt
+               git://git.rocketboards.org/linux-socfpga-next tags/socfpga-dt-updates-for-3.16_v3
+       mvebu/dt
+               git://git.infradead.org/linux-mvebu tags/mvebu-dt-3.16
+       rockchip/dt
+               git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip tags/v3.16-rockchip-dt
+       keystone/dt
+               git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone tags/keystone-dts
+       at91/dt2
+               git://github.com/at91linux/linux-at91 tags/at91-dt2
+       renesas/dt3
+               git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas tags/renesas-dt3-for-v3.16
+
+next/drivers
+       socfpga/reset-driver
+               git://git.rocketboards.org/linux-socfpga-next tags/socfpga-driver-update-for-3.16
+       mvebu/drivers
+               git://git.infradead.org/linux-mvebu tags/mvebu-drivers-3.16
index 377b7c3640337ed994107814836d16909ddbd447..c6b911c27e613bd8bf2c2bea41e0d3deedfbc538 100644 (file)
@@ -289,7 +289,10 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
        am43x-epos-evm.dtb \
        am437x-gp-evm.dtb \
        dra7-evm.dtb
-dtb-$(CONFIG_ARCH_ORION5X) += orion5x-lacie-ethernet-disk-mini-v2.dtb
+dtb-$(CONFIG_ARCH_ORION5X) += orion5x-lacie-d2-network.dtb \
+       orion5x-lacie-ethernet-disk-mini-v2.dtb \
+       orion5x-maxtor-shared-storage-2.dtb \
+       orion5x-rd88f5182-nas.dtb
 dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb
 dtb-$(CONFIG_ARCH_QCOM) += qcom-msm8660-surf.dtb \
        qcom-msm8960-cdp.dtb \
@@ -297,8 +300,7 @@ dtb-$(CONFIG_ARCH_QCOM) += qcom-msm8660-surf.dtb \
 dtb-$(CONFIG_ARCH_S3C24XX) += s3c2416-smdk2416.dtb
 dtb-$(CONFIG_ARCH_S3C64XX) += s3c6410-mini6410.dtb \
        s3c6410-smdk6410.dtb
-dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += emev2-kzm9d.dtb \
-       r7s72100-genmai.dtb \
+dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += r7s72100-genmai.dtb \
        r7s72100-genmai-reference.dtb \
        r8a7740-armadillo800eva.dtb \
        r8a7778-bockw.dtb \
@@ -315,11 +317,13 @@ dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += emev2-kzm9d.dtb \
        sh7372-mackerel.dtb
 dtb-$(CONFIG_ARCH_SHMOBILE_MULTI) += emev2-kzm9d.dtb \
        r7s72100-genmai-reference.dtb \
+       r8a7791-henninger.dtb \
        r8a7791-koelsch.dtb \
        r8a7790-lager.dtb
 dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_arria5_socdk.dtb \
        socfpga_cyclone5_socdk.dtb \
        socfpga_cyclone5_sockit.dtb \
+       socfpga_cyclone5_socrates.dtb \
        socfpga_vt.dtb
 dtb-$(CONFIG_ARCH_SPEAR13XX) += spear1310-evb.dtb \
        spear1340-evb.dtb
index 3383c4b668035737e1812777fed34a03f5f9ef7c..416f4e5a69c154cbf673d22bcf7021d63b2267ec 100644 (file)
@@ -35,7 +35,6 @@
 
                internal-regs {
                        serial@12000 {
-                               clock-frequency = <200000000>;
                                status = "okay";
                        };
                        sata@a0000 {
index 2354fe023ee01ee6f9df5e1b0f23e6e9498acf86..097df7d8f0f6c624fb5531d0257d7f5f67eee4fc 100644 (file)
@@ -47,7 +47,6 @@
 
                internal-regs {
                        serial@12000 {
-                               clock-frequency = <200000000>;
                                status = "okay";
                        };
                        timer@20300 {
index 651aeb5ef43956e27cb945ae1e5d6dc2bce560e9..d6d572e5af321482b20aa1fd08baed1f445a37eb 100644 (file)
@@ -50,7 +50,6 @@
 
                internal-regs {
                        serial@12000 {
-                               clock-frequency = <200000000>;
                                status = "okay";
                        };
 
index 4e27587667bf5df680bb18af95f43633e90fced1..c5fe8b5dcdc7dab6250597efb80b7b2b0c8ea321 100644 (file)
@@ -50,7 +50,6 @@
 
                internal-regs {
                        serial@12000 {
-                               clock-frequency = <200000000>;
                                status = "okay";
                        };
 
index 3e2c857d600008a896d3402572fedd8d68bbf624..4169f4096ea3bd6885339f31106135c89b6fc681 100644 (file)
@@ -51,7 +51,6 @@
 
                internal-regs {
                        serial@12000 {
-                               clock-frequency = <200000000>;
                                status = "okay";
                        };
                        sata@a0000 {
index bb77970c0b1223499137ef80079ad39446919f42..23227e0027ec3f96baf017d3e84fafe4319ff683 100644 (file)
                                reg-shift = <2>;
                                interrupts = <41>;
                                reg-io-width = <1>;
+                               clocks = <&coreclk 0>;
                                status = "disabled";
                        };
                        serial@12100 {
                                reg-shift = <2>;
                                interrupts = <42>;
                                reg-io-width = <1>;
+                               clocks = <&coreclk 0>;
                                status = "disabled";
                        };
 
                                reg = <0x20300 0x34>, <0x20704 0x4>;
                        };
 
+                       pmsu@22000 {
+                               compatible = "marvell,armada-370-pmsu";
+                               reg = <0x22000 0x1000>;
+                       };
+
                        usb@50000 {
                                compatible = "marvell,orion-ehci";
                                reg = <0x50000 0x500>;
index af1f11e9e5a011d526f64f8afaa60d000ef87542..21b588b6f6bd7559d30109e27913e9ea27919dc6 100644 (file)
                                clocks = <&coreclk 2>;
                        };
 
+                       cpurst@20800 {
+                               compatible = "marvell,armada-370-cpu-reset";
+                               reg = <0x20800 0x8>;
+                       };
+
                        audio_controller: audio-controller@30000 {
                                compatible = "marvell,armada370-audio";
                                reg = <0x30000 0x4000>;
index 0451124e8ebf49af45b34072ae69a02a6fa133a9..20f1f33c947d730c89456c1554137afd7b457a18 100644 (file)
@@ -68,7 +68,6 @@
                        };
 
                        serial@12000 {
-                               clock-frequency = <200000000>;
                                status = "okay";
                        };
 
index 3877693fb2d875ef0249a67aa748f00e557f32f3..3b6de4c0e37922cb7bfa7d4fb1850b05de0913b2 100644 (file)
@@ -39,6 +39,8 @@
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
+               enable-method = "marvell,armada-375-smp";
+
                cpu@0 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a9";
                                cache-level = <2>;
                        };
 
+                       scu@c000 {
+                               compatible = "arm,cortex-a9-scu";
+                               reg = <0xc000 0x58>;
+                       };
+
                        timer@c600 {
                                compatible = "arm,cortex-a9-twd-timer";
                                reg = <0xc600 0x20>;
                                reg-shift = <2>;
                                interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
                                reg-io-width = <1>;
+                               clocks = <&coreclk 0>;
                                status = "disabled";
                        };
 
                                reg-shift = <2>;
                                interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
                                reg-io-width = <1>;
+                               clocks = <&coreclk 0>;
                                status = "disabled";
                        };
 
                                clocks = <&coreclk 0>;
                        };
 
+                       watchdog@20300 {
+                               compatible = "marvell,armada-375-wdt";
+                               reg = <0x20300 0x34>, <0x20704 0x4>, <0x18254 0x4>;
+                               clocks = <&coreclk 0>;
+                       };
+
+                       cpurst@20800 {
+                               compatible = "marvell,armada-370-cpu-reset";
+                               reg = <0x20800 0x10>;
+                       };
+
+                       coherency-fabric@21010 {
+                               compatible = "marvell,armada-375-coherency-fabric";
+                               reg = <0x21010 0x1c>;
+                       };
+
                        xor@60800 {
                                compatible = "marvell,orion-xor";
                                reg = <0x60800 0x100
                                status = "disabled";
                        };
 
+                       thermal@e8078 {
+                               compatible = "marvell,armada375-thermal";
+                               reg = <0xe8078 0x4>, <0xe807c 0x8>;
+                               status = "okay";
+                       };
+
                        coreclk: mvebu-sar@e8204 {
                                compatible = "marvell,armada-375-core-clock";
                                reg = <0xe8204 0x04>;
index 068031f0f263ef081f590eae7ac3da0df629ab2d..aa71718b549d0a7d5278d14641ff4a130cdb6d70 100644 (file)
@@ -21,6 +21,8 @@
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
+               enable-method = "marvell,armada-380-smp";
+
                cpu@0 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a9";
index 6828d77696a67647397c568e5bce65f007e0c10d..7fcbc0d2a85ff868329058c9eab96ba518f7b073 100644 (file)
@@ -55,7 +55,6 @@
                        };
 
                        serial@12000 {
-                               clock-frequency = <200000000>;
                                status = "okay";
                        };
 
                                };
                        };
 
+                       sata@a8000 {
+                               status = "okay";
+                       };
+
+                       sata@e0000 {
+                               status = "okay";
+                       };
+
                        flash@d0000 {
                                status = "okay";
                                num-cs = <1>;
                                        reg = <0x1000000 0x3f000000>;
                                };
                        };
+
+                       sdhci@d8000 {
+                               clock-frequency = <200000000>;
+                               broken-cd;
+                               wp-inverted;
+                               bus-width = <8>;
+                               status = "okay";
+                       };
                };
 
                pcie-controller {
index 45250c88814b89c6b83213c7572c8896f7190e2b..4b39bed4ed07d11e4e1b70613a782b74694b8650 100644 (file)
@@ -51,7 +51,6 @@
                        };
 
                        serial@12000 {
-                               clock-frequency = <200000000>;
                                status = "okay";
                        };
 
index e2919f02e1d47687c77477b1a9bd389a32a4134e..2c7990d6efa220e4524de0ecb5913c05ad953a96 100644 (file)
@@ -21,6 +21,8 @@
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
+               enable-method = "marvell,armada-380-smp";
+
                cpu@0 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a9";
index ca8813bb99ba627d52e7c9d163005d39481f3e1a..6ee59a34408902e4ab8182ceff8a1900841090b3 100644 (file)
                                cache-level = <2>;
                        };
 
+                       scu@c000 {
+                               compatible = "arm,cortex-a9-scu";
+                               reg = <0xc000 0x58>;
+                       };
+
                        timer@c600 {
                                compatible = "arm,cortex-a9-twd-timer";
                                reg = <0xc600 0x20>;
                                reg-shift = <2>;
                                interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
                                reg-io-width = <1>;
+                               clocks = <&coreclk 0>;
                                status = "disabled";
                        };
 
                                reg-shift = <2>;
                                interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
                                reg-io-width = <1>;
+                               clocks = <&coreclk 0>;
                                status = "disabled";
                        };
 
                                clock-names = "nbclk", "fixed";
                        };
 
+                       watchdog@20300 {
+                               compatible = "marvell,armada-380-wdt";
+                               reg = <0x20300 0x34>, <0x20704 0x4>, <0x18260 0x4>;
+                               clocks = <&coreclk 2>, <&refclk>;
+                               clock-names = "nbclk", "fixed";
+                       };
+
+                       cpurst@20800 {
+                               compatible = "marvell,armada-370-cpu-reset";
+                               reg = <0x20800 0x10>;
+                       };
+
+                       coherency-fabric@21010 {
+                               compatible = "marvell,armada-380-coherency-fabric";
+                               reg = <0x21010 0x1c>;
+                       };
+
+                       pmsu@22000 {
+                               compatible = "marvell,armada-380-pmsu";
+                               reg = <0x22000 0x1000>;
+                       };
+
                        eth1: ethernet@30000 {
                                compatible = "marvell,armada-370-neta";
                                reg = <0x30000 0x4000>;
                                clocks = <&gateclk 4>;
                        };
 
+                       sata@a8000 {
+                               compatible = "marvell,armada-380-ahci";
+                               reg = <0xa8000 0x2000>;
+                               interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&gateclk 15>;
+                               status = "disabled";
+                       };
+
+                       sata@e0000 {
+                               compatible = "marvell,armada-380-ahci";
+                               reg = <0xe0000 0x2000>;
+                               interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&gateclk 30>;
+                               status = "disabled";
+                       };
+
                        coredivclk: clock@e4250 {
                                compatible = "marvell,armada-380-corediv-clock";
                                reg = <0xe4250 0xc>;
                                clock-output-names = "nand";
                        };
 
+                       thermal@e8078 {
+                               compatible = "marvell,armada380-thermal";
+                               reg = <0xe4078 0x4>, <0xe4074 0x4>;
+                               status = "okay";
+                       };
+
                        flash@d0000 {
                                compatible = "marvell,armada370-nand";
                                reg = <0xd0000 0x54>;
                                clocks = <&coredivclk 0>;
                                status = "disabled";
                        };
+
+                       sdhci@d8000 {
+                               compatible = "marvell,armada-380-sdhci";
+                               reg = <0xd8000 0x1000>, <0xdc000 0x100>;
+                               interrupts = <0 25 0x4>;
+                               clocks = <&gateclk 17>;
+                               mrvl,clk-delay-cycles = <0x1F>;
+                               status = "disabled";
+                       };
                };
        };
 
index d83d7d69ac01ff7f33c33677ff16bf7d906d5f1c..a55a97a705056a72a0e480c9c6a60fc4c1a50381 100644 (file)
                        };
 
                        serial@12000 {
-                               clock-frequency = <250000000>;
                                status = "okay";
                        };
 
                        serial@12100 {
-                               clock-frequency = <250000000>;
                                status = "okay";
                        };
 
index 90f0bf6f92715c7335072bda5b508e7800fa89a4..42ddb2864365684a046bbb64461dc096b96c022e 100644 (file)
 
                internal-regs {
                        serial@12000 {
-                               clock-frequency = <250000000>;
                                status = "okay";
                        };
                        serial@12100 {
-                               clock-frequency = <250000000>;
                                status = "okay";
                        };
                        serial@12200 {
-                               clock-frequency = <250000000>;
                                status = "okay";
                        };
                        serial@12300 {
-                               clock-frequency = <250000000>;
                                status = "okay";
                        };
 
index 0c756421ae6aa5f504b72898c16875bdaab5f8d3..0478c55ca6567a6e780098598ef0a36d2fb223ea 100644 (file)
 
                internal-regs {
                        serial@12000 {
-                               clock-frequency = <250000000>;
                                status = "okay";
                        };
                        serial@12100 {
-                               clock-frequency = <250000000>;
                                status = "okay";
                        };
                        serial@12200 {
-                               clock-frequency = <250000000>;
                                status = "okay";
                        };
                        serial@12300 {
-                               clock-frequency = <250000000>;
                                status = "okay";
                        };
 
index c2242745b9b87a29afcfcc2fc77bf9178d5814f9..25674fe81f703d279dc154ff75d02d366b34cef6 100644 (file)
 
                internal-regs {
                        serial@12000 {
-                               clock-frequency = <250000000>;
                                status = "okay";
                        };
                        serial@12100 {
-                               clock-frequency = <250000000>;
                                status = "okay";
                        };
                        serial@12200 {
-                               clock-frequency = <250000000>;
                                status = "okay";
                        };
                        serial@12300 {
-                               clock-frequency = <250000000>;
                                status = "okay";
                        };
 
index 98335fb34b7ad5a11d9f40b6564bddc161431455..1257ff1ed278e68a33793eb9cf0c40be08e0b169 100644 (file)
@@ -27,6 +27,7 @@
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
+               enable-method = "marvell,armada-xp-smp";
 
                cpu@0 {
                        device_type = "cpu";
index 9480cf891f8cd0ce475d87cf2eed904a6a740eb7..3396b25b39e179cb1a444435adfa28c87385e8ed 100644 (file)
@@ -29,6 +29,7 @@
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
+               enable-method = "marvell,armada-xp-smp";
 
                cpu@0 {
                        device_type = "cpu";
index 31ba6d8fbadf8803f28aca6312c8205c79c23aee..6da84bf40aaf48849d308453755c1eca3605396b 100644 (file)
@@ -30,6 +30,7 @@
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
+               enable-method = "marvell,armada-xp-smp";
 
                cpu@0 {
                        device_type = "cpu";
index ff049ee862ebd2d8a271d70a0b2e20206f47592f..0cf999abc4ed768abf20b2b32c9d5299a7be9a71 100644 (file)
                        };
 
                        serial@12000 {
-                               clocks = <&coreclk 0>;
                                status = "okay";
                        };
 
index 5d42feb3104983a2ee9b21be33b59cc2e66a1bcd..e5c6a0492ca00b922c5a5cebae7e770de2e15e2f 100644 (file)
 
                internal-regs {
                        serial@12000 {
-                               clock-frequency = <250000000>;
                                status = "okay";
                        };
                        serial@12100 {
-                               clock-frequency = <250000000>;
                                status = "okay";
                        };
                        pinctrl {
index abb9f9dcc525a6a7c1583e5f1f7c65d4ff29e485..5902e8359c9165c33cc265b0a304df33acb640b5 100644 (file)
@@ -58,6 +58,7 @@
                                reg-shift = <2>;
                                interrupts = <43>;
                                reg-io-width = <1>;
+                               clocks = <&coreclk 0>;
                                status = "disabled";
                        };
                        serial@12300 {
@@ -66,6 +67,7 @@
                                reg-shift = <2>;
                                interrupts = <44>;
                                reg-io-width = <1>;
+                               clocks = <&coreclk 0>;
                                status = "disabled";
                        };
 
                                clock-names = "nbclk", "fixed";
                        };
 
-                       armada-370-xp-pmsu@22000 {
-                               compatible = "marvell,armada-370-xp-pmsu";
-                               reg = <0x22100 0x400>, <0x20800 0x20>;
+                       cpurst@20800 {
+                               compatible = "marvell,armada-370-cpu-reset";
+                               reg = <0x20800 0x20>;
                        };
 
                        eth2: ethernet@30000 {
index a542d5837a17be14c1f82547c59529d4a59f5ce7..27ebb0f722fdbd724fe83089b86cae39eed2b5ee 100644 (file)
                                status = "okay";
                        };
 
-
-                       tsadcc: tsadcc@f804c000 {
-                               status = "okay";
-                       };
-
                        rtc@fffffeb0 {
                                status = "okay";
                        };
index 4537259ce5299baf8cf68978d7c2d106c5f67c32..5b8e40400becbd57fb2ca3e03d3b411dfb7e6dd7 100644 (file)
                reg = <0x20000000 0x10000000>;
        };
 
+       slow_xtal {
+               clock-frequency = <32768>;
+       };
+
+       main_xtal {
+               clock-frequency = <12000000>;
+       };
+
        ahb {
                apb {
                        mmc0: mmc@f0000000 {
                        };
 
                        i2c0: i2c@f0014000 {
+                               pinctrl-0 = <&pinctrl_i2c0_pu>;
                                status = "okay";
                        };
 
                        i2c1: i2c@f0018000 {
                                status = "okay";
+
+                               pmic: act8865@5b {
+                                       compatible = "active-semi,act8865";
+                                       reg = <0x5b>;
+                                       status = "okay";
+
+                                       regulators {
+                                               vcc_1v8_reg: DCDC_REG1 {
+                                                       regulator-name = "VCC_1V8";
+                                                       regulator-min-microvolt = <1800000>;
+                                                       regulator-max-microvolt = <1800000>;
+                                                       regulator-always-on;
+                                               };
+
+                                               vcc_1v2_reg: DCDC_REG2 {
+                                                       regulator-name = "VCC_1V2";
+                                                       regulator-min-microvolt = <1200000>;
+                                                       regulator-max-microvolt = <1200000>;
+                                                       regulator-always-on;
+                                               };
+
+                                               vcc_3v3_reg: DCDC_REG3 {
+                                                       regulator-name = "VCC_3V3";
+                                                       regulator-min-microvolt = <3300000>;
+                                                       regulator-max-microvolt = <3300000>;
+                                                       regulator-always-on;
+                                               };
+
+                                               vddfuse_reg: LDO_REG1 {
+                                                       regulator-name = "FUSE_2V5";
+                                                       regulator-min-microvolt = <2500000>;
+                                                       regulator-max-microvolt = <2500000>;
+                                               };
+
+                                               vddana_reg: LDO_REG2 {
+                                                       regulator-name = "VDDANA";
+                                                       regulator-min-microvolt = <3300000>;
+                                                       regulator-max-microvolt = <3300000>;
+                                                       regulator-always-on;
+                                               };
+                                       };
+                               };
                        };
 
                        macb0: ethernet@f0028000 {
                                status = "okay";
                        };
 
+                       pwm0: pwm@f002c000 {
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_pwm0_pwmh0_0 &pinctrl_pwm0_pwmh1_0>;
+                               status = "okay";
+                       };
+
                        usart0: serial@f001c000 {
                                status = "okay";
                        };
 
                        i2c2: i2c@f801c000 {
                                dmas = <0>, <0>;        /* Do not use DMA for i2c2 */
+                               pinctrl-0 = <&pinctrl_i2c2_pu>;
                                status = "okay";
                        };
 
 
                        pinctrl@fffff200 {
                                board {
+                                       pinctrl_i2c0_pu: i2c0_pu {
+                                               atmel,pins =
+                                                       <AT91_PIOA 30 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>,
+                                                       <AT91_PIOA 31 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
+                                       };
+
+                                       pinctrl_i2c2_pu: i2c2_pu {
+                                               atmel,pins =
+                                                       <AT91_PIOA 18 AT91_PERIPH_B AT91_PINCTRL_PULL_UP>,
+                                                       <AT91_PIOA 19 AT91_PERIPH_B AT91_PINCTRL_PULL_UP>;
+                                       };
+
                                        pinctrl_mmc0_cd: mmc0_cd {
                                                atmel,pins =
                                                        <AT91_PIOE 0 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
index 3be973e9889a2b0ef29cc45657ad6eeb056e7f5f..b309c1c6e848958d3af6c6679a1dc19402329402 100644 (file)
@@ -29,6 +29,7 @@
                i2c0 = &i2c0;
                ssc0 = &ssc0;
                ssc1 = &ssc1;
+               ssc2 = &ssc2;
        };
 
        cpus {
                reg = <0x20000000 0x08000000>;
        };
 
+       main_xtal: main_xtal {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <0>;
+       };
+
+       slow_xtal: slow_xtal {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <0>;
+       };
+
        ahb {
                compatible = "simple-bus";
                #address-cells = <1>;
                                interrupts = <14 IRQ_TYPE_LEVEL_HIGH 5>;
                                pinctrl-names = "default";
                                pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
+                               clocks = <&ssc0_clk>;
+                               clock-names = "pclk";
                                status = "disabled";
                        };
 
                                interrupts = <15 IRQ_TYPE_LEVEL_HIGH 5>;
                                pinctrl-names = "default";
                                pinctrl-0 = <&pinctrl_ssc1_tx &pinctrl_ssc1_rx>;
+                               clocks = <&ssc1_clk>;
+                               clock-names = "pclk";
+                               status = "disabled";
+                       };
+
+                       ssc2: ssc@fffc4000 {
+                               compatible = "atmel,at91rm9200-ssc";
+                               reg = <0xfffc4000 0x4000>;
+                               interrupts = <16 IRQ_TYPE_LEVEL_HIGH 5>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_ssc2_tx &pinctrl_ssc2_rx>;
+                               clocks = <&ssc2_clk>;
+                               clock-names = "pclk";
                                status = "disabled";
                        };
 
                                        };
                                };
 
+                               ssc2 {
+                                       pinctrl_ssc2_tx: ssc2_tx-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOC 25 AT91_PERIPH_B AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOC 26 AT91_PERIPH_B AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOC 27 AT91_PERIPH_B AT91_PINCTRL_NONE>;
+                                       };
+
+                                       pinctrl_ssc2_rx: ssc2_rx-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOC 28 AT91_PERIPH_B AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOC 29 AT91_PERIPH_B AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOC 30 AT91_PERIPH_B AT91_PINCTRL_NONE>;
+                                       };
+                               };
+
                                spi0 {
                                        pinctrl_spi0: spi0-0 {
                                                atmel,pins =
                                #size-cells = <0>;
                                #interrupt-cells = <1>;
 
-                               clk32k: slck {
+                               slow_rc_osc: slow_rc_osc {
                                        compatible = "fixed-clock";
                                        #clock-cells = <0>;
                                        clock-frequency = <32768>;
+                                       clock-accuracy = <50000000>;
+                               };
+
+                               clk32k: slck {
+                                       compatible = "atmel,at91sam9260-clk-slow";
+                                       #clock-cells = <0>;
+                                       clocks = <&slow_rc_osc &slow_xtal>;
                                };
 
                                main: mainck {
                                        compatible = "atmel,at91rm9200-clk-main";
                                        #clock-cells = <0>;
                                        interrupts-extended = <&pmc AT91_PMC_MOSCS>;
-                                       clocks = <&clk32k>;
+                                       clocks = <&main_xtal>;
                                };
 
                                plla: pllack {
                                        reg = <0>;
                                        atmel,clk-input-range = <1000000 32000000>;
                                        #atmel,pll-clk-output-range-cells = <4>;
-                                       atmel,pll-clk-output-ranges = <80000000 200000000 190000000 240000000>;
+                                       atmel,pll-clk-output-ranges = <80000000 200000000 0 1>,
+                                                               <190000000 240000000 2 1>;
                                };
 
                                pllb: pllbck {
                                        interrupts-extended = <&pmc AT91_PMC_LOCKB>;
                                        clocks = <&main>;
                                        reg = <1>;
-                                       atmel,clk-input-range = <1000000 32000000>;
+                                       atmel,clk-input-range = <1000000 5000000>;
                                        #atmel,pll-clk-output-range-cells = <4>;
-                                       atmel,pll-clk-output-ranges = <80000000 200000000 190000000 240000000>;
+                                       atmel,pll-clk-output-ranges = <70000000 130000000 1 1>;
                                };
 
                                mck: masterck {
                                        interrupts-extended = <&pmc AT91_PMC_MCKRDY>;
                                        clocks = <&clk32k>, <&main>, <&plla>, <&pllb>;
                                        atmel,clk-output-range = <0 94000000>;
-                                       atmel,clk-divisors = <1 2 4 3>;
+                                       atmel,clk-divisors = <1 2 4 0>;
                                };
 
                                usb: usbck {
                                        compatible = "atmel,at91rm9200-clk-usb";
                                        #clock-cells = <0>;
-                                       atmel,clk-divisors = <1 2 4 3>;
+                                       atmel,clk-divisors = <1 2 4 0>;
                                        clocks = <&pllb>;
                                };
 
+                               prog: progck {
+                                       compatible = "atmel,at91rm9200-clk-programmable";
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       interrupt-parent = <&pmc>;
+                                       clocks = <&clk32k>, <&main>, <&plla>, <&pllb>;
+
+                                       prog0: prog0 {
+                                               #clock-cells = <0>;
+                                               reg = <0>;
+                                               interrupts = <AT91_PMC_PCKRDY(0)>;
+                                       };
+
+                                       prog1: prog1 {
+                                               #clock-cells = <0>;
+                                               reg = <1>;
+                                               interrupts = <AT91_PMC_PCKRDY(1)>;
+                                       };
+
+                                       prog2: prog2 {
+                                               #clock-cells = <0>;
+                                               reg = <2>;
+                                               interrupts = <AT91_PMC_PCKRDY(2)>;
+                                       };
+
+                                       prog3: prog3 {
+                                               #clock-cells = <0>;
+                                               reg = <3>;
+                                               interrupts = <AT91_PMC_PCKRDY(3)>;
+                                       };
+                               };
+
                                systemck {
                                        compatible = "atmel,at91rm9200-clk-system";
                                        #address-cells = <1>;
                                                clocks = <&usb>;
                                        };
 
+                                       pck0: pck0 {
+                                               #clock-cells = <0>;
+                                               reg = <8>;
+                                               clocks = <&prog0>;
+                                       };
+
+                                       pck1: pck1 {
+                                               #clock-cells = <0>;
+                                               reg = <9>;
+                                               clocks = <&prog1>;
+                                       };
+
+                                       pck2: pck2 {
+                                               #clock-cells = <0>;
+                                               reg = <10>;
+                                               clocks = <&prog2>;
+                                       };
+
+                                       pck3: pck3 {
+                                               #clock-cells = <0>;
+                                               reg = <11>;
+                                               clocks = <&prog3>;
+                                       };
+
                                        hclk0: hclk0 {
                                                #clock-cells = <0>;
                                                reg = <16>;
                                                reg = <13>;
                                        };
 
+                                       ssc0_clk: ssc0_clk {
+                                               #clock-cells = <0>;
+                                               reg = <14>;
+                                       };
+
+                                       ssc1_clk: ssc1_clk {
+                                               #clock-cells = <0>;
+                                               reg = <15>;
+                                       };
+
+                                       ssc2_clk: ssc2_clk {
+                                               #clock-cells = <0>;
+                                               reg = <16>;
+                                       };
+
                                        tc0_clk: tc0_clk {
                                                #clock-cells = <0>;
                                                reg = <17>;
index 2ce527e70c7abb45f37e759377f3ee9400f69ee8..c6683ea8b74350b2dace53015b43d1f78b3a7762 100644 (file)
                reg = <0x20000000 0x4000000>;
        };
 
+       main_xtal {
+               clock-frequency = <18432000>;
+       };
+
        clocks {
                #address-cells = <1>;
                #size-cells = <1>;
index 9cdaecff13b3996932fc7564a8c4927cd97024c6..ace6bf197b708dd79e29054773d50c5f1a3fd864 100644 (file)
                                      >;
 
                                /* shared pinctrl settings */
+                               adc0 {
+                                       pinctrl_adc0_adtrg: adc0_adtrg {
+                                               atmel,pins = <AT91_PIOD 28 AT91_PERIPH_A AT91_PINCTRL_NONE>;
+                                       };
+                                       pinctrl_adc0_ad0: adc0_ad0 {
+                                               atmel,pins = <AT91_PIOD 20 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
+                                       };
+                                       pinctrl_adc0_ad1: adc0_ad1 {
+                                               atmel,pins = <AT91_PIOD 21 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
+                                       };
+                                       pinctrl_adc0_ad2: adc0_ad2 {
+                                               atmel,pins = <AT91_PIOD 22 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
+                                       };
+                                       pinctrl_adc0_ad3: adc0_ad3 {
+                                               atmel,pins = <AT91_PIOD 23 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
+                                       };
+                                       pinctrl_adc0_ad4: adc0_ad4 {
+                                               atmel,pins = <AT91_PIOD 24 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
+                                       };
+                                       pinctrl_adc0_ad5: adc0_ad5 {
+                                               atmel,pins = <AT91_PIOD 25 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
+                                       };
+                                       pinctrl_adc0_ad6: adc0_ad6 {
+                                               atmel,pins = <AT91_PIOD 26 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
+                                       };
+                                       pinctrl_adc0_ad7: adc0_ad7 {
+                                               atmel,pins = <AT91_PIOD 27 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
+                                       };
+                               };
+
                                dbgu {
                                        pinctrl_dbgu: dbgu-0 {
                                                atmel,pins =
                        adc0: adc@fffb0000 {
                                #address-cells = <1>;
                                #size-cells = <0>;
-                               compatible = "atmel,at91sam9260-adc";
+                               compatible = "atmel,at91sam9g45-adc";
                                reg = <0xfffb0000 0x100>;
                                interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0>;
-                               atmel,adc-use-external-triggers;
                                atmel,adc-channels-used = <0xff>;
                                atmel,adc-vref = <3300>;
                                atmel,adc-startup-time = <40>;
index 7ff665a8c7080b2634fd2095e9b24fb550044a4b..9f5b0a6749955755b75ece053be16d6c563be051 100644 (file)
@@ -8,6 +8,7 @@
  */
 /dts-v1/;
 #include "at91sam9g45.dtsi"
+#include <dt-bindings/pwm/pwm.h>
 
 / {
        model = "Atmel AT91SAM9M10G45-EK";
                                status = "okay";
                        };
 
+                       adc0: adc@fffb0000 {
+                               pinctrl-names = "default";
+                               pinctrl-0 = <
+                                       &pinctrl_adc0_ad0
+                                       &pinctrl_adc0_ad1
+                                       &pinctrl_adc0_ad2
+                                       &pinctrl_adc0_ad3
+                                       &pinctrl_adc0_ad4
+                                       &pinctrl_adc0_ad5
+                                       &pinctrl_adc0_ad6
+                                       &pinctrl_adc0_ad7>;
+                               atmel,adc-ts-wires = <4>;
+                               status = "okay";
+                       };
+
                        pwm0: pwm@fffb8000 {
                                status = "okay";
 
 
                d6 {
                        label = "d6";
-                       pwms = <&pwm0 3 5000 0>;
+                       pwms = <&pwm0 3 5000 PWM_POLARITY_INVERTED>;
                        max-brightness = <255>;
                        linux,default-trigger = "nand-disk";
                };
 
                d7 {
                        label = "d7";
-                       pwms = <&pwm0 1 5000 0>;
+                       pwms = <&pwm0 1 5000 PWM_POLARITY_INVERTED>;
                        max-brightness = <255>;
                        linux,default-trigger = "mmc0";
                };
index 92a52faebef77cd8eda572d11504c0f83362a428..1da183155eeeedad507d95703aebba3f5668c7ae 100644 (file)
@@ -11,6 +11,7 @@
 #include <dt-bindings/clock/at91.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pwm/pwm.h>
 
 / {
        model = "Atmel AT91SAM9RL family SoC";
@@ -32,6 +33,7 @@
                i2c1 = &i2c1;
                ssc0 = &ssc0;
                ssc1 = &ssc1;
+               pwm0 = &pwm0;
        };
 
        cpus {
                reg = <0x20000000 0x04000000>;
        };
 
+       slow_xtal: slow_xtal {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <0>;
+       };
+
+       main_xtal: main_xtal {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <0>;
+       };
+
+       clocks {
+               adc_op_clk: adc_op_clk{
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <1000000>;
+               };
+       };
+
        ahb {
                compatible = "simple-bus";
                #address-cells = <1>;
                #size-cells = <1>;
                ranges;
 
+               fb0: fb@00500000 {
+                       compatible = "atmel,at91sam9rl-lcdc";
+                       reg = <0x00500000 0x1000>;
+                       interrupts = <23 IRQ_TYPE_LEVEL_HIGH 3>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_fb>;
+                       clocks = <&lcd_clk>, <&lcd_clk>;
+                       clock-names = "hclk", "lcdc_clk";
+                       status = "disabled";
+               };
+
                nand0: nand@40000000 {
                        compatible = "atmel,at91rm9200-nand";
                        #address-cells = <1>;
                                status = "disabled";
                        };
 
+                       pwm0: pwm@fffc8000 {
+                               compatible = "atmel,at91sam9rl-pwm";
+                               reg = <0xfffc8000 0x300>;
+                               interrupts = <19 IRQ_TYPE_LEVEL_HIGH 4>;
+                               #pwm-cells = <3>;
+                               clocks = <&pwm_clk>;
+                               clock-names = "pwm_clk";
+                               status = "disabled";
+                       };
+
                        spi0: spi@fffcc000 {
                                #address-cells = <1>;
                                #size-cells = <0>;
                                status = "disabled";
                        };
 
+                       adc0: adc@fffd0000 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               compatible = "atmel,at91sam9rl-adc";
+                               reg = <0xfffd0000 0x100>;
+                               interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0>;
+                               clocks = <&adc_clk>, <&adc_op_clk>;
+                               clock-names = "adc_clk", "adc_op_clk";
+                               atmel,adc-use-external-triggers;
+                               atmel,adc-channels-used = <0x3f>;
+                               atmel,adc-vref = <3300>;
+                               atmel,adc-startup-time = <40>;
+                               atmel,adc-res = <8 10>;
+                               atmel,adc-res-names = "lowres", "highres";
+                               atmel,adc-use-res = "highres";
+
+                               trigger@0 {
+                                       reg = <0>;
+                                       trigger-name = "timer-counter-0";
+                                       trigger-value = <0x1>;
+                               };
+                               trigger@1 {
+                                       reg = <1>;
+                                       trigger-name = "timer-counter-1";
+                                       trigger-value = <0x3>;
+                               };
+
+                               trigger@2 {
+                                       reg = <2>;
+                                       trigger-name = "timer-counter-2";
+                                       trigger-value = <0x5>;
+                               };
+
+                               trigger@3 {
+                                       reg = <3>;
+                                       trigger-name = "external";
+                                       trigger-value = <0x13>;
+                                       trigger-external;
+                               };
+                       };
+
+                       usb0: gadget@fffd4000 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               compatible = "atmel,at91sam9rl-udc";
+                               reg = <0x00600000 0x100000>,
+                                     <0xfffd4000 0x4000>;
+                               interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>;
+                               clocks = <&udphs_clk>, <&utmi>;
+                               clock-names = "pclk", "hclk";
+                               status = "disabled";
+
+                               ep0 {
+                                       reg = <0>;
+                                       atmel,fifo-size = <64>;
+                                       atmel,nb-banks = <1>;
+                               };
+
+                               ep1 {
+                                       reg = <1>;
+                                       atmel,fifo-size = <1024>;
+                                       atmel,nb-banks = <2>;
+                                       atmel,can-dma;
+                                       atmel,can-isoc;
+                               };
+
+                               ep2 {
+                                       reg = <2>;
+                                       atmel,fifo-size = <1024>;
+                                       atmel,nb-banks = <2>;
+                                       atmel,can-dma;
+                                       atmel,can-isoc;
+                               };
+
+                               ep3 {
+                                       reg = <3>;
+                                       atmel,fifo-size = <1024>;
+                                       atmel,nb-banks = <3>;
+                                       atmel,can-dma;
+                               };
+
+                               ep4 {
+                                       reg = <4>;
+                                       atmel,fifo-size = <1024>;
+                                       atmel,nb-banks = <3>;
+                                       atmel,can-dma;
+                               };
+
+                               ep5 {
+                                       reg = <5>;
+                                       atmel,fifo-size = <1024>;
+                                       atmel,nb-banks = <3>;
+                                       atmel,can-dma;
+                                       atmel,can-isoc;
+                               };
+
+                               ep6 {
+                                       reg = <6>;
+                                       atmel,fifo-size = <1024>;
+                                       atmel,nb-banks = <3>;
+                                       atmel,can-dma;
+                                       atmel,can-isoc;
+                               };
+                       };
+
                        ramc0: ramc@ffffea00 {
                                compatible = "atmel,at91sam9260-sdramc";
                                reg = <0xffffea00 0x200>;
                                        <0x003fffff 0x0001ff3c>;  /* pioD */
 
                                /* shared pinctrl settings */
+                               adc0 {
+                                       pinctrl_adc0_ts: adc0_ts-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOA 17 AT91_PERIPH_A AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOA 18 AT91_PERIPH_A AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOA 19 AT91_PERIPH_A AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOA 20 AT91_PERIPH_A AT91_PINCTRL_NONE>;
+                                       };
+
+                                       pinctrl_adc0_ad0: adc0_ad0-0 {
+                                               atmel,pins = <AT91_PIOA 17 AT91_PERIPH_A AT91_PINCTRL_NONE>;
+                                       };
+
+                                       pinctrl_adc0_ad1: adc0_ad1-0 {
+                                               atmel,pins = <AT91_PIOA 18 AT91_PERIPH_A AT91_PINCTRL_NONE>;
+                                       };
+
+                                       pinctrl_adc0_ad2: adc0_ad2-0 {
+                                               atmel,pins = <AT91_PIOA 19 AT91_PERIPH_A AT91_PINCTRL_NONE>;
+                                       };
+
+                                       pinctrl_adc0_ad3: adc0_ad3-0 {
+                                               atmel,pins = <AT91_PIOA 20 AT91_PERIPH_A AT91_PINCTRL_NONE>;
+                                       };
+
+                                       pinctrl_adc0_ad4: adc0_ad4-0 {
+                                               atmel,pins = <AT91_PIOD 6 AT91_PERIPH_A AT91_PINCTRL_NONE>;
+                                       };
+
+                                       pinctrl_adc0_ad5: adc0_ad5-0 {
+                                               atmel,pins = <AT91_PIOD 7 AT91_PERIPH_A AT91_PINCTRL_NONE>;
+                                       };
+
+                                       pinctrl_adc0_adtrg: adc0_adtrg-0 {
+                                               atmel,pins = <AT91_PIOB 15 AT91_PERIPH_A AT91_PINCTRL_NONE>;
+                                       };
+                               };
+
                                dbgu {
                                        pinctrl_dbgu: dbgu-0 {
                                                atmel,pins =
                                        };
                                };
 
+                               fb {
+                                       pinctrl_fb: fb-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOC 1 AT91_PERIPH_B AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOC 3 AT91_PERIPH_A AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOC 5 AT91_PERIPH_A AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOC 6 AT91_PERIPH_A AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOC 7 AT91_PERIPH_A AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOC 9 AT91_PERIPH_B AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOC 10 AT91_PERIPH_B AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOC 11 AT91_PERIPH_B AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOC 12 AT91_PERIPH_B AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOC 13 AT91_PERIPH_B AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOC 15 AT91_PERIPH_B AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOC 16 AT91_PERIPH_B AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOC 17 AT91_PERIPH_B AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOC 18 AT91_PERIPH_B AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOC 19 AT91_PERIPH_B AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOC 20 AT91_PERIPH_B AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOC 21 AT91_PERIPH_B AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOC 22 AT91_PERIPH_B AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOC 23 AT91_PERIPH_B AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOC 24 AT91_PERIPH_B AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOC 25 AT91_PERIPH_B AT91_PINCTRL_NONE>;
+                                       };
+                               };
+
                                i2c_gpio0 {
                                        pinctrl_i2c_gpio0: i2c_gpio0-0 {
                                                atmel,pins =
                                        };
                                };
 
+                               pwm0 {
+                                       pinctrl_pwm0_pwm0_0: pwm0_pwm0-0 {
+                                               atmel,pins = <AT91_PIOB 8 AT91_PERIPH_B AT91_PINCTRL_NONE>;
+                                       };
+
+                                       pinctrl_pwm0_pwm0_1: pwm0_pwm0-1 {
+                                               atmel,pins = <AT91_PIOC 2 AT91_PERIPH_B AT91_PINCTRL_NONE>;
+                                       };
+
+                                       pinctrl_pwm0_pwm0_2: pwm0_pwm0-2 {
+                                               atmel,pins = <AT91_PIOD 14 AT91_PERIPH_B AT91_PINCTRL_NONE>;
+                                       };
+
+                                       pinctrl_pwm0_pwm1_0: pwm0_pwm1-0 {
+                                               atmel,pins = <AT91_PIOB 9 AT91_PERIPH_B AT91_PINCTRL_NONE>;
+                                       };
+
+                                       pinctrl_pwm0_pwm1_1: pwm0_pwm1-1 {
+                                               atmel,pins = <AT91_PIOC 3 AT91_PERIPH_B AT91_PINCTRL_NONE>;
+                                       };
+
+                                       pinctrl_pwm0_pwm1_2: pwm0_pwm1-2 {
+                                               atmel,pins = <AT91_PIOD 15 AT91_PERIPH_B AT91_PINCTRL_NONE>;
+                                       };
+
+                                       pinctrl_pwm0_pwm2_0: pwm0_pwm2-0 {
+                                               atmel,pins = <AT91_PIOD 5 AT91_PERIPH_B AT91_PINCTRL_NONE>;
+                                       };
+
+                                       pinctrl_pwm0_pwm2_1: pwm0_pwm2-1 {
+                                               atmel,pins = <AT91_PIOD 12 AT91_PERIPH_A AT91_PINCTRL_NONE>;
+                                       };
+
+                                       pinctrl_pwm0_pwm2_2: pwm0_pwm2-2 {
+                                               atmel,pins = <AT91_PIOD 16 AT91_PERIPH_B AT91_PINCTRL_NONE>;
+                                       };
+
+                                       pinctrl_pwm0_pwm3_0: pwm0_pwm3-0 {
+                                               atmel,pins = <AT91_PIOD 8 AT91_PERIPH_B AT91_PINCTRL_NONE>;
+                                       };
+
+                                       pinctrl_pwm0_pwm3_1: pwm0_pwm3-1 {
+                                               atmel,pins = <AT91_PIOD 18 AT91_PERIPH_A AT91_PINCTRL_NONE>;
+                                       };
+                               };
+
+                               spi0 {
+                                       pinctrl_spi0: spi0-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOA 25 AT91_PERIPH_A AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOA 26 AT91_PERIPH_A AT91_PINCTRL_NONE>,
+                                                       <AT91_PIOA 27 AT91_PERIPH_A AT91_PINCTRL_NONE>;
+                                       };
+                               };
+
                                ssc0 {
                                        pinctrl_ssc0_tx: ssc0_tx-0 {
                                                atmel,pins =
                                        };
                                };
 
-                               spi0 {
-                                       pinctrl_spi0: spi0-0 {
-                                               atmel,pins =
-                                                       <AT91_PIOA 25 AT91_PERIPH_A AT91_PINCTRL_NONE>,
-                                                       <AT91_PIOA 26 AT91_PERIPH_A AT91_PINCTRL_NONE>,
-                                                       <AT91_PIOA 27 AT91_PERIPH_A AT91_PINCTRL_NONE>;
-                                       };
-                               };
-
                                tcb0 {
                                        pinctrl_tcb0_tclk0: tcb0_tclk0-0 {
                                                atmel,pins = <AT91_PIOA 3 AT91_PERIPH_B AT91_PINCTRL_NONE>;
                                #size-cells = <0>;
                                #interrupt-cells = <1>;
 
-                               clk32k: slck {
-                                       compatible = "fixed-clock";
-                                       #clock-cells = <0>;
-                                       clock-frequency = <32768>;
-                               };
-
                                main: mainck {
                                        compatible = "atmel,at91rm9200-clk-main";
                                        #clock-cells = <0>;
                                        interrupts-extended = <&pmc AT91_PMC_MOSCS>;
-                                       clocks = <&clk32k>;
+                                       clocks = <&main_xtal>;
                                };
 
                                plla: pllack {
                                        clocks = <&main>;
                                        reg = <0>;
                                        atmel,clk-input-range = <1000000 32000000>;
-                                       #atmel,pll-clk-output-range-cells = <4>;
-                                       atmel,pll-clk-output-ranges = <80000000 200000000 190000000 240000000>;
+                                       #atmel,pll-clk-output-range-cells = <3>;
+                                       atmel,pll-clk-output-ranges = <80000000 200000000 0>,
+                                                               <190000000 240000000 2>;
                                };
 
                                utmi: utmick {
                                        interrupts-extended = <&pmc AT91_PMC_MCKRDY>;
                                        clocks = <&clk32k>, <&main>, <&plla>, <&utmi>;
                                        atmel,clk-output-range = <0 94000000>;
-                                       atmel,clk-divisors = <1 2 4 3>;
+                                       atmel,clk-divisors = <1 2 4 0>;
                                };
 
                                prog: progck {
                                interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
                                status = "disabled";
                        };
+
+                       sckc@fffffd50 {
+                               compatible = "atmel,at91sam9x5-sckc";
+                               reg = <0xfffffd50 0x4>;
+
+                               slow_osc: slow_osc {
+                                       compatible = "atmel,at91sam9x5-clk-slow-osc";
+                                       #clock-cells = <0>;
+                                       atmel,startup-time-usec = <1200000>;
+                                       clocks = <&slow_xtal>;
+                               };
+
+                               slow_rc_osc: slow_rc_osc {
+                                       compatible = "atmel,at91sam9x5-clk-slow-rc-osc";
+                                       #clock-cells = <0>;
+                                       atmel,startup-time-usec = <75>;
+                                       clock-frequency = <32768>;
+                                       clock-accuracy = <50000000>;
+                               };
+
+                               clk32k: slck {
+                                       compatible = "atmel,at91sam9x5-clk-slow";
+                                       #clock-cells = <0>;
+                                       clocks = <&slow_rc_osc &slow_osc>;
+                               };
+                       };
                };
        };
 
index cddb37825fad5adc5990b1cbfa216853ce62b3bb..d4a010e40fe3e2803e9e3e4fdd171ffa35e98cb1 100644 (file)
                reg = <0x20000000 0x4000000>;
        };
 
+
+       slow_xtal {
+               clock-frequency = <32768>;
+       };
+
+       main_xtal {
+               clock-frequency = <12000000>;
+       };
+
        clocks {
                #address-cells = <1>;
                #size-cells = <1>;
        };
 
        ahb {
+               fb0: fb@00500000 {
+                       display = <&display0>;
+                       status = "okay";
+
+                       display0: display {
+                               bits-per-pixel = <16>;
+                               atmel,lcdcon-backlight;
+                               atmel,dmacon = <0x1>;
+                               atmel,lcdcon2 = <0x80008002>;
+                               atmel,guard-time = <1>;
+                               atmel,lcd-wiring-mode = "RGB";
+
+                               display-timings {
+                                       native-mode = <&timing0>;
+                                       timing0: timing0 {
+                                               clock-frequency = <4965000>;
+                                               hactive = <240>;
+                                               vactive = <320>;
+                                               hback-porch = <1>;
+                                               hfront-porch = <33>;
+                                               vback-porch = <1>;
+                                               vfront-porch = <0>;
+                                               hsync-len = <5>;
+                                               vsync-len = <1>;
+                                               hsync-active = <1>;
+                                               vsync-active = <1>;
+                                       };
+                               };
+                       };
+               };
+
                nand0: nand@40000000 {
                        nand-bus-width = <8>;
                        nand-ecc-mode = "soft";
                                status = "okay";
                        };
 
+                       adc0: adc@fffd0000 {
+                               pinctrl-names = "default";
+                               pinctrl-0 = <
+                                       &pinctrl_adc0_ad0
+                                       &pinctrl_adc0_ad1
+                                       &pinctrl_adc0_ad2
+                                       &pinctrl_adc0_ad3
+                                       &pinctrl_adc0_ad4
+                                       &pinctrl_adc0_ad5
+                                       &pinctrl_adc0_adtrg>;
+                               atmel,adc-ts-wires = <4>;
+                               status = "okay";
+                       };
+
+                       usb0: gadget@fffd4000 {
+                               atmel,vbus-gpio = <&pioA 8 GPIO_ACTIVE_HIGH>;
+                               status = "okay";
+                       };
+
+                       spi0: spi@fffcc000 {
+                               status = "okay";
+                               cs-gpios = <&pioA 28 0>, <0>, <0>, <0>;
+                               mtd_dataflash@0 {
+                                       compatible = "atmel,at45", "atmel,dataflash";
+                                       spi-max-frequency = <15000000>;
+                                       reg = <0>;
+                               };
+                       };
+
+                       pwm0: pwm@fffc8000 {
+                               status = "okay";
+
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_pwm0_pwm1_2>,
+                                       <&pinctrl_pwm0_pwm2_2>;
+                       };
+
                        dbgu: serial@fffff200 {
                                status = "okay";
                        };
                };
        };
 
-       leds {
-               compatible = "gpio-leds";
+       pwmleds {
+               compatible = "pwm-leds";
 
                ds1 {
                        label = "ds1";
-                       gpios = <&pioD 15 GPIO_ACTIVE_LOW>;
+                       pwms = <&pwm0 1 5000 PWM_POLARITY_INVERTED>;
+                       max-brightness = <255>;
                };
 
                ds2 {
                        label = "ds2";
-                       gpios = <&pioD 16 GPIO_ACTIVE_LOW>;
+                       pwms = <&pwm0 2 5000 PWM_POLARITY_INVERTED>;
+                       max-brightness = <255>;
                };
+       };
+
+       leds {
+               compatible = "gpio-leds";
 
                ds3 {
                        label = "ds3";
                        gpio-key,wakeup;
                };
        };
+
+       i2c@0 {
+               status = "okay";
+       };
+
+       i2c@1 {
+               status = "okay";
+       };
 };
index 9d72674049d6ba7decd0678cd09380fa89634c08..317bc590a4d09bf0130430708a2a487726b9d529 100644 (file)
                                compatible = "sirf,prima2-tick";
                                reg = <0xb0020000 0x1000>;
                                interrupts = <0>;
+                               clocks = <&clks 11>;
                        };
 
                        nand@b0030000 {
index 80a3bf4c59865e0403a4197abb5ae6f0bc00d363..896a2a6619e0a72aed8c0f474c721e8294a38a3d 100644 (file)
                        gpio-key,wakeup;
                };
        };
-
-       amba {
-               mdma1: mdma@11C10000 {
-                       /*
-                        * MDMA1 can support both secure and non-secure
-                        * AXI transactions. When this is enabled in the kernel
-                        * for boards that run in secure mode, we are getting
-                        * imprecise external aborts causing the kernel to oops.
-                        */
-                       status = "disabled";
-               };
-       };
 };
index c3a9a66c57678f9a5dddd75e11e55be913e3c3c0..418f2506aaf04d6d54825e650c890670f36b3d99 100644 (file)
                reg = <0x100440C0 0x20>;
        };
 
-       mau_pd: power-domain@100440E0 {
-               compatible = "samsung,exynos4210-pd";
-               reg = <0x100440E0 0x20>;
-       };
-
-       g2d_pd: power-domain@10044100 {
-               compatible = "samsung,exynos4210-pd";
-               reg = <0x10044100 0x20>;
-       };
-
        msc_pd: power-domain@10044120 {
                compatible = "samsung,exynos4210-pd";
                reg = <0x10044120 0x20>;
                        #dma-cells = <1>;
                        #dma-channels = <8>;
                        #dma-requests = <1>;
+                       /*
+                        * MDMA1 can support both secure and non-secure
+                        * AXI transactions. When this is enabled in the kernel
+                        * for boards that run in secure mode, we are getting
+                        * imprecise external aborts causing the kernel to oops.
+                        */
+                       status = "disabled";
                };
        };
 
                interrupts = <0 112 0>;
                clocks = <&clock 471>;
                clock-names = "secss";
-               samsung,power-domain = <&g2d_pd>;
        };
 };
index 74b3b63e94cf8cae0b6bf86817573551c99adfb5..c568f067604d91c72a432de366b80b922570e7ba 100644 (file)
 &usb1 {
        status = "okay";
 };
+
+&i2c0 {
+       dtt@50 {
+               compatible = "at,24c1024";
+               reg = <0x50>;
+       };
+};
+
+&aemif {
+       cs0 {
+               #address-cells = <2>;
+               #size-cells = <1>;
+               clock-ranges;
+               ranges;
+
+               ti,cs-chipselect = <0>;
+               /* all timings in nanoseconds */
+               ti,cs-min-turnaround-ns = <12>;
+               ti,cs-read-hold-ns = <6>;
+               ti,cs-read-strobe-ns = <23>;
+               ti,cs-read-setup-ns = <9>;
+               ti,cs-write-hold-ns = <8>;
+               ti,cs-write-strobe-ns = <23>;
+               ti,cs-write-setup-ns = <8>;
+
+               nand@0,0 {
+                       compatible = "ti,keystone-nand","ti,davinci-nand";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       reg = <0 0 0x4000000
+                              1 0 0x0000100>;
+
+                       ti,davinci-chipselect = <0>;
+                       ti,davinci-mask-ale = <0x2000>;
+                       ti,davinci-mask-cle = <0x4000>;
+                       ti,davinci-mask-chipsel = <0>;
+                       nand-ecc-mode = "hw";
+                       ti,davinci-ecc-bits = <4>;
+                       nand-on-flash-bbt;
+
+                       partition@0 {
+                               label = "u-boot";
+                               reg = <0x0 0x100000>;
+                               read-only;
+                       };
+
+                       partition@100000 {
+                               label = "params";
+                               reg = <0x100000 0x80000>;
+                               read-only;
+                       };
+
+                       partition@180000 {
+                               label = "ubifs";
+                               reg = <0x180000 0x1FE80000>;
+                       };
+               };
+       };
+};
+
+&spi0 {
+       nor_flash: n25q128a11@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "Micron,n25q128a11";
+               spi-max-frequency = <54000000>;
+               m25p,fast-read;
+               reg = <0>;
+
+               partition@0 {
+                       label = "u-boot-spl";
+                       reg = <0x0 0x80000>;
+                       read-only;
+               };
+
+               partition@1 {
+                       label = "misc";
+                       reg = <0x80000 0xf80000>;
+               };
+       };
+};
index c93d06f9f2a8db17e9d05b65766136c803247cff..1f90cbf27fd7f73e9cff64ece88f1136b8071fbd 100644 (file)
                };
        };
 };
+
+&i2c0 {
+       dtt@50 {
+               compatible = "at,24c1024";
+               reg = <0x50>;
+       };
+};
+
+&spi0 {
+       nor_flash: n25q128a11@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "Micron,n25q128a11";
+               spi-max-frequency = <54000000>;
+               m25p,fast-read;
+               reg = <0>;
+
+               partition@0 {
+                       label = "u-boot-spl";
+                       reg = <0x0 0x80000>;
+                       read-only;
+               };
+
+               partition@1 {
+                       label = "misc";
+                       reg = <0x80000 0xf80000>;
+               };
+       };
+};
index 50a70132ac9e45ec00a8d9d985c702277006205e..fec43128a2e0f946dabf80e18e287269571c4854 100644 (file)
 &usb {
        status = "okay";
 };
+
+&i2c0 {
+       dtt@50 {
+               compatible = "at,24c1024";
+               reg = <0x50>;
+       };
+};
+
+&aemif {
+       cs0 {
+               #address-cells = <2>;
+               #size-cells = <1>;
+               clock-ranges;
+               ranges;
+
+               ti,cs-chipselect = <0>;
+               /* all timings in nanoseconds */
+               ti,cs-min-turnaround-ns = <12>;
+               ti,cs-read-hold-ns = <6>;
+               ti,cs-read-strobe-ns = <23>;
+               ti,cs-read-setup-ns = <9>;
+               ti,cs-write-hold-ns = <8>;
+               ti,cs-write-strobe-ns = <23>;
+               ti,cs-write-setup-ns = <8>;
+
+               nand@0,0 {
+                       compatible = "ti,keystone-nand","ti,davinci-nand";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       reg = <0 0 0x4000000
+                              1 0 0x0000100>;
+
+                       ti,davinci-chipselect = <0>;
+                       ti,davinci-mask-ale = <0x2000>;
+                       ti,davinci-mask-cle = <0x4000>;
+                       ti,davinci-mask-chipsel = <0>;
+                       nand-ecc-mode = "hw";
+                       ti,davinci-ecc-bits = <4>;
+                       nand-on-flash-bbt;
+
+                       partition@0 {
+                               label = "u-boot";
+                               reg = <0x0 0x100000>;
+                               read-only;
+                       };
+
+                       partition@100000 {
+                               label = "params";
+                               reg = <0x100000 0x80000>;
+                               read-only;
+                       };
+
+                       partition@180000 {
+                               label = "ubifs";
+                               reg = <0x180000 0x7FE80000>;
+                       };
+               };
+       };
+};
+
+&spi0 {
+       nor_flash: n25q128a11@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "Micron,n25q128a11";
+               spi-max-frequency = <54000000>;
+               m25p,fast-read;
+               reg = <0>;
+
+               partition@0 {
+                       label = "u-boot-spl";
+                       reg = <0x0 0x80000>;
+                       read-only;
+               };
+
+               partition@1 {
+                       label = "misc";
+                       reg = <0x80000 0xf80000>;
+               };
+       };
+};
index 90823eb90c1b820544ca390026305f050c74fee7..d9f99e7deb83d6da54af0a0fa911b8b1134adf2b 100644 (file)
@@ -28,8 +28,6 @@
        gic: interrupt-controller {
                compatible = "arm,cortex-a15-gic";
                #interrupt-cells = <3>;
-               #size-cells = <0>;
-               #address-cells = <1>;
                interrupt-controller;
                reg = <0x0 0x02561000 0x0 0x1000>,
                      <0x0 0x02562000 0x0 0x2000>,
@@ -66,6 +64,7 @@
                compatible = "ti,keystone","simple-bus";
                interrupt-parent = <&gic>;
                ranges = <0x0 0x0 0x0 0xc0000000>;
+               dma-ranges = <0x80000000 0x8 0x00000000 0x80000000>;
 
                rstctrl: reset-controller {
                        compatible = "ti,keystone-reset";
                        interrupts = <GIC_SPI 283 IRQ_TYPE_EDGE_RISING>;
                        #address-cells = <1>;
                        #size-cells = <0>;
-
-                       dtt@50 {
-                               compatible = "at,24c1024";
-                               reg = <0x50>;
-                       };
                };
 
                i2c1: i2c@2530400 {
                        clock-frequency = <100000>;
                        clocks = <&clki2c>;
                        interrupts = <GIC_SPI 286 IRQ_TYPE_EDGE_RISING>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                };
 
                i2c2: i2c@2530800 {
                        clock-frequency = <100000>;
                        clocks = <&clki2c>;
                        interrupts = <GIC_SPI 289 IRQ_TYPE_EDGE_RISING>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                };
 
                spi0: spi@21000400 {
                        ti,davinci-spi-intr-line = <0>;
                        interrupts = <GIC_SPI 292 IRQ_TYPE_EDGE_RISING>;
                        clocks = <&clkspi>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                };
 
                spi1: spi@21000600 {
                        ti,davinci-spi-intr-line = <0>;
                        interrupts = <GIC_SPI 296 IRQ_TYPE_EDGE_RISING>;
                        clocks = <&clkspi>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                };
 
                spi2: spi@21000800 {
                        ti,davinci-spi-intr-line = <0>;
                        interrupts = <GIC_SPI 300 IRQ_TYPE_EDGE_RISING>;
                        clocks = <&clkspi>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                };
 
                usb_phy: usb_phy@2620738 {
                        clock-names = "usb";
                        interrupts = <GIC_SPI 393 IRQ_TYPE_EDGE_RISING>;
                        ranges;
+                       dma-coherent;
+                       dma-ranges;
                        status = "disabled";
 
                        dwc3@2690000 {
index 3916937d6818032bc0c6aeb19594f8db3773479b..dd81508b919b87349b2cc3260f405470e84957d8 100644 (file)
@@ -1,6 +1,6 @@
 / {
        mbus {
-               pcie-controller {
+               pciec: pcie-controller {
                        compatible = "marvell,kirkwood-pcie";
                        status = "disabled";
                        device_type = "pci";
@@ -15,7 +15,7 @@
                                0x82000000 0x1 0     MBUS_ID(0x04, 0xe8) 0       1 0 /* Port 0.0 MEM */
                                0x81000000 0x1 0     MBUS_ID(0x04, 0xe0) 0       1 0 /* Port 0.0 IO  */>;
 
-                       pcie@1,0 {
+                       pcie0: pcie@1,0 {
                                device_type = "pci";
                                assigned-addresses = <0x82000800 0 0x00040000 0 0x2000>;
                                reg = <0x0800 0 0 0 0>;
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        compatible = "marvell,88f6192-pinctrl";
-                       reg = <0x10000 0x20>;
 
-                       pmx_nand: pmx-nand {
-                               marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3",
-                                              "mpp4", "mpp5", "mpp18",
-                                              "mpp19";
-                               marvell,function = "nand";
-                       };
                        pmx_sata0: pmx-sata0 {
                                marvell,pins = "mpp5", "mpp21", "mpp23";
                                marvell,function = "sata0";
                                marvell,pins = "mpp4", "mpp20", "mpp22";
                                marvell,function = "sata1";
                        };
-                       pmx_spi: pmx-spi {
-                               marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3";
-                               marvell,function = "spi";
-                       };
-                       pmx_twsi0: pmx-twsi0 {
-                               marvell,pins = "mpp8", "mpp9";
-                               marvell,function = "twsi0";
-                       };
-                       pmx_uart0: pmx-uart0 {
-                               marvell,pins = "mpp10", "mpp11";
-                               marvell,function = "uart0";
-                       };
-                       pmx_uart1: pmx-uart1 {
-                               marvell,pins = "mpp13", "mpp14";
-                               marvell,function = "uart1";
-                       };
                        pmx_sdio: pmx-sdio {
                                marvell,pins = "mpp12", "mpp13", "mpp14",
                                               "mpp15", "mpp16", "mpp17";
                        };
                };
 
-               rtc@10300 {
+               rtc: rtc@10300 {
                        compatible = "marvell,kirkwood-rtc", "marvell,orion-rtc";
                        reg = <0x10300 0x20>;
                        interrupts = <53>;
                        clocks = <&gate_clk 7>;
                };
 
-               sata@80000 {
+               sata: sata@80000 {
                        compatible = "marvell,orion-sata";
                        reg = <0x80000 0x5000>;
                        interrupts = <21>;
@@ -92,7 +69,7 @@
                        status = "disabled";
                };
 
-               mvsdio@90000 {
+               sdio: mvsdio@90000 {
                        compatible = "marvell,orion-sdio";
                        reg = <0x90000 0x200>;
                        interrupts = <28>;
index 416d96e1302fab6e9af0d61ebb5cdbbe0290cfa7..7dc7d6782e8325012b8b7ad8fe52676ab15ca404 100644 (file)
@@ -1,6 +1,6 @@
 / {
        mbus {
-               pcie-controller {
+               pciec: pcie-controller {
                        compatible = "marvell,kirkwood-pcie";
                        status = "disabled";
                        device_type = "pci";
@@ -15,7 +15,7 @@
                                0x82000000 0x1 0     MBUS_ID(0x04, 0xe8) 0       1 0 /* Port 0.0 MEM */
                                0x81000000 0x1 0     MBUS_ID(0x04, 0xe0) 0       1 0 /* Port 0.0 IO  */>;
 
-                       pcie@1,0 {
+                       pcie0: pcie@1,0 {
                                device_type = "pci";
                                assigned-addresses = <0x82000800 0 0x00040000 0 0x2000>;
                                reg = <0x0800 0 0 0 0>;
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        compatible = "marvell,88f6281-pinctrl";
-                       reg = <0x10000 0x20>;
 
-                       pmx_nand: pmx-nand {
-                               marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3",
-                                              "mpp4", "mpp5", "mpp18",
-                                              "mpp19";
-                               marvell,function = "nand";
-                       };
                        pmx_sata0: pmx-sata0 {
                                marvell,pins = "mpp5", "mpp21", "mpp23";
                                marvell,function = "sata0";
                                marvell,pins = "mpp4", "mpp20", "mpp22";
                                marvell,function = "sata1";
                        };
-                       pmx_spi: pmx-spi {
-                               marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3";
-                               marvell,function = "spi";
-                       };
-                       pmx_twsi0: pmx-twsi0 {
-                               marvell,pins = "mpp8", "mpp9";
-                               marvell,function = "twsi0";
-                       };
-                       pmx_uart0: pmx-uart0 {
-                               marvell,pins = "mpp10", "mpp11";
-                               marvell,function = "uart0";
-                       };
-                       pmx_uart1: pmx-uart1 {
-                               marvell,pins = "mpp13", "mpp14";
-                               marvell,function = "uart1";
-                       };
                        pmx_sdio: pmx-sdio {
                                marvell,pins = "mpp12", "mpp13", "mpp14",
                                               "mpp15", "mpp16", "mpp17";
                        };
                };
 
-               rtc@10300 {
+               rtc: rtc@10300 {
                        compatible = "marvell,kirkwood-rtc", "marvell,orion-rtc";
                        reg = <0x10300 0x20>;
                        interrupts = <53>;
                        clocks = <&gate_clk 7>;
                };
 
-               sata@80000 {
+               sata: sata@80000 {
                        compatible = "marvell,orion-sata";
                        reg = <0x80000 0x5000>;
                        interrupts = <21>;
@@ -94,7 +71,7 @@
                        status = "disabled";
                };
 
-               mvsdio@90000 {
+               sdio: mvsdio@90000 {
                        compatible = "marvell,orion-sdio";
                        reg = <0x90000 0x200>;
                        interrupts = <28>;
index 2902e0d7971d061599d13ef8733e3a3c4ad49fd2..4680eec990f0cd3bc92a985b57e954303ee2f0b4 100644 (file)
@@ -1,6 +1,6 @@
 / {
        mbus {
-               pcie-controller {
+               pciec: pcie-controller {
                        compatible = "marvell,kirkwood-pcie";
                        status = "disabled";
                        device_type = "pci";
@@ -19,7 +19,7 @@
                                0x82000000 0x2 0     MBUS_ID(0x04, 0xd8) 0       1 0 /* Port 1.0 MEM */
                                0x81000000 0x2 0     MBUS_ID(0x04, 0xd0) 0       1 0 /* Port 1.0 IO  */>;
 
-                       pcie@1,0 {
+                       pcie0: pcie@1,0 {
                                device_type = "pci";
                                assigned-addresses = <0x82000800 0 0x00040000 0 0x2000>;
                                reg = <0x0800 0 0 0 0>;
@@ -36,7 +36,7 @@
                                status = "disabled";
                        };
 
-                       pcie@2,0 {
+                       pcie1: pcie@2,0 {
                                device_type = "pci";
                                assigned-addresses = <0x82001000 0 0x00044000 0 0x2000>;
                                reg = <0x1000 0 0 0 0>;
        };
        ocp@f1000000 {
 
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        compatible = "marvell,88f6282-pinctrl";
-                       reg = <0x10000 0x20>;
-
-                       pmx_nand: pmx-nand {
-                               marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3",
-                                                       "mpp4", "mpp5", "mpp18", "mpp19";
-                               marvell,function = "nand";
-                       };
 
                        pmx_sata0: pmx-sata0 {
                                marvell,pins = "mpp5", "mpp21", "mpp23";
                                marvell,pins = "mpp4", "mpp20", "mpp22";
                                marvell,function = "sata1";
                        };
-                       pmx_spi: pmx-spi {
-                               marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3";
-                               marvell,function = "spi";
-                       };
-                       pmx_twsi0: pmx-twsi0 {
-                               marvell,pins = "mpp8", "mpp9";
-                               marvell,function = "twsi0";
-                       };
 
+                       /*
+                        * Default I2C1 pinctrl setting on mpp36/mpp37,
+                        * overwrite marvell,pins on board level if required.
+                        */
                        pmx_twsi1: pmx-twsi1 {
                                marvell,pins = "mpp36", "mpp37";
                                marvell,function = "twsi1";
                        };
 
-                       pmx_uart0: pmx-uart0 {
-                               marvell,pins = "mpp10", "mpp11";
-                               marvell,function = "uart0";
-                       };
-
-                       pmx_uart1: pmx-uart1 {
-                               marvell,pins = "mpp13", "mpp14";
-                               marvell,function = "uart1";
-                       };
                        pmx_sdio: pmx-sdio {
                                marvell,pins = "mpp12", "mpp13", "mpp14",
                                               "mpp15", "mpp16", "mpp17";
                        };
                };
 
-               thermal@10078 {
+               thermal: thermal@10078 {
                        compatible = "marvell,kirkwood-thermal";
                        reg = <0x10078 0x4>;
                        status = "okay";
                };
 
-               rtc@10300 {
+               rtc: rtc@10300 {
                        compatible = "marvell,kirkwood-rtc", "marvell,orion-rtc";
                        reg = <0x10300 0x20>;
                        interrupts = <53>;
                        clocks = <&gate_clk 7>;
                };
 
-               i2c@11100 {
+               i2c1: i2c@11100 {
                        compatible = "marvell,mv64xxx-i2c";
                        reg = <0x11100 0x20>;
                        #address-cells = <1>;
                        interrupts = <32>;
                        clock-frequency = <100000>;
                        clocks = <&gate_clk 7>;
+                       pinctrl-0 = <&pmx_twsi1>;
+                       pinctrl-names = "default";
                        status = "disabled";
                };
 
-               sata@80000 {
+               sata: sata@80000 {
                        compatible = "marvell,orion-sata";
                        reg = <0x80000 0x5000>;
                        interrupts = <21>;
                        status = "disabled";
                };
 
-               mvsdio@90000 {
+               sdio: mvsdio@90000 {
                        compatible = "marvell,orion-sdio";
                        reg = <0x90000 0x200>;
                        interrupts = <28>;
index 3271e4c8ea07c61549232e19c5489e62bfe3adf6..2e8e412b9db0ddb655adf70c4933f58216bffa9c 100644 (file)
@@ -1,31 +1,8 @@
 / {
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        compatible = "marvell,98dx4122-pinctrl";
-                       reg = <0x10000 0x20>;
 
-                       pmx_nand: pmx-nand {
-                               marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3",
-                                              "mpp4", "mpp5", "mpp18",
-                                              "mpp19";
-                               marvell,function = "nand";
-                       };
-                       pmx_spi: pmx-spi {
-                               marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3";
-                               marvell,function = "spi";
-                       };
-                       pmx_twsi0: pmx-twsi0 {
-                               marvell,pins = "mpp8", "mpp9";
-                               marvell,function = "twsi0";
-                       };
-                       pmx_uart0: pmx-uart0 {
-                               marvell,pins = "mpp10", "mpp11";
-                               marvell,function = "uart0";
-                       };
-                       pmx_uart1: pmx-uart1 {
-                               marvell,pins = "mpp13", "mpp14";
-                               marvell,function = "uart1";
-                       };
                };
        };
 };
index 6becedebaa4e946e9fc080096a771053d06854df..c9247f8672ae14c24487f9b6902187c48e25fcd3 100644 (file)
@@ -30,6 +30,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8 earlyprintk";
+               stdout-path = &uart0;
        };
 
        mbus {
@@ -44,7 +45,7 @@
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        pmx_button_power: pmx-button-power {
                                marvell,pins = "mpp39";
                                marvell,function = "gpio";
@@ -69,8 +70,6 @@
 
                spi@10600 {
                        status = "okay";
-                       pinctrl-0 = <&pmx_spi>;
-                       pinctrl-names = "default";
 
                        m25p16@0 {
                                #address-cells = <1>;
                         * UART0_TX = Testpoint 66
                         * See the Excito Wiki for more details.
                         */
-                       pinctrl-0 = <&pmx_uart0>;
-                       pinctrl-names = "default";
                        status = "okay";
                };
 
index 3b62aeeaa3a2fe1ff5b01eab47e7c25718b45647..ab6ab4933e6bae498216b00efc433ceaf9c157fa 100644 (file)
 
        chosen {
                bootargs = "console=ttyS0,115200n8";
+               stdout-path = &uart0;
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        pmx_cloudbox_sata0: pmx-cloudbox-sata0 {
                                marvell,pins = "mpp15";
                                marvell,function = "sata0";
@@ -25,9 +26,6 @@
                };
 
                serial@12000 {
-                       pinctrl-0 = <&pmx_uart0>;
-                       pinctrl-names = "default";
-                       clock-frequency = <166666667>;
                        status = "okay";
                };
 
@@ -39,8 +37,6 @@
                };
 
                spi@10600 {
-                       pinctrl-0 = <&pmx_spi>;
-                       pinctrl-names = "default";
                        status = "okay";
 
                        flash@0 {
index 02d1225ef99f8364c1d9a03987d73ed357b4c428..812df691ae3d11a82df137ae894aa069ef237d56 100644 (file)
 
        chosen {
                bootargs = "console=ttyS0,115200n8 earlyprintk";
+               stdout-path = &uart0;
        };
 
        ocp@f1000000 {
-               pinctrl@10000 {
+               pin-controller@10000 {
                        pmx_sdio_gpios: pmx-sdio-gpios {
                                marvell,pins = "mpp37", "mpp38";
                                marvell,function = "gpio";
                };
 
                serial@12000 {
-                       pinctrl-0 = <&pmx_uart0>;
-                       pinctrl-names = "default";
-                       clock-frequency = <200000000>;
-                       status = "ok";
+                       status = "okay";
                };
 
                sata@80000 {
@@ -59,8 +57,6 @@
 };
 
 &nand {
-       pinctrl-0 = <&pmx_nand>;
-       pinctrl-names = "default";
        chip-delay = <25>;
        status = "okay";
 
index bf7fe8ab88f4353d0e1688d7fdf8cbd9718e1f7e..d85ef0a91b5019d005dbbd199072aff4e90b14aa 100644 (file)
@@ -13,6 +13,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8 earlyprintk";
+               stdout-path = &uart0;
        };
 
        gpio-leds {
@@ -51,8 +52,6 @@
                };
 
                serial@12100 {
-                       pinctrl-0 = <&pmx_uart1>;
-                       pinctrl-names = "default";
                        status = "okay";
                };
        };
index cb9978c652f2d1635b762e5aa3ef09097aa0b79e..5e586ed04c58a45d2f6ddb61db84b4e9cd53e457 100644 (file)
@@ -13,6 +13,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8 earlyprintk";
+               stdout-path = &uart0;
        };
 
        gpio-leds {
index d5aa9564a287ee44589ede975c4d591f43747842..113dcf056dcfb792d4220ec089a9dae748e4a587 100644 (file)
@@ -50,7 +50,7 @@
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
 
                        pinctrl-0 = <&pmx_power_back_on &pmx_present_sata0
                                     &pmx_present_sata1 &pmx_fan_tacho
 };
 
 &nand {
-       pinctrl-0 = <&pmx_nand>;
-       pinctrl-names = "default";
        status = "okay";
        chip-delay = <35>;
 
index f31312ebd0d60b17538dd1b8bd8250ee80bf88ea..849736349511433644dcf749633ff317737efb17 100644 (file)
 
        chosen {
                bootargs = "console=ttyS0,115200n8 earlyprintk root=/dev/sda1 rootdelay=10";
+               stdout-path = &uart0;
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        pmx_usb_power_enable: pmx-usb-power-enable {
                                marvell,pins = "mpp29";
                                marvell,function = "gpio";
index 28b3ee369778f945379096fea755796ef6156cef..6467c7924195900f66e91e0ce3bdecc50cf13827 100644 (file)
 
        chosen {
                bootargs = "console=ttyS0,115200n8 earlyprintk";
+               stdout-path = &uart0;
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        pmx_led_bluetooth: pmx-led-bluetooth {
                                marvell,pins = "mpp47";
                                marvell,function = "gpio";
@@ -37,8 +38,6 @@
 
                spi@10600 {
                        status = "okay";
-                       pinctrl-0 = <&pmx_spi>;
-                       pinctrl-names = "default";
 
                        m25p40@0 {
                                #address-cells = <1>;
index 772092c94ca34ab3546ad732ae6f6a06da4f724d..d4bcc1c7f6b31a1897baf620c9ce5634a10c52b8 100644 (file)
@@ -25,6 +25,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8";
+               stdout-path = &uart0;
        };
 
        gpio-fan-150-32-35 {
index aabafbe0da4c77f5e2381f93ab8dcc3ddd681dd3..95bf83b91b4acac4aaf659f796d4813c940c42e2 100644 (file)
@@ -25,6 +25,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8";
+               stdout-path = &uart0;
        };
 
        gpio-fan-150-32-35 {
index 16ec7fbab5734a3b1e8c2fdc2beb93b73cf85e6c..61f47fbe44d0d6b12354da1641a7c7cc05b5cf22 100644 (file)
@@ -24,6 +24,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8";
+               stdout-path = &uart0;
        };
 
        gpio-fan-100-15-35-1 {
index cff1b2388765bb86d7e751401d0b4c0890129721..bf4143c6cb8f10991d4abbaae126966f9f9c753c 100644 (file)
@@ -24,6 +24,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8";
+               stdout-path = &uart0;
        };
 
        gpio-fan-100-15-35-1 {
index 330411993d386547addb426980578259fa7c2476..6d25093a9ac48290eb52a8daae4ded18239ebcc3 100644 (file)
@@ -24,6 +24,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8";
+               stdout-path = &uart0;
        };
 
        gpio-fan-150-32-35 {
index 6052eaa37d4f3126d45236bd2e401b142d8ff15a..2f1933efcac1f4020f4c12b1e77a9662f843d0ce 100644 (file)
@@ -26,6 +26,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8";
+               stdout-path = &uart0;
        };
 
        gpio-fan-150-32-35 {
index 7f76cd30e84e73257d57f5cd8ca16ba249c70148..99afd462f956ff2030f8e6d639ffb2052a78857a 100644 (file)
@@ -27,6 +27,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8";
+               stdout-path = &uart0;
        };
 
        gpio-fan-100-15-35-1 {
index 1f83a00f1f74e4ebd4d919c707726ce1cace125d..f5c4213fc67cc8f7195d56f42a5fa1e3c54d9203 100644 (file)
@@ -25,6 +25,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8";
+               stdout-path = &uart0;
        };
 
        gpio-fan-100-32-35 {
index 0a573add44a252d8b6a2a7d4bd43d8488f355fd5..e80a962ebba0a54262b9ff31fc61196a0ebb02a4 100644 (file)
@@ -24,6 +24,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8";
+               stdout-path = &uart0;
        };
 
        gpio-fan-150-15-18 {
index 1848a6245fd30ab67a67c3833cd493c4fb16304e..cae5af4b88b56152583885707c9ae24751a126ea 100644 (file)
@@ -24,6 +24,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8";
+               stdout-path = &uart0;
        };
 
        gpio-fan-150-32-35 {
index a1737b4311c628b5329fac6b4083894841cc00e3..623cd4a37d7171bfe3d262513c98feb48eae0f71 100644 (file)
@@ -24,6 +24,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8";
+               stdout-path = &uart0;
        };
 
        gpio-fan-100-15-35-1 {
index 0cde914eceaee417b551ccbfccdfc148c19b243b..3348e330f0742f83828480048320a2902c047767 100644 (file)
@@ -24,6 +24,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8";
+               stdout-path = &uart0;
        };
 
        gpio-fan-150-15-18 {
index aef0cadc2c781f80855a514297bd8dc0d276064d..a0a1fad8b4de5fae9690a11ad0bc2670a2e0bd81 100644 (file)
@@ -24,6 +24,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8";
+               stdout-path = &uart0;
        };
 
        gpio-fan-100-15-35-1 {
index eb93294201070aa84cd212b23924e7720ecd9b24..aa60a0b049a7722dcb4b587e2f9cfd5fc56ae3de 100644 (file)
 
        chosen {
                bootargs = "console=ttyS0,115200n8 earlyprintk root=/dev/sda1 rootdelay=10";
+               stdout-path = &uart0;
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        pmx_usb_power_enable: pmx-usb-power-enable {
                                marvell,pins = "mpp29";
                                marvell,function = "gpio";
index 2d51fce74a5ad17894d6e9661384f0aacdced2d1..c5a1fc75c7a3b43778e0f8634776a2d6a2150aed 100644 (file)
 
        chosen {
                bootargs = "console=ttyS0,115200n8 earlyprintk";
+               stdout-path = &uart0;
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        pmx_led_health_r: pmx-led-health-r {
                                marvell,pins = "mpp46";
                                marvell,function = "gpio";
@@ -36,7 +37,6 @@
                        };
                };
                serial@12000 {
-                       clock-frequency = <200000000>;
                        status = "ok";
                };
 
        status = "okay";
 
        ethphy0: ethernet-phy@0 {
-               compatible = "marvell,88e1121";
+               /* Marvell 88E1121R */
+               compatible = "ethernet-phy-id0141.0cb0",
+                            "ethernet-phy-ieee802.3-c22";
                reg = <0>;
+               phy-connection-type = "rgmii-id";
        };
 
        ethphy1: ethernet-phy@1 {
-               compatible = "marvell,88e1121";
+               /* Marvell 88E1121R */
+               compatible = "ethernet-phy-id0141.0cb0",
+                            "ethernet-phy-ieee802.3-c22";
                reg = <1>;
+               phy-connection-type = "rgmii-id";
        };
 };
 
index a1add3f215e394aaeb006c711c5f2f8ce5fbf58c..bfa5edde179c30d38d55cb80dd462dc6c3ee8084 100644 (file)
 
        chosen {
                bootargs = "console=ttyS0,115200n8 earlyprintk";
+               stdout-path = &uart0;
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        pmx_led_os_red: pmx-led-os-red {
                                marvell,pins = "mpp22";
                                marvell,function = "gpio";
 
 &nand {
        status = "okay";
-       pinctrl-0 = <&pmx_nand>;
-       pinctrl-names = "default";
 
        partition@0 {
                label = "u-boot";
index 8d8c80e3656d6ebaf36c71dfc0351dbe28efe5b3..38e31d15a62d3fc41d91425beba35a41c44fa7a1 100644 (file)
@@ -14,6 +14,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8 earlyprintk";
+               stdout-path = &uart0;
                linux,initrd-start = <0x4500040>;
                linux,initrd-end   = <0x4800000>;
        };
@@ -29,7 +30,7 @@
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        pmx_button_reset: pmx-button-reset {
                                marvell,pins = "mpp12";
                                marvell,function = "gpio";
index 59e7a5adeedbcb7791994bc2a506dca5d73c2e05..05291f3990d03561ff50940f42956d5b11019724 100644 (file)
 
        chosen {
                bootargs = "console=ttyS0,115200n8 earlyprintk";
+               stdout-path = &uart0;
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        pinctrl-0 = < &pmx_led_sata_brt_ctrl_1
                                      &pmx_led_sata_brt_ctrl_2
                                      &pmx_led_backup_brt_ctrl_1
index 04a1e44541b34b302a1e86100dd13a169e60c440..61139bf309858cba22f6c678e087fdd7e5cdd32c 100644 (file)
 
        chosen {
                bootargs = "console=ttyS0,115200n8 earlyprintk";
+               stdout-path = &uart0;
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        pinctrl-0 = < &pmx_i2c_gpio_sda &pmx_i2c_gpio_scl >;
                        pinctrl-names = "default";
 
@@ -45,9 +46,7 @@
 };
 
 &nand {
-       pinctrl-0 = <&pmx_nand>;
-       pinctrl-names = "default";
-       status = "ok";
+       status = "okay";
        chip-delay = <25>;
 };
 
index 6761ffa2c4ab7eb9e130dbef6a00e4a2faea1714..24425660e973c47edf90087589cf62fcef324208 100644 (file)
@@ -24,6 +24,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8 earlyprintk";
+               stdout-path = &uart0;
        };
 
        mbus {
 
        ocp@f1000000 {
                serial@12000 {
-                       pinctrl-0 = <&pmx_uart0>;
-                       pinctrl-names = "default";
                        status = "okay";
                };
 
                i2c@11000 {
-                       pinctrl-0 = <&pmx_twsi0>;
-                       pinctrl-names = "default";
                        status = "okay";
 
                        eeprom@50 {
@@ -54,7 +51,7 @@
                        };
                };
 
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        pmx_usb_power_enable: pmx-usb-power-enable {
                                marvell,pins = "mpp14";
                                marvell,function = "gpio";
 &nand {
        /* Total size : 512MB */
        status = "okay";
-       pinctrl-0 = <&pmx_nand>;
 
        partition@0 {
                label = "u-boot";
index 1656653d339b55cebf1456d189f90b142bb6ec75..53484474df1f4672ee3b1110f87ed86cbadd613a 100644 (file)
@@ -4,10 +4,11 @@
 / {
        chosen {
                bootargs = "console=ttyS0,115200n8 earlyprintk";
+               stdout-path = &uart0;
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        pmx_power_hdd: pmx-power-hdd {
                                marvell,pins = "mpp10";
                                marvell,function = "gpo";
index 73722c06750182cd003bb67e264d574616415412..f3a991837515d4b97aec12aa2a21b9ddcefe8a2d 100644 (file)
                 reg = <0x00000000 0x20000000>;
         };
 
-        chosen {
-                bootargs = "console=ttyS0,115200n8 earlyprintk";
-        };
+       chosen {
+               bootargs = "console=ttyS0,115200n8 earlyprintk";
+               stdout-path = &uart0;
+       };
 
        mbus {
                pcie-controller {
@@ -27,7 +28,7 @@
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        pmx_led_health: pmx-led-health {
                                marvell,pins = "mpp7";
                                marvell,function = "gpo";
 
                 };
 
-                serial@12000 {
-                        status = "ok";
-                        pinctrl-0 = <&pmx_uart0>;
-                        pinctrl-names = "default";
-                };
+               serial@12000 {
+                       status = "okay";
+               };
 
                rtc@10300 {
                        status = "disabled";
 };
 
 &nand {
-       pinctrl-0 = <&pmx_nand>;
-       pinctrl-names = "default";
        status = "okay";
 
        partition@0 {
index b939f4f52d16a7c0edb677a86558bacd94fec831..8f76d28759a30747d96014bfb8582622d049798b 100644 (file)
@@ -28,6 +28,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8 earlyprintk";
+               stdout-path = &uart0;
        };
 
        mbus {
@@ -41,7 +42,7 @@
         };
 
        ocp@f1000000 {
-               pinctrl@10000 {
+               pin-controller@10000 {
                        pmx_usb_led: pmx-usb-led {
                                marvell,pins = "mpp12";
                                marvell,function = "gpo";
@@ -59,8 +60,6 @@
                };
 
                spi@10600 {
-                       pinctrl-0 = <&pmx_spi>;
-                       pinctrl-names = "default";
                        status = "okay";
 
                        flash@0 {
                };
 
                serial@12000 {
-                       pinctrl-0 = <&pmx_uart0>;
-                       pinctrl-names = "default";
-                       clock-frequency = <200000000>;
-                       status = "ok";
+                       status = "okay";
                };
 
                ehci@50000 {
index 4838478019ccb94a88f6f4027f7e60125c42a6d9..fd733c63bc27da55aadb88b435fe8f2912aca8ad 100644 (file)
@@ -25,6 +25,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8 earlyprintk";
+               stdout-path = &uart0;
        };
 
        mbus {
@@ -38,7 +39,7 @@
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        pmx_button_power: pmx-button-power {
                                marvell,pins = "mpp47";
                                marvell,function = "gpio";
                };
 
                serial@12000 {
-                       pinctrl-0 = <&pmx_uart0>;
-                       pinctrl-names = "default";
                        status = "okay";
                };
 
index 7c8a0d9d8d1fd02fc7dd6b02c2bb6986a7e04a42..b514d643fb6c5413abd3ad1c50bfeffe9d905a33 100644 (file)
@@ -25,6 +25,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8 earlyprintk";
+               stdout-path = &uart0;
        };
 
        mbus {
@@ -40,7 +41,7 @@
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        pmx_button_power: pmx-button-power {
                                marvell,pins = "mpp47";
                                marvell,function = "gpio";
                };
 
                serial@12000 {
-                       pinctrl-0 = <&pmx_uart0>;
-                       pinctrl-names = "default";
                        status = "okay";
                };
 
index e6e5ec4fe6b9e005b9c37ced8fda18f31bb5fbe0..fe6c0246db1ab4749bf453b7e312dbd6ca5667ae 100644 (file)
@@ -4,10 +4,11 @@
 / {
        chosen {
                bootargs = "console=ttyS0,115200n8";
+               stdout-path = &uart0;
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        pmx_ns2_sata0: pmx-ns2-sata0 {
                                marvell,pins = "mpp21";
                                marvell,function = "sata0";
                };
 
                serial@12000 {
-                       pinctrl-0 = <&pmx_uart0>;
-                       pinctrl-names = "default";
                        status = "okay";
                };
 
                spi@10600 {
-                       pinctrl-0 = <&pmx_spi>;
-                       pinctrl-names = "default";
                        status = "okay";
 
                        flash@0 {
@@ -45,8 +42,6 @@
                };
 
                i2c@11000 {
-                       pinctrl-0 = <&pmx_twsi0>;
-                       pinctrl-names = "default";
                        status = "okay";
 
                        eeprom@50 {
index 0a07af9d8e58d0c06938fe0284332f87a650503b..6139df0f376c911f078408761acd5f86df09f53b 100644 (file)
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-#include "kirkwood-nsa310-common.dtsi"
+#include "kirkwood-nsa3x0-common.dtsi"
 
 / {
        compatible = "zyxel,nsa310", "marvell,kirkwood-88f6281", "marvell,kirkwood";
@@ -12,6 +12,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200";
+               stdout-path = &uart0;
        };
 
        mbus {
@@ -25,7 +26,7 @@
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        pinctrl-0 = <&pmx_unknown>;
                        pinctrl-names = "default";
 
                                marvell,function = "gpio";
                        };
 
-                       pmx_btn_reset: pmx-btn-reset {
-                               marvell,pins = "mpp36";
-                               marvell,function = "gpio";
-                       };
-
-                       pmx_btn_copy: pmx-btn-copy {
-                               marvell,pins = "mpp37";
-                               marvell,function = "gpio";
-                       };
-
-                       pmx_led_copy_green: pmx-led-copy-green {
-                               marvell,pins = "mpp39";
-                               marvell,function = "gpio";
-                       };
-
-                       pmx_led_copy_red: pmx-led-copy-red {
-                               marvell,pins = "mpp40";
-                               marvell,function = "gpio";
-                       };
-
                        pmx_led_hdd_green: pmx-led-hdd-green {
                                marvell,pins = "mpp41";
                                marvell,function = "gpio";
                                marvell,function = "gpio";
                        };
 
-                       pmx_btn_power: pmx-btn-power {
-                               marvell,pins = "mpp46";
-                               marvell,function = "gpio";
-                       };
                };
 
                i2c@11000 {
                };
        };
 
-       gpio_keys {
-               compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
-               pinctrl-0 = <&pmx_btn_reset &pmx_btn_copy &pmx_btn_power>;
-               pinctrl-names = "default";
-
-               button@1 {
-                       label = "Power Button";
-                       linux,code = <KEY_POWER>;
-                       gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
-               };
-               button@2 {
-                       label = "Copy Button";
-                       linux,code = <KEY_COPY>;
-                       gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
-               };
-               button@3 {
-                       label = "Reset Button";
-                       linux,code = <KEY_RESTART>;
-                       gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
-               };
-       };
-
        gpio-leds {
                compatible = "gpio-leds";
                pinctrl-0 = <&pmx_led_esata_green &pmx_led_esata_red
index 27ca6a79c48a473f15d082287e19a605ef98b651..3d2b3d494c1913eafb7e43c3034cac912f1f5591 100644 (file)
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-#include "kirkwood-nsa310-common.dtsi"
+#include "kirkwood-nsa3x0-common.dtsi"
 
 /*
  * There are at least two different NSA310 designs. This variant does
 
        chosen {
                bootargs = "console=ttyS0,115200";
+               stdout-path = &uart0;
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        pinctrl-names = "default";
 
                        pmx_led_esata_green: pmx-led-esata-green {
                                marvell,function = "gpio";
                        };
 
-                       pmx_usb_power_off: pmx-usb-power-off {
-                               marvell,pins = "mpp21";
-                               marvell,function = "gpio";
-                       };
-
                        pmx_led_sys_green: pmx-led-sys-green {
                                marvell,pins = "mpp28";
                                marvell,function = "gpio";
                                marvell,function = "gpio";
                        };
 
-                       pmx_btn_reset: pmx-btn-reset {
-                               marvell,pins = "mpp36";
-                               marvell,function = "gpio";
-                       };
-
-                       pmx_btn_copy: pmx-btn-copy {
-                               marvell,pins = "mpp37";
-                               marvell,function = "gpio";
-                       };
-
-                       pmx_led_copy_green: pmx-led-copy-green {
-                               marvell,pins = "mpp39";
-                               marvell,function = "gpio";
-                       };
-
-                       pmx_led_copy_red: pmx-led-copy-red {
-                               marvell,pins = "mpp40";
-                               marvell,function = "gpio";
-                       };
-
                        pmx_led_hdd_green: pmx-led-hdd-green {
                                marvell,pins = "mpp41";
                                marvell,function = "gpio";
                                marvell,function = "gpio";
                        };
 
-                       pmx_btn_power: pmx-btn-power {
-                               marvell,pins = "mpp46";
-                               marvell,function = "gpio";
-                       };
-
                };
 
                i2c@11000 {
                };
        };
 
-       gpio_keys {
-               compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
-
-               button@1 {
-                       label = "Power Button";
-                       linux,code = <KEY_POWER>;
-                       gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
-               };
-               button@2 {
-                       label = "Copy Button";
-                       linux,code = <KEY_COPY>;
-                       gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
-               };
-               button@3 {
-                       label = "Reset Button";
-                       linux,code = <KEY_RESTART>;
-                       gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
-               };
-       };
-
        gpio-leds {
                compatible = "gpio-leds";
 
diff --git a/arch/arm/boot/dts/kirkwood-nsa320.dts b/arch/arm/boot/dts/kirkwood-nsa320.dts
new file mode 100644 (file)
index 0000000..24f686d
--- /dev/null
@@ -0,0 +1,215 @@
+/* Device tree file for the Zyxel NSA 320 NAS box.
+ *
+ * Copyright (c) 2014, Adam Baker <linux@baker-net.org.uk>
+ *
+ * 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.
+ *
+ * Based upon the board setup file created by Peter Schildmann */
+
+/dts-v1/;
+
+#include "kirkwood-nsa3x0-common.dtsi"
+
+/ {
+       model = "Zyxel NSA320";
+       compatible = "zyxel,nsa320", "marvell,kirkwood-88f6281", "marvell,kirkwood";
+
+       memory {
+               device_type = "memory";
+               reg = <0x00000000 0x20000000>;
+       };
+
+       chosen {
+               bootargs = "console=ttyS0,115200";
+               stdout-path = &uart0;
+       };
+
+       mbus {
+               pcie-controller {
+                       status = "okay";
+
+                       pcie@1,0 {
+                               status = "okay";
+                       };
+               };
+       };
+
+       ocp@f1000000 {
+               pinctrl: pin-controller@10000 {
+                       pinctrl-names = "default";
+
+                       /* SATA Activity and Present pins are not connected */
+                       pmx_sata0: pmx-sata0 {
+                               marvell,pins ;
+                               marvell,function = "sata0";
+                       };
+
+                       pmx_sata1: pmx-sata1 {
+                               marvell,pins ;
+                               marvell,function = "sata1";
+                       };
+
+                       pmx_led_hdd2_green: pmx-led-hdd2-green {
+                               marvell,pins = "mpp12";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_led_hdd2_red: pmx-led-hdd2-red {
+                               marvell,pins = "mpp13";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_mcu_data: pmx-mcu-data {
+                               marvell,pins = "mpp14";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_led_usb_green: pmx-led-usb-green {
+                               marvell,pins = "mpp15";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_mcu_clk: pmx-mcu-clk {
+                               marvell,pins = "mpp16";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_mcu_act: pmx-mcu-act {
+                               marvell,pins = "mpp17";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_led_sys_green: pmx-led-sys-green {
+                               marvell,pins = "mpp28";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_led_sys_orange: pmx-led-sys-orange {
+                               marvell,pins = "mpp29";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_led_hdd1_green: pmx-led-hdd1-green {
+                               marvell,pins = "mpp41";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_led_hdd1_red: pmx-led-hdd1-red {
+                               marvell,pins = "mpp42";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_htp: pmx-htp {
+                               marvell,pins = "mpp43";
+                               marvell,function = "gpio";
+                       };
+
+                       /* Buzzer needs to be switched at around 1kHz so is
+                          not compatible with the gpio-beeper driver. */
+                       pmx_buzzer: pmx-buzzer {
+                               marvell,pins = "mpp44";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_vid_b1: pmx-vid-b1 {
+                               marvell,pins = "mpp45";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_power_resume_data: pmx-power-resume-data {
+                               marvell,pins = "mpp47";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_power_resume_clk: pmx-power-resume-clk {
+                               marvell,pins = "mpp49";
+                               marvell,function = "gpio";
+                       };
+               };
+
+               i2c@11000 {
+                       status = "okay";
+
+                       pcf8563: pcf8563@51 {
+                               compatible = "nxp,pcf8563";
+                               reg = <0x51>;
+                       };
+               };
+       };
+
+       regulators {
+               usb0_power: regulator@1 {
+                       enable-active-high;
+               };
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+               pinctrl-0 = <&pmx_led_hdd2_green &pmx_led_hdd2_red
+                            &pmx_led_usb_green
+                            &pmx_led_sys_green &pmx_led_sys_orange
+                            &pmx_led_copy_green &pmx_led_copy_red
+                            &pmx_led_hdd1_green &pmx_led_hdd1_red>;
+               pinctrl-names = "default";
+
+               green-sys {
+                       label = "nsa320:green:sys";
+                       gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>;
+               };
+               orange-sys {
+                       label = "nsa320:orange:sys";
+                       gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>;
+               };
+               green-hdd1 {
+                       label = "nsa320:green:hdd1";
+                       gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
+               };
+               red-hdd1 {
+                       label = "nsa320:red:hdd1";
+                       gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
+               };
+               green-hdd2 {
+                       label = "nsa320:green:hdd2";
+                       gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
+               };
+               red-hdd2 {
+                       label = "nsa320:red:hdd2";
+                       gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
+               };
+               green-usb {
+                       label = "nsa320:green:usb";
+                       gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
+               };
+               green-copy {
+                       label = "nsa320:green:copy";
+                       gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
+               };
+               red-copy {
+                       label = "nsa320:red:copy";
+                       gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       /* The following pins are currently not assigned to a driver,
+          some of them should be configured as inputs.
+       pinctrl-0 = <&pmx_mcu_data &pmx_mcu_clk &pmx_mcu_act
+                    &pmx_htp &pmx_vid_b1
+                    &pmx_power_resume_data &pmx_power_resume_clk>; */
+};
+
+&mdio {
+       status = "okay";
+       ethphy0: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
+&eth0 {
+       status = "okay";
+       ethernet0-port@0 {
+               phy-handle = <&ethphy0>;
+       };
+};
similarity index 58%
rename from arch/arm/boot/dts/kirkwood-nsa310-common.dtsi
rename to arch/arm/boot/dts/kirkwood-nsa3x0-common.dtsi
index e2cc85cc3b87e805a113489d3d95cf912d682224..2075a2e828f17b6623c71855da85573807fd33f5 100644 (file)
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
 
-                       pmx_usb_power_off: pmx-usb-power-off {
+                       pmx_usb_power: pmx-usb-power {
                                marvell,pins = "mpp21";
                                marvell,function = "gpio";
                        };
+
                        pmx_pwr_off: pmx-pwr-off {
                                marvell,pins = "mpp48";
                                marvell,function = "gpio";
                        };
 
+                       pmx_btn_reset: pmx-btn-reset {
+                               marvell,pins = "mpp36";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_btn_copy: pmx-btn-copy {
+                               marvell,pins = "mpp37";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_btn_power: pmx-btn-power {
+                               marvell,pins = "mpp46";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_led_copy_green: pmx-led-copy-green {
+                               marvell,pins = "mpp39";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_led_copy_red: pmx-led-copy-red {
+                               marvell,pins = "mpp40";
+                               marvell,function = "gpio";
+                       };
                };
 
                serial@12000 {
                gpios = <&gpio1 16 GPIO_ACTIVE_HIGH>;
        };
 
+       gpio_keys {
+               compatible = "gpio-keys";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               pinctrl-0 = <&pmx_btn_reset &pmx_btn_copy &pmx_btn_power>;
+               pinctrl-names = "default";
+
+               button@1 {
+                       label = "Power Button";
+                       linux,code = <KEY_POWER>;
+                       gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
+               };
+               button@2 {
+                       label = "Copy Button";
+                       linux,code = <KEY_COPY>;
+                       gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
+               };
+               button@3 {
+                       label = "Reset Button";
+                       linux,code = <KEY_RESTART>;
+                       gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+
        regulators {
                compatible = "simple-bus";
                #address-cells = <1>;
                #size-cells = <0>;
-               pinctrl-0 = <&pmx_usb_power_off>;
+               pinctrl-0 = <&pmx_usb_power>;
                pinctrl-names = "default";
 
-               usb0_power_off: regulator@1 {
+               usb0_power: regulator@1 {
                        compatible = "regulator-fixed";
                        reg = <1>;
-                       regulator-name = "USB Power Off";
+                       regulator-name = "USB Power";
                        regulator-min-microvolt = <5000000>;
                        regulator-max-microvolt = <5000000>;
                        regulator-always-on;
index 0650beafc1de0ac4a7e60fbc759ed7726982c22a..fb9dc227255d91a2a4bdb58a7adfac3072a80521 100644 (file)
 
        chosen {
                bootargs = "console=ttyS0,115200n8 earlyprintk";
+               stdout-path = &uart0;
        };
 
        ocp@f1000000 {
                serial@12000 {
-                       status = "ok";
-                       pinctrl-0 = <&pmx_uart0>;
-                       pinctrl-names = "default";
+                       status = "okay";
                };
 
                serial@12100 {
-                       status = "ok";
-                       pinctrl-0 = <&pmx_uart1>;
-                       pinctrl-names = "default";
+                       status = "okay";
                };
 
                sata@80000 {
@@ -36,8 +33,6 @@
 
                i2c@11100 {
                        status = "okay";
-                       pinctrl-0 = <&pmx_twsi1>;
-                       pinctrl-names = "default";
 
                        s35390a: s35390a@30 {
                                compatible = "sii,s35390a";
@@ -45,7 +40,7 @@
                        };
                };
 
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        pinctrl-0 = <&pmx_dip_switches &pmx_gpio_header>;
                        pinctrl-names = "default";
 
 &nand {
        chip-delay = <25>;
        status = "okay";
-       pinctrl-0 = <&pmx_nand>;
-       pinctrl-names = "default";
 
        partition@0 {
                label = "uboot";
index 38520a2875146d565c8016f69cc4f324098ff1ee..d5e3bc518968b4acf5e4b811d2944a84d12b79b8 100644 (file)
 
        chosen {
                bootargs = "console=ttyS0,115200n8 earlyprintk";
+               stdout-path = &uart0;
        };
 
        ocp@f1000000 {
                serial@12000 {
-                       status = "ok";
-                       pinctrl-0 = <&pmx_uart0>;
-                       pinctrl-names = "default";
+                       status = "okay";
                };
 
                serial@12100 {
-                       status = "ok";
-                       pinctrl-0 = <&pmx_uart1>;
-                       pinctrl-names = "default";
+                       status = "okay";
                };
 
                sata@80000 {
@@ -48,8 +45,6 @@
 
                i2c@11100 {
                        status = "okay";
-                       pinctrl-0 = <&pmx_twsi1>;
-                       pinctrl-names = "default";
 
                        s24c02: s24c02@50 {
                                compatible = "atmel,24c02";
@@ -57,7 +52,7 @@
                        };
                };
 
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        pinctrl-0 = <&pmx_dip_switches &pmx_gpio_header>;
                        pinctrl-names = "default";
 
                                marvell,pins = "mpp41", "mpp42", "mpp43";
                                marvell,function = "gpio";
                        };
-
-                       pmx_ge1: pmx-ge1 {
-                               marvell,pins = "mpp20", "mpp21", "mpp22", "mpp23",
-                                              "mpp24", "mpp25", "mpp26", "mpp27",
-                                              "mpp30", "mpp31", "mpp32", "mpp33";
-                               marvell,function = "ge1";
-                       };
                };
        };
 
 &nand {
        chip-delay = <25>;
        status = "okay";
-       pinctrl-0 = <&pmx_nand>;
-       pinctrl-names = "default";
 
        partition@0 {
                label = "uboot";
 
 &eth1 {
        status = "okay";
-       pinctrl-0 = <&pmx_ge1>;
-       pinctrl-names = "default";
        ethernet1-port@0 {
                phy-handle = <&ethphy1>;
        };
index e9dd850492976ca557d4545f8a18150751afed35..35a29dee8dd864f818c5cacd437a936eb2de0024 100644 (file)
@@ -26,6 +26,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8";
+               stdout-path = &uart0;
        };
 
        mbus {
@@ -39,7 +40,7 @@
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        pinctrl-0 = <&pmx_usb_power>;
                        pinctrl-names = "default";
 
@@ -56,8 +57,6 @@
 
                spi@10600 {
                        status = "okay";
-                       pinctrl-0 = <&pmx_spi>;
-                       pinctrl-names = "default";
 
                        m25p128@0 {
                                #address-cells = <1>;
index d6368c39102e743ef74465f94a032ef8d94f7e70..26cf0e0ccefd3772f6e194b8102ea751408d3f6f 100644 (file)
@@ -22,6 +22,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8";
+               stdout-path = &uart0;
        };
 
        mbus {
@@ -35,7 +36,7 @@
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        pinctrl-0 = <&pmx_sdio_cd>;
                        pinctrl-names = "default";
 
index 93ec3d00c6ab90b17ee11bac2fe6bb4cea23312e..3b19f1fd4caca99e687474b92a3a0729a13a1537 100644 (file)
@@ -24,6 +24,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8";
+               stdout-path = &uart0;
        };
 
        gpio-fan-100-15-35-3 {
index 311df4e5aa285e799d63fd06a10c45da1e24f309..921ca49e85a4dadf4cce6dc726e678c3044ef79b 100644 (file)
@@ -24,6 +24,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8";
+               stdout-path = &uart0;
        };
 
        gpio-fan-150-15-18 {
index f90da850bb31bca5f28c20e9f47c8132fd28bceb..02852b0c809f00020c01a7252b3dcc84254ae4ba 100644 (file)
@@ -24,6 +24,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8";
+               stdout-path = &uart0;
        };
 
        gpio-fan-100-15-35-3 {
index 1ff848d570a9a02921122140fd78f02d8759fd86..7196c7f3e1096fc4c42beb74db5ec2160e447ef2 100644 (file)
 
        chosen {
                bootargs = "console=ttyS0,115200n8 earlyprintk";
+               stdout-path = &uart0;
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
 
                        pmx_usb_power_enable: pmx-usb-power-enable {
                                marvell,pins = "mpp29";
@@ -44,8 +45,6 @@
                        };
                };
                serial@12000 {
-                       pinctrl-0 = <&pmx_uart0>;
-                       pinctrl-names = "default";
                        status = "okay";
                };
        };
@@ -72,8 +71,6 @@
 };
 
 &nand {
-       pinctrl-0 = <&pmx_nand>;
-       pinctrl-names = "default";
        status = "okay";
 
        partition@0 {
index 4227c974729d003b211f14658ba44e19e70cea6e..811e0971fc588a2cc9f59ddbd8f64d51e38acb14 100644 (file)
@@ -25,7 +25,7 @@
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        pmx_alarmled_12: pmx-alarmled-12 {
                                marvell,pins = "mpp12";
                                marvell,function = "gpio";
 
                spi@10600 {
                        status = "okay";
-                       pinctrl-0 = <&pmx_spi>;
-                       pinctrl-names = "default";
 
                        m25p80@0 {
                                #address-cells = <1>;
                i2c@11000 {
                        status = "okay";
                        clock-frequency = <400000>;
-                       pinctrl-0 = <&pmx_twsi0>;
-                       pinctrl-names = "default";
 
                        rs5c372: rs5c372@32 {
                                status = "disabled";
 
                serial@12000 {
                        status = "okay";
-                       pinctrl-0 = <&pmx_uart0>;
-                       pinctrl-names = "default";
                };
 
                serial@12100 {
                        status = "okay";
-                       pinctrl-0 = <&pmx_uart1>;
-                       pinctrl-names = "default";
                };
 
                poweroff@12100 {
index 0bd70d928c69ba7f7798d1492f6ce3844af9d6ad..610ec0f95858b4691f7c275d8a0d794a27d8863b 100644 (file)
@@ -27,6 +27,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8";
+               stdout-path = &uart0;
        };
 
        mbus {
@@ -40,7 +41,7 @@
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        pinctrl-0 = <&pmx_i2s &pmx_sysrst>;
                        pinctrl-names = "default";
 
                                marvell,function = "gpio";
                        };
 
-                       /*
-                        * Redefined from kirkwood-6281.dtsi, because
-                        * we don't use SPI CS on MPP0, but on MPP7.
-                        */
                        pmx_spi: pmx-spi {
                                marvell,pins = "mpp1", "mpp2", "mpp3", "mpp7";
                                marvell,function = "spi";
@@ -86,8 +83,6 @@
                };
 
                spi@10600 {
-                       pinctrl-0 = <&pmx_spi>;
-                       pinctrl-names = "default";
                        status = "okay";
 
                        flash@0 {
 
                i2c@11000 {
                        status = "okay";
+
+                       alc5621: alc5621@1a {
+                               compatible = "realtek,alc5621";
+                               reg = <0x1a>;
+                               #sound-dai-cells = <0>;
+                               add-ctrl = <0x3700>;
+                               jack-det-ctrl = <0x4810>;
+                       };
                };
 
                serial@12000 {
                gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
        };
 
+       sound {
+               compatible = "simple-audio-card";
+               simple-audio-card,format = "i2s";
+               simple-audio-card,routing =
+                       "Headphone Jack", "HPL",
+                       "Headphone Jack", "HPR",
+                       "Speaker", "SPKOUT",
+                       "Speaker", "SPKOUTN",
+                       "MIC1", "Mic Jack",
+                       "MIC2", "Mic Jack";
+               simple-audio-card,widgets =
+                       "Headphone", "Headphone Jack",
+                       "Speaker", "Speaker",
+                       "Microphone", "Mic Jack";
+
+               simple-audio-card,mclk-fs = <256>;
+
+               simple-audio-card,cpu {
+                       sound-dai = <&audio>;
+               };
+
+               simple-audio-card,codec {
+                       sound-dai = <&alc5621>;
+               };
+       };
 };
 
 &mdio {
index 5fc817c2cb87379dd3fbe9513dded60ae00c92e8..f5c8c0dd41dc82f7e7671f7713182186b250ec8e 100644 (file)
 
        chosen {
                bootargs = "console=ttyS0,115200n8 earlyprintk";
+               stdout-path = &uart0;
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        /*
                         * Switch positions
                         *
@@ -85,9 +86,7 @@
                };
 
                serial@12000 {
-                       status = "ok";
-                       pinctrl-0 = <&pmx_uart0>;
-                       pinctrl-names = "default";
+                       status = "okay";
                };
 
                sata@80000 {
@@ -96,9 +95,7 @@
                };
 
                i2c@11000 {
-                       status = "ok";
-                       pinctrl-0 = <&pmx_twsi0>;
-                       pinctrl-names = "default";
+                       status = "okay";
                };
 
                mvsdio@90000 {
 
 &nand {
        status = "okay";
-       pinctrl-0 = <&pmx_nand>;
-       pinctrl-names = "default";
 
        partition@0 {
                label = "u-boot";
index c17ae45e19be3ffc33f500e172e3a6e04c439b10..9767d73f3857f972798f22047e93391290034581 100644 (file)
@@ -6,7 +6,7 @@
 
 / {
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
 
                        pinctrl-0 = <&pmx_ram_size &pmx_board_id>;
                        pinctrl-names = "default";
index 0713d072758a1e22a30b86bf3921cdc806cf6b61..bfc1a32d4e422d5ca25dc8e1def9d0f0f0209fce 100644 (file)
@@ -16,7 +16,7 @@
        };
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
 
                        pinctrl-0 = <&pmx_ram_size &pmx_board_id>;
                        pinctrl-names = "default";
index 911f3a8cee23ec0d5d28f07451338147eeb01893..df7f15276575ada26c356e224bb223c63e0b42f8 100644 (file)
@@ -9,6 +9,7 @@
 
        chosen {
                bootargs = "console=ttyS0,115200n8";
+               stdout-path = &uart0;
        };
 
        mbus {
@@ -25,8 +26,6 @@
                i2c@11000 {
                        status = "okay";
                        clock-frequency = <400000>;
-                       pinctrl-0 = <&pmx_twsi0>;
-                       pinctrl-names = "default";
 
                        s35390a: s35390a@30 {
                                compatible = "s35390a";
                        };
                };
                serial@12000 {
-                       clock-frequency = <200000000>;
                        status = "okay";
-                       pinctrl-0 = <&pmx_uart0>;
-                       pinctrl-names = "default";
                };
                serial@12100 {
-                       clock-frequency = <200000000>;
                        status = "okay";
-                       pinctrl-0 = <&pmx_uart1>;
-                       pinctrl-names = "default";
                };
                poweroff@12100 {
                        compatible = "qnap,power-off";
@@ -52,8 +45,6 @@
                };
                spi@10600 {
                        status = "okay";
-                       pinctrl-0 = <&pmx_spi>;
-                       pinctrl-names = "default";
 
                        m25p128@0 {
                                #address-cells = <1>;
index 1a9c624c7a928f9c67bd72e1bb372e61d4a911b0..30ab93bfb1e476d0722bdc17e1eb6b5ca43f353b 100644 (file)
@@ -14,7 +14,7 @@
        compatible = "qnap,ts419", "marvell,kirkwood";
 
        ocp@f1000000 {
-               pinctrl: pinctrl@10000 {
+               pinctrl: pin-controller@10000 {
                        pinctrl-names = "default";
 
                        pmx_USB_copy_button: pmx-USB-copy-button {
index 90384587c27843c563d2c4328ce9411f4c26458b..afc640cd80c5f6c6cf561550e3fb9133beb3d523 100644 (file)
@@ -40,7 +40,7 @@
                pcie-mem-aperture = <0xe0000000 0x10000000>; /* 256 MiB memory space */
                pcie-io-aperture  = <0xf2000000 0x100000>;   /*   1 MiB    I/O space */
 
-               crypto@0301 {
+               cesa: crypto@0301 {
                        compatible = "marvell,orion-crypto";
                        reg = <MBUS_ID(0xf0, 0x01) 0x30000 0x10000>,
                              <MBUS_ID(0x03, 0x01) 0 0x800>;
@@ -61,6 +61,8 @@
                        chip-delay = <25>;
                        /* set partition map and/or chip-delay in board dts */
                        clocks = <&gate_clk 7>;
+                       pinctrl-0 = <&pmx_nand>;
+                       pinctrl-names = "default";
                        status = "disabled";
                };
        };
                #address-cells = <1>;
                #size-cells = <1>;
 
+               pinctrl: pin-controller@10000 {
+                       /* set compatible property in SoC file */
+                       reg = <0x10000 0x20>;
+
+                       pmx_ge1: pmx-ge1 {
+                               marvell,pins = "mpp20", "mpp21", "mpp22", "mpp23",
+                                              "mpp24", "mpp25", "mpp26", "mpp27",
+                                              "mpp30", "mpp31", "mpp32", "mpp33";
+                               marvell,function = "ge1";
+                       };
+
+                       pmx_nand: pmx-nand {
+                               marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3",
+                                              "mpp4", "mpp5", "mpp18", "mpp19";
+                               marvell,function = "nand";
+                       };
+
+                       /*
+                        * Default SPI0 pinctrl setting with CSn on mpp0,
+                        * overwrite marvell,pins on board level if required.
+                        */
+                       pmx_spi: pmx-spi {
+                               marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3";
+                               marvell,function = "spi";
+                       };
+
+                       pmx_twsi0: pmx-twsi0 {
+                               marvell,pins = "mpp8", "mpp9";
+                               marvell,function = "twsi0";
+                       };
+
+                       /*
+                        * Default UART pinctrl setting without RTS/CTS,
+                        * overwrite marvell,pins on board level if required.
+                        */
+                       pmx_uart0: pmx-uart0 {
+                               marvell,pins = "mpp10", "mpp11";
+                               marvell,function = "uart0";
+                       };
+
+                       pmx_uart1: pmx-uart1 {
+                               marvell,pins = "mpp13", "mpp14";
+                               marvell,function = "uart1";
+                       };
+               };
+
                core_clk: core-clocks@10030 {
                        compatible = "marvell,kirkwood-core-clock";
                        reg = <0x10030 0x4>;
                        #clock-cells = <1>;
                };
 
-               spi@10600 {
+               spi0: spi@10600 {
                        compatible = "marvell,orion-spi";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        interrupts = <23>;
                        reg = <0x10600 0x28>;
                        clocks = <&gate_clk 7>;
+                       pinctrl-0 = <&pmx_spi>;
+                       pinctrl-names = "default";
                        status = "disabled";
                };
 
                        interrupts = <29>;
                        clock-frequency = <100000>;
                        clocks = <&gate_clk 7>;
+                       pinctrl-0 = <&pmx_twsi0>;
+                       pinctrl-names = "default";
                        status = "disabled";
                };
 
-               serial@12000 {
+               uart0: serial@12000 {
                        compatible = "ns16550a";
                        reg = <0x12000 0x100>;
                        reg-shift = <2>;
                        interrupts = <33>;
                        clocks = <&gate_clk 7>;
+                       pinctrl-0 = <&pmx_uart0>;
+                       pinctrl-names = "default";
                        status = "disabled";
                };
 
-               serial@12100 {
+               uart1: serial@12100 {
                        compatible = "ns16550a";
                        reg = <0x12100 0x100>;
                        reg-shift = <2>;
                        interrupts = <34>;
                        clocks = <&gate_clk 7>;
+                       pinctrl-0 = <&pmx_uart1>;
+                       pinctrl-names = "default";
                        status = "disabled";
                };
 
                        reg = <0x20000 0x80>, <0x1500 0x20>;
                };
 
-               system-controller@20000 {
+               sysc: system-controller@20000 {
                        compatible = "marvell,orion-system-controller";
                        reg = <0x20000 0x120>;
                };
                        status = "okay";
                };
 
-               ehci@50000 {
+               usb0: ehci@50000 {
                        compatible = "marvell,orion-ehci";
                        reg = <0x50000 0x1000>;
                        interrupts = <19>;
                        status = "okay";
                };
 
-               xor@60800 {
+               dma0: xor@60800 {
                        compatible = "marvell,orion-xor";
                        reg = <0x60800 0x100
                               0x60A00 0x100>;
                        };
                };
 
-               xor@60900 {
+               dma1: xor@60900 {
                        compatible = "marvell,orion-xor";
                        reg = <0x60900 0x100
                               0x60B00 0x100>;
                        reg = <0x76000 0x4000>;
                        clocks = <&gate_clk 19>;
                        marvell,tx-checksum-limit = <1600>;
+                       pinctrl-0 = <&pmx_ge1>;
+                       pinctrl-names = "default";
                        status = "disabled";
 
                        ethernet1-port@0 {
 
                audio0: audio-controller@a0000 {
                        compatible = "marvell,kirkwood-audio";
+                       #sound-dai-cells = <0>;
                        reg = <0xa0000 0x2210>;
                        interrupts = <24>;
                        clocks = <&gate_clk 9>;
diff --git a/arch/arm/boot/dts/orion5x-lacie-d2-network.dts b/arch/arm/boot/dts/orion5x-lacie-d2-network.dts
new file mode 100644 (file)
index 0000000..c701e8d
--- /dev/null
@@ -0,0 +1,236 @@
+/*
+ * Copyright (C) 2014 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+ * Copyright (C) 2009 Simon Guinot <sguinot@lacie.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.
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include "orion5x-mv88f5182.dtsi"
+
+/ {
+       model = "LaCie d2 Network";
+       compatible = "lacie,d2-network", "marvell,orion5x-88f5182", "marvell,orion5x";
+
+       memory {
+               reg = <0x00000000 0x4000000>; /* 64 MB */
+       };
+
+       chosen {
+               bootargs = "console=ttyS0,115200n8 earlyprintk";
+               linux,stdout-path = &uart0;
+       };
+
+       soc {
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>,
+                        <MBUS_ID(0x09, 0x00) 0 0xf2200000 0x800>,
+                        <MBUS_ID(0x01, 0x0f) 0 0xfff80000 0x80000>;
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               pinctrl-0 = <&pmx_buttons>;
+               pinctrl-names = "default";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               front_button {
+                       label = "Front Push Button";
+                       linux,code = <KEY_POWER>;
+                       gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>;
+               };
+
+               power_rocker_sw_on {
+                       label = "Power rocker switch (on|auto)";
+                       linux,input-type = <5>; /* EV_SW */
+                       linux,code = <1>; /* D2NET_SWITCH_POWER_ON */
+                       gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
+               };
+
+               power_rocker_sw_off {
+                       label = "Power rocker switch (auto|off)";
+                       linux,input-type = <5>; /* EV_SW */
+                       linux,code = <2>; /* D2NET_SWITCH_POWER_OFF */
+                       gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       regulators {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               pinctrl-0 = <&pmx_sata0_power &pmx_sata1_power>;
+               pinctrl-names = "default";
+
+               sata0_power: regulator@0 {
+                       compatible = "regulator-fixed";
+                       reg = <0>;
+                       regulator-name = "SATA0 Power";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       enable-active-high;
+                       regulator-always-on;
+                       regulator-boot-on;
+                       gpio = <&gpio0 3 GPIO_ACTIVE_HIGH>;
+               };
+
+               sata1_power: regulator@1 {
+                       compatible = "regulator-fixed";
+                       reg = <1>;
+                       regulator-name = "SATA1 Power";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       enable-active-high;
+                       regulator-always-on;
+                       regulator-boot-on;
+                       gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>;
+               };
+       };
+};
+
+&devbus_bootcs {
+       status = "okay";
+
+       devbus,keep-config;
+
+       /*
+        * Currently the MTD code does not recognize the MX29LV400CBCT
+        * as a bottom-type device. This could cause risks of
+        * accidentally erasing critical flash sectors. We thus define
+        * a single, write-protected partition covering the whole
+        * flash.  TODO: once the flash part TOP/BOTTOM detection
+        * issue is sorted out in the MTD code, break this into at
+        * least three partitions: 'u-boot code', 'u-boot environment'
+        * and 'whatever is left'.
+        */
+       flash@0 {
+               compatible = "cfi-flash";
+               reg = <0 0x80000>;
+               bank-width = <1>;
+                #address-cells = <1>;
+               #size-cells = <1>;
+
+               partition@0 {
+                       label = "Full512Kb";
+                       reg = <0 0x80000>;
+                       read-only;
+               };
+       };
+};
+
+&mdio {
+       status = "okay";
+
+       ethphy: ethernet-phy {
+               reg = <8>;
+       };
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&eth {
+       status = "okay";
+
+       ethernet-port@0 {
+               phy-handle = <&ethphy>;
+       };
+};
+
+&i2c {
+       status = "okay";
+       clock-frequency = <100000>;
+       #address-cells = <1>;
+
+       rtc@32 {
+               compatible = "ricoh,rs5c372b";
+               reg = <0x32>;
+       };
+
+       fan@3e {
+               compatible = "gmt,g762";
+               reg = <0x3e>;
+
+               /* Not enough HW info */
+               status = "disabled";
+       };
+
+       eeprom@50 {
+               compatible = "atmel,24c08";
+               reg = <0x50>;
+       };
+};
+
+&pinctrl {
+       pinctrl-0 = <&pmx_leds &pmx_board_id &pmx_fan_fail>;
+       pinctrl-names = "default";
+
+       pmx_board_id: pmx-board-id {
+               marvell,pins = "mpp0", "mpp1", "mpp2";
+               marvell,function = "gpio";
+       };
+
+       pmx_buttons: pmx-buttons {
+               marvell,pins = "mpp8", "mpp9", "mpp18";
+               marvell,function = "gpio";
+       };
+
+       pmx_fan_fail: pmx-fan-fail {
+               marvell,pins = "mpp5";
+               marvell,function = "gpio";
+       };
+
+       /*
+        * MPP6: Red front LED
+        * MPP16: Blue front LED blink control
+        */
+       pmx_leds: pmx-leds {
+               marvell,pins = "mpp6", "mpp16";
+               marvell,function = "gpio";
+       };
+
+       pmx_sata0_led_active: pmx-sata0-led-active {
+               marvell,pins = "mpp14";
+               marvell,function = "sata0";
+       };
+
+       pmx_sata0_power: pmx-sata0-power {
+               marvell,pins = "mpp3";
+               marvell,function = "gpio";
+       };
+
+       pmx_sata1_led_active: pmx-sata1-led-active {
+               marvell,pins = "mpp15";
+               marvell,function = "sata1";
+       };
+
+       pmx_sata1_power: pmx-sata1-power {
+               marvell,pins = "mpp12";
+               marvell,function = "gpio";
+       };
+
+       /*
+        * Non MPP GPIOs:
+        *  GPIO 22: USB port 1 fuse (0 = Fail, 1 = Ok)
+        *  GPIO 23: Blue front LED off
+        *  GPIO 24: Inhibit board power off (0 = Disabled, 1 = Enabled)
+        */
+};
+
+&sata {
+       pinctrl-0 = <&pmx_sata0_led_active
+                    &pmx_sata1_led_active>;
+       pinctrl-names = "default";
+       status = "okay";
+       nr-ports = <2>;
+};
+
+&uart0 {
+       status = "okay";
+};
index 5ed6c137690183c4586e6bdb7f00baa19f7b7054..89ff404a528c74f3869c6afcfcfdb34cdc7cde46 100644 (file)
@@ -6,8 +6,19 @@
  * warranty of any kind, whether express or implied.
  */
 
+/*
+ * TODO: add Orion USB device port init when kernel.org support is added.
+ * TODO: add flash write support: see below.
+ * TODO: add power-off support.
+ * TODO: add I2C EEPROM support.
+ */
+
 /dts-v1/;
-/include/ "orion5x.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include "orion5x-mv88f5182.dtsi"
 
 / {
        model = "LaCie Ethernet Disk mini V2";
 
        chosen {
                bootargs = "console=ttyS0,115200n8 earlyprintk";
+               linux,stdout-path = &uart0;
        };
 
-       ocp@f1000000 {
-               serial@12000 {
-                       clock-frequency = <166666667>;
-                       status = "okay";
-               };
-
-               sata@80000 {
-                       status = "okay";
-                       nr-ports = <2>;
-               };
+       soc {
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>,
+                        <MBUS_ID(0x09, 0x00) 0 0xf2200000 0x800>,
+                        <MBUS_ID(0x01, 0x0f) 0 0xfff80000 0x80000>;
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
+               pinctrl-0 = <&pmx_power_button>;
+               pinctrl-names = "default";
                #address-cells = <1>;
                #size-cells = <0>;
                button@1 {
                        label = "Power-on Switch";
-                       linux,code = <116>; /* KEY_POWER */
-                       gpios = <&gpio0 18 0>;
+                       linux,code = <KEY_POWER>;
+                       gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>;
                };
        };
 
-       gpio_leds {
+       gpio-leds {
                compatible = "gpio-leds";
+               pinctrl-0 = <&pmx_power_led>;
+               pinctrl-names = "default";
 
                led@1 {
                        label = "power:blue";
-                       gpios = <&gpio0 16 1>;
+                       gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
                };
        };
 };
 
-&mdio {
+&devbus_bootcs {
        status = "okay";
 
-       ethphy: ethernet-phy {
-               reg = <8>;
+       /* Read parameters */
+       devbus,bus-width    = <8>;
+       devbus,turn-off-ps  = <90000>;
+       devbus,badr-skew-ps = <0>;
+       devbus,acc-first-ps = <186000>;
+       devbus,acc-next-ps  = <186000>;
+
+       /* Write parameters */
+       devbus,wr-high-ps  = <90000>;
+       devbus,wr-low-ps   = <90000>;
+       devbus,ale-wr-ps   = <90000>;
+
+       /*
+        * Currently the MTD code does not recognize the MX29LV400CBCT
+        * as a bottom-type device. This could cause risks of
+        * accidentally erasing critical flash sectors. We thus define
+        * a single, write-protected partition covering the whole
+        * flash.  TODO: once the flash part TOP/BOTTOM detection
+        * issue is sorted out in the MTD code, break this into at
+        * least three partitions: 'u-boot code', 'u-boot environment'
+        * and 'whatever is left'.
+        */
+       flash@0 {
+               compatible = "cfi-flash";
+               reg = <0 0x80000>;
+               bank-width = <1>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               partition@0 {
+                       label = "Full512Kb";
+                       reg = <0 0x80000>;
+                       read-only;
+               };
        };
 };
 
+&ehci0 {
+       status = "okay";
+};
+
 &eth {
        status = "okay";
 
                phy-handle = <&ethphy>;
        };
 };
+
+&i2c {
+       status = "okay";
+       clock-frequency = <100000>;
+       #address-cells = <1>;
+
+       rtc@32 {
+               compatible = "ricoh,rs5c372a";
+               reg = <0x32>;
+               interrupt-parent = <&gpio0>;
+               interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
+       };
+};
+
+&mdio {
+       status = "okay";
+
+       ethphy: ethernet-phy {
+               reg = <8>;
+       };
+};
+
+&pinctrl {
+       pinctrl-0 = <&pmx_rtc &pmx_power_led_ctrl>;
+       pinctrl-names = "default";
+
+       pmx_power_button: pmx-power-button {
+               marvell,pins = "mpp18";
+               marvell,function = "gpio";
+       };
+
+       pmx_power_led: pmx-power-led {
+               marvell,pins = "mpp16";
+               marvell,function = "gpio";
+       };
+
+       pmx_power_led_ctrl: pmx-power-led-ctrl {
+               marvell,pins = "mpp17";
+               marvell,function = "gpio";
+       };
+
+       pmx_rtc: pmx-rtc {
+               marvell,pins = "mpp3";
+               marvell,function = "gpio";
+       };
+};
+
+&sata {
+       pinctrl-0 = <&pmx_sata0 &pmx_sata1>;
+       pinctrl-names = "default";
+       status = "okay";
+       nr-ports = <2>;
+};
+
+&uart0 {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/orion5x-maxtor-shared-storage-2.dts b/arch/arm/boot/dts/orion5x-maxtor-shared-storage-2.dts
new file mode 100644 (file)
index 0000000..ff34849
--- /dev/null
@@ -0,0 +1,178 @@
+/*
+ * Copyright (C) 2014 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+ * Copyright (C) Sylver Bruneau <sylver.bruneau@googlemail.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.
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include "orion5x-mv88f5182.dtsi"
+
+/ {
+       model = "Maxtor Shared Storage II";
+       compatible = "maxtor,shared-storage-2", "marvell,orion5x-88f5182", "marvell,orion5x";
+
+       memory {
+               reg = <0x00000000 0x4000000>; /* 64 MB */
+       };
+
+       chosen {
+               bootargs = "console=ttyS0,115200n8 earlyprintk";
+               linux,stdout-path = &uart0;
+       };
+
+       soc {
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>,
+                        <MBUS_ID(0x09, 0x00) 0 0xf2200000 0x800>,
+                        <MBUS_ID(0x01, 0x0f) 0 0xff800000 0x40000>;
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               pinctrl-0 = <&pmx_buttons>;
+               pinctrl-names = "default";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               power {
+                       label = "Power";
+                       linux,code = <KEY_POWER>;
+                       gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
+               };
+
+               reset {
+                       label = "Reset";
+                       linux,code = <KEY_RESTART>;
+                       gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
+               };
+       };
+};
+
+&devbus_bootcs {
+       status = "okay";
+
+       devbus,keep-config;
+
+       /*
+        * Currently the MTD code does not recognize the MX29LV400CBCT
+        * as a bottom-type device. This could cause risks of
+        * accidentally erasing critical flash sectors. We thus define
+        * a single, write-protected partition covering the whole
+        * flash.  TODO: once the flash part TOP/BOTTOM detection
+        * issue is sorted out in the MTD code, break this into at
+        * least three partitions: 'u-boot code', 'u-boot environment'
+        * and 'whatever is left'.
+        */
+       flash@0 {
+               compatible = "cfi-flash";
+               reg = <0 0x40000>;
+               bank-width = <1>;
+                #address-cells = <1>;
+               #size-cells = <1>;
+       };
+};
+
+&mdio {
+       status = "okay";
+
+       ethphy: ethernet-phy {
+               reg = <8>;
+       };
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&eth {
+       status = "okay";
+
+       ethernet-port@0 {
+               phy-handle = <&ethphy>;
+       };
+};
+
+&i2c {
+       status = "okay";
+       clock-frequency = <100000>;
+       #address-cells = <1>;
+
+       rtc@68 {
+               compatible = "st,m41t81";
+               reg = <0x68>;
+               pinctrl-0 = <&pmx_rtc>;
+               pinctrl-names = "default";
+               interrupt-parent = <&gpio0>;
+               interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
+       };
+};
+
+&pinctrl {
+       pinctrl-0 = <&pmx_leds &pmx_misc>;
+       pinctrl-names = "default";
+
+       pmx_buttons: pmx-buttons {
+               marvell,pins = "mpp11", "mpp12";
+               marvell,function = "gpio";
+       };
+
+       /*
+        * MPP0: Power LED
+        * MPP1: Error LED
+        */
+       pmx_leds: pmx-leds {
+               marvell,pins = "mpp0", "mpp1";
+               marvell,function = "gpio";
+       };
+
+       /*
+        * MPP4: HDD ind. (Single/Dual)
+        * MPP5: HD0 5V control
+        * MPP6: HD0 12V control
+        * MPP7: HD1 5V control
+        * MPP8: HD1 12V control
+        */
+       pmx_misc: pmx-misc {
+               marvell,pins = "mpp4", "mpp5", "mpp6", "mpp7", "mpp8", "mpp10";
+               marvell,function = "gpio";
+       };
+
+       pmx_rtc: pmx-rtc {
+               marvell,pins = "mpp3";
+               marvell,function = "gpio";
+       };
+
+       pmx_sata0_led_active: pmx-sata0-led-active {
+               marvell,pins = "mpp14";
+               marvell,function = "sata0";
+       };
+
+       pmx_sata1_led_active: pmx-sata1-led-active {
+               marvell,pins = "mpp15";
+               marvell,function = "sata1";
+       };
+
+       /*
+        * Non MPP GPIOs:
+        *  GPIO 22: USB port 1 fuse (0 = Fail, 1 = Ok)
+        *  GPIO 23: Blue front LED off
+        *  GPIO 24: Inhibit board power off (0 = Disabled, 1 = Enabled)
+        */
+};
+
+&sata {
+       pinctrl-0 = <&pmx_sata0_led_active
+                    &pmx_sata1_led_active>;
+       pinctrl-names = "default";
+       status = "okay";
+       nr-ports = <2>;
+};
+
+&uart0 {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/orion5x-mv88f5182.dtsi b/arch/arm/boot/dts/orion5x-mv88f5182.dtsi
new file mode 100644 (file)
index 0000000..d1ed71c
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2014 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 "orion5x.dtsi"
+
+/ {
+       compatible = "marvell,orion5x-88f5182", "marvell,orion5x";
+
+       soc {
+               compatible = "marvell,orion5x-88f5182-mbus", "simple-bus";
+
+               internal-regs {
+                       pinctrl: pinctrl@10000 {
+                               compatible = "marvell,88f5182-pinctrl";
+                               reg = <0x10000 0x8>, <0x10050 0x4>;
+
+                               pmx_sata0: pmx-sata0 {
+                                       marvell,pins = "mpp12", "mpp14";
+                                       marvell,function = "sata0";
+                               };
+
+                               pmx_sata1: pmx-sata1 {
+                                       marvell,pins = "mpp13", "mpp15";
+                                       marvell,function = "sata1";
+                               };
+                       };
+
+                       core_clk: core-clocks@10030 {
+                               compatible = "marvell,mv88f5182-core-clock";
+                               reg = <0x10010 0x4>;
+                               #clock-cells = <1>;
+                       };
+
+                       mbusc: mbus-controller@20000 {
+                               compatible = "marvell,mbus-controller";
+                               reg = <0x20000 0x100>, <0x1500 0x20>;
+                       };
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/orion5x-rd88f5182-nas.dts b/arch/arm/boot/dts/orion5x-rd88f5182-nas.dts
new file mode 100644 (file)
index 0000000..6fb0525
--- /dev/null
@@ -0,0 +1,177 @@
+/*
+ * Copyright (C) 2014 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.
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include "orion5x-mv88f5182.dtsi"
+
+/ {
+       model = "Marvell Reference Design 88F5182 NAS";
+       compatible = "marvell,rd-88f5182-nas", "marvell,orion5x-88f5182", "marvell,orion5x";
+
+       memory {
+               reg = <0x00000000 0x4000000>; /* 64 MB */
+       };
+
+       chosen {
+               bootargs = "console=ttyS0,115200n8 earlyprintk";
+               linux,stdout-path = &uart0;
+       };
+
+       soc {
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>,
+                        <MBUS_ID(0x09, 0x00) 0 0xf2200000 0x800>,
+                        <MBUS_ID(0x01, 0x0f) 0 0xf4000000 0x80000>,
+                        <MBUS_ID(0x01, 0x1d) 0 0xfc000000 0x1000000>;
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+               pinctrl-0 = <&pmx_debug_led>;
+               pinctrl-names = "default";
+
+               led@0 {
+                       label = "rd88f5182:cpu";
+                       linux,default-trigger = "heartbeat";
+                       gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
+               };
+       };
+};
+
+&devbus_bootcs {
+       status = "okay";
+
+       /* Read parameters */
+       devbus,bus-width    = <8>;
+       devbus,turn-off-ps  = <90000>;
+       devbus,badr-skew-ps = <0>;
+       devbus,acc-first-ps = <186000>;
+       devbus,acc-next-ps  = <186000>;
+
+       /* Write parameters */
+       devbus,wr-high-ps  = <90000>;
+       devbus,wr-low-ps   = <90000>;
+       devbus,ale-wr-ps   = <90000>;
+
+       flash@0 {
+               compatible = "cfi-flash";
+               reg = <0 0x80000>;
+               bank-width = <1>;
+       };
+};
+
+&devbus_cs1 {
+       status = "okay";
+
+       /* Read parameters */
+       devbus,bus-width    = <8>;
+       devbus,turn-off-ps  = <90000>;
+       devbus,badr-skew-ps = <0>;
+       devbus,acc-first-ps = <186000>;
+       devbus,acc-next-ps  = <186000>;
+
+       /* Write parameters */
+       devbus,wr-high-ps  = <90000>;
+       devbus,wr-low-ps   = <90000>;
+       devbus,ale-wr-ps   = <90000>;
+
+       flash@0 {
+               compatible = "cfi-flash";
+               reg = <0 0x1000000>;
+               bank-width = <1>;
+       };
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&eth {
+       status = "okay";
+
+       ethernet-port@0 {
+               phy-handle = <&ethphy>;
+       };
+};
+
+&i2c {
+       status = "okay";
+       clock-frequency = <100000>;
+       #address-cells = <1>;
+
+       rtc@68 {
+               pinctrl-0 = <&pmx_rtc>;
+               pinctrl-names = "default";
+               compatible = "dallas,ds1338";
+               reg = <0x68>;
+       };
+};
+
+&mdio {
+       status = "okay";
+
+       ethphy: ethernet-phy {
+               reg = <8>;
+       };
+};
+
+&pinctrl {
+       pinctrl-0 = <&pmx_reset_switch &pmx_misc_gpios
+               &pmx_pci_gpios>;
+       pinctrl-names = "default";
+
+       /*
+        * MPP[20] PCI Clock to MV88F5182
+        * MPP[21] PCI Clock to mini PCI CON11
+        * MPP[22] USB 0 over current indication
+        * MPP[23] USB 1 over current indication
+        * MPP[24] USB 1 over current enable
+        * MPP[25] USB 0 over current enable
+        */
+
+       pmx_debug_led: pmx-debug_led {
+               marvell,pins = "mpp0";
+               marvell,function = "gpio";
+       };
+
+       pmx_reset_switch: pmx-reset-switch {
+               marvell,pins = "mpp1";
+               marvell,function = "gpio";
+       };
+
+       pmx_rtc: pmx-rtc {
+               marvell,pins = "mpp3";
+               marvell,function = "gpio";
+       };
+
+       pmx_misc_gpios: pmx-misc-gpios {
+               marvell,pins = "mpp4", "mpp5";
+               marvell,function = "gpio";
+       };
+
+       pmx_pci_gpios: pmx-pci-gpios {
+               marvell,pins = "mpp6", "mpp7";
+               marvell,function = "gpio";
+       };
+};
+
+&sata {
+       pinctrl-0 = <&pmx_sata0 &pmx_sata1>;
+       pinctrl-names = "default";
+       status = "okay";
+       nr-ports = <2>;
+};
+
+&uart0 {
+       status = "okay";
+};
index 174d89241f7002ffb9b12e4f3db1997bf13d7611..75cd01bd60241d0e0f06f2a390941c63a925e7bf 100644 (file)
@@ -6,7 +6,9 @@
  * warranty of any kind, whether express or implied.
  */
 
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
+
+#define MBUS_ID(target,attributes) (((target) << 24) | ((attributes) << 16))
 
 / {
        model = "Marvell Orion5x SoC";
                gpio0 = &gpio0;
        };
 
-       intc: interrupt-controller {
-               compatible = "marvell,orion-intc";
-               interrupt-controller;
-               #interrupt-cells = <1>;
-               reg = <0xf1020200 0x08>;
-       };
-
-       ocp@f1000000 {
-               compatible = "simple-bus";
-               ranges = <0x00000000 0xf1000000 0x4000000
-                         0xf2200000 0xf2200000 0x0000800>;
-               #address-cells = <1>;
+       soc {
+               #address-cells = <2>;
                #size-cells = <1>;
+               controller = <&mbusc>;
 
-               gpio0: gpio@10100 {
-                       compatible = "marvell,orion-gpio";
-                       #gpio-cells = <2>;
-                       gpio-controller;
-                       reg = <0x10100 0x40>;
-                       ngpios = <32>;
-                       interrupt-controller;
-                       #interrupt-cells = <2>;
-                       interrupts = <6>, <7>, <8>, <9>;
-               };
-
-               spi@10600 {
-                       compatible = "marvell,orion-spi";
+               devbus_bootcs: devbus-bootcs {
+                       compatible = "marvell,orion-devbus";
+                       reg = <MBUS_ID(0xf0, 0x01) 0x1046C 0x4>;
+                       ranges = <0 MBUS_ID(0x01, 0x0f) 0 0xffffffff>;
                        #address-cells = <1>;
-                       #size-cells = <0>;
-                       cell-index = <0>;
-                       reg = <0x10600 0x28>;
+                       #size-cells = <1>;
+                       clocks = <&core_clk 0>;
                        status = "disabled";
                };
 
-               i2c@11000 {
-                       compatible = "marvell,mv64xxx-i2c";
-                       reg = <0x11000 0x20>;
+               devbus_cs0: devbus-cs0 {
+                       compatible = "marvell,orion-devbus";
+                       reg = <MBUS_ID(0xf0, 0x01) 0x1045C 0x4>;
+                       ranges = <0 MBUS_ID(0x01, 0x1e) 0 0xffffffff>;
                        #address-cells = <1>;
-                       #size-cells = <0>;
-                       interrupts = <5>;
-                       clock-frequency = <100000>;
+                       #size-cells = <1>;
+                       clocks = <&core_clk 0>;
                        status = "disabled";
                };
 
-               serial@12000 {
-                       compatible = "ns16550a";
-                       reg = <0x12000 0x100>;
-                       reg-shift = <2>;
-                       interrupts = <3>;
-                       /* set clock-frequency in board dts */
+               devbus_cs1: devbus-cs1 {
+                       compatible = "marvell,orion-devbus";
+                       reg = <MBUS_ID(0xf0, 0x01) 0x10460 0x4>;
+                       ranges = <0 MBUS_ID(0x01, 0x1d) 0 0xffffffff>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       clocks = <&core_clk 0>;
                        status = "disabled";
                };
 
-               serial@12100 {
-                       compatible = "ns16550a";
-                       reg = <0x12100 0x100>;
-                       reg-shift = <2>;
-                       interrupts = <4>;
-                       /* set clock-frequency in board dts */
+               devbus_cs2: devbus-cs2 {
+                       compatible = "marvell,orion-devbus";
+                       reg = <MBUS_ID(0xf0, 0x01) 0x10464 0x4>;
+                       ranges = <0 MBUS_ID(0x01, 0x1b) 0 0xffffffff>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       clocks = <&core_clk 0>;
                        status = "disabled";
                };
 
-               wdt@20300 {
-                       compatible = "marvell,orion-wdt";
-                       reg = <0x20300 0x28>;
-                       status = "okay";
-               };
+               internal-regs {
+                       compatible = "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 MBUS_ID(0xf0, 0x01) 0 0x100000>;
+
+                       gpio0: gpio@10100 {
+                               compatible = "marvell,orion-gpio";
+                               #gpio-cells = <2>;
+                               gpio-controller;
+                               reg = <0x10100 0x40>;
+                               ngpios = <32>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                               interrupts = <6>, <7>, <8>, <9>;
+                       };
 
-               ehci@50000 {
-                       compatible = "marvell,orion-ehci";
-                       reg = <0x50000 0x1000>;
-                       interrupts = <17>;
-                       status = "disabled";
-               };
+                       spi: spi@10600 {
+                               compatible = "marvell,orion-spi";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               cell-index = <0>;
+                               reg = <0x10600 0x28>;
+                               status = "disabled";
+                       };
 
-               xor@60900 {
-                       compatible = "marvell,orion-xor";
-                       reg = <0x60900 0x100
-                              0x60b00 0x100>;
-                       status = "okay";
+                       i2c: i2c@11000 {
+                               compatible = "marvell,mv64xxx-i2c";
+                               reg = <0x11000 0x20>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               interrupts = <5>;
+                               clocks = <&core_clk 0>;
+                               status = "disabled";
+                       };
 
-                       xor00 {
-                             interrupts = <30>;
-                             dmacap,memcpy;
-                             dmacap,xor;
+                       uart0: serial@12000 {
+                               compatible = "ns16550a";
+                               reg = <0x12000 0x100>;
+                               reg-shift = <2>;
+                               interrupts = <3>;
+                               clocks = <&core_clk 0>;
+                               status = "disabled";
                        };
-                       xor01 {
-                             interrupts = <31>;
-                             dmacap,memcpy;
-                             dmacap,xor;
-                             dmacap,memset;
+
+                       uart1: serial@12100 {
+                               compatible = "ns16550a";
+                               reg = <0x12100 0x100>;
+                               reg-shift = <2>;
+                               interrupts = <4>;
+                               clocks = <&core_clk 0>;
+                               status = "disabled";
                        };
-               };
 
-               eth: ethernet-controller@72000 {
-                       compatible = "marvell,orion-eth";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       reg = <0x72000 0x4000>;
-                       marvell,tx-checksum-limit = <1600>;
-                       status = "disabled";
+                       bridge_intc: bridge-interrupt-ctrl@20110 {
+                               compatible = "marvell,orion-bridge-intc";
+                               interrupt-controller;
+                               #interrupt-cells = <1>;
+                               reg = <0x20110 0x8>;
+                               interrupts = <0>;
+                               marvell,#interrupts = <4>;
+                       };
 
-                       ethernet-port@0 {
-                               compatible = "marvell,orion-eth-port";
-                               reg = <0>;
-                               /* overwrite MAC address in bootloader */
-                               local-mac-address = [00 00 00 00 00 00];
-                               /* set phy-handle property in board file */
+                       intc: interrupt-controller@20200 {
+                               compatible = "marvell,orion-intc";
+                               interrupt-controller;
+                               #interrupt-cells = <1>;
+                               reg = <0x20200 0x08>;
                        };
-               };
 
-               mdio: mdio-bus@72004 {
-                       compatible = "marvell,orion-mdio";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       reg = <0x72004 0x84>;
-                       interrupts = <22>;
-                       status = "disabled";
+                       timer: timer@20300 {
+                               compatible = "marvell,orion-timer";
+                               reg = <0x20300 0x20>;
+                               interrupt-parent = <&bridge_intc>;
+                               interrupts = <1>, <2>;
+                               clocks = <&core_clk 0>;
+                       };
 
-                       /* add phy nodes in board file */
-               };
+                       wdt: wdt@20300 {
+                               compatible = "marvell,orion-wdt";
+                               reg = <0x20300 0x28>;
+                               interrupt-parent = <&bridge_intc>;
+                               interrupts = <3>;
+                               status = "okay";
+                       };
 
-               sata@80000 {
-                       compatible = "marvell,orion-sata";
-                       reg = <0x80000 0x5000>;
-                       interrupts = <29>;
-                       status = "disabled";
+                       ehci0: ehci@50000 {
+                               compatible = "marvell,orion-ehci";
+                               reg = <0x50000 0x1000>;
+                               interrupts = <17>;
+                               status = "disabled";
+                       };
+
+                       xor: dma-controller@60900 {
+                               compatible = "marvell,orion-xor";
+                               reg = <0x60900 0x100
+                                      0x60b00 0x100>;
+                               status = "okay";
+
+                               xor00 {
+                                     interrupts = <30>;
+                                     dmacap,memcpy;
+                                     dmacap,xor;
+                               };
+                               xor01 {
+                                     interrupts = <31>;
+                                     dmacap,memcpy;
+                                     dmacap,xor;
+                                     dmacap,memset;
+                               };
+                       };
+
+                       eth: ethernet-controller@72000 {
+                               compatible = "marvell,orion-eth";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               reg = <0x72000 0x4000>;
+                               marvell,tx-checksum-limit = <1600>;
+                               status = "disabled";
+
+                               ethport: ethernet-port@0 {
+                                       compatible = "marvell,orion-eth-port";
+                                       reg = <0>;
+                                       interrupts = <21>;
+                                       /* overwrite MAC address in bootloader */
+                                       local-mac-address = [00 00 00 00 00 00];
+                                       /* set phy-handle property in board file */
+                               };
+                       };
+
+                       mdio: mdio-bus@72004 {
+                               compatible = "marvell,orion-mdio";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               reg = <0x72004 0x84>;
+                               interrupts = <22>;
+                               status = "disabled";
+
+                               /* add phy nodes in board file */
+                       };
+
+                       sata: sata@80000 {
+                               compatible = "marvell,orion-sata";
+                               reg = <0x80000 0x5000>;
+                               interrupts = <29>;
+                               status = "disabled";
+                       };
+
+                       ehci1: ehci@a0000 {
+                               compatible = "marvell,orion-ehci";
+                               reg = <0xa0000 0x1000>;
+                               interrupts = <12>;
+                               status = "disabled";
+                       };
                };
 
-               crypto@90000 {
+               cesa: crypto@90000 {
                        compatible = "marvell,orion-crypto";
-                       reg = <0x90000 0x10000>,
-                             <0xf2200000 0x800>;
+                       reg = <MBUS_ID(0xf0, 0x01) 0x90000 0x10000>,
+                             <MBUS_ID(0x09, 0x00) 0x0 0x800>;
                        reg-names = "regs", "sram";
                        interrupts = <28>;
                        status = "okay";
                };
-
-               ehci@a0000 {
-                       compatible = "marvell,orion-ehci";
-                       reg = <0xa0000 0x1000>;
-                       interrupts = <12>;
-                       status = "disabled";
-               };
        };
 };
index 1e82571d6823ef55169af9827efab952189e952c..7e7d8843abaf3121ce83cf86775d5e25acc82fc8 100644 (file)
                                compatible = "sirf,prima2-tick";
                                reg = <0xb0020000 0x1000>;
                                interrupts = <0>;
+                               clocks = <&clks 11>;
                        };
 
                        nand@b0030000 {
index 62d0211bd19202a093fde2c45b51faec273c6bfa..82c5ac825386e4d5720d738cab456c2eba3078be 100644 (file)
@@ -55,7 +55,6 @@
                #interrupt-cells = <2>;
                interrupt-controller;
                reg = <0 0xe61c0000 0 0x200>;
-               interrupt-parent = <&gic>;
                interrupts = <0 0 IRQ_TYPE_LEVEL_HIGH>,
                             <0 1 IRQ_TYPE_LEVEL_HIGH>,
                             <0 2 IRQ_TYPE_LEVEL_HIGH>,
@@ -95,7 +94,6 @@
                #interrupt-cells = <2>;
                interrupt-controller;
                reg = <0 0xe61c0200 0 0x200>;
-               interrupt-parent = <&gic>;
                interrupts = <0 32 IRQ_TYPE_LEVEL_HIGH>,
                             <0 33 IRQ_TYPE_LEVEL_HIGH>,
                             <0 34 IRQ_TYPE_LEVEL_HIGH>,
                dma0: dma-controller@e6700020 {
                        compatible = "renesas,shdma-r8a73a4";
                        reg = <0 0xe6700020 0 0x89e0>;
-                       interrupt-parent = <&gic>;
                        interrupts = <0 220 IRQ_TYPE_LEVEL_HIGH
                                        0 200 IRQ_TYPE_LEVEL_HIGH
                                        0 201 IRQ_TYPE_LEVEL_HIGH
                compatible = "renesas,rcar-thermal";
                reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>,
                         <0 0xe61f0200 0 0x38>, <0 0xe61f0300 0 0x38>;
-               interrupt-parent = <&gic>;
                interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
        };
 
                #size-cells = <0>;
                compatible = "renesas,rmobile-iic";
                reg = <0 0xe6500000 0 0x428>;
-               interrupt-parent = <&gic>;
                interrupts = <0 174 IRQ_TYPE_LEVEL_HIGH>;
                status = "disabled";
        };
                #size-cells = <0>;
                compatible = "renesas,rmobile-iic";
                reg = <0 0xe6510000 0 0x428>;
-               interrupt-parent = <&gic>;
                interrupts = <0 175 IRQ_TYPE_LEVEL_HIGH>;
                status = "disabled";
        };
                #size-cells = <0>;
                compatible = "renesas,rmobile-iic";
                reg = <0 0xe6520000 0 0x428>;
-               interrupt-parent = <&gic>;
                interrupts = <0 176 IRQ_TYPE_LEVEL_HIGH>;
                status = "disabled";
        };
                #size-cells = <0>;
                compatible = "renesas,rmobile-iic";
                reg = <0 0xe6530000 0 0x428>;
-               interrupt-parent = <&gic>;
                interrupts = <0 177 IRQ_TYPE_LEVEL_HIGH>;
                status = "disabled";
        };
                #size-cells = <0>;
                compatible = "renesas,rmobile-iic";
                reg = <0 0xe6540000 0 0x428>;
-               interrupt-parent = <&gic>;
                interrupts = <0 178 IRQ_TYPE_LEVEL_HIGH>;
                status = "disabled";
        };
                #size-cells = <0>;
                compatible = "renesas,rmobile-iic";
                reg = <0 0xe60b0000 0 0x428>;
-               interrupt-parent = <&gic>;
                interrupts = <0 179 IRQ_TYPE_LEVEL_HIGH>;
                status = "disabled";
        };
                #size-cells = <0>;
                compatible = "renesas,rmobile-iic";
                reg = <0 0xe6550000 0 0x428>;
-               interrupt-parent = <&gic>;
                interrupts = <0 184 IRQ_TYPE_LEVEL_HIGH>;
                status = "disabled";
        };
                #size-cells = <0>;
                compatible = "renesas,rmobile-iic";
                reg = <0 0xe6560000 0 0x428>;
-               interrupt-parent = <&gic>;
                interrupts = <0 185 IRQ_TYPE_LEVEL_HIGH>;
                status = "disabled";
        };
                #size-cells = <0>;
                compatible = "renesas,rmobile-iic";
                reg = <0 0xe6570000 0 0x428>;
-               interrupt-parent = <&gic>;
                interrupts = <0 173 IRQ_TYPE_LEVEL_HIGH>;
                status = "disabled";
        };
        mmcif0: mmc@ee200000 {
                compatible = "renesas,sh-mmcif";
                reg = <0 0xee200000 0 0x80>;
-               interrupt-parent = <&gic>;
                interrupts = <0 169 IRQ_TYPE_LEVEL_HIGH>;
                reg-io-width = <4>;
                status = "disabled";
        mmcif1: mmc@ee220000 {
                compatible = "renesas,sh-mmcif";
                reg = <0 0xee220000 0 0x80>;
-               interrupt-parent = <&gic>;
                interrupts = <0 170 IRQ_TYPE_LEVEL_HIGH>;
                reg-io-width = <4>;
                status = "disabled";
        sdhi0: sd@ee100000 {
                compatible = "renesas,sdhi-r8a73a4";
                reg = <0 0xee100000 0 0x100>;
-               interrupt-parent = <&gic>;
                interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>;
                cap-sd-highspeed;
                status = "disabled";
        sdhi1: sd@ee120000 {
                compatible = "renesas,sdhi-r8a73a4";
                reg = <0 0xee120000 0 0x100>;
-               interrupt-parent = <&gic>;
                interrupts = <0 166 IRQ_TYPE_LEVEL_HIGH>;
                cap-sd-highspeed;
                status = "disabled";
        sdhi2: sd@ee140000 {
                compatible = "renesas,sdhi-r8a73a4";
                reg = <0 0xee140000 0 0x100>;
-               interrupt-parent = <&gic>;
                interrupts = <0 167 IRQ_TYPE_LEVEL_HIGH>;
                cap-sd-highspeed;
                status = "disabled";
index 95a849bf921f464fa4e59bcada97d7a048dcd876..486007d7ffe4ee2463560655819146e84708416d 100644 (file)
@@ -11,6 +11,7 @@
 /dts-v1/;
 #include "r8a7740.dtsi"
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/pwm/pwm.h>
 
 
                power-key {
                        gpios = <&pfc 99 GPIO_ACTIVE_LOW>;
-                       linux,code = <116>;
+                       linux,code = <KEY_POWER>;
                        label = "SW3";
                        gpio-key,wakeup;
                };
 
                back-key {
                        gpios = <&pfc 100 GPIO_ACTIVE_LOW>;
-                       linux,code = <158>;
+                       linux,code = <KEY_BACK>;
                        label = "SW4";
                };
 
                menu-key {
                        gpios = <&pfc 97 GPIO_ACTIVE_LOW>;
-                       linux,code = <139>;
+                       linux,code = <KEY_MENU>;
                        label = "SW5";
                };
 
                home-key {
                        gpios = <&pfc 98 GPIO_ACTIVE_LOW>;
-                       linux,code = <102>;
+                       linux,code = <KEY_HOME>;
                        label = "SW6";
                };
        };
                };
        };
 
+       i2c2: i2c@2 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "i2c-gpio";
+               gpios = <&pfc 208 GPIO_ACTIVE_HIGH /* sda */
+                        &pfc 91 GPIO_ACTIVE_HIGH /* scl */
+                       >;
+               i2c-gpio,delay-us = <5>;
+       };
+
        backlight {
                compatible = "pwm-backlight";
                pwms = <&tpu 2 33333 PWM_POLARITY_INVERTED>;
        };
 };
 
+&ether {
+       pinctrl-0 = <&ether_pins>;
+       pinctrl-names = "default";
+
+       phy-handle = <&phy0>;
+       status = "ok";
+
+       phy0: ethernet-phy@0 {
+               reg = <0>;
+       };
+};
+
 &i2c0 {
        status = "okay";
        touchscreen@55 {
        };
 };
 
+&i2c2 {
+       status = "okay";
+       rtc@30 {
+               compatible = "sii,s35390a";
+               reg = <0x30>;
+       };
+};
+
 &pfc {
        pinctrl-0 = <&scifa1_pins>;
        pinctrl-names = "default";
 
+       ether_pins: ether {
+               renesas,groups = "gether_mii", "gether_int";
+               renesas,function = "gether";
+       };
+
        scifa1_pins: serial1 {
                renesas,groups = "scifa1_data";
                renesas,function = "scifa1";
index 2551e9438d358a55e8e4edb7c494ea231ee46810..55d29f4d2ed6829b2c1de815dd11a2125945c29c 100644 (file)
@@ -14,6 +14,7 @@
 
 / {
        compatible = "renesas,r8a7740";
+       interrupt-parent = <&gic>;
 
        cpus {
                #address-cells = <1>;
@@ -22,6 +23,7 @@
                        compatible = "arm,cortex-a9";
                        device_type = "cpu";
                        reg = <0x0>;
+                       clock-frequency = <800000000>;
                };
        };
 
@@ -48,7 +50,6 @@
                        <0xe6900020 1>,
                        <0xe6900040 1>,
                        <0xe6900060 1>;
-               interrupt-parent = <&gic>;
                interrupts = <0 149 IRQ_TYPE_LEVEL_HIGH
                              0 149 IRQ_TYPE_LEVEL_HIGH
                              0 149 IRQ_TYPE_LEVEL_HIGH
@@ -69,7 +70,6 @@
                        <0xe6900024 1>,
                        <0xe6900044 1>,
                        <0xe6900064 1>;
-               interrupt-parent = <&gic>;
                interrupts = <0 149 IRQ_TYPE_LEVEL_HIGH
                              0 149 IRQ_TYPE_LEVEL_HIGH
                              0 149 IRQ_TYPE_LEVEL_HIGH
@@ -90,7 +90,6 @@
                        <0xe6900028 1>,
                        <0xe6900048 1>,
                        <0xe6900068 1>;
-               interrupt-parent = <&gic>;
                interrupts = <0 149 IRQ_TYPE_LEVEL_HIGH
                              0 149 IRQ_TYPE_LEVEL_HIGH
                              0 149 IRQ_TYPE_LEVEL_HIGH
                        <0xe690002c 1>,
                        <0xe690004c 1>,
                        <0xe690006c 1>;
-               interrupt-parent = <&gic>;
                interrupts = <0 149 IRQ_TYPE_LEVEL_HIGH
                              0 149 IRQ_TYPE_LEVEL_HIGH
                              0 149 IRQ_TYPE_LEVEL_HIGH
                              0 149 IRQ_TYPE_LEVEL_HIGH>;
        };
 
+       ether: ethernet@e9a00000 {
+               compatible = "renesas,gether-r8a7740";
+               reg = <0xe9a00000 0x800>,
+                     <0xe9a01800 0x800>;
+               interrupts = <0 110 IRQ_TYPE_LEVEL_HIGH>;
+               /* clocks = <&mstp3_clks R8A7740_CLK_GETHER>; */
+               phy-mode = "mii";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
+
        i2c0: i2c@fff20000 {
                #address-cells = <1>;
                #size-cells = <0>;
-               compatible = "renesas,rmobile-iic";
+               compatible = "renesas,iic-r8a7740", "renesas,rmobile-iic";
                reg = <0xfff20000 0x425>;
-               interrupt-parent = <&gic>;
                interrupts = <0 201 IRQ_TYPE_LEVEL_HIGH
                              0 202 IRQ_TYPE_LEVEL_HIGH
                              0 203 IRQ_TYPE_LEVEL_HIGH
        i2c1: i2c@e6c20000 {
                #address-cells = <1>;
                #size-cells = <0>;
-               compatible = "renesas,rmobile-iic";
+               compatible = "renesas,iic-r8a7740", "renesas,rmobile-iic";
                reg = <0xe6c20000 0x425>;
-               interrupt-parent = <&gic>;
                interrupts = <0 70 IRQ_TYPE_LEVEL_HIGH
                              0 71 IRQ_TYPE_LEVEL_HIGH
                              0 72 IRQ_TYPE_LEVEL_HIGH
        };
 
        mmcif0: mmc@e6bd0000 {
-               compatible = "renesas,sh-mmcif";
+               compatible = "renesas,mmcif-r8a7740", "renesas,sh-mmcif";
                reg = <0xe6bd0000 0x100>;
-               interrupt-parent = <&gic>;
                interrupts = <0 56 IRQ_TYPE_LEVEL_HIGH
                              0 57 IRQ_TYPE_LEVEL_HIGH>;
                status = "disabled";
        sdhi0: sd@e6850000 {
                compatible = "renesas,sdhi-r8a7740";
                reg = <0xe6850000 0x100>;
-               interrupt-parent = <&gic>;
                interrupts = <0 117 IRQ_TYPE_LEVEL_HIGH
                              0 118 IRQ_TYPE_LEVEL_HIGH
                              0 119 IRQ_TYPE_LEVEL_HIGH>;
        sdhi1: sd@e6860000 {
                compatible = "renesas,sdhi-r8a7740";
                reg = <0xe6860000 0x100>;
-               interrupt-parent = <&gic>;
                interrupts = <0 121 IRQ_TYPE_LEVEL_HIGH
                              0 122 IRQ_TYPE_LEVEL_HIGH
                              0 123 IRQ_TYPE_LEVEL_HIGH>;
        sdhi2: sd@e6870000 {
                compatible = "renesas,sdhi-r8a7740";
                reg = <0xe6870000 0x100>;
-               interrupt-parent = <&gic>;
                interrupts = <0 125 IRQ_TYPE_LEVEL_HIGH
                              0 126 IRQ_TYPE_LEVEL_HIGH
                              0 127 IRQ_TYPE_LEVEL_HIGH>;
 
        sh_fsi2: sound@fe1f0000 {
                #sound-dai-cells = <1>;
-               compatible = "renesas,sh_fsi2";
+               compatible = "renesas,fsi2-r8a7740", "renesas,sh_fsi2";
                reg = <0xfe1f0000 0x400>;
-               interrupt-parent = <&gic>;
                interrupts = <0 9 0x4>;
                status = "disabled";
        };
index 06cda19dac6a6dccef649109ca17eb4528327dc7..f76f6ec01e194c669ef0bcc055e78b20d602086a 100644 (file)
        pinctrl-0 = <&hspi0_pins>;
        pinctrl-names = "default";
        status = "okay";
+
+       flash: flash@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "spansion,s25fl008k";
+               reg = <0>;
+               spi-max-frequency = <104000000>;
+               m25p,fast-read;
+
+               partition@0 {
+                       label = "data(spi)";
+                       reg = <0x00000000 0x00100000>;
+               };
+       };
 };
index 85c5b3b99f5e3b87485f193750e8150815ff9e17..3af0a2187493101f142a2739bbec15172b0449b9 100644 (file)
@@ -20,6 +20,7 @@
 
 / {
        compatible = "renesas,r8a7778";
+       interrupt-parent = <&gic>;
 
        cpus {
                cpu@0 {
@@ -52,7 +53,6 @@
                        <0xfe780024 4>,
                        <0xfe780044 4>,
                        <0xfe780064 4>;
-               interrupt-parent = <&gic>;
                interrupts =   <0 27 IRQ_TYPE_LEVEL_HIGH
                                0 28 IRQ_TYPE_LEVEL_HIGH
                                0 29 IRQ_TYPE_LEVEL_HIGH
@@ -63,7 +63,6 @@
        gpio0: gpio@ffc40000 {
                compatible = "renesas,gpio-r8a7778", "renesas,gpio-rcar";
                reg = <0xffc40000 0x2c>;
-               interrupt-parent = <&gic>;
                interrupts = <0 103 IRQ_TYPE_LEVEL_HIGH>;
                #gpio-cells = <2>;
                gpio-controller;
@@ -75,7 +74,6 @@
        gpio1: gpio@ffc41000 {
                compatible = "renesas,gpio-r8a7778", "renesas,gpio-rcar";
                reg = <0xffc41000 0x2c>;
-               interrupt-parent = <&gic>;
                interrupts = <0 103 IRQ_TYPE_LEVEL_HIGH>;
                #gpio-cells = <2>;
                gpio-controller;
@@ -87,7 +85,6 @@
        gpio2: gpio@ffc42000 {
                compatible = "renesas,gpio-r8a7778", "renesas,gpio-rcar";
                reg = <0xffc42000 0x2c>;
-               interrupt-parent = <&gic>;
                interrupts = <0 103 IRQ_TYPE_LEVEL_HIGH>;
                #gpio-cells = <2>;
                gpio-controller;
@@ -99,7 +96,6 @@
        gpio3: gpio@ffc43000 {
                compatible = "renesas,gpio-r8a7778", "renesas,gpio-rcar";
                reg = <0xffc43000 0x2c>;
-               interrupt-parent = <&gic>;
                interrupts = <0 103 IRQ_TYPE_LEVEL_HIGH>;
                #gpio-cells = <2>;
                gpio-controller;
        gpio4: gpio@ffc44000 {
                compatible = "renesas,gpio-r8a7778", "renesas,gpio-rcar";
                reg = <0xffc44000 0x2c>;
-               interrupt-parent = <&gic>;
                interrupts = <0 103 IRQ_TYPE_LEVEL_HIGH>;
                #gpio-cells = <2>;
                gpio-controller;
                #size-cells = <0>;
                compatible = "renesas,i2c-r8a7778";
                reg = <0xffc70000 0x1000>;
-               interrupt-parent = <&gic>;
                interrupts = <0 67 IRQ_TYPE_LEVEL_HIGH>;
                status = "disabled";
        };
                #size-cells = <0>;
                compatible = "renesas,i2c-r8a7778";
                reg = <0xffc71000 0x1000>;
-               interrupt-parent = <&gic>;
                interrupts = <0 78 IRQ_TYPE_LEVEL_HIGH>;
                status = "disabled";
        };
                #size-cells = <0>;
                compatible = "renesas,i2c-r8a7778";
                reg = <0xffc72000 0x1000>;
-               interrupt-parent = <&gic>;
                interrupts = <0 76 IRQ_TYPE_LEVEL_HIGH>;
                status = "disabled";
        };
                #size-cells = <0>;
                compatible = "renesas,i2c-r8a7778";
                reg = <0xffc73000 0x1000>;
-               interrupt-parent = <&gic>;
                interrupts = <0 77 IRQ_TYPE_LEVEL_HIGH>;
                status = "disabled";
        };
        mmcif: mmc@ffe4e000 {
                compatible = "renesas,sh-mmcif";
                reg = <0xffe4e000 0x100>;
-               interrupt-parent = <&gic>;
                interrupts = <0 61 IRQ_TYPE_LEVEL_HIGH>;
                status = "disabled";
        };
        sdhi0: sd@ffe4c000 {
                compatible = "renesas,sdhi-r8a7778";
                reg = <0xffe4c000 0x100>;
-               interrupt-parent = <&gic>;
                interrupts = <0 87 IRQ_TYPE_LEVEL_HIGH>;
                cap-sd-highspeed;
                cap-sdio-irq;
        sdhi1: sd@ffe4d000 {
                compatible = "renesas,sdhi-r8a7778";
                reg = <0xffe4d000 0x100>;
-               interrupt-parent = <&gic>;
                interrupts = <0 88 IRQ_TYPE_LEVEL_HIGH>;
                cap-sd-highspeed;
                cap-sdio-irq;
        sdhi2: sd@ffe4f000 {
                compatible = "renesas,sdhi-r8a7778";
                reg = <0xffe4f000 0x100>;
-               interrupt-parent = <&gic>;
                interrupts = <0 86 IRQ_TYPE_LEVEL_HIGH>;
                cap-sd-highspeed;
                cap-sdio-irq;
        };
 
        hspi0: spi@fffc7000 {
-               compatible = "renesas,hspi";
+               compatible = "renesas,hspi-r8a7778", "renesas,hspi";
                reg = <0xfffc7000 0x18>;
-               interrupt-controller = <&gic>;
                interrupts = <0 63 IRQ_TYPE_LEVEL_HIGH>;
+               #address-cells = <1>;
+               #size-cells = <0>;
                status = "disabled";
        };
 
        hspi1: spi@fffc8000 {
-               compatible = "renesas,hspi";
+               compatible = "renesas,hspi-r8a7778", "renesas,hspi";
                reg = <0xfffc8000 0x18>;
-               interrupt-controller = <&gic>;
                interrupts = <0 84 IRQ_TYPE_LEVEL_HIGH>;
+               #address-cells = <1>;
+               #size-cells = <0>;
                status = "disabled";
        };
 
        hspi2: spi@fffc6000 {
-               compatible = "renesas,hspi";
+               compatible = "renesas,hspi-r8a7778", "renesas,hspi";
                reg = <0xfffc6000 0x18>;
-               interrupt-controller = <&gic>;
                interrupts = <0 85 IRQ_TYPE_LEVEL_HIGH>;
+               #address-cells = <1>;
+               #size-cells = <0>;
                status = "disabled";
        };
 };
index 76f5eef7d1cce9055587164f5a157a48ec66956a..b27c6373ff4d028b69c310f882d986ec57f8baf6 100644 (file)
@@ -45,6 +45,7 @@
                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>;
index d0561d4c7c466056096969331d467f6196b9ff63..b517c8e6b42094c5637a1aae27a4eec4a0f83b82 100644 (file)
@@ -15,6 +15,7 @@
 
 / {
        compatible = "renesas,r8a7779";
+       interrupt-parent = <&gic>;
 
        cpus {
                #address-cells = <1>;
@@ -59,7 +60,6 @@
        gpio0: gpio@ffc40000 {
                compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar";
                reg = <0xffc40000 0x2c>;
-               interrupt-parent = <&gic>;
                interrupts = <0 141 IRQ_TYPE_LEVEL_HIGH>;
                #gpio-cells = <2>;
                gpio-controller;
@@ -71,7 +71,6 @@
        gpio1: gpio@ffc41000 {
                compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar";
                reg = <0xffc41000 0x2c>;
-               interrupt-parent = <&gic>;
                interrupts = <0 142 IRQ_TYPE_LEVEL_HIGH>;
                #gpio-cells = <2>;
                gpio-controller;
@@ -83,7 +82,6 @@
        gpio2: gpio@ffc42000 {
                compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar";
                reg = <0xffc42000 0x2c>;
-               interrupt-parent = <&gic>;
                interrupts = <0 143 IRQ_TYPE_LEVEL_HIGH>;
                #gpio-cells = <2>;
                gpio-controller;
@@ -95,7 +93,6 @@
        gpio3: gpio@ffc43000 {
                compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar";
                reg = <0xffc43000 0x2c>;
-               interrupt-parent = <&gic>;
                interrupts = <0 144 IRQ_TYPE_LEVEL_HIGH>;
                #gpio-cells = <2>;
                gpio-controller;
        gpio4: gpio@ffc44000 {
                compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar";
                reg = <0xffc44000 0x2c>;
-               interrupt-parent = <&gic>;
                interrupts = <0 145 IRQ_TYPE_LEVEL_HIGH>;
                #gpio-cells = <2>;
                gpio-controller;
        gpio5: gpio@ffc45000 {
                compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar";
                reg = <0xffc45000 0x2c>;
-               interrupt-parent = <&gic>;
                interrupts = <0 146 IRQ_TYPE_LEVEL_HIGH>;
                #gpio-cells = <2>;
                gpio-controller;
        gpio6: gpio@ffc46000 {
                compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar";
                reg = <0xffc46000 0x2c>;
-               interrupt-parent = <&gic>;
                interrupts = <0 147 IRQ_TYPE_LEVEL_HIGH>;
                #gpio-cells = <2>;
                gpio-controller;
                        <0xfe780024 4>,
                        <0xfe780044 4>,
                        <0xfe780064 4>;
-               interrupt-parent = <&gic>;
                interrupts = <0 27 IRQ_TYPE_LEVEL_HIGH
                              0 28 IRQ_TYPE_LEVEL_HIGH
                              0 29 IRQ_TYPE_LEVEL_HIGH
                #size-cells = <0>;
                compatible = "renesas,i2c-r8a7779";
                reg = <0xffc70000 0x1000>;
-               interrupt-parent = <&gic>;
                interrupts = <0 79 IRQ_TYPE_LEVEL_HIGH>;
                status = "disabled";
        };
                #size-cells = <0>;
                compatible = "renesas,i2c-r8a7779";
                reg = <0xffc71000 0x1000>;
-               interrupt-parent = <&gic>;
                interrupts = <0 82 IRQ_TYPE_LEVEL_HIGH>;
                status = "disabled";
        };
                #size-cells = <0>;
                compatible = "renesas,i2c-r8a7779";
                reg = <0xffc72000 0x1000>;
-               interrupt-parent = <&gic>;
                interrupts = <0 80 IRQ_TYPE_LEVEL_HIGH>;
                status = "disabled";
        };
                #size-cells = <0>;
                compatible = "renesas,i2c-r8a7779";
                reg = <0xffc73000 0x1000>;
-               interrupt-parent = <&gic>;
                interrupts = <0 81 IRQ_TYPE_LEVEL_HIGH>;
                status = "disabled";
        };
        sata: sata@fc600000 {
                compatible = "renesas,rcar-sata";
                reg = <0xfc600000 0x2000>;
-               interrupt-parent = <&gic>;
                interrupts = <0 100 IRQ_TYPE_LEVEL_HIGH>;
        };
 
        sdhi0: sd@ffe4c000 {
                compatible = "renesas,sdhi-r8a7779";
                reg = <0xffe4c000 0x100>;
-               interrupt-parent = <&gic>;
                interrupts = <0 104 IRQ_TYPE_LEVEL_HIGH>;
                cap-sd-highspeed;
                cap-sdio-irq;
        sdhi1: sd@ffe4d000 {
                compatible = "renesas,sdhi-r8a7779";
                reg = <0xffe4d000 0x100>;
-               interrupt-parent = <&gic>;
                interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>;
                cap-sd-highspeed;
                cap-sdio-irq;
        sdhi2: sd@ffe4e000 {
                compatible = "renesas,sdhi-r8a7779";
                reg = <0xffe4e000 0x100>;
-               interrupt-parent = <&gic>;
                interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>;
                cap-sd-highspeed;
                cap-sdio-irq;
        sdhi3: sd@ffe4f000 {
                compatible = "renesas,sdhi-r8a7779";
                reg = <0xffe4f000 0x100>;
-               interrupt-parent = <&gic>;
                interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>;
                cap-sd-highspeed;
                cap-sdio-irq;
        };
 
        hspi0: spi@fffc7000 {
-               compatible = "renesas,hspi";
+               compatible = "renesas,hspi-r8a7779", "renesas,hspi";
                reg = <0xfffc7000 0x18>;
-               interrupt-controller = <&gic>;
                interrupts = <0 73 IRQ_TYPE_LEVEL_HIGH>;
+               #address-cells = <1>;
+               #size-cells = <0>;
                status = "disabled";
        };
 
        hspi1: spi@fffc8000 {
-               compatible = "renesas,hspi";
+               compatible = "renesas,hspi-r8a7779", "renesas,hspi";
                reg = <0xfffc8000 0x18>;
-               interrupt-controller = <&gic>;
                interrupts = <0 74 IRQ_TYPE_LEVEL_HIGH>;
+               #address-cells = <1>;
+               #size-cells = <0>;
                status = "disabled";
        };
 
        hspi2: spi@fffc6000 {
-               compatible = "renesas,hspi";
+               compatible = "renesas,hspi-r8a7779", "renesas,hspi";
                reg = <0xfffc6000 0x18>;
-               interrupt-controller = <&gic>;
                interrupts = <0 75 IRQ_TYPE_LEVEL_HIGH>;
+               #address-cells = <1>;
+               #size-cells = <0>;
                status = "disabled";
        };
 };
index d01048ab3e777534e224eb9a9395ba0a83cd56b7..86d676f629429ab3c304111fcdd987e91fca0c9a 100644 (file)
@@ -12,6 +12,7 @@
 /dts-v1/;
 #include "r8a7790.dtsi"
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 
 / {
        model = "Lager";
                #size-cells = <1>;
        };
 
+       gpio_keys {
+               compatible = "gpio-keys";
+
+               button@1 {
+                       linux,code = <KEY_1>;
+                       label = "SW2-1";
+                       gpio-key,wakeup;
+                       debounce-interval = <20>;
+                       gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
+               };
+               button@2 {
+                       linux,code = <KEY_2>;
+                       label = "SW2-2";
+                       gpio-key,wakeup;
+                       debounce-interval = <20>;
+                       gpios = <&gpio1 24 GPIO_ACTIVE_LOW>;
+               };
+               button@3 {
+                       linux,code = <KEY_3>;
+                       label = "SW2-3";
+                       gpio-key,wakeup;
+                       debounce-interval = <20>;
+                       gpios = <&gpio1 26 GPIO_ACTIVE_LOW>;
+               };
+               button@4 {
+                       linux,code = <KEY_4>;
+                       label = "SW2-4";
+                       gpio-key,wakeup;
+                       debounce-interval = <20>;
+                       gpios = <&gpio1 28 GPIO_ACTIVE_LOW>;
+               };
+       };
+
        leds {
                compatible = "gpio-leds";
                led6 {
                renesas,function = "mmc1";
        };
 
-       qspi_pins: spi {
+       qspi_pins: spi0 {
                renesas,groups = "qspi_ctrl", "qspi_data4";
                renesas,function = "qspi";
        };
+
+       msiof1_pins: spi2 {
+               renesas,groups = "msiof1_clk", "msiof1_sync", "msiof1_rx",
+                                "msiof1_tx";
+               renesas,function = "msiof1";
+       };
 };
 
 &ether {
                reg = <1>;
                interrupt-parent = <&irqc0>;
                interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+               micrel,led-mode = <1>;
        };
 };
 
        status = "okay";
 };
 
-&spi {
+&qspi {
        pinctrl-0 = <&qspi_pins>;
        pinctrl-names = "default";
 
                compatible = "spansion,s25fl512s";
                reg = <0>;
                spi-max-frequency = <30000000>;
+               spi-tx-bus-width = <4>;
+               spi-rx-bus-width = <4>;
                m25p,fast-read;
 
                partition@0 {
        };
 };
 
+&msiof1 {
+       pinctrl-0 = <&msiof1_pins>;
+       pinctrl-names = "default";
+
+       status = "okay";
+
+       pmic: pmic@0 {
+               compatible = "renesas,r2a11302ft";
+               reg = <0>;
+               spi-max-frequency = <6000000>;
+               spi-cpol;
+               spi-cpha;
+       };
+
+};
+
 &sdhi0 {
        pinctrl-0 = <&sdhi0_pins>;
        pinctrl-names = "default";
index 618e5b537eaf9deb5efbe34ee7f917f8ea95990b..7ff29601f962a01747ca02115d63497e04b48d73 100644 (file)
                i2c1 = &i2c1;
                i2c2 = &i2c2;
                i2c3 = &i2c3;
+               i2c4 = &iic0;
+               i2c5 = &iic1;
+               i2c6 = &iic2;
+               i2c7 = &iic3;
+               spi0 = &qspi;
+               spi1 = &msiof0;
+               spi2 = &msiof1;
+               spi3 = &msiof2;
+               spi4 = &msiof3;
        };
 
        cpus {
                gpio-ranges = <&pfc 0 0 32>;
                #interrupt-cells = <2>;
                interrupt-controller;
+               clocks = <&mstp9_clks R8A7790_CLK_GPIO0>;
        };
 
        gpio1: gpio@e6051000 {
                gpio-ranges = <&pfc 0 32 32>;
                #interrupt-cells = <2>;
                interrupt-controller;
+               clocks = <&mstp9_clks R8A7790_CLK_GPIO1>;
        };
 
        gpio2: gpio@e6052000 {
                gpio-ranges = <&pfc 0 64 32>;
                #interrupt-cells = <2>;
                interrupt-controller;
+               clocks = <&mstp9_clks R8A7790_CLK_GPIO2>;
        };
 
        gpio3: gpio@e6053000 {
                gpio-ranges = <&pfc 0 96 32>;
                #interrupt-cells = <2>;
                interrupt-controller;
+               clocks = <&mstp9_clks R8A7790_CLK_GPIO3>;
        };
 
        gpio4: gpio@e6054000 {
                gpio-ranges = <&pfc 0 128 32>;
                #interrupt-cells = <2>;
                interrupt-controller;
+               clocks = <&mstp9_clks R8A7790_CLK_GPIO4>;
        };
 
        gpio5: gpio@e6055000 {
                gpio-ranges = <&pfc 0 160 32>;
                #interrupt-cells = <2>;
                interrupt-controller;
+               clocks = <&mstp9_clks R8A7790_CLK_GPIO5>;
        };
 
        thermal@e61f0000 {
                status = "disabled";
        };
 
+       iic0: i2c@e6500000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "renesas,iic-r8a7790", "renesas,rmobile-iic";
+               reg = <0 0xe6500000 0 0x425>;
+               interrupts = <0 174 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp3_clks R8A7790_CLK_IIC0>;
+               status = "disabled";
+       };
+
+       iic1: i2c@e6510000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "renesas,iic-r8a7790", "renesas,rmobile-iic";
+               reg = <0 0xe6510000 0 0x425>;
+               interrupts = <0 175 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp3_clks R8A7790_CLK_IIC1>;
+               status = "disabled";
+       };
+
+       iic2: i2c@e6520000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "renesas,iic-r8a7790", "renesas,rmobile-iic";
+               reg = <0 0xe6520000 0 0x425>;
+               interrupts = <0 176 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp3_clks R8A7790_CLK_IIC2>;
+               status = "disabled";
+       };
+
+       iic3: i2c@e60b0000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "renesas,iic-r8a7790", "renesas,rmobile-iic";
+               reg = <0 0xe60b0000 0 0x425>;
+               interrupts = <0 173 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp9_clks R8A7790_CLK_IICDVFS>;
+               status = "disabled";
+       };
+
        mmcif0: mmcif@ee200000 {
                compatible = "renesas,mmcif-r8a7790", "renesas,sh-mmcif";
                reg = <0 0xee200000 0 0x80>;
                        renesas,clock-indices = <
                                R8A7790_CLK_TMU1 R8A7790_CLK_TMU3 R8A7790_CLK_TMU2
                                R8A7790_CLK_CMT0 R8A7790_CLK_TMU0 R8A7790_CLK_VSP1_DU1
-                               R8A7790_CLK_VSP1_DU0 R8A7790_CLK_VSP1_RT R8A7790_CLK_VSP1_SY
+                               R8A7790_CLK_VSP1_DU0 R8A7790_CLK_VSP1_R R8A7790_CLK_VSP1_S
                        >;
                        clock-output-names =
                                "tmu1", "tmu3", "tmu2", "cmt0", "tmu0", "vsp1-du1",
                mstp3_clks: mstp3_clks@e615013c {
                        compatible = "renesas,r8a7790-mstp-clocks", "renesas,cpg-mstp-clocks";
                        reg = <0 0xe615013c 0 4>, <0 0xe6150048 0 4>;
-                       clocks = <&cp_clk>, <&mmc1_clk>, <&sd3_clk>, <&sd2_clk>,
-                                <&cpg_clocks R8A7790_CLK_SD1>, <&cpg_clocks R8A7790_CLK_SD0>,
-                                <&mmc0_clk>, <&rclk_clk>;
+                       clocks = <&hp_clk>, <&cp_clk>, <&mmc1_clk>, <&sd3_clk>,
+                                <&sd2_clk>, <&cpg_clocks R8A7790_CLK_SD1>, <&cpg_clocks R8A7790_CLK_SD0>, <&mmc0_clk>,
+                                <&hp_clk>, <&hp_clk>, <&rclk_clk>;
                        #clock-cells = <1>;
                        renesas,clock-indices = <
-                               R8A7790_CLK_TPU0 R8A7790_CLK_MMCIF1 R8A7790_CLK_SDHI3
-                               R8A7790_CLK_SDHI2 R8A7790_CLK_SDHI1 R8A7790_CLK_SDHI0
-                               R8A7790_CLK_MMCIF0 R8A7790_CLK_CMT1
+                               R8A7790_CLK_IIC2 R8A7790_CLK_TPU0 R8A7790_CLK_MMCIF1 R8A7790_CLK_SDHI3
+                               R8A7790_CLK_SDHI2 R8A7790_CLK_SDHI1 R8A7790_CLK_SDHI0 R8A7790_CLK_MMCIF0
+                               R8A7790_CLK_IIC0 R8A7790_CLK_IIC1 R8A7790_CLK_CMT1
                        >;
                        clock-output-names =
-                               "tpu0", "mmcif1", "sdhi3", "sdhi2",
-                               "sdhi1", "sdhi0", "mmcif0", "cmt1";
+                               "iic2", "tpu0", "mmcif1", "sdhi3",
+                               "sdhi2", "sdhi1", "sdhi0", "mmcif0",
+                               "iic0", "iic1", "cmt1";
                };
                mstp5_clks: mstp5_clks@e6150144 {
                        compatible = "renesas,r8a7790-mstp-clocks", "renesas,cpg-mstp-clocks";
                mstp9_clks: mstp9_clks@e6150994 {
                        compatible = "renesas,r8a7790-mstp-clocks", "renesas,cpg-mstp-clocks";
                        reg = <0 0xe6150994 0 4>, <0 0xe61509a4 0 4>;
-                       clocks = <&p_clk>, <&p_clk>, <&cpg_clocks R8A7790_CLK_QSPI>,
-                                <&p_clk>, <&p_clk>, <&p_clk>, <&p_clk>;
+                       clocks = <&cp_clk>, <&cp_clk>, <&cp_clk>,
+                                <&cp_clk>, <&cp_clk>, <&cp_clk>,
+                                <&p_clk>, <&p_clk>, <&cpg_clocks R8A7790_CLK_QSPI>, <&cp_clk>,
+                                <&hp_clk>, <&hp_clk>, <&hp_clk>, <&hp_clk>;
                        #clock-cells = <1>;
                        renesas,clock-indices = <
-                               R8A7790_CLK_RCAN1 R8A7790_CLK_RCAN0 R8A7790_CLK_QSPI_MOD
-                               R8A7790_CLK_I2C3 R8A7790_CLK_I2C2 R8A7790_CLK_I2C1
-                               R8A7790_CLK_I2C0
+                               R8A7790_CLK_GPIO5 R8A7790_CLK_GPIO4 R8A7790_CLK_GPIO3
+                               R8A7790_CLK_GPIO2 R8A7790_CLK_GPIO1 R8A7790_CLK_GPIO0
+                               R8A7790_CLK_RCAN1 R8A7790_CLK_RCAN0 R8A7790_CLK_QSPI_MOD R8A7790_CLK_IICDVFS
+                               R8A7790_CLK_I2C3 R8A7790_CLK_I2C2 R8A7790_CLK_I2C1 R8A7790_CLK_I2C0
                        >;
                        clock-output-names =
-                               "rcan1", "rcan0", "qspi_mod", "i2c3", "i2c2", "i2c1", "i2c0";
+                               "gpio5", "gpio4", "gpio3", "gpio2", "gpio1", "gpio0",
+                               "rcan1", "rcan0", "qspi_mod", "iic3",
+                               "i2c3", "i2c2", "i2c1", "i2c0";
                };
        };
 
-       spi: spi@e6b10000 {
+       qspi: spi@e6b10000 {
                compatible = "renesas,qspi-r8a7790", "renesas,qspi";
                reg = <0 0xe6b10000 0 0x2c>;
                interrupts = <0 184 IRQ_TYPE_LEVEL_HIGH>;
                #size-cells = <0>;
                status = "disabled";
        };
+
+       msiof0: spi@e6e20000 {
+               compatible = "renesas,msiof-r8a7790";
+               reg = <0 0xe6e20000 0 0x0064>;
+               interrupts = <0 156 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp0_clks R8A7790_CLK_MSIOF0>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
+
+       msiof1: spi@e6e10000 {
+               compatible = "renesas,msiof-r8a7790";
+               reg = <0 0xe6e10000 0 0x0064>;
+               interrupts = <0 157 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp2_clks R8A7790_CLK_MSIOF1>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
+
+       msiof2: spi@e6e00000 {
+               compatible = "renesas,msiof-r8a7790";
+               reg = <0 0xe6e00000 0 0x0064>;
+               interrupts = <0 158 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp2_clks R8A7790_CLK_MSIOF2>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
+
+       msiof3: spi@e6c90000 {
+               compatible = "renesas,msiof-r8a7790";
+               reg = <0 0xe6c90000 0 0x0064>;
+               interrupts = <0 159 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp2_clks R8A7790_CLK_MSIOF3>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
 };
diff --git a/arch/arm/boot/dts/r8a7791-henninger.dts b/arch/arm/boot/dts/r8a7791-henninger.dts
new file mode 100644 (file)
index 0000000..cc6d992
--- /dev/null
@@ -0,0 +1,219 @@
+/*
+ * Device Tree Source for the Henninger board
+ *
+ * Copyright (C) 2014 Renesas Solutions Corp.
+ * Copyright (C) 2014 Cogent Embedded, Inc.
+ *
+ * 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 "r8a7791.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+       model = "Henninger";
+       compatible = "renesas,henninger", "renesas,r8a7791";
+
+       aliases {
+               serial0 = &scif0;
+       };
+
+       chosen {
+               bootargs = "console=ttySC0,38400 ignore_loglevel rw root=/dev/nfs ip=dhcp";
+       };
+
+       memory@40000000 {
+               device_type = "memory";
+               reg = <0 0x40000000 0 0x40000000>;
+       };
+
+       memory@200000000 {
+               device_type = "memory";
+               reg = <2 0x00000000 0 0x40000000>;
+       };
+
+       vcc_sdhi0: regulator@0 {
+               compatible = "regulator-fixed";
+
+               regulator-name = "SDHI0 Vcc";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               regulator-always-on;
+       };
+
+       vccq_sdhi0: regulator@1 {
+               compatible = "regulator-gpio";
+
+               regulator-name = "SDHI0 VccQ";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <3300000>;
+
+               gpios = <&gpio2 12 GPIO_ACTIVE_HIGH>;
+               gpios-states = <1>;
+               states = <3300000 1
+                         1800000 0>;
+       };
+
+       vcc_sdhi2: regulator@2 {
+               compatible = "regulator-fixed";
+
+               regulator-name = "SDHI2 Vcc";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               regulator-always-on;
+       };
+
+       vccq_sdhi2: regulator@3 {
+               compatible = "regulator-gpio";
+
+               regulator-name = "SDHI2 VccQ";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <3300000>;
+
+               gpios = <&gpio2 26 GPIO_ACTIVE_HIGH>;
+               gpios-states = <1>;
+               states = <3300000 1
+                         1800000 0>;
+       };
+};
+
+&extal_clk {
+       clock-frequency = <20000000>;
+};
+
+&pfc {
+       scif0_pins: serial0 {
+               renesas,groups = "scif0_data_d";
+               renesas,function = "scif0";
+       };
+
+       ether_pins: ether {
+               renesas,groups = "eth_link", "eth_mdio", "eth_rmii";
+               renesas,function = "eth";
+       };
+
+       phy1_pins: phy1 {
+               renesas,groups = "intc_irq0";
+               renesas,function = "intc";
+       };
+
+       sdhi0_pins: sd0 {
+               renesas,groups = "sdhi0_data4", "sdhi0_ctrl";
+               renesas,function = "sdhi0";
+       };
+
+       sdhi2_pins: sd2 {
+               renesas,groups = "sdhi2_data4", "sdhi2_ctrl";
+               renesas,function = "sdhi2";
+       };
+
+       qspi_pins: spi0 {
+               renesas,groups = "qspi_ctrl", "qspi_data4";
+               renesas,function = "qspi";
+       };
+
+       msiof0_pins: spi1 {
+               renesas,groups = "msiof0_clk", "msiof0_sync", "msiof0_rx",
+                                "msiof0_tx";
+               renesas,function = "msiof0";
+       };
+};
+
+&scif0 {
+       pinctrl-0 = <&scif0_pins>;
+       pinctrl-names = "default";
+
+       status = "okay";
+};
+
+&ether {
+       pinctrl-0 = <&ether_pins &phy1_pins>;
+       pinctrl-names = "default";
+
+       phy-handle = <&phy1>;
+       renesas,ether-link-active-low;
+       status = "ok";
+
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+               interrupt-parent = <&irqc0>;
+               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+               micrel,led-mode = <1>;
+       };
+};
+
+&sata0 {
+       status = "okay";
+};
+
+&sdhi0 {
+       pinctrl-0 = <&sdhi0_pins>;
+       pinctrl-names = "default";
+
+       vmmc-supply = <&vcc_sdhi0>;
+       vqmmc-supply = <&vccq_sdhi0>;
+       cd-gpios = <&gpio6 6 GPIO_ACTIVE_LOW>;
+       wp-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
+
+&sdhi2 {
+       pinctrl-0 = <&sdhi2_pins>;
+       pinctrl-names = "default";
+
+       vmmc-supply = <&vcc_sdhi2>;
+       vqmmc-supply = <&vccq_sdhi2>;
+       cd-gpios = <&gpio6 22 GPIO_ACTIVE_LOW>;
+       status = "okay";
+};
+
+&qspi {
+       pinctrl-0 = <&qspi_pins>;
+       pinctrl-names = "default";
+
+       status = "okay";
+
+       flash@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "spansion,s25fl512s";
+               reg = <0>;
+               spi-max-frequency = <30000000>;
+               spi-tx-bus-width = <4>;
+               spi-rx-bus-width = <4>;
+               m25p,fast-read;
+
+               partition@0 {
+                       label = "loader_prg";
+                       reg = <0x00000000 0x00040000>;
+                       read-only;
+               };
+               partition@40000 {
+                       label = "user_prg";
+                       reg = <0x00040000 0x00400000>;
+                       read-only;
+               };
+               partition@440000 {
+                       label = "flash_fs";
+                       reg = <0x00440000 0x03bc0000>;
+               };
+       };
+};
+
+&msiof0 {
+       pinctrl-0 = <&msiof0_pins>;
+       pinctrl-names = "default";
+
+       status = "okay";
+
+       pmic@0 {
+               compatible = "renesas,r2a11302ft";
+               reg = <0>;
+               spi-max-frequency = <6000000>;
+               spi-cpol;
+               spi-cpha;
+       };
+};
index de1b6977c69a4b009d3e658b8d9790b373278d49..0d69813def859eb1d235576acc565e9269a8e5d6 100644 (file)
@@ -13,6 +13,7 @@
 /dts-v1/;
 #include "r8a7791.dtsi"
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 
 / {
        model = "Koelsch";
        gpio-keys {
                compatible = "gpio-keys";
 
+               key-1 {
+                       gpios = <&gpio5 0 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_1>;
+                       label = "SW2-1";
+                       gpio-key,wakeup;
+                       debounce-interval = <20>;
+               };
+               key-2 {
+                       gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_2>;
+                       label = "SW2-2";
+                       gpio-key,wakeup;
+                       debounce-interval = <20>;
+               };
+               key-3 {
+                       gpios = <&gpio5 2 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_3>;
+                       label = "SW2-3";
+                       gpio-key,wakeup;
+                       debounce-interval = <20>;
+               };
+               key-4 {
+                       gpios = <&gpio5 3 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_4>;
+                       label = "SW2-4";
+                       gpio-key,wakeup;
+                       debounce-interval = <20>;
+               };
                key-a {
                        gpios = <&gpio7 0 GPIO_ACTIVE_LOW>;
-                       linux,code = <30>;
+                       linux,code = <KEY_A>;
                        label = "SW30";
                        gpio-key,wakeup;
                        debounce-interval = <20>;
                };
                key-b {
                        gpios = <&gpio7 1 GPIO_ACTIVE_LOW>;
-                       linux,code = <48>;
+                       linux,code = <KEY_B>;
                        label = "SW31";
                        gpio-key,wakeup;
                        debounce-interval = <20>;
                };
                key-c {
                        gpios = <&gpio7 2 GPIO_ACTIVE_LOW>;
-                       linux,code = <46>;
+                       linux,code = <KEY_C>;
                        label = "SW32";
                        gpio-key,wakeup;
                        debounce-interval = <20>;
                };
                key-d {
                        gpios = <&gpio7 3 GPIO_ACTIVE_LOW>;
-                       linux,code = <32>;
+                       linux,code = <KEY_D>;
                        label = "SW33";
                        gpio-key,wakeup;
                        debounce-interval = <20>;
                };
                key-e {
                        gpios = <&gpio7 4 GPIO_ACTIVE_LOW>;
-                       linux,code = <18>;
+                       linux,code = <KEY_E>;
                        label = "SW34";
                        gpio-key,wakeup;
                        debounce-interval = <20>;
                };
                key-f {
                        gpios = <&gpio7 5 GPIO_ACTIVE_LOW>;
-                       linux,code = <33>;
+                       linux,code = <KEY_F>;
                        label = "SW35";
                        gpio-key,wakeup;
                        debounce-interval = <20>;
                };
                key-g {
                        gpios = <&gpio7 6 GPIO_ACTIVE_LOW>;
-                       linux,code = <34>;
+                       linux,code = <KEY_G>;
                        label = "SW36";
                        gpio-key,wakeup;
                        debounce-interval = <20>;
        };
 };
 
+&i2c6 {
+       status = "okay";
+       clock-frequency = <100000>;
+};
+
 &pfc {
        pinctrl-0 = <&du_pins &scif0_pins &scif1_pins>;
        pinctrl-names = "default";
 
-       i2c2_pins: i2c {
+       i2c2_pins: i2c2 {
                renesas,groups = "i2c2";
                renesas,function = "i2c2";
        };
                renesas,function = "sdhi2";
        };
 
-       qspi_pins: spi {
+       qspi_pins: spi0 {
                renesas,groups = "qspi_ctrl", "qspi_data4";
                renesas,function = "qspi";
        };
+
+       msiof0_pins: spi1 {
+               renesas,groups = "msiof0_clk", "msiof0_sync", "msiof0_rx",
+                                "msiof0_tx";
+               renesas,function = "msiof0";
+       };
 };
 
 &ether {
                reg = <1>;
                interrupt-parent = <&irqc0>;
                interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+               micrel,led-mode = <1>;
        };
 };
 
        status = "okay";
 };
 
-&spi {
+&qspi {
        pinctrl-0 = <&qspi_pins>;
        pinctrl-names = "default";
 
                compatible = "spansion,s25fl512s";
                reg = <0>;
                spi-max-frequency = <30000000>;
+               spi-tx-bus-width = <4>;
+               spi-rx-bus-width = <4>;
                m25p,fast-read;
 
                partition@0 {
                };
        };
 };
+
+&msiof0 {
+       pinctrl-0 = <&msiof0_pins>;
+       pinctrl-names = "default";
+
+       status = "okay";
+
+       pmic: pmic@0 {
+               compatible = "renesas,r2a11302ft";
+               reg = <0>;
+               spi-max-frequency = <6000000>;
+               spi-cpol;
+               spi-cpha;
+       };
+};
index 46181708e59c5c7d7e558743983a88efa9622e13..8d7ffaeff6e03fd3f4b3e56aebd313d4bd743d3d 100644 (file)
                i2c3 = &i2c3;
                i2c4 = &i2c4;
                i2c5 = &i2c5;
+               i2c6 = &i2c6;
+               i2c7 = &i2c7;
+               i2c8 = &i2c8;
+               spi0 = &qspi;
+               spi1 = &msiof0;
+               spi2 = &msiof1;
+               spi3 = &msiof2;
        };
 
        cpus {
                        device_type = "cpu";
                        compatible = "arm,cortex-a15";
                        reg = <0>;
-                       clock-frequency = <1300000000>;
+                       clock-frequency = <1500000000>;
                };
 
                cpu1: cpu@1 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a15";
                        reg = <1>;
-                       clock-frequency = <1300000000>;
+                       clock-frequency = <1500000000>;
                };
        };
 
@@ -69,6 +76,7 @@
                gpio-ranges = <&pfc 0 0 32>;
                #interrupt-cells = <2>;
                interrupt-controller;
+               clocks = <&mstp9_clks R8A7791_CLK_GPIO0>;
        };
 
        gpio1: gpio@e6051000 {
@@ -80,6 +88,7 @@
                gpio-ranges = <&pfc 0 32 32>;
                #interrupt-cells = <2>;
                interrupt-controller;
+               clocks = <&mstp9_clks R8A7791_CLK_GPIO1>;
        };
 
        gpio2: gpio@e6052000 {
                gpio-ranges = <&pfc 0 64 32>;
                #interrupt-cells = <2>;
                interrupt-controller;
+               clocks = <&mstp9_clks R8A7791_CLK_GPIO2>;
        };
 
        gpio3: gpio@e6053000 {
                gpio-ranges = <&pfc 0 96 32>;
                #interrupt-cells = <2>;
                interrupt-controller;
+               clocks = <&mstp9_clks R8A7791_CLK_GPIO3>;
        };
 
        gpio4: gpio@e6054000 {
                gpio-ranges = <&pfc 0 128 32>;
                #interrupt-cells = <2>;
                interrupt-controller;
+               clocks = <&mstp9_clks R8A7791_CLK_GPIO4>;
        };
 
        gpio5: gpio@e6055000 {
                gpio-ranges = <&pfc 0 160 32>;
                #interrupt-cells = <2>;
                interrupt-controller;
+               clocks = <&mstp9_clks R8A7791_CLK_GPIO5>;
        };
 
        gpio6: gpio@e6055400 {
                gpio-ranges = <&pfc 0 192 32>;
                #interrupt-cells = <2>;
                interrupt-controller;
+               clocks = <&mstp9_clks R8A7791_CLK_GPIO6>;
        };
 
        gpio7: gpio@e6055800 {
                gpio-ranges = <&pfc 0 224 26>;
                #interrupt-cells = <2>;
                interrupt-controller;
+               clocks = <&mstp9_clks R8A7791_CLK_GPIO7>;
        };
 
        thermal@e61f0000 {
                             <0 17 IRQ_TYPE_LEVEL_HIGH>;
        };
 
+       /* The memory map in the User's Manual maps the cores to bus numbers */
        i2c0: i2c@e6508000 {
                #address-cells = <1>;
                #size-cells = <0>;
        };
 
        i2c5: i2c@e6528000 {
+               /* doesn't need pinmux */
                #address-cells = <1>;
                #size-cells = <0>;
                compatible = "renesas,i2c-r8a7791";
                status = "disabled";
        };
 
+       i2c6: i2c@e60b0000 {
+               /* doesn't need pinmux */
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "renesas,iic-r8a7791", "renesas,rmobile-iic";
+               reg = <0 0xe60b0000 0 0x425>;
+               interrupts = <0 173 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp9_clks R8A7791_CLK_IICDVFS>;
+               status = "disabled";
+       };
+
+       i2c7: i2c@e6500000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "renesas,iic-r8a7791", "renesas,rmobile-iic";
+               reg = <0 0xe6500000 0 0x425>;
+               interrupts = <0 174 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp3_clks R8A7791_CLK_IIC0>;
+               status = "disabled";
+       };
+
+       i2c8: i2c@e6510000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "renesas,iic-r8a7791", "renesas,rmobile-iic";
+               reg = <0 0xe6510000 0 0x425>;
+               interrupts = <0 175 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp3_clks R8A7791_CLK_IIC1>;
+               status = "disabled";
+       };
+
        pfc: pfc@e6060000 {
                compatible = "renesas,pfc-r8a7791";
                reg = <0 0xe6060000 0 0x250>;
        sdhi0: sd@ee100000 {
                compatible = "renesas,sdhi-r8a7791";
                reg = <0 0xee100000 0 0x200>;
-               interrupt-parent = <&gic>;
                interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&mstp3_clks R8A7791_CLK_SDHI0>;
                status = "disabled";
        sdhi1: sd@ee140000 {
                compatible = "renesas,sdhi-r8a7791";
                reg = <0 0xee140000 0 0x100>;
-               interrupt-parent = <&gic>;
                interrupts = <0 167 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&mstp3_clks R8A7791_CLK_SDHI1>;
                status = "disabled";
        sdhi2: sd@ee160000 {
                compatible = "renesas,sdhi-r8a7791";
                reg = <0 0xee160000 0 0x100>;
-               interrupt-parent = <&gic>;
                interrupts = <0 168 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&mstp3_clks R8A7791_CLK_SDHI2>;
                status = "disabled";
                        renesas,clock-indices = <
                                R8A7791_CLK_TMU1 R8A7791_CLK_TMU3 R8A7791_CLK_TMU2
                                R8A7791_CLK_CMT0 R8A7791_CLK_TMU0 R8A7791_CLK_VSP1_DU1
-                               R8A7791_CLK_VSP1_DU0 R8A7791_CLK_VSP1_SY
+                               R8A7791_CLK_VSP1_DU0 R8A7791_CLK_VSP1_S
                        >;
                        clock-output-names =
                                "tmu1", "tmu3", "tmu2", "cmt0", "tmu0", "vsp1-du1",
                mstp3_clks: mstp3_clks@e615013c {
                        compatible = "renesas,r8a7791-mstp-clocks", "renesas,cpg-mstp-clocks";
                        reg = <0 0xe615013c 0 4>, <0 0xe6150048 0 4>;
-                       clocks = <&cp_clk>, <&sd2_clk>, <&sd1_clk>,
-                               <&cpg_clocks R8A7791_CLK_SD0>, <&mmc0_clk>, <&rclk_clk>;
+                       clocks = <&cp_clk>, <&sd2_clk>, <&sd1_clk>, <&cpg_clocks R8A7791_CLK_SD0>,
+                                <&mmc0_clk>, <&hp_clk>, <&hp_clk>, <&rclk_clk>;
                        #clock-cells = <1>;
                        renesas,clock-indices = <
-                               R8A7791_CLK_TPU0 R8A7791_CLK_SDHI2 R8A7791_CLK_SDHI1
-                               R8A7791_CLK_SDHI0 R8A7791_CLK_MMCIF0 R8A7791_CLK_CMT1
+                               R8A7791_CLK_TPU0 R8A7791_CLK_SDHI2 R8A7791_CLK_SDHI1 R8A7791_CLK_SDHI0
+                               R8A7791_CLK_MMCIF0 R8A7791_CLK_IIC0 R8A7791_CLK_IIC1 R8A7791_CLK_CMT1
                        >;
                        clock-output-names =
-                               "tpu0", "sdhi2", "sdhi1", "sdhi0", "mmcif0", "cmt1";
+                               "tpu0", "sdhi2", "sdhi1", "sdhi0",
+                               "mmcif0", "i2c7", "i2c8", "cmt1";
                };
                mstp5_clks: mstp5_clks@e6150144 {
                        compatible = "renesas,r8a7791-mstp-clocks", "renesas,cpg-mstp-clocks";
                mstp7_clks: mstp7_clks@e615014c {
                        compatible = "renesas,r8a7791-mstp-clocks", "renesas,cpg-mstp-clocks";
                        reg = <0 0xe615014c 0 4>, <0 0xe61501c4 0 4>;
-                       clocks = <&mp_clk>, <&zs_clk>, <&p_clk>, <&p_clk>, <&zs_clk>,
+                       clocks = <&mp_clk>,  <&mp_clk>, <&zs_clk>, <&p_clk>, <&p_clk>, <&zs_clk>,
                                 <&zs_clk>, <&p_clk>, <&p_clk>, <&p_clk>, <&p_clk>,
                                 <&zx_clk>, <&zx_clk>, <&zx_clk>;
                        #clock-cells = <1>;
                        renesas,clock-indices = <
-                               R8A7791_CLK_HSUSB R8A7791_CLK_HSCIF2 R8A7791_CLK_SCIF5
+                               R8A7791_CLK_EHCI R8A7791_CLK_HSUSB R8A7791_CLK_HSCIF2 R8A7791_CLK_SCIF5
                                R8A7791_CLK_SCIF4 R8A7791_CLK_HSCIF1 R8A7791_CLK_HSCIF0
                                R8A7791_CLK_SCIF3 R8A7791_CLK_SCIF2 R8A7791_CLK_SCIF1
                                R8A7791_CLK_SCIF0 R8A7791_CLK_DU1 R8A7791_CLK_DU0
                                R8A7791_CLK_LVDS0
                        >;
                        clock-output-names =
-                               "hsusb", "hscif2", "scif5", "scif4", "hscif1", "hscif0",
+                               "ehci", "hsusb", "hscif2", "scif5", "scif4", "hscif1", "hscif0",
                                "scif3", "scif2", "scif1", "scif0", "du1", "du0", "lvds0";
                };
                mstp8_clks: mstp8_clks@e6150990 {
                mstp9_clks: mstp9_clks@e6150994 {
                        compatible = "renesas,r8a7791-mstp-clocks", "renesas,cpg-mstp-clocks";
                        reg = <0 0xe6150994 0 4>, <0 0xe61509a4 0 4>;
-                       clocks = <&p_clk>, <&p_clk>, <&cpg_clocks R8A7791_CLK_QSPI>,
-                                <&p_clk>, <&p_clk>, <&p_clk>, <&p_clk>, <&p_clk>,
-                                <&p_clk>;
+                       clocks = <&cp_clk>, <&cp_clk>, <&cp_clk>, <&cp_clk>,
+                                <&cp_clk>, <&cp_clk>, <&cp_clk>, <&cp_clk>,
+                                <&p_clk>, <&p_clk>, <&cpg_clocks R8A7791_CLK_QSPI>, <&hp_clk>,
+                                <&cp_clk>, <&hp_clk>, <&hp_clk>, <&hp_clk>,
+                                <&hp_clk>, <&hp_clk>;
                        #clock-cells = <1>;
                        renesas,clock-indices = <
-                               R8A7791_CLK_RCAN1 R8A7791_CLK_RCAN0 R8A7791_CLK_QSPI_MOD
-                               R8A7791_CLK_I2C5 R8A7791_CLK_I2C4 R8A7791_CLK_I2C3
-                               R8A7791_CLK_I2C2 R8A7791_CLK_I2C1 R8A7791_CLK_I2C0
+                               R8A7791_CLK_GPIO7 R8A7791_CLK_GPIO6 R8A7791_CLK_GPIO5 R8A7791_CLK_GPIO4
+                               R8A7791_CLK_GPIO3 R8A7791_CLK_GPIO2 R8A7791_CLK_GPIO1 R8A7791_CLK_GPIO0
+                               R8A7791_CLK_RCAN1 R8A7791_CLK_RCAN0 R8A7791_CLK_QSPI_MOD R8A7791_CLK_I2C5
+                               R8A7791_CLK_IICDVFS R8A7791_CLK_I2C4 R8A7791_CLK_I2C3 R8A7791_CLK_I2C2
+                               R8A7791_CLK_I2C1 R8A7791_CLK_I2C0
                        >;
                        clock-output-names =
-                               "rcan1", "rcan0", "qspi_mod", "i2c5", "i2c4", "i2c3",
-                               "i2c2", "i2c1", "i2c0";
+                               "gpio7", "gpio6", "gpio5", "gpio4", "gpio3", "gpio2", "gpio1", "gpio0",
+                               "rcan1", "rcan0", "qspi_mod", "i2c5", "i2c6", "i2c4", "i2c3", "i2c2",
+                               "i2c1", "i2c0";
                };
                mstp11_clks: mstp11_clks@e615099c {
                        compatible = "renesas,r8a7791-mstp-clocks", "renesas,cpg-mstp-clocks";
                };
        };
 
-       spi: spi@e6b10000 {
+       qspi: spi@e6b10000 {
                compatible = "renesas,qspi-r8a7791", "renesas,qspi";
                reg = <0 0xe6b10000 0 0x2c>;
                interrupts = <0 184 IRQ_TYPE_LEVEL_HIGH>;
                #size-cells = <0>;
                status = "disabled";
        };
+
+       msiof0: spi@e6e20000 {
+               compatible = "renesas,msiof-r8a7791";
+               reg = <0 0xe6e20000 0 0x0064>;
+               interrupts = <0 156 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp0_clks R8A7791_CLK_MSIOF0>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
+
+       msiof1: spi@e6e10000 {
+               compatible = "renesas,msiof-r8a7791";
+               reg = <0 0xe6e10000 0 0x0064>;
+               interrupts = <0 157 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp2_clks R8A7791_CLK_MSIOF1>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
+
+       msiof2: spi@e6e00000 {
+               compatible = "renesas,msiof-r8a7791";
+               reg = <0 0xe6e00000 0 0x0064>;
+               interrupts = <0 158 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp2_clks R8A7791_CLK_MSIOF2>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
 };
index 035df4053c21767b894871a0b37ff0d20006e296..afb327322a4a6d40538f30cdfca33aa3b25b39e3 100644 (file)
@@ -18,6 +18,7 @@
 
 / {
        model = "bq Curie 2";
+       compatible = "mundoreader,bq-curie2", "rockchip,rk3066a";
 
        memory {
                reg = <0x60000000 0x40000000>;
index 4d4dfbb59f4b53590aaf4fe61af6c013f793a03a..048c5de00551e1e108da32d57ab6e6a684468582 100644 (file)
@@ -79,7 +79,7 @@
 
                pinctrl@20008000 {
                        compatible = "rockchip,rk3066a-pinctrl";
-                       reg = <0x20008000 0x150>;
+                       rockchip,grf = <&grf>;
                        #address-cells = <1>;
                        #size-cells = <1>;
                        ranges;
index 3ba1968a70abb55489d692dfb8ce2bebab683a23..a5eee55079cb7e622dfd6368cefff3b6329439a4 100644 (file)
@@ -17,6 +17,7 @@
 
 / {
        model = "Radxa Rock";
+       compatible = "radxa,rock", "rockchip,rk3188";
 
        memory {
                reg = <0x60000000 0x80000000>;
index ed9a70af3e3f88ff59a266165b2655754e50dbda..a494fb0cff648f8cec3c86af590fba88a45526c2 100644 (file)
 
                pinctrl@20008000 {
                        compatible = "rockchip,rk3188-pinctrl";
-                       reg = <0x20008000 0xa0>,
-                             <0x20008164 0x1a0>;
-                       reg-names = "base", "pull";
+                       rockchip,grf = <&grf>;
+                       rockchip,pmu = <&pmu>;
+
                        #address-cells = <1>;
                        #size-cells = <1>;
                        ranges;
 
                        gpio0: gpio0@0x2000a000 {
                                compatible = "rockchip,rk3188-gpio-bank0";
-                               reg = <0x2000a000 0x100>,
-                                     <0x20004064 0x8>;
+                               reg = <0x2000a000 0x100>;
                                interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
                                clocks = <&clk_gates8 9>;
 
index 26e5a968d49d1ffa39619d172237f28c4c74f1a7..2adf1cc9e85df4478c5ed329911dd613356d97f9 100644 (file)
                        reg = <0x1013c000 0x100>;
                };
 
-               pmu@20004000 {
-                       compatible = "rockchip,rk3066-pmu";
+               pmu: pmu@20004000 {
+                       compatible = "rockchip,rk3066-pmu", "syscon";
                        reg = <0x20004000 0x100>;
                };
 
+               grf: grf@20008000 {
+                       compatible = "syscon";
+                       reg = <0x20008000 0x200>;
+               };
+
                gic: interrupt-controller@1013d000 {
                        compatible = "arm,cortex-a9-gic";
                        interrupt-controller;
index a106b0872910da874f1000f417a1aab1793237de..e0b15a6e8897fe84860a04d26d5d581b3f3161cf 100644 (file)
                reg = <0x20000000 0x8000000>;
        };
 
+       slow_xtal: slow_xtal {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <0>;
+       };
+
+       main_xtal: main_xtal {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <0>;
+       };
+
        clocks {
                adc_op_clk: adc_op_clk{
                        compatible = "fixed-clock";
                                compatible = "atmel,at91sam9g45-ssc";
                                reg = <0xf0008000 0x4000>;
                                interrupts = <38 IRQ_TYPE_LEVEL_HIGH 4>;
+                               dmas = <&dma0 2 AT91_DMA_CFG_PER_ID(13)>,
+                                      <&dma0 2 AT91_DMA_CFG_PER_ID(14)>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
                                clocks = <&ssc0_clk>;
                                compatible = "atmel,at91sam9g45-ssc";
                                reg = <0xf800c000 0x4000>;
                                interrupts = <39 IRQ_TYPE_LEVEL_HIGH 4>;
+                               dmas = <&dma1 2 AT91_DMA_CFG_PER_ID(3)>,
+                                      <&dma1 2 AT91_DMA_CFG_PER_ID(4)>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&pinctrl_ssc1_tx &pinctrl_ssc1_rx>;
                                clocks = <&ssc1_clk>;
                                        };
                                };
 
+                               pwm0 {
+                                       pinctrl_pwm0_pwmh0_0: pwm0_pwmh0-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOA 20 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* conflicts with ISI_D4 and LCDDAT20 */
+                                       };
+                                       pinctrl_pwm0_pwmh0_1: pwm0_pwmh0-1 {
+                                               atmel,pins =
+                                                       <AT91_PIOB 0 AT91_PERIPH_B AT91_PINCTRL_NONE>;  /* conflicts with GTX0 */
+                                       };
+                                       pinctrl_pwm0_pwml0_0: pwm0_pwml0-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOA 21 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* conflicts with ISI_D5 and LCDDAT21 */
+                                       };
+                                       pinctrl_pwm0_pwml0_1: pwm0_pwml0-1 {
+                                               atmel,pins =
+                                                       <AT91_PIOB 1 AT91_PERIPH_B AT91_PINCTRL_NONE>;  /* conflicts with GTX1 */
+                                       };
+
+                                       pinctrl_pwm0_pwmh1_0: pwm0_pwmh1-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOA 22 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* conflicts with ISI_D6 and LCDDAT22 */
+                                       };
+                                       pinctrl_pwm0_pwmh1_1: pwm0_pwmh1-1 {
+                                               atmel,pins =
+                                                       <AT91_PIOB 4 AT91_PERIPH_B AT91_PINCTRL_NONE>;  /* conflicts with GRX0 */
+                                       };
+                                       pinctrl_pwm0_pwmh1_2: pwm0_pwmh1-2 {
+                                               atmel,pins =
+                                                       <AT91_PIOB 27 AT91_PERIPH_C AT91_PINCTRL_NONE>; /* conflicts with G125CKO and RTS1 */
+                                       };
+                                       pinctrl_pwm0_pwml1_0: pwm0_pwml1-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOA 23 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* conflicts with ISI_D7 and LCDDAT23 */
+                                       };
+                                       pinctrl_pwm0_pwml1_1: pwm0_pwml1-1 {
+                                               atmel,pins =
+                                                       <AT91_PIOB 5 AT91_PERIPH_B AT91_PINCTRL_NONE>;  /* conflicts with GRX1 */
+                                       };
+                                       pinctrl_pwm0_pwml1_2: pwm0_pwml1-2 {
+                                               atmel,pins =
+                                                       <AT91_PIOE 31 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* conflicts with IRQ */
+                                       };
+
+                                       pinctrl_pwm0_pwmh2_0: pwm0_pwmh2-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOB 8 AT91_PERIPH_B AT91_PINCTRL_NONE>;  /* conflicts with GTXCK */
+                                       };
+                                       pinctrl_pwm0_pwmh2_1: pwm0_pwmh2-1 {
+                                               atmel,pins =
+                                                       <AT91_PIOD 5 AT91_PERIPH_C AT91_PINCTRL_NONE>;  /* conflicts with MCI0_DA4 and TIOA0 */
+                                       };
+                                       pinctrl_pwm0_pwml2_0: pwm0_pwml2-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOB 9 AT91_PERIPH_B AT91_PINCTRL_NONE>;  /* conflicts with GTXEN */
+                                       };
+                                       pinctrl_pwm0_pwml2_1: pwm0_pwml2-1 {
+                                               atmel,pins =
+                                                       <AT91_PIOD 6 AT91_PERIPH_C AT91_PINCTRL_NONE>;  /* conflicts with MCI0_DA5 and TIOB0 */
+                                       };
+
+                                       pinctrl_pwm0_pwmh3_0: pwm0_pwmh3-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOB 12 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* conflicts with GRXDV */
+                                       };
+                                       pinctrl_pwm0_pwmh3_1: pwm0_pwmh3-1 {
+                                               atmel,pins =
+                                                       <AT91_PIOD 7 AT91_PERIPH_C AT91_PINCTRL_NONE>;  /* conflicts with MCI0_DA6 and TCLK0 */
+                                       };
+                                       pinctrl_pwm0_pwml3_0: pwm0_pwml3-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOB 13 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* conflicts with GRXER */
+                                       };
+                                       pinctrl_pwm0_pwml3_1: pwm0_pwml3-1 {
+                                               atmel,pins =
+                                                       <AT91_PIOD 8 AT91_PERIPH_C AT91_PINCTRL_NONE>;  /* conflicts with MCI0_DA7 */
+                                       };
+                               };
+
                                spi0 {
                                        pinctrl_spi0: spi0-0 {
                                                atmel,pins =
                                #size-cells = <0>;
                                #interrupt-cells = <1>;
 
-                               clk32k: slck {
-                                       compatible = "fixed-clock";
+                               main_rc_osc: main_rc_osc {
+                                       compatible = "atmel,at91sam9x5-clk-main-rc-osc";
                                        #clock-cells = <0>;
-                                       clock-frequency = <32768>;
+                                       interrupt-parent = <&pmc>;
+                                       interrupts = <AT91_PMC_MOSCRCS>;
+                                       clock-frequency = <12000000>;
+                                       clock-accuracy = <50000000>;
                                };
 
-                               main: mainck {
-                                       compatible = "atmel,at91rm9200-clk-main";
+                               main_osc: main_osc {
+                                       compatible = "atmel,at91rm9200-clk-main-osc";
                                        #clock-cells = <0>;
                                        interrupt-parent = <&pmc>;
                                        interrupts = <AT91_PMC_MOSCS>;
-                                       clocks = <&clk32k>;
+                                       clocks = <&main_xtal>;
+                               };
+
+                               main: mainck {
+                                       compatible = "atmel,at91sam9x5-clk-main";
+                                       #clock-cells = <0>;
+                                       interrupt-parent = <&pmc>;
+                                       interrupts = <AT91_PMC_MOSCSELS>;
+                                       clocks = <&main_rc_osc &main_osc>;
                                };
 
                                plla: pllack {
                                status = "disabled";
                        };
 
+                       sckc@fffffe50 {
+                               compatible = "atmel,at91sam9x5-sckc";
+                               reg = <0xfffffe50 0x4>;
+
+                               slow_rc_osc: slow_rc_osc {
+                                       compatible = "atmel,at91sam9x5-clk-slow-rc-osc";
+                                       #clock-cells = <0>;
+                                       clock-frequency = <32768>;
+                                       clock-accuracy = <50000000>;
+                                       atmel,startup-time-usec = <75>;
+                               };
+
+                               slow_osc: slow_osc {
+                                       compatible = "atmel,at91sam9x5-clk-slow-osc";
+                                       #clock-cells = <0>;
+                                       clocks = <&slow_xtal>;
+                                       atmel,startup-time-usec = <1200000>;
+                               };
+
+                               clk32k: slowck {
+                                       compatible = "atmel,at91sam9x5-clk-slow";
+                                       #clock-cells = <0>;
+                                       clocks = <&slow_rc_osc &slow_osc>;
+                               };
+                       };
+
                        rtc@fffffeb0 {
                                compatible = "atmel,at91rm9200-rtc";
                                reg = <0xfffffeb0 0x30>;
index f55ed072c8e6b1c0290a5aa3eb4ab4b7680e121b..b0b1331c1974cf1a3c70a708cda0044e887ced54 100644 (file)
                reg = <0x20000000 0x20000000>;
        };
 
+       slow_xtal {
+               clock-frequency = <32768>;
+       };
+
+       main_xtal {
+               clock-frequency = <12000000>;
+       };
+
        ahb {
                apb {
                        spi0: spi@f0004000 {
index dba739b6ef36faa57fc630708f7deb8903c1c4d5..306eef0f97ef21fc51a0410d2e2a6d59186986b8 100644 (file)
                                };
                        };
 
+                       ssc0: ssc@f0008000 {
+                               atmel,clk-from-rk-pin;
+                       };
+
                        /*
                         * i2c0 conflicts with ISI:
                         * disable it to allow the use of ISI
        };
 
        sound {
-               compatible = "atmel,sama5d3ek-wm8904";
+               compatible = "atmel,asoc-wm8904";
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_pck0_as_audio_mck>;
 
                        "Headphone Jack", "HPOUTR",
                        "IN2L", "Line In Jack",
                        "IN2R", "Line In Jack",
+                       "MICBIAS", "IN1L",
                        "IN1L", "Mic";
 
                atmel,ssc-controller = <&ssc0>;
                atmel,audio-codec = <&wm8904>;
+
+               status = "disabled";
        };
 };
index eb8886b535e4a28345ac5ae848ce85de47fcbbe4..a99171c8a78222f97497b4d1de6f3897e2e5fca1 100644 (file)
@@ -14,6 +14,7 @@
 /dts-v1/;
 #include "sh73a0.dtsi"
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 
 / {
 
                back-key {
                        gpios = <&pcf8575 8 GPIO_ACTIVE_LOW>;
-                       linux,code = <158>;
+                       linux,code = <KEY_BACK>;
                        label = "SW3";
                };
 
                right-key {
                        gpios = <&pcf8575 9 GPIO_ACTIVE_LOW>;
-                       linux,code = <106>;
+                       linux,code = <KEY_RIGHT>;
                        label = "SW2-R";
                };
 
                left-key {
                        gpios = <&pcf8575 10 GPIO_ACTIVE_LOW>;
-                       linux,code = <105>;
+                       linux,code = <KEY_LEFT>;
                        label = "SW2-L";
                };
 
                enter-key {
                        gpios = <&pcf8575 11 GPIO_ACTIVE_LOW>;
-                       linux,code = <28>;
+                       linux,code = <KEY_ENTER>;
                        label = "SW2-P";
                };
 
                up-key {
                        gpios = <&pcf8575 12 GPIO_ACTIVE_LOW>;
-                       linux,code = <103>;
+                       linux,code = <KEY_UP>;
                        label = "SW2-U";
                };
 
                down-key {
                        gpios = <&pcf8575 13 GPIO_ACTIVE_LOW>;
-                       linux,code = <108>;
+                       linux,code = <KEY_DOWN>;
                        label = "SW2-D";
                };
 
                home-key {
                        gpios = <&pcf8575 14 GPIO_ACTIVE_LOW>;
-                       linux,code = <102>;
+                       linux,code = <KEY_HOME>;
                        label = "SW1";
                };
        };
index 56fc214e6d2c3a6fd67f7ce41f11f0ec9a4c8abc..280966b92e5ed3863f0f9750b10a52fc9f4508d9 100644 (file)
@@ -15,7 +15,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
+#include <dt-bindings/reset/altr,rst-mgr.h>
 
 / {
        #address-cells = <1>;
                        pdma: pdma@ffe01000 {
                                compatible = "arm,pl330", "arm,primecell";
                                reg = <0xffe01000 0x1000>;
-                               interrupts = <0 180 4>;
+                               interrupts = <0 104 4>,
+                                            <0 105 4>,
+                                            <0 106 4>,
+                                            <0 107 4>,
+                                            <0 108 4>,
+                                            <0 109 4>,
+                                            <0 110 4>,
+                                            <0 111 4>;
                                #dma-cells = <1>;
                                #dma-channels = <8>;
                                #dma-requests = <32>;
                        };
                };
 
+               can0: can@ffc00000 {
+                       compatible = "bosch,d_can";
+                       reg = <0xffc00000 0x1000>;
+                       interrupts = <0 131 4>, <0 132 4>, <0 133 4>, <0 134 4>;
+                       clocks = <&can0_clk>;
+                       status = "disabled";
+               };
+
+               can1: can@ffc01000 {
+                       compatible = "bosch,d_can";
+                       reg = <0xffc01000 0x1000>;
+                       interrupts = <0 135 4>, <0 136 4>, <0 137 4>, <0 138 4>;
+                       clocks = <&can1_clk>;
+                       status = "disabled";
+               };
+
                clkmgr@ffd04000 {
                                compatible = "altr,clk-mgr";
                                reg = <0xffd04000 0x1000>;
                                                        #clock-cells = <0>;
                                                        compatible = "altr,socfpga-perip-clk";
                                                        clocks = <&main_pll>;
-                                                       fixed-divider = <2>;
+                                                       div-reg = <0xe0 0 9>;
                                                        reg = <0x48>;
                                                };
 
                                                        #clock-cells = <0>;
                                                        compatible = "altr,socfpga-perip-clk";
                                                        clocks = <&main_pll>;
-                                                       fixed-divider = <4>;
+                                                       div-reg = <0xe4 0 9>;
                                                        reg = <0x4C>;
                                                };
 
                                                        #clock-cells = <0>;
                                                        compatible = "altr,socfpga-perip-clk";
                                                        clocks = <&main_pll>;
-                                                       fixed-divider = <4>;
+                                                       div-reg = <0xe8 0 9>;
                                                        reg = <0x50>;
                                                };
 
                        mac-address = [00 00 00 00 00 00];/* Filled in by U-Boot */
                        clocks = <&emac0_clk>;
                        clock-names = "stmmaceth";
+                       resets = <&rst EMAC0_RESET>;
+                       reset-names = "stmmaceth";
                        status = "disabled";
                };
 
                        mac-address = [00 00 00 00 00 00];/* Filled in by U-Boot */
                        clocks = <&emac1_clk>;
                        clock-names = "stmmaceth";
+                       resets = <&rst EMAC1_RESET>;
+                       reset-names = "stmmaceth";
+                       status = "disabled";
+               };
+
+               i2c0: i2c@ffc04000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc04000 0x1000>;
+                       clocks = <&l4_sp_clk>;
+                       interrupts = <0 158 0x4>;
+                       status = "disabled";
+               };
+
+               i2c1: i2c@ffc05000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc05000 0x1000>;
+                       clocks = <&l4_sp_clk>;
+                       interrupts = <0 159 0x4>;
+                       status = "disabled";
+               };
+
+               i2c2: i2c@ffc06000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc06000 0x1000>;
+                       clocks = <&l4_sp_clk>;
+                       interrupts = <0 160 0x4>;
+                       status = "disabled";
+               };
+
+               i2c3: i2c@ffc07000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc07000 0x1000>;
+                       clocks = <&l4_sp_clk>;
+                       interrupts = <0 161 0x4>;
                        status = "disabled";
                };
 
                        compatible = "snps,dw-apb-timer";
                        interrupts = <0 167 4>;
                        reg = <0xffc08000 0x1000>;
+                       clocks = <&l4_sp_clk>;
+                       clock-names = "timer";
                };
 
                timer1: timer1@ffc09000 {
                        compatible = "snps,dw-apb-timer";
                        interrupts = <0 168 4>;
                        reg = <0xffc09000 0x1000>;
+                       clocks = <&l4_sp_clk>;
+                       clock-names = "timer";
                };
 
                timer2: timer2@ffd00000 {
                        compatible = "snps,dw-apb-timer";
                        interrupts = <0 169 4>;
                        reg = <0xffd00000 0x1000>;
+                       clocks = <&osc1>;
+                       clock-names = "timer";
                };
 
                timer3: timer3@ffd01000 {
                        compatible = "snps,dw-apb-timer";
                        interrupts = <0 170 4>;
                        reg = <0xffd01000 0x1000>;
+                       clocks = <&osc1>;
+                       clock-names = "timer";
                };
 
                uart0: serial0@ffc02000 {
                        interrupts = <0 162 4>;
                        reg-shift = <2>;
                        reg-io-width = <4>;
+                       clocks = <&l4_sp_clk>;
                };
 
                uart1: serial1@ffc03000 {
                        interrupts = <0 163 4>;
                        reg-shift = <2>;
                        reg-io-width = <4>;
+                       clocks = <&l4_sp_clk>;
                };
 
-               rstmgr@ffd05000 {
+               rst: rstmgr@ffd05000 {
                        compatible = "altr,rst-mgr";
                        reg = <0xffd05000 0x1000>;
                };
 
+               usbphy0: usbphy@0 {
+                       #phy-cells = <0>;
+                       compatible = "usb-nop-xceiv";
+                       status = "okay";
+               };
+
+               usb0: usb@ffb00000 {
+                       compatible = "snps,dwc2";
+                       reg = <0xffb00000 0xffff>;
+                       interrupts = <0 125 4>;
+                       clocks = <&usb_mp_clk>;
+                       clock-names = "otg";
+                       phys = <&usbphy0>;
+                       phy-names = "usb2-phy";
+                       status = "disabled";
+               };
+
+               usb1: usb@ffb40000 {
+                       compatible = "snps,dwc2";
+                       reg = <0xffb40000 0xffff>;
+                       interrupts = <0 128 4>;
+                       clocks = <&usb_mp_clk>;
+                       clock-names = "otg";
+                       phys = <&usbphy0>;
+                       phy-names = "usb2-phy";
+                       status = "disabled";
+               };
+
                sysmgr: sysmgr@ffd08000 {
                        compatible = "altr,sys-mgr", "syscon";
                        reg = <0xffd08000 0x4000>;
index 6c87b7070ca77d0379e03b214a7a0f6601973bfc..12d1c2ccaf5ba4b22b12a4793dd1d6f8e51da38e 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 /dts-v1/;
-/include/ "socfpga.dtsi"
+#include "socfpga.dtsi"
 
 / {
        soc {
                        };
                };
 
-               serial0@ffc02000 {
-                       clock-frequency = <100000000>;
-               };
-
-               serial1@ffc03000 {
-                       clock-frequency = <100000000>;
-               };
-
                sysmgr@ffd08000 {
                        cpu1-start-addr = <0xffd080c4>;
                };
-
-               timer0@ffc08000 {
-                       clock-frequency = <100000000>;
-               };
-
-               timer1@ffc09000 {
-                       clock-frequency = <100000000>;
-               };
-
-               timer2@ffd00000 {
-                       clock-frequency = <25000000>;
-               };
-
-               timer3@ffd01000 {
-                       clock-frequency = <25000000>;
-               };
        };
 };
index a87ee1c07661b466d9d8abc8ca323739f82d6b69..d532d171e3917dba36b2284be351d33774fdd7a4 100644 (file)
@@ -15,7 +15,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-/include/ "socfpga_arria5.dtsi"
+#include "socfpga_arria5.dtsi"
 
 / {
        model = "Altera SOCFPGA Arria V SoC Development Kit";
        rxdv-skew-ps = <0>;
        rxc-skew-ps = <2000>;
 };
+
+&i2c0 {
+       status = "okay";
+
+       eeprom@51 {
+               compatible = "atmel,24c32";
+               reg = <0x51>;
+               pagesize = <32>;
+       };
+
+       rtc@68 {
+               compatible = "dallas,ds1339";
+               reg = <0x68>;
+       };
+};
+
+&usb1 {
+       status = "okay";
+};
index ca41b0ebf461b12a413d36627a73fff323f5d69a..bf511828729f9fe8c7756b19eed1341a40a23789 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 /dts-v1/;
-/include/ "socfpga.dtsi"
+#include "socfpga.dtsi"
 
 / {
        soc {
                        status = "okay";
                };
 
-               timer0@ffc08000 {
-                       clock-frequency = <100000000>;
-               };
-
-               timer1@ffc09000 {
-                       clock-frequency = <100000000>;
-               };
-
-               timer2@ffd00000 {
-                       clock-frequency = <25000000>;
-               };
-
-               timer3@ffd01000 {
-                       clock-frequency = <25000000>;
-               };
-
-               serial0@ffc02000 {
-                       clock-frequency = <100000000>;
-               };
-
-               serial1@ffc03000 {
-                       clock-frequency = <100000000>;
-               };
-
                sysmgr@ffd08000 {
                        cpu1-start-addr = <0xffd080c4>;
                };
index ae16d975196d62c1947cbf41187d0e47cb6a5e9a..45de1514af0ac24f36c0cf5a737a70c7da555213 100644 (file)
@@ -15,7 +15,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-/include/ "socfpga_cyclone5.dtsi"
+#include "socfpga_cyclone5.dtsi"
 
 / {
        model = "Altera SOCFPGA Cyclone V SoC Development Kit";
        rxdv-skew-ps = <0>;
        rxc-skew-ps = <2000>;
 };
+
+&i2c0 {
+       status = "okay";
+
+       eeprom@51 {
+               compatible = "atmel,24c32";
+               reg = <0x51>;
+               pagesize = <32>;
+       };
+
+       rtc@68 {
+               compatible = "dallas,ds1339";
+               reg = <0x68>;
+       };
+};
+
+&usb1 {
+       status = "okay";
+};
index b79e2a2bf17522504e5384a929ee2d3226a42654..d26f155f5fd9f64fcdbd1bcf12626c6008683b9b 100644 (file)
@@ -15,7 +15,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-/include/ "socfpga_cyclone5.dtsi"
+#include "socfpga_cyclone5.dtsi"
 
 / {
        model = "Terasic SoCkit";
@@ -52,3 +52,7 @@
        rxdv-skew-ps = <0>;
        rxc-skew-ps = <2000>;
 };
+
+&usb1 {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/socfpga_cyclone5_socrates.dts b/arch/arm/boot/dts/socfpga_cyclone5_socrates.dts
new file mode 100644 (file)
index 0000000..a1814b4
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ *  Copyright (C) 2014 Steffen Trumtrar <s.trumtrar@pengutronix.de>
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "socfpga_cyclone5.dtsi"
+
+/ {
+       model = "EBV SOCrates";
+       compatible = "ebv,socrates", "altr,socfpga-cyclone5", "altr,socfpga";
+
+       chosen {
+               bootargs = "console=ttyS0,115200";
+       };
+
+       memory {
+               name = "memory";
+               device_type = "memory";
+               reg = <0x0 0x40000000>; /* 1GB */
+       };
+};
+
+&gmac1 {
+       status = "okay";
+};
+
+&i2c0 {
+       status = "okay";
+
+       rtc: rtc@68 {
+               compatible = "stm,m41t82";
+               reg = <0x68>;
+       };
+};
+
+&mmc {
+       status = "okay";
+};
index 87d6f759a9c187dc81c4ddcc718c97e87a7683ab..09792b41111058f2546577d3f7ddefdc78291b41 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 /dts-v1/;
-/include/ "socfpga.dtsi"
+#include "socfpga.dtsi"
 
 / {
        model = "Altera SOCFPGA VT";
index e181a50fd65a9713000317c1cf04b16136d95477..c6661a60025d5e524287ffbc07846160877b0d86 100644 (file)
@@ -83,7 +83,6 @@ CONFIG_KEYBOARD_GPIO=y
 # CONFIG_INPUT_MOUSE is not set
 CONFIG_INPUT_TOUCHSCREEN=y
 CONFIG_TOUCHSCREEN_ATMEL_MXT=m
-CONFIG_TOUCHSCREEN_ATMEL_TSADCC=y
 # CONFIG_SERIO is not set
 # CONFIG_LEGACY_PTYS is not set
 CONFIG_SERIAL_ATMEL=y
@@ -146,6 +145,8 @@ CONFIG_DMADEVICES=y
 CONFIG_AT_HDMAC=y
 CONFIG_DMATEST=m
 # CONFIG_IOMMU_SUPPORT is not set
+CONFIG_IIO=y
+CONFIG_AT91_ADC=y
 CONFIG_EXT4_FS=y
 CONFIG_FANOTIFY=y
 CONFIG_VFAT_FS=y
index 85f846ae9ff21e77d8126bda271660f108c0cc75..5d7797d43d23e4c3d8b91d875cdb22ceaa1da11d 100644 (file)
@@ -45,7 +45,6 @@ CONFIG_INPUT_EVDEV=y
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
 CONFIG_INPUT_TOUCHSCREEN=y
-CONFIG_TOUCHSCREEN_ATMEL_TSADCC=y
 # CONFIG_SERIO is not set
 CONFIG_SERIAL_ATMEL=y
 CONFIG_SERIAL_ATMEL_CONSOLE=y
@@ -65,6 +64,8 @@ CONFIG_MMC=y
 CONFIG_MMC_ATMELMCI=m
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_AT91SAM9=y
+CONFIG_IIO=y
+CONFIG_AT91_ADC=y
 CONFIG_EXT2_FS=y
 CONFIG_MSDOS_FS=y
 CONFIG_VFAT_FS=y
index f1595514417560858f3fb517b561aab6b2553a1a..701677f9248c2f493d14f1b984a05dc0fa8ae260 100644 (file)
@@ -37,7 +37,6 @@ CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_MTD=y
 CONFIG_MTD_CMDLINE_PARTS=y
-CONFIG_MTD_CHAR=y
 CONFIG_MTD_BLOCK=y
 CONFIG_MTD_CFI=y
 CONFIG_MTD_JEDECPROBE=y
@@ -48,6 +47,7 @@ CONFIG_MTD_CFI_INTELEXT=y
 CONFIG_MTD_CFI_STAA=y
 CONFIG_MTD_PHYSMAP=y
 CONFIG_MTD_M25P80=y
+CONFIG_MTD_SPI_NOR=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=1
index 4ce7b70ea9011634de2bcb9f1b0ff4f29e046ecd..e07a227ec0dbb331bae2428427dc36fec444adec 100644 (file)
@@ -65,6 +65,7 @@ CONFIG_TCG_TIS_I2C_INFINEON=y
 CONFIG_I2C=y
 CONFIG_I2C_MUX=y
 CONFIG_I2C_ARB_GPIO_CHALLENGE=y
+CONFIG_I2C_EXYNOS5=y
 CONFIG_I2C_S3C2410=y
 CONFIG_DEBUG_GPIO=y
 # CONFIG_HWMON is not set
index 2e762d94e94b31501c1e7e3ea16965c72d3d9b9c..b9e480c10b10880bb64d2d5f2ec8ac872ced5890 100644 (file)
@@ -61,6 +61,7 @@ CONFIG_MTD_PHYSMAP=y
 CONFIG_MTD_M25P80=y
 CONFIG_MTD_NAND=y
 CONFIG_MTD_NAND_ORION=y
+CONFIG_MTD_SPI_NOR=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_EEPROM_AT24=y
 # CONFIG_SCSI_PROC_FS is not set
index aa3dfb084fed6b3e4739f3a2d002daf616f18eb6..5ebfa8bf85094b8ff5ded8b819a9d7f278304a22 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_MVEBU=y
 CONFIG_MACH_KIRKWOOD=y
-CONFIG_MACH_T5325=y
 CONFIG_ARCH_MXC=y
 CONFIG_MACH_IMX25_DT=y
 CONFIG_MACH_IMX27_DT=y
@@ -108,6 +107,8 @@ CONFIG_SND=y
 CONFIG_SND_SOC=y
 CONFIG_SND_KIRKWOOD_SOC=y
 CONFIG_SND_KIRKWOOD_SOC_T5325=y
+CONFIG_SND_SOC_ALC5623=y
+CONFIG_SND_SIMPLE_CARD=y
 # CONFIG_ABX500_CORE is not set
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
index d4e8a47a2f7c8a016b8eee0adaf36e24bb0c341a..86e01a86e8cc06fb8e39fd218c5452774d985697 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_ARCH_BCM_MOBILE=y
 CONFIG_ARCH_BERLIN=y
 CONFIG_MACH_BERLIN_BG2=y
 CONFIG_MACH_BERLIN_BG2CD=y
+CONFIG_MACH_BERLIN_BG2Q=y
 CONFIG_GPIO_PCA953X=y
 CONFIG_ARCH_HIGHBANK=y
 CONFIG_ARCH_HI3xxx=y
@@ -96,6 +97,11 @@ CONFIG_INET6_IPCOMP=m
 CONFIG_IPV6_MIP6=m
 CONFIG_IPV6_TUNNEL=m
 CONFIG_IPV6_MULTIPLE_TABLES=y
+CONFIG_CAN=y
+CONFIG_CAN_RAW=y
+CONFIG_CAN_BCM=y
+CONFIG_CAN_DEV=y
+CONFIG_CAN_MCP251X=y
 CONFIG_CFG80211=m
 CONFIG_MAC80211=m
 CONFIG_RFKILL=y
@@ -112,6 +118,7 @@ CONFIG_BLK_DEV_LOOP=y
 CONFIG_ICS932S401=y
 CONFIG_APDS9802ALS=y
 CONFIG_ISL29003=y
+CONFIG_EEPROM_AT24=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_BLK_DEV_SR=y
 CONFIG_SCSI_MULTI_LUN=y
@@ -191,6 +198,7 @@ CONFIG_PINCTRL_AS3722=y
 CONFIG_PINCTRL_PALMAS=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_GENERIC_PLATFORM=y
+CONFIG_GPIO_DWAPB=y
 CONFIG_GPIO_PCA953X_IRQ=y
 CONFIG_GPIO_TWL4030=y
 CONFIG_GPIO_PALMAS=y
@@ -254,6 +262,7 @@ CONFIG_SND_SOC_TEGRA_ALC5632=y
 CONFIG_SND_SOC_TEGRA_MAX98090=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_MVEBU=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_TEGRA=y
 CONFIG_USB_EHCI_HCD_PLATFORM=y
@@ -273,6 +282,7 @@ CONFIG_MMC_BLOCK_MINORS=16
 CONFIG_MMC_ARMMMCI=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ESDHC_IMX=y
+CONFIG_MMC_SDHCI_PXAV3=y
 CONFIG_MMC_SDHCI_TEGRA=y
 CONFIG_MMC_SDHCI_DOVE=y
 CONFIG_MMC_SDHCI_SPEAR=y
@@ -286,6 +296,7 @@ CONFIG_EDAC_HIGHBANK_MC=y
 CONFIG_EDAC_HIGHBANK_L2=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_AS3722=y
+CONFIG_RTC_DRV_DS1307=y
 CONFIG_RTC_DRV_MAX8907=y
 CONFIG_RTC_DRV_PALMAS=y
 CONFIG_RTC_DRV_TWL4030=y
index 36484a37a1ca1924241fc371d7aa584ca4732175..27c732fdf21eae1bfe04e8e19761dffd9996bdc6 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_SYSVIPC=y
+CONFIG_FHANDLE=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_LOG_BUF_SHIFT=19
@@ -11,7 +12,6 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_MVEBU=y
 CONFIG_MACH_KIRKWOOD=y
-CONFIG_MACH_T5325=y
 # CONFIG_CPU_FEROCEON_OLD_ID is not set
 CONFIG_PCI_MVEBU=y
 CONFIG_PREEMPT=y
@@ -50,6 +50,7 @@ CONFIG_MTD_PHYSMAP=y
 CONFIG_MTD_M25P80=y
 CONFIG_MTD_NAND=y
 CONFIG_MTD_NAND_ORION=y
+CONFIG_MTD_SPI_NOR=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_EEPROM_AT24=y
 # CONFIG_SCSI_PROC_FS is not set
@@ -100,6 +101,8 @@ CONFIG_SND=y
 CONFIG_SND_SOC=y
 CONFIG_SND_KIRKWOOD_SOC=y
 CONFIG_SND_KIRKWOOD_SOC_T5325=y
+CONFIG_SND_SOC_ALC5623=y
+CONFIG_SND_SIMPLE_CARD=y
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
 CONFIG_HID_DRAGONRISE=y
index a34713d8db9f6cc633d14230808e634e9c4b599b..b52a6f5c52256a67b88ee054f6ebbf1af6b6cb3a 100644 (file)
@@ -1,5 +1,6 @@
 CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
+CONFIG_FHANDLE=y
 CONFIG_IRQ_DOMAIN_DEBUG=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_LOG_BUF_SHIFT=14
@@ -29,6 +30,9 @@ CONFIG_ARM_ATAG_DTB_COMPAT=y
 CONFIG_VFP=y
 CONFIG_NET=y
 CONFIG_INET=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
 CONFIG_BT=y
 CONFIG_BT_MRVL=y
 CONFIG_BT_MRVL_SDIO=y
@@ -36,6 +40,7 @@ CONFIG_CFG80211=y
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_BLK_DEV_SD=y
 CONFIG_ATA=y
+CONFIG_AHCI_MVEBU=y
 CONFIG_SATA_MV=y
 CONFIG_NETDEVICES=y
 CONFIG_MVNETA=y
@@ -53,6 +58,7 @@ CONFIG_I2C_MV64XXX=y
 CONFIG_MTD=y
 CONFIG_MTD_CHAR=y
 CONFIG_MTD_M25P80=y
+CONFIG_MTD_SPI_NOR=y
 CONFIG_MTD_CFI=y
 CONFIG_MTD_CFI_INTELEXT=y
 CONFIG_MTD_CFI_AMDSTD=y
@@ -79,6 +85,7 @@ CONFIG_USB_EHCI_ROOT_HUB_TT=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_MMC=y
+CONFIG_MMC_SDHCI_PXAV3=y
 CONFIG_MMC_MVSDIO=y
 CONFIG_NEW_LEDS=y
 CONFIG_LEDS_GPIO=y
@@ -103,6 +110,8 @@ CONFIG_UDF_FS=m
 CONFIG_MSDOS_FS=y
 CONFIG_VFAT_FS=y
 CONFIG_TMPFS=y
+CONFIG_NFS_FS=y
+CONFIG_ROOT_NFS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_CODEPAGE_850=y
 CONFIG_NLS_ISO8859_1=y
index abe61bf379d265988220ea03fa6fe9346a737bba..1da5d9e48224246ae3c813f9100587293f886fbd 100644 (file)
@@ -76,8 +76,10 @@ CONFIG_MMC=y
 CONFIG_MMC_ARMMMCI=y
 CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_VERSATILE=y
 CONFIG_LEDS_TRIGGERS=y
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_CPU=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_DS1307=y
 CONFIG_RTC_DRV_PL031=y
index 7079cbe898a8c8041983dcb95679dfa24fc4f0f2..d02e9d911bb7298291260b367a9ccdc03e4ec9aa 100644 (file)
@@ -75,8 +75,10 @@ CONFIG_MMC=y
 CONFIG_MMC_ARMMMCI=y
 CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_VERSATILE=y
 CONFIG_LEDS_TRIGGERS=y
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_CPU=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_DS1307=y
 CONFIG_RTC_DRV_PL031=y
index dc3881e07630c8924356436936927d020055862a..869fa18ebeb2303ca678e193642284e7e9352047 100644 (file)
@@ -122,7 +122,6 @@ CONFIG_KEYBOARD_GPIO=y
 # CONFIG_INPUT_MOUSE is not set
 CONFIG_INPUT_TOUCHSCREEN=y
 CONFIG_TOUCHSCREEN_ATMEL_MXT=y
-CONFIG_TOUCHSCREEN_ATMEL_TSADCC=y
 # CONFIG_SERIO is not set
 CONFIG_LEGACY_PTY_COUNT=4
 CONFIG_SERIAL_ATMEL=y
index 83b07258a385b43c9a2920eb4cbb1b88f4f95efc..6d6437cbbc523b11510a26a7e75330a6a129e7dc 100644 (file)
@@ -25,6 +25,7 @@ CONFIG_SCHED_MC=y
 CONFIG_HAVE_ARM_ARCH_TIMER=y
 CONFIG_NR_CPUS=8
 CONFIG_AEABI=y
+CONFIG_HIGHMEM=y
 CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_ARM_APPENDED_DTB=y
@@ -43,6 +44,7 @@ CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_MTD=y
 CONFIG_MTD_M25P80=y
+CONFIG_EEPROM_AT24=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_ATA=y
 CONFIG_SATA_RCAR=y
@@ -75,9 +77,11 @@ CONFIG_SERIAL_SH_SCI=y
 CONFIG_SERIAL_SH_SCI_NR_UARTS=20
 CONFIG_SERIAL_SH_SCI_CONSOLE=y
 CONFIG_I2C_GPIO=y
+CONFIG_I2C_SH_MOBILE=y
 CONFIG_I2C_RCAR=y
 CONFIG_SPI=y
 CONFIG_SPI_RSPI=y
+CONFIG_SPI_SH_MSIOF=y
 CONFIG_GPIO_EM=y
 CONFIG_GPIO_RCAR=y
 # CONFIG_HWMON is not set
@@ -88,10 +92,14 @@ CONFIG_REGULATOR_FIXED_VOLTAGE=y
 CONFIG_REGULATOR_GPIO=y
 CONFIG_MEDIA_SUPPORT=y
 CONFIG_MEDIA_CAMERA_SUPPORT=y
+CONFIG_MEDIA_CONTROLLER=y
+CONFIG_VIDEO_V4L2_SUBDEV_API=y
 CONFIG_V4L_PLATFORM_DRIVERS=y
 CONFIG_SOC_CAMERA=y
 CONFIG_SOC_CAMERA_PLATFORM=y
 CONFIG_VIDEO_RCAR_VIN=y
+CONFIG_V4L_MEM2MEM_DRIVERS=y
+CONFIG_VIDEO_RENESAS_VSP1=y
 # CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set
 CONFIG_VIDEO_ADV7180=y
 CONFIG_DRM=y
@@ -100,7 +108,13 @@ CONFIG_SOUND=y
 CONFIG_SND=y
 CONFIG_SND_SOC=y
 CONFIG_SND_SOC_RCAR=y
+CONFIG_USB=y
 CONFIG_USB_RCAR_GEN2_PHY=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_RENESAS_USBHS=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_RENESAS_USBHS_UDC=y
 CONFIG_MMC=y
 CONFIG_MMC_SDHI=y
 CONFIG_MMC_SH_MMCIF=y
index 073541a50e2313869aeb0d0c60fd705e9833cec5..d52b4ffe2012ccdcf9c54b728113f49b1a1e05d2 100644 (file)
@@ -61,6 +61,9 @@ CONFIG_SND_ARMAACI=m
 CONFIG_MMC=y
 CONFIG_MMC_ARMMMCI=m
 CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_VERSATILE=y
+CONFIG_LEDS_TRIGGERS=y
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
 CONFIG_LEDS_TRIGGER_CPU=y
 CONFIG_EXT2_FS=y
index f3f19f21352aa94275755f882226027d58a39287..4860918b411eaa1a348bc5a2570b02238cdbe08b 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "board.h"
 #include "generic.h"
+#include "gpio.h"
 
 
 /* --------------------------------------------------------------------
index a0282928e9c10bdbc67b385423b225f8e5315756..14a6e35801ff8db88e32ca7867b50b2c6f5fd5d5 100644 (file)
 #include <mach/at91sam9260_matrix.h>
 #include <mach/at91_matrix.h>
 #include <mach/at91sam9_smc.h>
-#include <mach/at91_adc.h>
 #include <mach/hardware.h>
 
 #include "board.h"
 #include "generic.h"
-
+#include "gpio.h"
 
 /* --------------------------------------------------------------------
  *  USB Host
@@ -1325,13 +1324,6 @@ static struct at91_adc_trigger at91_adc_triggers[] = {
        },
 };
 
-static struct at91_adc_reg_desc at91_adc_register_g20 = {
-       .channel_base = AT91_ADC_CHR(0),
-       .drdy_mask = AT91_ADC_DRDY,
-       .status_register = AT91_ADC_SR,
-       .trigger_register = AT91_ADC_MR,
-};
-
 void __init at91_add_device_adc(struct at91_adc_data *data)
 {
        if (!data)
@@ -1349,9 +1341,7 @@ void __init at91_add_device_adc(struct at91_adc_data *data)
        if (data->use_external_triggers)
                at91_set_A_periph(AT91_PIN_PA22, 0);
 
-       data->num_channels = 4;
        data->startup_time = 10;
-       data->registers = &at91_adc_register_g20;
        data->trigger_number = 4;
        data->trigger_list = at91_adc_triggers;
 
index 80e35895d28fb74f06d852d5712cb4c283b56a47..43b21f456f6e65624971001820574e83c055afa2 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "board.h"
 #include "generic.h"
-
+#include "gpio.h"
 
 /* --------------------------------------------------------------------
  *  USB Host
index 43d53d6156dd7fd60384da67afb3784cf08c88f4..953616e5dbcb25a33f91172fd60e197c293922e2 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "board.h"
 #include "generic.h"
+#include "gpio.h"
 
 
 /* --------------------------------------------------------------------
index 5e6f498db0a8d1bbda3bd2bad51f8dd4ce1b4576..9d3d544ac19c95476c2a1cf513b6283100dba923 100644 (file)
@@ -182,7 +182,7 @@ static struct clk vdec_clk = {
 static struct clk adc_op_clk = {
        .name           = "adc_op_clk",
        .type           = CLK_TYPE_PERIPHERAL,
-       .rate_hz        = 13200000,
+       .rate_hz        = 300000,
 };
 
 /* AES/TDES/SHA clock - Only for sam9m11/sam9g56 */
index dab362c06487a856c9bcac67dd9248903c133fcd..d943363c18454a3cce963c7ae824e68dd40fe366 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/fb.h>
 #include <video/atmel_lcdc.h>
 
-#include <mach/at91_adc.h>
 #include <mach/at91sam9g45.h>
 #include <mach/at91sam9g45_matrix.h>
 #include <mach/at91_matrix.h>
@@ -39,6 +38,7 @@
 #include "board.h"
 #include "generic.h"
 #include "clock.h"
+#include "gpio.h"
 
 
 /* --------------------------------------------------------------------
@@ -1133,58 +1133,7 @@ static void __init at91_add_device_rtc(void) {}
 
 
 /* --------------------------------------------------------------------
- *  Touchscreen
- * -------------------------------------------------------------------- */
-
-#if defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) || defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC_MODULE)
-static u64 tsadcc_dmamask = DMA_BIT_MASK(32);
-static struct at91_tsadcc_data tsadcc_data;
-
-static struct resource tsadcc_resources[] = {
-       [0] = {
-               .start  = AT91SAM9G45_BASE_TSC,
-               .end    = AT91SAM9G45_BASE_TSC + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_TSC,
-               .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_TSC,
-               .flags  = IORESOURCE_IRQ,
-       }
-};
-
-static struct platform_device at91sam9g45_tsadcc_device = {
-       .name           = "atmel_tsadcc",
-       .id             = -1,
-       .dev            = {
-                               .dma_mask               = &tsadcc_dmamask,
-                               .coherent_dma_mask      = DMA_BIT_MASK(32),
-                               .platform_data          = &tsadcc_data,
-       },
-       .resource       = tsadcc_resources,
-       .num_resources  = ARRAY_SIZE(tsadcc_resources),
-};
-
-void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data)
-{
-       if (!data)
-               return;
-
-       at91_set_gpio_input(AT91_PIN_PD20, 0);  /* AD0_XR */
-       at91_set_gpio_input(AT91_PIN_PD21, 0);  /* AD1_XL */
-       at91_set_gpio_input(AT91_PIN_PD22, 0);  /* AD2_YT */
-       at91_set_gpio_input(AT91_PIN_PD23, 0);  /* AD3_TB */
-
-       tsadcc_data = *data;
-       platform_device_register(&at91sam9g45_tsadcc_device);
-}
-#else
-void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data) {}
-#endif
-
-
-/* --------------------------------------------------------------------
- *  ADC
+ *  ADC and touchscreen
  * -------------------------------------------------------------------- */
 
 #if IS_ENABLED(CONFIG_AT91_ADC)
@@ -1236,13 +1185,6 @@ static struct at91_adc_trigger at91_adc_triggers[] = {
        },
 };
 
-static struct at91_adc_reg_desc at91_adc_register_g45 = {
-       .channel_base = AT91_ADC_CHR(0),
-       .drdy_mask = AT91_ADC_DRDY,
-       .status_register = AT91_ADC_SR,
-       .trigger_register = 0x08,
-};
-
 void __init at91_add_device_adc(struct at91_adc_data *data)
 {
        if (!data)
@@ -1268,9 +1210,7 @@ void __init at91_add_device_adc(struct at91_adc_data *data)
        if (data->use_external_triggers)
                at91_set_A_periph(AT91_PIN_PD28, 0);
 
-       data->num_channels = 8;
        data->startup_time = 40;
-       data->registers = &at91_adc_register_g45;
        data->trigger_number = 4;
        data->trigger_list = at91_adc_triggers;
 
index 57f12d86c0e6166c38019b7b7f6acac75078451b..a79960f57e6abff18647e9951a844ef6fb0ef3db 100644 (file)
@@ -153,6 +153,11 @@ static struct clk ac97_clk = {
        .pmc_mask       = 1 << AT91SAM9RL_ID_AC97C,
        .type           = CLK_TYPE_PERIPHERAL,
 };
+static struct clk adc_op_clk = {
+       .name           = "adc_op_clk",
+       .type           = CLK_TYPE_PERIPHERAL,
+       .rate_hz        = 1000000,
+};
 
 static struct clk *periph_clocks[] __initdata = {
        &pioA_clk,
@@ -178,6 +183,7 @@ static struct clk *periph_clocks[] __initdata = {
        &udphs_clk,
        &lcdc_clk,
        &ac97_clk,
+       &adc_op_clk,
        // irq0
 };
 
@@ -216,6 +222,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
        CLKDEV_CON_DEV_ID(NULL, "fffff600.gpio", &pioB_clk),
        CLKDEV_CON_DEV_ID(NULL, "fffff800.gpio", &pioC_clk),
        CLKDEV_CON_DEV_ID(NULL, "fffffa00.gpio", &pioD_clk),
+       CLKDEV_CON_ID("adc_clk", &tsc_clk),
 };
 
 static struct clk_lookup usart_clocks_lookups[] = {
index 428fc412aaf1e223da13a0d675aea08681391210..044ad8bc69632c8866249cb4410a70dd8d029664 100644 (file)
 #include <mach/at91sam9_smc.h>
 #include <mach/hardware.h>
 #include <linux/platform_data/dma-atmel.h>
+#include <linux/platform_data/at91_adc.h>
 
 #include "board.h"
 #include "generic.h"
+#include "gpio.h"
 
 
 /* --------------------------------------------------------------------
@@ -608,14 +610,13 @@ static void __init at91_add_device_tc(void) { }
 
 
 /* --------------------------------------------------------------------
- *  Touchscreen
+ *  ADC and Touchscreen
  * -------------------------------------------------------------------- */
 
-#if defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) || defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC_MODULE)
-static u64 tsadcc_dmamask = DMA_BIT_MASK(32);
-static struct at91_tsadcc_data tsadcc_data;
+#if IS_ENABLED(CONFIG_AT91_ADC)
+static struct at91_adc_data adc_data;
 
-static struct resource tsadcc_resources[] = {
+static struct resource adc_resources[] = {
        [0] = {
                .start  = AT91SAM9RL_BASE_TSC,
                .end    = AT91SAM9RL_BASE_TSC + SZ_16K - 1,
@@ -628,36 +629,71 @@ static struct resource tsadcc_resources[] = {
        }
 };
 
-static struct platform_device at91sam9rl_tsadcc_device = {
-       .name           = "atmel_tsadcc",
-       .id             = -1,
-       .dev            = {
-                               .dma_mask               = &tsadcc_dmamask,
-                               .coherent_dma_mask      = DMA_BIT_MASK(32),
-                               .platform_data          = &tsadcc_data,
+static struct platform_device at91_adc_device = {
+       .name           = "at91sam9rl-adc",
+       .id             = -1,
+       .dev            = {
+               .platform_data  = &adc_data,
        },
-       .resource       = tsadcc_resources,
-       .num_resources  = ARRAY_SIZE(tsadcc_resources),
+       .resource       = adc_resources,
+       .num_resources  = ARRAY_SIZE(adc_resources),
 };
 
-void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data)
+static struct at91_adc_trigger at91_adc_triggers[] = {
+       [0] = {
+               .name = "external-rising",
+               .value = 1,
+               .is_external = true,
+       },
+       [1] = {
+               .name = "external-falling",
+               .value = 2,
+               .is_external = true,
+       },
+       [2] = {
+               .name = "external-any",
+               .value = 3,
+               .is_external = true,
+       },
+       [3] = {
+               .name = "continuous",
+               .value = 6,
+               .is_external = false,
+       },
+};
+
+void __init at91_add_device_adc(struct at91_adc_data *data)
 {
        if (!data)
                return;
 
-       at91_set_A_periph(AT91_PIN_PA17, 0);    /* AD0_XR */
-       at91_set_A_periph(AT91_PIN_PA18, 0);    /* AD1_XL */
-       at91_set_A_periph(AT91_PIN_PA19, 0);    /* AD2_YT */
-       at91_set_A_periph(AT91_PIN_PA20, 0);    /* AD3_TB */
-
-       tsadcc_data = *data;
-       platform_device_register(&at91sam9rl_tsadcc_device);
+       if (test_bit(0, &data->channels_used))
+               at91_set_A_periph(AT91_PIN_PA17, 0);
+       if (test_bit(1, &data->channels_used))
+               at91_set_A_periph(AT91_PIN_PA18, 0);
+       if (test_bit(2, &data->channels_used))
+               at91_set_A_periph(AT91_PIN_PA19, 0);
+       if (test_bit(3, &data->channels_used))
+               at91_set_A_periph(AT91_PIN_PA20, 0);
+       if (test_bit(4, &data->channels_used))
+               at91_set_A_periph(AT91_PIN_PD6, 0);
+       if (test_bit(5, &data->channels_used))
+               at91_set_A_periph(AT91_PIN_PD7, 0);
+
+       if (data->use_external_triggers)
+               at91_set_A_periph(AT91_PIN_PB15, 0);
+
+       data->startup_time = 40;
+       data->trigger_number = 4;
+       data->trigger_list = at91_adc_triggers;
+
+       adc_data = *data;
+       platform_device_register(&at91_adc_device);
 }
 #else
-void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data) {}
+void __init at91_add_device_adc(struct at91_adc_data *data) {}
 #endif
 
-
 /* --------------------------------------------------------------------
  *  RTC
  * -------------------------------------------------------------------- */
index 35ab632bbf68a169f5e2b1671d7ba79506ccffae..3f6dbcc340228dedfecbfc7718c8bfe564a11973 100644 (file)
@@ -39,7 +39,7 @@
 #include "at91_aic.h"
 #include "board.h"
 #include "generic.h"
-
+#include "gpio.h"
 
 static void __init onearm_init_early(void)
 {
index f95e31cda4b33ac1de9101991ea8556167697619..597c649170aa6f0940ac9e4497b29260f829f52d 100644 (file)
@@ -46,6 +46,7 @@
 #include "at91_aic.h"
 #include "board.h"
 #include "generic.h"
+#include "gpio.h"
 
 
 static void __init afeb9260_init_early(void)
index 112e867c4abea764f19cb0470ba253f6e00585d2..a30502c8d3790b89ac80d04b3d12d7290f9e14b7 100644 (file)
@@ -44,6 +44,7 @@
 #include "board.h"
 #include "sam9_smc.h"
 #include "generic.h"
+#include "gpio.h"
 
 
 static void __init cam60_init_early(void)
index 92983050a9bd2bc78e7ec12f5f69045d18777d7a..47313d3ee037e03d341a5253d21784706345dc80 100644 (file)
@@ -39,6 +39,7 @@
 #include "at91_aic.h"
 #include "board.h"
 #include "generic.h"
+#include "gpio.h"
 
 
 static void __init carmeva_init_early(void)
index 008527efdbcf6af4d05b56311e3a9678f486c819..2037f78c84e7c7c4e0eef21f4f050a2a07d3ae0d 100644 (file)
@@ -48,6 +48,7 @@
 #include "board.h"
 #include "sam9_smc.h"
 #include "generic.h"
+#include "gpio.h"
 
 static void __init cpu9krea_init_early(void)
 {
index 42f1353a4bafe5566a9c705640b6e210d18e43ac..c094350c93142d2d72ef63771a4bec9474ae3f64 100644 (file)
@@ -43,6 +43,8 @@
 #include "at91_aic.h"
 #include "board.h"
 #include "generic.h"
+#include "gpio.h"
+
 
 static struct gpio_led cpuat91_leds[] = {
        {
index e5fde215225b2d245dbe419cab59cf8cfdd8210b..0e35a45cf8d44ee1b4705e7cf9b915e78a6ba6f2 100644 (file)
@@ -42,7 +42,7 @@
 #include "at91_aic.h"
 #include "board.h"
 #include "generic.h"
-
+#include "gpio.h"
 
 static void __init csb337_init_early(void)
 {
index fdf11061c577585d15297ff12595ba65888e9e10..18d027f529a882982ed691b5b94aac2a21020aee 100644 (file)
@@ -39,6 +39,7 @@
 #include "at91_aic.h"
 #include "board.h"
 #include "generic.h"
+#include "gpio.h"
 
 
 static void __init csb637_init_early(void)
index f9be8161bbfafab9ace4dcfc5e74978c06f8a2c8..aa457a8b22f5c197f15090468cb123092cc41e6e 100644 (file)
@@ -38,6 +38,7 @@
 #include "at91_aic.h"
 #include "board.h"
 #include "generic.h"
+#include "gpio.h"
 
 
 static void __init eb9200_init_early(void)
index b2fcd71262ba2c8c7e4ed72e8913b66e35b09a16..ede1373ccabaeb05dda7e985be53818fdf0f20aa 100644 (file)
@@ -42,6 +42,7 @@
 #include "at91_aic.h"
 #include "board.h"
 #include "generic.h"
+#include "gpio.h"
 
 
 static void __init ecb_at91init_early(void)
index 77de410efc90a94a5f2ba20eb68f28d9b88699ce..4e75321a8f2a4072d1da9da86590dd7718a40780 100644 (file)
@@ -31,6 +31,8 @@
 #include "at91_aic.h"
 #include "board.h"
 #include "generic.h"
+#include "gpio.h"
+
 
 static void __init eco920_init_early(void)
 {
index 737c08563628ef40ce68020b8f2f9d56ba8e918a..68f1ab6bd08f499dc7e9a5366071024d14685150 100644 (file)
@@ -37,6 +37,7 @@
 #include "at91_aic.h"
 #include "board.h"
 #include "generic.h"
+#include "gpio.h"
 
 static void __init flexibity_init_early(void)
 {
index c20a870ea9c9295e01eda9842650a3aa593533fd..8b22c60bb2384546b8019268a3179ad8ae57944e 100644 (file)
@@ -47,6 +47,7 @@
 #include "board.h"
 #include "sam9_smc.h"
 #include "generic.h"
+#include "gpio.h"
 
 /*
  * The FOX Board G20 hardware comes as the "Netus G20" board with
index 416bae8435eeaaeb526eb79bf363cfc5fccb764b..b729dd1271bfbb2210e0e564a11cbbfbfd73e6fe 100644 (file)
@@ -39,6 +39,7 @@
 #include "generic.h"
 #include "gsia18s.h"
 #include "stamp9g20.h"
+#include "gpio.h"
 
 static void __init gsia18s_init_early(void)
 {
index 88e2f5d2d16dfca5e301c6ef826019a3786e8c6c..93b1df42f639c3032b43b322fda870edcdc0c022 100644 (file)
@@ -39,6 +39,7 @@
 #include "at91_aic.h"
 #include "board.h"
 #include "generic.h"
+#include "gpio.h"
 
 
 static void __init kafa_init_early(void)
index 0c519d9ebffc578c7c740ce7b8d440699648a5a0..d58d36225e080048e4c527b20adf6cb91a008db8 100644 (file)
@@ -42,6 +42,7 @@
 #include "at91_aic.h"
 #include "board.h"
 #include "generic.h"
+#include "gpio.h"
 
 
 static void __init kb9202_init_early(void)
index 5f25fa54eb93e9887bea2bced02521941c53a63c..b48d95ec5152954d26e9485c0a5e1f97977a1d5f 100644 (file)
@@ -37,6 +37,7 @@
 #include "sam9_smc.h"
 #include "generic.h"
 #include "stamp9g20.h"
+#include "gpio.h"
 
 
 static void __init pcontrol_g20_init_early(void)
index ab2b2ec36c14a965bbb67aa31717c9adbe92882f..2c0f2d554d8466fdbb42a982da680ac15ab805fb 100644 (file)
@@ -43,6 +43,7 @@
 #include "at91_aic.h"
 #include "board.h"
 #include "generic.h"
+#include "gpio.h"
 
 
 static void __init picotux200_init_early(void)
index 8b17dadc1aba23766c954614fadf894c1dc8ec9d..953cea416754f9d593dfb4c233d79983319a55ad 100644 (file)
@@ -45,6 +45,7 @@
 #include "at91_aic.h"
 #include "board.h"
 #include "generic.h"
+#include "gpio.h"
 
 
 static void __init ek_init_early(void)
index f6d7f1958c7e5822661ac6517f48aa4de21a7247..f28e8b74df4b2fb2512e1d97425ac4a85e31d2a0 100644 (file)
@@ -31,6 +31,7 @@
 #include "at91_aic.h"
 #include "board.h"
 #include "generic.h"
+#include "gpio.h"
 
 static void __init rsi_ews_init_early(void)
 {
index 43ee4dc43b50f8851a423721315a3a7f22b8091d..d24dda67e2d343c49259b654c3d2d8d5266759aa 100644 (file)
@@ -43,6 +43,7 @@
 #include "board.h"
 #include "sam9_smc.h"
 #include "generic.h"
+#include "gpio.h"
 
 
 static void __init ek_init_early(void)
index f4f8735315dafd8247f686e756423d8b9608a013..65dea12d685ef98ef32e04aade12bf1f2be0d9b5 100644 (file)
@@ -49,6 +49,7 @@
 #include "board.h"
 #include "sam9_smc.h"
 #include "generic.h"
+#include "gpio.h"
 
 
 static void __init ek_init_early(void)
index 473546b9408bf087a6b1a38950a9cf2157b3497f..4637432de08f32486e0345b71bc15af121e69d95 100644 (file)
@@ -53,6 +53,7 @@
 #include "board.h"
 #include "sam9_smc.h"
 #include "generic.h"
+#include "gpio.h"
 
 
 static void __init ek_init_early(void)
index 2f931915c80c8d2f9a6c9059cf2e6eb07d2093a7..cd2726ee5addc96c52fdf6f443aba0c6b425e080 100644 (file)
@@ -52,6 +52,7 @@
 #include "board.h"
 #include "sam9_smc.h"
 #include "generic.h"
+#include "gpio.h"
 
 
 static void __init ek_init_early(void)
index f9cd1f2c71469f6ee3809981c643aaebdd439d7b..e1be6e25b380aab2e002f3b80352be164b637877 100644 (file)
@@ -50,6 +50,7 @@
 #include "board.h"
 #include "sam9_smc.h"
 #include "generic.h"
+#include "gpio.h"
 
 /*
  * board revision encoding
index ef39078c8ce214973352a22055421d7404cb4952..1ea61328f30dc19feddf682197f2d853174ee7fc 100644 (file)
@@ -50,6 +50,7 @@
 #include "board.h"
 #include "sam9_smc.h"
 #include "generic.h"
+#include "gpio.h"
 
 
 static void __init ek_init_early(void)
@@ -300,21 +301,13 @@ static struct atmel_lcdfb_pdata __initdata ek_lcdc_data;
 
 
 /*
- * Touchscreen
- */
-static struct at91_tsadcc_data ek_tsadcc_data = {
-       .adc_clock              = 300000,
-       .pendet_debounce        = 0x0d,
-       .ts_sample_hold_time    = 0x0a,
-};
-
-/*
- * ADCs
+ * ADCs and touchscreen
  */
 static struct at91_adc_data ek_adc_data = {
        .channels_used = BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(4) | BIT(5) | BIT(6) | BIT(7),
        .use_external_triggers = true,
        .vref = 3300,
+       .touchscreen_type = ATMEL_ADC_TOUCHSCREEN_4WIRE,
 };
 
 /*
@@ -485,9 +478,7 @@ static void __init ek_board_init(void)
        at91_add_device_isi(&isi_data, true);
        /* LCD Controller */
        at91_add_device_lcdc(&ek_lcdc_data);
-       /* Touch Screen */
-       at91_add_device_tsadcc(&ek_tsadcc_data);
-       /* ADC */
+       /* ADC and touchscreen */
        at91_add_device_adc(&ek_adc_data);
        /* Push Buttons */
        ek_add_device_buttons();
index 604eecf6cd70d03b57c34e6a2736f9feceb5be98..b64648b4a1fc9a8720d0b3f45495b08240beba48 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/clk.h>
 #include <linux/input.h>
 #include <linux/gpio_keys.h>
+#include <linux/platform_data/at91_adc.h>
 
 #include <video/atmel_lcdc.h>
 
@@ -38,6 +39,7 @@
 #include "board.h"
 #include "sam9_smc.h"
 #include "generic.h"
+#include "gpio.h"
 
 
 static void __init ek_init_early(void)
@@ -229,12 +231,13 @@ static struct gpio_led ek_leds[] = {
 
 
 /*
- * Touchscreen
+ * ADC + Touchscreen
  */
-static struct at91_tsadcc_data ek_tsadcc_data = {
-       .adc_clock              = 1000000,
-       .pendet_debounce        = 0x0f,
-       .ts_sample_hold_time    = 0x03,
+static struct at91_adc_data ek_adc_data = {
+       .channels_used = BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(4) | BIT(5),
+       .use_external_triggers = true,
+       .vref = 3300,
+       .touchscreen_type = ATMEL_ADC_TOUCHSCREEN_4WIRE,
 };
 
 
@@ -310,8 +313,8 @@ static void __init ek_board_init(void)
        at91_add_device_lcdc(&ek_lcdc_data);
        /* AC97 */
        at91_add_device_ac97(&ek_ac97_data);
-       /* Touch Screen Controller */
-       at91_add_device_tsadcc(&ek_tsadcc_data);
+       /* Touch Screen Controller + ADC */
+       at91_add_device_adc(&ek_adc_data);
        /* LEDs */
        at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
        /* Push Buttons */
index f1d49e929ccbb039594b7f3b27cb332232fd403a..1b870e6def0cf54b5ea692e5e244a7d69a187b61 100644 (file)
@@ -38,6 +38,7 @@
 #include "board.h"
 #include "sam9_smc.h"
 #include "generic.h"
+#include "gpio.h"
 
 #define SNAPPER9260_IO_EXP_GPIO(x)     (NR_BUILTIN_GPIO + (x))
 
index e4a5ac17cdbcb79c020635431ba1ebdf7057c062..3b575036ff961ce73d3e657b1f289a4962993556 100644 (file)
@@ -32,6 +32,7 @@
 #include "board.h"
 #include "sam9_smc.h"
 #include "generic.h"
+#include "gpio.h"
 
 
 void __init stamp9g20_init_early(void)
index be083771df2e813ba055aa05237bb56aa99d4d86..46fdb0c68a68063f51fd3bff7d8039bce9e90758 100644 (file)
@@ -50,6 +50,7 @@
 #include "at91_aic.h"
 #include "board.h"
 #include "generic.h"
+#include "gpio.h"
 
 
 static void __init yl9200_init_early(void)
index 6c08b341167d308df456eb1a0e79b4f10b5a9e00..4e773b55bc2d4625fb41641a77895522d6a38d9b 100644 (file)
@@ -118,9 +118,6 @@ struct isi_platform_data;
 extern void __init at91_add_device_isi(struct isi_platform_data *data,
                bool use_pck_as_mck);
 
- /* Touchscreen Controller */
-extern void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data);
-
 /* CAN */
 extern void __init at91_add_device_can(struct at91_can_data *data);
 
index a5afcf76550e3d592f1e7eaf8024327cb6716de3..12ed05bbdc5c7a6ba57cd466c0879b3cde49149f 100644 (file)
@@ -29,6 +29,7 @@
 #include <mach/at91_pio.h>
 
 #include "generic.h"
+#include "gpio.h"
 
 #define MAX_NB_GPIO_PER_BANK   32
 
similarity index 96%
rename from arch/arm/mach-at91/include/mach/gpio.h
rename to arch/arm/mach-at91/gpio.h
index 5fc23771c15455a4874211ba49ae2b012ffe6566..eed465ab0dd7d14c589880f4a242ce74138e7030 100644 (file)
@@ -209,14 +209,6 @@ extern int at91_get_gpio_value(unsigned pin);
 extern void at91_gpio_suspend(void);
 extern void at91_gpio_resume(void);
 
-#ifdef CONFIG_PINCTRL_AT91
-extern void at91_pinctrl_gpio_suspend(void);
-extern void at91_pinctrl_gpio_resume(void);
-#else
-static inline void at91_pinctrl_gpio_suspend(void) {}
-static inline void at91_pinctrl_gpio_resume(void) {}
-#endif
-
 #endif /* __ASSEMBLY__ */
 
 #endif
diff --git a/arch/arm/mach-at91/include/mach/at91_adc.h b/arch/arm/mach-at91/include/mach/at91_adc.h
deleted file mode 100644 (file)
index c287307..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * arch/arm/mach-at91/include/mach/at91_adc.h
- *
- * Copyright (C) SAN People
- *
- * Analog-to-Digital Converter (ADC) registers.
- * Based on AT91SAM9260 datasheet revision D.
- *
- * 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.
- */
-
-#ifndef AT91_ADC_H
-#define AT91_ADC_H
-
-#define AT91_ADC_CR            0x00            /* Control Register */
-#define                AT91_ADC_SWRST          (1 << 0)        /* Software Reset */
-#define                AT91_ADC_START          (1 << 1)        /* Start Conversion */
-
-#define AT91_ADC_MR            0x04            /* Mode Register */
-#define                AT91_ADC_TRGEN          (1 << 0)        /* Trigger Enable */
-#define                AT91_ADC_TRGSEL         (7 << 1)        /* Trigger Selection */
-#define                        AT91_ADC_TRGSEL_TC0             (0 << 1)
-#define                        AT91_ADC_TRGSEL_TC1             (1 << 1)
-#define                        AT91_ADC_TRGSEL_TC2             (2 << 1)
-#define                        AT91_ADC_TRGSEL_EXTERNAL        (6 << 1)
-#define                AT91_ADC_LOWRES         (1 << 4)        /* Low Resolution */
-#define                AT91_ADC_SLEEP          (1 << 5)        /* Sleep Mode */
-#define                AT91_ADC_PRESCAL_9260   (0x3f << 8)     /* Prescalar Rate Selection */
-#define                AT91_ADC_PRESCAL_9G45   (0xff << 8)
-#define                        AT91_ADC_PRESCAL_(x)    ((x) << 8)
-#define                AT91_ADC_STARTUP_9260   (0x1f << 16)    /* Startup Up Time */
-#define                AT91_ADC_STARTUP_9G45   (0x7f << 16)
-#define                AT91_ADC_STARTUP_9X5    (0xf << 16)
-#define                        AT91_ADC_STARTUP_(x)    ((x) << 16)
-#define                AT91_ADC_SHTIM          (0xf  << 24)    /* Sample & Hold Time */
-#define                        AT91_ADC_SHTIM_(x)      ((x) << 24)
-
-#define AT91_ADC_CHER          0x10            /* Channel Enable Register */
-#define AT91_ADC_CHDR          0x14            /* Channel Disable Register */
-#define AT91_ADC_CHSR          0x18            /* Channel Status Register */
-#define                AT91_ADC_CH(n)          (1 << (n))      /* Channel Number */
-
-#define AT91_ADC_SR            0x1C            /* Status Register */
-#define                AT91_ADC_EOC(n)         (1 << (n))      /* End of Conversion on Channel N */
-#define                AT91_ADC_OVRE(n)        (1 << ((n) + 8))/* Overrun Error on Channel N */
-#define                AT91_ADC_DRDY           (1 << 16)       /* Data Ready */
-#define                AT91_ADC_GOVRE          (1 << 17)       /* General Overrun Error */
-#define                AT91_ADC_ENDRX          (1 << 18)       /* End of RX Buffer */
-#define                AT91_ADC_RXFUFF         (1 << 19)       /* RX Buffer Full */
-
-#define AT91_ADC_SR_9X5                0x30            /* Status Register for 9x5 */
-#define                AT91_ADC_SR_DRDY_9X5    (1 << 24)       /* Data Ready */
-
-#define AT91_ADC_LCDR          0x20            /* Last Converted Data Register */
-#define                AT91_ADC_LDATA          (0x3ff)
-
-#define AT91_ADC_IER           0x24            /* Interrupt Enable Register */
-#define AT91_ADC_IDR           0x28            /* Interrupt Disable Register */
-#define AT91_ADC_IMR           0x2C            /* Interrupt Mask Register */
-#define                AT91_ADC_IER_PEN        (1 << 29)
-#define                AT91_ADC_IER_NOPEN      (1 << 30)
-#define                AT91_ADC_IER_XRDY       (1 << 20)
-#define                AT91_ADC_IER_YRDY       (1 << 21)
-#define                AT91_ADC_IER_PRDY       (1 << 22)
-#define                AT91_ADC_ISR_PENS       (1 << 31)
-
-#define AT91_ADC_CHR(n)                (0x30 + ((n) * 4))      /* Channel Data Register N */
-#define                AT91_ADC_DATA           (0x3ff)
-
-#define AT91_ADC_CDR0_9X5      (0x50)                  /* Channel Data Register 0 for 9X5 */
-
-#define AT91_ADC_ACR           0x94    /* Analog Control Register */
-#define                AT91_ADC_ACR_PENDETSENS (0x3 << 0)      /* pull-up resistor */
-
-#define AT91_ADC_TSMR          0xB0
-#define                AT91_ADC_TSMR_TSMODE    (3 << 0)        /* Touch Screen Mode */
-#define                        AT91_ADC_TSMR_TSMODE_NONE               (0 << 0)
-#define                        AT91_ADC_TSMR_TSMODE_4WIRE_NO_PRESS     (1 << 0)
-#define                        AT91_ADC_TSMR_TSMODE_4WIRE_PRESS        (2 << 0)
-#define                        AT91_ADC_TSMR_TSMODE_5WIRE              (3 << 0)
-#define                AT91_ADC_TSMR_TSAV      (3 << 4)        /* Averages samples */
-#define                        AT91_ADC_TSMR_TSAV_(x)          ((x) << 4)
-#define                AT91_ADC_TSMR_SCTIM     (0x0f << 16)    /* Switch closure time */
-#define                AT91_ADC_TSMR_PENDBC    (0x0f << 28)    /* Pen Debounce time */
-#define                        AT91_ADC_TSMR_PENDBC_(x)        ((x) << 28)
-#define                AT91_ADC_TSMR_NOTSDMA   (1 << 22)       /* No Touchscreen DMA */
-#define                AT91_ADC_TSMR_PENDET_DIS        (0 << 24)       /* Pen contact detection disable */
-#define                AT91_ADC_TSMR_PENDET_ENA        (1 << 24)       /* Pen contact detection enable */
-
-#define AT91_ADC_TSXPOSR       0xB4
-#define AT91_ADC_TSYPOSR       0xB8
-#define AT91_ADC_TSPRESSR      0xBC
-
-#define AT91_ADC_TRGR_9260     AT91_ADC_MR
-#define AT91_ADC_TRGR_9G45     0x08
-#define AT91_ADC_TRGR_9X5      0xC0
-
-/* Trigger Register bit field */
-#define                AT91_ADC_TRGR_TRGPER    (0xffff << 16)
-#define                        AT91_ADC_TRGR_TRGPER_(x)        ((x) << 16)
-#define                AT91_ADC_TRGR_TRGMOD    (0x7 << 0)
-#define                        AT91_ADC_TRGR_MOD_PERIOD_TRIG   (5 << 0)
-
-#endif
index f17aa3150019bfe3e16ed1fa67e48a434f9c12ae..56338245653aea10f094ec765f0d9afdb99ae580 100644 (file)
 /* Clocks */
 #define AT91_SLOW_CLOCK                32768           /* slow clock */
 
+/*
+ * FIXME: this is needed to communicate between the pinctrl driver and
+ * the PM implementation in the machine. Possibly part of the PM
+ * implementation should be moved down into the pinctrl driver and get
+ * called as part of the generic suspend/resume path.
+ */
+#ifndef __ASSEMBLY__
+#ifdef CONFIG_PINCTRL_AT91
+extern void at91_pinctrl_gpio_suspend(void);
+extern void at91_pinctrl_gpio_resume(void);
+#else
+static inline void at91_pinctrl_gpio_suspend(void) {}
+static inline void at91_pinctrl_gpio_resume(void) {}
+#endif
+#endif
 
 #endif
index 3e22978b5547a0eb80638a9f495f970e5da4d10e..77c4d8fd03fd56c0ee04ad1b64212f56f83fe015 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/platform_device.h>
 
 #include "board.h"
+#include "gpio.h"
 
 
 /* ------------------------------------------------------------------------- */
index 8bda1cefdf96ad500f84641cbcb8fa300c3b13df..e95554532987e431ae509d47aa8f4f0dc70833e6 100644 (file)
@@ -32,6 +32,7 @@
 #include "at91_aic.h"
 #include "generic.h"
 #include "pm.h"
+#include "gpio.h"
 
 /*
  * Show the reason for the previous system reset.
index 49c914cd9c7a9c83159475a33c4a4a9961b7f4a9..9f19636fea2f656392c84fdff74f08e909db14ca 100644 (file)
@@ -11,7 +11,6 @@ menu "Broadcom SoC Selection"
 
 config ARCH_BCM_MOBILE
        bool "Broadcom Mobile SoC" if ARCH_MULTI_V7
-       depends on MMU
        select ARCH_REQUIRE_GPIOLIB
        select ARM_ERRATA_754322
        select ARM_ERRATA_764369 if SMP
@@ -33,10 +32,7 @@ config ARCH_BCM2835
        select ARM_AMBA
        select ARM_ERRATA_411920
        select ARM_TIMER_SP804
-       select CLKDEV_LOOKUP
        select CLKSRC_OF
-       select CPU_V6
-       select GENERIC_CLOCKEVENTS
        select PINCTRL
        select PINCTRL_BCM2835
        help
@@ -45,14 +41,10 @@ config ARCH_BCM2835
 
 config ARCH_BCM_5301X
        bool "Broadcom BCM470X / BCM5301X ARM SoC" if ARCH_MULTI_V7
-       depends on MMU
        select ARM_GIC
        select CACHE_L2X0
        select HAVE_ARM_SCU if SMP
        select HAVE_ARM_TWD if SMP
-       select HAVE_SMP
-       select COMMON_CLK
-       select GENERIC_CLOCKEVENTS
        select ARM_GLOBAL_TIMER
        select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK
        select MIGHT_HAVE_PCI
index bc4344aa10092dc8568ed8fe3890073e22147b53..4a5a7aedcb763e9673dd8d51b416c6f1024e3310 100644 (file)
@@ -108,6 +108,38 @@ static int __initdata gpio2_irqs[4] = {
        0,
 };
 
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+/*
+ * Compiling with both non-DT and DT support enabled, will
+ * break asm irq handler used by non-DT boards. Therefore,
+ * we provide a C-style irq handler even for non-DT boards,
+ * if MULTI_IRQ_HANDLER is set.
+ */
+
+static void __iomem *dove_irq_base = IRQ_VIRT_BASE;
+
+static asmlinkage void
+__exception_irq_entry dove_legacy_handle_irq(struct pt_regs *regs)
+{
+       u32 stat;
+
+       stat = readl_relaxed(dove_irq_base + IRQ_CAUSE_LOW_OFF);
+       stat &= readl_relaxed(dove_irq_base + IRQ_MASK_LOW_OFF);
+       if (stat) {
+               unsigned int hwirq = __fls(stat);
+               handle_IRQ(hwirq, regs);
+               return;
+       }
+       stat = readl_relaxed(dove_irq_base + IRQ_CAUSE_HIGH_OFF);
+       stat &= readl_relaxed(dove_irq_base + IRQ_MASK_HIGH_OFF);
+       if (stat) {
+               unsigned int hwirq = 32 + __fls(stat);
+               handle_IRQ(hwirq, regs);
+               return;
+       }
+}
+#endif
+
 void __init dove_init_irq(void)
 {
        int i;
@@ -115,6 +147,10 @@ void __init dove_init_irq(void)
        orion_irq_init(0, IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF);
        orion_irq_init(32, IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF);
 
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+       set_handle_irq(dove_legacy_handle_irq);
+#endif
+
        /*
         * Initialize gpiolib for GPIOs 0-71.
         */
index 932129ef26c66054a2bdeecaef9c0af1a9bba788..aa01c4222b40334db58a603cbcbee82f5f671d6b 100644 (file)
@@ -18,6 +18,8 @@
 
 #include <mach/map.h>
 
+#include <plat/cpu.h>
+
 #include "smc.h"
 
 static int exynos_do_idle(void)
@@ -28,13 +30,24 @@ static int exynos_do_idle(void)
 
 static int exynos_cpu_boot(int cpu)
 {
+       /*
+        * The second parameter of SMC_CMD_CPU1BOOT command means CPU id.
+        * But, Exynos4212 has only one secondary CPU so second parameter
+        * isn't used for informing secure firmware about CPU id.
+        */
+       if (soc_is_exynos4212())
+               cpu = 0;
+
        exynos_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0);
        return 0;
 }
 
 static int exynos_set_cpu_boot_addr(int cpu, unsigned long boot_addr)
 {
-       void __iomem *boot_reg = S5P_VA_SYSRAM_NS + 0x1c + 4*cpu;
+       void __iomem *boot_reg = S5P_VA_SYSRAM_NS + 0x1c;
+
+       if (!soc_is_exynos4212())
+               boot_reg += 4*cpu;
 
        __raw_writel(boot_addr, boot_reg);
        return 0;
index 2801da49e2a36bfea53cf1fd5a084c51dbac42a6..ff18ff20f71fe4b1f41e4fc032342f6be9c4a7f5 100644 (file)
@@ -195,7 +195,7 @@ static void __init kirkwood_dt_init(void)
 {
        kirkwood_disable_mbus_error_propagation();
 
-       BUG_ON(mvebu_mbus_dt_init());
+       BUG_ON(mvebu_mbus_dt_init(false));
 
 #ifdef CONFIG_CACHE_FEROCEON_L2
        feroceon_of_init();
index 2a97a2e4163cdf9593276159756ade03833ac028..2c47a8ad0e27fbffad7b1217ac1047e2125e8213 100644 (file)
@@ -7,6 +7,7 @@
  * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
+#include <asm/exception.h>
 #include <linux/gpio.h>
 #include <linux/kernel.h>
 #include <linux/irq.h>
@@ -30,11 +31,47 @@ static int __initdata gpio1_irqs[4] = {
        0,
 };
 
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+/*
+ * Compiling with both non-DT and DT support enabled, will
+ * break asm irq handler used by non-DT boards. Therefore,
+ * we provide a C-style irq handler even for non-DT boards,
+ * if MULTI_IRQ_HANDLER is set.
+ */
+
+static void __iomem *kirkwood_irq_base = IRQ_VIRT_BASE;
+
+asmlinkage void
+__exception_irq_entry kirkwood_legacy_handle_irq(struct pt_regs *regs)
+{
+       u32 stat;
+
+       stat = readl_relaxed(kirkwood_irq_base + IRQ_CAUSE_LOW_OFF);
+       stat &= readl_relaxed(kirkwood_irq_base + IRQ_MASK_LOW_OFF);
+       if (stat) {
+               unsigned int hwirq = __fls(stat);
+               handle_IRQ(hwirq, regs);
+               return;
+       }
+       stat = readl_relaxed(kirkwood_irq_base + IRQ_CAUSE_HIGH_OFF);
+       stat &= readl_relaxed(kirkwood_irq_base + IRQ_MASK_HIGH_OFF);
+       if (stat) {
+               unsigned int hwirq = 32 + __fls(stat);
+               handle_IRQ(hwirq, regs);
+               return;
+       }
+}
+#endif
+
 void __init kirkwood_init_irq(void)
 {
        orion_irq_init(0, IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF);
        orion_irq_init(32, IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF);
 
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+       set_handle_irq(kirkwood_legacy_handle_irq);
+#endif
+
        /*
         * Initialize gpiolib for GPIOs 0-49.
         */
index 3f73eecbcfb033d3370ad41642f7fe95b9d948b9..199187e474ce524600922a4d46fd5c41a537711d 100644 (file)
@@ -3,15 +3,14 @@ config ARCH_MVEBU
        select ARCH_SUPPORTS_BIG_ENDIAN
        select CLKSRC_MMIO
        select GENERIC_IRQ_CHIP
-       select IRQ_DOMAIN
        select PINCTRL
        select PLAT_ORION
+       select SOC_BUS
        select MVEBU_MBUS
        select ZONE_DMA if ARM_LPAE
        select ARCH_REQUIRE_GPIOLIB
        select MIGHT_HAVE_PCI
        select PCI_QUIRKS if PCI
-       select OF_ADDRESS_PCI
 
 if ARCH_MVEBU
 
@@ -38,7 +37,9 @@ config MACH_ARMADA_375
        select ARM_ERRATA_753970
        select ARM_GIC
        select ARMADA_375_CLK
-       select CPU_V7
+       select HAVE_ARM_SCU
+       select HAVE_ARM_TWD if SMP
+       select HAVE_SMP
        select MACH_MVEBU_V7
        select PINCTRL_ARMADA_375
        help
@@ -51,7 +52,9 @@ config MACH_ARMADA_38X
        select ARM_ERRATA_753970
        select ARM_GIC
        select ARMADA_38X_CLK
-       select CPU_V7
+       select HAVE_ARM_SCU
+       select HAVE_ARM_TWD if SMP
+       select HAVE_SMP
        select MACH_MVEBU_V7
        select PINCTRL_ARMADA_38X
        help
@@ -86,24 +89,15 @@ config MACH_KIRKWOOD
        select ARCH_REQUIRE_GPIOLIB
        select CPU_FEROCEON
        select KIRKWOOD_CLK
-       select OF_IRQ
        select ORION_IRQCHIP
        select ORION_TIMER
        select PCI
        select PCI_QUIRKS
        select PINCTRL_KIRKWOOD
-       select USE_OF
        help
          Say 'Y' here if you want your kernel to support boards based
          on the Marvell Kirkwood device tree.
 
-config MACH_T5325
-       bool "HP T5325 thin client"
-       depends on MACH_KIRKWOOD
-       help
-         Say 'Y' here if you want your kernel to support the
-         HP T5325 Thin client
-
 endmenu
 
 endif
index a63e43b6b451e24c1aba904006f9d5a3c636a47d..2ecb828e4a8bd223ef086a3787cd7980f557ab78 100644 (file)
@@ -2,12 +2,15 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \
        -I$(srctree)/arch/arm/plat-orion/include
 
 AFLAGS_coherency_ll.o          := -Wa,-march=armv7-a
+CFLAGS_pmsu.o                  := -march=armv7-a
 
 obj-y                           += system-controller.o mvebu-soc-id.o
-obj-$(CONFIG_MACH_MVEBU_V7)      += board-v7.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_ARCH_MVEBU)        += coherency.o coherency_ll.o pmsu.o
-obj-$(CONFIG_SMP)                += platsmp.o headsmp.o
-obj-$(CONFIG_HOTPLUG_CPU)        += hotplug.o
 obj-$(CONFIG_MACH_KIRKWOOD)     += kirkwood.o kirkwood-pm.o
-obj-$(CONFIG_MACH_T5325)        += board-t5325.o
index 237c86b83390178a069f22971c960766bdaa22f2..c3465f5b12500fb74e6975ce46c9a8a34c1871f3 100644 (file)
@@ -20,8 +20,6 @@
 
 #define ARMADA_XP_MAX_CPUS 4
 
-void armada_mpic_send_doorbell(const struct cpumask *mask, unsigned int irq);
-void armada_xp_mpic_smp_cpu_init(void);
 void armada_xp_secondary_startup(void);
 extern struct smp_operations armada_xp_smp_ops;
 #endif
diff --git a/arch/arm/mach-mvebu/board-t5325.c b/arch/arm/mach-mvebu/board-t5325.c
deleted file mode 100644 (file)
index 65ace6d..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * HP T5325 Board Setup
- *
- * Copyright (C) 2014
- *
- * Andrew Lunn <andrew@lunn.ch>
- *
- * 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/i2c.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <sound/alc5623.h>
-#include "board.h"
-
-static struct platform_device hp_t5325_audio_device = {
-       .name           = "t5325-audio",
-       .id             = -1,
-};
-
-static struct alc5623_platform_data alc5621_data = {
-       .add_ctrl = 0x3700,
-       .jack_det_ctrl = 0x4810,
-};
-
-static struct i2c_board_info i2c_board_info[] __initdata = {
-       {
-               I2C_BOARD_INFO("alc5621", 0x1a),
-               .platform_data = &alc5621_data,
-       },
-};
-
-void __init t5325_init(void)
-{
-       i2c_register_board_info(0, i2c_board_info, ARRAY_SIZE(i2c_board_info));
-       platform_device_register(&hp_t5325_audio_device);
-}
index 333fca8fdc41c2cf667a849b7461bd8fb2c9baac..01cfce6ac20b9512fe38d9c59d9164d99e86d20e 100644 (file)
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
+#include <asm/smp_scu.h>
 #include "armada-370-xp.h"
 #include "common.h"
 #include "coherency.h"
 #include "mvebu-soc-id.h"
 
+/*
+ * Enables the SCU when available. Obviously, this is only useful on
+ * Cortex-A based SOCs, not on PJ4B based ones.
+ */
+static void __init mvebu_scu_enable(void)
+{
+       void __iomem *scu_base;
+
+       struct device_node *np =
+               of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu");
+       if (np) {
+               scu_base = of_iomap(np, 0);
+               scu_enable(scu_base);
+               of_node_put(np);
+       }
+}
+
 /*
  * Early versions of Armada 375 SoC have a bug where the BootROM
  * leaves an external data abort pending. The kernel is hit by this
@@ -57,11 +75,10 @@ static void __init mvebu_timer_and_clk_init(void)
 {
        of_clk_init(NULL);
        clocksource_of_init();
+       mvebu_scu_enable();
        coherency_init();
-       BUG_ON(mvebu_mbus_dt_init());
-#ifdef CONFIG_CACHE_L2X0
+       BUG_ON(mvebu_mbus_dt_init(coherency_available()));
        l2x0_of_init(0, ~0UL);
-#endif
 
        if (of_machine_is_compatible("marvell,armada375"))
                hook_fault_code(16 + 6, armada_375_external_abort_wa, SIGBUS, 0,
@@ -78,7 +95,7 @@ static void __init i2c_quirk(void)
         * mechanism. We can exit only if we are sure that we can
         * get the SoC revision and it is more recent than A0.
         */
-       if (mvebu_get_soc_id(&rev, &dev) == 0 && dev > MV78XX0_A0_REV)
+       if (mvebu_get_soc_id(&dev, &rev) == 0 && rev > MV78XX0_A0_REV)
                return;
 
        for_each_compatible_node(np, NULL, "marvell,mv78230-i2c") {
@@ -96,10 +113,66 @@ static void __init i2c_quirk(void)
        return;
 }
 
+#define A375_Z1_THERMAL_FIXUP_OFFSET 0xc
+
+static void __init thermal_quirk(void)
+{
+       struct device_node *np;
+       u32 dev, rev;
+
+       if (mvebu_get_soc_id(&dev, &rev) == 0 && rev > ARMADA_375_Z1_REV)
+               return;
+
+       for_each_compatible_node(np, NULL, "marvell,armada375-thermal") {
+               struct property *prop;
+               __be32 newval, *newprop, *oldprop;
+               int len;
+
+               /*
+                * The register offset is at a wrong location. This quirk
+                * creates a new reg property as a clone of the previous
+                * one and corrects the offset.
+                */
+               oldprop = (__be32 *)of_get_property(np, "reg", &len);
+               if (!oldprop)
+                       continue;
+
+               /* Create a duplicate of the 'reg' property */
+               prop = kzalloc(sizeof(*prop), GFP_KERNEL);
+               prop->length = len;
+               prop->name = kstrdup("reg", GFP_KERNEL);
+               prop->value = kzalloc(len, GFP_KERNEL);
+               memcpy(prop->value, oldprop, len);
+
+               /* Fixup the register offset of the second entry */
+               oldprop += 2;
+               newprop = (__be32 *)prop->value + 2;
+               newval = cpu_to_be32(be32_to_cpu(*oldprop) -
+                                    A375_Z1_THERMAL_FIXUP_OFFSET);
+               *newprop = newval;
+               of_update_property(np, prop);
+
+               /*
+                * The thermal controller needs some quirk too, so let's change
+                * the compatible string to reflect this.
+                */
+               prop = kzalloc(sizeof(*prop), GFP_KERNEL);
+               prop->name = kstrdup("compatible", GFP_KERNEL);
+               prop->length = sizeof("marvell,armada375-z1-thermal");
+               prop->value = kstrdup("marvell,armada375-z1-thermal",
+                                               GFP_KERNEL);
+               of_update_property(np, prop);
+       }
+       return;
+}
+
 static void __init mvebu_dt_init(void)
 {
        if (of_machine_is_compatible("plathome,openblocks-ax3-4"))
                i2c_quirk();
+       if (of_machine_is_compatible("marvell,a375-db"))
+               thermal_quirk();
+
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
@@ -123,6 +196,7 @@ static const char * const armada_375_dt_compat[] = {
 
 DT_MACHINE_START(ARMADA_375_DT, "Marvell Armada 375 (Device Tree)")
        .init_time      = mvebu_timer_and_clk_init,
+       .init_machine   = mvebu_dt_init,
        .restart        = mvebu_restart,
        .dt_compat      = armada_375_dt_compat,
 MACHINE_END
index de7f0a191394d744e8801632ee057cd754880155..9c7bb4386f8bc92574a0723ebd7ea303e9028201 100644 (file)
 #ifndef __ARCH_MVEBU_BOARD_H
 #define __ARCH_MVEBU_BOARD_H
 
-#ifdef CONFIG_MACH_T5325
-void t5325_init(void);
-#else
-static inline void t5325_init(void) {};
-#endif
-
 #endif
index 4e9d58148ca7e3031cbbdaa5dba2bb5aa0607619..d5a975b6a590aa939a4b2d3864faeaa51ef584b0 100644 (file)
@@ -17,6 +17,8 @@
  * supplies basic routines for configuring and controlling hardware coherency
  */
 
+#define pr_fmt(fmt) "mvebu-coherency: " fmt
+
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/of_address.h>
 #include <linux/smp.h>
 #include <linux/dma-mapping.h>
 #include <linux/platform_device.h>
+#include <linux/slab.h>
+#include <linux/mbus.h>
+#include <linux/clk.h>
 #include <asm/smp_plat.h>
 #include <asm/cacheflush.h>
 #include "armada-370-xp.h"
 #include "coherency.h"
+#include "mvebu-soc-id.h"
 
 unsigned long coherency_phys_base;
-static void __iomem *coherency_base;
+void __iomem *coherency_base;
 static void __iomem *coherency_cpu_base;
 
 /* Coherency fabric registers */
@@ -38,27 +44,190 @@ static void __iomem *coherency_cpu_base;
 
 #define IO_SYNC_BARRIER_CTL_OFFSET                0x0
 
+enum {
+       COHERENCY_FABRIC_TYPE_NONE,
+       COHERENCY_FABRIC_TYPE_ARMADA_370_XP,
+       COHERENCY_FABRIC_TYPE_ARMADA_375,
+       COHERENCY_FABRIC_TYPE_ARMADA_380,
+};
+
 static struct of_device_id of_coherency_table[] = {
-       {.compatible = "marvell,coherency-fabric"},
+       {.compatible = "marvell,coherency-fabric",
+        .data = (void *) COHERENCY_FABRIC_TYPE_ARMADA_370_XP },
+       {.compatible = "marvell,armada-375-coherency-fabric",
+        .data = (void *) COHERENCY_FABRIC_TYPE_ARMADA_375 },
+       {.compatible = "marvell,armada-380-coherency-fabric",
+        .data = (void *) COHERENCY_FABRIC_TYPE_ARMADA_380 },
        { /* end of list */ },
 };
 
-/* Function defined in coherency_ll.S */
-int ll_set_cpu_coherent(void __iomem *base_addr, unsigned int hw_cpu_id);
+/* Functions defined in coherency_ll.S */
+int ll_enable_coherency(void);
+void ll_add_cpu_to_smp_group(void);
 
-int set_cpu_coherent(unsigned int hw_cpu_id, int smp_group_id)
+int set_cpu_coherent(void)
 {
        if (!coherency_base) {
-               pr_warn("Can't make CPU %d cache coherent.\n", hw_cpu_id);
+               pr_warn("Can't make current CPU cache coherent.\n");
                pr_warn("Coherency fabric is not initialized\n");
                return 1;
        }
 
-       return ll_set_cpu_coherent(coherency_base, hw_cpu_id);
+       ll_add_cpu_to_smp_group();
+       return ll_enable_coherency();
+}
+
+/*
+ * The below code implements the I/O coherency workaround on Armada
+ * 375. This workaround consists in using the two channels of the
+ * first XOR engine to trigger a XOR transaction that serves as the
+ * I/O coherency barrier.
+ */
+
+static void __iomem *xor_base, *xor_high_base;
+static dma_addr_t coherency_wa_buf_phys[CONFIG_NR_CPUS];
+static void *coherency_wa_buf[CONFIG_NR_CPUS];
+static bool coherency_wa_enabled;
+
+#define XOR_CONFIG(chan)            (0x10 + (chan * 4))
+#define XOR_ACTIVATION(chan)        (0x20 + (chan * 4))
+#define WINDOW_BAR_ENABLE(chan)     (0x240 + ((chan) << 2))
+#define WINDOW_BASE(w)              (0x250 + ((w) << 2))
+#define WINDOW_SIZE(w)              (0x270 + ((w) << 2))
+#define WINDOW_REMAP_HIGH(w)        (0x290 + ((w) << 2))
+#define WINDOW_OVERRIDE_CTRL(chan)  (0x2A0 + ((chan) << 2))
+#define XOR_DEST_POINTER(chan)      (0x2B0 + (chan * 4))
+#define XOR_BLOCK_SIZE(chan)        (0x2C0 + (chan * 4))
+#define XOR_INIT_VALUE_LOW           0x2E0
+#define XOR_INIT_VALUE_HIGH          0x2E4
+
+static inline void mvebu_hwcc_armada375_sync_io_barrier_wa(void)
+{
+       int idx = smp_processor_id();
+
+       /* Write '1' to the first word of the buffer */
+       writel(0x1, coherency_wa_buf[idx]);
+
+       /* Wait until the engine is idle */
+       while ((readl(xor_base + XOR_ACTIVATION(idx)) >> 4) & 0x3)
+               ;
+
+       dmb();
+
+       /* Trigger channel */
+       writel(0x1, xor_base + XOR_ACTIVATION(idx));
+
+       /* Poll the data until it is cleared by the XOR transaction */
+       while (readl(coherency_wa_buf[idx]))
+               ;
+}
+
+static void __init armada_375_coherency_init_wa(void)
+{
+       const struct mbus_dram_target_info *dram;
+       struct device_node *xor_node;
+       struct property *xor_status;
+       struct clk *xor_clk;
+       u32 win_enable = 0;
+       int i;
+
+       pr_warn("enabling coherency workaround for Armada 375 Z1, one XOR engine disabled\n");
+
+       /*
+        * Since the workaround uses one XOR engine, we grab a
+        * reference to its Device Tree node first.
+        */
+       xor_node = of_find_compatible_node(NULL, NULL, "marvell,orion-xor");
+       BUG_ON(!xor_node);
+
+       /*
+        * Then we mark it as disabled so that the real XOR driver
+        * will not use it.
+        */
+       xor_status = kzalloc(sizeof(struct property), GFP_KERNEL);
+       BUG_ON(!xor_status);
+
+       xor_status->value = kstrdup("disabled", GFP_KERNEL);
+       BUG_ON(!xor_status->value);
+
+       xor_status->length = 8;
+       xor_status->name = kstrdup("status", GFP_KERNEL);
+       BUG_ON(!xor_status->name);
+
+       of_update_property(xor_node, xor_status);
+
+       /*
+        * And we remap the registers, get the clock, and do the
+        * initial configuration of the XOR engine.
+        */
+       xor_base = of_iomap(xor_node, 0);
+       xor_high_base = of_iomap(xor_node, 1);
+
+       xor_clk = of_clk_get_by_name(xor_node, NULL);
+       BUG_ON(!xor_clk);
+
+       clk_prepare_enable(xor_clk);
+
+       dram = mv_mbus_dram_info();
+
+       for (i = 0; i < 8; i++) {
+               writel(0, xor_base + WINDOW_BASE(i));
+               writel(0, xor_base + WINDOW_SIZE(i));
+               if (i < 4)
+                       writel(0, xor_base + WINDOW_REMAP_HIGH(i));
+       }
+
+       for (i = 0; i < dram->num_cs; i++) {
+               const struct mbus_dram_window *cs = dram->cs + i;
+               writel((cs->base & 0xffff0000) |
+                      (cs->mbus_attr << 8) |
+                      dram->mbus_dram_target_id, xor_base + WINDOW_BASE(i));
+               writel((cs->size - 1) & 0xffff0000, xor_base + WINDOW_SIZE(i));
+
+               win_enable |= (1 << i);
+               win_enable |= 3 << (16 + (2 * i));
+       }
+
+       writel(win_enable, xor_base + WINDOW_BAR_ENABLE(0));
+       writel(win_enable, xor_base + WINDOW_BAR_ENABLE(1));
+       writel(0, xor_base + WINDOW_OVERRIDE_CTRL(0));
+       writel(0, xor_base + WINDOW_OVERRIDE_CTRL(1));
+
+       for (i = 0; i < CONFIG_NR_CPUS; i++) {
+               coherency_wa_buf[i] = kzalloc(PAGE_SIZE, GFP_KERNEL);
+               BUG_ON(!coherency_wa_buf[i]);
+
+               /*
+                * We can't use the DMA mapping API, since we don't
+                * have a valid 'struct device' pointer
+                */
+               coherency_wa_buf_phys[i] =
+                       virt_to_phys(coherency_wa_buf[i]);
+               BUG_ON(!coherency_wa_buf_phys[i]);
+
+               /*
+                * Configure the XOR engine for memset operation, with
+                * a 128 bytes block size
+                */
+               writel(0x444, xor_base + XOR_CONFIG(i));
+               writel(128, xor_base + XOR_BLOCK_SIZE(i));
+               writel(coherency_wa_buf_phys[i],
+                      xor_base + XOR_DEST_POINTER(i));
+       }
+
+       writel(0x0, xor_base + XOR_INIT_VALUE_LOW);
+       writel(0x0, xor_base + XOR_INIT_VALUE_HIGH);
+
+       coherency_wa_enabled = true;
 }
 
 static inline void mvebu_hwcc_sync_io_barrier(void)
 {
+       if (coherency_wa_enabled) {
+               mvebu_hwcc_armada375_sync_io_barrier_wa();
+               return;
+       }
+
        writel(0x1, coherency_cpu_base + IO_SYNC_BARRIER_CTL_OFFSET);
        while (readl(coherency_cpu_base + IO_SYNC_BARRIER_CTL_OFFSET) & 0x1);
 }
@@ -121,42 +290,93 @@ static struct notifier_block mvebu_hwcc_platform_nb = {
        .notifier_call = mvebu_hwcc_platform_notifier,
 };
 
-int __init coherency_init(void)
+static void __init armada_370_coherency_init(struct device_node *np)
+{
+       struct resource res;
+
+       of_address_to_resource(np, 0, &res);
+       coherency_phys_base = res.start;
+       /*
+        * Ensure secondary CPUs will see the updated value,
+        * which they read before they join the coherency
+        * fabric, and therefore before they are coherent with
+        * the boot CPU cache.
+        */
+       sync_cache_w(&coherency_phys_base);
+       coherency_base = of_iomap(np, 0);
+       coherency_cpu_base = of_iomap(np, 1);
+       set_cpu_coherent();
+}
+
+static void __init armada_375_380_coherency_init(struct device_node *np)
+{
+       coherency_cpu_base = of_iomap(np, 0);
+}
+
+static int coherency_type(void)
 {
        struct device_node *np;
+       const struct of_device_id *match;
 
-       np = of_find_matching_node(NULL, of_coherency_table);
+       np = of_find_matching_node_and_match(NULL, of_coherency_table, &match);
        if (np) {
-               struct resource res;
-               pr_info("Initializing Coherency fabric\n");
-               of_address_to_resource(np, 0, &res);
-               coherency_phys_base = res.start;
-               /*
-                * Ensure secondary CPUs will see the updated value,
-                * which they read before they join the coherency
-                * fabric, and therefore before they are coherent with
-                * the boot CPU cache.
-                */
-               sync_cache_w(&coherency_phys_base);
-               coherency_base = of_iomap(np, 0);
-               coherency_cpu_base = of_iomap(np, 1);
-               set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0);
-               of_node_put(np);
+               int type = (int) match->data;
+
+               /* Armada 370/XP coherency works in both UP and SMP */
+               if (type == COHERENCY_FABRIC_TYPE_ARMADA_370_XP)
+                       return type;
+
+               /* Armada 375 coherency works only on SMP */
+               else if (type == COHERENCY_FABRIC_TYPE_ARMADA_375 && is_smp())
+                       return type;
+
+               /* Armada 380 coherency works only on SMP */
+               else if (type == COHERENCY_FABRIC_TYPE_ARMADA_380 && is_smp())
+                       return type;
        }
 
-       return 0;
+       return COHERENCY_FABRIC_TYPE_NONE;
 }
 
-static int __init coherency_late_init(void)
+int coherency_available(void)
+{
+       return coherency_type() != COHERENCY_FABRIC_TYPE_NONE;
+}
+
+int __init coherency_init(void)
 {
+       int type = coherency_type();
        struct device_node *np;
 
        np = of_find_matching_node(NULL, of_coherency_table);
-       if (np) {
-               bus_register_notifier(&platform_bus_type,
-                                     &mvebu_hwcc_platform_nb);
-               of_node_put(np);
+
+       if (type == COHERENCY_FABRIC_TYPE_ARMADA_370_XP)
+               armada_370_coherency_init(np);
+       else if (type == COHERENCY_FABRIC_TYPE_ARMADA_375 ||
+                type == COHERENCY_FABRIC_TYPE_ARMADA_380)
+               armada_375_380_coherency_init(np);
+
+       return 0;
+}
+
+static int __init coherency_late_init(void)
+{
+       int type = coherency_type();
+
+       if (type == COHERENCY_FABRIC_TYPE_NONE)
+               return 0;
+
+       if (type == COHERENCY_FABRIC_TYPE_ARMADA_375) {
+               u32 dev, rev;
+
+               if (mvebu_get_soc_id(&dev, &rev) == 0 &&
+                   rev == ARMADA_375_Z1_REV)
+                       armada_375_coherency_init_wa();
        }
+
+       bus_register_notifier(&platform_bus_type,
+                             &mvebu_hwcc_platform_nb);
+
        return 0;
 }
 
index 760226c4135309b4ec79ddda47ba9fb18c31a3f4..54cb7607b52669ec7d31aad95e44ffd04471a4fb 100644 (file)
@@ -15,8 +15,9 @@
 #define __MACH_370_XP_COHERENCY_H
 
 extern unsigned long coherency_phys_base;
+int set_cpu_coherent(void);
 
-int set_cpu_coherent(unsigned int cpu_id, int smp_group_id);
 int coherency_init(void);
+int coherency_available(void);
 
 #endif /* __MACH_370_XP_COHERENCY_H */
index ee7598fe75db873dc81843610939d189969833a3..6828f9f157b0b36d02abb6daab4843c143d2bf4d 100644 (file)
 #define ARMADA_XP_CFB_CFG_REG_OFFSET 0x4
 
 #include <asm/assembler.h>
+#include <asm/cp15.h>
 
        .text
-/*
- * r0: Coherency fabric base register address
- * r1: HW CPU id
- */
-ENTRY(ll_set_cpu_coherent)
-       /* Create bit by cpu index */
-       mov     r3, #(1 << 24)
-       lsl     r1, r3, r1
-ARM_BE8(rev    r1, r1)
+/* Returns with the coherency address in r1 (r0 is untouched)*/
+ENTRY(ll_get_coherency_base)
+       mrc     p15, 0, r1, c1, c0, 0
+       tst     r1, #CR_M @ Check MMU bit enabled
+       bne     1f
 
-       /* Add CPU to SMP group - Atomic */
-       add     r3, r0, #ARMADA_XP_CFB_CTL_REG_OFFSET
+       /* use physical address of the coherency register */
+       adr     r1, 3f
+       ldr     r3, [r1]
+       ldr     r1, [r1, r3]
+       b       2f
 1:
-       ldrex   r2, [r3]
-       orr     r2, r2, r1
-       strex   r0, r2, [r3]
-       cmp     r0, #0
-       bne 1b
-
-       /* Enable coherency on CPU - Atomic */
-       add     r3, r3, #ARMADA_XP_CFB_CFG_REG_OFFSET
+       /* use virtual address of the coherency register */
+       ldr     r1, =coherency_base
+       ldr     r1, [r1]
+2:
+       mov     pc, lr
+ENDPROC(ll_get_coherency_base)
+
+/* Returns with the CPU ID in r3 (r0 is untouched)*/
+ENTRY(ll_get_cpuid)
+       mrc     15, 0, r3, cr0, cr0, 5
+       and     r3, r3, #15
+       mov     r2, #(1 << 24)
+       lsl     r3, r2, r3
+ARM_BE8(rev    r1, r1)
+       mov     pc, lr
+ENDPROC(ll_get_cpuid)
+
+/* ll_add_cpu_to_smp_group, ll_enable_coherency and
+ * ll_disable_coherency use strex/ldrex whereas MMU can be off. The
+ * Armada XP SoC has an exclusive monitor that can track transactions
+ * to Device and/or SO and as such also when MMU is disabled the
+ * exclusive transactions will be functional
+ */
+
+ENTRY(ll_add_cpu_to_smp_group)
+       /*
+        * r0 being untouched in ll_get_coherency_base and
+        * ll_get_cpuid, we can use it to save lr modifing it with the
+        * following bl
+        */
+       mov r0, lr
+       bl      ll_get_coherency_base
+       bl      ll_get_cpuid
+       mov lr, r0
+       add     r0, r1, #ARMADA_XP_CFB_CFG_REG_OFFSET
 1:
-       ldrex   r2, [r3]
-       orr     r2, r2, r1
-       strex   r0, r2, [r3]
-       cmp     r0, #0
-       bne 1b
+       ldrex   r2, [r0]
+       orr     r2, r2, r3
+       strex   r1, r2, [r0]
+       cmp     r1, #0
+       bne     1b
+       mov     pc, lr
+ENDPROC(ll_add_cpu_to_smp_group)
 
+ENTRY(ll_enable_coherency)
+       /*
+        * r0 being untouched in ll_get_coherency_base and
+        * ll_get_cpuid, we can use it to save lr modifing it with the
+        * following bl
+        */
+       mov r0, lr
+       bl      ll_get_coherency_base
+       bl      ll_get_cpuid
+       mov lr, r0
+       add     r0, r1, #ARMADA_XP_CFB_CTL_REG_OFFSET
+1:
+       ldrex   r2, [r0]
+       orr     r2, r2, r3
+       strex   r1, r2, [r0]
+       cmp     r1, #0
+       bne     1b
        dsb
-
        mov     r0, #0
        mov     pc, lr
-ENDPROC(ll_set_cpu_coherent)
+ENDPROC(ll_enable_coherency)
+
+ENTRY(ll_disable_coherency)
+       /*
+        * r0 being untouched in ll_get_coherency_base and
+        * ll_get_cpuid, we can use it to save lr modifing it with the
+        * following bl
+        */
+       mov r0, lr
+       bl      ll_get_coherency_base
+       bl      ll_get_cpuid
+       mov lr, r0
+       add     r0, r1, #ARMADA_XP_CFB_CTL_REG_OFFSET
+1:
+       ldrex   r2, [r0]
+       bic     r2, r2, r3
+       strex   r1, r2, [r0]
+       cmp     r1, #0
+       bne     1b
+       dsb
+       mov     pc, lr
+ENDPROC(ll_disable_coherency)
+
+       .align 2
+3:
+       .long   coherency_phys_base - .
index 55449c487c9e9dff0a8e084b75a269d650cb5a93..b67fb7a10d8b466086672170c5615de4583f009f 100644 (file)
@@ -18,6 +18,9 @@
 #include <linux/reboot.h>
 
 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);
 
diff --git a/arch/arm/mach-mvebu/cpu-reset.c b/arch/arm/mach-mvebu/cpu-reset.c
new file mode 100644 (file)
index 0000000..4a8f9ee
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Copyright (C) 2014 Marvell
+ *
+ * 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.
+ */
+
+#define pr_fmt(fmt) "mvebu-cpureset: " fmt
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/of_address.h>
+#include <linux/io.h>
+#include <linux/resource.h>
+#include "armada-370-xp.h"
+
+static void __iomem *cpu_reset_base;
+static size_t cpu_reset_size;
+
+#define CPU_RESET_OFFSET(cpu) (cpu * 0x8)
+#define CPU_RESET_ASSERT      BIT(0)
+
+int mvebu_cpu_reset_deassert(int cpu)
+{
+       u32 reg;
+
+       if (!cpu_reset_base)
+               return -ENODEV;
+
+       if (CPU_RESET_OFFSET(cpu) >= cpu_reset_size)
+               return -EINVAL;
+
+       reg = readl(cpu_reset_base + CPU_RESET_OFFSET(cpu));
+       reg &= ~CPU_RESET_ASSERT;
+       writel(reg, cpu_reset_base + CPU_RESET_OFFSET(cpu));
+
+       return 0;
+}
+
+static int mvebu_cpu_reset_map(struct device_node *np, int res_idx)
+{
+       struct resource res;
+
+       if (of_address_to_resource(np, res_idx, &res)) {
+               pr_err("unable to get resource\n");
+               return -ENOENT;
+       }
+
+       if (!request_mem_region(res.start, resource_size(&res),
+                               np->full_name)) {
+               pr_err("unable to request region\n");
+               return -EBUSY;
+       }
+
+       cpu_reset_base = ioremap(res.start, resource_size(&res));
+       if (!cpu_reset_base) {
+               pr_err("unable to map registers\n");
+               release_mem_region(res.start, resource_size(&res));
+               return -ENOMEM;
+       }
+
+       cpu_reset_size = resource_size(&res);
+
+       return 0;
+}
+
+int __init mvebu_cpu_reset_init(void)
+{
+       struct device_node *np;
+       int res_idx;
+       int ret;
+
+       np = of_find_compatible_node(NULL, NULL,
+                                    "marvell,armada-370-cpu-reset");
+       if (np) {
+               res_idx = 0;
+       } else {
+               /*
+                * This code is kept for backward compatibility with
+                * old Device Trees.
+                */
+               np = of_find_compatible_node(NULL, NULL,
+                                            "marvell,armada-370-xp-pmsu");
+               if (np) {
+                       pr_warn(FW_WARN "deprecated pmsu binding\n");
+                       res_idx = 1;
+               }
+       }
+
+       /* No reset node found */
+       if (!np)
+               return -ENODEV;
+
+       ret = mvebu_cpu_reset_map(np, res_idx);
+       of_node_put(np);
+
+       return ret;
+}
+
+early_initcall(mvebu_cpu_reset_init);
index 5e5a43624237681f6f85b288147880babc66fef6..b50464ec1130ff0b5961990d2684953c582d44cc 100644 (file)
@@ -23,7 +23,7 @@ static void __init dove_init(void)
 #ifdef CONFIG_CACHE_TAUROS2
        tauros2_init(0);
 #endif
-       BUG_ON(mvebu_mbus_dt_init());
+       BUG_ON(mvebu_mbus_dt_init(false));
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
diff --git a/arch/arm/mach-mvebu/headsmp-a9.S b/arch/arm/mach-mvebu/headsmp-a9.S
new file mode 100644 (file)
index 0000000..5925366
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * SMP support: Entry point for secondary CPUs of Marvell EBU
+ * Cortex-A9 based SOCs (Armada 375 and Armada 38x).
+ *
+ * Copyright (C) 2014 Marvell
+ *
+ * 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/linkage.h>
+#include <linux/init.h>
+
+       __CPUINIT
+#define CPU_RESUME_ADDR_REG 0xf10182d4
+
+.global armada_375_smp_cpu1_enable_code_start
+.global armada_375_smp_cpu1_enable_code_end
+
+armada_375_smp_cpu1_enable_code_start:
+       ldr     r0, [pc, #4]
+       ldr     r1, [r0]
+       mov     pc, r1
+       .word   CPU_RESUME_ADDR_REG
+armada_375_smp_cpu1_enable_code_end:
+
+ENTRY(mvebu_cortex_a9_secondary_startup)
+       bl      v7_invalidate_l1
+       b       secondary_startup
+ENDPROC(mvebu_cortex_a9_secondary_startup)
index 3dd80df428f7edbf92885011a64141bf472add8c..2c4032e368badaa94d5ff60b7a6361b42d7f04dd 100644 (file)
 ENTRY(armada_xp_secondary_startup)
  ARM_BE8(setend        be )                    @ go BE8 if entered LE
 
-       /* Get coherency fabric base physical address */
-       adr     r0, 1f
-       ldr     r1, [r0]
-       ldr     r0, [r0, r1]
+       bl      ll_add_cpu_to_smp_group
 
-       /* Read CPU id */
-       mrc     p15, 0, r1, c0, c0, 5
-       and     r1, r1, #0xF
+       bl      ll_enable_coherency
 
-       /* Add CPU to coherency fabric */
-       bl      ll_set_cpu_coherent
        b       secondary_startup
 
 ENDPROC(armada_xp_secondary_startup)
-
-       .align 2
-1:
-       .long   coherency_phys_base - .
index 120207fc36f1f87d210c98d747bb28ee914015a0..46f105913c84b75e6b6c7b1095cdf485f015af5d 100644 (file)
@@ -169,7 +169,7 @@ static void __init kirkwood_dt_init(void)
 {
        kirkwood_disable_mbus_error_propagation();
 
-       BUG_ON(mvebu_mbus_dt_init());
+       BUG_ON(mvebu_mbus_dt_init(false));
 
 #ifdef CONFIG_CACHE_FEROCEON_L2
        feroceon_of_init();
@@ -180,9 +180,6 @@ static void __init kirkwood_dt_init(void)
        kirkwood_pm_init();
        kirkwood_dt_eth_fixup();
 
-       if (of_machine_is_compatible("hp,t5325"))
-               t5325_init();
-
        of_platform_populate(NULL, of_default_bus_match_table, auxdata, NULL);
 }
 
index f3d4cf53f7466ba6c44f5ef1d91484e3ce8f62e6..e9119a99a5f377857dc14ea5ee6ba5cbd0f30aec 100644 (file)
@@ -23,6 +23,8 @@
 #include <linux/kernel.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/slab.h>
+#include <linux/sys_soc.h>
 #include "mvebu-soc-id.h"
 
 #define PCIE_DEV_ID_OFF                0x0
@@ -116,5 +118,33 @@ clk_err:
 
        return ret;
 }
-core_initcall(mvebu_soc_id_init);
+early_initcall(mvebu_soc_id_init);
 
+static int __init mvebu_soc_device(void)
+{
+       struct soc_device_attribute *soc_dev_attr;
+       struct soc_device *soc_dev;
+
+       /* Also protects against running on non-mvebu systems */
+       if (!is_id_valid)
+               return 0;
+
+       soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
+       if (!soc_dev_attr)
+               return -ENOMEM;
+
+       soc_dev_attr->family = kasprintf(GFP_KERNEL, "Marvell");
+       soc_dev_attr->revision = kasprintf(GFP_KERNEL, "%X", soc_rev);
+       soc_dev_attr->soc_id = kasprintf(GFP_KERNEL, "%X", soc_dev_id);
+
+       soc_dev = soc_device_register(soc_dev_attr);
+       if (IS_ERR(soc_dev)) {
+               kfree(soc_dev_attr->family);
+               kfree(soc_dev_attr->revision);
+               kfree(soc_dev_attr->soc_id);
+               kfree(soc_dev_attr);
+       }
+
+       return 0;
+}
+postcore_initcall(mvebu_soc_device);
index 31654252fe35ca63e41706572ddc88e3bb9455f3..c16bb68ca81fd93255a489e8bf9034d5851972f5 100644 (file)
 #define MV78XX0_A0_REV     0x1
 #define MV78XX0_B0_REV     0x2
 
+/* Armada 375 */
+#define ARMADA_375_Z1_REV   0x0
+#define ARMADA_375_A0_REV   0x3
+
 #ifdef CONFIG_ARCH_MVEBU
 int mvebu_get_soc_id(u32 *dev, u32 *rev);
 #else
diff --git a/arch/arm/mach-mvebu/platsmp-a9.c b/arch/arm/mach-mvebu/platsmp-a9.c
new file mode 100644 (file)
index 0000000..96c2c59
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Symmetric Multi Processing (SMP) support for Marvell EBU Cortex-A9
+ * based SOCs (Armada 375/38x).
+ *
+ * Copyright (C) 2014 Marvell
+ *
+ * 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/init.h>
+#include <linux/io.h>
+#include <linux/of.h>
+#include <linux/smp.h>
+#include <linux/mbus.h>
+#include <asm/smp_scu.h>
+#include <asm/smp_plat.h>
+#include "common.h"
+#include "mvebu-soc-id.h"
+#include "pmsu.h"
+
+#define CRYPT0_ENG_ID   41
+#define CRYPT0_ENG_ATTR 0x1
+#define SRAM_PHYS_BASE  0xFFFF0000
+
+#define BOOTROM_BASE    0xFFF00000
+#define BOOTROM_SIZE    0x100000
+
+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)
+{
+       void __iomem *sram_virt_base;
+
+       mvebu_mbus_del_window(BOOTROM_BASE, BOOTROM_SIZE);
+       mvebu_mbus_add_window_by_id(CRYPT0_ENG_ID, CRYPT0_ENG_ATTR,
+                               SRAM_PHYS_BASE, SZ_64K);
+       sram_virt_base = ioremap(SRAM_PHYS_BASE, SZ_64K);
+
+       memcpy(sram_virt_base, &armada_375_smp_cpu1_enable_code_start,
+              &armada_375_smp_cpu1_enable_code_end
+              - &armada_375_smp_cpu1_enable_code_start);
+}
+
+extern void mvebu_cortex_a9_secondary_startup(void);
+
+static int __cpuinit mvebu_cortex_a9_boot_secondary(unsigned int cpu,
+                                                   struct task_struct *idle)
+{
+       int ret, hw_cpu;
+
+       pr_info("Booting CPU %d\n", cpu);
+
+       /*
+        * Write the address of secondary startup into the system-wide
+        * flags register. The boot monitor waits until it receives a
+        * soft interrupt, and then the secondary CPU branches to this
+        * address.
+        */
+       hw_cpu = cpu_logical_map(cpu);
+
+       if (of_machine_is_compatible("marvell,armada375")) {
+               u32 dev, rev;
+
+               if (mvebu_get_soc_id(&dev, &rev) == 0 &&
+                   rev == ARMADA_375_Z1_REV)
+                       armada_375_smp_cpu1_enable_wa();
+
+               mvebu_system_controller_set_cpu_boot_addr(mvebu_cortex_a9_secondary_startup);
+       }
+       else {
+               mvebu_pmsu_set_cpu_boot_addr(hw_cpu,
+                                            mvebu_cortex_a9_secondary_startup);
+       }
+
+       smp_wmb();
+       ret = mvebu_cpu_reset_deassert(hw_cpu);
+       if (ret) {
+               pr_err("Could not start the secondary CPU: %d\n", ret);
+               return ret;
+       }
+       arch_send_wakeup_ipi_mask(cpumask_of(cpu));
+
+       return 0;
+}
+
+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",
+                     &mvebu_cortex_a9_smp_ops);
+CPU_METHOD_OF_DECLARE(mvebu_armada_380_smp, "marvell,armada-380-smp",
+                     &mvebu_cortex_a9_smp_ops);
index a6da03f5b24ec921090af5508a2b6d87a66c7197..88b976b317198f7733b4945eaad440c195175aaa 100644 (file)
@@ -70,16 +70,19 @@ static void __init set_secondary_cpus_clock(void)
        }
 }
 
-static void armada_xp_secondary_init(unsigned int cpu)
-{
-       armada_xp_mpic_smp_cpu_init();
-}
-
 static int armada_xp_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
+       int ret, hw_cpu;
+
        pr_info("Booting CPU %d\n", cpu);
 
-       armada_xp_boot_cpu(cpu, armada_xp_secondary_startup);
+       hw_cpu = cpu_logical_map(cpu);
+       mvebu_pmsu_set_cpu_boot_addr(hw_cpu, armada_xp_secondary_startup);
+       ret = mvebu_cpu_reset_deassert(hw_cpu);
+       if (ret) {
+               pr_warn("unable to boot CPU: %d\n", ret);
+               return ret;
+       }
 
        return 0;
 }
@@ -90,8 +93,6 @@ static void __init armada_xp_smp_init_cpus(void)
 
        if (ncores == 0 || ncores > ARMADA_XP_MAX_CPUS)
                panic("Invalid number of CPUs in DT\n");
-
-       set_smp_cross_call(armada_mpic_send_doorbell);
 }
 
 static void __init armada_xp_smp_prepare_cpus(unsigned int max_cpus)
@@ -102,7 +103,7 @@ static void __init armada_xp_smp_prepare_cpus(unsigned int max_cpus)
 
        set_secondary_cpus_clock();
        flush_cache_all();
-       set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0);
+       set_cpu_coherent();
 
        /*
         * In order to boot the secondary CPUs we need to ensure
@@ -124,9 +125,11 @@ static void __init armada_xp_smp_prepare_cpus(unsigned int max_cpus)
 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_secondary_init     = armada_xp_secondary_init,
        .smp_boot_secondary     = armada_xp_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
        .cpu_die                = armada_xp_cpu_die,
 #endif
 };
+
+CPU_METHOD_OF_DECLARE(armada_xp_smp, "marvell,armada-xp-smp",
+                     &armada_xp_smp_ops);
index d71ef53107c4e9a530a558458d31eecf92039bd2..53a55c8520bf9a1fbab97919457af791f202ca2d 100644 (file)
  * other SOC units
  */
 
+#define pr_fmt(fmt) "mvebu-pmsu: " fmt
+
+#include <linux/cpu_pm.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/of_address.h>
 #include <linux/io.h>
+#include <linux/platform_device.h>
 #include <linux/smp.h>
+#include <linux/resource.h>
+#include <asm/cacheflush.h>
+#include <asm/cp15.h>
 #include <asm/smp_plat.h>
-#include "pmsu.h"
+#include <asm/suspend.h>
+#include <asm/tlbflush.h>
+#include "common.h"
 
 static void __iomem *pmsu_mp_base;
-static void __iomem *pmsu_reset_base;
 
-#define PMSU_BOOT_ADDR_REDIRECT_OFFSET(cpu)    ((cpu * 0x100) + 0x24)
-#define PMSU_RESET_CTL_OFFSET(cpu)             (cpu * 0x8)
+#define PMSU_BASE_OFFSET    0x100
+#define PMSU_REG_SIZE      0x1000
+
+/* PMSU MP registers */
+#define PMSU_CONTROL_AND_CONFIG(cpu)       ((cpu * 0x100) + 0x104)
+#define PMSU_CONTROL_AND_CONFIG_DFS_REQ                BIT(18)
+#define PMSU_CONTROL_AND_CONFIG_PWDDN_REQ      BIT(16)
+#define PMSU_CONTROL_AND_CONFIG_L2_PWDDN       BIT(20)
+
+#define PMSU_CPU_POWER_DOWN_CONTROL(cpu)    ((cpu * 0x100) + 0x108)
+
+#define PMSU_CPU_POWER_DOWN_DIS_SNP_Q_SKIP     BIT(0)
+
+#define PMSU_STATUS_AND_MASK(cpu)          ((cpu * 0x100) + 0x10c)
+#define PMSU_STATUS_AND_MASK_CPU_IDLE_WAIT     BIT(16)
+#define PMSU_STATUS_AND_MASK_SNP_Q_EMPTY_WAIT  BIT(17)
+#define PMSU_STATUS_AND_MASK_IRQ_WAKEUP                BIT(20)
+#define PMSU_STATUS_AND_MASK_FIQ_WAKEUP                BIT(21)
+#define PMSU_STATUS_AND_MASK_DBG_WAKEUP                BIT(22)
+#define PMSU_STATUS_AND_MASK_IRQ_MASK          BIT(24)
+#define PMSU_STATUS_AND_MASK_FIQ_MASK          BIT(25)
+
+#define PMSU_BOOT_ADDR_REDIRECT_OFFSET(cpu) ((cpu * 0x100) + 0x124)
+
+/* PMSU fabric registers */
+#define L2C_NFABRIC_PM_CTL                 0x4
+#define L2C_NFABRIC_PM_CTL_PWR_DOWN            BIT(20)
+
+extern void ll_disable_coherency(void);
+extern void ll_enable_coherency(void);
+
+static struct platform_device armada_xp_cpuidle_device = {
+       .name = "cpuidle-armada-370-xp",
+};
 
 static struct of_device_id of_pmsu_table[] = {
-       {.compatible = "marvell,armada-370-xp-pmsu"},
+       { .compatible = "marvell,armada-370-pmsu", },
+       { .compatible = "marvell,armada-370-xp-pmsu", },
+       { .compatible = "marvell,armada-380-pmsu", },
        { /* end of list */ },
 };
 
-#ifdef CONFIG_SMP
-int armada_xp_boot_cpu(unsigned int cpu_id, void *boot_addr)
+void mvebu_pmsu_set_cpu_boot_addr(int hw_cpu, void *boot_addr)
 {
-       int reg, hw_cpu;
+       writel(virt_to_phys(boot_addr), pmsu_mp_base +
+               PMSU_BOOT_ADDR_REDIRECT_OFFSET(hw_cpu));
+}
+
+static int __init armada_370_xp_pmsu_init(void)
+{
+       struct device_node *np;
+       struct resource res;
+       int ret = 0;
+
+       np = of_find_matching_node(NULL, of_pmsu_table);
+       if (!np)
+               return 0;
+
+       pr_info("Initializing Power Management Service Unit\n");
 
-       if (!pmsu_mp_base || !pmsu_reset_base) {
-               pr_warn("Can't boot CPU. PMSU is uninitialized\n");
-               return 1;
+       if (of_address_to_resource(np, 0, &res)) {
+               pr_err("unable to get resource\n");
+               ret = -ENOENT;
+               goto out;
        }
 
-       hw_cpu = cpu_logical_map(cpu_id);
+       if (of_device_is_compatible(np, "marvell,armada-370-xp-pmsu")) {
+               pr_warn(FW_WARN "deprecated pmsu binding\n");
+               res.start = res.start - PMSU_BASE_OFFSET;
+               res.end = res.start + PMSU_REG_SIZE - 1;
+       }
 
-       writel(virt_to_phys(boot_addr), pmsu_mp_base +
-                       PMSU_BOOT_ADDR_REDIRECT_OFFSET(hw_cpu));
+       if (!request_mem_region(res.start, resource_size(&res),
+                               np->full_name)) {
+               pr_err("unable to request region\n");
+               ret = -EBUSY;
+               goto out;
+       }
+
+       pmsu_mp_base = ioremap(res.start, resource_size(&res));
+       if (!pmsu_mp_base) {
+               pr_err("unable to map registers\n");
+               release_mem_region(res.start, resource_size(&res));
+               ret = -ENOMEM;
+               goto out;
+       }
+
+ out:
+       of_node_put(np);
+       return ret;
+}
+
+static void armada_370_xp_pmsu_enable_l2_powerdown_onidle(void)
+{
+       u32 reg;
+
+       if (pmsu_mp_base == NULL)
+               return;
+
+       /* Enable L2 & Fabric powerdown in Deep-Idle mode - Fabric */
+       reg = readl(pmsu_mp_base + L2C_NFABRIC_PM_CTL);
+       reg |= L2C_NFABRIC_PM_CTL_PWR_DOWN;
+       writel(reg, pmsu_mp_base + L2C_NFABRIC_PM_CTL);
+}
+
+static void armada_370_xp_cpu_resume(void)
+{
+       asm volatile("bl    ll_add_cpu_to_smp_group\n\t"
+                    "bl    ll_enable_coherency\n\t"
+                    "b     cpu_resume\n\t");
+}
+
+/* No locking is needed because we only access per-CPU registers */
+void armada_370_xp_pmsu_idle_prepare(bool deepidle)
+{
+       unsigned int hw_cpu = cpu_logical_map(smp_processor_id());
+       u32 reg;
+
+       if (pmsu_mp_base == NULL)
+               return;
 
-       /* Release CPU from reset by clearing reset bit*/
-       reg = readl(pmsu_reset_base + PMSU_RESET_CTL_OFFSET(hw_cpu));
-       reg &= (~0x1);
-       writel(reg, pmsu_reset_base + PMSU_RESET_CTL_OFFSET(hw_cpu));
+       /*
+        * Adjust the PMSU configuration to wait for WFI signal, enable
+        * IRQ and FIQ as wakeup events, set wait for snoop queue empty
+        * indication and mask IRQ and FIQ from CPU
+        */
+       reg = readl(pmsu_mp_base + PMSU_STATUS_AND_MASK(hw_cpu));
+       reg |= PMSU_STATUS_AND_MASK_CPU_IDLE_WAIT    |
+              PMSU_STATUS_AND_MASK_IRQ_WAKEUP       |
+              PMSU_STATUS_AND_MASK_FIQ_WAKEUP       |
+              PMSU_STATUS_AND_MASK_SNP_Q_EMPTY_WAIT |
+              PMSU_STATUS_AND_MASK_IRQ_MASK         |
+              PMSU_STATUS_AND_MASK_FIQ_MASK;
+       writel(reg, pmsu_mp_base + PMSU_STATUS_AND_MASK(hw_cpu));
+
+       reg = readl(pmsu_mp_base + PMSU_CONTROL_AND_CONFIG(hw_cpu));
+       /* ask HW to power down the L2 Cache if needed */
+       if (deepidle)
+               reg |= PMSU_CONTROL_AND_CONFIG_L2_PWDDN;
+
+       /* request power down */
+       reg |= PMSU_CONTROL_AND_CONFIG_PWDDN_REQ;
+       writel(reg, pmsu_mp_base + PMSU_CONTROL_AND_CONFIG(hw_cpu));
+
+       /* Disable snoop disable by HW - SW is taking care of it */
+       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);
+
+       ll_disable_coherency();
+
+       dsb();
+
+       wfi();
+
+       /* If we are here, wfi failed. As processors run out of
+        * coherency for some time, tlbs might be stale, so flush them
+        */
+       local_flush_tlb_all();
+
+       ll_enable_coherency();
+
+       /* Test the CR_C bit and set it if it was cleared */
+       asm volatile(
+       "mrc    p15, 0, %0, c1, c0, 0 \n\t"
+       "tst    %0, #(1 << 2) \n\t"
+       "orreq  %0, %0, #(1 << 2) \n\t"
+       "mcreq  p15, 0, %0, c1, c0, 0 \n\t"
+       "isb    "
+       : : "r" (0));
+
+       pr_warn("Failed to suspend the system\n");
 
        return 0;
 }
-#endif
 
-static int __init armada_370_xp_pmsu_init(void)
+static int armada_370_xp_cpu_suspend(unsigned long deepidle)
+{
+       return cpu_suspend(deepidle, do_armada_370_xp_cpu_suspend);
+}
+
+/* No locking is needed because we only access per-CPU registers */
+static noinline void armada_370_xp_pmsu_idle_restore(void)
+{
+       unsigned int hw_cpu = cpu_logical_map(smp_processor_id());
+       u32 reg;
+
+       if (pmsu_mp_base == NULL)
+               return;
+
+       /* cancel ask HW to power down the L2 Cache if possible */
+       reg = readl(pmsu_mp_base + PMSU_CONTROL_AND_CONFIG(hw_cpu));
+       reg &= ~PMSU_CONTROL_AND_CONFIG_L2_PWDDN;
+       writel(reg, pmsu_mp_base + PMSU_CONTROL_AND_CONFIG(hw_cpu));
+
+       /* cancel Enable wakeup events and mask interrupts */
+       reg = readl(pmsu_mp_base + PMSU_STATUS_AND_MASK(hw_cpu));
+       reg &= ~(PMSU_STATUS_AND_MASK_IRQ_WAKEUP | PMSU_STATUS_AND_MASK_FIQ_WAKEUP);
+       reg &= ~PMSU_STATUS_AND_MASK_CPU_IDLE_WAIT;
+       reg &= ~PMSU_STATUS_AND_MASK_SNP_Q_EMPTY_WAIT;
+       reg &= ~(PMSU_STATUS_AND_MASK_IRQ_MASK | PMSU_STATUS_AND_MASK_FIQ_MASK);
+       writel(reg, pmsu_mp_base + PMSU_STATUS_AND_MASK(hw_cpu));
+}
+
+static int armada_370_xp_cpu_pm_notify(struct notifier_block *self,
+                                   unsigned long action, void *hcpu)
+{
+       if (action == CPU_PM_ENTER) {
+               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();
+       }
+
+       return NOTIFY_OK;
+}
+
+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)
 {
        struct device_node *np;
 
+       /*
+        * Check that all the requirements are available to enable
+        * cpuidle. So far, it is only supported on Armada XP, cpuidle
+        * needs the coherency fabric and the PMSU enabled
+        */
+
+       if (!of_machine_is_compatible("marvell,armadaxp"))
+               return 0;
+
+       np = of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric");
+       if (!np)
+               return 0;
+       of_node_put(np);
+
        np = of_find_matching_node(NULL, of_pmsu_table);
-       if (np) {
-               pr_info("Initializing Power Management Service Unit\n");
-               pmsu_mp_base = of_iomap(np, 0);
-               pmsu_reset_base = of_iomap(np, 1);
-               of_node_put(np);
-       }
+       if (!np)
+               return 0;
+       of_node_put(np);
+
+       armada_370_xp_pmsu_enable_l2_powerdown_onidle();
+       armada_xp_cpuidle_device.dev.platform_data = armada_370_xp_cpu_suspend;
+       platform_device_register(&armada_xp_cpuidle_device);
+       cpu_pm_register_notifier(&armada_370_xp_cpu_pm_notifier);
 
        return 0;
 }
 
+arch_initcall(armada_370_xp_cpu_pm_init);
 early_initcall(armada_370_xp_pmsu_init);
index 614ba6832ff3ae4e14fe72ff12bdd98c83b95964..0c5524ac75b75c4b00b1cb2ba2814e94be35bc2a 100644 (file)
@@ -37,6 +37,8 @@ struct mvebu_system_controller {
 
        u32 rstoutn_mask_reset_out_en;
        u32 system_soft_reset;
+
+       u32 resume_boot_addr;
 };
 static struct mvebu_system_controller *mvebu_sc;
 
@@ -52,6 +54,7 @@ static const struct mvebu_system_controller armada_375_system_controller = {
        .system_soft_reset_offset = 0x58,
        .rstoutn_mask_reset_out_en = 0x1,
        .system_soft_reset = 0x1,
+       .resume_boot_addr = 0xd4,
 };
 
 static const struct mvebu_system_controller orion_system_controller = {
@@ -98,6 +101,16 @@ void mvebu_restart(enum reboot_mode mode, const char *cmd)
                ;
 }
 
+#ifdef CONFIG_SMP
+void mvebu_system_controller_set_cpu_boot_addr(void *boot_addr)
+{
+       BUG_ON(system_controller_base == NULL);
+       BUG_ON(mvebu_sc->resume_boot_addr == 0);
+       writel(virt_to_phys(boot_addr), system_controller_base +
+              mvebu_sc->resume_boot_addr);
+}
+#endif
+
 static int __init mvebu_system_controller_init(void)
 {
        const struct of_device_id *match;
@@ -114,4 +127,4 @@ static int __init mvebu_system_controller_init(void)
        return 0;
 }
 
-arch_initcall(mvebu_system_controller_init);
+early_initcall(mvebu_system_controller_init);
index 14f2cae4109ca10fc61962b4d787a5f89ed70097..2412efb6cdd963950725bf2a51118851f0813c9a 100644 (file)
@@ -5,6 +5,11 @@ menu "Orion Implementations"
 config ARCH_ORION5X_DT
        bool "Marvell Orion5x Flattened Device Tree"
        select USE_OF
+       select ORION_CLK
+       select ORION_IRQCHIP
+       select ORION_TIMER
+       select PINCTRL
+       select PINCTRL_ORION
        help
          Say 'Y' here if you want your kernel to support the
          Marvell Orion5x using flattened device tree.
@@ -23,6 +28,14 @@ config MACH_RD88F5182
          Say 'Y' here if you want your kernel to support the
          Marvell Orion-NAS (88F5182) RD2
 
+config MACH_RD88F5182_DT
+       bool "Marvell Orion-NAS Reference Design (Flattened Device Tree)"
+       select ARCH_ORION5X_DT
+       select I2C_BOARDINFO
+       help
+         Say 'Y' here if you want your kernel to support the Marvell
+         Orion-NAS (88F5182) RD2, Flattened Device Tree.
+
 config MACH_KUROBOX_PRO
        bool "KuroBox Pro"
        select I2C_BOARDINFO
@@ -102,28 +115,13 @@ config MACH_MV2120
          Say 'Y' here if you want your kernel to support the
          HP Media Vault mv2120 or mv5100.
 
-config MACH_EDMINI_V2_DT
-       bool "LaCie Ethernet Disk mini V2 (Flattened Device Tree)"
-       select I2C_BOARDINFO
+config MACH_D2NET_DT
+       bool "LaCie d2 Network / Big Disk Network (Flattened Device Tree)"
        select ARCH_ORION5X_DT
-       help
-         Say 'Y' here if you want your kernel to support the
-         LaCie Ethernet Disk mini V2 (Flattened Device Tree).
-
-config MACH_D2NET
-       bool "LaCie d2 Network"
-       select I2C_BOARDINFO
        help
          Say 'Y' here if you want your kernel to support the
          LaCie d2 Network NAS.
 
-config MACH_BIGDISK
-       bool "LaCie Big Disk Network"
-       select I2C_BOARDINFO
-       help
-         Say 'Y' here if you want your kernel to support the
-         LaCie Big Disk Network NAS.
-
 config MACH_NET2BIG
        bool "LaCie 2Big Network"
        select I2C_BOARDINFO
@@ -131,8 +129,9 @@ config MACH_NET2BIG
          Say 'Y' here if you want your kernel to support the
          LaCie 2Big Network NAS.
 
-config MACH_MSS2
-       bool "Maxtor Shared Storage II"
+config MACH_MSS2_DT
+       bool "Maxtor Shared Storage II (Flattened Device Tree)"
+       select ARCH_ORION5X_DT
        help
          Say 'Y' here if you want your kernel to support the
          Maxtor Shared Storage II platform.
index 45da805fb23692d07703310e8076a0cd8e4070f5..a40b5c9a58c4fb1795ff18c78bfe0c4f4073f42a 100644 (file)
@@ -12,10 +12,7 @@ obj-$(CONFIG_MACH_TS409)     += ts409-setup.o tsx09-common.o
 obj-$(CONFIG_MACH_WRT350N_V2)  += wrt350n-v2-setup.o
 obj-$(CONFIG_MACH_TS78XX)      += ts78xx-setup.o
 obj-$(CONFIG_MACH_MV2120)      += mv2120-setup.o
-obj-$(CONFIG_MACH_D2NET)       += d2net-setup.o
-obj-$(CONFIG_MACH_BIGDISK)     += d2net-setup.o
 obj-$(CONFIG_MACH_NET2BIG)     += net2big-setup.o
-obj-$(CONFIG_MACH_MSS2)                += mss2-setup.o
 obj-$(CONFIG_MACH_WNR854T)     += wnr854t-setup.o
 obj-$(CONFIG_MACH_RD88F5181L_GE)       += rd88f5181l-ge-setup.o
 obj-$(CONFIG_MACH_RD88F5181L_FXO)      += rd88f5181l-fxo-setup.o
@@ -23,4 +20,6 @@ obj-$(CONFIG_MACH_RD88F6183AP_GE)     += rd88f6183ap-ge-setup.o
 obj-$(CONFIG_MACH_LINKSTATION_LSCHL)   += ls-chl-setup.o
 
 obj-$(CONFIG_ARCH_ORION5X_DT)          += board-dt.o
-obj-$(CONFIG_MACH_EDMINI_V2_DT)        += edmini_v2-setup.o
+obj-$(CONFIG_MACH_D2NET_DT)    += board-d2net.o
+obj-$(CONFIG_MACH_MSS2_DT)     += board-mss2.o
+obj-$(CONFIG_MACH_RD88F5182_DT)        += board-rd88f5182.o
diff --git a/arch/arm/mach-orion5x/board-d2net.c b/arch/arm/mach-orion5x/board-d2net.c
new file mode 100644 (file)
index 0000000..8a72841
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * arch/arm/mach-orion5x/board-d2net.c
+ *
+ * LaCie d2Network and Big Disk Network NAS setup
+ *
+ * Copyright (C) 2009 Simon Guinot <sguinot@lacie.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/init.h>
+#include <linux/platform_device.h>
+#include <linux/pci.h>
+#include <linux/irq.h>
+#include <linux/leds.h>
+#include <linux/gpio.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/pci.h>
+#include <mach/orion5x.h>
+#include <plat/orion-gpio.h>
+#include "common.h"
+
+/*****************************************************************************
+ * LaCie d2 Network Info
+ ****************************************************************************/
+
+/*****************************************************************************
+ * GPIO LED's
+ ****************************************************************************/
+
+/*
+ * The blue front LED is wired to the CPLD and can blink in relation with the
+ * SATA activity.
+ *
+ * The following array detail the different LED registers and the combination
+ * of their possible values:
+ *
+ * led_off   | blink_ctrl | SATA active | LED state
+ *           |            |             |
+ *    1      |     x      |      x      |  off
+ *    0      |     0      |      0      |  off
+ *    0      |     1      |      0      |  blink (rate 300ms)
+ *    0      |     x      |      1      |  on
+ *
+ * Notes: The blue and the red front LED's can't be on at the same time.
+ *        Red LED have priority.
+ */
+
+#define D2NET_GPIO_RED_LED             6
+#define D2NET_GPIO_BLUE_LED_BLINK_CTRL 16
+#define D2NET_GPIO_BLUE_LED_OFF                23
+
+static struct gpio_led d2net_leds[] = {
+       {
+               .name = "d2net:blue:sata",
+               .default_trigger = "default-on",
+               .gpio = D2NET_GPIO_BLUE_LED_OFF,
+               .active_low = 1,
+       },
+       {
+               .name = "d2net:red:fail",
+               .gpio = D2NET_GPIO_RED_LED,
+       },
+};
+
+static struct gpio_led_platform_data d2net_led_data = {
+       .num_leds = ARRAY_SIZE(d2net_leds),
+       .leds = d2net_leds,
+};
+
+static struct platform_device d2net_gpio_leds = {
+       .name           = "leds-gpio",
+       .id             = -1,
+       .dev            = {
+               .platform_data  = &d2net_led_data,
+       },
+};
+
+static void __init d2net_gpio_leds_init(void)
+{
+       int err;
+
+       /* Configure register blink_ctrl to allow SATA activity LED blinking. */
+       err = gpio_request(D2NET_GPIO_BLUE_LED_BLINK_CTRL, "blue LED blink");
+       if (err == 0) {
+               err = gpio_direction_output(D2NET_GPIO_BLUE_LED_BLINK_CTRL, 1);
+               if (err)
+                       gpio_free(D2NET_GPIO_BLUE_LED_BLINK_CTRL);
+       }
+       if (err)
+               pr_err("d2net: failed to configure blue LED blink GPIO\n");
+
+       platform_device_register(&d2net_gpio_leds);
+}
+
+/*****************************************************************************
+ * General Setup
+ ****************************************************************************/
+
+void __init d2net_init(void)
+{
+       d2net_gpio_leds_init();
+
+       pr_notice("d2net: Flash write are not yet supported.\n");
+}
index c134a826070a14ccadda4293181f27cf81278804..35d418faf8f1b87c243199bd7552a24d39e53e43 100644 (file)
 #include <linux/of.h>
 #include <linux/of_platform.h>
 #include <linux/cpu.h>
+#include <linux/mbus.h>
+#include <linux/clk-provider.h>
+#include <linux/clocksource.h>
 #include <asm/system_misc.h>
 #include <asm/mach/arch.h>
+#include <asm/mach/map.h>
 #include <mach/orion5x.h>
+#include <mach/bridge-regs.h>
 #include <plat/irq.h>
+#include <plat/time.h>
 #include "common.h"
 
 static struct of_dev_auxdata orion5x_auxdata_lookup[] __initdata = {
@@ -39,14 +45,13 @@ static void __init orion5x_dt_init(void)
        orion5x_id(&dev, &rev, &dev_name);
        printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, orion5x_tclk);
 
+       BUG_ON(mvebu_mbus_dt_init());
+
        /*
         * Setup Orion address map
         */
        orion5x_setup_wins();
 
-       /* Setup root of clk tree */
-       clk_init();
-
        /*
         * Don't issue "Wait for Interrupt" instruction if we are
         * running on D0 5281 silicon.
@@ -56,8 +61,8 @@ static void __init orion5x_dt_init(void)
                cpu_idle_poll_ctrl(true);
        }
 
-       if (of_machine_is_compatible("lacie,ethernet-disk-mini-v2"))
-               edmini_v2_init();
+       if (of_machine_is_compatible("maxtor,shared-storage-2"))
+               mss2_init();
 
        of_platform_populate(NULL, of_default_bus_match_table,
                             orion5x_auxdata_lookup, NULL);
@@ -71,9 +76,6 @@ static const char *orion5x_dt_compat[] = {
 DT_MACHINE_START(ORION5X_DT, "Marvell Orion5x (Flattened Device Tree)")
        /* Maintainer: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> */
        .map_io         = orion5x_map_io,
-       .init_early     = orion5x_init_early,
-       .init_irq       = orion_dt_init_irq,
-       .init_time      = orion5x_timer_init,
        .init_machine   = orion5x_dt_init,
        .restart        = orion5x_restart,
        .dt_compat      = orion5x_dt_compat,
diff --git a/arch/arm/mach-orion5x/board-mss2.c b/arch/arm/mach-orion5x/board-mss2.c
new file mode 100644 (file)
index 0000000..66f9c3b
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * Maxtor Shared Storage II Board Setup
+ *
+ * Maintainer: Sylver Bruneau <sylver.bruneau@googlemail.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.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/pci.h>
+#include <linux/irq.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/pci.h>
+#include <mach/orion5x.h>
+#include <mach/bridge-regs.h>
+#include "common.h"
+
+/*****************************************************************************
+ * Maxtor Shared Storage II Info
+ ****************************************************************************/
+
+/****************************************************************************
+ * PCI setup
+ ****************************************************************************/
+static int __init mss2_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
+{
+       int irq;
+
+       /*
+        * Check for devices with hard-wired IRQs.
+        */
+       irq = orion5x_pci_map_irq(dev, slot, pin);
+       if (irq != -1)
+               return irq;
+
+       return -1;
+}
+
+static struct hw_pci mss2_pci __initdata = {
+       .nr_controllers = 2,
+       .setup          = orion5x_pci_sys_setup,
+       .scan           = orion5x_pci_sys_scan_bus,
+       .map_irq        = mss2_pci_map_irq,
+};
+
+static int __init mss2_pci_init(void)
+{
+       if (machine_is_mss2())
+               pci_common_init(&mss2_pci);
+
+       return 0;
+}
+subsys_initcall(mss2_pci_init);
+
+/*****************************************************************************
+ * MSS2 power off method
+ ****************************************************************************/
+/*
+ * On the Maxtor Shared Storage II, the shutdown process is the following :
+ * - Userland modifies U-boot env to tell U-boot to go idle at next boot
+ * - The board reboots
+ * - U-boot starts and go into an idle mode until the user press "power"
+ */
+static void mss2_power_off(void)
+{
+       u32 reg;
+
+       /*
+        * Enable and issue soft reset
+        */
+       reg = readl(RSTOUTn_MASK);
+       reg |= 1 << 2;
+       writel(reg, RSTOUTn_MASK);
+
+       reg = readl(CPU_SOFT_RESET);
+       reg |= 1;
+       writel(reg, CPU_SOFT_RESET);
+}
+
+void __init mss2_init(void)
+{
+       /* register mss2 specific power-off method */
+       pm_power_off = mss2_power_off;
+}
diff --git a/arch/arm/mach-orion5x/board-rd88f5182.c b/arch/arm/mach-orion5x/board-rd88f5182.c
new file mode 100644 (file)
index 0000000..270824b
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * arch/arm/mach-orion5x/rd88f5182-setup.c
+ *
+ * Marvell Orion-NAS Reference Design Setup
+ *
+ * Maintainer: Ronen Shitrit <rshitrit@marvell.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/gpio.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/pci.h>
+#include <linux/irq.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/pci.h>
+#include <mach/orion5x.h>
+#include "common.h"
+
+/*****************************************************************************
+ * RD-88F5182 Info
+ ****************************************************************************/
+
+/*
+ * PCI
+ */
+
+#define RD88F5182_PCI_SLOT0_OFFS       7
+#define RD88F5182_PCI_SLOT0_IRQ_A_PIN  7
+#define RD88F5182_PCI_SLOT0_IRQ_B_PIN  6
+
+/*****************************************************************************
+ * PCI
+ ****************************************************************************/
+
+static void __init rd88f5182_pci_preinit(void)
+{
+       int pin;
+
+       /*
+        * Configure PCI GPIO IRQ pins
+        */
+       pin = RD88F5182_PCI_SLOT0_IRQ_A_PIN;
+       if (gpio_request(pin, "PCI IntA") == 0) {
+               if (gpio_direction_input(pin) == 0) {
+                       irq_set_irq_type(gpio_to_irq(pin), IRQ_TYPE_LEVEL_LOW);
+               } else {
+                       printk(KERN_ERR "rd88f5182_pci_preinit failed to "
+                                       "set_irq_type pin %d\n", pin);
+                       gpio_free(pin);
+               }
+       } else {
+               printk(KERN_ERR "rd88f5182_pci_preinit failed to request gpio %d\n", pin);
+       }
+
+       pin = RD88F5182_PCI_SLOT0_IRQ_B_PIN;
+       if (gpio_request(pin, "PCI IntB") == 0) {
+               if (gpio_direction_input(pin) == 0) {
+                       irq_set_irq_type(gpio_to_irq(pin), IRQ_TYPE_LEVEL_LOW);
+               } else {
+                       printk(KERN_ERR "rd88f5182_pci_preinit failed to "
+                                       "set_irq_type pin %d\n", pin);
+                       gpio_free(pin);
+               }
+       } else {
+               printk(KERN_ERR "rd88f5182_pci_preinit failed to gpio_request %d\n", pin);
+       }
+}
+
+static int __init rd88f5182_pci_map_irq(const struct pci_dev *dev, u8 slot,
+       u8 pin)
+{
+       int irq;
+
+       /*
+        * Check for devices with hard-wired IRQs.
+        */
+       irq = orion5x_pci_map_irq(dev, slot, pin);
+       if (irq != -1)
+               return irq;
+
+       /*
+        * PCI IRQs are connected via GPIOs
+        */
+       switch (slot - RD88F5182_PCI_SLOT0_OFFS) {
+       case 0:
+               if (pin == 1)
+                       return gpio_to_irq(RD88F5182_PCI_SLOT0_IRQ_A_PIN);
+               else
+                       return gpio_to_irq(RD88F5182_PCI_SLOT0_IRQ_B_PIN);
+       default:
+               return -1;
+       }
+}
+
+static struct hw_pci rd88f5182_pci __initdata = {
+       .nr_controllers = 2,
+       .preinit        = rd88f5182_pci_preinit,
+       .setup          = orion5x_pci_sys_setup,
+       .scan           = orion5x_pci_sys_scan_bus,
+       .map_irq        = rd88f5182_pci_map_irq,
+};
+
+static int __init rd88f5182_pci_init(void)
+{
+       if (of_machine_is_compatible("marvell,rd-88f5182-nas"))
+               pci_common_init(&rd88f5182_pci);
+
+       return 0;
+}
+
+subsys_initcall(rd88f5182_pci_init);
index 7548db2bfb8a7e595d7672c5cfbba3868651d689..26d6f34b6027e4a4e34c9a74ef56ad614edfa9e2 100644 (file)
@@ -64,17 +64,16 @@ int orion5x_pci_sys_setup(int nr, struct pci_sys_data *sys);
 struct pci_bus *orion5x_pci_sys_scan_bus(int nr, struct pci_sys_data *sys);
 int orion5x_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin);
 
-/* board init functions for boards not fully converted to fdt */
-#ifdef CONFIG_MACH_EDMINI_V2_DT
-void edmini_v2_init(void);
-#else
-static inline void edmini_v2_init(void) {};
-#endif
-
 struct meminfo;
 struct tag;
 extern void __init tag_fixup_mem32(struct tag *, char **, struct meminfo *);
 
+#ifdef CONFIG_MACH_MSS2_DT
+extern void mss2_init(void);
+#else
+static inline void mss2_init(void) {}
+#endif
+
 /*****************************************************************************
  * Helpers to access Orion registers
  ****************************************************************************/
diff --git a/arch/arm/mach-orion5x/d2net-setup.c b/arch/arm/mach-orion5x/d2net-setup.c
deleted file mode 100644 (file)
index 8f68b74..0000000
+++ /dev/null
@@ -1,365 +0,0 @@
-/*
- * arch/arm/mach-orion5x/d2net-setup.c
- *
- * LaCie d2Network and Big Disk Network NAS setup
- *
- * Copyright (C) 2009 Simon Guinot <sguinot@lacie.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/init.h>
-#include <linux/platform_device.h>
-#include <linux/pci.h>
-#include <linux/irq.h>
-#include <linux/mtd/physmap.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/leds.h>
-#include <linux/gpio_keys.h>
-#include <linux/input.h>
-#include <linux/i2c.h>
-#include <linux/ata_platform.h>
-#include <linux/gpio.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/pci.h>
-#include <mach/orion5x.h>
-#include <plat/orion-gpio.h>
-#include "common.h"
-#include "mpp.h"
-
-/*****************************************************************************
- * LaCie d2 Network Info
- ****************************************************************************/
-
-/*
- * 512KB NOR flash Device bus boot chip select
- */
-
-#define D2NET_NOR_BOOT_BASE            0xfff80000
-#define D2NET_NOR_BOOT_SIZE            SZ_512K
-
-/*****************************************************************************
- * 512KB NOR Flash on Boot Device
- ****************************************************************************/
-
-/*
- * TODO: Check write support on flash MX29LV400CBTC-70G
- */
-
-static struct mtd_partition d2net_partitions[] = {
-       {
-               .name           = "Full512kb",
-               .size           = MTDPART_SIZ_FULL,
-               .offset         = 0,
-               .mask_flags     = MTD_WRITEABLE,
-       },
-};
-
-static struct physmap_flash_data d2net_nor_flash_data = {
-       .width          = 1,
-       .parts          = d2net_partitions,
-       .nr_parts       = ARRAY_SIZE(d2net_partitions),
-};
-
-static struct resource d2net_nor_flash_resource = {
-       .flags                  = IORESOURCE_MEM,
-       .start                  = D2NET_NOR_BOOT_BASE,
-       .end                    = D2NET_NOR_BOOT_BASE
-                                       + D2NET_NOR_BOOT_SIZE - 1,
-};
-
-static struct platform_device d2net_nor_flash = {
-       .name                   = "physmap-flash",
-       .id                     = 0,
-       .dev            = {
-               .platform_data  = &d2net_nor_flash_data,
-       },
-       .num_resources          = 1,
-       .resource               = &d2net_nor_flash_resource,
-};
-
-/*****************************************************************************
- * Ethernet
- ****************************************************************************/
-
-static struct mv643xx_eth_platform_data d2net_eth_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(8),
-};
-
-/*****************************************************************************
- * I2C devices
- ****************************************************************************/
-
-/*
- * i2c addr | chip         | description
- * 0x32     | Ricoh 5C372b | RTC
- * 0x3e     | GMT G762     | PWM fan controller
- * 0x50     | HT24LC08     | eeprom (1kB)
- *
- * TODO: Add G762 support to the g760a driver.
- */
-static struct i2c_board_info __initdata d2net_i2c_devices[] = {
-       {
-               I2C_BOARD_INFO("rs5c372b", 0x32),
-       }, {
-               I2C_BOARD_INFO("24c08", 0x50),
-       },
-};
-
-/*****************************************************************************
- * SATA
- ****************************************************************************/
-
-static struct mv_sata_platform_data d2net_sata_data = {
-       .n_ports        = 2,
-};
-
-#define D2NET_GPIO_SATA0_POWER 3
-#define D2NET_GPIO_SATA1_POWER 12
-
-static void __init d2net_sata_power_init(void)
-{
-       int err;
-
-       err = gpio_request(D2NET_GPIO_SATA0_POWER, "SATA0 power");
-       if (err == 0) {
-               err = gpio_direction_output(D2NET_GPIO_SATA0_POWER, 1);
-               if (err)
-                       gpio_free(D2NET_GPIO_SATA0_POWER);
-       }
-       if (err)
-               pr_err("d2net: failed to configure SATA0 power GPIO\n");
-
-       err = gpio_request(D2NET_GPIO_SATA1_POWER, "SATA1 power");
-       if (err == 0) {
-               err = gpio_direction_output(D2NET_GPIO_SATA1_POWER, 1);
-               if (err)
-                       gpio_free(D2NET_GPIO_SATA1_POWER);
-       }
-       if (err)
-               pr_err("d2net: failed to configure SATA1 power GPIO\n");
-}
-
-/*****************************************************************************
- * GPIO LED's
- ****************************************************************************/
-
-/*
- * The blue front LED is wired to the CPLD and can blink in relation with the
- * SATA activity.
- *
- * The following array detail the different LED registers and the combination
- * of their possible values:
- *
- * led_off   | blink_ctrl | SATA active | LED state
- *           |            |             |
- *    1      |     x      |      x      |  off
- *    0      |     0      |      0      |  off
- *    0      |     1      |      0      |  blink (rate 300ms)
- *    0      |     x      |      1      |  on
- *
- * Notes: The blue and the red front LED's can't be on at the same time.
- *        Red LED have priority.
- */
-
-#define D2NET_GPIO_RED_LED             6
-#define D2NET_GPIO_BLUE_LED_BLINK_CTRL 16
-#define D2NET_GPIO_BLUE_LED_OFF                23
-
-static struct gpio_led d2net_leds[] = {
-       {
-               .name = "d2net:blue:sata",
-               .default_trigger = "default-on",
-               .gpio = D2NET_GPIO_BLUE_LED_OFF,
-               .active_low = 1,
-       },
-       {
-               .name = "d2net:red:fail",
-               .gpio = D2NET_GPIO_RED_LED,
-       },
-};
-
-static struct gpio_led_platform_data d2net_led_data = {
-       .num_leds = ARRAY_SIZE(d2net_leds),
-       .leds = d2net_leds,
-};
-
-static struct platform_device d2net_gpio_leds = {
-       .name           = "leds-gpio",
-       .id             = -1,
-       .dev            = {
-               .platform_data  = &d2net_led_data,
-       },
-};
-
-static void __init d2net_gpio_leds_init(void)
-{
-       int err;
-
-       /* Configure GPIO over MPP max number. */
-       orion_gpio_set_valid(D2NET_GPIO_BLUE_LED_OFF, 1);
-
-       /* Configure register blink_ctrl to allow SATA activity LED blinking. */
-       err = gpio_request(D2NET_GPIO_BLUE_LED_BLINK_CTRL, "blue LED blink");
-       if (err == 0) {
-               err = gpio_direction_output(D2NET_GPIO_BLUE_LED_BLINK_CTRL, 1);
-               if (err)
-                       gpio_free(D2NET_GPIO_BLUE_LED_BLINK_CTRL);
-       }
-       if (err)
-               pr_err("d2net: failed to configure blue LED blink GPIO\n");
-
-       platform_device_register(&d2net_gpio_leds);
-}
-
-/****************************************************************************
- * GPIO keys
- ****************************************************************************/
-
-#define D2NET_GPIO_PUSH_BUTTON         18
-#define D2NET_GPIO_POWER_SWITCH_ON     8
-#define D2NET_GPIO_POWER_SWITCH_OFF    9
-
-#define D2NET_SWITCH_POWER_ON          0x1
-#define D2NET_SWITCH_POWER_OFF         0x2
-
-static struct gpio_keys_button d2net_buttons[] = {
-       {
-               .type           = EV_SW,
-               .code           = D2NET_SWITCH_POWER_OFF,
-               .gpio           = D2NET_GPIO_POWER_SWITCH_OFF,
-               .desc           = "Power rocker switch (auto|off)",
-               .active_low     = 0,
-       },
-       {
-               .type           = EV_SW,
-               .code           = D2NET_SWITCH_POWER_ON,
-               .gpio           = D2NET_GPIO_POWER_SWITCH_ON,
-               .desc           = "Power rocker switch (on|auto)",
-               .active_low     = 0,
-       },
-       {
-               .type           = EV_KEY,
-               .code           = KEY_POWER,
-               .gpio           = D2NET_GPIO_PUSH_BUTTON,
-               .desc           = "Front Push Button",
-               .active_low     = 0,
-       },
-};
-
-static struct gpio_keys_platform_data d2net_button_data = {
-       .buttons        = d2net_buttons,
-       .nbuttons       = ARRAY_SIZE(d2net_buttons),
-};
-
-static struct platform_device d2net_gpio_buttons = {
-       .name           = "gpio-keys",
-       .id             = -1,
-       .dev            = {
-               .platform_data  = &d2net_button_data,
-       },
-};
-
-/*****************************************************************************
- * General Setup
- ****************************************************************************/
-
-static unsigned int d2net_mpp_modes[] __initdata = {
-       MPP0_GPIO,      /* Board ID (bit 0) */
-       MPP1_GPIO,      /* Board ID (bit 1) */
-       MPP2_GPIO,      /* Board ID (bit 2) */
-       MPP3_GPIO,      /* SATA 0 power */
-       MPP4_UNUSED,
-       MPP5_GPIO,      /* Fan fail detection */
-       MPP6_GPIO,      /* Red front LED */
-       MPP7_UNUSED,
-       MPP8_GPIO,      /* Rear power switch (on|auto) */
-       MPP9_GPIO,      /* Rear power switch (auto|off) */
-       MPP10_UNUSED,
-       MPP11_UNUSED,
-       MPP12_GPIO,     /* SATA 1 power */
-       MPP13_UNUSED,
-       MPP14_SATA_LED, /* SATA 0 active */
-       MPP15_SATA_LED, /* SATA 1 active */
-       MPP16_GPIO,     /* Blue front LED blink control */
-       MPP17_UNUSED,
-       MPP18_GPIO,     /* Front button (0 = Released, 1 = Pushed ) */
-       MPP19_UNUSED,
-       0,
-       /* 22: USB port 1 fuse (0 = Fail, 1 = Ok) */
-       /* 23: Blue front LED off */
-       /* 24: Inhibit board power off (0 = Disabled, 1 = Enabled) */
-};
-
-#define D2NET_GPIO_INHIBIT_POWER_OFF    24
-
-static void __init d2net_init(void)
-{
-       /*
-        * Setup basic Orion functions. Need to be called early.
-        */
-       orion5x_init();
-
-       orion5x_mpp_conf(d2net_mpp_modes);
-
-       /*
-        * Configure peripherals.
-        */
-       orion5x_ehci0_init();
-       orion5x_eth_init(&d2net_eth_data);
-       orion5x_i2c_init();
-       orion5x_uart0_init();
-
-       d2net_sata_power_init();
-       orion5x_sata_init(&d2net_sata_data);
-
-       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
-                                   ORION_MBUS_DEVBUS_BOOT_ATTR,
-                                   D2NET_NOR_BOOT_BASE,
-                                   D2NET_NOR_BOOT_SIZE);
-       platform_device_register(&d2net_nor_flash);
-
-       platform_device_register(&d2net_gpio_buttons);
-
-       d2net_gpio_leds_init();
-
-       pr_notice("d2net: Flash write are not yet supported.\n");
-
-       i2c_register_board_info(0, d2net_i2c_devices,
-                               ARRAY_SIZE(d2net_i2c_devices));
-
-       orion_gpio_set_valid(D2NET_GPIO_INHIBIT_POWER_OFF, 1);
-}
-
-/* Warning: LaCie use a wrong mach-type (0x20e=526) in their bootloader. */
-
-#ifdef CONFIG_MACH_D2NET
-MACHINE_START(D2NET, "LaCie d2 Network")
-       .atag_offset    = 0x100,
-       .init_machine   = d2net_init,
-       .map_io         = orion5x_map_io,
-       .init_early     = orion5x_init_early,
-       .init_irq       = orion5x_init_irq,
-       .init_time      = orion5x_timer_init,
-       .fixup          = tag_fixup_mem32,
-       .restart        = orion5x_restart,
-MACHINE_END
-#endif
-
-#ifdef CONFIG_MACH_BIGDISK
-MACHINE_START(BIGDISK, "LaCie Big Disk Network")
-       .atag_offset    = 0x100,
-       .init_machine   = d2net_init,
-       .map_io         = orion5x_map_io,
-       .init_early     = orion5x_init_early,
-       .init_irq       = orion5x_init_irq,
-       .init_time      = orion5x_timer_init,
-       .fixup          = tag_fixup_mem32,
-       .restart        = orion5x_restart,
-MACHINE_END
-#endif
-
diff --git a/arch/arm/mach-orion5x/edmini_v2-setup.c b/arch/arm/mach-orion5x/edmini_v2-setup.c
deleted file mode 100644 (file)
index f66c1b2..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * arch/arm/mach-orion5x/edmini_v2-setup.c
- *
- * LaCie Ethernet Disk mini V2 Setup
- *
- * Copyright (C) 2008 Christopher Moore <moore@free.fr>
- * Copyright (C) 2008 Albert Aribaud <albert.aribaud@free.fr>
- *
- * 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.
- */
-
-/*
- * TODO: add Orion USB device port init when kernel.org support is added.
- * TODO: add flash write support: see below.
- * TODO: add power-off support.
- * TODO: add I2C EEPROM support.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/pci.h>
-#include <linux/irq.h>
-#include <linux/mbus.h>
-#include <linux/mtd/physmap.h>
-#include <linux/leds.h>
-#include <linux/gpio_keys.h>
-#include <linux/input.h>
-#include <linux/i2c.h>
-#include <linux/ata_platform.h>
-#include <linux/gpio.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/pci.h>
-#include <mach/orion5x.h>
-#include "common.h"
-#include "mpp.h"
-
-/*****************************************************************************
- * EDMINI_V2 Info
- ****************************************************************************/
-
-/*
- * 512KB NOR flash Device bus boot chip select
- */
-
-#define EDMINI_V2_NOR_BOOT_BASE                0xfff80000
-#define EDMINI_V2_NOR_BOOT_SIZE                SZ_512K
-
-/*****************************************************************************
- * 512KB NOR Flash on BOOT Device
- ****************************************************************************/
-
-/*
- * Currently the MTD code does not recognize the MX29LV400CBCT as a bottom
- * -type device. This could cause risks of accidentally erasing critical
- * flash sectors. We thus define a single, write-protected partition covering
- * the whole flash.
- * TODO: once the flash part TOP/BOTTOM detection issue is sorted out in the MTD
- * code, break this into at least three partitions: 'u-boot code', 'u-boot
- * environment' and 'whatever is left'.
- */
-
-static struct mtd_partition edmini_v2_partitions[] = {
-       {
-               .name           = "Full512kb",
-               .size           = 0x00080000,
-               .offset         = 0x00000000,
-               .mask_flags     = MTD_WRITEABLE,
-       },
-};
-
-static struct physmap_flash_data edmini_v2_nor_flash_data = {
-       .width          = 1,
-       .parts          = edmini_v2_partitions,
-       .nr_parts       = ARRAY_SIZE(edmini_v2_partitions),
-};
-
-static struct resource edmini_v2_nor_flash_resource = {
-       .flags                  = IORESOURCE_MEM,
-       .start                  = EDMINI_V2_NOR_BOOT_BASE,
-       .end                    = EDMINI_V2_NOR_BOOT_BASE
-               + EDMINI_V2_NOR_BOOT_SIZE - 1,
-};
-
-static struct platform_device edmini_v2_nor_flash = {
-       .name                   = "physmap-flash",
-       .id                     = 0,
-       .dev            = {
-               .platform_data  = &edmini_v2_nor_flash_data,
-       },
-       .num_resources          = 1,
-       .resource               = &edmini_v2_nor_flash_resource,
-};
-
-/*****************************************************************************
- * RTC 5C372a on I2C bus
- ****************************************************************************/
-
-#define EDMINIV2_RTC_GPIO      3
-
-static struct i2c_board_info __initdata edmini_v2_i2c_rtc = {
-       I2C_BOARD_INFO("rs5c372a", 0x32),
-       .irq = 0,
-};
-
-/*****************************************************************************
- * General Setup
- ****************************************************************************/
-static unsigned int edminiv2_mpp_modes[] __initdata = {
-       MPP0_UNUSED,
-       MPP1_UNUSED,
-       MPP2_UNUSED,
-       MPP3_GPIO,      /* RTC interrupt */
-       MPP4_UNUSED,
-       MPP5_UNUSED,
-       MPP6_UNUSED,
-       MPP7_UNUSED,
-       MPP8_UNUSED,
-       MPP9_UNUSED,
-       MPP10_UNUSED,
-       MPP11_UNUSED,
-       MPP12_SATA_LED, /* SATA 0 presence */
-       MPP13_SATA_LED, /* SATA 1 presence */
-       MPP14_SATA_LED, /* SATA 0 active */
-       MPP15_SATA_LED, /* SATA 1 active */
-       /* 16: Power LED control (0 = On, 1 = Off) */
-       MPP16_GPIO,
-       /* 17: Power LED control select (0 = CPLD, 1 = GPIO16) */
-       MPP17_GPIO,
-       /* 18: Power button status (0 = Released, 1 = Pressed) */
-       MPP18_GPIO,
-       MPP19_UNUSED,
-       0,
-};
-
-void __init edmini_v2_init(void)
-{
-       orion5x_mpp_conf(edminiv2_mpp_modes);
-
-       /*
-        * Configure peripherals.
-        */
-       orion5x_ehci0_init();
-
-       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
-                                   ORION_MBUS_DEVBUS_BOOT_ATTR,
-                                   EDMINI_V2_NOR_BOOT_BASE,
-                                   EDMINI_V2_NOR_BOOT_SIZE);
-       platform_device_register(&edmini_v2_nor_flash);
-
-       pr_notice("edmini_v2: USB device port, flash write and power-off "
-                 "are not yet supported.\n");
-
-       /* Get RTC IRQ and register the chip */
-       if (gpio_request(EDMINIV2_RTC_GPIO, "rtc") == 0) {
-               if (gpio_direction_input(EDMINIV2_RTC_GPIO) == 0)
-                       edmini_v2_i2c_rtc.irq = gpio_to_irq(EDMINIV2_RTC_GPIO);
-               else
-                       gpio_free(EDMINIV2_RTC_GPIO);
-       }
-
-       if (edmini_v2_i2c_rtc.irq == 0)
-               pr_warning("edmini_v2: failed to get RTC IRQ\n");
-
-       i2c_register_board_info(0, &edmini_v2_i2c_rtc, 1);
-}
index 9654b0cc58928741c13281eaf7c6b737411dd7ec..cd4bac4d7e43f194f8bf0306f7ed808d48caec3d 100644 (file)
@@ -16,6 +16,7 @@
 #include <mach/bridge-regs.h>
 #include <plat/orion-gpio.h>
 #include <plat/irq.h>
+#include <asm/exception.h>
 #include "common.h"
 
 static int __initdata gpio0_irqs[4] = {
@@ -25,10 +26,37 @@ static int __initdata gpio0_irqs[4] = {
        IRQ_ORION5X_GPIO_24_31,
 };
 
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+/*
+ * Compiling with both non-DT and DT support enabled, will
+ * break asm irq handler used by non-DT boards. Therefore,
+ * we provide a C-style irq handler even for non-DT boards,
+ * if MULTI_IRQ_HANDLER is set.
+ */
+
+asmlinkage void
+__exception_irq_entry orion5x_legacy_handle_irq(struct pt_regs *regs)
+{
+       u32 stat;
+
+       stat = readl_relaxed(MAIN_IRQ_CAUSE);
+       stat &= readl_relaxed(MAIN_IRQ_MASK);
+       if (stat) {
+               unsigned int hwirq = __fls(stat);
+               handle_IRQ(hwirq, regs);
+               return;
+       }
+}
+#endif
+
 void __init orion5x_init_irq(void)
 {
        orion_irq_init(0, MAIN_IRQ_MASK);
 
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+       set_handle_irq(orion5x_legacy_handle_irq);
+#endif
+
        /*
         * Initialize gpiolib for GPIOs 0-31.
         */
diff --git a/arch/arm/mach-orion5x/mss2-setup.c b/arch/arm/mach-orion5x/mss2-setup.c
deleted file mode 100644 (file)
index e105130..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- * Maxtor Shared Storage II Board Setup
- *
- * Maintainer: Sylver Bruneau <sylver.bruneau@googlemail.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.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/pci.h>
-#include <linux/irq.h>
-#include <linux/mtd/physmap.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/leds.h>
-#include <linux/gpio_keys.h>
-#include <linux/input.h>
-#include <linux/i2c.h>
-#include <linux/ata_platform.h>
-#include <linux/gpio.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/pci.h>
-#include <mach/orion5x.h>
-#include <mach/bridge-regs.h>
-#include "common.h"
-#include "mpp.h"
-
-#define MSS2_NOR_BOOT_BASE     0xff800000
-#define MSS2_NOR_BOOT_SIZE     SZ_256K
-
-/*****************************************************************************
- * Maxtor Shared Storage II Info
- ****************************************************************************/
-
-/*
- * Maxtor Shared Storage II hardware :
- * - Marvell 88F5182-A2 C500
- * - Marvell 88E1111 Gigabit Ethernet PHY
- * - RTC M41T81 (@0x68) on I2C bus
- * - 256KB NOR flash
- * - 64MB of RAM
- */
-
-/*****************************************************************************
- * 256KB NOR Flash on BOOT Device
- ****************************************************************************/
-
-static struct physmap_flash_data mss2_nor_flash_data = {
-       .width          = 1,
-};
-
-static struct resource mss2_nor_flash_resource = {
-       .flags          = IORESOURCE_MEM,
-       .start          = MSS2_NOR_BOOT_BASE,
-       .end            = MSS2_NOR_BOOT_BASE + MSS2_NOR_BOOT_SIZE - 1,
-};
-
-static struct platform_device mss2_nor_flash = {
-       .name           = "physmap-flash",
-       .id             = 0,
-       .dev            = {
-               .platform_data  = &mss2_nor_flash_data,
-       },
-       .resource       = &mss2_nor_flash_resource,
-       .num_resources  = 1,
-};
-
-/****************************************************************************
- * PCI setup
- ****************************************************************************/
-static int __init mss2_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
-{
-       int irq;
-
-       /*
-        * Check for devices with hard-wired IRQs.
-        */
-       irq = orion5x_pci_map_irq(dev, slot, pin);
-       if (irq != -1)
-               return irq;
-
-       return -1;
-}
-
-static struct hw_pci mss2_pci __initdata = {
-       .nr_controllers = 2,
-       .setup          = orion5x_pci_sys_setup,
-       .scan           = orion5x_pci_sys_scan_bus,
-       .map_irq        = mss2_pci_map_irq,
-};
-
-static int __init mss2_pci_init(void)
-{
-       if (machine_is_mss2())
-               pci_common_init(&mss2_pci);
-
-       return 0;
-}
-subsys_initcall(mss2_pci_init);
-
-
-/*****************************************************************************
- * Ethernet
- ****************************************************************************/
-
-static struct mv643xx_eth_platform_data mss2_eth_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(8),
-};
-
-/*****************************************************************************
- * SATA
- ****************************************************************************/
-
-static struct mv_sata_platform_data mss2_sata_data = {
-       .n_ports        = 2,
-};
-
-/*****************************************************************************
- * GPIO buttons
- ****************************************************************************/
-
-#define MSS2_GPIO_KEY_RESET    12
-#define MSS2_GPIO_KEY_POWER    11
-
-static struct gpio_keys_button mss2_buttons[] = {
-       {
-               .code           = KEY_POWER,
-               .gpio           = MSS2_GPIO_KEY_POWER,
-               .desc           = "Power",
-               .active_low     = 1,
-       }, {
-               .code           = KEY_RESTART,
-               .gpio           = MSS2_GPIO_KEY_RESET,
-               .desc           = "Reset",
-               .active_low     = 1,
-       },
-};
-
-static struct gpio_keys_platform_data mss2_button_data = {
-       .buttons        = mss2_buttons,
-       .nbuttons       = ARRAY_SIZE(mss2_buttons),
-};
-
-static struct platform_device mss2_button_device = {
-       .name           = "gpio-keys",
-       .id             = -1,
-       .dev            = {
-               .platform_data  = &mss2_button_data,
-       },
-};
-
-/*****************************************************************************
- * RTC m41t81 on I2C bus
- ****************************************************************************/
-
-#define MSS2_GPIO_RTC_IRQ      3
-
-static struct i2c_board_info __initdata mss2_i2c_rtc = {
-       I2C_BOARD_INFO("m41t81", 0x68),
-};
-
-/*****************************************************************************
- * MSS2 power off method
- ****************************************************************************/
-/*
- * On the Maxtor Shared Storage II, the shutdown process is the following :
- * - Userland modifies U-boot env to tell U-boot to go idle at next boot
- * - The board reboots
- * - U-boot starts and go into an idle mode until the user press "power"
- */
-static void mss2_power_off(void)
-{
-       u32 reg;
-
-       /*
-        * Enable and issue soft reset
-        */
-       reg = readl(RSTOUTn_MASK);
-       reg |= 1 << 2;
-       writel(reg, RSTOUTn_MASK);
-
-       reg = readl(CPU_SOFT_RESET);
-       reg |= 1;
-       writel(reg, CPU_SOFT_RESET);
-}
-
-/****************************************************************************
- * General Setup
- ****************************************************************************/
-static unsigned int mss2_mpp_modes[] __initdata = {
-       MPP0_GPIO,              /* Power LED */
-       MPP1_GPIO,              /* Error LED */
-       MPP2_UNUSED,
-       MPP3_GPIO,              /* RTC interrupt */
-       MPP4_GPIO,              /* HDD ind. (Single/Dual)*/
-       MPP5_GPIO,              /* HD0 5V control */
-       MPP6_GPIO,              /* HD0 12V control */
-       MPP7_GPIO,              /* HD1 5V control */
-       MPP8_GPIO,              /* HD1 12V control */
-       MPP9_UNUSED,
-       MPP10_GPIO,             /* Fan control */
-       MPP11_GPIO,             /* Power button */
-       MPP12_GPIO,             /* Reset button */
-       MPP13_UNUSED,
-       MPP14_SATA_LED,         /* SATA 0 active */
-       MPP15_SATA_LED,         /* SATA 1 active */
-       MPP16_UNUSED,
-       MPP17_UNUSED,
-       MPP18_UNUSED,
-       MPP19_UNUSED,
-       0,
-};
-
-static void __init mss2_init(void)
-{
-       /* Setup basic Orion functions. Need to be called early. */
-       orion5x_init();
-
-       orion5x_mpp_conf(mss2_mpp_modes);
-
-       /*
-        * MPP[20] Unused
-        * MPP[21] PCI clock
-        * MPP[22] USB 0 over current
-        * MPP[23] USB 1 over current
-        */
-
-       /*
-        * Configure peripherals.
-        */
-       orion5x_ehci0_init();
-       orion5x_ehci1_init();
-       orion5x_eth_init(&mss2_eth_data);
-       orion5x_i2c_init();
-       orion5x_sata_init(&mss2_sata_data);
-       orion5x_uart0_init();
-       orion5x_xor_init();
-
-       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
-                                   ORION_MBUS_DEVBUS_BOOT_ATTR,
-                                   MSS2_NOR_BOOT_BASE,
-                                   MSS2_NOR_BOOT_SIZE);
-       platform_device_register(&mss2_nor_flash);
-
-       platform_device_register(&mss2_button_device);
-
-       if (gpio_request(MSS2_GPIO_RTC_IRQ, "rtc") == 0) {
-               if (gpio_direction_input(MSS2_GPIO_RTC_IRQ) == 0)
-                       mss2_i2c_rtc.irq = gpio_to_irq(MSS2_GPIO_RTC_IRQ);
-               else
-                       gpio_free(MSS2_GPIO_RTC_IRQ);
-       }
-       i2c_register_board_info(0, &mss2_i2c_rtc, 1);
-
-       /* register mss2 specific power-off method */
-       pm_power_off = mss2_power_off;
-}
-
-MACHINE_START(MSS2, "Maxtor Shared Storage II")
-       /* Maintainer: Sylver Bruneau <sylver.bruneau@googlemail.com> */
-       .atag_offset    = 0x100,
-       .init_machine   = mss2_init,
-       .map_io         = orion5x_map_io,
-       .init_early     = orion5x_init_early,
-       .init_irq       = orion5x_init_irq,
-       .init_time      = orion5x_timer_init,
-       .fixup          = tag_fixup_mem32,
-       .restart        = orion5x_restart,
-MACHINE_END
index 4887a2a4c698a7f5b82e0b511af84615cee7dd86..3dffcb2d714ee8034046c1e2f501e21d43e6b68b 100644 (file)
@@ -36,27 +36,33 @@ static int sirfsoc_reset_module(struct reset_controller_dev *rcdev,
 
        if (of_device_is_compatible(rcdev->of_node, "sirf,prima2-rstc")) {
                /*
-                * Writing 1 to this bit resets corresponding block. Writing 0 to this
-                * bit de-asserts reset signal of the corresponding block.
-                * datasheet doesn't require explicit delay between the set and clear
-                * of reset bit. it could be shorter if tests pass.
+                * Writing 1 to this bit resets corresponding block.
+                * Writing 0 to this bit de-asserts reset signal of the
+                * corresponding block. datasheet doesn't require explicit
+                * delay between the set and clear of reset bit. it could
+                * be shorter if tests pass.
                 */
-               writel(readl(sirfsoc_rstc_base + (reset_bit / 32) * 4) | (1 << reset_bit),
+               writel(readl(sirfsoc_rstc_base +
+                       (reset_bit / 32) * 4) | (1 << reset_bit),
                        sirfsoc_rstc_base + (reset_bit / 32) * 4);
-               msleep(10);
-               writel(readl(sirfsoc_rstc_base + (reset_bit / 32) * 4) & ~(1 << reset_bit),
+               msleep(20);
+               writel(readl(sirfsoc_rstc_base +
+                       (reset_bit / 32) * 4) & ~(1 << reset_bit),
                        sirfsoc_rstc_base + (reset_bit / 32) * 4);
        } else {
                /*
                 * For MARCO and POLO
-                * Writing 1 to SET register resets corresponding block. Writing 1 to CLEAR
-                * register de-asserts reset signal of the corresponding block.
-                * datasheet doesn't require explicit delay between the set and clear
-                * of reset bit. it could be shorter if tests pass.
+                * Writing 1 to SET register resets corresponding block.
+                * Writing 1 to CLEAR register de-asserts reset signal of the
+                * corresponding block.
+                * datasheet doesn't require explicit delay between the set and
+                * clear of reset bit. it could be shorter if tests pass.
                 */
-               writel(1 << reset_bit, sirfsoc_rstc_base + (reset_bit / 32) * 8);
-               msleep(10);
-               writel(1 << reset_bit, sirfsoc_rstc_base + (reset_bit / 32) * 8 + 4);
+               writel(1 << reset_bit,
+                       sirfsoc_rstc_base + (reset_bit / 32) * 8);
+               msleep(20);
+               writel(1 << reset_bit,
+                       sirfsoc_rstc_base + (reset_bit / 32) * 8 + 4);
        }
 
        mutex_unlock(&rstc_lock);
index a028be23433453d0ef7bacef1af026853dcbb412..6aa22147cace9c89c1dae3edc28e99d4fa5a913c 100644 (file)
@@ -3,8 +3,6 @@ config ARCH_QCOM
        select ARCH_REQUIRE_GPIOLIB
        select ARM_GIC
        select CLKSRC_OF
-       select GENERIC_CLOCKEVENTS
-       select HAVE_SMP
        select QCOM_SCM if SMP
        help
          Support for Qualcomm's devicetree based systems.
index 1d5ee5c9a1dcd36624ab2c29d0a7111e7a3e1bdc..960b8dd78c4498f935fb841a510bb38736d09d4e 100644 (file)
@@ -148,6 +148,21 @@ struct platform_device realview_cf_device = {
        },
 };
 
+static struct resource realview_leds_resources[] = {
+       {
+               .start  = REALVIEW_SYS_BASE + REALVIEW_SYS_LED_OFFSET,
+               .end    = REALVIEW_SYS_BASE + REALVIEW_SYS_LED_OFFSET + 4,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+struct platform_device realview_leds_device = {
+       .name           = "versatile-leds",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(realview_leds_resources),
+       .resource       = realview_leds_resources,
+};
+
 static struct resource realview_i2c_resource = {
        .start          = REALVIEW_I2C_BASE,
        .end            = REALVIEW_I2C_BASE + SZ_4K - 1,
index 602ca5ec52c53a855e3bb6fa8ec2013486d28ba8..13dc830ef469a3587e22a54e1ad31a2b44a43737 100644 (file)
@@ -37,6 +37,7 @@ struct machine_desc;
 
 extern struct platform_device realview_flash_device;
 extern struct platform_device realview_cf_device;
+extern struct platform_device realview_leds_device;
 extern struct platform_device realview_i2c_device;
 extern struct mmci_platform_data realview_mmc0_plat_data;
 extern struct mmci_platform_data realview_mmc1_plat_data;
index c85ddb2a0ad09083e3e3c30901bc28bb3c807af2..6bb070e801287606466a54cd1e411d4b377570ef 100644 (file)
@@ -452,6 +452,7 @@ static void __init realview_eb_init(void)
        realview_flash_register(&realview_eb_flash_resource, 1);
        platform_device_register(&realview_i2c_device);
        platform_device_register(&char_lcd_device);
+       platform_device_register(&realview_leds_device);
        eth_device_register();
        realview_usb_register(realview_eb_isp1761_resources);
 
index c5eade76461be3cf2faa4d6dffbb9becc7cbb872..173f2c15de49ac6709d028d607fb0bb49a339df5 100644 (file)
@@ -367,6 +367,7 @@ static void __init realview_pb1176_init(void)
        realview_usb_register(realview_pb1176_isp1761_resources);
        platform_device_register(&pmu_device);
        platform_device_register(&char_lcd_device);
+       platform_device_register(&realview_leds_device);
 
        for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
                struct amba_device *d = amba_devs[i];
index f4b0962578feb94dd653033620bfed0fcfddeaac..bde7e6b1fd44ddba8cde40e13497b0bfc9f71314 100644 (file)
@@ -347,6 +347,7 @@ static void __init realview_pb11mp_init(void)
        realview_eth_register(NULL, realview_pb11mp_smsc911x_resources);
        platform_device_register(&realview_i2c_device);
        platform_device_register(&realview_cf_device);
+       platform_device_register(&realview_leds_device);
        realview_usb_register(realview_pb11mp_isp1761_resources);
        platform_device_register(&pmu_device);
 
index 10a3e1d76891315d6fce093a36d69618cbe48f44..4e57a8599265b6d69c70285a7573957f3da9347d 100644 (file)
@@ -289,6 +289,7 @@ static void __init realview_pba8_init(void)
        realview_eth_register(NULL, realview_pba8_smsc911x_resources);
        platform_device_register(&realview_i2c_device);
        platform_device_register(&realview_cf_device);
+       platform_device_register(&realview_leds_device);
        realview_usb_register(realview_pba8_isp1761_resources);
        platform_device_register(&pmu_device);
 
index 9d75493e3f0cc110751b168cadff78093b0d129f..72c96caebefa92fdfaac1f4cb19348b793a69631 100644 (file)
@@ -385,6 +385,7 @@ static void __init realview_pbx_init(void)
        realview_eth_register(NULL, realview_pbx_smsc911x_resources);
        platform_device_register(&realview_i2c_device);
        platform_device_register(&realview_cf_device);
+       platform_device_register(&realview_leds_device);
        realview_usb_register(realview_pbx_isp1761_resources);
 
        for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
index 0f92ba8e78841556c683ffaebbae8a8df13347db..037c00622de69f324aaab6f6ac36acbd0ef0f562 100644 (file)
@@ -108,6 +108,7 @@ config ARCH_R8A7778
        select SH_CLK_CPG
        select ARM_GIC
        select SYS_SUPPORTS_SH_TMU
+       select RENESAS_INTC_IRQPIN
 
 config ARCH_R8A7779
        bool "R-Car H1 (R8A77790)"
@@ -140,16 +141,6 @@ config ARCH_R8A7791
        select SYS_SUPPORTS_SH_CMT
        select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE
 
-config ARCH_EMEV2
-       bool "Emma Mobile EV2"
-       select ARCH_WANT_OPTIONAL_GPIOLIB
-       select ARM_GIC
-       select CPU_V7
-       select MIGHT_HAVE_PCI
-       select USE_OF
-       select AUTO_ZRELADDR
-       select SYS_SUPPORTS_EM_STI
-
 config ARCH_R7S72100
        bool "RZ/A1H (R7S72100)"
        select ARCH_WANT_OPTIONAL_GPIOLIB
@@ -205,8 +196,8 @@ config MACH_ARMADILLO800EVA_REFERENCE
        select SND_SOC_WM8978 if SND_SIMPLE_CARD
        select USE_OF
        ---help---
-          Use reference implementation of Aramdillo800 EVA board support
-          which makes greater use of device tree at the expense
+          Use reference implementation of Armadillo800 EVA board support
+          which makes greater use of device tree at the expense
           of not supporting a number of devices.
 
           This is intended to aid developers
@@ -216,7 +207,6 @@ config MACH_BOCKW
        depends on ARCH_R8A7778
        select ARCH_REQUIRE_GPIOLIB
        select REGULATOR_FIXED_VOLTAGE if REGULATOR
-       select RENESAS_INTC_IRQPIN
        select SND_SOC_AK4554 if SND_SIMPLE_CARD
        select SND_SOC_AK4642 if SND_SIMPLE_CARD
        select USE_OF
@@ -225,7 +215,6 @@ config MACH_BOCKW_REFERENCE
        bool "BOCK-W  - Reference Device Tree Implementation"
        depends on ARCH_R8A7778
        select ARCH_REQUIRE_GPIOLIB
-       select RENESAS_INTC_IRQPIN
        select REGULATOR_FIXED_VOLTAGE if REGULATOR
        select USE_OF
        ---help---
index 4caffc912a81ccf442c6929d8f08018faff22fd6..9c5cd8c53a8568326fdc73bf12210252379b655e 100644 (file)
@@ -21,8 +21,8 @@ obj-$(CONFIG_ARCH_EMEV2)      += setup-emev2.o
 obj-$(CONFIG_ARCH_R7S72100)    += setup-r7s72100.o
 
 # Clock objects
-ifndef CONFIG_COMMON_CLK
 obj-y                          += clock.o
+ifndef CONFIG_COMMON_CLK
 obj-$(CONFIG_ARCH_SH7372)      += clock-sh7372.o
 obj-$(CONFIG_ARCH_SH73A0)      += clock-sh73a0.o
 obj-$(CONFIG_ARCH_R8A73A4)     += clock-r8a73a4.o
@@ -31,7 +31,6 @@ obj-$(CONFIG_ARCH_R8A7778)    += clock-r8a7778.o
 obj-$(CONFIG_ARCH_R8A7779)     += clock-r8a7779.o
 obj-$(CONFIG_ARCH_R8A7790)     += clock-r8a7790.o
 obj-$(CONFIG_ARCH_R8A7791)     += clock-r8a7791.o
-obj-$(CONFIG_ARCH_EMEV2)       += clock-emev2.o
 obj-$(CONFIG_ARCH_R7S72100)    += clock-r7s72100.o
 endif
 
index 57d1a78367b6aa17accfddc013132b8328d9b5f5..57d246eb8813b111258730762e0ccfa227d993d0 100644 (file)
@@ -187,7 +187,7 @@ static const char *eva_boards_compat_dt[] __initdata = {
 
 DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva-reference")
        .map_io         = r8a7740_map_io,
-       .init_early     = r8a7740_init_delay,
+       .init_early     = shmobile_init_delay,
        .init_irq       = r8a7740_init_irq_of,
        .init_machine   = eva_init,
        .init_late      = shmobile_init_late,
index 486063db2a2ffd501ca67cf7d62f0e0750464010..48a1453b3378c04a10244cdcceadc9928092bab8 100644 (file)
@@ -1300,11 +1300,6 @@ static void __init eva_earlytimer_init(void)
        eva_clock_init();
 }
 
-static void __init eva_add_early_devices(void)
-{
-       r8a7740_add_early_devices();
-}
-
 #define RESCNT2 IOMEM(0xe6188020)
 static void eva_restart(enum reboot_mode mode, const char *cmd)
 {
@@ -1319,7 +1314,7 @@ static const char *eva_boards_compat_dt[] __initdata = {
 
 DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva")
        .map_io         = r8a7740_map_io,
-       .init_early     = eva_add_early_devices,
+       .init_early     = r8a7740_add_early_devices,
        .init_irq       = r8a7740_init_irq_of,
        .init_machine   = eva_init,
        .init_late      = shmobile_init_late,
index b4122f8cb8d9ff986b62948db81755a6a6ba0248..f444be2f241ed5ca7b1f38a970042272937ba246 100644 (file)
@@ -345,24 +345,39 @@ static struct rsnd_ssi_platform_info rsnd_ssi[] = {
        RSND_SSI_UNUSED, /* SSI 0 */
        RSND_SSI_UNUSED, /* SSI 1 */
        RSND_SSI_UNUSED, /* SSI 2 */
-       RSND_SSI_SET(1, HPBDMA_SLAVE_HPBIF3_TX, gic_iid(0x85), RSND_SSI_PLAY),
-       RSND_SSI_SET(2, HPBDMA_SLAVE_HPBIF4_RX, gic_iid(0x85), RSND_SSI_CLK_PIN_SHARE),
-       RSND_SSI_SET(0, HPBDMA_SLAVE_HPBIF5_TX, gic_iid(0x86), RSND_SSI_PLAY),
-       RSND_SSI_SET(0, HPBDMA_SLAVE_HPBIF6_RX, gic_iid(0x86), 0),
-       RSND_SSI_SET(3, HPBDMA_SLAVE_HPBIF7_TX, gic_iid(0x86), RSND_SSI_PLAY),
-       RSND_SSI_SET(4, HPBDMA_SLAVE_HPBIF8_RX, gic_iid(0x86), RSND_SSI_CLK_PIN_SHARE),
+       RSND_SSI(HPBDMA_SLAVE_HPBIF3_TX, gic_iid(0x85), 0),
+       RSND_SSI(HPBDMA_SLAVE_HPBIF4_RX, gic_iid(0x85), RSND_SSI_CLK_PIN_SHARE),
+       RSND_SSI(HPBDMA_SLAVE_HPBIF5_TX, gic_iid(0x86), 0),
+       RSND_SSI(HPBDMA_SLAVE_HPBIF6_RX, gic_iid(0x86), 0),
+       RSND_SSI(HPBDMA_SLAVE_HPBIF7_TX, gic_iid(0x86), 0),
+       RSND_SSI(HPBDMA_SLAVE_HPBIF8_RX, gic_iid(0x86), RSND_SSI_CLK_PIN_SHARE),
 };
 
-static struct rsnd_scu_platform_info rsnd_scu[9] = {
-       { .flags = 0, }, /* SRU 0 */
-       { .flags = 0, }, /* SRU 1 */
-       { .flags = 0, }, /* SRU 2 */
-       { .flags = RSND_SCU_USE_HPBIF, },
-       { .flags = RSND_SCU_USE_HPBIF, },
-       { .flags = RSND_SCU_USE_HPBIF, },
-       { .flags = RSND_SCU_USE_HPBIF, },
-       { .flags = RSND_SCU_USE_HPBIF, },
-       { .flags = RSND_SCU_USE_HPBIF, },
+static struct rsnd_src_platform_info rsnd_src[9] = {
+       RSND_SRC_UNUSED, /* SRU 0 */
+       RSND_SRC_UNUSED, /* SRU 1 */
+       RSND_SRC_UNUSED, /* SRU 2 */
+       RSND_SRC(0, 0),
+       RSND_SRC(0, 0),
+       RSND_SRC(0, 0),
+       RSND_SRC(0, 0),
+       RSND_SRC(0, 0),
+       RSND_SRC(0, 0),
+};
+
+static struct rsnd_dai_platform_info rsnd_dai[] = {
+       {
+               .playback = { .ssi = &rsnd_ssi[5], .src = &rsnd_src[5] },
+               .capture  = { .ssi = &rsnd_ssi[6], .src = &rsnd_src[6] },
+       }, {
+               .playback = { .ssi = &rsnd_ssi[3], .src = &rsnd_src[3] },
+       }, {
+               .capture  = { .ssi = &rsnd_ssi[4], .src = &rsnd_src[4] },
+       }, {
+               .playback = { .ssi = &rsnd_ssi[7], .src = &rsnd_src[7] },
+       }, {
+               .capture  = { .ssi = &rsnd_ssi[8], .src = &rsnd_src[8] },
+       },
 };
 
 enum {
@@ -437,8 +452,10 @@ static struct rcar_snd_info rsnd_info = {
        .flags          = RSND_GEN1,
        .ssi_info       = rsnd_ssi,
        .ssi_info_nr    = ARRAY_SIZE(rsnd_ssi),
-       .scu_info       = rsnd_scu,
-       .scu_info_nr    = ARRAY_SIZE(rsnd_scu),
+       .src_info       = rsnd_src,
+       .src_info_nr    = ARRAY_SIZE(rsnd_src),
+       .dai_info       = rsnd_dai,
+       .dai_info_nr    = ARRAY_SIZE(rsnd_dai),
        .start          = rsnd_start,
        .stop           = rsnd_stop,
 };
@@ -591,6 +608,7 @@ static void __init bockw_init(void)
 {
        void __iomem *base;
        struct clk *clk;
+       struct platform_device *pdev;
        int i;
 
        r8a7778_clock_init();
@@ -673,9 +691,6 @@ static void __init bockw_init(void)
        }
 
        /* for Audio */
-       clk = clk_get(NULL, "audio_clk_b");
-       clk_set_rate(clk, 24576000);
-       clk_put(clk);
        rsnd_codec_power(5, 1); /* enable ak4642 */
 
        platform_device_register_simple(
@@ -684,11 +699,15 @@ static void __init bockw_init(void)
        platform_device_register_simple(
                "ak4554-adc-dac", 1, NULL, 0);
 
-       platform_device_register_resndata(
+       pdev = platform_device_register_resndata(
                &platform_bus, "rcar_sound", -1,
                rsnd_resources, ARRAY_SIZE(rsnd_resources),
                &rsnd_info, sizeof(rsnd_info));
 
+       clk = clk_get(&pdev->dev, "clk_b");
+       clk_set_rate(clk, 24576000);
+       clk_put(clk);
+
        for (i = 0; i < ARRAY_SIZE(rsnd_card_info); i++) {
                struct platform_device_info cardinfo = {
                        .parent         = &platform_bus,
index a3fd30242bd87d2a8c77f2c6ade2a3c96259e039..b244a3b21474b6a0b59ff73c8cdd607593f6bdb3 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <linux/clk.h>
-#include <linux/clkdev.h>
 #include <linux/dma-mapping.h>
 #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>
@@ -82,49 +81,50 @@ static void __init koelsch_add_du_device(void)
        platform_device_register_full(&info);
 }
 
-static void __init koelsch_add_standard_devices(void)
-{
-       /*
-        * This is a really crude hack to provide clkdev support to the CMT and
-        * DU devices until they get moved to DT.
-        */
-       static const struct clk_name {
-               const char *clk;
-               const char *con_id;
-               const char *dev_id;
-       } clk_names[] = {
-               { "cmt0", NULL, "sh_cmt.0" },
-               { "scifa0", NULL, "sh-sci.0" },
-               { "scifa1", NULL, "sh-sci.1" },
-               { "scifb0", NULL, "sh-sci.2" },
-               { "scifb1", NULL, "sh-sci.3" },
-               { "scifb2", NULL, "sh-sci.4" },
-               { "scifa2", NULL, "sh-sci.5" },
-               { "scif0", NULL, "sh-sci.6" },
-               { "scif1", NULL, "sh-sci.7" },
-               { "scif2", NULL, "sh-sci.8" },
-               { "scif3", NULL, "sh-sci.9" },
-               { "scif4", NULL, "sh-sci.10" },
-               { "scif5", NULL, "sh-sci.11" },
-               { "scifa3", NULL, "sh-sci.12" },
-               { "scifa4", NULL, "sh-sci.13" },
-               { "scifa5", NULL, "sh-sci.14" },
-               { "du0", "du.0", "rcar-du-r8a7791" },
-               { "du1", "du.1", "rcar-du-r8a7791" },
-               { "lvds0", "lvds.0", "rcar-du-r8a7791" },
-       };
-       struct clk *clk;
-       unsigned int i;
+/*
+ * 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 = {
+       { "cmt0", NULL, "sh_cmt.0" },
+       { "scifa0", NULL, "sh-sci.0" },
+       { "scifa1", NULL, "sh-sci.1" },
+       { "scifb0", NULL, "sh-sci.2" },
+       { "scifb1", NULL, "sh-sci.3" },
+       { "scifb2", NULL, "sh-sci.4" },
+       { "scifa2", NULL, "sh-sci.5" },
+       { "scif0", NULL, "sh-sci.6" },
+       { "scif1", NULL, "sh-sci.7" },
+       { "scif2", NULL, "sh-sci.8" },
+       { "scif3", NULL, "sh-sci.9" },
+       { "scif4", NULL, "sh-sci.10" },
+       { "scif5", NULL, "sh-sci.11" },
+       { "scifa3", NULL, "sh-sci.12" },
+       { "scifa4", NULL, "sh-sci.13" },
+       { "scifa5", NULL, "sh-sci.14" },
+       { "du0", "du.0", "rcar-du-r8a7791" },
+       { "du1", "du.1", "rcar-du-r8a7791" },
+       { "lvds0", "lvds.0", "rcar-du-r8a7791" },
+};
 
-       for (i = 0; i < ARRAY_SIZE(clk_names); ++i) {
-               clk = clk_get(NULL, clk_names[i].clk);
-               if (!IS_ERR(clk)) {
-                       clk_register_clkdev(clk, clk_names[i].con_id,
-                                           clk_names[i].dev_id);
-                       clk_put(clk);
-               }
-       }
+/*
+ * This is a really crude hack to work around core platform clock issues
+ */
+static const struct clk_name clk_enables[] __initconst = {
+       { "ether", NULL, "ee700000.ethernet" },
+       { "i2c2", NULL, "e6530000.i2c" },
+       { "msiof0", NULL, "e6e20000.spi" },
+       { "qspi_mod", NULL, "e6b10000.spi" },
+       { "sdhi0", NULL, "ee100000.sd" },
+       { "sdhi1", NULL, "ee140000.sd" },
+       { "sdhi2", NULL, "ee160000.sd" },
+       { "thermal", NULL, "e61f0000.thermal" },
+};
 
+static void __init koelsch_add_standard_devices(void)
+{
+       shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false);
+       shmobile_clk_workaround(clk_enables, ARRAY_SIZE(clk_enables), true);
        r8a7791_add_dt_devices();
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 
@@ -139,7 +139,7 @@ static const char * const koelsch_boards_compat_dt[] __initconst = {
 
 DT_MACHINE_START(KOELSCH_DT, "koelsch")
        .smp            = smp_ops(r8a7791_smp_ops),
-       .init_early     = r8a7791_init_early,
+       .init_early     = shmobile_init_delay,
        .init_time      = rcar_gen2_timer_init,
        .init_machine   = koelsch_add_standard_devices,
        .init_late      = shmobile_init_late,
index 5a034ff405d001c82e9c79872296719691f4a378..c6c68892caa3a96f251075a1038d2b52f60bc0ad 100644 (file)
@@ -216,7 +216,7 @@ static const struct spi_board_info spi_info[] __initconst = {
        {
                .modalias       = "m25p80",
                .platform_data  = &spi_flash_data,
-               .mode           = SPI_MODE_0,
+               .mode           = SPI_MODE_0 | SPI_TX_QUAD | SPI_RX_QUAD,
                .max_speed_hz   = 30000000,
                .bus_num        = 0,
                .chip_select    = 0,
@@ -522,7 +522,7 @@ static const char * const koelsch_boards_compat_dt[] __initconst = {
 
 DT_MACHINE_START(KOELSCH_DT, "koelsch")
        .smp            = smp_ops(r8a7791_smp_ops),
-       .init_early     = r8a7791_init_early,
+       .init_early     = shmobile_init_delay,
        .init_time      = rcar_gen2_timer_init,
        .init_machine   = koelsch_init,
        .init_late      = shmobile_init_late,
index 440aac36d6938d1e58b78618d1d1f599665d1f96..1eb48cffb4c583e05749721d0e79427aab805be7 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <linux/clk.h>
-#include <linux/clkdev.h>
 #include <linux/dma-mapping.h>
 #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>
@@ -86,46 +85,46 @@ static void __init lager_add_du_device(void)
        platform_device_register_full(&info);
 }
 
-static void __init lager_add_standard_devices(void)
-{
-       /*
-        * This is a really crude hack to provide clkdev support to platform
-        * devices until they get moved to DT.
-        */
-       static const struct clk_name {
-               const char *clk;
-               const char *con_id;
-               const char *dev_id;
-       } clk_names[] = {
-               { "cmt0", NULL, "sh_cmt.0" },
-               { "scifa0", NULL, "sh-sci.0" },
-               { "scifa1", NULL, "sh-sci.1" },
-               { "scifb0", NULL, "sh-sci.2" },
-               { "scifb1", NULL, "sh-sci.3" },
-               { "scifb2", NULL, "sh-sci.4" },
-               { "scifa2", NULL, "sh-sci.5" },
-               { "scif0", NULL, "sh-sci.6" },
-               { "scif1", NULL, "sh-sci.7" },
-               { "hscif0", NULL, "sh-sci.8" },
-               { "hscif1", NULL, "sh-sci.9" },
-               { "du0", "du.0", "rcar-du-r8a7790" },
-               { "du1", "du.1", "rcar-du-r8a7790" },
-               { "du2", "du.2", "rcar-du-r8a7790" },
-               { "lvds0", "lvds.0", "rcar-du-r8a7790" },
-               { "lvds1", "lvds.1", "rcar-du-r8a7790" },
-       };
-       struct clk *clk;
-       unsigned int i;
+/*
+ * 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 = {
+       { "cmt0", NULL, "sh_cmt.0" },
+       { "scifa0", NULL, "sh-sci.0" },
+       { "scifa1", NULL, "sh-sci.1" },
+       { "scifb0", NULL, "sh-sci.2" },
+       { "scifb1", NULL, "sh-sci.3" },
+       { "scifb2", NULL, "sh-sci.4" },
+       { "scifa2", NULL, "sh-sci.5" },
+       { "scif0", NULL, "sh-sci.6" },
+       { "scif1", NULL, "sh-sci.7" },
+       { "hscif0", NULL, "sh-sci.8" },
+       { "hscif1", NULL, "sh-sci.9" },
+       { "du0", "du.0", "rcar-du-r8a7790" },
+       { "du1", "du.1", "rcar-du-r8a7790" },
+       { "du2", "du.2", "rcar-du-r8a7790" },
+       { "lvds0", "lvds.0", "rcar-du-r8a7790" },
+       { "lvds1", "lvds.1", "rcar-du-r8a7790" },
+};
 
-       for (i = 0; i < ARRAY_SIZE(clk_names); ++i) {
-               clk = clk_get(NULL, clk_names[i].clk);
-               if (!IS_ERR(clk)) {
-                       clk_register_clkdev(clk, clk_names[i].con_id,
-                                           clk_names[i].dev_id);
-                       clk_put(clk);
-               }
-       }
+/*
+ * This is a really crude hack to work around core platform clock issues
+ */
+static const struct clk_name clk_enables[] __initconst = {
+       { "ether", NULL, "ee700000.ethernet" },
+       { "msiof1", NULL, "e6e10000.spi" },
+       { "mmcif1", NULL, "ee220000.mmc" },
+       { "qspi_mod", NULL, "e6b10000.spi" },
+       { "sdhi0", NULL, "ee100000.sd" },
+       { "sdhi2", NULL, "ee140000.sd" },
+       { "thermal", NULL, "e61f0000.thermal" },
+};
 
+static void __init lager_add_standard_devices(void)
+{
+       shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false);
+       shmobile_clk_workaround(clk_enables, ARRAY_SIZE(clk_enables), true);
        r8a7790_add_dt_devices();
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 
index 18c7e0311aa679c60a634963a3f64ddf7484dffd..f8b1e05463ccde8e0c835affdb1fe7b49b13038c 100644 (file)
@@ -325,12 +325,12 @@ static const struct rspi_plat_data qspi_pdata __initconst = {
 
 static const struct spi_board_info spi_info[] __initconst = {
        {
-               .modalias               = "m25p80",
-               .platform_data          = &spi_flash_data,
-               .mode                   = SPI_MODE_0,
-               .max_speed_hz           = 30000000,
-               .bus_num                = 0,
-               .chip_select            = 0,
+               .modalias       = "m25p80",
+               .platform_data  = &spi_flash_data,
+               .mode           = SPI_MODE_0 | SPI_TX_QUAD | SPI_RX_QUAD,
+               .max_speed_hz   = 30000000,
+               .bus_num        = 0,
+               .chip_select    = 0,
        },
 };
 
@@ -567,20 +567,27 @@ static struct resource rsnd_resources[] __initdata = {
 };
 
 static struct rsnd_ssi_platform_info rsnd_ssi[] = {
-       RSND_SSI_SET(0, 0, gic_spi(370), RSND_SSI_PLAY),
-       RSND_SSI_SET(0, 0, gic_spi(371), RSND_SSI_CLK_PIN_SHARE),
+       RSND_SSI(0, gic_spi(370), 0),
+       RSND_SSI(0, gic_spi(371), RSND_SSI_CLK_PIN_SHARE),
 };
 
-static struct rsnd_scu_platform_info rsnd_scu[2] = {
+static struct rsnd_src_platform_info rsnd_src[2] = {
        /* no member at this point */
 };
 
+static struct rsnd_dai_platform_info rsnd_dai = {
+       .playback = { .ssi = &rsnd_ssi[0], },
+       .capture  = { .ssi = &rsnd_ssi[1], },
+};
+
 static struct rcar_snd_info rsnd_info = {
        .flags          = RSND_GEN2,
        .ssi_info       = rsnd_ssi,
        .ssi_info_nr    = ARRAY_SIZE(rsnd_ssi),
-       .scu_info       = rsnd_scu,
-       .scu_info_nr    = ARRAY_SIZE(rsnd_scu),
+       .src_info       = rsnd_src,
+       .src_info_nr    = ARRAY_SIZE(rsnd_src),
+       .dai_info       = &rsnd_dai,
+       .dai_info_nr    = 1,
 };
 
 static struct asoc_simple_card_info rsnd_card_info = {
diff --git a/arch/arm/mach-shmobile/clock-emev2.c b/arch/arm/mach-shmobile/clock-emev2.c
deleted file mode 100644 (file)
index 5ac13ba..0000000
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Emma Mobile EV2 clock framework support
- *
- * Copyright (C) 2012  Magnus Damm
- *
- * 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
- */
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/io.h>
-#include <linux/sh_clk.h>
-#include <linux/clkdev.h>
-#include <mach/common.h>
-
-#define EMEV2_SMU_BASE 0xe0110000
-
-/* EMEV2 SMU registers */
-#define USIAU0_RSTCTRL 0x094
-#define USIBU1_RSTCTRL 0x0ac
-#define USIBU2_RSTCTRL 0x0b0
-#define USIBU3_RSTCTRL 0x0b4
-#define STI_RSTCTRL 0x124
-#define USIAU0GCLKCTRL 0x4a0
-#define USIBU1GCLKCTRL 0x4b8
-#define USIBU2GCLKCTRL 0x4bc
-#define USIBU3GCLKCTRL 0x04c0
-#define STIGCLKCTRL 0x528
-#define USIAU0SCLKDIV 0x61c
-#define USIB2SCLKDIV 0x65c
-#define USIB3SCLKDIV 0x660
-#define STI_CLKSEL 0x688
-
-/* not pretty, but hey */
-static void __iomem *smu_base;
-
-static void emev2_smu_write(unsigned long value, int offs)
-{
-       BUG_ON(!smu_base || (offs >= PAGE_SIZE));
-       iowrite32(value, smu_base + offs);
-}
-
-static struct clk_mapping smu_mapping = {
-       .phys   = EMEV2_SMU_BASE,
-       .len    = PAGE_SIZE,
-};
-
-/* Fixed 32 KHz root clock from C32K pin */
-static struct clk c32k_clk = {
-       .rate           = 32768,
-       .mapping        = &smu_mapping,
-};
-
-/* PLL3 multiplies C32K with 7000 */
-static unsigned long pll3_recalc(struct clk *clk)
-{
-       return clk->parent->rate * 7000;
-}
-
-static struct sh_clk_ops pll3_clk_ops = {
-       .recalc         = pll3_recalc,
-};
-
-static struct clk pll3_clk = {
-       .ops            = &pll3_clk_ops,
-       .parent         = &c32k_clk,
-};
-
-static struct clk *main_clks[] = {
-       &c32k_clk,
-       &pll3_clk,
-};
-
-enum { SCLKDIV_USIAU0, SCLKDIV_USIBU2, SCLKDIV_USIBU1, SCLKDIV_USIBU3,
-       SCLKDIV_NR };
-
-#define SCLKDIV(_reg, _shift)                  \
-{                                                              \
-       .parent         = &pll3_clk,                            \
-       .enable_reg     = IOMEM(EMEV2_SMU_BASE + (_reg)),       \
-       .enable_bit     = _shift,                               \
-}
-
-static struct clk sclkdiv_clks[SCLKDIV_NR] = {
-       [SCLKDIV_USIAU0] = SCLKDIV(USIAU0SCLKDIV, 0),
-       [SCLKDIV_USIBU2] = SCLKDIV(USIB2SCLKDIV, 16),
-       [SCLKDIV_USIBU1] = SCLKDIV(USIB2SCLKDIV, 0),
-       [SCLKDIV_USIBU3] = SCLKDIV(USIB3SCLKDIV, 0),
-};
-
-enum { GCLK_USIAU0_SCLK, GCLK_USIBU1_SCLK, GCLK_USIBU2_SCLK, GCLK_USIBU3_SCLK,
-       GCLK_STI_SCLK,
-       GCLK_NR };
-
-#define GCLK_SCLK(_parent, _reg) \
-{                                                              \
-       .parent         = _parent,                              \
-       .enable_reg     = IOMEM(EMEV2_SMU_BASE + (_reg)),       \
-       .enable_bit     = 1, /* SCLK_GCC */                     \
-}
-
-static struct clk gclk_clks[GCLK_NR] = {
-       [GCLK_USIAU0_SCLK] = GCLK_SCLK(&sclkdiv_clks[SCLKDIV_USIAU0],
-                                      USIAU0GCLKCTRL),
-       [GCLK_USIBU1_SCLK] = GCLK_SCLK(&sclkdiv_clks[SCLKDIV_USIBU1],
-                                      USIBU1GCLKCTRL),
-       [GCLK_USIBU2_SCLK] = GCLK_SCLK(&sclkdiv_clks[SCLKDIV_USIBU2],
-                                      USIBU2GCLKCTRL),
-       [GCLK_USIBU3_SCLK] = GCLK_SCLK(&sclkdiv_clks[SCLKDIV_USIBU3],
-                                      USIBU3GCLKCTRL),
-       [GCLK_STI_SCLK] = GCLK_SCLK(&c32k_clk, STIGCLKCTRL),
-};
-
-static int emev2_gclk_enable(struct clk *clk)
-{
-       iowrite32(ioread32(clk->mapped_reg) | (1 << clk->enable_bit),
-                 clk->mapped_reg);
-       return 0;
-}
-
-static void emev2_gclk_disable(struct clk *clk)
-{
-       iowrite32(ioread32(clk->mapped_reg) & ~(1 << clk->enable_bit),
-                 clk->mapped_reg);
-}
-
-static struct sh_clk_ops emev2_gclk_clk_ops = {
-       .enable         = emev2_gclk_enable,
-       .disable        = emev2_gclk_disable,
-       .recalc         = followparent_recalc,
-};
-
-static int __init emev2_gclk_register(struct clk *clks, int nr)
-{
-       struct clk *clkp;
-       int ret = 0;
-       int k;
-
-       for (k = 0; !ret && (k < nr); k++) {
-               clkp = clks + k;
-               clkp->ops = &emev2_gclk_clk_ops;
-               ret |= clk_register(clkp);
-       }
-
-       return ret;
-}
-
-static unsigned long emev2_sclkdiv_recalc(struct clk *clk)
-{
-       unsigned int sclk_div;
-
-       sclk_div = (ioread32(clk->mapped_reg) >> clk->enable_bit) & 0xff;
-
-       return clk->parent->rate / (sclk_div + 1);
-}
-
-static struct sh_clk_ops emev2_sclkdiv_clk_ops = {
-       .recalc         = emev2_sclkdiv_recalc,
-};
-
-static int __init emev2_sclkdiv_register(struct clk *clks, int nr)
-{
-       struct clk *clkp;
-       int ret = 0;
-       int k;
-
-       for (k = 0; !ret && (k < nr); k++) {
-               clkp = clks + k;
-               clkp->ops = &emev2_sclkdiv_clk_ops;
-               ret |= clk_register(clkp);
-       }
-
-       return ret;
-}
-
-static struct clk_lookup lookups[] = {
-       CLKDEV_DEV_ID("serial8250-em.0", &gclk_clks[GCLK_USIAU0_SCLK]),
-       CLKDEV_DEV_ID("e1020000.uart", &gclk_clks[GCLK_USIAU0_SCLK]),
-       CLKDEV_DEV_ID("serial8250-em.1", &gclk_clks[GCLK_USIBU1_SCLK]),
-       CLKDEV_DEV_ID("e1030000.uart", &gclk_clks[GCLK_USIBU1_SCLK]),
-       CLKDEV_DEV_ID("serial8250-em.2", &gclk_clks[GCLK_USIBU2_SCLK]),
-       CLKDEV_DEV_ID("e1040000.uart", &gclk_clks[GCLK_USIBU2_SCLK]),
-       CLKDEV_DEV_ID("serial8250-em.3", &gclk_clks[GCLK_USIBU3_SCLK]),
-       CLKDEV_DEV_ID("e1050000.uart", &gclk_clks[GCLK_USIBU3_SCLK]),
-       CLKDEV_DEV_ID("em_sti.0", &gclk_clks[GCLK_STI_SCLK]),
-       CLKDEV_DEV_ID("e0180000.sti", &gclk_clks[GCLK_STI_SCLK]),
-};
-
-void __init emev2_clock_init(void)
-{
-       int k, ret = 0;
-
-       smu_base = ioremap(EMEV2_SMU_BASE, PAGE_SIZE);
-       BUG_ON(!smu_base);
-
-       /* setup STI timer to run on 32.768 kHz and deassert reset */
-       emev2_smu_write(0, STI_CLKSEL);
-       emev2_smu_write(1, STI_RSTCTRL);
-
-       /* deassert reset for UART0->UART3 */
-       emev2_smu_write(2, USIAU0_RSTCTRL);
-       emev2_smu_write(2, USIBU1_RSTCTRL);
-       emev2_smu_write(2, USIBU2_RSTCTRL);
-       emev2_smu_write(2, USIBU3_RSTCTRL);
-
-       for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
-               ret = clk_register(main_clks[k]);
-
-       if (!ret)
-               ret = emev2_sclkdiv_register(sclkdiv_clks, SCLKDIV_NR);
-
-       if (!ret)
-               ret = emev2_gclk_register(gclk_clks, GCLK_NR);
-
-       clkdev_add_table(lookups, ARRAY_SIZE(lookups));
-
-       if (!ret)
-               shmobile_clk_init();
-       else
-               panic("failed to setup emev2 clocks\n");
-}
index dd989f93498f66bca2534f4a9daac35fe14ab7ef..433ec674ead1832f690b4c51255c2704195e1934 100644 (file)
@@ -596,7 +596,7 @@ static struct clk_lookup lookups[] = {
        CLKDEV_DEV_ID("sh_mmcif",               &mstp_clks[MSTP312]),
        CLKDEV_DEV_ID("e6bd0000.mmc",           &mstp_clks[MSTP312]),
        CLKDEV_DEV_ID("r8a7740-gether",         &mstp_clks[MSTP309]),
-       CLKDEV_DEV_ID("e9a00000.sh-eth",        &mstp_clks[MSTP309]),
+       CLKDEV_DEV_ID("e9a00000.ethernet",      &mstp_clks[MSTP309]),
        CLKDEV_DEV_ID("renesas-tpu-pwm",        &mstp_clks[MSTP304]),
        CLKDEV_DEV_ID("e6600000.pwm",           &mstp_clks[MSTP304]),
 
index 9989b1b06ffd7dae363552e4d1b973f99f423f0a..6609beb9b9b4d6516b0af89f1d3f1c66c4028e94 100644 (file)
@@ -175,10 +175,6 @@ static struct clk mstp_clks[MSTP_NR] = {
 
 static struct clk_lookup lookups[] = {
        /* main */
-       CLKDEV_CON_ID("audio_clk_a",    &audio_clk_a),
-       CLKDEV_CON_ID("audio_clk_b",    &audio_clk_b),
-       CLKDEV_CON_ID("audio_clk_c",    &audio_clk_c),
-       CLKDEV_CON_ID("audio_clk_internal",     &s1_clk),
        CLKDEV_CON_ID("shyway_clk",     &s_clk),
        CLKDEV_CON_ID("peripheral_clk", &p_clk),
 
@@ -234,15 +230,15 @@ static struct clk_lookup lookups[] = {
        CLKDEV_ICK_ID("ssi.6", "rcar_sound", &mstp_clks[MSTP309]),
        CLKDEV_ICK_ID("ssi.7", "rcar_sound", &mstp_clks[MSTP308]),
        CLKDEV_ICK_ID("ssi.8", "rcar_sound", &mstp_clks[MSTP307]),
-       CLKDEV_ICK_ID("scu.0", "rcar_sound", &mstp_clks[MSTP531]),
-       CLKDEV_ICK_ID("scu.1", "rcar_sound", &mstp_clks[MSTP530]),
-       CLKDEV_ICK_ID("scu.2", "rcar_sound", &mstp_clks[MSTP529]),
-       CLKDEV_ICK_ID("scu.3", "rcar_sound", &mstp_clks[MSTP528]),
-       CLKDEV_ICK_ID("scu.4", "rcar_sound", &mstp_clks[MSTP527]),
-       CLKDEV_ICK_ID("scu.5", "rcar_sound", &mstp_clks[MSTP526]),
-       CLKDEV_ICK_ID("scu.6", "rcar_sound", &mstp_clks[MSTP525]),
-       CLKDEV_ICK_ID("scu.7", "rcar_sound", &mstp_clks[MSTP524]),
-       CLKDEV_ICK_ID("scu.8", "rcar_sound", &mstp_clks[MSTP523]),
+       CLKDEV_ICK_ID("src.0", "rcar_sound", &mstp_clks[MSTP531]),
+       CLKDEV_ICK_ID("src.1", "rcar_sound", &mstp_clks[MSTP530]),
+       CLKDEV_ICK_ID("src.2", "rcar_sound", &mstp_clks[MSTP529]),
+       CLKDEV_ICK_ID("src.3", "rcar_sound", &mstp_clks[MSTP528]),
+       CLKDEV_ICK_ID("src.4", "rcar_sound", &mstp_clks[MSTP527]),
+       CLKDEV_ICK_ID("src.5", "rcar_sound", &mstp_clks[MSTP526]),
+       CLKDEV_ICK_ID("src.6", "rcar_sound", &mstp_clks[MSTP525]),
+       CLKDEV_ICK_ID("src.7", "rcar_sound", &mstp_clks[MSTP524]),
+       CLKDEV_ICK_ID("src.8", "rcar_sound", &mstp_clks[MSTP523]),
 };
 
 void __init r8a7778_clock_init(void)
index 3f93503f5b96f123fc2441abcd37eccc09972dc4..a936ae7de0838602eddb2fe80690c0f009f7089c 100644 (file)
@@ -249,10 +249,10 @@ static struct clk mstp_clks[MSTP_NR] = {
        [MSTP1007] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 7, MSTPSR10, 0), /* SSI8 */
        [MSTP1006] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 6, MSTPSR10, 0), /* SSI9 */
        [MSTP1005] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 5, MSTPSR10, 0), /* SSI ALL */
-       [MSTP931] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 31, MSTPSR9, 0), /* I2C0 */
-       [MSTP930] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 30, MSTPSR9, 0), /* I2C1 */
-       [MSTP929] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 29, MSTPSR9, 0), /* I2C2 */
-       [MSTP928] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 28, MSTPSR9, 0), /* I2C3 */
+       [MSTP931] = SH_CLK_MSTP32_STS(&hp_clk, SMSTPCR9, 31, MSTPSR9, 0), /* I2C0 */
+       [MSTP930] = SH_CLK_MSTP32_STS(&hp_clk, SMSTPCR9, 30, MSTPSR9, 0), /* I2C1 */
+       [MSTP929] = SH_CLK_MSTP32_STS(&hp_clk, SMSTPCR9, 29, MSTPSR9, 0), /* I2C2 */
+       [MSTP928] = SH_CLK_MSTP32_STS(&hp_clk, SMSTPCR9, 28, MSTPSR9, 0), /* I2C3 */
        [MSTP917] = SH_CLK_MSTP32_STS(&qspi_clk, SMSTPCR9, 17, MSTPSR9, 0), /* QSPI */
        [MSTP815] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 15, MSTPSR8, 0), /* SATA0 */
        [MSTP814] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 14, MSTPSR8, 0), /* SATA1 */
@@ -294,10 +294,6 @@ static struct clk mstp_clks[MSTP_NR] = {
 static struct clk_lookup lookups[] = {
 
        /* main clocks */
-       CLKDEV_CON_ID("audio_clk_a",    &audio_clk_a),
-       CLKDEV_CON_ID("audio_clk_b",    &audio_clk_b),
-       CLKDEV_CON_ID("audio_clk_c",    &audio_clk_c),
-       CLKDEV_CON_ID("audio_clk_internal",     &m2_clk),
        CLKDEV_CON_ID("extal",          &extal_clk),
        CLKDEV_CON_ID("extal_div2",     &extal_div2_clk),
        CLKDEV_CON_ID("main",           &main_clk),
@@ -381,16 +377,16 @@ static struct clk_lookup lookups[] = {
        CLKDEV_ICK_ID("clk_b", "rcar_sound", &audio_clk_b),
        CLKDEV_ICK_ID("clk_c", "rcar_sound", &audio_clk_c),
        CLKDEV_ICK_ID("clk_i", "rcar_sound", &m2_clk),
-       CLKDEV_ICK_ID("scu.0", "rcar_sound", &mstp_clks[MSTP1031]),
-       CLKDEV_ICK_ID("scu.1", "rcar_sound", &mstp_clks[MSTP1030]),
-       CLKDEV_ICK_ID("scu.2", "rcar_sound", &mstp_clks[MSTP1029]),
-       CLKDEV_ICK_ID("scu.3", "rcar_sound", &mstp_clks[MSTP1028]),
-       CLKDEV_ICK_ID("scu.4", "rcar_sound", &mstp_clks[MSTP1027]),
-       CLKDEV_ICK_ID("scu.5", "rcar_sound", &mstp_clks[MSTP1026]),
-       CLKDEV_ICK_ID("scu.6", "rcar_sound", &mstp_clks[MSTP1025]),
-       CLKDEV_ICK_ID("scu.7", "rcar_sound", &mstp_clks[MSTP1024]),
-       CLKDEV_ICK_ID("scu.8", "rcar_sound", &mstp_clks[MSTP1023]),
-       CLKDEV_ICK_ID("scu.9", "rcar_sound", &mstp_clks[MSTP1022]),
+       CLKDEV_ICK_ID("src.0", "rcar_sound", &mstp_clks[MSTP1031]),
+       CLKDEV_ICK_ID("src.1", "rcar_sound", &mstp_clks[MSTP1030]),
+       CLKDEV_ICK_ID("src.2", "rcar_sound", &mstp_clks[MSTP1029]),
+       CLKDEV_ICK_ID("src.3", "rcar_sound", &mstp_clks[MSTP1028]),
+       CLKDEV_ICK_ID("src.4", "rcar_sound", &mstp_clks[MSTP1027]),
+       CLKDEV_ICK_ID("src.5", "rcar_sound", &mstp_clks[MSTP1026]),
+       CLKDEV_ICK_ID("src.6", "rcar_sound", &mstp_clks[MSTP1025]),
+       CLKDEV_ICK_ID("src.7", "rcar_sound", &mstp_clks[MSTP1024]),
+       CLKDEV_ICK_ID("src.8", "rcar_sound", &mstp_clks[MSTP1023]),
+       CLKDEV_ICK_ID("src.9", "rcar_sound", &mstp_clks[MSTP1022]),
        CLKDEV_ICK_ID("ssi.0", "rcar_sound", &mstp_clks[MSTP1015]),
        CLKDEV_ICK_ID("ssi.1", "rcar_sound", &mstp_clks[MSTP1014]),
        CLKDEV_ICK_ID("ssi.2", "rcar_sound", &mstp_clks[MSTP1013]),
index 701383fe32674141434f08767d375e05e00e8174..3b26c7eee873fbee4ddd281811247154f1659f3e 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/clkdev.h>
 #include <mach/clock.h>
 #include <mach/common.h>
+#include <mach/rcar-gen2.h>
 
 /*
  *   MD                EXTAL           PLL0    PLL1    PLL3
@@ -43,8 +44,6 @@
  *     see "p1 / 2" on R8A7791_CLOCK_ROOT() below
  */
 
-#define MD(nr) (1 << nr)
-
 #define CPG_BASE 0xe6150000
 #define CPG_LEN 0x1000
 
@@ -68,7 +67,6 @@
 #define MSTPSR9                IOMEM(0xe61509a4)
 #define MSTPSR11       IOMEM(0xe61509ac)
 
-#define MODEMR         0xE6160060
 #define SDCKCR         0xE6150074
 #define SD1CKCR                0xE6150078
 #define SD2CKCR                0xE615026c
@@ -190,12 +188,12 @@ static struct clk mstp_clks[MSTP_NR] = {
        [MSTP1108] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR11, 8, MSTPSR11, 0), /* SCIFA5 */
        [MSTP1107] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR11, 7, MSTPSR11, 0), /* SCIFA4 */
        [MSTP1106] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR11, 6, MSTPSR11, 0), /* SCIFA3 */
-       [MSTP931] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 31, MSTPSR9, 0), /* I2C0 */
-       [MSTP930] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 30, MSTPSR9, 0), /* I2C1 */
-       [MSTP929] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 29, MSTPSR9, 0), /* I2C2 */
-       [MSTP928] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 28, MSTPSR9, 0), /* I2C3 */
-       [MSTP927] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 27, MSTPSR9, 0), /* I2C4 */
-       [MSTP925] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 25, MSTPSR9, 0), /* I2C5 */
+       [MSTP931] = SH_CLK_MSTP32_STS(&hp_clk, SMSTPCR9, 31, MSTPSR9, 0), /* I2C0 */
+       [MSTP930] = SH_CLK_MSTP32_STS(&hp_clk, SMSTPCR9, 30, MSTPSR9, 0), /* I2C1 */
+       [MSTP929] = SH_CLK_MSTP32_STS(&hp_clk, SMSTPCR9, 29, MSTPSR9, 0), /* I2C2 */
+       [MSTP928] = SH_CLK_MSTP32_STS(&hp_clk, SMSTPCR9, 28, MSTPSR9, 0), /* I2C3 */
+       [MSTP927] = SH_CLK_MSTP32_STS(&hp_clk, SMSTPCR9, 27, MSTPSR9, 0), /* I2C4 */
+       [MSTP925] = SH_CLK_MSTP32_STS(&hp_clk, SMSTPCR9, 25, MSTPSR9, 0), /* I2C5 */
        [MSTP917] = SH_CLK_MSTP32_STS(&qspi_clk, SMSTPCR9, 17, MSTPSR9, 0), /* QSPI */
        [MSTP815] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 15, MSTPSR8, 0), /* SATA0 */
        [MSTP814] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 14, MSTPSR8, 0), /* SATA1 */
@@ -295,14 +293,9 @@ static struct clk_lookup lookups[] = {
 
 void __init r8a7791_clock_init(void)
 {
-       void __iomem *modemr = ioremap_nocache(MODEMR, PAGE_SIZE);
-       u32 mode;
+       u32 mode = rcar_gen2_read_mode_pins();
        int k, ret = 0;
 
-       BUG_ON(!modemr);
-       mode = ioread32(modemr);
-       iounmap(modemr);
-
        switch (mode & (MD(14) | MD(13))) {
        case 0:
                R8A7791_CLOCK_ROOT(15, &extal_clk, 172, 208, 106, 88);
index ad7df629d995413d7e73338e9a984dbf5870c7e8..e7232a0373b9f51719f8391bff63d0bb40e1ab65 100644 (file)
  */
 #include <linux/kernel.h>
 #include <linux/init.h>
+
+#ifdef CONFIG_COMMON_CLK
+#include <linux/clk.h>
+#include <linux/clkdev.h>
+#include <mach/clock.h>
+
+void __init shmobile_clk_workaround(const struct clk_name *clks,
+                                   int nr_clks, bool enable)
+{
+       const struct clk_name *clkn;
+       struct clk *clk;
+       unsigned int i;
+
+       for (i = 0; i < nr_clks; ++i) {
+               clkn = clks + i;
+               clk = clk_get(NULL, clkn->clk);
+               if (!IS_ERR(clk)) {
+                       clk_register_clkdev(clk, clkn->con_id, clkn->dev_id);
+                       if (enable)
+                               clk_prepare_enable(clk);
+                       clk_put(clk);
+               }
+       }
+}
+
+#else /* CONFIG_COMMON_CLK */
 #include <linux/sh_clk.h>
 #include <linux/export.h>
 #include <mach/clock.h>
@@ -58,3 +84,5 @@ void __clk_put(struct clk *clk)
 {
 }
 EXPORT_SYMBOL(__clk_put);
+
+#endif /* CONFIG_COMMON_CLK */
index 03e56074928c23fcb053b22b0ac523240e3976d8..9a93cf924b9cf09ef28f1ea4d25451025ccabed2 100644 (file)
@@ -1,6 +1,21 @@
 #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 */
+
 unsigned long shmobile_fixed_ratio_clk_recalc(struct clk *clk);
 extern struct sh_clk_ops shmobile_fixed_ratio_clk_ops;
 
@@ -36,4 +51,5 @@ do {                  \
        (p)->div = d;   \
 } while (0)
 
+#endif /* CONFIG_COMMON_CLK */
 #endif
index cb8e32deb2a3c6cadf7efba9f6cb478daa92c241..f7a360edcc3531b3ed62b38458e1d1b296986853 100644 (file)
@@ -4,6 +4,7 @@
 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);
diff --git a/arch/arm/mach-shmobile/include/mach/emev2.h b/arch/arm/mach-shmobile/include/mach/emev2.h
deleted file mode 100644 (file)
index fcb142a..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef __ASM_EMEV2_H__
-#define __ASM_EMEV2_H__
-
-extern void emev2_map_io(void);
-extern void emev2_init_delay(void);
-extern void emev2_clock_init(void);
-extern struct smp_operations emev2_smp_ops;
-
-#endif /* __ASM_EMEV2_H__ */
index d07932f872b6770273a5b227231c60a5cbf5a06f..5e3c9ec06303e1f5de7c8af85f4a6be8538590ae 100644 (file)
@@ -47,7 +47,6 @@ enum {
 };
 
 extern void r8a7740_meram_workaround(void);
-extern void r8a7740_init_delay(void);
 extern void r8a7740_init_irq_of(void);
 extern void r8a7740_map_io(void);
 extern void r8a7740_add_early_devices(void);
index 200fa699f730e81fe8e02336ee69e07cc20e6898..664274cc4b64f17e3352f74f32623e044370ffde 100644 (file)
@@ -5,7 +5,6 @@ void r8a7791_add_standard_devices(void);
 void r8a7791_add_dt_devices(void);
 void r8a7791_clock_init(void);
 void r8a7791_pinmux_init(void);
-void r8a7791_init_early(void);
 extern struct smp_operations r8a7791_smp_ops;
 
 #endif /* __ASM_R8A7791_H__ */
index 1fc05d9453d026df07a1fb383a81f97d6f8d460e..f710235aff2fad5addfb2f0a65363ccf26bfa93f 100644 (file)
@@ -99,39 +99,7 @@ static int rmobile_pd_power_up(struct generic_pm_domain *genpd)
 
 static bool rmobile_pd_active_wakeup(struct device *dev)
 {
-       bool (*active_wakeup)(struct device *dev);
-
-       active_wakeup = dev_gpd_data(dev)->ops.active_wakeup;
-       return active_wakeup ? active_wakeup(dev) : true;
-}
-
-static int rmobile_pd_stop_dev(struct device *dev)
-{
-       int (*stop)(struct device *dev);
-
-       stop = dev_gpd_data(dev)->ops.stop;
-       if (stop) {
-               int ret = stop(dev);
-               if (ret)
-                       return ret;
-       }
-       return pm_clk_suspend(dev);
-}
-
-static int rmobile_pd_start_dev(struct device *dev)
-{
-       int (*start)(struct device *dev);
-       int ret;
-
-       ret = pm_clk_resume(dev);
-       if (ret)
-               return ret;
-
-       start = dev_gpd_data(dev)->ops.start;
-       if (start)
-               ret = start(dev);
-
-       return ret;
+       return true;
 }
 
 static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd)
@@ -140,8 +108,8 @@ static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd)
        struct dev_power_governor *gov = rmobile_pd->gov;
 
        pm_genpd_init(genpd, gov ? : &simple_qos_governor, false);
-       genpd->dev_ops.stop             = rmobile_pd_stop_dev;
-       genpd->dev_ops.start            = rmobile_pd_start_dev;
+       genpd->dev_ops.stop             = pm_clk_suspend;
+       genpd->dev_ops.start            = pm_clk_resume;
        genpd->dev_ops.active_wakeup    = rmobile_pd_active_wakeup;
        genpd->dev_irq_safe             = true;
        genpd->power_off                = rmobile_pd_power_down;
index c71d667007b8e4e79811da67513ff3b06b6c38c4..d953ff6e78a29d884754548f9ea6af974ae74b20 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/init.h>
 #include <linux/of_platform.h>
 #include <mach/common.h>
-#include <mach/emev2.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -38,23 +37,19 @@ static struct map_desc emev2_io_desc[] __initdata = {
 #endif
 };
 
-void __init emev2_map_io(void)
+static void __init emev2_map_io(void)
 {
        iotable_init(emev2_io_desc, ARRAY_SIZE(emev2_io_desc));
 }
 
-void __init emev2_init_delay(void)
+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)
 {
-#ifdef CONFIG_COMMON_CLK
        of_clk_init(NULL);
-#else
-       emev2_clock_init();
-#endif
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
@@ -63,6 +58,8 @@ static const char *emev2_boards_compat_dt[] __initconst = {
        NULL,
 };
 
+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,
index 8f3c68101d59d7f3423e59ee98eb361e73b6a856..2dfd198fb6353eee5f2d7ed52ff3ddc86aa598bb 100644 (file)
@@ -765,7 +765,7 @@ static struct platform_device *r8a7740_late_devices[] __initdata = {
  *     "Media RAM (MERAM)" on r8a7740 documentation
  */
 #define MEBUFCNTR      0xFE950098
-void r8a7740_meram_workaround(void)
+void __init r8a7740_meram_workaround(void)
 {
        void __iomem *reg;
 
@@ -869,17 +869,6 @@ void __init r8a7740_add_early_devices(void)
 
 #ifdef CONFIG_USE_OF
 
-void __init r8a7740_add_early_devices_dt(void)
-{
-       shmobile_setup_delay(800, 1, 3); /* Cortex-A9 @ 800MHz */
-
-       early_platform_add_devices(r8a7740_early_devices,
-                                  ARRAY_SIZE(r8a7740_early_devices));
-
-       /* setup early console here as well */
-       shmobile_setup_console();
-}
-
 void __init r8a7740_add_standard_devices_dt(void)
 {
        platform_add_devices(r8a7740_devices_dt,
@@ -887,11 +876,6 @@ void __init r8a7740_add_standard_devices_dt(void)
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
-void __init r8a7740_init_delay(void)
-{
-       shmobile_setup_delay(800, 1, 3); /* Cortex-A9 @ 800MHz */
-};
-
 void __init r8a7740_init_irq_of(void)
 {
        void __iomem *intc_prio_base = ioremap_nocache(0xe6900010, 0x10);
@@ -935,9 +919,10 @@ static const char *r8a7740_boards_compat_dt[] __initdata = {
 
 DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)")
        .map_io         = r8a7740_map_io,
-       .init_early     = r8a7740_init_delay,
+       .init_early     = shmobile_init_delay,
        .init_irq       = r8a7740_init_irq_of,
        .init_machine   = r8a7740_generic_init,
+       .init_late      = shmobile_init_late,
        .dt_compat      = r8a7740_boards_compat_dt,
 MACHINE_END
 
index c4616f0698c6dcfefc3934cace5fd6c16c37e257..a901d9ef53f61c3f6a891f4ea3f4876ec83a6a3a 100644 (file)
@@ -185,12 +185,6 @@ void __init r8a7790_pinmux_init(void)
        r8a7790_register_gpio(3);
        r8a7790_register_gpio(4);
        r8a7790_register_gpio(5);
-       r8a7790_register_i2c(0);
-       r8a7790_register_i2c(1);
-       r8a7790_register_i2c(2);
-       r8a7790_register_i2c(3);
-       r8a7790_register_audio_dmac(0);
-       r8a7790_register_audio_dmac(1);
 }
 
 #define __R8A7790_SCIF(scif_type, _scscr, index, baseaddr, irq)                \
@@ -308,6 +302,12 @@ void __init r8a7790_add_standard_devices(void)
        r8a7790_add_dt_devices();
        r8a7790_register_irqc(0);
        r8a7790_register_thermal();
+       r8a7790_register_i2c(0);
+       r8a7790_register_i2c(1);
+       r8a7790_register_i2c(2);
+       r8a7790_register_i2c(3);
+       r8a7790_register_audio_dmac(0);
+       r8a7790_register_audio_dmac(1);
 }
 
 void __init r8a7790_init_early(void)
index e28404e43860ac371a766dbf97c0f9f47902ec50..949580ae150ae47acbd04665af979b2dc15fdbd6 100644 (file)
@@ -210,13 +210,6 @@ void __init r8a7791_add_standard_devices(void)
        r8a7791_register_thermal();
 }
 
-void __init r8a7791_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 *r8a7791_boards_compat_dt[] __initdata = {
        "renesas,r8a7791",
@@ -225,7 +218,7 @@ static const char *r8a7791_boards_compat_dt[] __initdata = {
 
 DT_MACHINE_START(R8A7791_DT, "Generic R8A7791 (Flattened Device Tree)")
        .smp            = smp_ops(r8a7791_smp_ops),
-       .init_early     = r8a7791_init_early,
+       .init_early     = shmobile_init_delay,
        .init_time      = rcar_gen2_timer_init,
        .dt_compat      = r8a7791_boards_compat_dt,
 MACHINE_END
index 10604480f325296347cdfc7a31ed5d40135fd7b1..542c5a47173f9e8a9794a07d39b765704b9c0d75 100644 (file)
 
 u32 rcar_gen2_read_mode_pins(void)
 {
-       void __iomem *modemr = ioremap_nocache(MODEMR, 4);
-       u32 mode;
-
-       BUG_ON(!modemr);
-       mode = ioread32(modemr);
-       iounmap(modemr);
+       static u32 mode;
+       static bool mode_valid;
+
+       if (!mode_valid) {
+               void __iomem *modemr = ioremap_nocache(MODEMR, 4);
+               BUG_ON(!modemr);
+               mode = ioread32(modemr);
+               iounmap(modemr);
+               mode_valid = true;
+       }
 
        return mode;
 }
index 27301278c20840064c7e88d857660e2dbb216015..f8176b051be485b4c242b29f2c281ac1275a8571 100644 (file)
@@ -1037,11 +1037,7 @@ void __init sh7372_add_early_devices_dt(void)
 {
        shmobile_setup_delay(800, 1, 3); /* Cortex-A8 @ 800MHz */
 
-       early_platform_add_devices(sh7372_early_devices,
-                                  ARRAY_SIZE(sh7372_early_devices));
-
-       /* setup early console here as well */
-       shmobile_setup_console();
+       sh7372_add_early_devices();
 }
 
 void __init sh7372_add_standard_devices_dt(void)
index f2ca92308f7568f851289626fddd9c25c6064fee..2dfd748da7f374156e13374251bcdd9fe4a65f31 100644 (file)
@@ -24,7 +24,6 @@
 #include <linux/io.h>
 #include <linux/delay.h>
 #include <mach/common.h>
-#include <mach/emev2.h>
 #include <asm/smp_plat.h>
 #include <asm/smp_scu.h>
 
index 2df5bd190fe4ce3ca4f40a8bd119d45af4aac1a1..ec979529f30f5b00c3cc94030d67fb5b27efb9c8 100644 (file)
@@ -20,6 +20,7 @@
 #include <asm/smp_plat.h>
 #include <mach/common.h>
 #include <mach/r8a7791.h>
+#include <mach/rcar-gen2.h>
 
 #define RST            0xe6160000
 #define CA15BAR                0x0020
@@ -51,9 +52,21 @@ static void __init r8a7791_smp_prepare_cpus(unsigned int max_cpus)
        iounmap(p);
 }
 
+static int r8a7791_smp_boot_secondary(unsigned int cpu,
+                                     struct task_struct *idle)
+{
+       /* Error out when hardware debug mode is enabled */
+       if (rcar_gen2_read_mode_pins() & BIT(21)) {
+               pr_warn("Unable to boot CPU%u when MD21 is set\n", cpu);
+               return -ENOTSUPP;
+       }
+
+       return shmobile_smp_apmu_boot_secondary(cpu, idle);
+}
+
 struct smp_operations r8a7791_smp_ops __initdata = {
        .smp_prepare_cpus       = r8a7791_smp_prepare_cpus,
-       .smp_boot_secondary     = shmobile_smp_apmu_boot_secondary,
+       .smp_boot_secondary     = r8a7791_smp_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
        .cpu_disable            = shmobile_smp_cpu_disable,
        .cpu_die                = shmobile_smp_apmu_cpu_die,
index 62d7052d6f215f7679d88f12365dc8fb048de253..68bc0b82226d18f3af3448010d2e3cc653420972 100644 (file)
 #include <linux/platform_device.h>
 #include <linux/clocksource.h>
 #include <linux/delay.h>
+#include <linux/of_address.h>
+
+void __init shmobile_setup_delay_hz(unsigned int max_cpu_core_hz,
+                                   unsigned int mult, unsigned int div)
+{
+       /* calculate a worst-case loops-per-jiffy value
+        * based on maximum cpu core hz setting and the
+        * __delay() implementation in arch/arm/lib/delay.S
+        *
+        * this will result in a longer delay than expected
+        * when the cpu core runs on lower frequencies.
+        */
+
+       unsigned int value = HZ * div / mult;
+
+       if (!preset_lpj)
+               preset_lpj = max_cpu_core_hz / value;
+}
 
 void __init shmobile_setup_delay(unsigned int max_cpu_core_mhz,
                                 unsigned int mult, unsigned int div)
@@ -39,6 +57,33 @@ void __init shmobile_setup_delay(unsigned int max_cpu_core_mhz,
                preset_lpj = max_cpu_core_mhz * value;
 }
 
+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);
+       }
+
+       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);
+       }
+}
+
 static void __init shmobile_late_time_init(void)
 {
        /*
index 1217fb598cfdc7dacd877e9df8a8fee3dc83ba43..df731f2322facb377aa35d08aa5f45db41d66362 100644 (file)
@@ -36,6 +36,7 @@ static void __init stih41x_machine_init(void)
 static const char *stih41x_dt_match[] __initdata = {
        "st,stih415",
        "st,stih416",
+       "st,stih407",
        NULL
 };
 
index f2c89fb8fca9d6bf6d2324404b45fad1869288f8..be83ba25f81b7e75064befef4dd4b599d63d91e2 100644 (file)
@@ -310,6 +310,21 @@ static struct platform_device char_lcd_device = {
        .resource       =       char_lcd_resources,
 };
 
+static struct resource leds_resources[] = {
+       {
+               .start  = VERSATILE_SYS_BASE + VERSATILE_SYS_LED_OFFSET,
+               .end    = VERSATILE_SYS_BASE + VERSATILE_SYS_LED_OFFSET + 4,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device leds_device = {
+       .name           = "versatile-leds",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(leds_resources),
+       .resource       = leds_resources,
+};
+
 /*
  * Clock handling
  */
@@ -795,6 +810,7 @@ void __init versatile_init(void)
        platform_device_register(&versatile_i2c_device);
        platform_device_register(&smc91x_device);
        platform_device_register(&char_lcd_device);
+       platform_device_register(&leds_device);
 
        for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
                struct amba_device *d = amba_devs[i];
index 6816192a7561b41941b403964008f46da0803da5..b61a3bcc2fa83bb028933edc80d934e5d1222386 100644 (file)
@@ -597,51 +597,3 @@ void __init orion_gpio_init(struct device_node *np,
 
        orion_gpio_chip_count++;
 }
-
-#ifdef CONFIG_OF
-static void __init orion_gpio_of_init_one(struct device_node *np,
-                                         int irq_gpio_base)
-{
-       int ngpio, gpio_base, mask_offset;
-       void __iomem *base;
-       int ret, i;
-       int irqs[4];
-       int secondary_irq_base;
-
-       ret = of_property_read_u32(np, "ngpio", &ngpio);
-       if (ret)
-               goto out;
-       ret = of_property_read_u32(np, "mask-offset", &mask_offset);
-       if (ret == -EINVAL)
-               mask_offset = 0;
-       else
-               goto out;
-       base = of_iomap(np, 0);
-       if (!base)
-               goto out;
-
-       secondary_irq_base = irq_gpio_base + (32 * orion_gpio_chip_count);
-       gpio_base = 32 * orion_gpio_chip_count;
-
-       /* Get the interrupt numbers. Each chip can have up to 4
-        * interrupt handlers, with each handler dealing with 8 GPIO
-        * pins. */
-
-       for (i = 0; i < 4; i++)
-               irqs[i] = irq_of_parse_and_map(np, i);
-
-       orion_gpio_init(np, gpio_base, ngpio, base, mask_offset,
-                       secondary_irq_base, irqs);
-       return;
-out:
-       pr_err("%s: %s: missing mandatory property\n", __func__, np->name);
-}
-
-void __init orion_gpio_of_init(int irq_gpio_base)
-{
-       struct device_node *np;
-
-       for_each_compatible_node(np, NULL, "marvell,orion-gpio")
-               orion_gpio_of_init_one(np, irq_gpio_base);
-}
-#endif
index 50547e41793601042a4342aebec12186163d9e00..96be19e9bd93dfd2da0a70d7fd0c2c67f9ba1b6f 100644 (file)
@@ -12,5 +12,4 @@
 #define __PLAT_IRQ_H
 
 void orion_irq_init(unsigned int irq_start, void __iomem *maskaddr);
-void __init orion_dt_init_irq(void);
 #endif
index 614dcac9dc5298bb42fb18183eb98d10789c8088..e763988b04b9cbd216d22e74a8854b598719b257 100644 (file)
@@ -33,5 +33,4 @@ void __init orion_gpio_init(struct device_node *np,
                            int secondary_irq_base,
                            int irq[4]);
 
-void __init orion_gpio_of_init(int irq_gpio_base);
 #endif
index 807df142444b4fefe854f5d7421f7221b5417b87..8c1fc06007c0c36c10ae1cf9aefeffe119bee8ca 100644 (file)
 #include <plat/orion-gpio.h>
 #include <mach/bridge-regs.h>
 
-#ifdef CONFIG_MULTI_IRQ_HANDLER
-/*
- * Compiling with both non-DT and DT support enabled, will
- * break asm irq handler used by non-DT boards. Therefore,
- * we provide a C-style irq handler even for non-DT boards,
- * if MULTI_IRQ_HANDLER is set.
- *
- * Notes:
- * - this is prepared for Kirkwood and Dove only, update
- *   accordingly if you add Orion5x or MV78x00.
- * - Orion5x uses different macro names and has only one
- *   set of CAUSE/MASK registers.
- * - MV78x00 uses the same macro names but has a third
- *   set of CAUSE/MASK registers.
- *
- */
-
-static void __iomem *orion_irq_base = IRQ_VIRT_BASE;
-
-asmlinkage void
-__exception_irq_entry orion_legacy_handle_irq(struct pt_regs *regs)
-{
-       u32 stat;
-
-       stat = readl_relaxed(orion_irq_base + IRQ_CAUSE_LOW_OFF);
-       stat &= readl_relaxed(orion_irq_base + IRQ_MASK_LOW_OFF);
-       if (stat) {
-               unsigned int hwirq = __fls(stat);
-               handle_IRQ(hwirq, regs);
-               return;
-       }
-       stat = readl_relaxed(orion_irq_base + IRQ_CAUSE_HIGH_OFF);
-       stat &= readl_relaxed(orion_irq_base + IRQ_MASK_HIGH_OFF);
-       if (stat) {
-               unsigned int hwirq = 32 + __fls(stat);
-               handle_IRQ(hwirq, regs);
-               return;
-       }
-}
-#endif
-
 void __init orion_irq_init(unsigned int irq_start, void __iomem *maskaddr)
 {
        struct irq_chip_generic *gc;
@@ -78,40 +37,4 @@ void __init orion_irq_init(unsigned int irq_start, void __iomem *maskaddr)
        ct->chip.irq_unmask = irq_gc_mask_set_bit;
        irq_setup_generic_chip(gc, IRQ_MSK(32), IRQ_GC_INIT_MASK_CACHE,
                               IRQ_NOREQUEST, IRQ_LEVEL | IRQ_NOPROBE);
-
-#ifdef CONFIG_MULTI_IRQ_HANDLER
-       set_handle_irq(orion_legacy_handle_irq);
-#endif
-}
-
-#ifdef CONFIG_OF
-static int __init orion_add_irq_domain(struct device_node *np,
-                                      struct device_node *interrupt_parent)
-{
-       int i = 0;
-       void __iomem *base;
-
-       do {
-               base = of_iomap(np, i);
-               if (base) {
-                       orion_irq_init(i * 32, base + 0x04);
-                       i++;
-               }
-       } while (base);
-
-       irq_domain_add_legacy(np, i * 32, 0, 0,
-                             &irq_domain_simple_ops, NULL);
-       return 0;
-}
-
-static const struct of_device_id orion_irq_match[] = {
-       { .compatible = "marvell,orion-intc",
-         .data = orion_add_irq_domain, },
-       {},
-};
-
-void __init orion_dt_init_irq(void)
-{
-       of_irq_init(orion_irq_match);
 }
-#endif
index 2c4332b9f9484883a00ab6b7af2a3edc0ccd88ac..fce41e93b6a4e74d9b4fb7622d12a80b1734dc36 100644 (file)
@@ -6,12 +6,6 @@ config PLAT_VERSATILE_CLOCK
 config PLAT_VERSATILE_CLCD
        bool
 
-config PLAT_VERSATILE_LEDS
-       def_bool y if NEW_LEDS
-       depends on ARCH_REALVIEW || ARCH_VERSATILE
-       select LEDS_CLASS
-       select LEDS_TRIGGERS
-
 config PLAT_VERSATILE_SCHED_CLOCK
        def_bool y
 
index f88d448b629caa43171f63b5c9bd9d9cf4bd1df0..2e0c472958ae42b0e175a65ea566f793ef07cd3d 100644 (file)
@@ -2,6 +2,5 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
 
 obj-$(CONFIG_PLAT_VERSATILE_CLOCK) += clock.o
 obj-$(CONFIG_PLAT_VERSATILE_CLCD) += clcd.o
-obj-$(CONFIG_PLAT_VERSATILE_LEDS) += leds.o
 obj-$(CONFIG_PLAT_VERSATILE_SCHED_CLOCK) += sched-clock.o
 obj-$(CONFIG_SMP) += headsmp.o platsmp.o
index 00b73448b22ea7b77a55785cfbbddf022bf4bfd3..26c3779d871da61ee7976dbfc180eb6ac2999b14 100644 (file)
@@ -704,7 +704,6 @@ static int __init mvebu_mbus_common_init(struct mvebu_mbus_state *mbus,
                                         phys_addr_t sdramwins_phys_base,
                                         size_t sdramwins_size)
 {
-       struct device_node *np;
        int win;
 
        mbus->mbuswins_base = ioremap(mbuswins_phys_base, mbuswins_size);
@@ -717,12 +716,6 @@ static int __init mvebu_mbus_common_init(struct mvebu_mbus_state *mbus,
                return -ENOMEM;
        }
 
-       np = of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric");
-       if (np) {
-               mbus->hw_io_coherency = 1;
-               of_node_put(np);
-       }
-
        for (win = 0; win < mbus->soc->num_wins; win++)
                mvebu_mbus_disable_window(mbus, win);
 
@@ -892,7 +885,7 @@ static void __init mvebu_mbus_get_pcie_resources(struct device_node *np,
        }
 }
 
-int __init mvebu_mbus_dt_init(void)
+int __init mvebu_mbus_dt_init(bool is_coherent)
 {
        struct resource mbuswins_res, sdramwins_res;
        struct device_node *np, *controller;
@@ -930,6 +923,8 @@ int __init mvebu_mbus_dt_init(void)
                return -EINVAL;
        }
 
+       mbus_state.hw_io_coherency = is_coherent;
+
        /* Get optional pcie-{mem,io}-aperture properties */
        mvebu_mbus_get_pcie_resources(np, &mbus_state.pcie_mem_aperture,
                                          &mbus_state.pcie_io_aperture);
index 46c1d3d0d66b00b62b80ba6366c6c22938f4cf6d..4998aee59267de45e83b2b53efd5867586ebb5c5 100644 (file)
@@ -2,8 +2,8 @@
 # Makefile for at91 specific clk
 #
 
-obj-y += pmc.o
-obj-y += clk-main.o clk-pll.o clk-plldiv.o clk-master.o
+obj-y += pmc.o sckc.o
+obj-y += clk-slow.o clk-main.o clk-pll.o clk-plldiv.o clk-master.o
 obj-y += clk-system.o clk-peripheral.o clk-programmable.o
 
 obj-$(CONFIG_HAVE_AT91_UTMI)           += clk-utmi.o
index 8e9e8cc0412dfe3cb3d3a1adc3ed9287637defdf..733306131b99f5798e20aad930c952987247591f 100644 (file)
 #define MAINF_LOOP_MIN_WAIT    (USEC_PER_SEC / SLOW_CLOCK_FREQ)
 #define MAINF_LOOP_MAX_WAIT    MAINFRDY_TIMEOUT
 
-struct clk_main {
+#define MOR_KEY_MASK           (0xff << 16)
+
+struct clk_main_osc {
        struct clk_hw hw;
        struct at91_pmc *pmc;
-       unsigned long rate;
        unsigned int irq;
        wait_queue_head_t wait;
 };
 
-#define to_clk_main(hw) container_of(hw, struct clk_main, hw)
+#define to_clk_main_osc(hw) container_of(hw, struct clk_main_osc, hw)
+
+struct clk_main_rc_osc {
+       struct clk_hw hw;
+       struct at91_pmc *pmc;
+       unsigned int irq;
+       wait_queue_head_t wait;
+       unsigned long frequency;
+       unsigned long accuracy;
+};
+
+#define to_clk_main_rc_osc(hw) container_of(hw, struct clk_main_rc_osc, hw)
+
+struct clk_rm9200_main {
+       struct clk_hw hw;
+       struct at91_pmc *pmc;
+};
+
+#define to_clk_rm9200_main(hw) container_of(hw, struct clk_rm9200_main, hw)
 
-static irqreturn_t clk_main_irq_handler(int irq, void *dev_id)
+struct clk_sam9x5_main {
+       struct clk_hw hw;
+       struct at91_pmc *pmc;
+       unsigned int irq;
+       wait_queue_head_t wait;
+       u8 parent;
+};
+
+#define to_clk_sam9x5_main(hw) container_of(hw, struct clk_sam9x5_main, hw)
+
+static irqreturn_t clk_main_osc_irq_handler(int irq, void *dev_id)
 {
-       struct clk_main *clkmain = (struct clk_main *)dev_id;
+       struct clk_main_osc *osc = dev_id;
 
-       wake_up(&clkmain->wait);
-       disable_irq_nosync(clkmain->irq);
+       wake_up(&osc->wait);
+       disable_irq_nosync(osc->irq);
 
        return IRQ_HANDLED;
 }
 
-static int clk_main_prepare(struct clk_hw *hw)
+static int clk_main_osc_prepare(struct clk_hw *hw)
 {
-       struct clk_main *clkmain = to_clk_main(hw);
-       struct at91_pmc *pmc = clkmain->pmc;
-       unsigned long halt_time, timeout;
+       struct clk_main_osc *osc = to_clk_main_osc(hw);
+       struct at91_pmc *pmc = osc->pmc;
        u32 tmp;
 
+       tmp = pmc_read(pmc, AT91_CKGR_MOR) & ~MOR_KEY_MASK;
+       if (tmp & AT91_PMC_OSCBYPASS)
+               return 0;
+
+       if (!(tmp & AT91_PMC_MOSCEN)) {
+               tmp |= AT91_PMC_MOSCEN | AT91_PMC_KEY;
+               pmc_write(pmc, AT91_CKGR_MOR, tmp);
+       }
+
        while (!(pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCS)) {
-               enable_irq(clkmain->irq);
-               wait_event(clkmain->wait,
+               enable_irq(osc->irq);
+               wait_event(osc->wait,
                           pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCS);
        }
 
-       if (clkmain->rate)
-               return 0;
+       return 0;
+}
+
+static void clk_main_osc_unprepare(struct clk_hw *hw)
+{
+       struct clk_main_osc *osc = to_clk_main_osc(hw);
+       struct at91_pmc *pmc = osc->pmc;
+       u32 tmp = pmc_read(pmc, AT91_CKGR_MOR);
+
+       if (tmp & AT91_PMC_OSCBYPASS)
+               return;
+
+       if (!(tmp & AT91_PMC_MOSCEN))
+               return;
+
+       tmp &= ~(AT91_PMC_KEY | AT91_PMC_MOSCEN);
+       pmc_write(pmc, AT91_CKGR_MOR, tmp | AT91_PMC_KEY);
+}
+
+static int clk_main_osc_is_prepared(struct clk_hw *hw)
+{
+       struct clk_main_osc *osc = to_clk_main_osc(hw);
+       struct at91_pmc *pmc = osc->pmc;
+       u32 tmp = pmc_read(pmc, AT91_CKGR_MOR);
+
+       if (tmp & AT91_PMC_OSCBYPASS)
+               return 1;
+
+       return !!((pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCS) &&
+                 (pmc_read(pmc, AT91_CKGR_MOR) & AT91_PMC_MOSCEN));
+}
+
+static const struct clk_ops main_osc_ops = {
+       .prepare = clk_main_osc_prepare,
+       .unprepare = clk_main_osc_unprepare,
+       .is_prepared = clk_main_osc_is_prepared,
+};
+
+static struct clk * __init
+at91_clk_register_main_osc(struct at91_pmc *pmc,
+                          unsigned int irq,
+                          const char *name,
+                          const char *parent_name,
+                          bool bypass)
+{
+       int ret;
+       struct clk_main_osc *osc;
+       struct clk *clk = NULL;
+       struct clk_init_data init;
+
+       if (!pmc || !irq || !name || !parent_name)
+               return ERR_PTR(-EINVAL);
+
+       osc = kzalloc(sizeof(*osc), GFP_KERNEL);
+       if (!osc)
+               return ERR_PTR(-ENOMEM);
+
+       init.name = name;
+       init.ops = &main_osc_ops;
+       init.parent_names = &parent_name;
+       init.num_parents = 1;
+       init.flags = CLK_IGNORE_UNUSED;
+
+       osc->hw.init = &init;
+       osc->pmc = pmc;
+       osc->irq = irq;
+
+       init_waitqueue_head(&osc->wait);
+       irq_set_status_flags(osc->irq, IRQ_NOAUTOEN);
+       ret = request_irq(osc->irq, clk_main_osc_irq_handler,
+                         IRQF_TRIGGER_HIGH, name, osc);
+       if (ret)
+               return ERR_PTR(ret);
+
+       if (bypass)
+               pmc_write(pmc, AT91_CKGR_MOR,
+                         (pmc_read(pmc, AT91_CKGR_MOR) &
+                          ~(MOR_KEY_MASK | AT91_PMC_MOSCEN)) |
+                         AT91_PMC_OSCBYPASS | AT91_PMC_KEY);
+
+       clk = clk_register(NULL, &osc->hw);
+       if (IS_ERR(clk)) {
+               free_irq(irq, osc);
+               kfree(osc);
+       }
+
+       return clk;
+}
+
+void __init of_at91rm9200_clk_main_osc_setup(struct device_node *np,
+                                            struct at91_pmc *pmc)
+{
+       struct clk *clk;
+       unsigned int irq;
+       const char *name = np->name;
+       const char *parent_name;
+       bool bypass;
+
+       of_property_read_string(np, "clock-output-names", &name);
+       bypass = of_property_read_bool(np, "atmel,osc-bypass");
+       parent_name = of_clk_get_parent_name(np, 0);
+
+       irq = irq_of_parse_and_map(np, 0);
+       if (!irq)
+               return;
+
+       clk = at91_clk_register_main_osc(pmc, irq, name, parent_name, bypass);
+       if (IS_ERR(clk))
+               return;
+
+       of_clk_add_provider(np, of_clk_src_simple_get, clk);
+}
+
+static irqreturn_t clk_main_rc_osc_irq_handler(int irq, void *dev_id)
+{
+       struct clk_main_rc_osc *osc = dev_id;
+
+       wake_up(&osc->wait);
+       disable_irq_nosync(osc->irq);
+
+       return IRQ_HANDLED;
+}
+
+static int clk_main_rc_osc_prepare(struct clk_hw *hw)
+{
+       struct clk_main_rc_osc *osc = to_clk_main_rc_osc(hw);
+       struct at91_pmc *pmc = osc->pmc;
+       u32 tmp;
+
+       tmp = pmc_read(pmc, AT91_CKGR_MOR) & ~MOR_KEY_MASK;
+
+       if (!(tmp & AT91_PMC_MOSCRCEN)) {
+               tmp |= AT91_PMC_MOSCRCEN | AT91_PMC_KEY;
+               pmc_write(pmc, AT91_CKGR_MOR, tmp);
+       }
+
+       while (!(pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCRCS)) {
+               enable_irq(osc->irq);
+               wait_event(osc->wait,
+                          pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCRCS);
+       }
+
+       return 0;
+}
+
+static void clk_main_rc_osc_unprepare(struct clk_hw *hw)
+{
+       struct clk_main_rc_osc *osc = to_clk_main_rc_osc(hw);
+       struct at91_pmc *pmc = osc->pmc;
+       u32 tmp = pmc_read(pmc, AT91_CKGR_MOR);
+
+       if (!(tmp & AT91_PMC_MOSCRCEN))
+               return;
+
+       tmp &= ~(MOR_KEY_MASK | AT91_PMC_MOSCRCEN);
+       pmc_write(pmc, AT91_CKGR_MOR, tmp | AT91_PMC_KEY);
+}
+
+static int clk_main_rc_osc_is_prepared(struct clk_hw *hw)
+{
+       struct clk_main_rc_osc *osc = to_clk_main_rc_osc(hw);
+       struct at91_pmc *pmc = osc->pmc;
+
+       return !!((pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCRCS) &&
+                 (pmc_read(pmc, AT91_CKGR_MOR) & AT91_PMC_MOSCRCEN));
+}
+
+static unsigned long clk_main_rc_osc_recalc_rate(struct clk_hw *hw,
+                                                unsigned long parent_rate)
+{
+       struct clk_main_rc_osc *osc = to_clk_main_rc_osc(hw);
+
+       return osc->frequency;
+}
+
+static unsigned long clk_main_rc_osc_recalc_accuracy(struct clk_hw *hw,
+                                                    unsigned long parent_acc)
+{
+       struct clk_main_rc_osc *osc = to_clk_main_rc_osc(hw);
+
+       return osc->accuracy;
+}
+
+static const struct clk_ops main_rc_osc_ops = {
+       .prepare = clk_main_rc_osc_prepare,
+       .unprepare = clk_main_rc_osc_unprepare,
+       .is_prepared = clk_main_rc_osc_is_prepared,
+       .recalc_rate = clk_main_rc_osc_recalc_rate,
+       .recalc_accuracy = clk_main_rc_osc_recalc_accuracy,
+};
+
+static struct clk * __init
+at91_clk_register_main_rc_osc(struct at91_pmc *pmc,
+                             unsigned int irq,
+                             const char *name,
+                             u32 frequency, u32 accuracy)
+{
+       int ret;
+       struct clk_main_rc_osc *osc;
+       struct clk *clk = NULL;
+       struct clk_init_data init;
+
+       if (!pmc || !irq || !name || !frequency)
+               return ERR_PTR(-EINVAL);
+
+       osc = kzalloc(sizeof(*osc), GFP_KERNEL);
+       if (!osc)
+               return ERR_PTR(-ENOMEM);
+
+       init.name = name;
+       init.ops = &main_rc_osc_ops;
+       init.parent_names = NULL;
+       init.num_parents = 0;
+       init.flags = CLK_IS_ROOT | CLK_IGNORE_UNUSED;
+
+       osc->hw.init = &init;
+       osc->pmc = pmc;
+       osc->irq = irq;
+       osc->frequency = frequency;
+       osc->accuracy = accuracy;
+
+       init_waitqueue_head(&osc->wait);
+       irq_set_status_flags(osc->irq, IRQ_NOAUTOEN);
+       ret = request_irq(osc->irq, clk_main_rc_osc_irq_handler,
+                         IRQF_TRIGGER_HIGH, name, osc);
+       if (ret)
+               return ERR_PTR(ret);
+
+       clk = clk_register(NULL, &osc->hw);
+       if (IS_ERR(clk)) {
+               free_irq(irq, osc);
+               kfree(osc);
+       }
+
+       return clk;
+}
+
+void __init of_at91sam9x5_clk_main_rc_osc_setup(struct device_node *np,
+                                               struct at91_pmc *pmc)
+{
+       struct clk *clk;
+       unsigned int irq;
+       u32 frequency = 0;
+       u32 accuracy = 0;
+       const char *name = np->name;
+
+       of_property_read_string(np, "clock-output-names", &name);
+       of_property_read_u32(np, "clock-frequency", &frequency);
+       of_property_read_u32(np, "clock-accuracy", &accuracy);
+
+       irq = irq_of_parse_and_map(np, 0);
+       if (!irq)
+               return;
+
+       clk = at91_clk_register_main_rc_osc(pmc, irq, name, frequency,
+                                           accuracy);
+       if (IS_ERR(clk))
+               return;
+
+       of_clk_add_provider(np, of_clk_src_simple_get, clk);
+}
+
+
+static int clk_main_probe_frequency(struct at91_pmc *pmc)
+{
+       unsigned long prep_time, timeout;
+       u32 tmp;
 
        timeout = jiffies + usecs_to_jiffies(MAINFRDY_TIMEOUT);
        do {
-               halt_time = jiffies;
+               prep_time = jiffies;
                tmp = pmc_read(pmc, AT91_CKGR_MCFR);
                if (tmp & AT91_PMC_MAINRDY)
                        return 0;
                usleep_range(MAINF_LOOP_MIN_WAIT, MAINF_LOOP_MAX_WAIT);
-       } while (time_before(halt_time, timeout));
+       } while (time_before(prep_time, timeout));
 
-       return 0;
+       return -ETIMEDOUT;
 }
 
-static int clk_main_is_prepared(struct clk_hw *hw)
+static unsigned long clk_main_recalc_rate(struct at91_pmc *pmc,
+                                         unsigned long parent_rate)
 {
-       struct clk_main *clkmain = to_clk_main(hw);
+       u32 tmp;
+
+       if (parent_rate)
+               return parent_rate;
+
+       tmp = pmc_read(pmc, AT91_CKGR_MCFR);
+       if (!(tmp & AT91_PMC_MAINRDY))
+               return 0;
 
-       return !!(pmc_read(clkmain->pmc, AT91_PMC_SR) & AT91_PMC_MOSCS);
+       return ((tmp & AT91_PMC_MAINF) * SLOW_CLOCK_FREQ) / MAINF_DIV;
 }
 
-static unsigned long clk_main_recalc_rate(struct clk_hw *hw,
-                                         unsigned long parent_rate)
+static int clk_rm9200_main_prepare(struct clk_hw *hw)
 {
-       u32 tmp;
-       struct clk_main *clkmain = to_clk_main(hw);
+       struct clk_rm9200_main *clkmain = to_clk_rm9200_main(hw);
+
+       return clk_main_probe_frequency(clkmain->pmc);
+}
+
+static int clk_rm9200_main_is_prepared(struct clk_hw *hw)
+{
+       struct clk_rm9200_main *clkmain = to_clk_rm9200_main(hw);
+
+       return !!(pmc_read(clkmain->pmc, AT91_CKGR_MCFR) & AT91_PMC_MAINRDY);
+}
+
+static unsigned long clk_rm9200_main_recalc_rate(struct clk_hw *hw,
+                                                unsigned long parent_rate)
+{
+       struct clk_rm9200_main *clkmain = to_clk_rm9200_main(hw);
+
+       return clk_main_recalc_rate(clkmain->pmc, parent_rate);
+}
+
+static const struct clk_ops rm9200_main_ops = {
+       .prepare = clk_rm9200_main_prepare,
+       .is_prepared = clk_rm9200_main_is_prepared,
+       .recalc_rate = clk_rm9200_main_recalc_rate,
+};
+
+static struct clk * __init
+at91_clk_register_rm9200_main(struct at91_pmc *pmc,
+                             const char *name,
+                             const char *parent_name)
+{
+       struct clk_rm9200_main *clkmain;
+       struct clk *clk = NULL;
+       struct clk_init_data init;
+
+       if (!pmc || !name)
+               return ERR_PTR(-EINVAL);
+
+       if (!parent_name)
+               return ERR_PTR(-EINVAL);
+
+       clkmain = kzalloc(sizeof(*clkmain), GFP_KERNEL);
+       if (!clkmain)
+               return ERR_PTR(-ENOMEM);
+
+       init.name = name;
+       init.ops = &rm9200_main_ops;
+       init.parent_names = &parent_name;
+       init.num_parents = 1;
+       init.flags = 0;
+
+       clkmain->hw.init = &init;
+       clkmain->pmc = pmc;
+
+       clk = clk_register(NULL, &clkmain->hw);
+       if (IS_ERR(clk))
+               kfree(clkmain);
+
+       return clk;
+}
+
+void __init of_at91rm9200_clk_main_setup(struct device_node *np,
+                                        struct at91_pmc *pmc)
+{
+       struct clk *clk;
+       const char *parent_name;
+       const char *name = np->name;
+
+       parent_name = of_clk_get_parent_name(np, 0);
+       of_property_read_string(np, "clock-output-names", &name);
+
+       clk = at91_clk_register_rm9200_main(pmc, name, parent_name);
+       if (IS_ERR(clk))
+               return;
+
+       of_clk_add_provider(np, of_clk_src_simple_get, clk);
+}
+
+static irqreturn_t clk_sam9x5_main_irq_handler(int irq, void *dev_id)
+{
+       struct clk_sam9x5_main *clkmain = dev_id;
+
+       wake_up(&clkmain->wait);
+       disable_irq_nosync(clkmain->irq);
+
+       return IRQ_HANDLED;
+}
+
+static int clk_sam9x5_main_prepare(struct clk_hw *hw)
+{
+       struct clk_sam9x5_main *clkmain = to_clk_sam9x5_main(hw);
        struct at91_pmc *pmc = clkmain->pmc;
 
-       if (clkmain->rate)
-               return clkmain->rate;
+       while (!(pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCSELS)) {
+               enable_irq(clkmain->irq);
+               wait_event(clkmain->wait,
+                          pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCSELS);
+       }
+
+       return clk_main_probe_frequency(pmc);
+}
 
-       tmp = pmc_read(pmc, AT91_CKGR_MCFR) & AT91_PMC_MAINF;
-       clkmain->rate = (tmp * parent_rate) / MAINF_DIV;
+static int clk_sam9x5_main_is_prepared(struct clk_hw *hw)
+{
+       struct clk_sam9x5_main *clkmain = to_clk_sam9x5_main(hw);
 
-       return clkmain->rate;
+       return !!(pmc_read(clkmain->pmc, AT91_PMC_SR) & AT91_PMC_MOSCSELS);
 }
 
-static const struct clk_ops main_ops = {
-       .prepare = clk_main_prepare,
-       .is_prepared = clk_main_is_prepared,
-       .recalc_rate = clk_main_recalc_rate,
+static unsigned long clk_sam9x5_main_recalc_rate(struct clk_hw *hw,
+                                                unsigned long parent_rate)
+{
+       struct clk_sam9x5_main *clkmain = to_clk_sam9x5_main(hw);
+
+       return clk_main_recalc_rate(clkmain->pmc, parent_rate);
+}
+
+static int clk_sam9x5_main_set_parent(struct clk_hw *hw, u8 index)
+{
+       struct clk_sam9x5_main *clkmain = to_clk_sam9x5_main(hw);
+       struct at91_pmc *pmc = clkmain->pmc;
+       u32 tmp;
+
+       if (index > 1)
+               return -EINVAL;
+
+       tmp = pmc_read(pmc, AT91_CKGR_MOR) & ~MOR_KEY_MASK;
+
+       if (index && !(tmp & AT91_PMC_MOSCSEL))
+               pmc_write(pmc, AT91_CKGR_MOR, tmp | AT91_PMC_MOSCSEL);
+       else if (!index && (tmp & AT91_PMC_MOSCSEL))
+               pmc_write(pmc, AT91_CKGR_MOR, tmp & ~AT91_PMC_MOSCSEL);
+
+       while (!(pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCSELS)) {
+               enable_irq(clkmain->irq);
+               wait_event(clkmain->wait,
+                          pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCSELS);
+       }
+
+       return 0;
+}
+
+static u8 clk_sam9x5_main_get_parent(struct clk_hw *hw)
+{
+       struct clk_sam9x5_main *clkmain = to_clk_sam9x5_main(hw);
+
+       return !!(pmc_read(clkmain->pmc, AT91_CKGR_MOR) & AT91_PMC_MOSCEN);
+}
+
+static const struct clk_ops sam9x5_main_ops = {
+       .prepare = clk_sam9x5_main_prepare,
+       .is_prepared = clk_sam9x5_main_is_prepared,
+       .recalc_rate = clk_sam9x5_main_recalc_rate,
+       .set_parent = clk_sam9x5_main_set_parent,
+       .get_parent = clk_sam9x5_main_get_parent,
 };
 
 static struct clk * __init
-at91_clk_register_main(struct at91_pmc *pmc,
-                      unsigned int irq,
-                      const char *name,
-                      const char *parent_name,
-                      unsigned long rate)
+at91_clk_register_sam9x5_main(struct at91_pmc *pmc,
+                             unsigned int irq,
+                             const char *name,
+                             const char **parent_names,
+                             int num_parents)
 {
        int ret;
-       struct clk_main *clkmain;
+       struct clk_sam9x5_main *clkmain;
        struct clk *clk = NULL;
        struct clk_init_data init;
 
        if (!pmc || !irq || !name)
                return ERR_PTR(-EINVAL);
 
-       if (!rate && !parent_name)
+       if (!parent_names || !num_parents)
                return ERR_PTR(-EINVAL);
 
        clkmain = kzalloc(sizeof(*clkmain), GFP_KERNEL);
@@ -130,19 +577,20 @@ at91_clk_register_main(struct at91_pmc *pmc,
                return ERR_PTR(-ENOMEM);
 
        init.name = name;
-       init.ops = &main_ops;
-       init.parent_names = parent_name ? &parent_name : NULL;
-       init.num_parents = parent_name ? 1 : 0;
-       init.flags = parent_name ? 0 : CLK_IS_ROOT;
+       init.ops = &sam9x5_main_ops;
+       init.parent_names = parent_names;
+       init.num_parents = num_parents;
+       init.flags = CLK_SET_PARENT_GATE;
 
        clkmain->hw.init = &init;
-       clkmain->rate = rate;
        clkmain->pmc = pmc;
        clkmain->irq = irq;
+       clkmain->parent = !!(pmc_read(clkmain->pmc, AT91_CKGR_MOR) &
+                            AT91_PMC_MOSCEN);
        init_waitqueue_head(&clkmain->wait);
        irq_set_status_flags(clkmain->irq, IRQ_NOAUTOEN);
-       ret = request_irq(clkmain->irq, clk_main_irq_handler,
-                         IRQF_TRIGGER_HIGH, "clk-main", clkmain);
+       ret = request_irq(clkmain->irq, clk_sam9x5_main_irq_handler,
+                         IRQF_TRIGGER_HIGH, name, clkmain);
        if (ret)
                return ERR_PTR(ret);
 
@@ -155,33 +603,36 @@ at91_clk_register_main(struct at91_pmc *pmc,
        return clk;
 }
 
-
-
-static void __init
-of_at91_clk_main_setup(struct device_node *np, struct at91_pmc *pmc)
+void __init of_at91sam9x5_clk_main_setup(struct device_node *np,
+                                        struct at91_pmc *pmc)
 {
        struct clk *clk;
+       const char *parent_names[2];
+       int num_parents;
        unsigned int irq;
-       const char *parent_name;
        const char *name = np->name;
-       u32 rate = 0;
+       int i;
+
+       num_parents = of_count_phandle_with_args(np, "clocks", "#clock-cells");
+       if (num_parents <= 0 || num_parents > 2)
+               return;
+
+       for (i = 0; i < num_parents; ++i) {
+               parent_names[i] = of_clk_get_parent_name(np, i);
+               if (!parent_names[i])
+                       return;
+       }
 
-       parent_name = of_clk_get_parent_name(np, 0);
        of_property_read_string(np, "clock-output-names", &name);
-       of_property_read_u32(np, "clock-frequency", &rate);
+
        irq = irq_of_parse_and_map(np, 0);
        if (!irq)
                return;
 
-       clk = at91_clk_register_main(pmc, irq, name, parent_name, rate);
+       clk = at91_clk_register_sam9x5_main(pmc, irq, name, parent_names,
+                                           num_parents);
        if (IS_ERR(clk))
                return;
 
        of_clk_add_provider(np, of_clk_src_simple_get, clk);
 }
-
-void __init of_at91rm9200_clk_main_setup(struct device_node *np,
-                                        struct at91_pmc *pmc)
-{
-       of_at91_clk_main_setup(np, pmc);
-}
diff --git a/drivers/clk/at91/clk-slow.c b/drivers/clk/at91/clk-slow.c
new file mode 100644 (file)
index 0000000..0300c46
--- /dev/null
@@ -0,0 +1,467 @@
+/*
+ * drivers/clk/at91/clk-slow.c
+ *
+ *  Copyright (C) 2013 Boris BREZILLON <b.brezillon@overkiz.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.
+ *
+ */
+
+#include <linux/clk-provider.h>
+#include <linux/clkdev.h>
+#include <linux/clk/at91_pmc.h>
+#include <linux/delay.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+#include <linux/io.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/sched.h>
+#include <linux/wait.h>
+
+#include "pmc.h"
+#include "sckc.h"
+
+#define SLOW_CLOCK_FREQ                32768
+#define SLOWCK_SW_CYCLES       5
+#define SLOWCK_SW_TIME_USEC    ((SLOWCK_SW_CYCLES * USEC_PER_SEC) / \
+                                SLOW_CLOCK_FREQ)
+
+#define        AT91_SCKC_CR                    0x00
+#define                AT91_SCKC_RCEN          (1 << 0)
+#define                AT91_SCKC_OSC32EN       (1 << 1)
+#define                AT91_SCKC_OSC32BYP      (1 << 2)
+#define                AT91_SCKC_OSCSEL        (1 << 3)
+
+struct clk_slow_osc {
+       struct clk_hw hw;
+       void __iomem *sckcr;
+       unsigned long startup_usec;
+};
+
+#define to_clk_slow_osc(hw) container_of(hw, struct clk_slow_osc, hw)
+
+struct clk_slow_rc_osc {
+       struct clk_hw hw;
+       void __iomem *sckcr;
+       unsigned long frequency;
+       unsigned long accuracy;
+       unsigned long startup_usec;
+};
+
+#define to_clk_slow_rc_osc(hw) container_of(hw, struct clk_slow_rc_osc, hw)
+
+struct clk_sam9260_slow {
+       struct clk_hw hw;
+       struct at91_pmc *pmc;
+};
+
+#define to_clk_sam9260_slow(hw) container_of(hw, struct clk_sam9260_slow, hw)
+
+struct clk_sam9x5_slow {
+       struct clk_hw hw;
+       void __iomem *sckcr;
+       u8 parent;
+};
+
+#define to_clk_sam9x5_slow(hw) container_of(hw, struct clk_sam9x5_slow, hw)
+
+
+static int clk_slow_osc_prepare(struct clk_hw *hw)
+{
+       struct clk_slow_osc *osc = to_clk_slow_osc(hw);
+       void __iomem *sckcr = osc->sckcr;
+       u32 tmp = readl(sckcr);
+
+       if (tmp & AT91_SCKC_OSC32BYP)
+               return 0;
+
+       writel(tmp | AT91_SCKC_OSC32EN, sckcr);
+
+       usleep_range(osc->startup_usec, osc->startup_usec + 1);
+
+       return 0;
+}
+
+static void clk_slow_osc_unprepare(struct clk_hw *hw)
+{
+       struct clk_slow_osc *osc = to_clk_slow_osc(hw);
+       void __iomem *sckcr = osc->sckcr;
+       u32 tmp = readl(sckcr);
+
+       if (tmp & AT91_SCKC_OSC32BYP)
+               return;
+
+       writel(tmp & ~AT91_SCKC_OSC32EN, sckcr);
+}
+
+static int clk_slow_osc_is_prepared(struct clk_hw *hw)
+{
+       struct clk_slow_osc *osc = to_clk_slow_osc(hw);
+       void __iomem *sckcr = osc->sckcr;
+       u32 tmp = readl(sckcr);
+
+       if (tmp & AT91_SCKC_OSC32BYP)
+               return 1;
+
+       return !!(tmp & AT91_SCKC_OSC32EN);
+}
+
+static const struct clk_ops slow_osc_ops = {
+       .prepare = clk_slow_osc_prepare,
+       .unprepare = clk_slow_osc_unprepare,
+       .is_prepared = clk_slow_osc_is_prepared,
+};
+
+static struct clk * __init
+at91_clk_register_slow_osc(void __iomem *sckcr,
+                          const char *name,
+                          const char *parent_name,
+                          unsigned long startup,
+                          bool bypass)
+{
+       struct clk_slow_osc *osc;
+       struct clk *clk = NULL;
+       struct clk_init_data init;
+
+       if (!sckcr || !name || !parent_name)
+               return ERR_PTR(-EINVAL);
+
+       osc = kzalloc(sizeof(*osc), GFP_KERNEL);
+       if (!osc)
+               return ERR_PTR(-ENOMEM);
+
+       init.name = name;
+       init.ops = &slow_osc_ops;
+       init.parent_names = &parent_name;
+       init.num_parents = 1;
+       init.flags = CLK_IGNORE_UNUSED;
+
+       osc->hw.init = &init;
+       osc->sckcr = sckcr;
+       osc->startup_usec = startup;
+
+       if (bypass)
+               writel((readl(sckcr) & ~AT91_SCKC_OSC32EN) | AT91_SCKC_OSC32BYP,
+                      sckcr);
+
+       clk = clk_register(NULL, &osc->hw);
+       if (IS_ERR(clk))
+               kfree(osc);
+
+       return clk;
+}
+
+void __init of_at91sam9x5_clk_slow_osc_setup(struct device_node *np,
+                                            void __iomem *sckcr)
+{
+       struct clk *clk;
+       const char *parent_name;
+       const char *name = np->name;
+       u32 startup;
+       bool bypass;
+
+       parent_name = of_clk_get_parent_name(np, 0);
+       of_property_read_string(np, "clock-output-names", &name);
+       of_property_read_u32(np, "atmel,startup-time-usec", &startup);
+       bypass = of_property_read_bool(np, "atmel,osc-bypass");
+
+       clk = at91_clk_register_slow_osc(sckcr, name, parent_name, startup,
+                                        bypass);
+       if (IS_ERR(clk))
+               return;
+
+       of_clk_add_provider(np, of_clk_src_simple_get, clk);
+}
+
+static unsigned long clk_slow_rc_osc_recalc_rate(struct clk_hw *hw,
+                                                unsigned long parent_rate)
+{
+       struct clk_slow_rc_osc *osc = to_clk_slow_rc_osc(hw);
+
+       return osc->frequency;
+}
+
+static unsigned long clk_slow_rc_osc_recalc_accuracy(struct clk_hw *hw,
+                                                    unsigned long parent_acc)
+{
+       struct clk_slow_rc_osc *osc = to_clk_slow_rc_osc(hw);
+
+       return osc->accuracy;
+}
+
+static int clk_slow_rc_osc_prepare(struct clk_hw *hw)
+{
+       struct clk_slow_rc_osc *osc = to_clk_slow_rc_osc(hw);
+       void __iomem *sckcr = osc->sckcr;
+
+       writel(readl(sckcr) | AT91_SCKC_RCEN, sckcr);
+
+       usleep_range(osc->startup_usec, osc->startup_usec + 1);
+
+       return 0;
+}
+
+static void clk_slow_rc_osc_unprepare(struct clk_hw *hw)
+{
+       struct clk_slow_rc_osc *osc = to_clk_slow_rc_osc(hw);
+       void __iomem *sckcr = osc->sckcr;
+
+       writel(readl(sckcr) & ~AT91_SCKC_RCEN, sckcr);
+}
+
+static int clk_slow_rc_osc_is_prepared(struct clk_hw *hw)
+{
+       struct clk_slow_rc_osc *osc = to_clk_slow_rc_osc(hw);
+
+       return !!(readl(osc->sckcr) & AT91_SCKC_RCEN);
+}
+
+static const struct clk_ops slow_rc_osc_ops = {
+       .prepare = clk_slow_rc_osc_prepare,
+       .unprepare = clk_slow_rc_osc_unprepare,
+       .is_prepared = clk_slow_rc_osc_is_prepared,
+       .recalc_rate = clk_slow_rc_osc_recalc_rate,
+       .recalc_accuracy = clk_slow_rc_osc_recalc_accuracy,
+};
+
+static struct clk * __init
+at91_clk_register_slow_rc_osc(void __iomem *sckcr,
+                             const char *name,
+                             unsigned long frequency,
+                             unsigned long accuracy,
+                             unsigned long startup)
+{
+       struct clk_slow_rc_osc *osc;
+       struct clk *clk = NULL;
+       struct clk_init_data init;
+
+       if (!sckcr || !name)
+               return ERR_PTR(-EINVAL);
+
+       osc = kzalloc(sizeof(*osc), GFP_KERNEL);
+       if (!osc)
+               return ERR_PTR(-ENOMEM);
+
+       init.name = name;
+       init.ops = &slow_rc_osc_ops;
+       init.parent_names = NULL;
+       init.num_parents = 0;
+       init.flags = CLK_IS_ROOT | CLK_IGNORE_UNUSED;
+
+       osc->hw.init = &init;
+       osc->sckcr = sckcr;
+       osc->frequency = frequency;
+       osc->accuracy = accuracy;
+       osc->startup_usec = startup;
+
+       clk = clk_register(NULL, &osc->hw);
+       if (IS_ERR(clk))
+               kfree(osc);
+
+       return clk;
+}
+
+void __init of_at91sam9x5_clk_slow_rc_osc_setup(struct device_node *np,
+                                               void __iomem *sckcr)
+{
+       struct clk *clk;
+       u32 frequency = 0;
+       u32 accuracy = 0;
+       u32 startup = 0;
+       const char *name = np->name;
+
+       of_property_read_string(np, "clock-output-names", &name);
+       of_property_read_u32(np, "clock-frequency", &frequency);
+       of_property_read_u32(np, "clock-accuracy", &accuracy);
+       of_property_read_u32(np, "atmel,startup-time-usec", &startup);
+
+       clk = at91_clk_register_slow_rc_osc(sckcr, name, frequency, accuracy,
+                                           startup);
+       if (IS_ERR(clk))
+               return;
+
+       of_clk_add_provider(np, of_clk_src_simple_get, clk);
+}
+
+static int clk_sam9x5_slow_set_parent(struct clk_hw *hw, u8 index)
+{
+       struct clk_sam9x5_slow *slowck = to_clk_sam9x5_slow(hw);
+       void __iomem *sckcr = slowck->sckcr;
+       u32 tmp;
+
+       if (index > 1)
+               return -EINVAL;
+
+       tmp = readl(sckcr);
+
+       if ((!index && !(tmp & AT91_SCKC_OSCSEL)) ||
+           (index && (tmp & AT91_SCKC_OSCSEL)))
+               return 0;
+
+       if (index)
+               tmp |= AT91_SCKC_OSCSEL;
+       else
+               tmp &= ~AT91_SCKC_OSCSEL;
+
+       writel(tmp, sckcr);
+
+       usleep_range(SLOWCK_SW_TIME_USEC, SLOWCK_SW_TIME_USEC + 1);
+
+       return 0;
+}
+
+static u8 clk_sam9x5_slow_get_parent(struct clk_hw *hw)
+{
+       struct clk_sam9x5_slow *slowck = to_clk_sam9x5_slow(hw);
+
+       return !!(readl(slowck->sckcr) & AT91_SCKC_OSCSEL);
+}
+
+static const struct clk_ops sam9x5_slow_ops = {
+       .set_parent = clk_sam9x5_slow_set_parent,
+       .get_parent = clk_sam9x5_slow_get_parent,
+};
+
+static struct clk * __init
+at91_clk_register_sam9x5_slow(void __iomem *sckcr,
+                             const char *name,
+                             const char **parent_names,
+                             int num_parents)
+{
+       struct clk_sam9x5_slow *slowck;
+       struct clk *clk = NULL;
+       struct clk_init_data init;
+
+       if (!sckcr || !name || !parent_names || !num_parents)
+               return ERR_PTR(-EINVAL);
+
+       slowck = kzalloc(sizeof(*slowck), GFP_KERNEL);
+       if (!slowck)
+               return ERR_PTR(-ENOMEM);
+
+       init.name = name;
+       init.ops = &sam9x5_slow_ops;
+       init.parent_names = parent_names;
+       init.num_parents = num_parents;
+       init.flags = 0;
+
+       slowck->hw.init = &init;
+       slowck->sckcr = sckcr;
+       slowck->parent = !!(readl(sckcr) & AT91_SCKC_OSCSEL);
+
+       clk = clk_register(NULL, &slowck->hw);
+       if (IS_ERR(clk))
+               kfree(slowck);
+
+       return clk;
+}
+
+void __init of_at91sam9x5_clk_slow_setup(struct device_node *np,
+                                        void __iomem *sckcr)
+{
+       struct clk *clk;
+       const char *parent_names[2];
+       int num_parents;
+       const char *name = np->name;
+       int i;
+
+       num_parents = of_count_phandle_with_args(np, "clocks", "#clock-cells");
+       if (num_parents <= 0 || num_parents > 2)
+               return;
+
+       for (i = 0; i < num_parents; ++i) {
+               parent_names[i] = of_clk_get_parent_name(np, i);
+               if (!parent_names[i])
+                       return;
+       }
+
+       of_property_read_string(np, "clock-output-names", &name);
+
+       clk = at91_clk_register_sam9x5_slow(sckcr, name, parent_names,
+                                           num_parents);
+       if (IS_ERR(clk))
+               return;
+
+       of_clk_add_provider(np, of_clk_src_simple_get, clk);
+}
+
+static u8 clk_sam9260_slow_get_parent(struct clk_hw *hw)
+{
+       struct clk_sam9260_slow *slowck = to_clk_sam9260_slow(hw);
+
+       return !!(pmc_read(slowck->pmc, AT91_PMC_SR) & AT91_PMC_OSCSEL);
+}
+
+static const struct clk_ops sam9260_slow_ops = {
+       .get_parent = clk_sam9260_slow_get_parent,
+};
+
+static struct clk * __init
+at91_clk_register_sam9260_slow(struct at91_pmc *pmc,
+                              const char *name,
+                              const char **parent_names,
+                              int num_parents)
+{
+       struct clk_sam9260_slow *slowck;
+       struct clk *clk = NULL;
+       struct clk_init_data init;
+
+       if (!pmc || !name)
+               return ERR_PTR(-EINVAL);
+
+       if (!parent_names || !num_parents)
+               return ERR_PTR(-EINVAL);
+
+       slowck = kzalloc(sizeof(*slowck), GFP_KERNEL);
+       if (!slowck)
+               return ERR_PTR(-ENOMEM);
+
+       init.name = name;
+       init.ops = &sam9260_slow_ops;
+       init.parent_names = parent_names;
+       init.num_parents = num_parents;
+       init.flags = 0;
+
+       slowck->hw.init = &init;
+       slowck->pmc = pmc;
+
+       clk = clk_register(NULL, &slowck->hw);
+       if (IS_ERR(clk))
+               kfree(slowck);
+
+       return clk;
+}
+
+void __init of_at91sam9260_clk_slow_setup(struct device_node *np,
+                                         struct at91_pmc *pmc)
+{
+       struct clk *clk;
+       const char *parent_names[2];
+       int num_parents;
+       const char *name = np->name;
+       int i;
+
+       num_parents = of_count_phandle_with_args(np, "clocks", "#clock-cells");
+       if (num_parents <= 0 || num_parents > 1)
+               return;
+
+       for (i = 0; i < num_parents; ++i) {
+               parent_names[i] = of_clk_get_parent_name(np, i);
+               if (!parent_names[i])
+                       return;
+       }
+
+       of_property_read_string(np, "clock-output-names", &name);
+
+       clk = at91_clk_register_sam9260_slow(pmc, name, parent_names,
+                                            num_parents);
+       if (IS_ERR(clk))
+               return;
+
+       of_clk_add_provider(np, of_clk_src_simple_get, clk);
+}
index 6a61477a57e05b2397d79c361f33c33277973af8..524196bb35a54d3565117e0e5a047300be7e30c3 100644 (file)
@@ -229,11 +229,28 @@ out_free_pmc:
 }
 
 static const struct of_device_id pmc_clk_ids[] __initconst = {
+       /* Slow oscillator */
+       {
+               .compatible = "atmel,at91sam9260-clk-slow",
+               .data = of_at91sam9260_clk_slow_setup,
+       },
        /* Main clock */
+       {
+               .compatible = "atmel,at91rm9200-clk-main-osc",
+               .data = of_at91rm9200_clk_main_osc_setup,
+       },
+       {
+               .compatible = "atmel,at91sam9x5-clk-main-rc-osc",
+               .data = of_at91sam9x5_clk_main_rc_osc_setup,
+       },
        {
                .compatible = "atmel,at91rm9200-clk-main",
                .data = of_at91rm9200_clk_main_setup,
        },
+       {
+               .compatible = "atmel,at91sam9x5-clk-main",
+               .data = of_at91sam9x5_clk_main_setup,
+       },
        /* PLL clocks */
        {
                .compatible = "atmel,at91rm9200-clk-pll",
index 441350983ccb03c0ec0297ee7da47cb0138a1ce8..6c7625976113390e33200ed2c62765c29347350b 100644 (file)
@@ -58,8 +58,17 @@ static inline void pmc_write(struct at91_pmc *pmc, int offset, u32 value)
 int of_at91_get_clk_range(struct device_node *np, const char *propname,
                          struct clk_range *range);
 
+extern void __init of_at91sam9260_clk_slow_setup(struct device_node *np,
+                                                struct at91_pmc *pmc);
+
+extern void __init of_at91rm9200_clk_main_osc_setup(struct device_node *np,
+                                                   struct at91_pmc *pmc);
+extern void __init of_at91sam9x5_clk_main_rc_osc_setup(struct device_node *np,
+                                                      struct at91_pmc *pmc);
 extern void __init of_at91rm9200_clk_main_setup(struct device_node *np,
                                                struct at91_pmc *pmc);
+extern void __init of_at91sam9x5_clk_main_setup(struct device_node *np,
+                                               struct at91_pmc *pmc);
 
 extern void __init of_at91rm9200_clk_pll_setup(struct device_node *np,
                                               struct at91_pmc *pmc);
diff --git a/drivers/clk/at91/sckc.c b/drivers/clk/at91/sckc.c
new file mode 100644 (file)
index 0000000..1184d76
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * drivers/clk/at91/sckc.c
+ *
+ *  Copyright (C) 2013 Boris BREZILLON <b.brezillon@overkiz.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.
+ *
+ */
+
+#include <linux/clk-provider.h>
+#include <linux/clkdev.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/io.h>
+
+#include "sckc.h"
+
+static const struct of_device_id sckc_clk_ids[] __initconst = {
+       /* Slow clock */
+       {
+               .compatible = "atmel,at91sam9x5-clk-slow-osc",
+               .data = of_at91sam9x5_clk_slow_osc_setup,
+       },
+       {
+               .compatible = "atmel,at91sam9x5-clk-slow-rc-osc",
+               .data = of_at91sam9x5_clk_slow_rc_osc_setup,
+       },
+       {
+               .compatible = "atmel,at91sam9x5-clk-slow",
+               .data = of_at91sam9x5_clk_slow_setup,
+       },
+       { /*sentinel*/ }
+};
+
+static void __init of_at91sam9x5_sckc_setup(struct device_node *np)
+{
+       struct device_node *childnp;
+       void (*clk_setup)(struct device_node *, void __iomem *);
+       const struct of_device_id *clk_id;
+       void __iomem *regbase = of_iomap(np, 0);
+
+       if (!regbase)
+               return;
+
+       for_each_child_of_node(np, childnp) {
+               clk_id = of_match_node(sckc_clk_ids, childnp);
+               if (!clk_id)
+                       continue;
+               clk_setup = clk_id->data;
+               clk_setup(childnp, regbase);
+       }
+}
+CLK_OF_DECLARE(at91sam9x5_clk_sckc, "atmel,at91sam9x5-sckc",
+              of_at91sam9x5_sckc_setup);
diff --git a/drivers/clk/at91/sckc.h b/drivers/clk/at91/sckc.h
new file mode 100644 (file)
index 0000000..836fcf5
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * drivers/clk/at91/sckc.h
+ *
+ *  Copyright (C) 2013 Boris BREZILLON <b.brezillon@overkiz.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.
+ */
+
+#ifndef __AT91_SCKC_H_
+#define __AT91_SCKC_H_
+
+extern void __init of_at91sam9x5_clk_slow_osc_setup(struct device_node *np,
+                                                   void __iomem *sckcr);
+extern void __init of_at91sam9x5_clk_slow_rc_osc_setup(struct device_node *np,
+                                                      void __iomem *sckcr);
+extern void __init of_at91sam9x5_clk_slow_setup(struct device_node *np,
+                                               void __iomem *sckcr);
+
+#endif /* __AT91_SCKC_H_ */
index b52e1c078b9955330dda32f803a26e8fa1527ab7..571d10974139ef310e5ed2b3b5db18b474f9978b 100644 (file)
@@ -252,15 +252,13 @@ static void __init sirfsoc_clockevent_init(void)
 }
 
 /* initialize the kernel jiffy timer source */
-static void __init sirfsoc_marco_timer_init(void)
+static void __init sirfsoc_marco_timer_init(struct device_node *np)
 {
        unsigned long rate;
        u32 timer_div;
        struct clk *clk;
 
-       /* timer's input clock is io clock */
-       clk = clk_get_sys("io", NULL);
-
+       clk = of_clk_get(np, 0);
        BUG_ON(IS_ERR(clk));
        rate = clk_get_rate(clk);
 
@@ -303,6 +301,6 @@ static void __init sirfsoc_of_timer_init(struct device_node *np)
        if (!sirfsoc_timer1_irq.irq)
                panic("No irq passed for timer1 via DT\n");
 
-       sirfsoc_marco_timer_init();
+       sirfsoc_marco_timer_init(np);
 }
 CLOCKSOURCE_OF_DECLARE(sirfsoc_marco_timer, "sirf,marco-tick", sirfsoc_of_timer_init );
index 1a6b2d6356d630ca65cca3f988d39d553171c038..a722aac7ac021baedf3db3db8e629de6d99a0b14 100644 (file)
@@ -61,7 +61,8 @@ static irqreturn_t sirfsoc_timer_interrupt(int irq, void *dev_id)
 {
        struct clock_event_device *ce = dev_id;
 
-       WARN_ON(!(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_STATUS) & BIT(0)));
+       WARN_ON(!(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_STATUS) &
+               BIT(0)));
 
        /* clear timer0 interrupt */
        writel_relaxed(BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_STATUS);
@@ -77,9 +78,11 @@ static cycle_t sirfsoc_timer_read(struct clocksource *cs)
        u64 cycles;
 
        /* latch the 64-bit timer counter */
-       writel_relaxed(SIRFSOC_TIMER_LATCH_BIT, sirfsoc_timer_base + SIRFSOC_TIMER_LATCH);
+       writel_relaxed(SIRFSOC_TIMER_LATCH_BIT,
+               sirfsoc_timer_base + SIRFSOC_TIMER_LATCH);
        cycles = readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_LATCHED_HI);
-       cycles = (cycles << 32) | readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_LATCHED_LO);
+       cycles = (cycles << 32) |
+               readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_LATCHED_LO);
 
        return cycles;
 }
@@ -89,11 +92,13 @@ static int sirfsoc_timer_set_next_event(unsigned long delta,
 {
        unsigned long now, next;
 
-       writel_relaxed(SIRFSOC_TIMER_LATCH_BIT, sirfsoc_timer_base + SIRFSOC_TIMER_LATCH);
+       writel_relaxed(SIRFSOC_TIMER_LATCH_BIT,
+               sirfsoc_timer_base + SIRFSOC_TIMER_LATCH);
        now = readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_LATCHED_LO);
        next = now + delta;
        writel_relaxed(next, sirfsoc_timer_base + SIRFSOC_TIMER_MATCH_0);
-       writel_relaxed(SIRFSOC_TIMER_LATCH_BIT, sirfsoc_timer_base + SIRFSOC_TIMER_LATCH);
+       writel_relaxed(SIRFSOC_TIMER_LATCH_BIT,
+               sirfsoc_timer_base + SIRFSOC_TIMER_LATCH);
        now = readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_LATCHED_LO);
 
        return next - now > delta ? -ETIME : 0;
@@ -108,10 +113,12 @@ static void sirfsoc_timer_set_mode(enum clock_event_mode mode,
                WARN_ON(1);
                break;
        case CLOCK_EVT_MODE_ONESHOT:
-               writel_relaxed(val | BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_INT_EN);
+               writel_relaxed(val | BIT(0),
+                       sirfsoc_timer_base + SIRFSOC_TIMER_INT_EN);
                break;
        case CLOCK_EVT_MODE_SHUTDOWN:
-               writel_relaxed(val & ~BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_INT_EN);
+               writel_relaxed(val & ~BIT(0),
+                       sirfsoc_timer_base + SIRFSOC_TIMER_INT_EN);
                break;
        case CLOCK_EVT_MODE_UNUSED:
        case CLOCK_EVT_MODE_RESUME:
@@ -123,10 +130,13 @@ static void sirfsoc_clocksource_suspend(struct clocksource *cs)
 {
        int i;
 
-       writel_relaxed(SIRFSOC_TIMER_LATCH_BIT, sirfsoc_timer_base + SIRFSOC_TIMER_LATCH);
+       writel_relaxed(SIRFSOC_TIMER_LATCH_BIT,
+               sirfsoc_timer_base + SIRFSOC_TIMER_LATCH);
 
        for (i = 0; i < SIRFSOC_TIMER_REG_CNT; i++)
-               sirfsoc_timer_reg_val[i] = readl_relaxed(sirfsoc_timer_base + sirfsoc_timer_reg_list[i]);
+               sirfsoc_timer_reg_val[i] =
+                       readl_relaxed(sirfsoc_timer_base +
+                               sirfsoc_timer_reg_list[i]);
 }
 
 static void sirfsoc_clocksource_resume(struct clocksource *cs)
@@ -134,10 +144,13 @@ static void sirfsoc_clocksource_resume(struct clocksource *cs)
        int i;
 
        for (i = 0; i < SIRFSOC_TIMER_REG_CNT - 2; i++)
-               writel_relaxed(sirfsoc_timer_reg_val[i], sirfsoc_timer_base + sirfsoc_timer_reg_list[i]);
+               writel_relaxed(sirfsoc_timer_reg_val[i],
+                       sirfsoc_timer_base + sirfsoc_timer_reg_list[i]);
 
-       writel_relaxed(sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT - 2], sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_LO);
-       writel_relaxed(sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT - 1], sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_HI);
+       writel_relaxed(sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT - 2],
+               sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_LO);
+       writel_relaxed(sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT - 1],
+               sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_HI);
 }
 
 static struct clock_event_device sirfsoc_clockevent = {
@@ -185,11 +198,8 @@ static void __init sirfsoc_prima2_timer_init(struct device_node *np)
        unsigned long rate;
        struct clk *clk;
 
-       /* timer's input clock is io clock */
-       clk = clk_get_sys("io", NULL);
-
+       clk = of_clk_get(np, 0);
        BUG_ON(IS_ERR(clk));
-
        rate = clk_get_rate(clk);
 
        BUG_ON(rate < PRIMA2_CLOCK_FREQ);
@@ -202,7 +212,7 @@ static void __init sirfsoc_prima2_timer_init(struct device_node *np)
        sirfsoc_timer_irq.irq = irq_of_parse_and_map(np, 0);
 
        writel_relaxed(rate / PRIMA2_CLOCK_FREQ / 2 - 1,
-                      sirfsoc_timer_base + SIRFSOC_TIMER_DIV);
+               sirfsoc_timer_base + SIRFSOC_TIMER_DIV);
        writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_LO);
        writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_HI);
        writel_relaxed(BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_STATUS);
@@ -216,4 +226,5 @@ static void __init sirfsoc_prima2_timer_init(struct device_node *np)
 
        sirfsoc_clockevent_init();
 }
-CLOCKSOURCE_OF_DECLARE(sirfsoc_prima2_timer, "sirf,prima2-tick", sirfsoc_prima2_timer_init);
+CLOCKSOURCE_OF_DECLARE(sirfsoc_prima2_timer,
+       "sirf,prima2-tick", sirfsoc_prima2_timer_init);
index 97ccc31dbdd8fb8c48510cc00f5472ea6aefa191..5bb94780d3778d31424b741b292ef70637444782 100644 (file)
@@ -1,6 +1,11 @@
 #
 # ARM CPU Idle drivers
 #
+config ARM_ARMADA_370_XP_CPUIDLE
+       bool "CPU Idle Driver for Armada 370/XP family processors"
+       depends on ARCH_MVEBU
+       help
+         Select this to enable cpuidle on Armada 370/XP processors.
 
 config ARM_BIG_LITTLE_CPUIDLE
        bool "Support for ARM big.LITTLE processors"
index f71ae1b373c5e85fc1075622e144832b5d7a0d1e..9902d052bd87a49cee52fc0ee90ae891c6cc91ce 100644 (file)
@@ -7,6 +7,7 @@ obj-$(CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED) += coupled.o
 
 ##################################################################################
 # ARM SoC drivers
+obj-$(CONFIG_ARM_ARMADA_370_XP_CPUIDLE) += cpuidle-armada-370-xp.o
 obj-$(CONFIG_ARM_BIG_LITTLE_CPUIDLE)   += cpuidle-big_little.o
 obj-$(CONFIG_ARM_HIGHBANK_CPUIDLE)     += cpuidle-calxeda.o
 obj-$(CONFIG_ARM_KIRKWOOD_CPUIDLE)     += cpuidle-kirkwood.o
diff --git a/drivers/cpuidle/cpuidle-armada-370-xp.c b/drivers/cpuidle/cpuidle-armada-370-xp.c
new file mode 100644 (file)
index 0000000..28587d0
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * Marvell Armada 370 and Armada XP SoC cpuidle driver
+ *
+ * Copyright (C) 2014 Marvell
+ *
+ * Nadav Haklai <nadavh@marvell.com>
+ * Gregory CLEMENT <gregory.clement@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.
+ *
+ * Maintainer: Gregory CLEMENT <gregory.clement@free-electrons.com>
+ */
+
+#include <linux/cpu_pm.h>
+#include <linux/cpuidle.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/suspend.h>
+#include <linux/platform_device.h>
+#include <asm/cpuidle.h>
+
+#define ARMADA_370_XP_MAX_STATES       3
+#define ARMADA_370_XP_FLAG_DEEP_IDLE   0x10000
+
+static int (*armada_370_xp_cpu_suspend)(int);
+
+static int armada_370_xp_enter_idle(struct cpuidle_device *dev,
+                               struct cpuidle_driver *drv,
+                               int index)
+{
+       int ret;
+       bool deepidle = false;
+       cpu_pm_enter();
+
+       if (drv->states[index].flags & ARMADA_370_XP_FLAG_DEEP_IDLE)
+               deepidle = true;
+
+       ret = armada_370_xp_cpu_suspend(deepidle);
+       if (ret)
+               return ret;
+
+       cpu_pm_exit();
+
+       return index;
+}
+
+static struct cpuidle_driver armada_370_xp_idle_driver = {
+       .name                   = "armada_370_xp_idle",
+       .states[0]              = ARM_CPUIDLE_WFI_STATE,
+       .states[1]              = {
+               .enter                  = armada_370_xp_enter_idle,
+               .exit_latency           = 10,
+               .power_usage            = 50,
+               .target_residency       = 100,
+               .flags                  = CPUIDLE_FLAG_TIME_VALID,
+               .name                   = "MV CPU IDLE",
+               .desc                   = "CPU power down",
+       },
+       .states[2]              = {
+               .enter                  = armada_370_xp_enter_idle,
+               .exit_latency           = 100,
+               .power_usage            = 5,
+               .target_residency       = 1000,
+               .flags                  = CPUIDLE_FLAG_TIME_VALID |
+                                               ARMADA_370_XP_FLAG_DEEP_IDLE,
+               .name                   = "MV CPU DEEP IDLE",
+               .desc                   = "CPU and L2 Fabric power down",
+       },
+       .state_count = ARMADA_370_XP_MAX_STATES,
+};
+
+static int armada_370_xp_cpuidle_probe(struct platform_device *pdev)
+{
+
+       armada_370_xp_cpu_suspend = (void *)(pdev->dev.platform_data);
+       return cpuidle_register(&armada_370_xp_idle_driver, NULL);
+}
+
+static struct platform_driver armada_370_xp_cpuidle_plat_driver = {
+       .driver = {
+               .name = "cpuidle-armada-370-xp",
+               .owner = THIS_MODULE,
+       },
+       .probe = armada_370_xp_cpuidle_probe,
+};
+
+module_platform_driver(armada_370_xp_cpuidle_plat_driver);
+
+MODULE_AUTHOR("Gregory CLEMENT <gregory.clement@free-electrons.com>");
+MODULE_DESCRIPTION("Armada 370/XP cpu idle driver");
+MODULE_LICENSE("GPL");
index 89777ed9abd858773b128c3a4d9fd6b34bdd9584..3b5bacd4d8da5dbe41be266ef8e432543ecdfb39 100644 (file)
 #include <linux/iio/trigger_consumer.h>
 #include <linux/iio/triggered_buffer.h>
 
-#include <mach/at91_adc.h>
+/* Registers */
+#define AT91_ADC_CR            0x00            /* Control Register */
+#define                AT91_ADC_SWRST          (1 << 0)        /* Software Reset */
+#define                AT91_ADC_START          (1 << 1)        /* Start Conversion */
+
+#define AT91_ADC_MR            0x04            /* Mode Register */
+#define                AT91_ADC_TSAMOD         (3 << 0)        /* ADC mode */
+#define                AT91_ADC_TSAMOD_ADC_ONLY_MODE           (0 << 0)        /* ADC Mode */
+#define                AT91_ADC_TSAMOD_TS_ONLY_MODE            (1 << 0)        /* Touch Screen Only Mode */
+#define                AT91_ADC_TRGEN          (1 << 0)        /* Trigger Enable */
+#define                AT91_ADC_TRGSEL         (7 << 1)        /* Trigger Selection */
+#define                        AT91_ADC_TRGSEL_TC0             (0 << 1)
+#define                        AT91_ADC_TRGSEL_TC1             (1 << 1)
+#define                        AT91_ADC_TRGSEL_TC2             (2 << 1)
+#define                        AT91_ADC_TRGSEL_EXTERNAL        (6 << 1)
+#define                AT91_ADC_LOWRES         (1 << 4)        /* Low Resolution */
+#define                AT91_ADC_SLEEP          (1 << 5)        /* Sleep Mode */
+#define                AT91_ADC_PENDET         (1 << 6)        /* Pen contact detection enable */
+#define                AT91_ADC_PRESCAL_9260   (0x3f << 8)     /* Prescalar Rate Selection */
+#define                AT91_ADC_PRESCAL_9G45   (0xff << 8)
+#define                        AT91_ADC_PRESCAL_(x)    ((x) << 8)
+#define                AT91_ADC_STARTUP_9260   (0x1f << 16)    /* Startup Up Time */
+#define                AT91_ADC_STARTUP_9G45   (0x7f << 16)
+#define                AT91_ADC_STARTUP_9X5    (0xf << 16)
+#define                        AT91_ADC_STARTUP_(x)    ((x) << 16)
+#define                AT91_ADC_SHTIM          (0xf  << 24)    /* Sample & Hold Time */
+#define                        AT91_ADC_SHTIM_(x)      ((x) << 24)
+#define                AT91_ADC_PENDBC         (0x0f << 28)    /* Pen Debounce time */
+#define                        AT91_ADC_PENDBC_(x)     ((x) << 28)
+
+#define AT91_ADC_TSR           0x0C
+#define                AT91_ADC_TSR_SHTIM      (0xf  << 24)    /* Sample & Hold Time */
+#define                        AT91_ADC_TSR_SHTIM_(x)  ((x) << 24)
+
+#define AT91_ADC_CHER          0x10            /* Channel Enable Register */
+#define AT91_ADC_CHDR          0x14            /* Channel Disable Register */
+#define AT91_ADC_CHSR          0x18            /* Channel Status Register */
+#define                AT91_ADC_CH(n)          (1 << (n))      /* Channel Number */
+
+#define AT91_ADC_SR            0x1C            /* Status Register */
+#define                AT91_ADC_EOC(n)         (1 << (n))      /* End of Conversion on Channel N */
+#define                AT91_ADC_OVRE(n)        (1 << ((n) + 8))/* Overrun Error on Channel N */
+#define                AT91_ADC_DRDY           (1 << 16)       /* Data Ready */
+#define                AT91_ADC_GOVRE          (1 << 17)       /* General Overrun Error */
+#define                AT91_ADC_ENDRX          (1 << 18)       /* End of RX Buffer */
+#define                AT91_ADC_RXFUFF         (1 << 19)       /* RX Buffer Full */
+
+#define AT91_ADC_SR_9X5                0x30            /* Status Register for 9x5 */
+#define                AT91_ADC_SR_DRDY_9X5    (1 << 24)       /* Data Ready */
+
+#define AT91_ADC_LCDR          0x20            /* Last Converted Data Register */
+#define                AT91_ADC_LDATA          (0x3ff)
+
+#define AT91_ADC_IER           0x24            /* Interrupt Enable Register */
+#define AT91_ADC_IDR           0x28            /* Interrupt Disable Register */
+#define AT91_ADC_IMR           0x2C            /* Interrupt Mask Register */
+#define                AT91RL_ADC_IER_PEN      (1 << 20)
+#define                AT91RL_ADC_IER_NOPEN    (1 << 21)
+#define                AT91_ADC_IER_PEN        (1 << 29)
+#define                AT91_ADC_IER_NOPEN      (1 << 30)
+#define                AT91_ADC_IER_XRDY       (1 << 20)
+#define                AT91_ADC_IER_YRDY       (1 << 21)
+#define                AT91_ADC_IER_PRDY       (1 << 22)
+#define                AT91_ADC_ISR_PENS       (1 << 31)
+
+#define AT91_ADC_CHR(n)                (0x30 + ((n) * 4))      /* Channel Data Register N */
+#define                AT91_ADC_DATA           (0x3ff)
+
+#define AT91_ADC_CDR0_9X5      (0x50)                  /* Channel Data Register 0 for 9X5 */
+
+#define AT91_ADC_ACR           0x94    /* Analog Control Register */
+#define                AT91_ADC_ACR_PENDETSENS (0x3 << 0)      /* pull-up resistor */
+
+#define AT91_ADC_TSMR          0xB0
+#define                AT91_ADC_TSMR_TSMODE    (3 << 0)        /* Touch Screen Mode */
+#define                        AT91_ADC_TSMR_TSMODE_NONE               (0 << 0)
+#define                        AT91_ADC_TSMR_TSMODE_4WIRE_NO_PRESS     (1 << 0)
+#define                        AT91_ADC_TSMR_TSMODE_4WIRE_PRESS        (2 << 0)
+#define                        AT91_ADC_TSMR_TSMODE_5WIRE              (3 << 0)
+#define                AT91_ADC_TSMR_TSAV      (3 << 4)        /* Averages samples */
+#define                        AT91_ADC_TSMR_TSAV_(x)          ((x) << 4)
+#define                AT91_ADC_TSMR_SCTIM     (0x0f << 16)    /* Switch closure time */
+#define                AT91_ADC_TSMR_PENDBC    (0x0f << 28)    /* Pen Debounce time */
+#define                        AT91_ADC_TSMR_PENDBC_(x)        ((x) << 28)
+#define                AT91_ADC_TSMR_NOTSDMA   (1 << 22)       /* No Touchscreen DMA */
+#define                AT91_ADC_TSMR_PENDET_DIS        (0 << 24)       /* Pen contact detection disable */
+#define                AT91_ADC_TSMR_PENDET_ENA        (1 << 24)       /* Pen contact detection enable */
+
+#define AT91_ADC_TSXPOSR       0xB4
+#define AT91_ADC_TSYPOSR       0xB8
+#define AT91_ADC_TSPRESSR      0xBC
+
+#define AT91_ADC_TRGR_9260     AT91_ADC_MR
+#define AT91_ADC_TRGR_9G45     0x08
+#define AT91_ADC_TRGR_9X5      0xC0
+
+/* Trigger Register bit field */
+#define                AT91_ADC_TRGR_TRGPER    (0xffff << 16)
+#define                        AT91_ADC_TRGR_TRGPER_(x)        ((x) << 16)
+#define                AT91_ADC_TRGR_TRGMOD    (0x7 << 0)
+#define                        AT91_ADC_TRGR_NONE              (0 << 0)
+#define                        AT91_ADC_TRGR_MOD_PERIOD_TRIG   (5 << 0)
 
 #define AT91_ADC_CHAN(st, ch) \
        (st->registers->channel_base + (ch * 4))
 #define TOUCH_SAMPLE_PERIOD_US         2000    /* 2ms */
 #define TOUCH_PEN_DETECT_DEBOUNCE_US   200
 
+#define MAX_RLPOS_BITS         10
+#define TOUCH_SAMPLE_PERIOD_US_RL      10000   /* 10ms, the SoC can't keep up with 2ms */
+#define TOUCH_SHTIM                    0xa
+
+/**
+ * struct at91_adc_reg_desc - Various informations relative to registers
+ * @channel_base:      Base offset for the channel data registers
+ * @drdy_mask:         Mask of the DRDY field in the relevant registers
+                       (Interruptions registers mostly)
+ * @status_register:   Offset of the Interrupt Status Register
+ * @trigger_register:  Offset of the Trigger setup register
+ * @mr_prescal_mask:   Mask of the PRESCAL field in the adc MR register
+ * @mr_startup_mask:   Mask of the STARTUP field in the adc MR register
+ */
+struct at91_adc_reg_desc {
+       u8      channel_base;
+       u32     drdy_mask;
+       u8      status_register;
+       u8      trigger_register;
+       u32     mr_prescal_mask;
+       u32     mr_startup_mask;
+};
+
 struct at91_adc_caps {
        bool    has_ts;         /* Support touch screen */
        bool    has_tsmr;       /* only at91sam9x5, sama5d3 have TSMR reg */
@@ -64,12 +188,6 @@ struct at91_adc_caps {
        struct at91_adc_reg_desc registers;
 };
 
-enum atmel_adc_ts_type {
-       ATMEL_ADC_TOUCHSCREEN_NONE = 0,
-       ATMEL_ADC_TOUCHSCREEN_4WIRE = 4,
-       ATMEL_ADC_TOUCHSCREEN_5WIRE = 5,
-};
-
 struct at91_adc_state {
        struct clk              *adc_clk;
        u16                     *buffer;
@@ -114,6 +232,11 @@ struct at91_adc_state {
 
        u16                     ts_sample_period_val;
        u32                     ts_pressure_threshold;
+       u16                     ts_pendbc;
+
+       bool                    ts_bufferedmeasure;
+       u32                     ts_prev_absx;
+       u32                     ts_prev_absy;
 };
 
 static irqreturn_t at91_adc_trigger_handler(int irq, void *p)
@@ -220,7 +343,72 @@ static int at91_ts_sample(struct at91_adc_state *st)
        return 0;
 }
 
-static irqreturn_t at91_adc_interrupt(int irq, void *private)
+static irqreturn_t at91_adc_rl_interrupt(int irq, void *private)
+{
+       struct iio_dev *idev = private;
+       struct at91_adc_state *st = iio_priv(idev);
+       u32 status = at91_adc_readl(st, st->registers->status_register);
+       unsigned int reg;
+
+       status &= at91_adc_readl(st, AT91_ADC_IMR);
+       if (status & st->registers->drdy_mask)
+               handle_adc_eoc_trigger(irq, idev);
+
+       if (status & AT91RL_ADC_IER_PEN) {
+               /* Disabling pen debounce is required to get a NOPEN irq */
+               reg = at91_adc_readl(st, AT91_ADC_MR);
+               reg &= ~AT91_ADC_PENDBC;
+               at91_adc_writel(st, AT91_ADC_MR, reg);
+
+               at91_adc_writel(st, AT91_ADC_IDR, AT91RL_ADC_IER_PEN);
+               at91_adc_writel(st, AT91_ADC_IER, AT91RL_ADC_IER_NOPEN
+                               | AT91_ADC_EOC(3));
+               /* Set up period trigger for sampling */
+               at91_adc_writel(st, st->registers->trigger_register,
+                       AT91_ADC_TRGR_MOD_PERIOD_TRIG |
+                       AT91_ADC_TRGR_TRGPER_(st->ts_sample_period_val));
+       } else if (status & AT91RL_ADC_IER_NOPEN) {
+               reg = at91_adc_readl(st, AT91_ADC_MR);
+               reg |= AT91_ADC_PENDBC_(st->ts_pendbc) & AT91_ADC_PENDBC;
+               at91_adc_writel(st, AT91_ADC_MR, reg);
+               at91_adc_writel(st, st->registers->trigger_register,
+                       AT91_ADC_TRGR_NONE);
+
+               at91_adc_writel(st, AT91_ADC_IDR, AT91RL_ADC_IER_NOPEN
+                               | AT91_ADC_EOC(3));
+               at91_adc_writel(st, AT91_ADC_IER, AT91RL_ADC_IER_PEN);
+               st->ts_bufferedmeasure = false;
+               input_report_key(st->ts_input, BTN_TOUCH, 0);
+               input_sync(st->ts_input);
+       } else if (status & AT91_ADC_EOC(3)) {
+               /* Conversion finished */
+               if (st->ts_bufferedmeasure) {
+                       /*
+                        * Last measurement is always discarded, since it can
+                        * be erroneous.
+                        * Always report previous measurement
+                        */
+                       input_report_abs(st->ts_input, ABS_X, st->ts_prev_absx);
+                       input_report_abs(st->ts_input, ABS_Y, st->ts_prev_absy);
+                       input_report_key(st->ts_input, BTN_TOUCH, 1);
+                       input_sync(st->ts_input);
+               } else
+                       st->ts_bufferedmeasure = true;
+
+               /* Now make new measurement */
+               st->ts_prev_absx = at91_adc_readl(st, AT91_ADC_CHAN(st, 3))
+                                  << MAX_RLPOS_BITS;
+               st->ts_prev_absx /= at91_adc_readl(st, AT91_ADC_CHAN(st, 2));
+
+               st->ts_prev_absy = at91_adc_readl(st, AT91_ADC_CHAN(st, 1))
+                                  << MAX_RLPOS_BITS;
+               st->ts_prev_absy /= at91_adc_readl(st, AT91_ADC_CHAN(st, 0));
+       }
+
+       return IRQ_HANDLED;
+}
+
+static irqreturn_t at91_adc_9x5_interrupt(int irq, void *private)
 {
        struct iio_dev *idev = private;
        struct at91_adc_state *st = iio_priv(idev);
@@ -653,6 +841,8 @@ static int at91_adc_probe_dt_ts(struct device_node *node,
                return -EINVAL;
        }
 
+       if (!st->caps->has_tsmr)
+               return 0;
        prop = 0;
        of_property_read_u32(node, "atmel,adc-ts-pressure-threshold", &prop);
        st->ts_pressure_threshold = prop;
@@ -776,6 +966,7 @@ static int at91_adc_probe_pdata(struct at91_adc_state *st,
        st->trigger_number = pdata->trigger_number;
        st->trigger_list = pdata->trigger_list;
        st->registers = &st->caps->registers;
+       st->touchscreen_type = pdata->touchscreen_type;
 
        return 0;
 }
@@ -790,7 +981,10 @@ static int atmel_ts_open(struct input_dev *dev)
 {
        struct at91_adc_state *st = input_get_drvdata(dev);
 
-       at91_adc_writel(st, AT91_ADC_IER, AT91_ADC_IER_PEN);
+       if (st->caps->has_tsmr)
+               at91_adc_writel(st, AT91_ADC_IER, AT91_ADC_IER_PEN);
+       else
+               at91_adc_writel(st, AT91_ADC_IER, AT91RL_ADC_IER_PEN);
        return 0;
 }
 
@@ -798,45 +992,61 @@ static void atmel_ts_close(struct input_dev *dev)
 {
        struct at91_adc_state *st = input_get_drvdata(dev);
 
-       at91_adc_writel(st, AT91_ADC_IDR, AT91_ADC_IER_PEN);
+       if (st->caps->has_tsmr)
+               at91_adc_writel(st, AT91_ADC_IDR, AT91_ADC_IER_PEN);
+       else
+               at91_adc_writel(st, AT91_ADC_IDR, AT91RL_ADC_IER_PEN);
 }
 
 static int at91_ts_hw_init(struct at91_adc_state *st, u32 adc_clk_khz)
 {
-       u32 reg = 0, pendbc;
+       u32 reg = 0;
        int i = 0;
 
-       if (st->touchscreen_type == ATMEL_ADC_TOUCHSCREEN_4WIRE)
-               reg = AT91_ADC_TSMR_TSMODE_4WIRE_PRESS;
-       else
-               reg = AT91_ADC_TSMR_TSMODE_5WIRE;
-
        /* a Pen Detect Debounce Time is necessary for the ADC Touch to avoid
         * pen detect noise.
         * The formula is : Pen Detect Debounce Time = (2 ^ pendbc) / ADCClock
         */
-       pendbc = round_up(TOUCH_PEN_DETECT_DEBOUNCE_US * adc_clk_khz / 1000, 1);
+       st->ts_pendbc = round_up(TOUCH_PEN_DETECT_DEBOUNCE_US * adc_clk_khz /
+                                1000, 1);
 
-       while (pendbc >> ++i)
+       while (st->ts_pendbc >> ++i)
                ;       /* Empty! Find the shift offset */
-       if (abs(pendbc - (1 << i)) < abs(pendbc - (1 << (i - 1))))
-               pendbc = i;
+       if (abs(st->ts_pendbc - (1 << i)) < abs(st->ts_pendbc - (1 << (i - 1))))
+               st->ts_pendbc = i;
        else
-               pendbc = i - 1;
+               st->ts_pendbc = i - 1;
 
-       if (st->caps->has_tsmr) {
-               reg |= AT91_ADC_TSMR_TSAV_(st->caps->ts_filter_average)
-                               & AT91_ADC_TSMR_TSAV;
-               reg |= AT91_ADC_TSMR_PENDBC_(pendbc) & AT91_ADC_TSMR_PENDBC;
-               reg |= AT91_ADC_TSMR_NOTSDMA;
-               reg |= AT91_ADC_TSMR_PENDET_ENA;
-               reg |= 0x03 << 8;       /* TSFREQ, need bigger than TSAV */
-
-               at91_adc_writel(st, AT91_ADC_TSMR, reg);
-       } else {
-               /* TODO: for 9g45 which has no TSMR */
+       if (!st->caps->has_tsmr) {
+               reg = at91_adc_readl(st, AT91_ADC_MR);
+               reg |= AT91_ADC_TSAMOD_TS_ONLY_MODE | AT91_ADC_PENDET;
+
+               reg |= AT91_ADC_PENDBC_(st->ts_pendbc) & AT91_ADC_PENDBC;
+               at91_adc_writel(st, AT91_ADC_MR, reg);
+
+               reg = AT91_ADC_TSR_SHTIM_(TOUCH_SHTIM) & AT91_ADC_TSR_SHTIM;
+               at91_adc_writel(st, AT91_ADC_TSR, reg);
+
+               st->ts_sample_period_val = round_up((TOUCH_SAMPLE_PERIOD_US_RL *
+                                                   adc_clk_khz / 1000) - 1, 1);
+
+               return 0;
        }
 
+       if (st->touchscreen_type == ATMEL_ADC_TOUCHSCREEN_4WIRE)
+               reg = AT91_ADC_TSMR_TSMODE_4WIRE_PRESS;
+       else
+               reg = AT91_ADC_TSMR_TSMODE_5WIRE;
+
+       reg |= AT91_ADC_TSMR_TSAV_(st->caps->ts_filter_average)
+              & AT91_ADC_TSMR_TSAV;
+       reg |= AT91_ADC_TSMR_PENDBC_(st->ts_pendbc) & AT91_ADC_TSMR_PENDBC;
+       reg |= AT91_ADC_TSMR_NOTSDMA;
+       reg |= AT91_ADC_TSMR_PENDET_ENA;
+       reg |= 0x03 << 8;       /* TSFREQ, needs to be bigger than TSAV */
+
+       at91_adc_writel(st, AT91_ADC_TSMR, reg);
+
        /* Change adc internal resistor value for better pen detection,
         * default value is 100 kOhm.
         * 0 = 200 kOhm, 1 = 150 kOhm, 2 = 100 kOhm, 3 = 50 kOhm
@@ -845,7 +1055,7 @@ static int at91_ts_hw_init(struct at91_adc_state *st, u32 adc_clk_khz)
        at91_adc_writel(st, AT91_ADC_ACR, st->caps->ts_pen_detect_sensitivity
                        & AT91_ADC_ACR_PENDETSENS);
 
-       /* Sample Peroid Time = (TRGPER + 1) / ADCClock */
+       /* Sample Period Time = (TRGPER + 1) / ADCClock */
        st->ts_sample_period_val = round_up((TOUCH_SAMPLE_PERIOD_US *
                        adc_clk_khz / 1000) - 1, 1);
 
@@ -874,18 +1084,38 @@ static int at91_ts_register(struct at91_adc_state *st,
        __set_bit(EV_ABS, input->evbit);
        __set_bit(EV_KEY, input->evbit);
        __set_bit(BTN_TOUCH, input->keybit);
-       input_set_abs_params(input, ABS_X, 0, (1 << MAX_POS_BITS) - 1, 0, 0);
-       input_set_abs_params(input, ABS_Y, 0, (1 << MAX_POS_BITS) - 1, 0, 0);
-       input_set_abs_params(input, ABS_PRESSURE, 0, 0xffffff, 0, 0);
+       if (st->caps->has_tsmr) {
+               input_set_abs_params(input, ABS_X, 0, (1 << MAX_POS_BITS) - 1,
+                                    0, 0);
+               input_set_abs_params(input, ABS_Y, 0, (1 << MAX_POS_BITS) - 1,
+                                    0, 0);
+               input_set_abs_params(input, ABS_PRESSURE, 0, 0xffffff, 0, 0);
+       } else {
+               if (st->touchscreen_type != ATMEL_ADC_TOUCHSCREEN_4WIRE) {
+                       dev_err(&pdev->dev,
+                               "This touchscreen controller only support 4 wires\n");
+                       ret = -EINVAL;
+                       goto err;
+               }
+
+               input_set_abs_params(input, ABS_X, 0, (1 << MAX_RLPOS_BITS) - 1,
+                                    0, 0);
+               input_set_abs_params(input, ABS_Y, 0, (1 << MAX_RLPOS_BITS) - 1,
+                                    0, 0);
+       }
 
        st->ts_input = input;
        input_set_drvdata(input, st);
 
        ret = input_register_device(input);
        if (ret)
-               input_free_device(st->ts_input);
+               goto err;
 
        return ret;
+
+err:
+       input_free_device(st->ts_input);
+       return ret;
 }
 
 static void at91_ts_unregister(struct at91_adc_state *st)
@@ -943,11 +1173,13 @@ static int at91_adc_probe(struct platform_device *pdev)
         */
        at91_adc_writel(st, AT91_ADC_CR, AT91_ADC_SWRST);
        at91_adc_writel(st, AT91_ADC_IDR, 0xFFFFFFFF);
-       ret = request_irq(st->irq,
-                         at91_adc_interrupt,
-                         0,
-                         pdev->dev.driver->name,
-                         idev);
+
+       if (st->caps->has_tsmr)
+               ret = request_irq(st->irq, at91_adc_9x5_interrupt, 0,
+                                 pdev->dev.driver->name, idev);
+       else
+               ret = request_irq(st->irq, at91_adc_rl_interrupt, 0,
+                                 pdev->dev.driver->name, idev);
        if (ret) {
                dev_err(&pdev->dev, "Failed to allocate IRQ.\n");
                return ret;
@@ -1051,12 +1283,6 @@ static int at91_adc_probe(struct platform_device *pdev)
                        goto error_disable_adc_clk;
                }
        } else {
-               if (!st->caps->has_tsmr) {
-                       dev_err(&pdev->dev, "We don't support non-TSMR adc\n");
-                       ret = -ENODEV;
-                       goto error_disable_adc_clk;
-               }
-
                ret = at91_ts_register(st, pdev);
                if (ret)
                        goto error_disable_adc_clk;
@@ -1120,6 +1346,20 @@ static struct at91_adc_caps at91sam9260_caps = {
        },
 };
 
+static struct at91_adc_caps at91sam9rl_caps = {
+       .has_ts = true,
+       .calc_startup_ticks = calc_startup_ticks_9260,  /* same as 9260 */
+       .num_channels = 6,
+       .registers = {
+               .channel_base = AT91_ADC_CHR(0),
+               .drdy_mask = AT91_ADC_DRDY,
+               .status_register = AT91_ADC_SR,
+               .trigger_register = AT91_ADC_TRGR_9G45,
+               .mr_prescal_mask = AT91_ADC_PRESCAL_9260,
+               .mr_startup_mask = AT91_ADC_STARTUP_9G45,
+       },
+};
+
 static struct at91_adc_caps at91sam9g45_caps = {
        .has_ts = true,
        .calc_startup_ticks = calc_startup_ticks_9260,  /* same as 9260 */
@@ -1154,6 +1394,7 @@ static struct at91_adc_caps at91sam9x5_caps = {
 
 static const struct of_device_id at91_adc_dt_ids[] = {
        { .compatible = "atmel,at91sam9260-adc", .data = &at91sam9260_caps },
+       { .compatible = "atmel,at91sam9rl-adc", .data = &at91sam9rl_caps },
        { .compatible = "atmel,at91sam9g45-adc", .data = &at91sam9g45_caps },
        { .compatible = "atmel,at91sam9x5-adc", .data = &at91sam9x5_caps },
        {},
@@ -1164,6 +1405,9 @@ static const struct platform_device_id at91_adc_ids[] = {
        {
                .name = "at91sam9260-adc",
                .driver_data = (unsigned long)&at91sam9260_caps,
+       }, {
+               .name = "at91sam9rl-adc",
+               .driver_data = (unsigned long)&at91sam9rl_caps,
        }, {
                .name = "at91sam9g45-adc",
                .driver_data = (unsigned long)&at91sam9g45_caps,
index b845e9370871bfdc0038ad8202b1d49bdddef121..d4e5ab57909fd132dc7e61291ed007901d23b8aa 100644 (file)
@@ -550,18 +550,6 @@ config TOUCHSCREEN_TI_AM335X_TSC
          To compile this driver as a module, choose M here: the
          module will be called ti_am335x_tsc.
 
-config TOUCHSCREEN_ATMEL_TSADCC
-       tristate "Atmel Touchscreen Interface"
-       depends on ARCH_AT91
-       help
-         Say Y here if you have a 4-wire touchscreen connected to the
-          ADC Controller on your Atmel SoC.
-
-         If unsure, say N.
-
-         To compile this driver as a module, choose M here: the
-         module will be called atmel_tsadcc.
-
 config TOUCHSCREEN_UCB1400
        tristate "Philips UCB1400 touchscreen"
        depends on AC97_BUS
index 4bc954b7c7c305393b9be4f0b07d5ca35ff64380..03f12a1f221819494139af161352f58689a4702a 100644 (file)
@@ -13,7 +13,6 @@ obj-$(CONFIG_TOUCHSCREEN_AD7879_I2C)  += ad7879-i2c.o
 obj-$(CONFIG_TOUCHSCREEN_AD7879_SPI)   += ad7879-spi.o
 obj-$(CONFIG_TOUCHSCREEN_ADS7846)      += ads7846.o
 obj-$(CONFIG_TOUCHSCREEN_ATMEL_MXT)    += atmel_mxt_ts.o
-obj-$(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) += atmel_tsadcc.o
 obj-$(CONFIG_TOUCHSCREEN_AUO_PIXCIR)   += auo-pixcir-ts.o
 obj-$(CONFIG_TOUCHSCREEN_BU21013)      += bu21013_ts.o
 obj-$(CONFIG_TOUCHSCREEN_CY8CTMG110)   += cy8ctmg110_ts.o
diff --git a/drivers/input/touchscreen/atmel_tsadcc.c b/drivers/input/touchscreen/atmel_tsadcc.c
deleted file mode 100644 (file)
index a7c9d69..0000000
+++ /dev/null
@@ -1,358 +0,0 @@
-/*
- *  Atmel Touch Screen Driver
- *
- *  Copyright (c) 2008 ATMEL
- *  Copyright (c) 2008 Dan Liang
- *  Copyright (c) 2008 TimeSys Corporation
- *  Copyright (c) 2008 Justin Waters
- *
- *  Based on touchscreen code from Atmel Corporation.
- *
- *  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/err.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/input.h>
-#include <linux/slab.h>
-#include <linux/interrupt.h>
-#include <linux/clk.h>
-#include <linux/platform_device.h>
-#include <linux/io.h>
-#include <linux/platform_data/atmel.h>
-#include <mach/cpu.h>
-
-/* Register definitions based on AT91SAM9RL64 preliminary draft datasheet */
-
-#define ATMEL_TSADCC_CR                0x00    /* Control register */
-#define   ATMEL_TSADCC_SWRST   (1 << 0)        /* Software Reset*/
-#define          ATMEL_TSADCC_START    (1 << 1)        /* Start conversion */
-
-#define ATMEL_TSADCC_MR                0x04    /* Mode register */
-#define          ATMEL_TSADCC_TSAMOD   (3    <<  0)    /* ADC mode */
-#define            ATMEL_TSADCC_TSAMOD_ADC_ONLY_MODE   (0x0)   /* ADC Mode */
-#define            ATMEL_TSADCC_TSAMOD_TS_ONLY_MODE    (0x1)   /* Touch Screen Only Mode */
-#define          ATMEL_TSADCC_LOWRES   (1    <<  4)    /* Resolution selection */
-#define          ATMEL_TSADCC_SLEEP    (1    <<  5)    /* Sleep mode */
-#define          ATMEL_TSADCC_PENDET   (1    <<  6)    /* Pen Detect selection */
-#define          ATMEL_TSADCC_PRES     (1    <<  7)    /* Pressure Measurement Selection */
-#define          ATMEL_TSADCC_PRESCAL  (0x3f <<  8)    /* Prescalar Rate Selection */
-#define          ATMEL_TSADCC_EPRESCAL (0xff <<  8)    /* Prescalar Rate Selection (Extended) */
-#define          ATMEL_TSADCC_STARTUP  (0x7f << 16)    /* Start Up time */
-#define          ATMEL_TSADCC_SHTIM    (0xf  << 24)    /* Sample & Hold time */
-#define          ATMEL_TSADCC_PENDBC   (0xf  << 28)    /* Pen Detect debouncing time */
-
-#define ATMEL_TSADCC_TRGR      0x08    /* Trigger register */
-#define          ATMEL_TSADCC_TRGMOD   (7      <<  0)  /* Trigger mode */
-#define            ATMEL_TSADCC_TRGMOD_NONE            (0 << 0)
-#define     ATMEL_TSADCC_TRGMOD_EXT_RISING     (1 << 0)
-#define     ATMEL_TSADCC_TRGMOD_EXT_FALLING    (2 << 0)
-#define     ATMEL_TSADCC_TRGMOD_EXT_ANY                (3 << 0)
-#define     ATMEL_TSADCC_TRGMOD_PENDET         (4 << 0)
-#define     ATMEL_TSADCC_TRGMOD_PERIOD         (5 << 0)
-#define     ATMEL_TSADCC_TRGMOD_CONTINUOUS     (6 << 0)
-#define   ATMEL_TSADCC_TRGPER  (0xffff << 16)  /* Trigger period */
-
-#define ATMEL_TSADCC_TSR       0x0C    /* Touch Screen register */
-#define          ATMEL_TSADCC_TSFREQ   (0xf <<  0)     /* TS Frequency in Interleaved mode */
-#define          ATMEL_TSADCC_TSSHTIM  (0xf << 24)     /* Sample & Hold time */
-
-#define ATMEL_TSADCC_CHER      0x10    /* Channel Enable register */
-#define ATMEL_TSADCC_CHDR      0x14    /* Channel Disable register */
-#define ATMEL_TSADCC_CHSR      0x18    /* Channel Status register */
-#define          ATMEL_TSADCC_CH(n)    (1 << (n))      /* Channel number */
-
-#define ATMEL_TSADCC_SR                0x1C    /* Status register */
-#define          ATMEL_TSADCC_EOC(n)   (1 << ((n)+0))  /* End of conversion for channel N */
-#define          ATMEL_TSADCC_OVRE(n)  (1 << ((n)+8))  /* Overrun error for channel N */
-#define          ATMEL_TSADCC_DRDY     (1 << 16)       /* Data Ready */
-#define          ATMEL_TSADCC_GOVRE    (1 << 17)       /* General Overrun Error */
-#define          ATMEL_TSADCC_ENDRX    (1 << 18)       /* End of RX Buffer */
-#define          ATMEL_TSADCC_RXBUFF   (1 << 19)       /* TX Buffer full */
-#define          ATMEL_TSADCC_PENCNT   (1 << 20)       /* Pen contact */
-#define          ATMEL_TSADCC_NOCNT    (1 << 21)       /* No contact */
-
-#define ATMEL_TSADCC_LCDR      0x20    /* Last Converted Data register */
-#define          ATMEL_TSADCC_DATA     (0x3ff << 0)    /* Channel data */
-
-#define ATMEL_TSADCC_IER       0x24    /* Interrupt Enable register */
-#define ATMEL_TSADCC_IDR       0x28    /* Interrupt Disable register */
-#define ATMEL_TSADCC_IMR       0x2C    /* Interrupt Mask register */
-#define ATMEL_TSADCC_CDR0      0x30    /* Channel Data 0 */
-#define ATMEL_TSADCC_CDR1      0x34    /* Channel Data 1 */
-#define ATMEL_TSADCC_CDR2      0x38    /* Channel Data 2 */
-#define ATMEL_TSADCC_CDR3      0x3C    /* Channel Data 3 */
-#define ATMEL_TSADCC_CDR4      0x40    /* Channel Data 4 */
-#define ATMEL_TSADCC_CDR5      0x44    /* Channel Data 5 */
-
-#define ATMEL_TSADCC_XPOS      0x50
-#define ATMEL_TSADCC_Z1DAT     0x54
-#define ATMEL_TSADCC_Z2DAT     0x58
-
-#define PRESCALER_VAL(x)       ((x) >> 8)
-
-#define ADC_DEFAULT_CLOCK      100000
-
-struct atmel_tsadcc {
-       struct input_dev        *input;
-       char                    phys[32];
-       struct clk              *clk;
-       int                     irq;
-       unsigned int            prev_absx;
-       unsigned int            prev_absy;
-       unsigned char           bufferedmeasure;
-};
-
-static void __iomem            *tsc_base;
-
-#define atmel_tsadcc_read(reg)         __raw_readl(tsc_base + (reg))
-#define atmel_tsadcc_write(reg, val)   __raw_writel((val), tsc_base + (reg))
-
-static irqreturn_t atmel_tsadcc_interrupt(int irq, void *dev)
-{
-       struct atmel_tsadcc     *ts_dev = (struct atmel_tsadcc *)dev;
-       struct input_dev        *input_dev = ts_dev->input;
-
-       unsigned int status;
-       unsigned int reg;
-
-       status = atmel_tsadcc_read(ATMEL_TSADCC_SR);
-       status &= atmel_tsadcc_read(ATMEL_TSADCC_IMR);
-
-       if (status & ATMEL_TSADCC_NOCNT) {
-               /* Contact lost */
-               reg = atmel_tsadcc_read(ATMEL_TSADCC_MR) | ATMEL_TSADCC_PENDBC;
-
-               atmel_tsadcc_write(ATMEL_TSADCC_MR, reg);
-               atmel_tsadcc_write(ATMEL_TSADCC_TRGR, ATMEL_TSADCC_TRGMOD_NONE);
-               atmel_tsadcc_write(ATMEL_TSADCC_IDR,
-                                  ATMEL_TSADCC_EOC(3) | ATMEL_TSADCC_NOCNT);
-               atmel_tsadcc_write(ATMEL_TSADCC_IER, ATMEL_TSADCC_PENCNT);
-
-               input_report_key(input_dev, BTN_TOUCH, 0);
-               ts_dev->bufferedmeasure = 0;
-               input_sync(input_dev);
-
-       } else if (status & ATMEL_TSADCC_PENCNT) {
-               /* Pen detected */
-               reg = atmel_tsadcc_read(ATMEL_TSADCC_MR);
-               reg &= ~ATMEL_TSADCC_PENDBC;
-
-               atmel_tsadcc_write(ATMEL_TSADCC_IDR, ATMEL_TSADCC_PENCNT);
-               atmel_tsadcc_write(ATMEL_TSADCC_MR, reg);
-               atmel_tsadcc_write(ATMEL_TSADCC_IER,
-                                  ATMEL_TSADCC_EOC(3) | ATMEL_TSADCC_NOCNT);
-               atmel_tsadcc_write(ATMEL_TSADCC_TRGR,
-                                  ATMEL_TSADCC_TRGMOD_PERIOD | (0x0FFF << 16));
-
-       } else if (status & ATMEL_TSADCC_EOC(3)) {
-               /* Conversion finished */
-
-               if (ts_dev->bufferedmeasure) {
-                       /* Last measurement is always discarded, since it can
-                        * be erroneous.
-                        * Always report previous measurement */
-                       input_report_abs(input_dev, ABS_X, ts_dev->prev_absx);
-                       input_report_abs(input_dev, ABS_Y, ts_dev->prev_absy);
-                       input_report_key(input_dev, BTN_TOUCH, 1);
-                       input_sync(input_dev);
-               } else
-                       ts_dev->bufferedmeasure = 1;
-
-               /* Now make new measurement */
-               ts_dev->prev_absx = atmel_tsadcc_read(ATMEL_TSADCC_CDR3) << 10;
-               ts_dev->prev_absx /= atmel_tsadcc_read(ATMEL_TSADCC_CDR2);
-
-               ts_dev->prev_absy = atmel_tsadcc_read(ATMEL_TSADCC_CDR1) << 10;
-               ts_dev->prev_absy /= atmel_tsadcc_read(ATMEL_TSADCC_CDR0);
-       }
-
-       return IRQ_HANDLED;
-}
-
-/*
- * The functions for inserting/removing us as a module.
- */
-
-static int atmel_tsadcc_probe(struct platform_device *pdev)
-{
-       struct atmel_tsadcc     *ts_dev;
-       struct input_dev        *input_dev;
-       struct resource         *res;
-       struct at91_tsadcc_data *pdata = dev_get_platdata(&pdev->dev);
-       int             err;
-       unsigned int    prsc;
-       unsigned int    reg;
-
-       if (!pdata)
-               return -EINVAL;
-
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res) {
-               dev_err(&pdev->dev, "no mmio resource defined.\n");
-               return -ENXIO;
-       }
-
-       /* Allocate memory for device */
-       ts_dev = kzalloc(sizeof(struct atmel_tsadcc), GFP_KERNEL);
-       if (!ts_dev) {
-               dev_err(&pdev->dev, "failed to allocate memory.\n");
-               return -ENOMEM;
-       }
-       platform_set_drvdata(pdev, ts_dev);
-
-       input_dev = input_allocate_device();
-       if (!input_dev) {
-               dev_err(&pdev->dev, "failed to allocate input device.\n");
-               err = -EBUSY;
-               goto err_free_mem;
-       }
-
-       ts_dev->irq = platform_get_irq(pdev, 0);
-       if (ts_dev->irq < 0) {
-               dev_err(&pdev->dev, "no irq ID is designated.\n");
-               err = -ENODEV;
-               goto err_free_dev;
-       }
-
-       if (!request_mem_region(res->start, resource_size(res),
-                               "atmel tsadcc regs")) {
-               dev_err(&pdev->dev, "resources is unavailable.\n");
-               err = -EBUSY;
-               goto err_free_dev;
-       }
-
-       tsc_base = ioremap(res->start, resource_size(res));
-       if (!tsc_base) {
-               dev_err(&pdev->dev, "failed to map registers.\n");
-               err = -ENOMEM;
-               goto err_release_mem;
-       }
-
-       err = request_irq(ts_dev->irq, atmel_tsadcc_interrupt, 0,
-                       pdev->dev.driver->name, ts_dev);
-       if (err) {
-               dev_err(&pdev->dev, "failed to allocate irq.\n");
-               goto err_unmap_regs;
-       }
-
-       ts_dev->clk = clk_get(&pdev->dev, "tsc_clk");
-       if (IS_ERR(ts_dev->clk)) {
-               dev_err(&pdev->dev, "failed to get ts_clk\n");
-               err = PTR_ERR(ts_dev->clk);
-               goto err_free_irq;
-       }
-
-       ts_dev->input = input_dev;
-       ts_dev->bufferedmeasure = 0;
-
-       snprintf(ts_dev->phys, sizeof(ts_dev->phys),
-                "%s/input0", dev_name(&pdev->dev));
-
-       input_dev->name = "atmel touch screen controller";
-       input_dev->phys = ts_dev->phys;
-       input_dev->dev.parent = &pdev->dev;
-
-       __set_bit(EV_ABS, input_dev->evbit);
-       input_set_abs_params(input_dev, ABS_X, 0, 0x3FF, 0, 0);
-       input_set_abs_params(input_dev, ABS_Y, 0, 0x3FF, 0, 0);
-
-       input_set_capability(input_dev, EV_KEY, BTN_TOUCH);
-
-       /* clk_enable() always returns 0, no need to check it */
-       clk_enable(ts_dev->clk);
-
-       prsc = clk_get_rate(ts_dev->clk);
-       dev_info(&pdev->dev, "Master clock is set at: %d Hz\n", prsc);
-
-       if (!pdata->adc_clock)
-               pdata->adc_clock = ADC_DEFAULT_CLOCK;
-
-       prsc = (prsc / (2 * pdata->adc_clock)) - 1;
-
-       /* saturate if this value is too high */
-       if (cpu_is_at91sam9rl()) {
-               if (prsc > PRESCALER_VAL(ATMEL_TSADCC_PRESCAL))
-                       prsc = PRESCALER_VAL(ATMEL_TSADCC_PRESCAL);
-       } else {
-               if (prsc > PRESCALER_VAL(ATMEL_TSADCC_EPRESCAL))
-                       prsc = PRESCALER_VAL(ATMEL_TSADCC_EPRESCAL);
-       }
-
-       dev_info(&pdev->dev, "Prescaler is set at: %d\n", prsc);
-
-       reg = ATMEL_TSADCC_TSAMOD_TS_ONLY_MODE          |
-               ((0x00 << 5) & ATMEL_TSADCC_SLEEP)      |       /* Normal Mode */
-               ((0x01 << 6) & ATMEL_TSADCC_PENDET)     |       /* Enable Pen Detect */
-               (prsc << 8)                             |
-               ((0x26 << 16) & ATMEL_TSADCC_STARTUP)   |
-               ((pdata->pendet_debounce << 28) & ATMEL_TSADCC_PENDBC);
-
-       atmel_tsadcc_write(ATMEL_TSADCC_CR, ATMEL_TSADCC_SWRST);
-       atmel_tsadcc_write(ATMEL_TSADCC_MR, reg);
-       atmel_tsadcc_write(ATMEL_TSADCC_TRGR, ATMEL_TSADCC_TRGMOD_NONE);
-       atmel_tsadcc_write(ATMEL_TSADCC_TSR,
-               (pdata->ts_sample_hold_time << 24) & ATMEL_TSADCC_TSSHTIM);
-
-       atmel_tsadcc_read(ATMEL_TSADCC_SR);
-       atmel_tsadcc_write(ATMEL_TSADCC_IER, ATMEL_TSADCC_PENCNT);
-
-       /* All went ok, so register to the input system */
-       err = input_register_device(input_dev);
-       if (err)
-               goto err_fail;
-
-       return 0;
-
-err_fail:
-       clk_disable(ts_dev->clk);
-       clk_put(ts_dev->clk);
-err_free_irq:
-       free_irq(ts_dev->irq, ts_dev);
-err_unmap_regs:
-       iounmap(tsc_base);
-err_release_mem:
-       release_mem_region(res->start, resource_size(res));
-err_free_dev:
-       input_free_device(input_dev);
-err_free_mem:
-       kfree(ts_dev);
-       return err;
-}
-
-static int atmel_tsadcc_remove(struct platform_device *pdev)
-{
-       struct atmel_tsadcc *ts_dev = platform_get_drvdata(pdev);
-       struct resource *res;
-
-       free_irq(ts_dev->irq, ts_dev);
-
-       input_unregister_device(ts_dev->input);
-
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       iounmap(tsc_base);
-       release_mem_region(res->start, resource_size(res));
-
-       clk_disable(ts_dev->clk);
-       clk_put(ts_dev->clk);
-
-       kfree(ts_dev);
-
-       return 0;
-}
-
-static struct platform_driver atmel_tsadcc_driver = {
-       .probe          = atmel_tsadcc_probe,
-       .remove         = atmel_tsadcc_remove,
-       .driver         = {
-               .name   = "atmel_tsadcc",
-       },
-};
-module_platform_driver(atmel_tsadcc_driver);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("Atmel TouchScreen Driver");
-MODULE_AUTHOR("Dan Liang <dan.liang@atmel.com>");
-
index 3899ba7821c5e78d4496c29ad3fba2b8b4ffcad9..c887e6eebc414310d9b283445b96997538c42a73 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/irqchip/chained_irq.h>
+#include <linux/cpu.h>
 #include <linux/io.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
@@ -310,7 +311,8 @@ static int armada_370_xp_mpic_irq_map(struct irq_domain *h,
 }
 
 #ifdef CONFIG_SMP
-void armada_mpic_send_doorbell(const struct cpumask *mask, unsigned int irq)
+static void armada_mpic_send_doorbell(const struct cpumask *mask,
+                                     unsigned int irq)
 {
        int cpu;
        unsigned long map = 0;
@@ -330,7 +332,7 @@ void armada_mpic_send_doorbell(const struct cpumask *mask, unsigned int irq)
                ARMADA_370_XP_SW_TRIG_INT_OFFS);
 }
 
-void armada_xp_mpic_smp_cpu_init(void)
+static void armada_xp_mpic_smp_cpu_init(void)
 {
        /* Clear pending IPIs */
        writel(0, per_cpu_int_base + ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS);
@@ -342,6 +344,20 @@ void armada_xp_mpic_smp_cpu_init(void)
        /* Unmask IPI interrupt */
        writel(0, per_cpu_int_base + ARMADA_370_XP_INT_CLEAR_MASK_OFFS);
 }
+
+static int armada_xp_mpic_secondary_init(struct notifier_block *nfb,
+                                        unsigned long action, void *hcpu)
+{
+       if (action == CPU_STARTING || action == CPU_STARTING_FROZEN)
+               armada_xp_mpic_smp_cpu_init();
+       return NOTIFY_OK;
+}
+
+static struct notifier_block armada_370_xp_mpic_cpu_notifier = {
+       .notifier_call = armada_xp_mpic_secondary_init,
+       .priority = 100,
+};
+
 #endif /* CONFIG_SMP */
 
 static struct irq_domain_ops armada_370_xp_mpic_irq_ops = {
@@ -497,6 +513,10 @@ static int __init armada_370_xp_mpic_of_init(struct device_node *node,
        if (parent_irq <= 0) {
                irq_set_default_host(armada_370_xp_mpic_domain);
                set_handle_irq(armada_370_xp_handle_irq);
+#ifdef CONFIG_SMP
+               set_smp_cross_call(armada_mpic_send_doorbell);
+               register_cpu_notifier(&armada_370_xp_mpic_cpu_notifier);
+#endif
        } else {
                irq_set_chained_handler(parent_irq,
                                        armada_370_xp_mpic_handle_cascade_irq);
index e25f246cd2fb9a75d90ab57a4d1d1e12feb494f1..34d18b48bb78fe11d130f2dcd10304b261ed98eb 100644 (file)
@@ -42,7 +42,7 @@ __exception_irq_entry orion_handle_irq(struct pt_regs *regs)
                u32 stat = readl_relaxed(gc->reg_base + ORION_IRQ_CAUSE) &
                        gc->mask_cache;
                while (stat) {
-                       u32 hwirq = ffs(stat) - 1;
+                       u32 hwirq = __fls(stat);
                        u32 irq = irq_find_mapping(orion_irq_domain,
                                                   gc->irq_base + hwirq);
                        handle_IRQ(irq, regs);
@@ -117,7 +117,7 @@ static void orion_bridge_irq_handler(unsigned int irq, struct irq_desc *desc)
                   gc->mask_cache;
 
        while (stat) {
-               u32 hwirq = ffs(stat) - 1;
+               u32 hwirq = __fls(stat);
 
                generic_handle_irq(irq_find_mapping(d, gc->irq_base + hwirq));
                stat &= ~(1 << hwirq);
index 581eefe331ae44a58512680bc5462137ae6b21d4..5e54f6d71e777c937f8f97185e3ef7ec790cfbb2 100644 (file)
@@ -58,7 +58,8 @@ static void __exception_irq_entry sirfsoc_handle_irq(struct pt_regs *regs)
        handle_IRQ(irqnr, regs);
 }
 
-static int __init sirfsoc_irq_init(struct device_node *np, struct device_node *parent)
+static int __init sirfsoc_irq_init(struct device_node *np,
+       struct device_node *parent)
 {
        void __iomem *base = of_iomap(np, 0);
        if (!base)
index 6de9dfbf61c197fe6078a633aabc47cd47805bcf..39e717797cc09d236ce63368d8ade4866fb16a32 100644 (file)
@@ -487,6 +487,14 @@ config LEDS_BLINKM
          This option enables support for the BlinkM RGB LED connected
          through I2C. Say Y to enable support for the BlinkM LED.
 
+config LEDS_VERSATILE
+       tristate "LED support for the ARM Versatile and RealView"
+       depends on ARCH_REALVIEW || ARCH_VERSATILE
+       depends on LEDS_CLASS
+       help
+         This option enabled support for the LEDs on the ARM Versatile
+         and RealView boards. Say Y to enabled these.
+
 comment "LED Triggers"
 source "drivers/leds/trigger/Kconfig"
 
index 3cd76dbd9be2ff9bd1763b34adad1d0c692ce054..8b4c956e11bad78162fe20c254e4f8f6d58566bd 100644 (file)
@@ -54,6 +54,7 @@ obj-$(CONFIG_LEDS_ASIC3)              += leds-asic3.o
 obj-$(CONFIG_LEDS_MAX8997)             += leds-max8997.o
 obj-$(CONFIG_LEDS_LM355x)              += leds-lm355x.o
 obj-$(CONFIG_LEDS_BLINKM)              += leds-blinkm.o
+obj-$(CONFIG_LEDS_VERSATILE)           += leds-versatile.o
 
 # LED SPI Drivers
 obj-$(CONFIG_LEDS_DAC124S085)          += leds-dac124s085.o
similarity index 68%
rename from arch/arm/plat-versatile/leds.c
rename to drivers/leds/leds-versatile.c
index d2490d00b46cd4e2e6c17a685eda16942ee930d6..80553022d661fcbd09e1a0048472deb5486b70ef 100644 (file)
@@ -7,22 +7,14 @@
  */
 #include <linux/kernel.h>
 #include <linux/init.h>
+#include <linux/module.h>
 #include <linux/io.h>
 #include <linux/slab.h>
 #include <linux/leds.h>
-
-#include <mach/hardware.h>
-#include <mach/platform.h>
-
-#ifdef VERSATILE_SYS_BASE
-#define LEDREG (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_LED_OFFSET)
-#endif
-
-#ifdef REALVIEW_SYS_BASE
-#define LEDREG (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LED_OFFSET)
-#endif
+#include <linux/platform_device.h>
 
 struct versatile_led {
+       void __iomem            *base;
        struct led_classdev     cdev;
        u8                      mask;
 };
@@ -50,30 +42,37 @@ static void versatile_led_set(struct led_classdev *cdev,
 {
        struct versatile_led *led = container_of(cdev,
                                                 struct versatile_led, cdev);
-       u32 reg = readl(LEDREG);
+       u32 reg = readl(led->base);
 
        if (b != LED_OFF)
                reg |= led->mask;
        else
                reg &= ~led->mask;
-       writel(reg, LEDREG);
+       writel(reg, led->base);
 }
 
 static enum led_brightness versatile_led_get(struct led_classdev *cdev)
 {
        struct versatile_led *led = container_of(cdev,
                                                 struct versatile_led, cdev);
-       u32 reg = readl(LEDREG);
+       u32 reg = readl(led->base);
 
        return (reg & led->mask) ? LED_FULL : LED_OFF;
 }
 
-static int __init versatile_leds_init(void)
+static int versatile_leds_probe(struct platform_device *dev)
 {
        int i;
+       struct resource *res;
+       void __iomem *base;
 
-       /* All ON */
-       writel(0xff, LEDREG);
+       res = platform_get_resource(dev, IORESOURCE_MEM, 0);
+       base = devm_ioremap_resource(&dev->dev, res);
+       if (IS_ERR(base))
+               return PTR_ERR(base);
+
+       /* All off */
+       writel(0, base);
        for (i = 0; i < ARRAY_SIZE(versatile_leds); i++) {
                struct versatile_led *led;
 
@@ -81,6 +80,7 @@ static int __init versatile_leds_init(void)
                if (!led)
                        break;
 
+               led->base = base;
                led->cdev.name = versatile_leds[i].name;
                led->cdev.brightness_set = versatile_led_set;
                led->cdev.brightness_get = versatile_led_get;
@@ -96,8 +96,15 @@ static int __init versatile_leds_init(void)
        return 0;
 }
 
-/*
- * Since we may have triggers on any subsystem, defer registration
- * until after subsystem_init.
- */
-fs_initcall(versatile_leds_init);
+static struct platform_driver versatile_leds_driver = {
+       .driver = {
+               .name   = "versatile-leds",
+       },
+       .probe = versatile_leds_probe,
+};
+
+module_platform_driver(versatile_leds_driver);
+
+MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>");
+MODULE_DESCRIPTION("ARM Versatile LED driver");
+MODULE_LICENSE("GPL v2");
index b59a17fb7c3e3f3eff43faecac3610f58df1dbd8..ff7138fd66d14378ff2adef5f6d1a4901be994b5 100644 (file)
@@ -2,7 +2,7 @@
  * Marvell EBU SoC Device Bus Controller
  * (memory controller for NOR/NAND/SRAM/FPGA devices)
  *
- * Copyright (C) 2013 Marvell
+ * Copyright (C) 2013-2014 Marvell
  *
  * 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
 #include <linux/platform_device.h>
 
 /* Register definitions */
-#define DEV_WIDTH_BIT          30
-#define BADR_SKEW_BIT          28
-#define RD_HOLD_BIT            23
-#define ACC_NEXT_BIT           17
-#define RD_SETUP_BIT           12
-#define ACC_FIRST_BIT          6
-
-#define SYNC_ENABLE_BIT                24
-#define WR_HIGH_BIT            16
-#define WR_LOW_BIT             8
-
-#define READ_PARAM_OFFSET      0x0
-#define WRITE_PARAM_OFFSET     0x4
+#define ARMADA_DEV_WIDTH_SHIFT         30
+#define ARMADA_BADR_SKEW_SHIFT         28
+#define ARMADA_RD_HOLD_SHIFT           23
+#define ARMADA_ACC_NEXT_SHIFT          17
+#define ARMADA_RD_SETUP_SHIFT          12
+#define ARMADA_ACC_FIRST_SHIFT         6
+
+#define ARMADA_SYNC_ENABLE_SHIFT       24
+#define ARMADA_WR_HIGH_SHIFT           16
+#define ARMADA_WR_LOW_SHIFT            8
+
+#define ARMADA_READ_PARAM_OFFSET       0x0
+#define ARMADA_WRITE_PARAM_OFFSET      0x4
+
+#define ORION_RESERVED                 (0x2 << 30)
+#define ORION_BADR_SKEW_SHIFT          28
+#define ORION_WR_HIGH_EXT_BIT          BIT(27)
+#define ORION_WR_HIGH_EXT_MASK         0x8
+#define ORION_WR_LOW_EXT_BIT           BIT(26)
+#define ORION_WR_LOW_EXT_MASK          0x8
+#define ORION_ALE_WR_EXT_BIT           BIT(25)
+#define ORION_ALE_WR_EXT_MASK          0x8
+#define ORION_ACC_NEXT_EXT_BIT         BIT(24)
+#define ORION_ACC_NEXT_EXT_MASK                0x10
+#define ORION_ACC_FIRST_EXT_BIT                BIT(23)
+#define ORION_ACC_FIRST_EXT_MASK       0x10
+#define ORION_TURN_OFF_EXT_BIT         BIT(22)
+#define ORION_TURN_OFF_EXT_MASK                0x8
+#define ORION_DEV_WIDTH_SHIFT          20
+#define ORION_WR_HIGH_SHIFT            17
+#define ORION_WR_HIGH_MASK             0x7
+#define ORION_WR_LOW_SHIFT             14
+#define ORION_WR_LOW_MASK              0x7
+#define ORION_ALE_WR_SHIFT             11
+#define ORION_ALE_WR_MASK              0x7
+#define ORION_ACC_NEXT_SHIFT           7
+#define ORION_ACC_NEXT_MASK            0xF
+#define ORION_ACC_FIRST_SHIFT          3
+#define ORION_ACC_FIRST_MASK           0xF
+#define ORION_TURN_OFF_SHIFT           0
+#define ORION_TURN_OFF_MASK            0x7
 
 struct devbus_read_params {
        u32 bus_width;
@@ -89,19 +117,14 @@ static int get_timing_param_ps(struct devbus *devbus,
        return 0;
 }
 
-static int devbus_set_timing_params(struct devbus *devbus,
-                                   struct device_node *node)
+static int devbus_get_timing_params(struct devbus *devbus,
+                                   struct device_node *node,
+                                   struct devbus_read_params *r,
+                                   struct devbus_write_params *w)
 {
-       struct devbus_read_params r;
-       struct devbus_write_params w;
-       u32 value;
        int err;
 
-       dev_dbg(devbus->dev, "Setting timing parameter, tick is %lu ps\n",
-               devbus->tick_ps);
-
-       /* Get read timings */
-       err = of_property_read_u32(node, "devbus,bus-width", &r.bus_width);
+       err = of_property_read_u32(node, "devbus,bus-width", &r->bus_width);
        if (err < 0) {
                dev_err(devbus->dev,
                        "%s has no 'devbus,bus-width' property\n",
@@ -113,104 +136,148 @@ static int devbus_set_timing_params(struct devbus *devbus,
         * The bus width is encoded into the register as 0 for 8 bits,
         * and 1 for 16 bits, so we do the necessary conversion here.
         */
-       if (r.bus_width == 8)
-               r.bus_width = 0;
-       else if (r.bus_width == 16)
-               r.bus_width = 1;
+       if (r->bus_width == 8)
+               r->bus_width = 0;
+       else if (r->bus_width == 16)
+               r->bus_width = 1;
        else {
-               dev_err(devbus->dev, "invalid bus width %d\n", r.bus_width);
+               dev_err(devbus->dev, "invalid bus width %d\n", r->bus_width);
                return -EINVAL;
        }
 
        err = get_timing_param_ps(devbus, node, "devbus,badr-skew-ps",
-                                &r.badr_skew);
+                                &r->badr_skew);
        if (err < 0)
                return err;
 
        err = get_timing_param_ps(devbus, node, "devbus,turn-off-ps",
-                                &r.turn_off);
+                                &r->turn_off);
        if (err < 0)
                return err;
 
        err = get_timing_param_ps(devbus, node, "devbus,acc-first-ps",
-                                &r.acc_first);
+                                &r->acc_first);
        if (err < 0)
                return err;
 
        err = get_timing_param_ps(devbus, node, "devbus,acc-next-ps",
-                                &r.acc_next);
-       if (err < 0)
-               return err;
-
-       err = get_timing_param_ps(devbus, node, "devbus,rd-setup-ps",
-                                &r.rd_setup);
+                                &r->acc_next);
        if (err < 0)
                return err;
 
-       err = get_timing_param_ps(devbus, node, "devbus,rd-hold-ps",
-                                &r.rd_hold);
-       if (err < 0)
-               return err;
-
-       /* Get write timings */
-       err = of_property_read_u32(node, "devbus,sync-enable",
-                                 &w.sync_enable);
-       if (err < 0) {
-               dev_err(devbus->dev,
-                       "%s has no 'devbus,sync-enable' property\n",
-                       node->full_name);
-               return err;
+       if (of_device_is_compatible(devbus->dev->of_node, "marvell,mvebu-devbus")) {
+               err = get_timing_param_ps(devbus, node, "devbus,rd-setup-ps",
+                                         &r->rd_setup);
+               if (err < 0)
+                       return err;
+
+               err = get_timing_param_ps(devbus, node, "devbus,rd-hold-ps",
+                                         &r->rd_hold);
+               if (err < 0)
+                       return err;
+
+               err = of_property_read_u32(node, "devbus,sync-enable",
+                                          &w->sync_enable);
+               if (err < 0) {
+                       dev_err(devbus->dev,
+                               "%s has no 'devbus,sync-enable' property\n",
+                               node->full_name);
+                       return err;
+               }
        }
 
        err = get_timing_param_ps(devbus, node, "devbus,ale-wr-ps",
-                                &w.ale_wr);
+                                &w->ale_wr);
        if (err < 0)
                return err;
 
        err = get_timing_param_ps(devbus, node, "devbus,wr-low-ps",
-                                &w.wr_low);
+                                &w->wr_low);
        if (err < 0)
                return err;
 
        err = get_timing_param_ps(devbus, node, "devbus,wr-high-ps",
-                                &w.wr_high);
+                                &w->wr_high);
        if (err < 0)
                return err;
 
+       return 0;
+}
+
+static void devbus_orion_set_timing_params(struct devbus *devbus,
+                                         struct device_node *node,
+                                         struct devbus_read_params *r,
+                                         struct devbus_write_params *w)
+{
+       u32 value;
+
+       /*
+        * The hardware designers found it would be a good idea to
+        * split most of the values in the register into two fields:
+        * one containing all the low-order bits, and another one
+        * containing just the high-order bit. For all of those
+        * fields, we have to split the value into these two parts.
+        */
+       value = (r->turn_off   & ORION_TURN_OFF_MASK)  << ORION_TURN_OFF_SHIFT  |
+               (r->acc_first  & ORION_ACC_FIRST_MASK) << ORION_ACC_FIRST_SHIFT |
+               (r->acc_next   & ORION_ACC_NEXT_MASK)  << ORION_ACC_NEXT_SHIFT  |
+               (w->ale_wr     & ORION_ALE_WR_MASK)    << ORION_ALE_WR_SHIFT    |
+               (w->wr_low     & ORION_WR_LOW_MASK)    << ORION_WR_LOW_SHIFT    |
+               (w->wr_high    & ORION_WR_HIGH_MASK)   << ORION_WR_HIGH_SHIFT   |
+               r->bus_width                           << ORION_DEV_WIDTH_SHIFT |
+               ((r->turn_off  & ORION_TURN_OFF_EXT_MASK)  ? ORION_TURN_OFF_EXT_BIT  : 0) |
+               ((r->acc_first & ORION_ACC_FIRST_EXT_MASK) ? ORION_ACC_FIRST_EXT_BIT : 0) |
+               ((r->acc_next  & ORION_ACC_NEXT_EXT_MASK)  ? ORION_ACC_NEXT_EXT_BIT  : 0) |
+               ((w->ale_wr    & ORION_ALE_WR_EXT_MASK)    ? ORION_ALE_WR_EXT_BIT    : 0) |
+               ((w->wr_low    & ORION_WR_LOW_EXT_MASK)    ? ORION_WR_LOW_EXT_BIT    : 0) |
+               ((w->wr_high   & ORION_WR_HIGH_EXT_MASK)   ? ORION_WR_HIGH_EXT_BIT   : 0) |
+               (r->badr_skew << ORION_BADR_SKEW_SHIFT) |
+               ORION_RESERVED;
+
+       writel(value, devbus->base);
+}
+
+static void devbus_armada_set_timing_params(struct devbus *devbus,
+                                          struct device_node *node,
+                                          struct devbus_read_params *r,
+                                          struct devbus_write_params *w)
+{
+       u32 value;
+
        /* Set read timings */
-       value = r.bus_width << DEV_WIDTH_BIT |
-               r.badr_skew << BADR_SKEW_BIT |
-               r.rd_hold   << RD_HOLD_BIT   |
-               r.acc_next  << ACC_NEXT_BIT  |
-               r.rd_setup  << RD_SETUP_BIT  |
-               r.acc_first << ACC_FIRST_BIT |
-               r.turn_off;
+       value = r->bus_width << ARMADA_DEV_WIDTH_SHIFT |
+               r->badr_skew << ARMADA_BADR_SKEW_SHIFT |
+               r->rd_hold   << ARMADA_RD_HOLD_SHIFT   |
+               r->acc_next  << ARMADA_ACC_NEXT_SHIFT  |
+               r->rd_setup  << ARMADA_RD_SETUP_SHIFT  |
+               r->acc_first << ARMADA_ACC_FIRST_SHIFT |
+               r->turn_off;
 
        dev_dbg(devbus->dev, "read parameters register 0x%p = 0x%x\n",
-               devbus->base + READ_PARAM_OFFSET,
+               devbus->base + ARMADA_READ_PARAM_OFFSET,
                value);
 
-       writel(value, devbus->base + READ_PARAM_OFFSET);
+       writel(value, devbus->base + ARMADA_READ_PARAM_OFFSET);
 
        /* Set write timings */
-       value = w.sync_enable  << SYNC_ENABLE_BIT |
-               w.wr_low       << WR_LOW_BIT      |
-               w.wr_high      << WR_HIGH_BIT     |
-               w.ale_wr;
+       value = w->sync_enable  << ARMADA_SYNC_ENABLE_SHIFT |
+               w->wr_low       << ARMADA_WR_LOW_SHIFT      |
+               w->wr_high      << ARMADA_WR_HIGH_SHIFT     |
+               w->ale_wr;
 
        dev_dbg(devbus->dev, "write parameters register: 0x%p = 0x%x\n",
-               devbus->base + WRITE_PARAM_OFFSET,
+               devbus->base + ARMADA_WRITE_PARAM_OFFSET,
                value);
 
-       writel(value, devbus->base + WRITE_PARAM_OFFSET);
-
-       return 0;
+       writel(value, devbus->base + ARMADA_WRITE_PARAM_OFFSET);
 }
 
 static int mvebu_devbus_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct device_node *node = pdev->dev.of_node;
+       struct devbus_read_params r;
+       struct devbus_write_params w;
        struct devbus *devbus;
        struct resource *res;
        struct clk *clk;
@@ -240,10 +307,21 @@ static int mvebu_devbus_probe(struct platform_device *pdev)
        rate = clk_get_rate(clk) / 1000;
        devbus->tick_ps = 1000000000 / rate;
 
-       /* Read the device tree node and set the new timing parameters */
-       err = devbus_set_timing_params(devbus, node);
-       if (err < 0)
-               return err;
+       dev_dbg(devbus->dev, "Setting timing parameter, tick is %lu ps\n",
+               devbus->tick_ps);
+
+       if (!of_property_read_bool(node, "devbus,keep-config")) {
+               /* Read the Device Tree node */
+               err = devbus_get_timing_params(devbus, node, &r, &w);
+               if (err < 0)
+                       return err;
+
+               /* Set the new timing parameters */
+               if (of_device_is_compatible(node, "marvell,orion-devbus"))
+                       devbus_orion_set_timing_params(devbus, node, &r, &w);
+               else
+                       devbus_armada_set_timing_params(devbus, node, &r, &w);
+       }
 
        /*
         * We need to create a child device explicitly from here to
@@ -259,6 +337,7 @@ static int mvebu_devbus_probe(struct platform_device *pdev)
 
 static const struct of_device_id mvebu_devbus_of_match[] = {
        { .compatible = "marvell,mvebu-devbus" },
+       { .compatible = "marvell,orion-devbus" },
        {},
 };
 MODULE_DEVICE_TABLE(of, mvebu_devbus_of_match);
index 4f60caf750ceb90e860e00d9ffed55cd74a4ec03..60fed3d7820b75fc0a0a8fd2157bb7a84918ff79 100644 (file)
@@ -1,3 +1,4 @@
 obj-$(CONFIG_RESET_CONTROLLER) += core.o
+obj-$(CONFIG_ARCH_SOCFPGA) += reset-socfpga.o
 obj-$(CONFIG_ARCH_SUNXI) += reset-sunxi.o
 obj-$(CONFIG_ARCH_STI) += sti/
diff --git a/drivers/reset/reset-socfpga.c b/drivers/reset/reset-socfpga.c
new file mode 100644 (file)
index 0000000..79c32ca
--- /dev/null
@@ -0,0 +1,146 @@
+/*
+ * Copyright 2014 Steffen Trumtrar <s.trumtrar@pengutronix.de>
+ *
+ * based on
+ * Allwinner SoCs Reset Controller driver
+ *
+ * Copyright 2013 Maxime Ripard
+ *
+ * Maxime Ripard <maxime.ripard@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 as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/reset-controller.h>
+#include <linux/spinlock.h>
+#include <linux/types.h>
+
+#define NR_BANKS               4
+#define OFFSET_MODRST          0x10
+
+struct socfpga_reset_data {
+       spinlock_t                      lock;
+       void __iomem                    *membase;
+       struct reset_controller_dev     rcdev;
+};
+
+static int socfpga_reset_assert(struct reset_controller_dev *rcdev,
+                               unsigned long id)
+{
+       struct socfpga_reset_data *data = container_of(rcdev,
+                                                    struct socfpga_reset_data,
+                                                    rcdev);
+       int bank = id / BITS_PER_LONG;
+       int offset = id % BITS_PER_LONG;
+       unsigned long flags;
+       u32 reg;
+
+       spin_lock_irqsave(&data->lock, flags);
+
+       reg = readl(data->membase + OFFSET_MODRST + (bank * NR_BANKS));
+       writel(reg | BIT(offset), data->membase + OFFSET_MODRST +
+                                (bank * NR_BANKS));
+       spin_unlock_irqrestore(&data->lock, flags);
+
+       return 0;
+}
+
+static int socfpga_reset_deassert(struct reset_controller_dev *rcdev,
+                                 unsigned long id)
+{
+       struct socfpga_reset_data *data = container_of(rcdev,
+                                                    struct socfpga_reset_data,
+                                                    rcdev);
+
+       int bank = id / BITS_PER_LONG;
+       int offset = id % BITS_PER_LONG;
+       unsigned long flags;
+       u32 reg;
+
+       spin_lock_irqsave(&data->lock, flags);
+
+       reg = readl(data->membase + OFFSET_MODRST + (bank * NR_BANKS));
+       writel(reg & ~BIT(offset), data->membase + OFFSET_MODRST +
+                                 (bank * NR_BANKS));
+
+       spin_unlock_irqrestore(&data->lock, flags);
+
+       return 0;
+}
+
+static struct reset_control_ops socfpga_reset_ops = {
+       .assert         = socfpga_reset_assert,
+       .deassert       = socfpga_reset_deassert,
+};
+
+static int socfpga_reset_probe(struct platform_device *pdev)
+{
+       struct socfpga_reset_data *data;
+       struct resource *res;
+
+       /*
+        * The binding was mainlined without the required property.
+        * Do not continue, when we encounter an old DT.
+        */
+       if (!of_find_property(pdev->dev.of_node, "#reset-cells", NULL)) {
+               dev_err(&pdev->dev, "%s missing #reset-cells property\n",
+                       pdev->dev.of_node->full_name);
+               return -EINVAL;
+       }
+
+       data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+       if (!data)
+               return -ENOMEM;
+
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       data->membase = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(data->membase))
+               return PTR_ERR(data->membase);
+
+       spin_lock_init(&data->lock);
+
+       data->rcdev.owner = THIS_MODULE;
+       data->rcdev.nr_resets = NR_BANKS * BITS_PER_LONG;
+       data->rcdev.ops = &socfpga_reset_ops;
+       data->rcdev.of_node = pdev->dev.of_node;
+       reset_controller_register(&data->rcdev);
+
+       return 0;
+}
+
+static int socfpga_reset_remove(struct platform_device *pdev)
+{
+       struct socfpga_reset_data *data = platform_get_drvdata(pdev);
+
+       reset_controller_unregister(&data->rcdev);
+
+       return 0;
+}
+
+static const struct of_device_id socfpga_reset_dt_ids[] = {
+       { .compatible = "altr,rst-mgr", },
+       { /* sentinel */ },
+};
+
+static struct platform_driver socfpga_reset_driver = {
+       .probe  = socfpga_reset_probe,
+       .remove = socfpga_reset_remove,
+       .driver = {
+               .name           = "socfpga-reset",
+               .owner          = THIS_MODULE,
+               .of_match_table = socfpga_reset_dt_ids,
+       },
+};
+module_platform_driver(socfpga_reset_driver);
+
+MODULE_AUTHOR("Steffen Trumtrar <s.trumtrar@pengutronix.de");
+MODULE_DESCRIPTION("Socfpga Reset Controller Driver");
+MODULE_LICENSE("GPL");
index 6548a5fbcf4a4854ec3afec3c8d1be5cf19952a1..1118f7a4bca611ee6e46d7d4d3f356f65822658a 100644 (file)
@@ -33,8 +33,8 @@
 #define R8A7790_CLK_TMU0               25
 #define R8A7790_CLK_VSP1_DU1           27
 #define R8A7790_CLK_VSP1_DU0           28
-#define R8A7790_CLK_VSP1_RT            30
-#define R8A7790_CLK_VSP1_SY            31
+#define R8A7790_CLK_VSP1_R             30
+#define R8A7790_CLK_VSP1_S             31
 
 /* MSTP2 */
 #define R8A7790_CLK_SCIFA2             2
@@ -50,6 +50,7 @@
 #define R8A7790_CLK_SYS_DMAC0          19
 
 /* MSTP3 */
+#define R8A7790_CLK_IIC2               0
 #define R8A7790_CLK_TPU0               4
 #define R8A7790_CLK_MMCIF1             5
 #define R8A7790_CLK_SDHI3              11
@@ -57,6 +58,8 @@
 #define R8A7790_CLK_SDHI1              13
 #define R8A7790_CLK_SDHI0              14
 #define R8A7790_CLK_MMCIF0             15
+#define R8A7790_CLK_IIC0               18
+#define R8A7790_CLK_IIC1               23
 #define R8A7790_CLK_SSUSB              28
 #define R8A7790_CLK_CMT1               29
 #define R8A7790_CLK_USBDMAC0           30
index 30f82f286e295df3423dd6729ef48918c80683c2..b050d18437cecda81940b805773b5955333cdc0b 100644 (file)
@@ -32,7 +32,7 @@
 #define R8A7791_CLK_TMU0               25
 #define R8A7791_CLK_VSP1_DU1           27
 #define R8A7791_CLK_VSP1_DU0           28
-#define R8A7791_CLK_VSP1_SY            31
+#define R8A7791_CLK_VSP1_S             31
 
 /* MSTP2 */
 #define R8A7791_CLK_SCIFA2             2
@@ -43,7 +43,8 @@
 #define R8A7791_CLK_SCIFB1             7
 #define R8A7791_CLK_MSIOF1             8
 #define R8A7791_CLK_SCIFB2             16
-#define R8A7791_CLK_DMAC               18
+#define R8A7791_CLK_SYS_DMAC1          18
+#define R8A7791_CLK_SYS_DMAC0          19
 
 /* MSTP3 */
 #define R8A7791_CLK_TPU0               4
@@ -51,6 +52,8 @@
 #define R8A7791_CLK_SDHI1              12
 #define R8A7791_CLK_SDHI0              14
 #define R8A7791_CLK_MMCIF0             15
+#define R8A7791_CLK_IIC0               18
+#define R8A7791_CLK_IIC1               23
 #define R8A7791_CLK_SSUSB              28
 #define R8A7791_CLK_CMT1               29
 #define R8A7791_CLK_USBDMAC0           30
@@ -61,6 +64,7 @@
 #define R8A7791_CLK_PWM                        23
 
 /* MSTP7 */
+#define R8A7791_CLK_EHCI               3
 #define R8A7791_CLK_HSUSB              4
 #define R8A7791_CLK_HSCIF2             13
 #define R8A7791_CLK_SCIF5              14
diff --git a/include/dt-bindings/reset/altr,rst-mgr.h b/include/dt-bindings/reset/altr,rst-mgr.h
new file mode 100644 (file)
index 0000000..3f04908
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2014, Steffen Trumtrar <s.trumtrar@pengutronix.de>
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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.
+ */
+
+#ifndef _DT_BINDINGS_RESET_ALTR_RST_MGR_H
+#define _DT_BINDINGS_RESET_ALTR_RST_MGR_H
+
+/* MPUMODRST */
+#define CPU0_RESET             0
+#define CPU1_RESET             1
+#define WDS_RESET              2
+#define SCUPER_RESET           3
+#define L2_RESET               4
+
+/* PERMODRST */
+#define EMAC0_RESET            32
+#define EMAC1_RESET            33
+#define USB0_RESET             34
+#define USB1_RESET             35
+#define NAND_RESET             36
+#define QSPI_RESET             37
+#define L4WD0_RESET            38
+#define L4WD1_RESET            39
+#define OSC1TIMER0_RESET       40
+#define OSC1TIMER1_RESET       41
+#define SPTIMER0_RESET         42
+#define SPTIMER1_RESET         43
+#define I2C0_RESET             44
+#define I2C1_RESET             45
+#define I2C2_RESET             46
+#define I2C3_RESET             47
+#define UART0_RESET            48
+#define UART1_RESET            49
+#define SPIM0_RESET            50
+#define SPIM1_RESET            51
+#define SPIS0_RESET            52
+#define SPIS1_RESET            53
+#define SDMMC_RESET            54
+#define CAN0_RESET             55
+#define CAN1_RESET             56
+#define GPIO0_RESET            57
+#define GPIO1_RESET            58
+#define GPIO2_RESET            59
+#define DMA_RESET              60
+#define SDR_RESET              61
+
+/* PER2MODRST */
+#define DMAIF0_RESET           64
+#define DMAIF1_RESET           65
+#define DMAIF2_RESET           66
+#define DMAIF3_RESET           67
+#define DMAIF4_RESET           68
+#define DMAIF5_RESET           69
+#define DMAIF6_RESET           70
+#define DMAIF7_RESET           71
+
+/* BRGMODRST */
+#define HPS2FPGA_RESET         96
+#define LWHPS2FPGA_RESET       97
+#define FPGA2HPS_RESET         98
+
+/* MISCMODRST*/
+#define ROM_RESET              128
+#define OCRAM_RESET            129
+#define SYSMGR_RESET           130
+#define SYSMGRCOLD_RESET       131
+#define FPGAMGR_RESET          132
+#define ACPIDMAP_RESET         133
+#define S2F_RESET              134
+#define S2FCOLD_RESET          135
+#define NRSTPIN_RESET          136
+#define TIMESTAMPCOLD_RESET    137
+#define CLKMGRCOLD_RESET       138
+#define SCANMGR_RESET          139
+#define FRZCTRLCOLD_RESET      140
+#define SYSDBG_RESET           141
+#define DBG_RESET              142
+#define TAPCOLD_RESET          143
+#define SDRCOLD_RESET          144
+
+#endif
index a6911ebbd02a024f3dffd028dc3d67fc13c0ef58..de4268d4987acb9ec2c6a4f985845c209d6c5c9c 100644 (file)
@@ -155,6 +155,7 @@ extern void __iomem *at91_pmc_base;
 #define                AT91_PMC_LOCKB          (1 <<  2)               /* PLLB Lock */
 #define                AT91_PMC_MCKRDY         (1 <<  3)               /* Master Clock */
 #define                AT91_PMC_LOCKU          (1 <<  6)               /* UPLL Lock [some SAM9] */
+#define                AT91_PMC_OSCSEL         (1 <<  7)               /* Slow Oscillator Selection [some SAM9] */
 #define                AT91_PMC_PCK0RDY        (1 <<  8)               /* Programmable Clock 0 */
 #define                AT91_PMC_PCK1RDY        (1 <<  9)               /* Programmable Clock 1 */
 #define                AT91_PMC_PCK2RDY        (1 << 10)               /* Programmable Clock 2 */
index 345b8c53b8974d7a6cc271fda41c851ee5835f7c..550c88fb0267f158c26d05714e411805ba15ee90 100644 (file)
@@ -73,6 +73,6 @@ int mvebu_mbus_del_window(phys_addr_t base, size_t size);
 int mvebu_mbus_init(const char *soc, phys_addr_t mbus_phys_base,
                    size_t mbus_size, phys_addr_t sdram_phys_base,
                    size_t sdram_size);
-int mvebu_mbus_dt_init(void);
+int mvebu_mbus_dt_init(bool is_coherent);
 
 #endif /* __LINUX_MBUS_H */
index b3ca1e94e0c88f1108ddd0065e32b93924531ee3..7819fc787731814bda7c7374cafb657972049030 100644 (file)
@@ -7,23 +7,10 @@
 #ifndef _AT91_ADC_H_
 #define _AT91_ADC_H_
 
-/**
- * struct at91_adc_reg_desc - Various informations relative to registers
- * @channel_base:      Base offset for the channel data registers
- * @drdy_mask:         Mask of the DRDY field in the relevant registers
-                       (Interruptions registers mostly)
- * @status_register:   Offset of the Interrupt Status Register
- * @trigger_register:  Offset of the Trigger setup register
- * @mr_prescal_mask:   Mask of the PRESCAL field in the adc MR register
- * @mr_startup_mask:   Mask of the STARTUP field in the adc MR register
- */
-struct at91_adc_reg_desc {
-       u8      channel_base;
-       u32     drdy_mask;
-       u8      status_register;
-       u8      trigger_register;
-       u32     mr_prescal_mask;
-       u32     mr_startup_mask;
+enum atmel_adc_ts_type {
+       ATMEL_ADC_TOUCHSCREEN_NONE = 0,
+       ATMEL_ADC_TOUCHSCREEN_4WIRE = 4,
+       ATMEL_ADC_TOUCHSCREEN_5WIRE = 5,
 };
 
 /**
@@ -42,23 +29,21 @@ struct at91_adc_trigger {
 /**
  * struct at91_adc_data - platform data for ADC driver
  * @channels_used:             channels in use on the board as a bitmask
- * @num_channels:              global number of channels available on the board
- * @registers:                 Registers definition on the board
  * @startup_time:              startup time of the ADC in microseconds
  * @trigger_list:              Triggers available in the ADC
  * @trigger_number:            Number of triggers available in the ADC
  * @use_external_triggers:     does the board has external triggers availables
  * @vref:                      Reference voltage for the ADC in millivolts
+ * @touchscreen_type:          If a touchscreen is connected, its type (4 or 5 wires)
  */
 struct at91_adc_data {
        unsigned long                   channels_used;
-       u8                              num_channels;
-       struct at91_adc_reg_desc        *registers;
        u8                              startup_time;
        struct at91_adc_trigger         *trigger_list;
        u8                              trigger_number;
        bool                            use_external_triggers;
        u16                             vref;
+       enum atmel_adc_ts_type          touchscreen_type;
 };
 
 extern void __init at91_add_device_adc(struct at91_adc_data *data);
index e26b0c14edea9c0864e6ebc4178537dc7a8eee75..1466443797d74a96214e803b95dc397f86319fc4 100644 (file)
@@ -87,13 +87,6 @@ struct atmel_uart_data {
        int                     rts_gpio;       /* optional RTS GPIO */
 };
 
- /* Touchscreen Controller */
-struct at91_tsadcc_data {
-       unsigned int    adc_clock;
-       u8              pendet_debounce;
-       u8              ts_sample_hold_time;
-};
-
 /* CAN */
 struct at91_can_data {
        void (*transceiver_switch)(int on);
index 174bd546c08b0814bf45a999b307aa9b67e69ad4..bb1149126c544d585cf9d2eba6d98b183ea07fea 100644 (file)
@@ -48,7 +48,6 @@
 
 #include <asm/mach-types.h>
 #include <mach/hardware.h>
-#include <mach/gpio.h>
 
 #include "../codecs/wm8731.h"
 #include "atmel-pcm.h"