Merge tag 'hi6220-dt-for-4.8-2' of git://github.com/hisilicon/linux-hisi into next...
authorArnd Bergmann <arnd@arndb.de>
Thu, 14 Jul 2016 13:57:02 +0000 (15:57 +0200)
committerArnd Bergmann <arnd@arndb.de>
Thu, 14 Jul 2016 15:44:45 +0000 (17:44 +0200)
Merge "ARM64: DT: Hisilicon Hi6220 updates for 4.8" from Wei Xu:

- Add pl031 rtc0 and rtc1 support for hi6220 SoC

* tag 'hi6220-dt-for-4.8-2' of git://github.com/hisilicon/linux-hisi:
  arm64: dts: hi6220: Add pl031 RTC support
  clk: hi6220: Add RTC clock for pl031

100 files changed:
Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt
Documentation/devicetree/bindings/arm/mediatek.txt
Documentation/devicetree/bindings/arm/shmobile.txt
Documentation/devicetree/bindings/ata/ahci-platform.txt
Documentation/devicetree/bindings/clock/renesas,cpg-mssr.txt
Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
Documentation/devicetree/bindings/clock/renesas,rcar-gen2-cpg-clocks.txt
Documentation/devicetree/bindings/interrupt-controller/mediatek,sysirq.txt
Documentation/devicetree/bindings/net/apm-xgene-enet.txt
Documentation/devicetree/bindings/pci/layerscape-pci.txt
Documentation/devicetree/bindings/pinctrl/meson,pinctrl.txt
Documentation/devicetree/bindings/power/renesas,rcar-sysc.txt
Documentation/devicetree/bindings/reset/amlogic,meson-reset.txt [new file with mode: 0644]
Documentation/devicetree/bindings/rng/amlogic,meson-rng.txt [new file with mode: 0644]
Documentation/devicetree/bindings/serial/mtk-uart.txt
Documentation/driver-model/devres.txt
arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
arch/arm/boot/dts/bcm2835-rpi-b.dts
arch/arm/boot/dts/bcm2836-rpi-2-b.dts
arch/arm/boot/dts/bcm283x-rpi-smsc9512.dtsi [new file with mode: 0644]
arch/arm/boot/dts/bcm283x-rpi-smsc9514.dtsi [new file with mode: 0644]
arch/arm/boot/dts/bcm283x.dtsi
arch/arm64/Kconfig.platforms
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi
arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
arch/arm64/boot/dts/apm/apm-shadowcat.dtsi
arch/arm64/boot/dts/apm/apm-storm.dtsi
arch/arm64/boot/dts/arm/juno-base.dtsi
arch/arm64/boot/dts/arm/juno-r1.dts
arch/arm64/boot/dts/arm/juno-r2.dts
arch/arm64/boot/dts/arm/juno.dts
arch/arm64/boot/dts/broadcom/Makefile
arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts [new file with mode: 0644]
arch/arm64/boot/dts/broadcom/bcm2837.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/broadcom/ns2-svk.dts
arch/arm64/boot/dts/broadcom/ns2.dtsi
arch/arm64/boot/dts/exynos/exynos7-espresso.dts
arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi
arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts
arch/arm64/boot/dts/lg/Makefile
arch/arm64/boot/dts/lg/lg1313-ref.dts [new file with mode: 0644]
arch/arm64/boot/dts/lg/lg1313.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/marvell/armada-37xx.dtsi
arch/arm64/boot/dts/marvell/armada-ap806.dtsi
arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi
arch/arm64/boot/dts/mediatek/Makefile
arch/arm64/boot/dts/mediatek/mt6755-evb.dts [new file with mode: 0644]
arch/arm64/boot/dts/mediatek/mt6755.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/mediatek/mt8173.dtsi
arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
arch/arm64/boot/dts/qcom/msm8916.dtsi
arch/arm64/boot/dts/qcom/msm8996-pins.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/qcom/msm8996.dtsi
arch/arm64/boot/dts/renesas/Makefile
arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts
arch/arm64/boot/dts/renesas/r8a7795.dtsi
arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts [new file with mode: 0644]
arch/arm64/boot/dts/renesas/r8a7796.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/rockchip/rk3368-r88.dts
arch/arm64/boot/dts/rockchip/rk3368.dtsi
arch/arm64/boot/dts/rockchip/rk3399-evb.dts
arch/arm64/boot/dts/rockchip/rk3399.dtsi
arch/arm64/boot/dts/socionext/uniphier-ph1-ld20.dtsi
drivers/clk/renesas/Kconfig
drivers/clk/renesas/Makefile
drivers/clk/renesas/r8a7795-cpg-mssr.c
drivers/clk/renesas/r8a7796-cpg-mssr.c [new file with mode: 0644]
drivers/clk/renesas/rcar-gen3-cpg.c [new file with mode: 0644]
drivers/clk/renesas/rcar-gen3-cpg.h [new file with mode: 0644]
drivers/clk/renesas/renesas-cpg-mssr.c
drivers/clk/renesas/renesas-cpg-mssr.h
drivers/clk/tegra/clk-id.h
drivers/clk/tegra/clk-tegra-periph.c
drivers/clk/tegra/clk-tegra210.c
drivers/reset/Kconfig
drivers/reset/Makefile
drivers/reset/core.c
drivers/reset/reset-ath79.c
drivers/reset/reset-meson.c [new file with mode: 0644]
drivers/reset/reset-oxnas.c
drivers/reset/reset-pistachio.c
drivers/reset/reset-socfpga.c
drivers/reset/reset-sunxi.c
drivers/reset/reset-zynq.c
drivers/reset/sti/Kconfig
drivers/soc/renesas/Makefile
drivers/soc/renesas/r8a7796-sysc.c [new file with mode: 0644]
drivers/soc/renesas/rcar-sysc.c
drivers/soc/renesas/rcar-sysc.h
include/dt-bindings/clock/r8a7796-cpg-mssr.h [new file with mode: 0644]
include/dt-bindings/clock/tegra210-car.h
include/dt-bindings/power/r8a7796-sysc.h [new file with mode: 0644]
include/dt-bindings/reset/amlogic,meson-gxbb-reset.h [new file with mode: 0644]
include/dt-bindings/reset/amlogic,meson8b-reset.h [new file with mode: 0644]
include/linux/reset-controller.h
include/linux/reset.h

index 11d3056..6ffe087 100644 (file)
@@ -30,6 +30,10 @@ Raspberry Pi 2 Model B
 Required root node properties:
 compatible = "raspberrypi,2-model-b", "brcm,bcm2836";
 
+Raspberry Pi 3 Model B
+Required root node properties:
+compatible = "raspberrypi,3-model-b", "brcm,bcm2837";
+
 Raspberry Pi Compute Module
 Required root node properties:
 compatible = "raspberrypi,compute-module", "brcm,bcm2835";
index d9c2a37..c860b24 100644 (file)
@@ -10,6 +10,7 @@ compatible: Must contain one of
    "mediatek,mt6580"
    "mediatek,mt6589"
    "mediatek,mt6592"
+   "mediatek,mt6755"
    "mediatek,mt6795"
    "mediatek,mt7623"
    "mediatek,mt8127"
@@ -31,6 +32,9 @@ Supported boards:
 - Evaluation board for MT6592:
     Required root node properties:
       - compatible = "mediatek,mt6592-evb", "mediatek,mt6592";
+- Evaluation phone for MT6755(Helio P10):
+    Required root node properties:
+      - compatible = "mediatek,mt6755-evb", "mediatek,mt6755";
 - Evaluation board for MT6795(Helio X10):
     Required root node properties:
       - compatible = "mediatek,mt6795-evb", "mediatek,mt6795";
index 9cf67e4..d5ed554 100644 (file)
@@ -29,6 +29,8 @@ SoCs:
     compatible = "renesas,r8a7794"
   - R-Car H3 (R8A77950)
     compatible = "renesas,r8a7795"
+  - R-Car M3-W (R8A77960)
+    compatible = "renesas,r8a7796"
 
 
 Boards:
@@ -61,5 +63,7 @@ Boards:
     compatible = "renesas,porter", "renesas,r8a7791"
   - Salvator-X (RTP0RC7795SIPB0010S)
     compatible = "renesas,salvator-x", "renesas,r8a7795";
+  - Salvator-X
+    compatible = "renesas,salvator-x", "renesas,r8a7796";
   - SILK (RTP0RC7794LCB00011S)
     compatible = "renesas,silk", "renesas,r8a7794"
index 87adfb2..fedc213 100644 (file)
@@ -10,6 +10,7 @@ PHYs.
 Required properties:
 - compatible        : compatible string, one of:
   - "allwinner,sun4i-a10-ahci"
+  - "brcm,iproc-ahci"
   - "hisilicon,hisi-ahci"
   - "cavium,octeon-7130-ahci"
   - "ibm,476gtr-ahci"
index fefb802..394d725 100644 (file)
@@ -13,7 +13,8 @@ They provide the following functionalities:
 
 Required Properties:
   - compatible: Must be one of:
-      - "renesas,r8a7795-cpg-mssr" for the r8a7795 SoC
+      - "renesas,r8a7795-cpg-mssr" for the r8a7795 SoC (R-Car H3)
+      - "renesas,r8a7796-cpg-mssr" for the r8a7796 SoC (R-Car M3-W)
 
   - reg: Base address and length of the memory resource used by the CPG/MSSR
     block
@@ -21,8 +22,8 @@ Required Properties:
   - clocks: References to external parent clocks, one entry for each entry in
     clock-names
   - clock-names: List of external parent clock names. Valid names are:
-      - "extal" (r8a7795)
-      - "extalr" (r8a7795)
+      - "extal" (r8a7795, r8a7796)
+      - "extalr" (r8a7795, r8a7796)
 
   - #clock-cells: Must be 2
       - For CPG core clocks, the two clock specifier cells must be "CPG_CORE"
index 16ed181..da578eb 100644 (file)
@@ -17,6 +17,7 @@ Required Properties:
     - "renesas,r8a7779-mstp-clocks" for R8A7779 (R-Car H1) MSTP gate clocks
     - "renesas,r8a7790-mstp-clocks" for R8A7790 (R-Car H2) MSTP gate clocks
     - "renesas,r8a7791-mstp-clocks" for R8A7791 (R-Car M2-W) MSTP gate clocks
+    - "renesas,r8a7792-mstp-clocks" for R8A7792 (R-Car V2H) MSTP gate clocks
     - "renesas,r8a7793-mstp-clocks" for R8A7793 (R-Car M2-N) MSTP gate clocks
     - "renesas,r8a7794-mstp-clocks" for R8A7794 (R-Car E2) MSTP gate clocks
     - "renesas,sh73a0-mstp-clocks" for SH73A0 (SH-MobileAG5) MSTP gate clocks
index 2a9a8ed..f8c05bb 100644 (file)
@@ -10,6 +10,7 @@ Required Properties:
   - compatible: Must be one of
     - "renesas,r8a7790-cpg-clocks" for the r8a7790 CPG
     - "renesas,r8a7791-cpg-clocks" for the r8a7791 CPG
+    - "renesas,r8a7792-cpg-clocks" for the r8a7792 CPG
     - "renesas,r8a7793-cpg-clocks" for the r8a7793 CPG
     - "renesas,r8a7794-cpg-clocks" for the r8a7794 CPG
     and "renesas,rcar-gen2-cpg-clocks" as a fallback.
index 8cf564d..9d1d72c 100644 (file)
@@ -9,6 +9,7 @@ Required properties:
        "mediatek,mt8135-sysirq"
        "mediatek,mt8127-sysirq"
        "mediatek,mt6795-sysirq"
+       "mediatek,mt6755-sysirq"
        "mediatek,mt6592-sysirq"
        "mediatek,mt6589-sysirq"
        "mediatek,mt6582-sysirq"
index 05f705e..e41b2d5 100644 (file)
@@ -59,8 +59,8 @@ Example:
                compatible = "apm,xgene-enet";
                status = "disabled";
                reg = <0x0 0x17020000 0x0 0xd100>,
-                     <0x0 0X17030000 0x0 0X400>,
-                     <0x0 0X10000000 0x0 0X200>;
+                     <0x0 0x17030000 0x0 0x400>,
+                     <0x0 0x10000000 0x0 0x200>;
                reg-names = "enet_csr", "ring_csr", "ring_cmd";
                interrupts = <0x0 0x3c 0x4>;
                port-id = <0>;
index ef683b2..41e9f55 100644 (file)
@@ -24,6 +24,9 @@ Required properties:
   The first entry must be a link to the SCFG device node
   The second entry must be '0' or '1' based on physical PCIe controller index.
   This is used to get SCFG PEXN registers
+- dma-coherent: Indicates that the hardware IP block can ensure the coherency
+  of the data transferred from/to the IP block. This can avoid the software
+  cache flush/invalid actions, and improve the performance significantly.
 
 Example:
 
@@ -38,6 +41,7 @@ Example:
                #address-cells = <3>;
                #size-cells = <2>;
                device_type = "pci";
+               dma-coherent;
                num-lanes = <4>;
                bus-range = <0x0 0xff>;
                ranges = <0x81000000 0x0 0x00000000 0x40 0x00010000 0x0 0x00010000   /* downstream I/O */
index 32f4a2d..fe7fe0b 100644 (file)
@@ -5,6 +5,8 @@ Required properties for the root node:
                      "amlogic,meson8b-cbus-pinctrl"
                      "amlogic,meson8-aobus-pinctrl"
                      "amlogic,meson8b-aobus-pinctrl"
+                     "amlogic,meson-gxbb-periphs-pinctrl"
+                     "amlogic,meson-gxbb-aobus-pinctrl"
  - reg: address and size of registers controlling irq functionality
 
 === GPIO sub-nodes ===
index b74e4d4..0725fb3 100644 (file)
@@ -14,6 +14,7 @@ Required properties:
       - "renesas,r8a7793-sysc" (R-Car M2-N)
       - "renesas,r8a7794-sysc" (R-Car E2)
       - "renesas,r8a7795-sysc" (R-Car H3)
+      - "renesas,r8a7796-sysc" (R-Car M3-W)
   - reg: Address start and address range for the device.
   - #power-domain-cells: Must be 1.
 
diff --git a/Documentation/devicetree/bindings/reset/amlogic,meson-reset.txt b/Documentation/devicetree/bindings/reset/amlogic,meson-reset.txt
new file mode 100644 (file)
index 0000000..e746b63
--- /dev/null
@@ -0,0 +1,18 @@
+Amlogic Meson SoC Reset Controller
+=======================================
+
+Please also refer to reset.txt in this directory for common reset
+controller binding usage.
+
+Required properties:
+- compatible: Should be "amlogic,meson8b-reset" or "amlogic,meson-gxbb-reset"
+- reg: should contain the register address base
+- #reset-cells: 1, see below
+
+example:
+
+reset: reset-controller {
+       compatible = "amlogic,meson-gxbb-reset";
+       reg = <0x0 0x04404 0x0 0x20>;
+       #reset-cells = <1>;
+};
diff --git a/Documentation/devicetree/bindings/rng/amlogic,meson-rng.txt b/Documentation/devicetree/bindings/rng/amlogic,meson-rng.txt
new file mode 100644 (file)
index 0000000..202f2d0
--- /dev/null
@@ -0,0 +1,14 @@
+Amlogic Meson Random number generator
+=====================================
+
+Required properties:
+
+- compatible : should be "amlogic,meson-rng"
+- reg : Specifies base physical address and size of the registers.
+
+Example:
+
+rng {
+        compatible = "amlogic,meson-rng";
+        reg = <0x0 0xc8834000 0x0 0x4>;
+};
index e99e10a..0015c72 100644 (file)
@@ -6,6 +6,7 @@ Required properties:
   * "mediatek,mt6580-uart" for MT6580 compatible UARTS
   * "mediatek,mt6582-uart" for MT6582 compatible UARTS
   * "mediatek,mt6589-uart" for MT6589 compatible UARTS
+  * "mediatek,mt6755-uart" for MT6755 compatible UARTS
   * "mediatek,mt6795-uart" for MT6795 compatible UARTS
   * "mediatek,mt7623-uart" for MT7623 compatible UARTS
   * "mediatek,mt8127-uart" for MT8127 compatible UARTS
index c63eea0..f5e5223 100644 (file)
@@ -352,6 +352,10 @@ REGULATOR
   devm_regulator_put()
   devm_regulator_register()
 
+RESET
+  devm_reset_control_get()
+  devm_reset_controller_register()
+
 SLAVE DMA ENGINE
   devm_acpi_dma_controller_register()
 
index 57d313b..d5fdb8e 100644 (file)
@@ -1,6 +1,7 @@
 /dts-v1/;
 #include "bcm2835.dtsi"
 #include "bcm2835-rpi.dtsi"
+#include "bcm283x-rpi-smsc9514.dtsi"
 
 / {
        compatible = "raspberrypi,model-b-plus", "brcm,bcm2835";
index cf2774e..bfc4bd9 100644 (file)
@@ -1,6 +1,7 @@
 /dts-v1/;
 #include "bcm2835.dtsi"
 #include "bcm2835-rpi.dtsi"
+#include "bcm283x-rpi-smsc9512.dtsi"
 
 / {
        compatible = "raspberrypi,model-b-rev2", "brcm,bcm2835";
index 8b15f9c..0371bb7 100644 (file)
@@ -1,6 +1,7 @@
 /dts-v1/;
 #include "bcm2835.dtsi"
 #include "bcm2835-rpi.dtsi"
+#include "bcm283x-rpi-smsc9512.dtsi"
 
 / {
        compatible = "raspberrypi,model-b", "brcm,bcm2835";
index c4743f4..29e1cfe 100644 (file)
@@ -1,6 +1,7 @@
 /dts-v1/;
 #include "bcm2836.dtsi"
 #include "bcm2835-rpi.dtsi"
+#include "bcm283x-rpi-smsc9514.dtsi"
 
 / {
        compatible = "raspberrypi,2-model-b", "brcm,bcm2836";
diff --git a/arch/arm/boot/dts/bcm283x-rpi-smsc9512.dtsi b/arch/arm/boot/dts/bcm283x-rpi-smsc9512.dtsi
new file mode 100644 (file)
index 0000000..12c981e
--- /dev/null
@@ -0,0 +1,19 @@
+/ {
+       aliases {
+               ethernet = &ethernet;
+       };
+};
+
+&usb {
+       usb1@1 {
+               compatible = "usb424,9512";
+               reg = <1>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               ethernet: usbether@1 {
+                       compatible = "usb424,ec00";
+                       reg = <1>;
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/bcm283x-rpi-smsc9514.dtsi b/arch/arm/boot/dts/bcm283x-rpi-smsc9514.dtsi
new file mode 100644 (file)
index 0000000..3f0a56e
--- /dev/null
@@ -0,0 +1,19 @@
+/ {
+       aliases {
+               ethernet = &ethernet;
+       };
+};
+
+&usb {
+       usb1@1 {
+               compatible = "usb424,9514";
+               reg = <1>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               ethernet: usbether@1 {
+                       compatible = "usb424,ec00";
+                       reg = <1>;
+               };
+       };
+};
index 10b27b9..b982522 100644 (file)
                        compatible = "brcm,bcm2835-usb";
                        reg = <0x7e980000 0x10000>;
                        interrupts = <1 9>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                };
 
                v3d: v3d@7ec00000 {
index 7ef1d05..2182fd5 100644 (file)
@@ -121,6 +121,12 @@ config ARCH_R8A7795
        help
          This enables support for the Renesas R-Car H3 SoC.
 
+config ARCH_R8A7796
+       bool "Renesas R-Car M3-W SoC Platform"
+       depends on ARCH_RENESAS
+       help
+         This enables support for the Renesas R-Car M3-W SoC.
+
 config ARCH_STRATIX10
        bool "Altera's Stratix 10 SoCFPGA Family"
        help
index 7f2c674..90a84c5 100644 (file)
@@ -45,6 +45,7 @@
 /dts-v1/;
 
 #include "meson-gxbb.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 
 / {
        compatible = "hardkernel,odroid-c2", "amlogic,meson-gxbb";
                device_type = "memory";
                reg = <0x0 0x0 0x0 0x80000000>;
        };
+
+       leds {
+               compatible = "gpio-leds";
+               blue {
+                       label = "c2:blue:alive";
+                       gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "heartbeat";
+                       default-state = "off";
+               };
+       };
 };
 
 &uart_AO {
        status = "okay";
+       pinctrl-0 = <&uart_ao_a_pins>;
+       pinctrl-names = "default";
+};
+
+&ethmac {
+       status = "okay";
+       pinctrl-0 = <&eth_pins>;
+       pinctrl-names = "default";
 };
+
index bf7ff1d..f4f30f6 100644 (file)
 /* This UART is brought out to the DB9 connector */
 &uart_AO {
        status = "okay";
+       pinctrl-0 = <&uart_ao_a_pins>;
+       pinctrl-names = "default";
 };
+
+&ethmac {
+       status = "okay";
+       pinctrl-0 = <&eth_pins>;
+       pinctrl-names = "default";
+};
+
index 012cdcc..54bb7c7 100644 (file)
@@ -56,4 +56,7 @@
 
 &uart_AO {
        status = "okay";
+       pinctrl-0 = <&uart_ao_a_pins>;
+       pinctrl-names = "default";
+
 };
index 832815d..e502c24 100644 (file)
@@ -43,6 +43,8 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/gpio/meson-gxbb-gpio.h>
+#include <dt-bindings/reset/amlogic,meson-gxbb-reset.h>
 
 / {
        compatible = "amlogic,meson-gxbb";
                        #size-cells = <2>;
                        ranges = <0x0 0x0 0x0 0xc1100000 0x0 0x100000>;
 
+                       reset: reset-controller@4404 {
+                               compatible = "amlogic,meson-gxbb-reset";
+                               reg = <0x0 0x04404 0x0 0x20>;
+                               #reset-cells = <1>;
+                       };
+
                        uart_A: serial@84c0 {
                                compatible = "amlogic,meson-uart";
-                               reg = <0x0 0x084c0 0x0 0x14>;
+                               reg = <0x0 0x84c0 0x0 0x14>;
                                interrupts = <GIC_SPI 26 IRQ_TYPE_EDGE_RISING>;
                                clocks = <&xtal>;
                                status = "disabled";
                        };
+
+                       uart_B: serial@84dc {
+                               compatible = "amlogic,meson-uart";
+                               reg = <0x0 0x84dc 0x0 0x14>;
+                               interrupts = <GIC_SPI 75 IRQ_TYPE_EDGE_RISING>;
+                               clocks = <&xtal>;
+                               status = "disabled";
+                       };
+
+                       uart_C: serial@8700 {
+                               compatible = "amlogic,meson-uart";
+                               reg = <0x0 0x8700 0x0 0x14>;
+                               interrupts = <GIC_SPI 93 IRQ_TYPE_EDGE_RISING>;
+                               clocks = <&xtal>;
+                               status = "disabled";
+                       };
                };
 
                gic: interrupt-controller@c4301000 {
                        #size-cells = <2>;
                        ranges = <0x0 0x0 0x0 0xc8100000 0x0 0x100000>;
 
+                       pinctrl_aobus: pinctrl@14 {
+                               compatible = "amlogic,meson-gxbb-aobus-pinctrl";
+                               #address-cells = <2>;
+                               #size-cells = <2>;
+                               ranges;
+
+                               gpio_ao: bank@14 {
+                                       reg = <0x0 0x00014 0x0 0x8>,
+                                             <0x0 0x0002c 0x0 0x4>,
+                                             <0x0 0x00024 0x0 0x8>;
+                                       reg-names = "mux", "pull", "gpio";
+                                       gpio-controller;
+                                       #gpio-cells = <2>;
+                               };
+
+                               uart_ao_a_pins: uart_ao_a {
+                                       mux {
+                                               groups = "uart_tx_ao_a", "uart_rx_ao_a";
+                                               function = "uart_ao";
+                                       };
+                               };
+                       };
+
                        uart_AO: serial@4c0 {
                                compatible = "amlogic,meson-uart";
                                reg = <0x0 0x004c0 0x0 0x14>;
                        };
                };
 
+               periphs: periphs@c8834000 {
+                       compatible = "simple-bus";
+                       reg = <0x0 0xc8834000 0x0 0x2000>;
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges = <0x0 0x0 0x0 0xc8834000 0x0 0x2000>;
+
+                       rng {
+                               compatible = "amlogic,meson-rng";
+                               reg = <0x0 0x0 0x0 0x4>;
+                       };
+
+                       pinctrl_periphs: pinctrl@4b0 {
+                               compatible = "amlogic,meson-gxbb-periphs-pinctrl";
+                               #address-cells = <2>;
+                               #size-cells = <2>;
+                               ranges;
+
+                               gpio: bank@4b0 {
+                                       reg = <0x0 0x004b0 0x0 0x28>,
+                                             <0x0 0x004e8 0x0 0x14>,
+                                             <0x0 0x00120 0x0 0x14>,
+                                             <0x0 0x00430 0x0 0x40>;
+                                       reg-names = "mux", "pull", "pull-enable", "gpio";
+                                       gpio-controller;
+                                       #gpio-cells = <2>;
+                               };
+
+                               emmc_pins: emmc {
+                                       mux {
+                                               groups = "emmc_nand_d07",
+                                                      "emmc_cmd",
+                                                      "emmc_clk";
+                                               function = "emmc";
+                                       };
+                               };
+
+                               sdcard_pins: sdcard {
+                                       mux {
+                                               groups = "sdcard_d0",
+                                                      "sdcard_d1",
+                                                      "sdcard_d2",
+                                                      "sdcard_d3",
+                                                      "sdcard_cmd",
+                                                      "sdcard_clk";
+                                               function = "sdcard";
+                                       };
+                               };
+
+                               uart_a_pins: uart_a {
+                                       mux {
+                                               groups = "uart_tx_a",
+                                                      "uart_rx_a";
+                                               function = "uart_a";
+                                       };
+                               };
+
+                               uart_b_pins: uart_b {
+                                       mux {
+                                               groups = "uart_tx_b",
+                                                      "uart_rx_b";
+                                               function = "uart_b";
+                                       };
+                               };
+
+                               uart_c_pins: uart_c {
+                                       mux {
+                                               groups = "uart_tx_c",
+                                                      "uart_rx_c";
+                                               function = "uart_c";
+                                       };
+                               };
+
+                               eth_pins: eth_c {
+                                       mux {
+                                               groups = "eth_mdio",
+                                                      "eth_mdc",
+                                                      "eth_clk_rx_clk",
+                                                      "eth_rx_dv",
+                                                      "eth_rxd0",
+                                                      "eth_rxd1",
+                                                      "eth_rxd2",
+                                                      "eth_rxd3",
+                                                      "eth_rgmii_tx_clk",
+                                                      "eth_tx_en",
+                                                      "eth_txd0",
+                                                      "eth_txd1",
+                                                      "eth_txd2",
+                                                      "eth_txd3";
+                                               function = "eth";
+                                       };
+                               };
+                       };
+               };
+
+               hiubus: hiubus@c883c000 {
+                       compatible = "simple-bus";
+                       reg = <0x0 0xc883c000 0x0 0x2000>;
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges = <0x0 0x0 0x0 0xc883c000 0x0 0x2000>;
+
+                       clkc: clock-controller@0 {
+                               compatible = "amlogic,gxbb-clkc";
+                               #clock-cells = <1>;
+                               reg = <0x0 0x0 0x0 0x3db>;
+                       };
+               };
+
                apb: apb@d0000000 {
                        compatible = "simple-bus";
                        reg = <0x0 0xd0000000 0x0 0x200000>;
                        #size-cells = <2>;
                        ranges = <0x0 0x0 0x0 0xd0000000 0x0 0x200000>;
                };
+
+               ethmac: ethernet@c9410000 {
+                       compatible = "amlogic,meson6-dwmac", "snps,dwmac";
+                       reg = <0x0 0xc9410000 0x0 0x10000
+                              0x0 0xc8834540 0x0 0x4>;
+                       interrupts = <0 8 1>;
+                       interrupt-names = "macirq";
+                       clocks = <&xtal>;
+                       clock-names = "stmmaceth";
+                       phy-mode = "rgmii";
+                       status = "disabled";
+               };
        };
 };
index c569f76..21028b1 100644 (file)
                interrupts = <1 9 0xf04>;       /* GIC Maintenence IRQ */
                ranges = <0 0 0 0x79000000 0x0 0x800000>; /* MSI Range */
                reg = <0x0 0x78090000 0x0 0x10000>,     /* GIC Dist */
-                     <0x0 0x780A0000 0x0 0x20000>,     /* GIC CPU */
-                     <0x0 0x780C0000 0x0 0x10000>,     /* GIC VCPU Control */
-                     <0x0 0x780E0000 0x0 0x20000>;     /* GIC VCPU */
-               v2m0: v2m@0x00000 {
+                     <0x0 0x780a0000 0x0 0x20000>,     /* GIC CPU */
+                     <0x0 0x780c0000 0x0 0x10000>,     /* GIC VCPU Control */
+                     <0x0 0x780e0000 0x0 0x20000>;     /* GIC VCPU */
+               v2m0: v2m@00000 {
                        compatible = "arm,gic-v2m-frame";
                        msi-controller;
                        reg = <0x0 0x0 0x0 0x1000>;
                };
-               v2m1: v2m@0x10000 {
+               v2m1: v2m@10000 {
                        compatible = "arm,gic-v2m-frame";
                        msi-controller;
                        reg = <0x0 0x10000 0x0 0x1000>;
                };
-               v2m2: v2m@0x20000 {
+               v2m2: v2m@20000 {
                        compatible = "arm,gic-v2m-frame";
                        msi-controller;
                        reg = <0x0 0x20000 0x0 0x1000>;
                };
-               v2m3: v2m@0x30000 {
+               v2m3: v2m@30000 {
                        compatible = "arm,gic-v2m-frame";
                        msi-controller;
                        reg = <0x0 0x30000 0x0 0x1000>;
                };
-               v2m4: v2m@0x40000 {
+               v2m4: v2m@40000 {
                        compatible = "arm,gic-v2m-frame";
                        msi-controller;
                        reg = <0x0 0x40000 0x0 0x1000>;
                };
-               v2m5: v2m@0x50000 {
+               v2m5: v2m@50000 {
                        compatible = "arm,gic-v2m-frame";
                        msi-controller;
                        reg = <0x0 0x50000 0x0 0x1000>;
                };
-               v2m6: v2m@0x60000 {
+               v2m6: v2m@60000 {
                        compatible = "arm,gic-v2m-frame";
                        msi-controller;
                        reg = <0x0 0x60000 0x0 0x1000>;
                };
-               v2m7: v2m@0x70000 {
+               v2m7: v2m@70000 {
                        compatible = "arm,gic-v2m-frame";
                        msi-controller;
                        reg = <0x0 0x70000 0x0 0x1000>;
                };
-               v2m8: v2m@0x80000 {
+               v2m8: v2m@80000 {
                        compatible = "arm,gic-v2m-frame";
                        msi-controller;
                        reg = <0x0 0x80000 0x0 0x1000>;
                };
-               v2m9: v2m@0x90000 {
+               v2m9: v2m@90000 {
                        compatible = "arm,gic-v2m-frame";
                        msi-controller;
                        reg = <0x0 0x90000 0x0 0x1000>;
                };
-               v2m10: v2m@0xA0000 {
+               v2m10: v2m@a0000 {
                        compatible = "arm,gic-v2m-frame";
                        msi-controller;
-                       reg = <0x0 0xA0000 0x0 0x1000>;
+                       reg = <0x0 0xa0000 0x0 0x1000>;
                };
-               v2m11: v2m@0xB0000 {
+               v2m11: v2m@b0000 {
                        compatible = "arm,gic-v2m-frame";
                        msi-controller;
-                       reg = <0x0 0xB0000 0x0 0x1000>;
+                       reg = <0x0 0xb0000 0x0 0x1000>;
                };
-               v2m12: v2m@0xC0000 {
+               v2m12: v2m@c0000 {
                        compatible = "arm,gic-v2m-frame";
                        msi-controller;
-                       reg = <0x0 0xC0000 0x0 0x1000>;
+                       reg = <0x0 0xc0000 0x0 0x1000>;
                };
-               v2m13: v2m@0xD0000 {
+               v2m13: v2m@d0000 {
                        compatible = "arm,gic-v2m-frame";
                        msi-controller;
-                       reg = <0x0 0xD0000 0x0 0x1000>;
+                       reg = <0x0 0xd0000 0x0 0x1000>;
                };
-               v2m14: v2m@0xE0000 {
+               v2m14: v2m@e0000 {
                        compatible = "arm,gic-v2m-frame";
                        msi-controller;
-                       reg = <0x0 0xE0000 0x0 0x1000>;
+                       reg = <0x0 0xe0000 0x0 0x1000>;
                };
-               v2m15: v2m@0xF0000 {
+               v2m15: v2m@f0000 {
                        compatible = "arm,gic-v2m-frame";
                        msi-controller;
-                       reg = <0x0 0xF0000 0x0 0x1000>;
+                       reg = <0x0 0xf0000 0x0 0x1000>;
                };
        };
 
 
        timer {
                compatible = "arm,armv8-timer";
-               interrupts = <1 0 0xff04>,      /* Secure Phys IRQ */
-                            <1 13 0xff04>,     /* Non-secure Phys IRQ */
-                            <1 14 0xff04>,     /* Virt IRQ */
-                            <1 15 0xff04>;     /* Hyp IRQ */
+               interrupts = <1 0 0xff08>,      /* Secure Phys IRQ */
+                            <1 13 0xff08>,     /* Non-secure Phys IRQ */
+                            <1 14 0xff08>,     /* Virt IRQ */
+                            <1 15 0xff08>;     /* Hyp IRQ */
                clock-frequency = <50000000>;
        };
 
                        compatible = "apm,xgene2-sgenet";
                        status = "disabled";
                        reg = <0x0 0x1f610000 0x0 0x10000>,
-                             <0x0 0x1f600000 0x0 0Xd100>,
-                             <0x0 0x20000000 0x0 0X20000>;
+                             <0x0 0x1f600000 0x0 0xd100>,
+                             <0x0 0x20000000 0x0 0x20000>;
                        interrupts = <0 96 4>,
                                     <0 97 4>;
                        dma-coherent;
                        compatible = "apm,xgene2-xgenet";
                        status = "disabled";
                        reg = <0x0 0x1f620000 0x0 0x10000>,
-                             <0x0 0x1f600000 0x0 0Xd100>,
-                             <0x0 0x20000000 0x0 0X220000>;
+                             <0x0 0x1f600000 0x0 0xd100>,
+                             <0x0 0x20000000 0x0 0x220000>;
                        interrupts = <0 108 4>,
                                     <0 109 4>,
                                     <0 110 4>,
                        #size-cells = <0>;
                        compatible = "snps,designware-i2c";
                        reg = <0x0 0x10640000 0x0 0x1000>;
-                       interrupts = <0 0x3A 0x4>;
+                       interrupts = <0 0x3a 0x4>;
                        clocks = <&i2c4clk 0>;
                        bus_num = <4>;
                };
index 5147d76..91c73b8 100644 (file)
                                clock-output-names = "sdioclk";
                        };
 
-                       qmlclk: qmlclk {
-                               compatible = "apm,xgene-device-clock";
-                               #clock-cells = <1>;
-                               clocks = <&socplldiv2 0>;
-                               clock-names = "qmlclk";
-                               reg = <0x0 0x1703C000 0x0 0x1000>;
-                               reg-names = "csr-reg";
-                               clock-output-names = "qmlclk";
-                       };
-
                        ethclk: ethclk {
                                compatible = "apm,xgene-device-clock";
                                #clock-cells = <1>;
                                compatible = "apm,xgene-device-clock";
                                #clock-cells = <1>;
                                clocks = <&ethclk 0>;
-                               reg = <0x0 0x1702C000 0x0 0x1000>;
+                               reg = <0x0 0x1702c000 0x0 0x1000>;
                                reg-names = "csr-reg";
                                clock-output-names = "menetclk";
                        };
                        compatible = "apm,xgene-enet";
                        status = "disabled";
                        reg = <0x0 0x17020000 0x0 0xd100>,
-                             <0x0 0X17030000 0x0 0Xc300>,
-                             <0x0 0X10000000 0x0 0X200>;
+                             <0x0 0x17030000 0x0 0xc300>,
+                             <0x0 0x10000000 0x0 0x200>;
                        reg-names = "enet_csr", "ring_csr", "ring_cmd";
                        interrupts = <0x0 0x3c 0x4>;
                        dma-coherent;
                        compatible = "apm,xgene1-sgenet";
                        status = "disabled";
                        reg = <0x0 0x1f210000 0x0 0xd100>,
-                             <0x0 0x1f200000 0x0 0Xc300>,
-                             <0x0 0x1B000000 0x0 0X200>;
+                             <0x0 0x1f200000 0x0 0xc300>,
+                             <0x0 0x1b000000 0x0 0x200>;
                        reg-names = "enet_csr", "ring_csr", "ring_cmd";
-                       interrupts = <0x0 0xA0 0x4>,
-                                    <0x0 0xA1 0x4>;
+                       interrupts = <0x0 0xa0 0x4>,
+                                    <0x0 0xa1 0x4>;
                        dma-coherent;
                        clocks = <&sge0clk 0>;
                        local-mac-address = [00 00 00 00 00 00];
                        compatible = "apm,xgene1-sgenet";
                        status = "disabled";
                        reg = <0x0 0x1f210030 0x0 0xd100>,
-                             <0x0 0x1f200000 0x0 0Xc300>,
-                             <0x0 0x1B000000 0x0 0X8000>;
+                             <0x0 0x1f200000 0x0 0xc300>,
+                             <0x0 0x1b000000 0x0 0x8000>;
                        reg-names = "enet_csr", "ring_csr", "ring_cmd";
-                       interrupts = <0x0 0xAC 0x4>,
-                                    <0x0 0xAD 0x4>;
+                       interrupts = <0x0 0xac 0x4>,
+                                    <0x0 0xad 0x4>;
                        port-id = <1>;
                        dma-coherent;
                        clocks = <&sge1clk 0>;
                        compatible = "apm,xgene1-xgenet";
                        status = "disabled";
                        reg = <0x0 0x1f610000 0x0 0xd100>,
-                             <0x0 0x1f600000 0x0 0Xc300>,
-                             <0x0 0x18000000 0x0 0X200>;
+                             <0x0 0x1f600000 0x0 0xc300>,
+                             <0x0 0x18000000 0x0 0x200>;
                        reg-names = "enet_csr", "ring_csr", "ring_cmd";
                        interrupts = <0x0 0x60 0x4>,
                                     <0x0 0x61 0x4>,
                        compatible = "apm,xgene1-xgenet";
                        status = "disabled";
                        reg = <0x0 0x1f620000 0x0 0xd100>,
-                             <0x0 0x1f600000 0x0 0Xc300>,
-                             <0x0 0x18000000 0x0 0X8000>;
+                             <0x0 0x1f600000 0x0 0xc300>,
+                             <0x0 0x18000000 0x0 0x8000>;
                        reg-names = "enet_csr", "ring_csr", "ring_cmd";
-                       interrupts = <0x0 0x6C 0x4>,
-                                    <0x0 0x6D 0x4>;
+                       interrupts = <0x0 0x6c 0x4>,
+                                    <0x0 0x6d 0x4>;
                        port-id = <1>;
                        dma-coherent;
                        clocks = <&xge1clk 0>;
index dee2386..334271a 100644 (file)
                             <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_LOW)>;
        };
 
+       /*
+        * Juno TRMs specify the size for these coresight components as 64K.
+        * The actual size is just 4K though 64K is reserved. Access to the
+        * unmapped reserved region results in a DECERR response.
+        */
+       etf@20010000 {
+               compatible = "arm,coresight-tmc", "arm,primecell";
+               reg = <0 0x20010000 0 0x1000>;
+
+               clocks = <&soc_smc50mhz>;
+               clock-names = "apb_pclk";
+               power-domains = <&scpi_devpd 0>;
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       /* input port */
+                       port@0 {
+                               reg = <0>;
+                               etf_in_port: endpoint {
+                                       slave-mode;
+                                       remote-endpoint = <&main_funnel_out_port>;
+                               };
+                       };
+
+                       /* output port */
+                       port@1 {
+                               reg = <0>;
+                               etf_out_port: endpoint {
+                                       remote-endpoint = <&replicator_in_port0>;
+                               };
+                       };
+               };
+       };
+
+       tpiu@20030000 {
+               compatible = "arm,coresight-tpiu", "arm,primecell";
+               reg = <0 0x20030000 0 0x1000>;
+
+               clocks = <&soc_smc50mhz>;
+               clock-names = "apb_pclk";
+               power-domains = <&scpi_devpd 0>;
+               port {
+                       tpiu_in_port: endpoint {
+                               slave-mode;
+                               remote-endpoint = <&replicator_out_port0>;
+                       };
+               };
+       };
+
+       main-funnel@20040000 {
+               compatible = "arm,coresight-funnel", "arm,primecell";
+               reg = <0 0x20040000 0 0x1000>;
+
+               clocks = <&soc_smc50mhz>;
+               clock-names = "apb_pclk";
+               power-domains = <&scpi_devpd 0>;
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               main_funnel_out_port: endpoint {
+                                       remote-endpoint = <&etf_in_port>;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <0>;
+                               main_funnel_in_port0: endpoint {
+                                       slave-mode;
+                                       remote-endpoint = <&cluster0_funnel_out_port>;
+                               };
+                       };
+
+                       port@2 {
+                               reg = <1>;
+                               main_funnel_in_port1: endpoint {
+                                       slave-mode;
+                                       remote-endpoint = <&cluster1_funnel_out_port>;
+                               };
+                       };
+
+               };
+       };
+
+       etr@20070000 {
+               compatible = "arm,coresight-tmc", "arm,primecell";
+               reg = <0 0x20070000 0 0x1000>;
+
+               clocks = <&soc_smc50mhz>;
+               clock-names = "apb_pclk";
+               power-domains = <&scpi_devpd 0>;
+               port {
+                       etr_in_port: endpoint {
+                               slave-mode;
+                               remote-endpoint = <&replicator_out_port1>;
+                       };
+               };
+       };
+
+       etm0: etm@22040000 {
+               compatible = "arm,coresight-etm4x", "arm,primecell";
+               reg = <0 0x22040000 0 0x1000>;
+
+               clocks = <&soc_smc50mhz>;
+               clock-names = "apb_pclk";
+               power-domains = <&scpi_devpd 0>;
+               port {
+                       cluster0_etm0_out_port: endpoint {
+                               remote-endpoint = <&cluster0_funnel_in_port0>;
+                       };
+               };
+       };
+
+       cluster0-funnel@220c0000 {
+               compatible = "arm,coresight-funnel", "arm,primecell";
+               reg = <0 0x220c0000 0 0x1000>;
+
+               clocks = <&soc_smc50mhz>;
+               clock-names = "apb_pclk";
+               power-domains = <&scpi_devpd 0>;
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               cluster0_funnel_out_port: endpoint {
+                                       remote-endpoint = <&main_funnel_in_port0>;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <0>;
+                               cluster0_funnel_in_port0: endpoint {
+                                       slave-mode;
+                                       remote-endpoint = <&cluster0_etm0_out_port>;
+                               };
+                       };
+
+                       port@2 {
+                               reg = <1>;
+                               cluster0_funnel_in_port1: endpoint {
+                                       slave-mode;
+                                       remote-endpoint = <&cluster0_etm1_out_port>;
+                               };
+                       };
+               };
+       };
+
+       etm1: etm@22140000 {
+               compatible = "arm,coresight-etm4x", "arm,primecell";
+               reg = <0 0x22140000 0 0x1000>;
+
+               clocks = <&soc_smc50mhz>;
+               clock-names = "apb_pclk";
+               power-domains = <&scpi_devpd 0>;
+               port {
+                       cluster0_etm1_out_port: endpoint {
+                               remote-endpoint = <&cluster0_funnel_in_port1>;
+                       };
+               };
+       };
+
+       etm2: etm@23040000 {
+               compatible = "arm,coresight-etm4x", "arm,primecell";
+               reg = <0 0x23040000 0 0x1000>;
+
+               clocks = <&soc_smc50mhz>;
+               clock-names = "apb_pclk";
+               power-domains = <&scpi_devpd 0>;
+               port {
+                       cluster1_etm0_out_port: endpoint {
+                               remote-endpoint = <&cluster1_funnel_in_port0>;
+                       };
+               };
+       };
+
+       cluster1-funnel@230c0000 {
+               compatible = "arm,coresight-funnel", "arm,primecell";
+               reg = <0 0x230c0000 0 0x1000>;
+
+               clocks = <&soc_smc50mhz>;
+               clock-names = "apb_pclk";
+               power-domains = <&scpi_devpd 0>;
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               cluster1_funnel_out_port: endpoint {
+                                       remote-endpoint = <&main_funnel_in_port1>;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <0>;
+                               cluster1_funnel_in_port0: endpoint {
+                                       slave-mode;
+                                       remote-endpoint = <&cluster1_etm0_out_port>;
+                               };
+                       };
+
+                       port@2 {
+                               reg = <1>;
+                               cluster1_funnel_in_port1: endpoint {
+                                       slave-mode;
+                                       remote-endpoint = <&cluster1_etm1_out_port>;
+                               };
+                       };
+                       port@3 {
+                               reg = <2>;
+                               cluster1_funnel_in_port2: endpoint {
+                                       slave-mode;
+                                       remote-endpoint = <&cluster1_etm2_out_port>;
+                               };
+                       };
+                       port@4 {
+                               reg = <3>;
+                               cluster1_funnel_in_port3: endpoint {
+                                       slave-mode;
+                                       remote-endpoint = <&cluster1_etm3_out_port>;
+                               };
+                       };
+               };
+       };
+
+       etm3: etm@23140000 {
+               compatible = "arm,coresight-etm4x", "arm,primecell";
+               reg = <0 0x23140000 0 0x1000>;
+
+               clocks = <&soc_smc50mhz>;
+               clock-names = "apb_pclk";
+               power-domains = <&scpi_devpd 0>;
+               port {
+                       cluster1_etm1_out_port: endpoint {
+                               remote-endpoint = <&cluster1_funnel_in_port1>;
+                       };
+               };
+       };
+
+       etm4: etm@23240000 {
+               compatible = "arm,coresight-etm4x", "arm,primecell";
+               reg = <0 0x23240000 0 0x1000>;
+
+               clocks = <&soc_smc50mhz>;
+               clock-names = "apb_pclk";
+               power-domains = <&scpi_devpd 0>;
+               port {
+                       cluster1_etm2_out_port: endpoint {
+                               remote-endpoint = <&cluster1_funnel_in_port2>;
+                       };
+               };
+       };
+
+       etm5: etm@23340000 {
+               compatible = "arm,coresight-etm4x", "arm,primecell";
+               reg = <0 0x23340000 0 0x1000>;
+
+               clocks = <&soc_smc50mhz>;
+               clock-names = "apb_pclk";
+               power-domains = <&scpi_devpd 0>;
+               port {
+                       cluster1_etm3_out_port: endpoint {
+                               remote-endpoint = <&cluster1_funnel_in_port3>;
+                       };
+               };
+       };
+
+       coresight-replicator {
+               /*
+                * Non-configurable replicators don't show up on the
+                * AMBA bus.  As such no need to add "arm,primecell".
+                */
+               compatible = "arm,coresight-replicator";
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       /* replicator output ports */
+                       port@0 {
+                               reg = <0>;
+                               replicator_out_port0: endpoint {
+                                       remote-endpoint = <&tpiu_in_port>;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               replicator_out_port1: endpoint {
+                                       remote-endpoint = <&etr_in_port>;
+                               };
+                       };
+
+                       /* replicator input port */
+                       port@2 {
+                               reg = <0>;
+                               replicator_in_port0: endpoint {
+                                       slave-mode;
+                                       remote-endpoint = <&etf_out_port>;
+                               };
+                       };
+               };
+       };
+
        sram: sram@2e000000 {
                compatible = "arm,juno-sram-ns", "mmio-sram";
                reg = <0x0 0x2e000000 0x0 0x8000>;
                        };
                };
 
+               scpi_devpd: scpi-power-domains {
+                       compatible = "arm,scpi-power-domains";
+                       num-domains = <2>;
+                       #power-domain-cells = <1>;
+               };
+
                scpi_sensors0: sensors {
                        compatible = "arm,scpi-sensors";
                        #thermal-sensor-cells = <1>;
                };
        };
 
+       thermal-zones {
+               pmic {
+                       polling-delay = <1000>;
+                       polling-delay-passive = <100>;
+                       thermal-sensors = <&scpi_sensors0 0>;
+               };
+
+               soc {
+                       polling-delay = <1000>;
+                       polling-delay-passive = <100>;
+                       thermal-sensors = <&scpi_sensors0 3>;
+               };
+
+               big_cluster_thermal_zone: big_cluster {
+                       polling-delay = <1000>;
+                       polling-delay-passive = <100>;
+                       thermal-sensors = <&scpi_sensors0 21>;
+                       status = "disabled";
+               };
+
+               little_cluster_thermal_zone: little_cluster {
+                       polling-delay = <1000>;
+                       polling-delay-passive = <100>;
+                       thermal-sensors = <&scpi_sensors0 22>;
+                       status = "disabled";
+               };
+
+               gpu0_thermal_zone: gpu0 {
+                       polling-delay = <1000>;
+                       polling-delay-passive = <100>;
+                       thermal-sensors = <&scpi_sensors0 23>;
+                       status = "disabled";
+               };
+
+               gpu1_thermal_zone: gpu1 {
+                       polling-delay = <1000>;
+                       polling-delay-passive = <100>;
+                       thermal-sensors = <&scpi_sensors0 24>;
+                       status = "disabled";
+               };
+       };
+
        /include/ "juno-clocks.dtsi"
 
        dma@7ff00000 {
index d95d9e7..123a58b 100644 (file)
 &pcie_ctlr {
        status = "okay";
 };
+
+&etm0 {
+       cpu = <&A57_0>;
+};
+
+&etm1 {
+       cpu = <&A57_1>;
+};
+
+&etm2 {
+       cpu = <&A53_0>;
+};
+
+&etm3 {
+       cpu = <&A53_1>;
+};
+
+&etm4 {
+       cpu = <&A53_2>;
+};
+
+&etm5 {
+       cpu = <&A53_3>;
+};
+
+&big_cluster_thermal_zone {
+       status = "okay";
+};
+
+&little_cluster_thermal_zone {
+       status = "okay";
+};
+
+&gpu0_thermal_zone {
+       status = "okay";
+};
+
+&gpu1_thermal_zone {
+       status = "okay";
+};
index 88ecd61..007be82 100644 (file)
 &pcie_ctlr {
        status = "okay";
 };
+
+&etm0 {
+       cpu = <&A72_0>;
+};
+
+&etm1 {
+       cpu = <&A72_1>;
+};
+
+&etm2 {
+       cpu = <&A53_0>;
+};
+
+&etm3 {
+       cpu = <&A53_1>;
+};
+
+&etm4 {
+       cpu = <&A53_2>;
+};
+
+&etm5 {
+       cpu = <&A53_3>;
+};
+
+&big_cluster_thermal_zone {
+       status = "okay";
+};
+
+&little_cluster_thermal_zone {
+       status = "okay";
+};
+
+&gpu0_thermal_zone {
+       status = "okay";
+};
+
+&gpu1_thermal_zone {
+       status = "okay";
+};
index dcfcf15..a7270ef 100644 (file)
 
        #include "juno-base.dtsi"
 };
+
+&etm0 {
+       cpu = <&A57_0>;
+};
+
+&etm1 {
+       cpu = <&A57_1>;
+};
+
+&etm2 {
+       cpu = <&A53_0>;
+};
+
+&etm3 {
+       cpu = <&A53_1>;
+};
+
+&etm4 {
+       cpu = <&A53_2>;
+};
+
+&etm5 {
+       cpu = <&A53_3>;
+};
index bec1f8b..05faf2a 100644 (file)
@@ -1,3 +1,4 @@
+dtb-$(CONFIG_ARCH_BCM2835) += bcm2837-rpi-3-b.dtb
 dtb-$(CONFIG_ARCH_BCM_IPROC) += ns2-svk.dtb
 dtb-$(CONFIG_ARCH_VULCAN) += vulcan-eval.dtb
 
diff --git a/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts b/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts
new file mode 100644 (file)
index 0000000..6f47dd2
--- /dev/null
@@ -0,0 +1,30 @@
+/dts-v1/;
+#include "bcm2837.dtsi"
+#include "../../../../arm/boot/dts/bcm2835-rpi.dtsi"
+#include "../../../../arm/boot/dts/bcm283x-rpi-smsc9514.dtsi"
+
+/ {
+       compatible = "raspberrypi,3-model-b", "brcm,bcm2837";
+       model = "Raspberry Pi 3 Model B";
+
+       memory {
+               reg = <0 0x40000000>;
+       };
+
+       leds {
+               act {
+                       gpios = <&gpio 47 0>;
+               };
+
+               pwr {
+                       label = "PWR";
+                       gpios = <&gpio 35 0>;
+                       default-state = "keep";
+                       linux,default-trigger = "default-on";
+               };
+       };
+};
+
+&uart1 {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/broadcom/bcm2837.dtsi b/arch/arm64/boot/dts/broadcom/bcm2837.dtsi
new file mode 100644 (file)
index 0000000..f2a31d0
--- /dev/null
@@ -0,0 +1,76 @@
+#include "../../../../arm/boot/dts/bcm283x.dtsi"
+
+/ {
+       compatible = "brcm,bcm2836";
+
+       soc {
+               ranges = <0x7e000000 0x3f000000 0x1000000>,
+                        <0x40000000 0x40000000 0x00001000>;
+               dma-ranges = <0xc0000000 0x00000000 0x3f000000>;
+
+               local_intc: local_intc {
+                       compatible = "brcm,bcm2836-l1-intc";
+                       reg = <0x40000000 0x100>;
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+                       interrupt-parent = <&local_intc>;
+               };
+       };
+
+       timer {
+               compatible = "arm,armv7-timer";
+               interrupt-parent = <&local_intc>;
+               interrupts = <0>, // PHYS_SECURE_PPI
+                            <1>, // PHYS_NONSECURE_PPI
+                            <3>, // VIRT_PPI
+                            <2>; // HYP_PPI
+               always-on;
+       };
+
+       cpus: cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu0: cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       reg = <0>;
+                       enable-method = "spin-table";
+                       cpu-release-addr = <0x0 0x000000d8>;
+               };
+
+               cpu1: cpu@1 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       reg = <1>;
+                       enable-method = "spin-table";
+                       cpu-release-addr = <0x0 0x000000e0>;
+               };
+
+               cpu2: cpu@2 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       reg = <2>;
+                       enable-method = "spin-table";
+                       cpu-release-addr = <0x0 0x000000e8>;
+               };
+
+               cpu3: cpu@3 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       reg = <3>;
+                       enable-method = "spin-table";
+                       cpu-release-addr = <0x0 0x000000f0>;
+               };
+       };
+};
+
+/* Make the BCM2835-style global interrupt controller be a child of the
+ * CPU-local interrupt controller.
+ */
+&intc {
+       compatible = "brcm,bcm2836-armctrl-ic";
+       reg = <0x7e00b200 0x200>;
+       interrupt-parent = <&local_intc>;
+       interrupts = <8>;
+};
index 54ca40c..b062a44 100644 (file)
 
        aliases {
                serial0 = &uart3;
+               serial1 = &uart0;
+               serial2 = &uart1;
+               serial3 = &uart2;
        };
 
        chosen {
                stdout-path = "serial0:115200n8";
+               bootargs = "earlycon=uart8250,mmio32,0x66130000";
        };
 
        memory {
        status = "ok";
 };
 
+&uart0 {
+       status = "ok";
+};
+
+&uart1 {
+       status = "ok";
+};
+
+&uart2 {
+       status = "ok";
+};
+
 &uart3 {
        status = "ok";
 };
        };
 };
 
+&sata_phy0 {
+       status = "ok";
+};
+
+&sata_phy1 {
+       status = "ok";
+};
+
+&sata {
+       status = "ok";
+};
+
 &sdio0 {
        status = "ok";
 };
                #size-cells = <1>;
        };
 };
+
+&pinctrl {
+       pinctrl-names = "default";
+       pinctrl-0 = <&nand_sel>;
+       nand_sel: nand_sel {
+               function = "nand";
+               groups = "nand_grp";
+       };
+};
index ec68ec1..d1dc812 100644 (file)
                        mmu-masters;
                };
 
+               pinctrl: pinctrl@6501d130 {
+                       compatible = "brcm,ns2-pinmux";
+                       reg = <0x6501d130 0x08>,
+                             <0x660a0028 0x04>,
+                             <0x660009b0 0x40>;
+               };
+
+               gpio_aon: gpio@65024800 {
+                       compatible = "brcm,iproc-gpio";
+                       reg = <0x65024800 0x50>,
+                             <0x65024008 0x18>;
+                       ngpios = <6>;
+                       #gpio-cells = <2>;
+                       gpio-controller;
+               };
+
                gic: interrupt-controller@65210000 {
                        compatible = "arm,gic-400";
                        #interrupt-cells = <3>;
                                      IRQ_TYPE_LEVEL_HIGH)>;
                };
 
+               cci@65590000 {
+                       compatible = "arm,cci-400";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       reg = <0x65590000 0x1000>;
+                       ranges = <0 0x65590000 0x10000>;
+
+                       pmu@9000 {
+                               compatible = "arm,cci-400-pmu,r1",
+                                            "arm,cci-400-pmu";
+                               reg = <0x9000 0x4000>;
+                               interrupts = <GIC_SPI 344 IRQ_TYPE_LEVEL_HIGH>,
+                                            <GIC_SPI 345 IRQ_TYPE_LEVEL_HIGH>,
+                                            <GIC_SPI 346 IRQ_TYPE_LEVEL_HIGH>,
+                                            <GIC_SPI 347 IRQ_TYPE_LEVEL_HIGH>,
+                                            <GIC_SPI 348 IRQ_TYPE_LEVEL_HIGH>,
+                                            <GIC_SPI 349 IRQ_TYPE_LEVEL_HIGH>;
+                       };
+               };
+
                timer0: timer@66030000 {
                        compatible = "arm,sp804", "arm,primecell";
                        reg = <0x66030000 0x1000>;
                        clock-names = "wdogclk", "apb_pclk";
                };
 
+               gpio_g: gpio@660a0000 {
+                       compatible = "brcm,iproc-gpio";
+                       reg = <0x660a0000 0x50>;
+                       ngpios = <32>;
+                       #gpio-cells = <2>;
+                       gpio-controller;
+                       interrupt-controller;
+                       interrupts = <GIC_SPI 400 IRQ_TYPE_LEVEL_HIGH>;
+               };
+
                i2c1: i2c@660b0000 {
                        compatible = "brcm,iproc-i2c";
                        reg = <0x660b0000 0x100>;
                        status = "disabled";
                };
 
+               uart0: serial@66100000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x66100000 0x100>;
+                       interrupts = <GIC_SPI 390 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&iprocslow>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       status = "disabled";
+               };
+
+               uart1: serial@66110000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x66110000 0x100>;
+                       interrupts = <GIC_SPI 391 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&iprocslow>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       status = "disabled";
+               };
+
+               uart2: serial@66120000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x66120000 0x100>;
+                       interrupts = <GIC_SPI 392 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&iprocslow>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       status = "disabled";
+               };
+
                uart3: serial@66130000 {
                        compatible = "snps,dw-apb-uart";
                        reg = <0x66130000 0x100>;
                        reg = <0x66220000 0x28>;
                };
 
+               sata_phy: sata_phy@663f0100 {
+                       compatible = "brcm,iproc-ns2-sata-phy";
+                       reg = <0x663f0100 0x1f00>,
+                             <0x663f004c 0x10>;
+                       reg-names = "phy", "phy-ctrl";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       sata_phy0: sata-phy@0 {
+                               reg = <0>;
+                               #phy-cells = <0>;
+                               status = "disabled";
+                       };
+
+                       sata_phy1: sata-phy@1 {
+                               reg = <1>;
+                               #phy-cells = <0>;
+                               status = "disabled";
+                       };
+               };
+
+               sata: ahci@663f2000 {
+                       compatible = "brcm,iproc-ahci", "generic-ahci";
+                       reg = <0x663f2000 0x1000>;
+                       reg-names = "ahci";
+                       interrupts = <GIC_SPI 438 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+
+                       sata0: sata-port@0 {
+                               reg = <0>;
+                               phys = <&sata_phy0>;
+                               phy-names = "sata-phy";
+                       };
+
+                       sata1: sata-port@1 {
+                               reg = <1>;
+                               phys = <&sata_phy1>;
+                               phy-names = "sata-phy";
+                       };
+               };
+
                sdio0: sdhci@66420000 {
                        compatible = "brcm,sdhci-iproc-cygnus";
                        reg = <0x66420000 0x100>;
index d8767b0..299f3ce 100644 (file)
 
                        buck2_reg: BUCK2 {
                                regulator-name = "vdd_atlas";
-                               regulator-min-microvolt = <1200000>;
+                               regulator-min-microvolt = <500000>;
                                regulator-max-microvolt = <1200000>;
                                regulator-always-on;
                                regulator-boot-on;
index de0323b..19572d8 100644 (file)
@@ -51,7 +51,7 @@
        #size-cells = <2>;
 
        cpus {
-               #address-cells = <2>;
+               #address-cells = <1>;
                #size-cells = <0>;
 
                /*
                cpu0: cpu@0 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a53";
-                       reg = <0x0 0x0>;
+                       reg = <0x0>;
                        clocks = <&clockgen 1 0>;
+                       next-level-cache = <&l2>;
                };
 
                cpu1: cpu@1 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a53";
-                       reg = <0x0 0x1>;
+                       reg = <0x1>;
                        clocks = <&clockgen 1 0>;
+                       next-level-cache = <&l2>;
                };
 
                cpu2: cpu@2 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a53";
-                       reg = <0x0 0x2>;
+                       reg = <0x2>;
                        clocks = <&clockgen 1 0>;
+                       next-level-cache = <&l2>;
                };
 
                cpu3: cpu@3 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a53";
-                       reg = <0x0 0x3>;
+                       reg = <0x3>;
                        clocks = <&clockgen 1 0>;
+                       next-level-cache = <&l2>;
+               };
+
+               l2: l2-cache {
+                       compatible = "cache";
                };
        };
 
                        interrupts = <0 60 0x4>;
                        dr_mode = "host";
                        snps,quirk-frame-length-adjustment = <0x20>;
+                       snps,dis_rxdet_inp3_quirk;
                };
 
                usb1: usb3@3000000 {
                        interrupts = <0 61 0x4>;
                        dr_mode = "host";
                        snps,quirk-frame-length-adjustment = <0x20>;
+                       snps,dis_rxdet_inp3_quirk;
                };
 
                usb2: usb3@3100000 {
                        interrupts = <0 63 0x4>;
                        dr_mode = "host";
                        snps,quirk-frame-length-adjustment = <0x20>;
+                       snps,dis_rxdet_inp3_quirk;
                };
 
                sata: sata@3200000 {
                        #address-cells = <3>;
                        #size-cells = <2>;
                        device_type = "pci";
+                       dma-coherent;
                        num-lanes = <4>;
                        bus-range = <0x0 0xff>;
                        ranges = <0x81000000 0x0 0x00000000 0x40 0x00010000 0x0 0x00010000   /* downstream I/O */
                        #address-cells = <3>;
                        #size-cells = <2>;
                        device_type = "pci";
+                       dma-coherent;
                        num-lanes = <2>;
                        bus-range = <0x0 0xff>;
                        ranges = <0x81000000 0x0 0x00000000 0x48 0x00010000 0x0 0x00010000   /* downstream I/O */
                        #address-cells = <3>;
                        #size-cells = <2>;
                        device_type = "pci";
+                       dma-coherent;
                        num-lanes = <2>;
                        bus-range = <0x0 0xff>;
                        ranges = <0x81000000 0x0 0x00000000 0x50 0x00010000 0x0 0x00010000   /* downstream I/O */
index 3187c82..21023a3 100644 (file)
@@ -51,7 +51,7 @@
        #size-cells = <2>;
 
        cpus {
-               #address-cells = <2>;
+               #address-cells = <1>;
                #size-cells = <0>;
 
                /*
                cpu@0 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a57";
-                       reg = <0x0 0x0>;
+                       reg = <0x0>;
                        clocks = <&clockgen 1 0>;
+                       next-level-cache = <&cluster0_l2>;
                };
 
                cpu@1 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a57";
-                       reg = <0x0 0x1>;
+                       reg = <0x1>;
                        clocks = <&clockgen 1 0>;
+                       next-level-cache = <&cluster0_l2>;
                };
 
                cpu@100 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a57";
-                       reg = <0x0 0x100>;
+                       reg = <0x100>;
                        clocks = <&clockgen 1 1>;
+                       next-level-cache = <&cluster1_l2>;
                };
 
                cpu@101 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a57";
-                       reg = <0x0 0x101>;
+                       reg = <0x101>;
                        clocks = <&clockgen 1 1>;
+                       next-level-cache = <&cluster1_l2>;
                };
 
                cpu@200 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a57";
-                       reg = <0x0 0x200>;
+                       reg = <0x200>;
                        clocks = <&clockgen 1 2>;
+                       next-level-cache = <&cluster2_l2>;
                };
 
                cpu@201 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a57";
-                       reg = <0x0 0x201>;
+                       reg = <0x201>;
                        clocks = <&clockgen 1 2>;
+                       next-level-cache = <&cluster2_l2>;
                };
 
                cpu@300 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a57";
-                       reg = <0x0 0x300>;
+                       reg = <0x300>;
                        clocks = <&clockgen 1 3>;
+                       next-level-cache = <&cluster3_l2>;
                };
 
                cpu@301 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a57";
-                       reg = <0x0 0x301>;
+                       reg = <0x301>;
                        clocks = <&clockgen 1 3>;
+                       next-level-cache = <&cluster3_l2>;
+               };
+
+               cluster0_l2: l2-cache0 {
+                       compatible = "cache";
+               };
+
+               cluster1_l2: l2-cache1 {
+                       compatible = "cache";
+               };
+
+               cluster2_l2: l2-cache2 {
+                       compatible = "cache";
+               };
+
+               cluster3_l2: l2-cache3 {
+                       compatible = "cache";
                };
        };
 
                        interrupts = <0 80 0x4>; /* Level high type */
                        dr_mode = "host";
                        snps,quirk-frame-length-adjustment = <0x20>;
+                       snps,dis_rxdet_inp3_quirk;
                };
 
                usb1: usb3@3110000 {
                        interrupts = <0 81 0x4>; /* Level high type */
                        dr_mode = "host";
                        snps,quirk-frame-length-adjustment = <0x20>;
+                       snps,dis_rxdet_inp3_quirk;
                };
 
                ccn@4000000 {
index e92a30c..593c7e4 100644 (file)
                        status = "ok";
                };
 
+               /*
+                * Legend: proper name = the GPIO line is used as GPIO
+                *         NC = not connected (not routed from the SoC)
+                *         "[PER]" = pin is muxed for peripheral (not GPIO)
+                *         "" = no idea, schematic doesn't say, could be
+                *              unrouted (not connected to any external pin)
+                *         LSEC = Low Speed External Connector
+                *         HSEC = High Speed External Connector
+                *
+                * Pin assignments taken from LeMaker and CircuitCo Schematics
+                * Rev A1.
+                *
+                * For the lines routed to the external connectors the
+                * lines are named after the 96Boards CE Specification 1.0,
+                * Appendix "Expansion Connector Signal Description".
+                *
+                * When the 96Board naming of a line and the schematic name of
+                * the same line are in conflict, the 96Board specification
+                * takes precedence, which means that the external UART on the
+                * LSEC is named UART0 while the schematic and SoC names this
+                * UART2. This is only for the informational lines i.e. "[FOO]",
+                * the GPIO named lines "GPIO-A" thru "GPIO-L" are the only
+                * ones actually used for GPIO.
+                */
+               gpio0: gpio@f8011000 {
+                       gpio-line-names = "PWR_HOLD", "DSI_SEL",
+                       "USB_HUB_RESET_N", "USB_SEL", "HDMI_PD", "WL_REG_ON",
+                       "PWRON_DET", "5V_HUB_EN";
+               };
+
+               gpio1: gpio@f8012000 {
+                       gpio-line-names = "SD_DET", "HDMI_INT", "PMU_IRQ_N",
+                       "WL_HOST_WAKE", "NC", "NC", "NC", "BT_REG_ON";
+               };
+
+               gpio2: gpio@f8013000 {
+                       gpio-line-names =
+                               "GPIO-A", /* LSEC Pin 23: GPIO2_0 */
+                               "GPIO-B", /* LSEC Pin 24: GPIO2_1 */
+                               "GPIO-C", /* LSEC Pin 25: GPIO2_2 */
+                               "GPIO-D", /* LSEC Pin 26: GPIO2_3 */
+                               "GPIO-E", /* LSEC Pin 27: GPIO2_4 */
+                               "USB_ID_DET", "USB_VBUS_DET",
+                               "GPIO-H"; /* LSEC Pin 30: GPIO2_7 */
+               };
+
+               gpio3: gpio@f8014000 {
+                       gpio-line-names = "GPIO3_0", "NC", "NC", "", "NC", "",
+                       "WLAN_ACTIVE", "NC", "NC";
+               };
+
+               gpio4: gpio@f7020000 {
+                       gpio-line-names = "USER_LED1", "USER_LED2", "USER_LED3",
+                       "USER_LED4", "SD_SEL", "NC", "NC", "BT_ACTIVE";
+               };
+
+               gpio5: gpio@f7021000 {
+                       gpio-line-names = "NC", "NC",
+                       "[UART1_RxD]", /* LSEC Pin 11: UART3_RX */
+                       "[UART1_TxD]", /* LSEC Pin 13: UART3_TX */
+                       "[AUX_SSI1]", "NC",
+                       "[PCM_CLK]", /* LSEC Pin 18: MODEM_PCM_XCLK */
+                       "[PCM_FS]"; /* LSEC Pin 16: MODEM_PCM_XFS */
+               };
+
+               gpio6: gpio@f7022000 {
+                       gpio-line-names =
+                       "[SPI0_DIN]", /* Pin 10: SPI0_DI */
+                       "[SPI0_DOUT]", /* Pin 14: SPI0_DO */
+                       "[SPI0_CS]", /* Pin 12: SPI0_CS_N */
+                       "[SPI0_SCLK]", /* Pin 8: SPI0_SCLK */
+                       "NC", "NC", "NC",
+                       "GPIO-G"; /* Pin 29: GPIO6_7_DSI_TE0 */
+               };
+
+               gpio7: gpio@f7023000 {
+                       gpio-line-names = "NC", "NC", "NC", "NC",
+                       "[PCM_DI]", /* Pin 22: MODEM_PCM_DI */
+                       "[PCM_DO]", /* Pin 20: MODEM_PCM_DO */
+                       "NC", "NC";
+               };
+
+               gpio8: gpio@f7024000 {
+                       gpio-line-names = "NC", "[CEC_CLK_19_2MHZ]", "NC",
+                       "", "", "", "", "", "";
+               };
+
+               gpio9: gpio@f7025000 {
+                       gpio-line-names = "",
+                       "GPIO-J", /* LSEC Pin 32: ISP_PWDN0_GPIO9_1 */
+                       "GPIO-L", /* LSEC Pin 34: ISP_PWDN1_GPIO9_2 */
+                       "NC", "NC", "NC", "NC", "[ISP_CCLK0]";
+               };
+
+               gpio10: gpio@f7026000 {
+                       gpio-line-names = "BOOT_SEL",
+                       "[ISP_CCLK1]",
+                       "GPIO-I", /* LSEC Pin 31: ISP_RSTB0_GPIO10_2 */
+                       "GPIO-K", /* LSEC Pin 33: ISP_RSTB1_GPIO10_3 */
+                       "NC", "NC",
+                       "[I2C2_SDA]", /* HSEC Pin 34: ISP0_SDA */
+                       "[I2C2_SCL]"; /* HSEC Pin 32: ISP0_SCL */
+               };
+
+               gpio11: gpio@f7027000 {
+                       gpio-line-names =
+                       "[I2C3_SDA]", /* HSEC Pin 38: ISP1_SDA */
+                       "[I2C3_SCL]", /* HSEC Pin 36: ISP1_SCL */
+                       "", "NC", "NC", "NC", "", "";
+               };
+
+               gpio12: gpio@f7028000 {
+                       gpio-line-names = "[BT_PCM_XFS]", "[BT_PCM_DI]",
+                       "[BT_PCM_DO]",
+                       "NC", "NC", "NC", "NC",
+                       "GPIO-F"; /* LSEC Pin 28: BL_PWM_GPIO12_7 */
+               };
+
+               gpio13: gpio@f7029000 {
+                       gpio-line-names = "[UART0_RX]", "[UART0_TX]",
+                       "[BT_UART1_CTS]", "[BT_UART1_RTS]",
+                       "[BT_UART1_RX]", "[BT_UART1_TX]",
+                       "[UART0_CTS]", /* LSEC Pin 3: UART2_CTS_N */
+                       "[UART0_RTS]"; /* LSEC Pin 9: UART2_RTS_N */
+               };
+
+               gpio14: gpio@f702a000 {
+                       gpio-line-names =
+                       "[UART0_RxD]", /* LSEC Pin 7: UART2_RX */
+                       "[UART0_TxD]", /* LSEC Pin 5: UART2_TX */
+                       "[I2C0_SCL]", /* LSEC Pin 15: I2C0_SCL */
+                       "[I2C0_SDA]", /* LSEC Pin 17: I2C0_SDA */
+                       "[I2C1_SCL]", /* LSEC Pin 19: I2C1_SCL */
+                       "[I2C1_SDA]", /* LSEC Pin 21: I2C1_SDA */
+                       "[I2C2_SCL]", "[I2C2_SDA]";
+               };
+
+               gpio15: gpio@f702b000 {
+                       gpio-line-names = "", "", "", "", "", "", "NC", "";
+               };
+
+               /* GPIO blocks 16 thru 19 do not appear to be routed to pins */
+
                dwmmc_2: dwmmc2@f723f000 {
                        ti,non-removable;
                        non-removable;
index b0cc649..5c7b54c 100644 (file)
@@ -1,4 +1,5 @@
 dtb-$(CONFIG_ARCH_LG1K) += lg1312-ref.dtb
+dtb-$(CONFIG_ARCH_LG1K) += lg1313-ref.dtb
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
diff --git a/arch/arm64/boot/dts/lg/lg1313-ref.dts b/arch/arm64/boot/dts/lg/lg1313-ref.dts
new file mode 100644 (file)
index 0000000..df0ece4
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * dts file for lg1313 Reference Board.
+ *
+ * Copyright (C) 2016, LG Electronics
+ */
+
+/dts-v1/;
+
+#include "lg1313.dtsi"
+
+/ {
+       #address-cells = <2>;
+       #size-cells = <1>;
+
+       model = "LG Electronics, DTV SoC LG1313 Reference Board";
+       compatible = "lge,lg1313-ref", "lge,lg1313";
+
+       aliases {
+               serial0 = &uart0;
+               serial1 = &uart1;
+               serial2 = &uart2;
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0x0 0x00000000 0x20000000>;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/lg/lg1313.dtsi b/arch/arm64/boot/dts/lg/lg1313.dtsi
new file mode 100644 (file)
index 0000000..e703e11
--- /dev/null
@@ -0,0 +1,351 @@
+/*
+ * dts file for lg1313 SoC
+ *
+ * Copyright (C) 2016, LG Electronics
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       compatible = "lge,lg1313";
+       interrupt-parent = <&gic>;
+
+       cpus {
+               #address-cells = <2>;
+               #size-cells = <0>;
+
+               cpu0: cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53", "arm,armv8";
+                       reg = <0x0 0x0>;
+                       next-level-cache = <&L2_0>;
+               };
+               cpu1: cpu@1 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53", "arm,armv8";
+                       reg = <0x0 0x1>;
+                       enable-method = "psci";
+                       next-level-cache = <&L2_0>;
+               };
+               cpu2: cpu@2 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53", "arm,armv8";
+                       reg = <0x0 0x2>;
+                       enable-method = "psci";
+                       next-level-cache = <&L2_0>;
+               };
+               cpu3: cpu@3 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53", "arm,armv8";
+                       reg = <0x0 0x3>;
+                       enable-method = "psci";
+                       next-level-cache = <&L2_0>;
+               };
+               L2_0: l2-cache0 {
+                       compatible = "cache";
+               };
+       };
+
+       psci {
+               compatible  = "arm,psci-0.2", "arm,psci";
+               method = "smc";
+               cpu_suspend = <0x84000001>;
+               cpu_off = <0x84000002>;
+               cpu_on = <0x84000003>;
+       };
+
+       gic: interrupt-controller@c0001000 {
+               #interrupt-cells = <3>;
+               compatible = "arm,gic-400";
+               interrupt-controller;
+               reg = <0x0 0xc0001000 0x1000>,
+                     <0x0 0xc0002000 0x2000>,
+                     <0x0 0xc0004000 0x2000>,
+                     <0x0 0xc0006000 0x2000>;
+       };
+
+       pmu {
+               compatible = "arm,cortex-a53-pmu";
+               interrupts = <GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 151 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-affinity = <&cpu0>,
+                                    <&cpu1>,
+                                    <&cpu2>,
+                                    <&cpu3>;
+       };
+
+       timer {
+               compatible = "arm,armv8-timer";
+               interrupts = <GIC_PPI 13 (GIC_CPU_MASK_RAW(0x0f) |
+                             IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 14 (GIC_CPU_MASK_RAW(0x0f) |
+                             IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 11 (GIC_CPU_MASK_RAW(0x0f) |
+                             IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 10 (GIC_CPU_MASK_RAW(0x0f) |
+                             IRQ_TYPE_LEVEL_LOW)>;
+       };
+
+       clk_bus: clk_bus {
+               #clock-cells = <0>;
+
+               compatible = "fixed-clock";
+               clock-frequency = <198000000>;
+               clock-output-names = "BUSCLK";
+       };
+
+       soc {
+               #address-cells = <2>;
+               #size-cells = <1>;
+
+               compatible = "simple-bus";
+               interrupt-parent = <&gic>;
+               ranges;
+
+               eth0: ethernet@c3700000 {
+                       compatible = "cdns,gem";
+                       reg = <0x0 0xc3700000 0x1000>;
+                       interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clk_bus>, <&clk_bus>;
+                       clock-names = "hclk", "pclk";
+                       phy-mode = "rmii";
+                       /* Filled in by boot */
+                       mac-address = [ 00 00 00 00 00 00 ];
+               };
+       };
+
+       amba {
+               #address-cells = <2>;
+               #size-cells = <1>;
+               #interrupts-cells = <3>;
+
+               compatible = "simple-bus";
+               interrupt-parent = <&gic>;
+               ranges;
+
+               timers: timer@fd100000 {
+                       compatible = "arm,sp804";
+                       reg = <0x0 0xfd100000 0x1000>;
+                       interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+               };
+               wdog: watchdog@fd200000 {
+                       compatible = "arm,sp805", "arm,primecell";
+                       reg = <0x0 0xfd200000 0x1000>;
+                       interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+               };
+               uart0: serial@fe000000 {
+                       compatible = "arm,pl011", "arm,primecell";
+                       reg = <0x0 0xfe000000 0x1000>;
+                       interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+                       status="disabled";
+               };
+               uart1: serial@fe100000 {
+                       compatible = "arm,pl011", "arm,primecell";
+                       reg = <0x0 0xfe100000 0x1000>;
+                       interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+                       status="disabled";
+               };
+               uart2: serial@fe200000 {
+                       compatible = "arm,pl011", "arm,primecell";
+                       reg = <0x0 0xfe200000 0x1000>;
+                       interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+                       status="disabled";
+               };
+               spi0: ssp@fe800000 {
+                       compatible = "arm,pl022", "arm,primecell";
+                       reg = <0x0 0xfe800000 0x1000>;
+                       interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+               };
+               spi1: ssp@fe900000 {
+                       compatible = "arm,pl022", "arm,primecell";
+                       reg = <0x0 0xfe900000 0x1000>;
+                       interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+               };
+               dmac0: dma@c1128000 {
+                       compatible = "arm,pl330", "arm,primecell";
+                       reg = <0x0 0xc1128000 0x1000>;
+                       interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+               };
+               gpio0: gpio@fd400000 {
+                       #gpio-cells = <2>;
+                       compatible = "arm,pl061", "arm,primecell";
+                       gpio-controller;
+                       reg = <0x0 0xfd400000 0x1000>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+                       status="disabled";
+               };
+               gpio1: gpio@fd410000 {
+                       #gpio-cells = <2>;
+                       compatible = "arm,pl061", "arm,primecell";
+                       gpio-controller;
+                       reg = <0x0 0xfd410000 0x1000>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+                       status="disabled";
+               };
+               gpio2: gpio@fd420000 {
+                       #gpio-cells = <2>;
+                       compatible = "arm,pl061", "arm,primecell";
+                       gpio-controller;
+                       reg = <0x0 0xfd420000 0x1000>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+                       status="disabled";
+               };
+               gpio3: gpio@fd430000 {
+                       #gpio-cells = <2>;
+                       compatible = "arm,pl061", "arm,primecell";
+                       gpio-controller;
+                       reg = <0x0 0xfd430000 0x1000>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+               };
+               gpio4: gpio@fd440000 {
+                       #gpio-cells = <2>;
+                       compatible = "arm,pl061", "arm,primecell";
+                       gpio-controller;
+                       reg = <0x0 0xfd440000 0x1000>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+                       status="disabled";
+               };
+               gpio5: gpio@fd450000 {
+                       #gpio-cells = <2>;
+                       compatible = "arm,pl061", "arm,primecell";
+                       gpio-controller;
+                       reg = <0x0 0xfd450000 0x1000>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+                       status="disabled";
+               };
+               gpio6: gpio@fd460000 {
+                       #gpio-cells = <2>;
+                       compatible = "arm,pl061", "arm,primecell";
+                       gpio-controller;
+                       reg = <0x0 0xfd460000 0x1000>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+                       status="disabled";
+               };
+               gpio7: gpio@fd470000 {
+                       #gpio-cells = <2>;
+                       compatible = "arm,pl061", "arm,primecell";
+                       gpio-controller;
+                       reg = <0x0 0xfd470000 0x1000>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+                       status="disabled";
+               };
+               gpio8: gpio@fd480000 {
+                       #gpio-cells = <2>;
+                       compatible = "arm,pl061", "arm,primecell";
+                       gpio-controller;
+                       reg = <0x0 0xfd480000 0x1000>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+                       status="disabled";
+               };
+               gpio9: gpio@fd490000 {
+                       #gpio-cells = <2>;
+                       compatible = "arm,pl061", "arm,primecell";
+                       gpio-controller;
+                       reg = <0x0 0xfd490000 0x1000>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+                       status="disabled";
+               };
+               gpio10: gpio@fd4a0000 {
+                       #gpio-cells = <2>;
+                       compatible = "arm,pl061", "arm,primecell";
+                       gpio-controller;
+                       reg = <0x0 0xfd4a0000 0x1000>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+                       status="disabled";
+               };
+               gpio11: gpio@fd4b0000 {
+                       #gpio-cells = <2>;
+                       compatible = "arm,pl061", "arm,primecell";
+                       gpio-controller;
+                       reg = <0x0 0xfd4b0000 0x1000>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+               };
+               gpio12: gpio@fd4c0000 {
+                       #gpio-cells = <2>;
+                       compatible = "arm,pl061", "arm,primecell";
+                       gpio-controller;
+                       reg = <0x0 0xfd4c0000 0x1000>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+                       status="disabled";
+               };
+               gpio13: gpio@fd4d0000 {
+                       #gpio-cells = <2>;
+                       compatible = "arm,pl061", "arm,primecell";
+                       gpio-controller;
+                       reg = <0x0 0xfd4d0000 0x1000>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+                       status="disabled";
+               };
+               gpio14: gpio@fd4e0000 {
+                       #gpio-cells = <2>;
+                       compatible = "arm,pl061", "arm,primecell";
+                       gpio-controller;
+                       reg = <0x0 0xfd4e0000 0x1000>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+                       status="disabled";
+               };
+               gpio15: gpio@fd4f0000 {
+                       #gpio-cells = <2>;
+                       compatible = "arm,pl061", "arm,primecell";
+                       gpio-controller;
+                       reg = <0x0 0xfd4f0000 0x1000>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+                       status="disabled";
+               };
+               gpio16: gpio@fd500000 {
+                       #gpio-cells = <2>;
+                       compatible = "arm,pl061", "arm,primecell";
+                       gpio-controller;
+                       reg = <0x0 0xfd500000 0x1000>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+                       status="disabled";
+               };
+               gpio17: gpio@fd510000 {
+                       #gpio-cells = <2>;
+                       compatible = "arm,pl061", "arm,primecell";
+                       gpio-controller;
+                       reg = <0x0 0xfd510000 0x1000>;
+                       clocks = <&clk_bus>;
+                       clock-names = "apb_pclk";
+               };
+       };
+};
index 9e2efb8..eb29280 100644 (file)
                                status = "disabled";
                        };
 
+                       nb_perih_clk: nb-periph-clk@13000{
+                               compatible = "marvell,armada-3700-periph-clock-nb";
+                               reg = <0x13000 0x100>;
+                               clocks = <&tbg 0>, <&tbg 1>, <&tbg 2>,
+                               <&tbg 3>, <&xtalclk>;
+                               #clock-cells = <1>;
+                       };
+
+                       sb_perih_clk: sb-periph-clk@18000{
+                               compatible = "marvell,armada-3700-periph-clock-sb";
+                               reg = <0x18000 0x100>;
+                               clocks = <&tbg 0>, <&tbg 1>, <&tbg 2>,
+                               <&tbg 3>, <&xtalclk>;
+                               #clock-cells = <1>;
+                       };
+
+                       tbg: tbg@13200 {
+                               compatible = "marvell,armada-3700-tbg-clock";
+                               reg = <0x13200 0x100>;
+                               clocks = <&xtalclk>;
+                               #clock-cells = <1>;
+                       };
+
+                       gpio1: gpio@13800 {
+                               compatible = "marvell,mvebu-gpio-3700",
+                               "syscon", "simple-mfd";
+                               reg = <0x13800 0x500>;
+
+                               xtalclk: xtal-clk {
+                                       compatible = "marvell,armada-3700-xtal-clock";
+                                       clock-output-names = "xtal";
+                                       #clock-cells = <0>;
+                               };
+                       };
+
                        usb3: usb@58000 {
                                compatible = "marvell,armada3700-xhci",
                                "generic-xhci";
index 20d256b..eab1a42 100644 (file)
                        };
 
                        xor@400000 {
-                               compatible = "marvell,mv-xor-v2";
+                               compatible = "marvell,armada-7k-xor", "marvell,xor-v2";
                                reg = <0x400000 0x1000>,
                                      <0x410000 0x1000>;
                                msi-parent = <&gic_v2m0>;
                        };
 
                        xor@420000 {
-                               compatible = "marvell,mv-xor-v2";
+                               compatible = "marvell,armada-7k-xor", "marvell,xor-v2";
                                reg = <0x420000 0x1000>,
                                      <0x430000 0x1000>;
                                msi-parent = <&gic_v2m0>;
                        };
 
                        xor@440000 {
-                               compatible = "marvell,mv-xor-v2";
+                               compatible = "marvell,armada-7k-xor", "marvell,xor-v2";
                                reg = <0x440000 0x1000>,
                                      <0x450000 0x1000>;
                                msi-parent = <&gic_v2m0>;
                        };
 
                        xor@460000 {
-                               compatible = "marvell,mv-xor-v2";
+                               compatible = "marvell,armada-7k-xor", "marvell,xor-v2";
                                reg = <0x460000 0x1000>,
                                      <0x470000 0x1000>;
                                msi-parent = <&gic_v2m0>;
index 367138b..da31bbb 100644 (file)
                                status = "disabled";
                        };
 
+                       cpm_xor0: xor@6a0000 {
+                               compatible = "marvell,armada-7k-xor", "marvell,xor-v2";
+                               reg = <0x6a0000 0x1000>,
+                                     <0x6b0000 0x1000>;
+                               dma-coherent;
+                               msi-parent = <&gic_v2m0>;
+                               clocks = <&cpm_syscon0 1 8>;
+                       };
+
+                       cpm_xor1: xor@6c0000 {
+                               compatible = "marvell,armada-7k-xor", "marvell,xor-v2";
+                               reg = <0x6c0000 0x1000>,
+                                     <0x6d0000 0x1000>;
+                               dma-coherent;
+                               msi-parent = <&gic_v2m0>;
+                               clocks = <&cpm_syscon0 1 7>;
+                       };
+
                        cpm_spi0: spi@700600 {
                                compatible = "marvell,armada-380-spi";
                                reg = <0x700600 0x50>;
index e0a4bff..9fbfd32 100644 (file)
@@ -1,3 +1,4 @@
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt6755-evb.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt6795-evb.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8173-evb.dtb
 
diff --git a/arch/arm64/boot/dts/mediatek/mt6755-evb.dts b/arch/arm64/boot/dts/mediatek/mt6755-evb.dts
new file mode 100644 (file)
index 0000000..c568d49
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2016 MediaTek Inc.
+ * Author: Mars.C <mars.cheng@mediatek.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+/dts-v1/;
+#include "mt6755.dtsi"
+
+/ {
+       model = "MediaTek MT6755 EVB";
+       compatible = "mediatek,mt6755-evb", "mediatek,mt6755";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       memory@40000000 {
+               device_type = "memory";
+               reg = <0 0x40000000 0 0x1e800000>;
+       };
+
+       chosen {
+               stdout-path = "serial0:921600n8";
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/mediatek/mt6755.dtsi b/arch/arm64/boot/dts/mediatek/mt6755.dtsi
new file mode 100644 (file)
index 0000000..01ba776
--- /dev/null
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2016 MediaTek Inc.
+ * Author: Mars.C <mars.cheng@mediatek.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+       compatible = "mediatek,mt6755";
+       interrupt-parent = <&sysirq>;
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu0: cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       enable-method = "psci";
+                       reg = <0x000>;
+               };
+
+               cpu1: cpu@1 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       enable-method = "psci";
+                       reg = <0x001>;
+               };
+
+               cpu2: cpu@2 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       enable-method = "psci";
+                       reg = <0x002>;
+               };
+
+               cpu3: cpu@3 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       enable-method = "psci";
+                       reg = <0x003>;
+               };
+
+               cpu4: cpu@100 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       enable-method = "psci";
+                       reg = <0x100>;
+               };
+
+               cpu5: cpu@101 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       enable-method = "psci";
+                       reg = <0x101>;
+               };
+
+               cpu6: cpu@102 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       enable-method = "psci";
+                       reg = <0x102>;
+               };
+
+               cpu7: cpu@103 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a53";
+                       enable-method = "psci";
+                       reg = <0x103>;
+               };
+       };
+
+       uart_clk: dummy26m {
+               compatible = "fixed-clock";
+               clock-frequency = <26000000>;
+               #clock-cells = <0>;
+       };
+
+       timer {
+               compatible = "arm,armv8-timer";
+               interrupt-parent = <&gic>;
+               interrupts = <GIC_PPI 13
+                            (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 14
+                            (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 11
+                            (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 10
+                            (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>;
+       };
+
+       sysirq: intpol-controller@10200620 {
+               compatible = "mediatek,mt6755-sysirq",
+                            "mediatek,mt6577-sysirq";
+               interrupt-controller;
+               #interrupt-cells = <3>;
+               interrupt-parent = <&gic>;
+               reg = <0 0x10200620 0 0x20>;
+       };
+
+       gic: interrupt-controller@10231000 {
+               compatible = "arm,gic-400";
+               #interrupt-cells = <3>;
+               interrupt-parent = <&gic>;
+               interrupt-controller;
+               reg = <0 0x10231000 0 0x1000>,
+                     <0 0x10232000 0 0x2000>,
+                     <0 0x10234000 0 0x2000>,
+                     <0 0x10236000 0 0x2000>;
+       };
+
+       uart0: serial@11002000 {
+               compatible = "mediatek,mt6755-uart",
+                            "mediatek,mt6577-uart";
+               reg = <0 0x11002000 0 0x400>;
+               interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_LOW>;
+               clocks = <&uart_clk>;
+               status = "disabled";
+       };
+
+       uart1: serial@11003000 {
+               compatible = "mediatek,mt6755-uart",
+                            "mediatek,mt6577-uart";
+               reg = <0 0x11003000 0 0x400>;
+               interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_LOW>;
+               clocks = <&uart_clk>;
+               status = "disabled";
+       };
+};
index 05f89c4..78529e4 100644 (file)
        #address-cells = <2>;
        #size-cells = <2>;
 
+       aliases {
+               ovl0 = &ovl0;
+               ovl1 = &ovl1;
+               rdma0 = &rdma0;
+               rdma1 = &rdma1;
+               rdma2 = &rdma2;
+               wdma0 = &wdma0;
+               wdma1 = &wdma1;
+               color0 = &color0;
+               color1 = &color1;
+               split0 = &split0;
+               split1 = &split1;
+               dpi0 = &dpi0;
+               dsi0 = &dsi0;
+               dsi1 = &dsi1;
+       };
+
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
                        #clock-cells = <1>;
                };
 
+               mipi_tx0: mipi-dphy@10215000 {
+                       compatible = "mediatek,mt8173-mipi-tx";
+                       reg = <0 0x10215000 0 0x1000>;
+                       clocks = <&clk26m>;
+                       clock-output-names = "mipi_tx0_pll";
+                       #clock-cells = <0>;
+                       #phy-cells = <0>;
+                       status = "disabled";
+               };
+
+               mipi_tx1: mipi-dphy@10216000 {
+                       compatible = "mediatek,mt8173-mipi-tx";
+                       reg = <0 0x10216000 0 0x1000>;
+                       clocks = <&clk26m>;
+                       clock-output-names = "mipi_tx1_pll";
+                       #clock-cells = <0>;
+                       #phy-cells = <0>;
+                       status = "disabled";
+               };
+
                gic: interrupt-controller@10220000 {
                        compatible = "arm,gic-400";
                        #interrupt-cells = <3>;
                mmsys: clock-controller@14000000 {
                        compatible = "mediatek,mt8173-mmsys", "syscon";
                        reg = <0 0x14000000 0 0x1000>;
+                       power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
                        #clock-cells = <1>;
                };
 
+               ovl0: ovl@1400c000 {
+                       compatible = "mediatek,mt8173-disp-ovl";
+                       reg = <0 0x1400c000 0 0x1000>;
+                       interrupts = <GIC_SPI 180 IRQ_TYPE_LEVEL_LOW>;
+                       power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
+                       clocks = <&mmsys CLK_MM_DISP_OVL0>;
+                       iommus = <&iommu M4U_PORT_DISP_OVL0>;
+                       mediatek,larb = <&larb0>;
+               };
+
+               ovl1: ovl@1400d000 {
+                       compatible = "mediatek,mt8173-disp-ovl";
+                       reg = <0 0x1400d000 0 0x1000>;
+                       interrupts = <GIC_SPI 181 IRQ_TYPE_LEVEL_LOW>;
+                       power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
+                       clocks = <&mmsys CLK_MM_DISP_OVL1>;
+                       iommus = <&iommu M4U_PORT_DISP_OVL1>;
+                       mediatek,larb = <&larb4>;
+               };
+
+               rdma0: rdma@1400e000 {
+                       compatible = "mediatek,mt8173-disp-rdma";
+                       reg = <0 0x1400e000 0 0x1000>;
+                       interrupts = <GIC_SPI 182 IRQ_TYPE_LEVEL_LOW>;
+                       power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
+                       clocks = <&mmsys CLK_MM_DISP_RDMA0>;
+                       iommus = <&iommu M4U_PORT_DISP_RDMA0>;
+                       mediatek,larb = <&larb0>;
+               };
+
+               rdma1: rdma@1400f000 {
+                       compatible = "mediatek,mt8173-disp-rdma";
+                       reg = <0 0x1400f000 0 0x1000>;
+                       interrupts = <GIC_SPI 183 IRQ_TYPE_LEVEL_LOW>;
+                       power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
+                       clocks = <&mmsys CLK_MM_DISP_RDMA1>;
+                       iommus = <&iommu M4U_PORT_DISP_RDMA1>;
+                       mediatek,larb = <&larb4>;
+               };
+
+               rdma2: rdma@14010000 {
+                       compatible = "mediatek,mt8173-disp-rdma";
+                       reg = <0 0x14010000 0 0x1000>;
+                       interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_LOW>;
+                       power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
+                       clocks = <&mmsys CLK_MM_DISP_RDMA2>;
+                       iommus = <&iommu M4U_PORT_DISP_RDMA2>;
+                       mediatek,larb = <&larb4>;
+               };
+
+               wdma0: wdma@14011000 {
+                       compatible = "mediatek,mt8173-disp-wdma";
+                       reg = <0 0x14011000 0 0x1000>;
+                       interrupts = <GIC_SPI 185 IRQ_TYPE_LEVEL_LOW>;
+                       power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
+                       clocks = <&mmsys CLK_MM_DISP_WDMA0>;
+                       iommus = <&iommu M4U_PORT_DISP_WDMA0>;
+                       mediatek,larb = <&larb0>;
+               };
+
+               wdma1: wdma@14012000 {
+                       compatible = "mediatek,mt8173-disp-wdma";
+                       reg = <0 0x14012000 0 0x1000>;
+                       interrupts = <GIC_SPI 186 IRQ_TYPE_LEVEL_LOW>;
+                       power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
+                       clocks = <&mmsys CLK_MM_DISP_WDMA1>;
+                       iommus = <&iommu M4U_PORT_DISP_WDMA1>;
+                       mediatek,larb = <&larb4>;
+               };
+
+               color0: color@14013000 {
+                       compatible = "mediatek,mt8173-disp-color";
+                       reg = <0 0x14013000 0 0x1000>;
+                       interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_LOW>;
+                       power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
+                       clocks = <&mmsys CLK_MM_DISP_COLOR0>;
+               };
+
+               color1: color@14014000 {
+                       compatible = "mediatek,mt8173-disp-color";
+                       reg = <0 0x14014000 0 0x1000>;
+                       interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_LOW>;
+                       power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
+                       clocks = <&mmsys CLK_MM_DISP_COLOR1>;
+               };
+
+               aal@14015000 {
+                       compatible = "mediatek,mt8173-disp-aal";
+                       reg = <0 0x14015000 0 0x1000>;
+                       interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_LOW>;
+                       power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
+                       clocks = <&mmsys CLK_MM_DISP_AAL>;
+               };
+
+               gamma@14016000 {
+                       compatible = "mediatek,mt8173-disp-gamma";
+                       reg = <0 0x14016000 0 0x1000>;
+                       interrupts = <GIC_SPI 190 IRQ_TYPE_LEVEL_LOW>;
+                       power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
+                       clocks = <&mmsys CLK_MM_DISP_GAMMA>;
+               };
+
+               merge@14017000 {
+                       compatible = "mediatek,mt8173-disp-merge";
+                       reg = <0 0x14017000 0 0x1000>;
+                       power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
+                       clocks = <&mmsys CLK_MM_DISP_MERGE>;
+               };
+
+               split0: split@14018000 {
+                       compatible = "mediatek,mt8173-disp-split";
+                       reg = <0 0x14018000 0 0x1000>;
+                       power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
+                       clocks = <&mmsys CLK_MM_DISP_SPLIT0>;
+               };
+
+               split1: split@14019000 {
+                       compatible = "mediatek,mt8173-disp-split";
+                       reg = <0 0x14019000 0 0x1000>;
+                       power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
+                       clocks = <&mmsys CLK_MM_DISP_SPLIT1>;
+               };
+
+               ufoe@1401a000 {
+                       compatible = "mediatek,mt8173-disp-ufoe";
+                       reg = <0 0x1401a000 0 0x1000>;
+                       interrupts = <GIC_SPI 191 IRQ_TYPE_LEVEL_LOW>;
+                       power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
+                       clocks = <&mmsys CLK_MM_DISP_UFOE>;
+               };
+
+               dsi0: dsi@1401b000 {
+                       compatible = "mediatek,mt8173-dsi";
+                       reg = <0 0x1401b000 0 0x1000>;
+                       interrupts = <GIC_SPI 192 IRQ_TYPE_LEVEL_LOW>;
+                       power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
+                       clocks = <&mmsys CLK_MM_DSI0_ENGINE>,
+                                <&mmsys CLK_MM_DSI0_DIGITAL>,
+                                <&mipi_tx0>;
+                       clock-names = "engine", "digital", "hs";
+                       phys = <&mipi_tx0>;
+                       phy-names = "dphy";
+                       status = "disabled";
+               };
+
+               dsi1: dsi@1401c000 {
+                       compatible = "mediatek,mt8173-dsi";
+                       reg = <0 0x1401c000 0 0x1000>;
+                       interrupts = <GIC_SPI 193 IRQ_TYPE_LEVEL_LOW>;
+                       power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
+                       clocks = <&mmsys CLK_MM_DSI1_ENGINE>,
+                                <&mmsys CLK_MM_DSI1_DIGITAL>,
+                                <&mipi_tx1>;
+                       clock-names = "engine", "digital", "hs";
+                       phy = <&mipi_tx1>;
+                       phy-names = "dphy";
+                       status = "disabled";
+               };
+
+               dpi0: dpi@1401d000 {
+                       compatible = "mediatek,mt8173-dpi";
+                       reg = <0 0x1401d000 0 0x1000>;
+                       interrupts = <GIC_SPI 194 IRQ_TYPE_LEVEL_LOW>;
+                       power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
+                       clocks = <&mmsys CLK_MM_DPI_PIXEL>,
+                                <&mmsys CLK_MM_DPI_ENGINE>,
+                                <&apmixedsys CLK_APMIXED_TVDPLL>;
+                       clock-names = "pixel", "engine", "pll";
+                       status = "disabled";
+               };
+
                pwm0: pwm@1401e000 {
                        compatible = "mediatek,mt8173-disp-pwm",
                                     "mediatek,mt6595-disp-pwm";
                        status = "disabled";
                };
 
+               mutex: mutex@14020000 {
+                       compatible = "mediatek,mt8173-disp-mutex";
+                       reg = <0 0x14020000 0 0x1000>;
+                       interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_LOW>;
+                       power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
+                       clocks = <&mmsys CLK_MM_MUTEX_32K>;
+               };
+
                larb0: larb@14021000 {
                        compatible = "mediatek,mt8173-smi-larb";
                        reg = <0 0x14021000 0 0x1000>;
                        clock-names = "apb", "smi";
                };
 
+               od@14023000 {
+                       compatible = "mediatek,mt8173-disp-od";
+                       reg = <0 0x14023000 0 0x1000>;
+                       clocks = <&mmsys CLK_MM_DISP_OD>;
+               };
+
                larb4: larb@14027000 {
                        compatible = "mediatek,mt8173-smi-larb";
                        reg = <0 0x14027000 0 0x1000>;
index 205ef89..18639bc 100644 (file)
        };
 
        soc {
+               dma@7884000 {
+                       status = "okay";
+               };
+
                serial@78af000 {
                        label = "LS-UART0";
                        status = "okay";
                        status = "okay";
                };
 
+               sdhci@07864000 {
+                       vmmc-supply = <&pm8916_l11>;
+                       vqmmc-supply = <&pm8916_l12>;
+
+                       pinctrl-names = "default", "sleep";
+                       pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
+                       pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
+
+                       cd-gpios = <&msmgpio 38 0x1>;
+                       status = "okay";
+               };
+
                usb@78d9000 {
                        extcon = <&usb_id>, <&usb_id>;
                        status = "okay";
index 9681200..11bdc24 100644 (file)
                #size-cells = <2>;
                ranges;
 
-               reserve_aligned@86000000 {
-                       reg = <0x0 0x86000000 0x0 0x0300000>;
+               tz-apps@86000000 {
+                       reg = <0x0 0x86000000 0x0 0x300000>;
                        no-map;
                };
 
                smem_mem: smem_region@86300000 {
-                       reg = <0x0 0x86300000 0x0 0x0100000>;
+                       reg = <0x0 0x86300000 0x0 0x100000>;
+                       no-map;
+               };
+
+               hypervisor@86400000 {
+                       reg = <0x0 0x86400000 0x0 0x100000>;
+                       no-map;
+               };
+
+               tz@86500000 {
+                       reg = <0x0 0x86500000 0x0 0x180000>;
+                       no-map;
+               };
+
+               reserved@8668000 {
+                       reg = <0x0 0x86680000 0x0 0x80000>;
+                       no-map;
+               };
+
+               rmtfs@86700000 {
+                       reg = <0x0 0x86700000 0x0 0xe0000>;
+                       no-map;
+               };
+
+               rfsa@867e00000 {
+                       reg = <0x0 0x867e0000 0x0 0x20000>;
+                       no-map;
+               };
+
+               mpss@86800000 {
+                       reg = <0x0 0x86800000 0x0 0x2b00000>;
+                       no-map;
+               };
+
+               wcnss@89300000 {
+                       reg = <0x0 0x89300000 0x0 0x600000>;
                        no-map;
                };
        };
@@ -62,6 +97,8 @@
                        compatible = "arm,cortex-a53", "arm,armv8";
                        reg = <0x0>;
                        next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+                       cpu-idle-states = <&CPU_SPC>;
                };
 
                CPU1: cpu@1 {
                        compatible = "arm,cortex-a53", "arm,armv8";
                        reg = <0x1>;
                        next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+                       cpu-idle-states = <&CPU_SPC>;
                };
 
                CPU2: cpu@2 {
                        compatible = "arm,cortex-a53", "arm,armv8";
                        reg = <0x2>;
                        next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+                       cpu-idle-states = <&CPU_SPC>;
                };
 
                CPU3: cpu@3 {
                        compatible = "arm,cortex-a53", "arm,armv8";
                        reg = <0x3>;
                        next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+                       cpu-idle-states = <&CPU_SPC>;
                };
 
                L2_0: l2-cache {
                      compatible = "cache";
                      cache-level = <2>;
                };
+
+               idle-states {
+                       CPU_SPC: spc {
+                               compatible = "arm,idle-state";
+                               arm,psci-suspend-param = <0x40000002>;
+                               entry-latency-us = <130>;
+                               exit-latency-us = <150>;
+                               min-residency-us = <2000>;
+                               local-timer-stop;
+                       };
+               };
+       };
+
+       psci {
+               compatible = "arm,psci-1.0";
+               method = "smc";
+       };
+
+       pmu {
+               compatible = "arm,armv8-pmuv3";
+               interrupts = <GIC_PPI 7 GIC_CPU_MASK_SIMPLE(4)>;
        };
 
        timer {
                hwlocks = <&tcsr_mutex 3>;
        };
 
+       firmware {
+               scm {
+                       compatible = "qcom,scm";
+                       clocks = <&gcc GCC_CRYPTO_CLK>, <&gcc GCC_CRYPTO_AXI_CLK>, <&gcc GCC_CRYPTO_AHB_CLK>;
+                       clock-names = "core", "bus", "iface";
+               };
+       };
+
        soc: soc {
                #address-cells = <1>;
                #size-cells = <1>;
diff --git a/arch/arm64/boot/dts/qcom/msm8996-pins.dtsi b/arch/arm64/boot/dts/qcom/msm8996-pins.dtsi
new file mode 100644 (file)
index 0000000..6599404
--- /dev/null
@@ -0,0 +1,303 @@
+/*
+ * Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+&msmgpio {
+
+       blsp1_spi0_default: blsp1_spi0_default {
+               pinmux {
+                       function = "blsp_spi1";
+                       pins = "gpio0", "gpio1", "gpio3";
+               };
+               pinmux_cs {
+                       function = "gpio";
+                       pins = "gpio2";
+               };
+               pinconf {
+                       pins = "gpio0", "gpio1", "gpio3";
+                       drive-strength = <12>;
+                       bias-disable;
+               };
+               pinconf_cs {
+                       pins = "gpio2";
+                       drive-strength = <16>;
+                       bias-disable;
+                       output-high;
+               };
+       };
+
+       blsp1_spi0_sleep: blsp1_spi0_sleep {
+               pinmux {
+                       function = "gpio";
+                       pins = "gpio0", "gpio1", "gpio2", "gpio3";
+               };
+               pinconf {
+                       pins = "gpio0", "gpio1", "gpio2", "gpio3";
+                       drive-strength = <2>;
+                       bias-pull-down;
+               };
+       };
+
+       blsp1_i2c2_default: blsp1_i2c2_default {
+               pinmux {
+                       function = "blsp_i2c3";
+                       pins = "gpio47", "gpio48";
+               };
+               pinconf {
+                       pins = "gpio47", "gpio48";
+                       drive-strength = <16>;
+                       bias-disable = <0>;
+               };
+       };
+
+       blsp1_i2c2_sleep: blsp1_i2c2_sleep {
+               pinmux {
+                       function = "gpio";
+                       pins = "gpio47", "gpio48";
+               };
+               pinconf {
+                       pins = "gpio47", "gpio48";
+                       drive-strength = <2>;
+                       bias-disable = <0>;
+               };
+       };
+
+       blsp2_i2c0_default: blsp2_i2c0 {
+               pinmux {
+                       function = "blsp_i2c7";
+                       pins = "gpio55", "gpio56";
+               };
+               pinconf {
+                       pins = "gpio55", "gpio56";
+                       drive-strength = <16>;
+                       bias-disable;
+               };
+       };
+
+       blsp2_i2c0_sleep: blsp2_i2c0_sleep {
+               pinmux {
+                       function = "gpio";
+                       pins = "gpio55", "gpio56";
+               };
+               pinconf {
+                       pins = "gpio55", "gpio56";
+                       drive-strength = <2>;
+                       bias-disable;
+               };
+       };
+
+       blsp2_uart1_2pins_default: blsp2_uart1_2pins {
+               pinmux {
+                       function = "blsp_uart8";
+                       pins = "gpio4", "gpio5";
+               };
+               pinconf {
+                       pins = "gpio4", "gpio5";
+                       drive-strength = <16>;
+                       bias-disable;
+               };
+       };
+
+       blsp2_uart1_2pins_sleep: blsp2_uart1_2pins_sleep {
+               pinmux {
+                       function = "gpio";
+                       pins = "gpio4", "gpio5";
+               };
+               pinconf {
+                       pins = "gpio4", "gpio5";
+                       drive-strength = <2>;
+                       bias-disable;
+               };
+       };
+
+       blsp2_uart1_4pins_default: blsp2_uart1_4pins {
+               pinmux {
+                       function = "blsp_uart8";
+                       pins = "gpio4", "gpio5", "gpio6", "gpio7";
+               };
+
+               pinconf {
+                       pins = "gpio4", "gpio5", "gpio6", "gpio7";
+                       drive-strength = <16>;
+                       bias-disable;
+               };
+       };
+
+       blsp2_uart1_4pins_sleep: blsp2_uart1_4pins_sleep {
+               pinmux {
+                       function = "gpio";
+                       pins = "gpio4", "gpio5", "gpio6", "gpio7";
+               };
+
+               pinconf {
+                       pins = "gpio4", "gpiio5", "gpio6", "gpio7";
+                       drive-strength = <2>;
+                       bias-disable;
+               };
+       };
+
+       blsp2_i2c1_default: blsp2_i2c1 {
+               pinmux {
+                       function = "blsp_i2c8";
+                       pins = "gpio6", "gpio7";
+               };
+               pinconf {
+                       pins = "gpio6", "gpio7";
+                       drive-strength = <16>;
+                       bias-disable;
+               };
+       };
+
+       blsp2_i2c1_sleep: blsp2_i2c1_sleep {
+               pinmux {
+                       function = "gpio";
+                       pins = "gpio6", "gpio7";
+               };
+               pinconf {
+                       pins = "gpio6", "gpio7";
+                       drive-strength = <2>;
+                       bias-disable;
+               };
+       };
+
+       blsp2_uart2_2pins_default: blsp2_uart2_2pins {
+               pinmux {
+                       function = "blsp_uart9";
+                       pins = "gpio49", "gpio50";
+               };
+               pinconf {
+                       pins = "gpio49", "gpio50";
+                       drive-strength = <16>;
+                       bias-disable;
+               };
+       };
+
+       blsp2_uart2_2pins_sleep: blsp2_uart2_2pins_sleep {
+               pinmux {
+                       function = "gpio";
+                       pins = "gpio49", "gpio50";
+               };
+               pinconf {
+                       pins = "gpio49", "gpio50";
+                       drive-strength = <2>;
+                       bias-disable;
+               };
+       };
+
+       blsp2_uart2_4pins_default: blsp2_uart2_4pins {
+               pinmux {
+                       function = "blsp_uart9";
+                       pins = "gpio49", "gpio50", "gpio51", "gpio52";
+               };
+
+               pinconf {
+                       pins = "gpio49", "gpio50", "gpio51", "gpio52";
+                       drive-strength = <16>;
+                       bias-disable;
+               };
+       };
+
+       blsp2_uart2_4pins_sleep: blsp2_uart2_4pins_sleep {
+               pinmux {
+                       function = "gpio";
+                       pins = "gpio49", "gpio50", "gpio51", "gpio52";
+               };
+
+               pinconf {
+                       pins = "gpio49", "gpio50", "gpio51", "gpio52";
+                       drive-strength = <2>;
+                       bias-disable;
+               };
+       };
+
+       blsp2_spi5_default: blsp2_spi5_default {
+               pinmux {
+                       function = "blsp_spi12";
+                       pins = "gpio85", "gpio86", "gpio88";
+               };
+               pinmux_cs {
+                       function = "gpio";
+                       pins = "gpio87";
+               };
+               pinconf {
+                       pins = "gpio85", "gpio86", "gpio88";
+                       drive-strength = <12>;
+                       bias-disable;
+               };
+               pinconf_cs {
+                       pins = "gpio87";
+                       drive-strength = <16>;
+                       bias-disable;
+                       output-high;
+               };
+       };
+
+       blsp2_spi5_sleep: blsp2_spi5_sleep {
+               pinmux {
+                       function = "gpio";
+                       pins = "gpio85", "gpio86", "gpio87", "gpio88";
+               };
+               pinconf {
+                       pins = "gpio85", "gpio86", "gpio87", "gpio88";
+                       drive-strength = <2>;
+                       bias-pull-down;
+               };
+       };
+
+       sdc2_clk_on: sdc2_clk_on {
+               config {
+                       pins = "sdc2_clk";
+                       bias-disable;           /* NO pull */
+                       drive-strength = <16>;  /* 16 MA */
+               };
+       };
+
+       sdc2_clk_off: sdc2_clk_off {
+               config {
+                       pins = "sdc2_clk";
+                       bias-disable;           /* NO pull */
+                       drive-strength = <2>;   /* 2 MA */
+               };
+       };
+
+       sdc2_cmd_on: sdc2_cmd_on {
+               config {
+                       pins = "sdc2_cmd";
+                       bias-pull-up;           /* pull up */
+                       drive-strength = <10>;  /* 10 MA */
+               };
+       };
+
+       sdc2_cmd_off: sdc2_cmd_off {
+               config {
+                       pins = "sdc2_cmd";
+                       bias-pull-up;           /* pull up */
+                       drive-strength = <2>;   /* 2 MA */
+               };
+       };
+
+       sdc2_data_on: sdc2_data_on {
+               config {
+                       pins = "sdc2_data";
+                       bias-pull-up;           /* pull up */
+                       drive-strength = <10>;  /* 10 MA */
+               };
+       };
+
+       sdc2_data_off: sdc2_data_off {
+               config {
+                       pins = "sdc2_data";
+                       bias-pull-up;           /* pull up */
+                       drive-strength = <2>;   /* 2 MA */
+               };
+       };
+};
index 0506fb8..55ec3e8 100644 (file)
                        reg = <0x300000 0x90000>;
                };
 
+               blsp1_spi0: spi@07575000 {
+                       compatible = "qcom,spi-qup-v2.2.1";
+                       reg = <0x07575000 0x600>;
+                       interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&gcc GCC_BLSP1_QUP1_SPI_APPS_CLK>,
+                                <&gcc GCC_BLSP1_AHB_CLK>;
+                       clock-names = "core", "iface";
+                       pinctrl-names = "default", "sleep";
+                       pinctrl-0 = <&blsp1_spi0_default>;
+                       pinctrl-1 = <&blsp1_spi0_sleep>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+               };
+
+               blsp2_i2c0: i2c@075b5000 {
+                       compatible = "qcom,i2c-qup-v2.2.1";
+                       reg = <0x075b5000 0x1000>;
+                       interrupts = <GIC_SPI 101 0>;
+                       clocks = <&gcc GCC_BLSP2_AHB_CLK>,
+                               <&gcc GCC_BLSP2_QUP1_I2C_APPS_CLK>;
+                       clock-names = "iface", "core";
+                       pinctrl-names = "default", "sleep";
+                       pinctrl-0 = <&blsp2_i2c0_default>;
+                       pinctrl-1 = <&blsp2_i2c0_sleep>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+               };
+
                blsp2_uart1: serial@75b0000 {
                        compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
                        reg = <0x75b0000 0x1000>;
                        status = "disabled";
                };
 
-               pinctrl@1010000 {
+               blsp2_i2c1: i2c@075b6000 {
+                       compatible = "qcom,i2c-qup-v2.2.1";
+                       reg = <0x075b6000 0x1000>;
+                       interrupts = <GIC_SPI 102 0>;
+                       clocks = <&gcc GCC_BLSP2_AHB_CLK>,
+                               <&gcc GCC_BLSP2_QUP2_I2C_APPS_CLK>;
+                       clock-names = "iface", "core";
+                       pinctrl-names = "default", "sleep";
+                       pinctrl-0 = <&blsp2_i2c1_default>;
+                       pinctrl-1 = <&blsp2_i2c1_sleep>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+               };
+
+               blsp2_uart2: serial@75b1000 {
+                       compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
+                       reg = <0x075b1000 0x1000>;
+                       interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&gcc GCC_BLSP2_UART3_APPS_CLK>,
+                                <&gcc GCC_BLSP2_AHB_CLK>;
+                       clock-names = "core", "iface";
+                       status = "disabled";
+               };
+
+               blsp1_i2c2: i2c@07577000 {
+                       compatible = "qcom,i2c-qup-v2.2.1";
+                       reg = <0x07577000 0x1000>;
+                       interrupts = <GIC_SPI 97 0>;
+                       clocks = <&gcc GCC_BLSP1_AHB_CLK>,
+                               <&gcc GCC_BLSP1_QUP3_I2C_APPS_CLK>;
+                       clock-names = "iface", "core";
+                       pinctrl-names = "default", "sleep";
+                       pinctrl-0 = <&blsp1_i2c2_default>;
+                       pinctrl-1 = <&blsp1_i2c2_sleep>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+               };
+
+               blsp2_spi5: spi@075ba000{
+                       compatible = "qcom,spi-qup-v2.2.1";
+                       reg = <0x075ba000 0x600>;
+                       interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&gcc GCC_BLSP2_QUP5_SPI_APPS_CLK>,
+                                <&gcc GCC_BLSP2_AHB_CLK>;
+                       clock-names = "core", "iface";
+                       pinctrl-names = "default", "sleep";
+                       pinctrl-0 = <&blsp2_spi5_default>;
+                       pinctrl-1 = <&blsp2_spi5_sleep>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+               };
+
+               sdhc2: sdhci@74a4900 {
+                        status = "disabled";
+                        compatible = "qcom,sdhci-msm-v4";
+                        reg = <0x74a4900 0x314>, <0x74a4000 0x800>;
+                        reg-names = "hc_mem", "core_mem";
+
+                        interrupts = <0 125 0>, <0 221 0>;
+                        interrupt-names = "hc_irq", "pwr_irq";
+
+                        clock-names = "iface", "core";
+                        clocks = <&gcc GCC_SDCC2_AHB_CLK>,
+                        <&gcc GCC_SDCC2_APPS_CLK>;
+                        bus-width = <4>;
+                };
+
+               msmgpio: pinctrl@1010000 {
                        compatible = "qcom,msm8996-pinctrl";
                        reg = <0x01010000 0x300000>;
                        interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>;
                };
        };
 };
+#include "msm8996-pins.dtsi"
index 9ce1890..17139f7 100644 (file)
@@ -1,4 +1,5 @@
 dtb-$(CONFIG_ARCH_R8A7795) += r8a7795-salvator-x.dtb
+dtb-$(CONFIG_ARCH_R8A7796) += r8a7796-salvator-x.dtb
 
 always         := $(dtb-y)
 clean-files    := *.dtb
index 9f561c9..98f0263 100644 (file)
@@ -62,7 +62,7 @@
                clock-frequency = <24576000>;
        };
 
-       vcc_sdhi0: regulator@1 {
+       vcc_sdhi0: regulator-vcc-sdhi0 {
                compatible = "regulator-fixed";
 
                regulator-name = "SDHI0 Vcc";
@@ -73,7 +73,7 @@
                enable-active-high;
        };
 
-       vccq_sdhi0: regulator@2 {
+       vccq_sdhi0: regulator-vccq-sdhi0 {
                compatible = "regulator-gpio";
 
                regulator-name = "SDHI0 VccQ";
@@ -86,7 +86,7 @@
                          1800000 0>;
        };
 
-       vcc_sdhi3: regulator@3 {
+       vcc_sdhi3: regulator-vcc-sdhi3 {
                compatible = "regulator-fixed";
 
                regulator-name = "SDHI3 Vcc";
@@ -97,7 +97,7 @@
                enable-active-high;
        };
 
-       vccq_sdhi3: regulator@4 {
+       vccq_sdhi3: regulator-vccq-sdhi3 {
                compatible = "regulator-gpio";
 
                regulator-name = "SDHI3 VccQ";
        pinctrl-0 = <&scif1_pins>;
        pinctrl-names = "default";
 
+       uart-has-rtscts;
        status = "okay";
 };
 
        shared-pin;
 };
 
+&wdt0 {
+       timeout-sec = <60>;
+       status = "okay";
+};
+
 &audio_clk_a {
        clock-frequency = <22579200>;
 };
index 3285a92..b902356 100644 (file)
@@ -53,6 +53,7 @@
                        next-level-cache = <&L2_CA57>;
                        enable-method = "psci";
                };
+
                a57_2: cpu@2 {
                        compatible = "arm,cortex-a57","arm,armv8";
                        reg = <0x2>;
@@ -61,6 +62,7 @@
                        next-level-cache = <&L2_CA57>;
                        enable-method = "psci";
                };
+
                a57_3: cpu@3 {
                        compatible = "arm,cortex-a57","arm,armv8";
                        reg = <0x3>;
                        next-level-cache = <&L2_CA57>;
                        enable-method = "psci";
                };
-       };
 
-       L2_CA57: cache-controller@0 {
-               compatible = "cache";
-               power-domains = <&sysc R8A7795_PD_CA57_SCU>;
-               cache-unified;
-               cache-level = <2>;
-       };
+               L2_CA57: cache-controller@0 {
+                       compatible = "cache";
+                       reg = <0>;
+                       power-domains = <&sysc R8A7795_PD_CA57_SCU>;
+                       cache-unified;
+                       cache-level = <2>;
+               };
 
-       L2_CA53: cache-controller@1 {
-               compatible = "cache";
-               power-domains = <&sysc R8A7795_PD_CA53_SCU>;
-               cache-unified;
-               cache-level = <2>;
+               L2_CA53: cache-controller@100 {
+                       compatible = "cache";
+                       reg = <0x100>;
+                       power-domains = <&sysc R8A7795_PD_CA53_SCU>;
+                       cache-unified;
+                       cache-level = <2>;
+               };
        };
 
        extal_clk: extal {
                #size-cells = <2>;
                ranges;
 
-               gic: interrupt-controller@0xf1010000 {
+               gic: interrupt-controller@f1010000 {
                        compatible = "arm,gic-400";
                        #interrupt-cells = <3>;
                        #address-cells = <0>;
                        interrupt-controller;
                        reg = <0x0 0xf1010000 0 0x1000>,
-                             <0x0 0xf1020000 0 0x2000>,
+                             <0x0 0xf1020000 0 0x20000>,
                              <0x0 0xf1040000 0 0x20000>,
-                             <0x0 0xf1060000 0 0x2000>;
+                             <0x0 0xf1060000 0 0x20000>;
                        interrupts = <GIC_PPI 9
                                        (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
                };
 
+               wdt0: watchdog@e6020000 {
+                       compatible = "renesas,r8a7795-wdt", "renesas,rcar-gen3-wdt";
+                       reg = <0 0xe6020000 0 0x0c>;
+                       clocks = <&cpg CPG_MOD 402>;
+                       power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
+                       status = "disabled";
+               };
+
                gpio0: gpio@e6050000 {
                        compatible = "renesas,gpio-r8a7795",
                                     "renesas,gpio-rcar";
                        status = "disabled";
                };
 
+               canfd: can@e66c0000 {
+                       compatible = "renesas,r8a7795-canfd",
+                                    "renesas,rcar-gen3-canfd";
+                       reg = <0 0xe66c0000 0 0x8000>;
+                       interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>,
+                                  <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 914>,
+                              <&cpg CPG_CORE R8A7795_CLK_CANFD>,
+                              <&can_clk>;
+                       clock-names = "fck", "canfd", "can_clk";
+                       assigned-clocks = <&cpg CPG_CORE R8A7795_CLK_CANFD>;
+                       assigned-clock-rates = <40000000>;
+                       power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
+                       status = "disabled";
+
+                       channel0 {
+                               status = "disabled";
+                       };
+
+                       channel1 {
+                               status = "disabled";
+                       };
+               };
+
                hscif0: serial@e6540000 {
                        compatible = "renesas,hscif-r8a7795",
                                     "renesas,rcar-gen3-hscif",
                        interrupts = <GIC_SPI 287 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 931>;
                        power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
+                       dmas = <&dmac1 0x91>, <&dmac1 0x90>;
+                       dma-names = "tx", "rx";
                        i2c-scl-internal-delay-ns = <110>;
                        status = "disabled";
                };
                        interrupts = <GIC_SPI 288 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 930>;
                        power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
+                       dmas = <&dmac1 0x93>, <&dmac1 0x92>;
+                       dma-names = "tx", "rx";
                        i2c-scl-internal-delay-ns = <6>;
                        status = "disabled";
                };
                        interrupts = <GIC_SPI 286 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 929>;
                        power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
+                       dmas = <&dmac1 0x95>, <&dmac1 0x94>;
+                       dma-names = "tx", "rx";
                        i2c-scl-internal-delay-ns = <6>;
                        status = "disabled";
                };
                        interrupts = <GIC_SPI 290 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 928>;
                        power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
+                       dmas = <&dmac0 0x97>, <&dmac0 0x96>;
+                       dma-names = "tx", "rx";
                        i2c-scl-internal-delay-ns = <110>;
                        status = "disabled";
                };
                        interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 927>;
                        power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
+                       dmas = <&dmac0 0x99>, <&dmac0 0x98>;
+                       dma-names = "tx", "rx";
                        i2c-scl-internal-delay-ns = <110>;
                        status = "disabled";
                };
                        interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 919>;
                        power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
+                       dmas = <&dmac0 0x9b>, <&dmac0 0x9a>;
+                       dma-names = "tx", "rx";
                        i2c-scl-internal-delay-ns = <110>;
                        status = "disabled";
                };
                        interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 918>;
                        power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
+                       dmas = <&dmac0 0x9d>, <&dmac0 0x9c>;
+                       dma-names = "tx", "rx";
                        i2c-scl-internal-delay-ns = <6>;
                        status = "disabled";
                };
                        status = "disabled";
 
                        rcar_sound,dvc {
-                               dvc0: dvc@0 {
+                               dvc0: dvc-0 {
                                        dmas = <&audma0 0xbc>;
                                        dma-names = "tx";
                                };
-                               dvc1: dvc@1 {
+                               dvc1: dvc-1 {
                                        dmas = <&audma0 0xbe>;
                                        dma-names = "tx";
                                };
                        };
 
                        rcar_sound,src {
-                               src0: src@0 {
+                               src0: src-0 {
                                        interrupts = <GIC_SPI 352 IRQ_TYPE_LEVEL_HIGH>;
                                        dmas = <&audma0 0x85>, <&audma1 0x9a>;
                                        dma-names = "rx", "tx";
                                };
-                               src1: src@1 {
+                               src1: src-1 {
                                        interrupts = <GIC_SPI 353 IRQ_TYPE_LEVEL_HIGH>;
                                        dmas = <&audma0 0x87>, <&audma1 0x9c>;
                                        dma-names = "rx", "tx";
                                };
-                               src2: src@2 {
+                               src2: src-2 {
                                        interrupts = <GIC_SPI 354 IRQ_TYPE_LEVEL_HIGH>;
                                        dmas = <&audma0 0x89>, <&audma1 0x9e>;
                                        dma-names = "rx", "tx";
                                };
-                               src3: src@3 {
+                               src3: src-3 {
                                        interrupts = <GIC_SPI 355 IRQ_TYPE_LEVEL_HIGH>;
                                        dmas = <&audma0 0x8b>, <&audma1 0xa0>;
                                        dma-names = "rx", "tx";
                                };
-                               src4: src@4 {
+                               src4: src-4 {
                                        interrupts = <GIC_SPI 356 IRQ_TYPE_LEVEL_HIGH>;
                                        dmas = <&audma0 0x8d>, <&audma1 0xb0>;
                                        dma-names = "rx", "tx";
                                };
-                               src5: src@5 {
+                               src5: src-5 {
                                        interrupts = <GIC_SPI 357 IRQ_TYPE_LEVEL_HIGH>;
                                        dmas = <&audma0 0x8f>, <&audma1 0xb2>;
                                        dma-names = "rx", "tx";
                                };
-                               src6: src@6 {
+                               src6: src-6 {
                                        interrupts = <GIC_SPI 358 IRQ_TYPE_LEVEL_HIGH>;
                                        dmas = <&audma0 0x91>, <&audma1 0xb4>;
                                        dma-names = "rx", "tx";
                                };
-                               src7: src@7 {
+                               src7: src-7 {
                                        interrupts = <GIC_SPI 359 IRQ_TYPE_LEVEL_HIGH>;
                                        dmas = <&audma0 0x93>, <&audma1 0xb6>;
                                        dma-names = "rx", "tx";
                                };
-                               src8: src@8 {
+                               src8: src-8 {
                                        interrupts = <GIC_SPI 360 IRQ_TYPE_LEVEL_HIGH>;
                                        dmas = <&audma0 0x95>, <&audma1 0xb8>;
                                        dma-names = "rx", "tx";
                                };
-                               src9: src@9 {
+                               src9: src-9 {
                                        interrupts = <GIC_SPI 361 IRQ_TYPE_LEVEL_HIGH>;
                                        dmas = <&audma0 0x97>, <&audma1 0xba>;
                                        dma-names = "rx", "tx";
                        };
 
                        rcar_sound,ssi {
-                               ssi0: ssi@0 {
+                               ssi0: ssi-0 {
                                        interrupts = <GIC_SPI 370 IRQ_TYPE_LEVEL_HIGH>;
                                        dmas = <&audma0 0x01>, <&audma1 0x02>, <&audma0 0x15>, <&audma1 0x16>;
                                        dma-names = "rx", "tx", "rxu", "txu";
                                };
-                               ssi1: ssi@1 {
+                               ssi1: ssi-1 {
                                         interrupts = <GIC_SPI 371 IRQ_TYPE_LEVEL_HIGH>;
                                        dmas = <&audma0 0x03>, <&audma1 0x04>, <&audma0 0x49>, <&audma1 0x4a>;
                                        dma-names = "rx", "tx", "rxu", "txu";
                                };
-                               ssi2: ssi@2 {
+                               ssi2: ssi-2 {
                                        interrupts = <GIC_SPI 372 IRQ_TYPE_LEVEL_HIGH>;
                                        dmas = <&audma0 0x05>, <&audma1 0x06>, <&audma0 0x63>, <&audma1 0x64>;
                                        dma-names = "rx", "tx", "rxu", "txu";
                                };
-                               ssi3: ssi@3 {
+                               ssi3: ssi-3 {
                                        interrupts = <GIC_SPI 373 IRQ_TYPE_LEVEL_HIGH>;
                                        dmas = <&audma0 0x07>, <&audma1 0x08>, <&audma0 0x6f>, <&audma1 0x70>;
                                        dma-names = "rx", "tx", "rxu", "txu";
                                };
-                               ssi4: ssi@4 {
+                               ssi4: ssi-4 {
                                        interrupts = <GIC_SPI 374 IRQ_TYPE_LEVEL_HIGH>;
                                        dmas = <&audma0 0x09>, <&audma1 0x0a>, <&audma0 0x71>, <&audma1 0x72>;
                                        dma-names = "rx", "tx", "rxu", "txu";
                                };
-                               ssi5: ssi@5 {
+                               ssi5: ssi-5 {
                                        interrupts = <GIC_SPI 375 IRQ_TYPE_LEVEL_HIGH>;
                                        dmas = <&audma0 0x0b>, <&audma1 0x0c>, <&audma0 0x73>, <&audma1 0x74>;
                                        dma-names = "rx", "tx", "rxu", "txu";
                                };
-                               ssi6: ssi@6 {
+                               ssi6: ssi-6 {
                                        interrupts = <GIC_SPI 376 IRQ_TYPE_LEVEL_HIGH>;
                                        dmas = <&audma0 0x0d>, <&audma1 0x0e>, <&audma0 0x75>, <&audma1 0x76>;
                                        dma-names = "rx", "tx", "rxu", "txu";
                                };
-                               ssi7: ssi@7 {
+                               ssi7: ssi-7 {
                                        interrupts = <GIC_SPI 377 IRQ_TYPE_LEVEL_HIGH>;
                                        dmas = <&audma0 0x0f>, <&audma1 0x10>, <&audma0 0x79>, <&audma1 0x7a>;
                                        dma-names = "rx", "tx", "rxu", "txu";
                                };
-                               ssi8: ssi@8 {
+                               ssi8: ssi-8 {
                                        interrupts = <GIC_SPI 378 IRQ_TYPE_LEVEL_HIGH>;
                                        dmas = <&audma0 0x11>, <&audma1 0x12>, <&audma0 0x7b>, <&audma1 0x7c>;
                                        dma-names = "rx", "tx", "rxu", "txu";
                                };
-                               ssi9: ssi@9 {
+                               ssi9: ssi-9 {
                                        interrupts = <GIC_SPI 379 IRQ_TYPE_LEVEL_HIGH>;
                                        dmas = <&audma0 0x13>, <&audma1 0x14>, <&audma0 0x7d>, <&audma1 0x7e>;
                                        dma-names = "rx", "tx", "rxu", "txu";
diff --git a/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts b/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts
new file mode 100644 (file)
index 0000000..e72be38
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Device Tree Source for the Salvator-X board
+ *
+ * Copyright (C) 2016 Renesas Electronics Corp.
+ *
+ * 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 "r8a7796.dtsi"
+
+/ {
+       model = "Renesas Salvator-X board based on r8a7796";
+       compatible = "renesas,salvator-x", "renesas,r8a7796";
+
+       aliases {
+               serial0 = &scif2;
+       };
+
+       chosen {
+               bootargs = "ignore_loglevel";
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory@48000000 {
+               device_type = "memory";
+               /* first 128MB is reserved for secure area. */
+               reg = <0x0 0x48000000 0x0 0x78000000>;
+       };
+};
+
+&extal_clk {
+       clock-frequency = <16666666>;
+};
+
+&scif2 {
+       status = "okay";
+};
+
+&scif_clk {
+       clock-frequency = <14745600>;
+       status = "okay";
+};
+
+&wdt0 {
+       timeout-sec = <60>;
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/renesas/r8a7796.dtsi b/arch/arm64/boot/dts/renesas/r8a7796.dtsi
new file mode 100644 (file)
index 0000000..1edf824
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ * Device Tree Source for the r8a7796 SoC
+ *
+ * Copyright (C) 2016 Renesas Electronics Corp.
+ *
+ * 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 <dt-bindings/clock/r8a7796-cpg-mssr.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/power/r8a7796-sysc.h>
+
+/ {
+       compatible = "renesas,r8a7796";
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               /* 1 core only at this point */
+               a57_0: cpu@0 {
+                       compatible = "arm,cortex-a57", "arm,armv8";
+                       reg = <0x0>;
+                       device_type = "cpu";
+                       power-domains = <&sysc R8A7796_PD_CA57_CPU0>;
+                       next-level-cache = <&L2_CA57>;
+                       enable-method = "psci";
+               };
+
+               L2_CA57: cache-controller@0 {
+                       compatible = "cache";
+                       reg = <0>;
+                       power-domains = <&sysc R8A7796_PD_CA57_SCU>;
+                       cache-unified;
+                       cache-level = <2>;
+               };
+       };
+
+       extal_clk: extal {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               /* This value must be overridden by the board */
+               clock-frequency = <0>;
+       };
+
+       extalr_clk: extalr {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               /* This value must be overridden by the board */
+               clock-frequency = <0>;
+       };
+
+       /* External SCIF clock - to be overridden by boards that provide it */
+       scif_clk: scif {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <0>;
+       };
+
+       soc {
+               compatible = "simple-bus";
+               interrupt-parent = <&gic>;
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               gic: interrupt-controller@f1010000 {
+                       compatible = "arm,gic-400";
+                       #interrupt-cells = <3>;
+                       #address-cells = <0>;
+                       interrupt-controller;
+                       reg = <0x0 0xf1010000 0 0x1000>,
+                             <0x0 0xf1020000 0 0x20000>,
+                             <0x0 0xf1040000 0 0x20000>,
+                             <0x0 0xf1060000 0 0x20000>;
+                       interrupts = <GIC_PPI 9
+                                       (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_HIGH)>;
+               };
+
+               timer {
+                       compatible = "arm,armv8-timer";
+                       interrupts = <GIC_PPI 13
+                                       (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
+                                    <GIC_PPI 14
+                                       (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
+                                    <GIC_PPI 11
+                                       (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
+                                    <GIC_PPI 10
+                                       (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>;
+               };
+
+               wdt0: watchdog@e6020000 {
+                       compatible = "renesas,r8a7796-wdt",
+                                    "renesas,rcar-gen3-wdt";
+                       reg = <0 0xe6020000 0 0x0c>;
+                       clocks = <&cpg CPG_MOD 402>;
+                       power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
+                       status = "disabled";
+               };
+
+               cpg: clock-controller@e6150000 {
+                       compatible = "renesas,r8a7796-cpg-mssr";
+                       reg = <0 0xe6150000 0 0x1000>;
+                       clocks = <&extal_clk>, <&extalr_clk>;
+                       clock-names = "extal", "extalr";
+                       #clock-cells = <2>;
+                       #power-domain-cells = <0>;
+               };
+
+               sysc: system-controller@e6180000 {
+                       compatible = "renesas,r8a7796-sysc";
+                       reg = <0 0xe6180000 0 0x0400>;
+                       #power-domain-cells = <1>;
+               };
+
+               scif2: serial@e6e88000 {
+                       compatible = "renesas,scif-r8a7796",
+                                    "renesas,rcar-gen3-scif", "renesas,scif";
+                       reg = <0 0xe6e88000 0 64>;
+                       interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 310>,
+                                <&cpg CPG_CORE R8A7796_CLK_S3D1>,
+                                <&scif_clk>;
+                       clock-names = "fck", "brg_int", "scif_clk";
+                       power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
+                       status = "disabled";
+               };
+       };
+};
index b56b720..82a32e5 100644 (file)
        };
 };
 
+&io_domains {
+       status = "ok";
+
+       audio-supply = <&vcc_io>;
+       gpio30-supply = <&vcc_io>;
+       gpio1830-supply = <&vcc_io>;
+       wifi-supply = <&vccio_wl>;
+};
+
 &sdio0 {
        assigned-clocks = <&cru SCLK_SDIO0>;
        assigned-clock-parents = <&cru PLL_CPLL>;
        };
 };
 
+&pmu_io_domains {
+       status = "okay";
+
+       pmu-supply = <&vcc_io>;
+       vop-supply = <&vcc_io>;
+};
+
 &saradc {
        vref-supply = <&vcc_18>;
        status = "okay";
index 8b4a7c9..d02a900 100644 (file)
        };
 
        pmugrf: syscon@ff738000 {
-               compatible = "rockchip,rk3368-pmugrf", "syscon";
+               compatible = "rockchip,rk3368-pmugrf", "syscon", "simple-mfd";
                reg = <0x0 0xff738000 0x0 0x1000>;
+
+               pmu_io_domains: io-domains {
+                       compatible = "rockchip,rk3368-pmu-io-voltage-domain";
+                       status = "disabled";
+               };
        };
 
        cru: clock-controller@ff760000 {
        };
 
        grf: syscon@ff770000 {
-               compatible = "rockchip,rk3368-grf", "syscon";
+               compatible = "rockchip,rk3368-grf", "syscon", "simple-mfd";
                reg = <0x0 0xff770000 0x0 0x1000>;
+
+               io_domains: io-domains {
+                       compatible = "rockchip,rk3368-io-voltage-domain";
+                       status = "disabled";
+               };
        };
 
        wdt: watchdog@ff800000 {
                #address-cells = <0>;
 
                reg = <0x0 0xffb71000 0x0 0x1000>,
-                     <0x0 0xffb72000 0x0 0x1000>,
+                     <0x0 0xffb72000 0x0 0x2000>,
                      <0x0 0xffb74000 0x0 0x2000>,
                      <0x0 0xffb76000 0x0 0x2000>;
                interrupts = <GIC_PPI 9
index 1a3eb14..d33aa06 100644 (file)
        };
 };
 
+&emmc_phy {
+       status = "okay";
+};
+
 &pwm0 {
        status = "okay";
 };
        status = "okay";
 };
 
+&sdhci {
+       bus-width = <8>;
+       mmc-hs400-1_8v;
+       mmc-hs400-enhanced-strobe;
+       non-removable;
+       status = "okay";
+};
+
 &uart2 {
        status = "okay";
 };
index 46f325a..80acb38 100644 (file)
@@ -45,6 +45,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/pinctrl/rockchip.h>
+#include <dt-bindings/thermal/thermal.h>
 
 / {
        compatible = "rockchip,rk3399";
        #size-cells = <2>;
 
        aliases {
+               i2c0 = &i2c0;
+               i2c1 = &i2c1;
+               i2c2 = &i2c2;
+               i2c3 = &i2c3;
+               i2c4 = &i2c4;
+               i2c5 = &i2c5;
+               i2c6 = &i2c6;
+               i2c7 = &i2c7;
+               i2c8 = &i2c8;
                serial0 = &uart0;
                serial1 = &uart1;
                serial2 = &uart2;
                status = "disabled";
        };
 
+       sdhci: sdhci@fe330000 {
+               compatible = "rockchip,rk3399-sdhci-5.1", "arasan,sdhci-5.1";
+               reg = <0x0 0xfe330000 0x0 0x10000>;
+               interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
+               arasan,soc-ctl-syscon = <&grf>;
+               assigned-clocks = <&cru SCLK_EMMC>;
+               assigned-clock-rates = <200000000>;
+               clocks = <&cru SCLK_EMMC>, <&cru ACLK_EMMC>;
+               clock-names = "clk_xin", "clk_ahb";
+               clock-output-names = "emmc_cardclock";
+               #clock-cells = <0>;
+               phys = <&emmc_phy>;
+               phy-names = "phy_arasan";
+               status = "disabled";
+       };
+
        usb_host0_ehci: usb@fe380000 {
                compatible = "generic-ehci";
                reg = <0x0 0xfe380000 0x0 0x20000>;
                };
        };
 
+       i2c1: i2c@ff110000 {
+               compatible = "rockchip,rk3399-i2c";
+               reg = <0x0 0xff110000 0x0 0x1000>;
+               assigned-clocks = <&cru SCLK_I2C1>;
+               assigned-clock-rates = <200000000>;
+               clocks = <&cru SCLK_I2C1>, <&cru PCLK_I2C1>;
+               clock-names = "i2c", "pclk";
+               interrupts = <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&i2c1_xfer>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
+
+       i2c2: i2c@ff120000 {
+               compatible = "rockchip,rk3399-i2c";
+               reg = <0x0 0xff120000 0x0 0x1000>;
+               assigned-clocks = <&cru SCLK_I2C2>;
+               assigned-clock-rates = <200000000>;
+               clocks = <&cru SCLK_I2C2>, <&cru PCLK_I2C2>;
+               clock-names = "i2c", "pclk";
+               interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&i2c2_xfer>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
+
+       i2c3: i2c@ff130000 {
+               compatible = "rockchip,rk3399-i2c";
+               reg = <0x0 0xff130000 0x0 0x1000>;
+               assigned-clocks = <&cru SCLK_I2C3>;
+               assigned-clock-rates = <200000000>;
+               clocks = <&cru SCLK_I2C3>, <&cru PCLK_I2C3>;
+               clock-names = "i2c", "pclk";
+               interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&i2c3_xfer>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
+
+       i2c5: i2c@ff140000 {
+               compatible = "rockchip,rk3399-i2c";
+               reg = <0x0 0xff140000 0x0 0x1000>;
+               assigned-clocks = <&cru SCLK_I2C5>;
+               assigned-clock-rates = <200000000>;
+               clocks = <&cru SCLK_I2C5>, <&cru PCLK_I2C5>;
+               clock-names = "i2c", "pclk";
+               interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&i2c5_xfer>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
+
+       i2c6: i2c@ff150000 {
+               compatible = "rockchip,rk3399-i2c";
+               reg = <0x0 0xff150000 0x0 0x1000>;
+               assigned-clocks = <&cru SCLK_I2C6>;
+               assigned-clock-rates = <200000000>;
+               clocks = <&cru SCLK_I2C6>, <&cru PCLK_I2C6>;
+               clock-names = "i2c", "pclk";
+               interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&i2c6_xfer>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
+
+       i2c7: i2c@ff160000 {
+               compatible = "rockchip,rk3399-i2c";
+               reg = <0x0 0xff160000 0x0 0x1000>;
+               assigned-clocks = <&cru SCLK_I2C7>;
+               assigned-clock-rates = <200000000>;
+               clocks = <&cru SCLK_I2C7>, <&cru PCLK_I2C7>;
+               clock-names = "i2c", "pclk";
+               interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&i2c7_xfer>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
+
        uart0: serial@ff180000 {
                compatible = "rockchip,rk3399-uart", "snps,dw-apb-uart";
                reg = <0x0 0xff180000 0x0 0x100>;
                status = "disabled";
        };
 
+       thermal-zones {
+               cpu_thermal: cpu {
+                       polling-delay-passive = <100>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsadc 0>;
+
+                       trips {
+                               cpu_alert0: cpu_alert0 {
+                                       temperature = <70000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+                               cpu_alert1: cpu_alert1 {
+                                       temperature = <75000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+                               cpu_crit: cpu_crit {
+                                       temperature = <95000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
+
+                       cooling-maps {
+                               map0 {
+                                       trip = <&cpu_alert0>;
+                                       cooling-device =
+                                               <&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                               map1 {
+                                       trip = <&cpu_alert1>;
+                                       cooling-device =
+                                               <&cpu_l0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                               <&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
+               };
+
+               gpu_thermal: gpu {
+                       polling-delay-passive = <100>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsadc 1>;
+
+                       trips {
+                               gpu_alert0: gpu_alert0 {
+                                       temperature = <75000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+                               gpu_crit: gpu_crit {
+                                       temperature = <95000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
+
+                       cooling-maps {
+                               map0 {
+                                       trip = <&gpu_alert0>;
+                                       cooling-device =
+                                               <&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
+               };
+       };
+
+       tsadc: tsadc@ff260000 {
+               compatible = "rockchip,rk3399-tsadc";
+               reg = <0x0 0xff260000 0x0 0x100>;
+               interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>;
+               assigned-clocks = <&cru SCLK_TSADC>;
+               assigned-clock-rates = <750000>;
+               clocks = <&cru SCLK_TSADC>, <&cru PCLK_TSADC>;
+               clock-names = "tsadc", "apb_pclk";
+               resets = <&cru SRST_TSADC>;
+               reset-names = "tsadc-apb";
+               rockchip,grf = <&grf>;
+               rockchip,hw-tshut-temp = <95000>;
+               pinctrl-names = "init", "default", "sleep";
+               pinctrl-0 = <&otp_gpio>;
+               pinctrl-1 = <&otp_out>;
+               pinctrl-2 = <&otp_gpio>;
+               #thermal-sensor-cells = <1>;
+               status = "disabled";
+       };
+
        pmugrf: syscon@ff320000 {
-               compatible = "rockchip,rk3399-pmugrf", "syscon";
+               compatible = "rockchip,rk3399-pmugrf", "syscon", "simple-mfd";
                reg = <0x0 0xff320000 0x0 0x1000>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               pmu_io_domains: io-domains {
+                       compatible = "rockchip,rk3399-pmu-io-voltage-domain";
+                       status = "disabled";
+               };
        };
 
        spi3: spi@ff350000 {
                status = "disabled";
        };
 
+       i2c0: i2c@ff3c0000 {
+               compatible = "rockchip,rk3399-i2c";
+               reg = <0x0 0xff3c0000 0x0 0x1000>;
+               assigned-clocks = <&pmucru SCLK_I2C0_PMU>;
+               assigned-clock-rates = <200000000>;
+               clocks = <&pmucru SCLK_I2C0_PMU>, <&pmucru PCLK_I2C0_PMU>;
+               clock-names = "i2c", "pclk";
+               interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&i2c0_xfer>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
+
+       i2c4: i2c@ff3d0000 {
+               compatible = "rockchip,rk3399-i2c";
+               reg = <0x0 0xff3d0000 0x0 0x1000>;
+               assigned-clocks = <&pmucru SCLK_I2C4_PMU>;
+               assigned-clock-rates = <200000000>;
+               clocks = <&pmucru SCLK_I2C4_PMU>, <&pmucru PCLK_I2C4_PMU>;
+               clock-names = "i2c", "pclk";
+               interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&i2c4_xfer>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
+
+       i2c8: i2c@ff3e0000 {
+               compatible = "rockchip,rk3399-i2c";
+               reg = <0x0 0xff3e0000 0x0 0x1000>;
+               assigned-clocks = <&pmucru SCLK_I2C8_PMU>;
+               assigned-clock-rates = <200000000>;
+               clocks = <&pmucru SCLK_I2C8_PMU>, <&pmucru PCLK_I2C8_PMU>;
+               clock-names = "i2c", "pclk";
+               interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&i2c8_xfer>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
+
        pwm0: pwm@ff420000 {
                compatible = "rockchip,rk3399-pwm", "rockchip,rk3288-pwm";
                reg = <0x0 0xff420000 0x0 0x10>;
                reg = <0x0 0xff760000 0x0 0x1000>;
                #clock-cells = <1>;
                #reset-cells = <1>;
+               assigned-clocks =
+                       <&cru PLL_GPLL>, <&cru PLL_CPLL>,
+                       <&cru PLL_NPLL>,
+                       <&cru ACLK_PERIHP>, <&cru HCLK_PERIHP>,
+                       <&cru PCLK_PERIHP>,
+                       <&cru ACLK_PERILP0>, <&cru HCLK_PERILP0>,
+                       <&cru PCLK_PERILP0>,
+                       <&cru HCLK_PERILP1>, <&cru PCLK_PERILP1>;
+               assigned-clock-rates =
+                        <594000000>,  <800000000>,
+                       <1000000000>,
+                        <150000000>,   <75000000>,
+                         <37500000>,
+                        <100000000>,  <100000000>,
+                         <50000000>,
+                        <100000000>,   <50000000>;
        };
 
        grf: syscon@ff770000 {
-               compatible = "rockchip,rk3399-grf", "syscon";
+               compatible = "rockchip,rk3399-grf", "syscon", "simple-mfd";
                reg = <0x0 0xff770000 0x0 0x10000>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               io_domains: io-domains {
+                       compatible = "rockchip,rk3399-io-voltage-domain";
+                       status = "disabled";
+               };
+
+               emmc_phy: phy@f780 {
+                       compatible = "rockchip,rk3399-emmc-phy";
+                       reg = <0xf780 0x24>;
+                       clocks = <&sdhci>;
+                       clock-names = "emmcclk";
+                       #phy-cells = <0>;
+                       status = "disabled";
+               };
        };
 
        watchdog@ff840000 {
                        };
                };
 
+               sleep {
+                       ap_pwroff: ap-pwroff {
+                               rockchip,pins = <1 5 RK_FUNC_1 &pcfg_pull_none>;
+                       };
+
+                       ddrio_pwroff: ddrio-pwroff {
+                               rockchip,pins = <0 1 RK_FUNC_1 &pcfg_pull_none>;
+                       };
+               };
+
                spdif {
                        spdif_bus: spdif-bus {
                                rockchip,pins =
                        };
                };
 
+               tsadc {
+                       otp_gpio: otp-gpio {
+                               rockchip,pins = <1 6 RK_FUNC_GPIO &pcfg_pull_none>;
+                       };
+
+                       otp_out: otp-out {
+                               rockchip,pins = <1 6 RK_FUNC_1 &pcfg_pull_none>;
+                       };
+               };
+
                uart0 {
                        uart0_xfer: uart0-xfer {
                                rockchip,pins =
index 9532880..c223915 100644 (file)
@@ -42,6 +42,8 @@
  *     OTHER DEALINGS IN THE SOFTWARE.
  */
 
+/memreserve/ 0x80000000 0x00000008;    /* cpu-release-addr */
+
 / {
        compatible = "socionext,ph1-ld20";
        #address-cells = <2>;
@@ -77,7 +79,7 @@
                        compatible = "arm,cortex-a72", "arm,armv8";
                        reg = <0 0x000>;
                        enable-method = "spin-table";
-                       cpu-release-addr = <0 0x80000100>;
+                       cpu-release-addr = <0 0x80000000>;
                };
 
                cpu1: cpu@1 {
@@ -85,7 +87,7 @@
                        compatible = "arm,cortex-a72", "arm,armv8";
                        reg = <0 0x001>;
                        enable-method = "spin-table";
-                       cpu-release-addr = <0 0x80000100>;
+                       cpu-release-addr = <0 0x80000000>;
                };
 
                cpu2: cpu@100 {
@@ -93,7 +95,7 @@
                        compatible = "arm,cortex-a53", "arm,armv8";
                        reg = <0 0x100>;
                        enable-method = "spin-table";
-                       cpu-release-addr = <0 0x80000100>;
+                       cpu-release-addr = <0 0x80000000>;
                };
 
                cpu3: cpu@101 {
                        compatible = "arm,cortex-a53", "arm,armv8";
                        reg = <0 0x101>;
                        enable-method = "spin-table";
-                       cpu-release-addr = <0 0x80000100>;
+                       cpu-release-addr = <0 0x80000000>;
                };
        };
 
                        reg = <0x59801000 0x400>;
                };
 
-               pinctrl: pinctrl@5f801000 {
-                       compatible = "socionext,ph1-ld20-pinctrl", "syscon";
-                       reg = <0x5f801000 0xe00>;
+               soc-glue@5f800000 {
+                       compatible = "simple-mfd", "syscon";
+                       reg = <0x5f800000 0x2000>;
+
+                       pinctrl: pinctrl {
+                                compatible = "socionext,uniphier-ld20-pinctrl";
+                       };
                };
 
                gic: interrupt-controller@5fe00000 {
index 2115ce4..41a12d3 100644 (file)
@@ -1,6 +1,7 @@
 config CLK_RENESAS_CPG_MSSR
        bool
        default y if ARCH_R8A7795
+       default y if ARCH_R8A7796
 
 config CLK_RENESAS_CPG_MSTP
        bool
@@ -11,6 +12,7 @@ config CLK_RENESAS_CPG_MSTP
        default y if ARCH_R8A7779
        default y if ARCH_R8A7790
        default y if ARCH_R8A7791
+       default y if ARCH_R8A7792
        default y if ARCH_R8A7793
        default y if ARCH_R8A7794
        default y if ARCH_SH73A0
index ead8bb8..90dd0db 100644 (file)
@@ -6,9 +6,11 @@ obj-$(CONFIG_ARCH_R8A7778)             += clk-r8a7778.o
 obj-$(CONFIG_ARCH_R8A7779)             += clk-r8a7779.o
 obj-$(CONFIG_ARCH_R8A7790)             += clk-rcar-gen2.o clk-div6.o
 obj-$(CONFIG_ARCH_R8A7791)             += clk-rcar-gen2.o clk-div6.o
+obj-$(CONFIG_ARCH_R8A7792)             += clk-rcar-gen2.o clk-div6.o
 obj-$(CONFIG_ARCH_R8A7793)             += clk-rcar-gen2.o clk-div6.o
 obj-$(CONFIG_ARCH_R8A7794)             += clk-rcar-gen2.o clk-div6.o
-obj-$(CONFIG_ARCH_R8A7795)             += r8a7795-cpg-mssr.o
+obj-$(CONFIG_ARCH_R8A7795)             += r8a7795-cpg-mssr.o rcar-gen3-cpg.o
+obj-$(CONFIG_ARCH_R8A7796)             += r8a7796-cpg-mssr.o rcar-gen3-cpg.o
 obj-$(CONFIG_ARCH_SH73A0)              += clk-sh73a0.o clk-div6.o
 
 obj-$(CONFIG_CLK_RENESAS_CPG_MSSR)     += renesas-cpg-mssr.o clk-div6.o
index ca5519c..d359c92 100644 (file)
  * the Free Software Foundation; version 2 of the License.
  */
 
-#include <linux/bug.h>
-#include <linux/clk.h>
-#include <linux/clk-provider.h>
 #include <linux/device.h>
-#include <linux/err.h>
 #include <linux/init.h>
-#include <linux/io.h>
 #include <linux/kernel.h>
-#include <linux/of.h>
-#include <linux/slab.h>
 
 #include <dt-bindings/clock/r8a7795-cpg-mssr.h>
 
 #include "renesas-cpg-mssr.h"
-
-#define CPG_RCKCR      0x240
+#include "rcar-gen3-cpg.h"
 
 enum clk_ids {
        /* Core Clock Outputs exported to DT */
@@ -58,20 +50,6 @@ enum clk_ids {
        MOD_CLK_BASE
 };
 
-enum r8a7795_clk_types {
-       CLK_TYPE_GEN3_MAIN = CLK_TYPE_CUSTOM,
-       CLK_TYPE_GEN3_PLL0,
-       CLK_TYPE_GEN3_PLL1,
-       CLK_TYPE_GEN3_PLL2,
-       CLK_TYPE_GEN3_PLL3,
-       CLK_TYPE_GEN3_PLL4,
-       CLK_TYPE_GEN3_SD,
-       CLK_TYPE_GEN3_R,
-};
-
-#define DEF_GEN3_SD(_name, _id, _parent, _offset)      \
-       DEF_BASE(_name, _id, CLK_TYPE_GEN3_SD, _parent, .offset = _offset)
-
 static const struct cpg_core_clk r8a7795_core_clks[] __initconst = {
        /* External Clock Inputs */
        DEF_INPUT("extal",  CLK_EXTAL),
@@ -129,6 +107,9 @@ static const struct cpg_core_clk r8a7795_core_clks[] __initconst = {
 };
 
 static const struct mssr_mod_clk r8a7795_mod_clks[] __initconst = {
+       DEF_MOD("fdp1-2",                117,   R8A7795_CLK_S2D1),
+       DEF_MOD("fdp1-1",                118,   R8A7795_CLK_S2D1),
+       DEF_MOD("fdp1-0",                119,   R8A7795_CLK_S2D1),
        DEF_MOD("scif5",                 202,   R8A7795_CLK_S3D4),
        DEF_MOD("scif4",                 203,   R8A7795_CLK_S3D4),
        DEF_MOD("scif3",                 204,   R8A7795_CLK_S3D4),
@@ -157,11 +138,20 @@ static const struct mssr_mod_clk r8a7795_mod_clks[] __initconst = {
        DEF_MOD("intc-ap",               408,   R8A7795_CLK_S3D1),
        DEF_MOD("audmac0",               502,   R8A7795_CLK_S3D4),
        DEF_MOD("audmac1",               501,   R8A7795_CLK_S3D4),
+       DEF_MOD("drif7",                 508,   R8A7795_CLK_S3D2),
+       DEF_MOD("drif6",                 509,   R8A7795_CLK_S3D2),
+       DEF_MOD("drif5",                 510,   R8A7795_CLK_S3D2),
+       DEF_MOD("drif4",                 511,   R8A7795_CLK_S3D2),
+       DEF_MOD("drif3",                 512,   R8A7795_CLK_S3D2),
+       DEF_MOD("drif2",                 513,   R8A7795_CLK_S3D2),
+       DEF_MOD("drif1",                 514,   R8A7795_CLK_S3D2),
+       DEF_MOD("drif0",                 515,   R8A7795_CLK_S3D2),
        DEF_MOD("hscif4",                516,   R8A7795_CLK_S3D1),
        DEF_MOD("hscif3",                517,   R8A7795_CLK_S3D1),
        DEF_MOD("hscif2",                518,   R8A7795_CLK_S3D1),
        DEF_MOD("hscif1",                519,   R8A7795_CLK_S3D1),
        DEF_MOD("hscif0",                520,   R8A7795_CLK_S3D1),
+       DEF_MOD("thermal",               522,   R8A7795_CLK_CP),
        DEF_MOD("pwm",                   523,   R8A7795_CLK_S3D4),
        DEF_MOD("fcpvd3",                600,   R8A7795_CLK_S2D1),
        DEF_MOD("fcpvd2",                601,   R8A7795_CLK_S2D1),
@@ -199,7 +189,7 @@ static const struct mssr_mod_clk r8a7795_mod_clks[] __initconst = {
        DEF_MOD("du2",                   722,   R8A7795_CLK_S2D1),
        DEF_MOD("du1",                   723,   R8A7795_CLK_S2D1),
        DEF_MOD("du0",                   724,   R8A7795_CLK_S2D1),
-       DEF_MOD("lvds",                  727,   R8A7795_CLK_S2D1),
+       DEF_MOD("lvds",                  727,   R8A7795_CLK_S0D4),
        DEF_MOD("hdmi1",                 728,   R8A7795_CLK_HDMI),
        DEF_MOD("hdmi0",                 729,   R8A7795_CLK_HDMI),
        DEF_MOD("vin7",                  804,   R8A7795_CLK_S2D1),
@@ -262,225 +252,6 @@ static const unsigned int r8a7795_crit_mod_clks[] __initconst = {
        MOD_CLK_ID(408),        /* INTC-AP (GIC) */
 };
 
-/* -----------------------------------------------------------------------------
- * SDn Clock
- *
- */
-#define CPG_SD_STP_HCK         BIT(9)
-#define CPG_SD_STP_CK          BIT(8)
-
-#define CPG_SD_STP_MASK                (CPG_SD_STP_HCK | CPG_SD_STP_CK)
-#define CPG_SD_FC_MASK         (0x7 << 2 | 0x3 << 0)
-
-#define CPG_SD_DIV_TABLE_DATA(stp_hck, stp_ck, sd_srcfc, sd_fc, sd_div) \
-{ \
-       .val = ((stp_hck) ? CPG_SD_STP_HCK : 0) | \
-              ((stp_ck) ? CPG_SD_STP_CK : 0) | \
-              ((sd_srcfc) << 2) | \
-              ((sd_fc) << 0), \
-       .div = (sd_div), \
-}
-
-struct sd_div_table {
-       u32 val;
-       unsigned int div;
-};
-
-struct sd_clock {
-       struct clk_hw hw;
-       void __iomem *reg;
-       const struct sd_div_table *div_table;
-       unsigned int div_num;
-       unsigned int div_min;
-       unsigned int div_max;
-};
-
-/* SDn divider
- *                     sd_srcfc   sd_fc   div
- * stp_hck   stp_ck    (div)      (div)     = sd_srcfc x sd_fc
- *-------------------------------------------------------------------
- *  0         0         0 (1)      1 (4)      4
- *  0         0         1 (2)      1 (4)      8
- *  1         0         2 (4)      1 (4)     16
- *  1         0         3 (8)      1 (4)     32
- *  1         0         4 (16)     1 (4)     64
- *  0         0         0 (1)      0 (2)      2
- *  0         0         1 (2)      0 (2)      4
- *  1         0         2 (4)      0 (2)      8
- *  1         0         3 (8)      0 (2)     16
- *  1         0         4 (16)     0 (2)     32
- */
-static const struct sd_div_table cpg_sd_div_table[] = {
-/*     CPG_SD_DIV_TABLE_DATA(stp_hck,  stp_ck,   sd_srcfc,   sd_fc,  sd_div) */
-       CPG_SD_DIV_TABLE_DATA(0,        0,        0,          1,        4),
-       CPG_SD_DIV_TABLE_DATA(0,        0,        1,          1,        8),
-       CPG_SD_DIV_TABLE_DATA(1,        0,        2,          1,       16),
-       CPG_SD_DIV_TABLE_DATA(1,        0,        3,          1,       32),
-       CPG_SD_DIV_TABLE_DATA(1,        0,        4,          1,       64),
-       CPG_SD_DIV_TABLE_DATA(0,        0,        0,          0,        2),
-       CPG_SD_DIV_TABLE_DATA(0,        0,        1,          0,        4),
-       CPG_SD_DIV_TABLE_DATA(1,        0,        2,          0,        8),
-       CPG_SD_DIV_TABLE_DATA(1,        0,        3,          0,       16),
-       CPG_SD_DIV_TABLE_DATA(1,        0,        4,          0,       32),
-};
-
-#define to_sd_clock(_hw) container_of(_hw, struct sd_clock, hw)
-
-static int cpg_sd_clock_enable(struct clk_hw *hw)
-{
-       struct sd_clock *clock = to_sd_clock(hw);
-       u32 val, sd_fc;
-       unsigned int i;
-
-       val = clk_readl(clock->reg);
-
-       sd_fc = val & CPG_SD_FC_MASK;
-       for (i = 0; i < clock->div_num; i++)
-               if (sd_fc == (clock->div_table[i].val & CPG_SD_FC_MASK))
-                       break;
-
-       if (i >= clock->div_num)
-               return -EINVAL;
-
-       val &= ~(CPG_SD_STP_MASK);
-       val |= clock->div_table[i].val & CPG_SD_STP_MASK;
-
-       clk_writel(val, clock->reg);
-
-       return 0;
-}
-
-static void cpg_sd_clock_disable(struct clk_hw *hw)
-{
-       struct sd_clock *clock = to_sd_clock(hw);
-
-       clk_writel(clk_readl(clock->reg) | CPG_SD_STP_MASK, clock->reg);
-}
-
-static int cpg_sd_clock_is_enabled(struct clk_hw *hw)
-{
-       struct sd_clock *clock = to_sd_clock(hw);
-
-       return !(clk_readl(clock->reg) & CPG_SD_STP_MASK);
-}
-
-static unsigned long cpg_sd_clock_recalc_rate(struct clk_hw *hw,
-                                               unsigned long parent_rate)
-{
-       struct sd_clock *clock = to_sd_clock(hw);
-       unsigned long rate = parent_rate;
-       u32 val, sd_fc;
-       unsigned int i;
-
-       val = clk_readl(clock->reg);
-
-       sd_fc = val & CPG_SD_FC_MASK;
-       for (i = 0; i < clock->div_num; i++)
-               if (sd_fc == (clock->div_table[i].val & CPG_SD_FC_MASK))
-                       break;
-
-       if (i >= clock->div_num)
-               return -EINVAL;
-
-       return DIV_ROUND_CLOSEST(rate, clock->div_table[i].div);
-}
-
-static unsigned int cpg_sd_clock_calc_div(struct sd_clock *clock,
-                                         unsigned long rate,
-                                         unsigned long parent_rate)
-{
-       unsigned int div;
-
-       if (!rate)
-               rate = 1;
-
-       div = DIV_ROUND_CLOSEST(parent_rate, rate);
-
-       return clamp_t(unsigned int, div, clock->div_min, clock->div_max);
-}
-
-static long cpg_sd_clock_round_rate(struct clk_hw *hw, unsigned long rate,
-                                     unsigned long *parent_rate)
-{
-       struct sd_clock *clock = to_sd_clock(hw);
-       unsigned int div = cpg_sd_clock_calc_div(clock, rate, *parent_rate);
-
-       return DIV_ROUND_CLOSEST(*parent_rate, div);
-}
-
-static int cpg_sd_clock_set_rate(struct clk_hw *hw, unsigned long rate,
-                                  unsigned long parent_rate)
-{
-       struct sd_clock *clock = to_sd_clock(hw);
-       unsigned int div = cpg_sd_clock_calc_div(clock, rate, parent_rate);
-       u32 val;
-       unsigned int i;
-
-       for (i = 0; i < clock->div_num; i++)
-               if (div == clock->div_table[i].div)
-                       break;
-
-       if (i >= clock->div_num)
-               return -EINVAL;
-
-       val = clk_readl(clock->reg);
-       val &= ~(CPG_SD_STP_MASK | CPG_SD_FC_MASK);
-       val |= clock->div_table[i].val & (CPG_SD_STP_MASK | CPG_SD_FC_MASK);
-       clk_writel(val, clock->reg);
-
-       return 0;
-}
-
-static const struct clk_ops cpg_sd_clock_ops = {
-       .enable = cpg_sd_clock_enable,
-       .disable = cpg_sd_clock_disable,
-       .is_enabled = cpg_sd_clock_is_enabled,
-       .recalc_rate = cpg_sd_clock_recalc_rate,
-       .round_rate = cpg_sd_clock_round_rate,
-       .set_rate = cpg_sd_clock_set_rate,
-};
-
-static struct clk * __init cpg_sd_clk_register(const struct cpg_core_clk *core,
-                                              void __iomem *base,
-                                              const char *parent_name)
-{
-       struct clk_init_data init;
-       struct sd_clock *clock;
-       struct clk *clk;
-       unsigned int i;
-
-       clock = kzalloc(sizeof(*clock), GFP_KERNEL);
-       if (!clock)
-               return ERR_PTR(-ENOMEM);
-
-       init.name = core->name;
-       init.ops = &cpg_sd_clock_ops;
-       init.flags = CLK_IS_BASIC | CLK_SET_RATE_PARENT;
-       init.parent_names = &parent_name;
-       init.num_parents = 1;
-
-       clock->reg = base + core->offset;
-       clock->hw.init = &init;
-       clock->div_table = cpg_sd_div_table;
-       clock->div_num = ARRAY_SIZE(cpg_sd_div_table);
-
-       clock->div_max = clock->div_table[0].div;
-       clock->div_min = clock->div_max;
-       for (i = 1; i < clock->div_num; i++) {
-               clock->div_max = max(clock->div_max, clock->div_table[i].div);
-               clock->div_min = min(clock->div_min, clock->div_table[i].div);
-       }
-
-       clk = clk_register(NULL, &clock->hw);
-       if (IS_ERR(clk))
-               kfree(clock);
-
-       return clk;
-}
-
-#define CPG_PLL0CR     0x00d8
-#define CPG_PLL2CR     0x002c
-#define CPG_PLL4CR     0x01f4
 
 /*
  * CPG Clock Data
@@ -512,13 +283,7 @@ static struct clk * __init cpg_sd_clk_register(const struct cpg_core_clk *core,
                                         (((md) & BIT(19)) >> 18) | \
                                         (((md) & BIT(17)) >> 17))
 
-struct cpg_pll_config {
-       unsigned int extal_div;
-       unsigned int pll1_mult;
-       unsigned int pll3_mult;
-};
-
-static const struct cpg_pll_config cpg_pll_configs[16] __initconst = {
+static const struct rcar_gen3_cpg_pll_config cpg_pll_configs[16] __initconst = {
        /* EXTAL div    PLL1 mult       PLL3 mult */
        { 1,            192,            192,    },
        { 1,            192,            128,    },
@@ -538,112 +303,9 @@ static const struct cpg_pll_config cpg_pll_configs[16] __initconst = {
        { 2,            192,            192,    },
 };
 
-static const struct cpg_pll_config *cpg_pll_config __initdata;
-
-static
-struct clk * __init r8a7795_cpg_clk_register(struct device *dev,
-                                            const struct cpg_core_clk *core,
-                                            const struct cpg_mssr_info *info,
-                                            struct clk **clks,
-                                            void __iomem *base)
-{
-       const struct clk *parent;
-       unsigned int mult = 1;
-       unsigned int div = 1;
-       u32 value;
-
-       parent = clks[core->parent];
-       if (IS_ERR(parent))
-               return ERR_CAST(parent);
-
-       switch (core->type) {
-       case CLK_TYPE_GEN3_MAIN:
-               div = cpg_pll_config->extal_div;
-               break;
-
-       case CLK_TYPE_GEN3_PLL0:
-               /*
-                * PLL0 is a configurable multiplier clock. Register it as a
-                * fixed factor clock for now as there's no generic multiplier
-                * clock implementation and we currently have no need to change
-                * the multiplier value.
-                */
-               value = readl(base + CPG_PLL0CR);
-               mult = (((value >> 24) & 0x7f) + 1) * 2;
-               break;
-
-       case CLK_TYPE_GEN3_PLL1:
-               mult = cpg_pll_config->pll1_mult;
-               break;
-
-       case CLK_TYPE_GEN3_PLL2:
-               /*
-                * PLL2 is a configurable multiplier clock. Register it as a
-                * fixed factor clock for now as there's no generic multiplier
-                * clock implementation and we currently have no need to change
-                * the multiplier value.
-                */
-               value = readl(base + CPG_PLL2CR);
-               mult = (((value >> 24) & 0x7f) + 1) * 2;
-               break;
-
-       case CLK_TYPE_GEN3_PLL3:
-               mult = cpg_pll_config->pll3_mult;
-               break;
-
-       case CLK_TYPE_GEN3_PLL4:
-               /*
-                * PLL4 is a configurable multiplier clock. Register it as a
-                * fixed factor clock for now as there's no generic multiplier
-                * clock implementation and we currently have no need to change
-                * the multiplier value.
-                */
-               value = readl(base + CPG_PLL4CR);
-               mult = (((value >> 24) & 0x7f) + 1) * 2;
-               break;
-
-       case CLK_TYPE_GEN3_SD:
-               return cpg_sd_clk_register(core, base, __clk_get_name(parent));
-
-       case CLK_TYPE_GEN3_R:
-               /* RINT is default. Only if EXTALR is populated, we switch to it */
-               value = readl(base + CPG_RCKCR) & 0x3f;
-
-               if (clk_get_rate(clks[CLK_EXTALR])) {
-                       parent = clks[CLK_EXTALR];
-                       value |= BIT(15);
-               }
-
-               writel(value, base + CPG_RCKCR);
-               break;
-
-       default:
-               return ERR_PTR(-EINVAL);
-       }
-
-       return clk_register_fixed_factor(NULL, core->name,
-                                        __clk_get_name(parent), 0, mult, div);
-}
-
-/*
- * Reset register definitions.
- */
-#define MODEMR 0xe6160060
-
-static u32 rcar_gen3_read_mode_pins(void)
-{
-       void __iomem *modemr = ioremap_nocache(MODEMR, 4);
-       u32 mode;
-
-       BUG_ON(!modemr);
-       mode = ioread32(modemr);
-       iounmap(modemr);
-
-       return mode;
-}
-
 static int __init r8a7795_cpg_mssr_init(struct device *dev)
 {
+       const struct rcar_gen3_cpg_pll_config *cpg_pll_config;
        u32 cpg_mode = rcar_gen3_read_mode_pins();
 
        cpg_pll_config = &cpg_pll_configs[CPG_PLL_CONFIG_INDEX(cpg_mode)];
@@ -652,7 +314,7 @@ static int __init r8a7795_cpg_mssr_init(struct device *dev)
                return -EINVAL;
        }
 
-       return 0;
+       return rcar_gen3_cpg_init(cpg_pll_config, CLK_EXTALR);
 }
 
 const struct cpg_mssr_info r8a7795_cpg_mssr_info __initconst = {
@@ -673,5 +335,5 @@ const struct cpg_mssr_info r8a7795_cpg_mssr_info __initconst = {
 
        /* Callbacks */
        .init = r8a7795_cpg_mssr_init,
-       .cpg_clk_register = r8a7795_cpg_clk_register,
+       .cpg_clk_register = rcar_gen3_cpg_clk_register,
 };
diff --git a/drivers/clk/renesas/r8a7796-cpg-mssr.c b/drivers/clk/renesas/r8a7796-cpg-mssr.c
new file mode 100644 (file)
index 0000000..c84b549
--- /dev/null
@@ -0,0 +1,192 @@
+/*
+ * r8a7796 Clock Pulse Generator / Module Standby and Software Reset
+ *
+ * Copyright (C) 2016 Glider bvba
+ *
+ * Based on r8a7795-cpg-mssr.c
+ *
+ * Copyright (C) 2015 Glider bvba
+ * Copyright (C) 2015 Renesas Electronics Corp.
+ *
+ * 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.
+ */
+
+#include <linux/device.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+
+#include <dt-bindings/clock/r8a7796-cpg-mssr.h>
+
+#include "renesas-cpg-mssr.h"
+#include "rcar-gen3-cpg.h"
+
+enum clk_ids {
+       /* Core Clock Outputs exported to DT */
+       LAST_DT_CORE_CLK = R8A7796_CLK_OSC,
+
+       /* External Input Clocks */
+       CLK_EXTAL,
+       CLK_EXTALR,
+
+       /* Internal Core Clocks */
+       CLK_MAIN,
+       CLK_PLL0,
+       CLK_PLL1,
+       CLK_PLL2,
+       CLK_PLL3,
+       CLK_PLL4,
+       CLK_PLL1_DIV2,
+       CLK_PLL1_DIV4,
+       CLK_S0,
+       CLK_S1,
+       CLK_S2,
+       CLK_S3,
+       CLK_SDSRC,
+       CLK_SSPSRC,
+
+       /* Module Clocks */
+       MOD_CLK_BASE
+};
+
+static const struct cpg_core_clk r8a7796_core_clks[] __initconst = {
+       /* External Clock Inputs */
+       DEF_INPUT("extal",  CLK_EXTAL),
+       DEF_INPUT("extalr", CLK_EXTALR),
+
+       /* Internal Core Clocks */
+       DEF_BASE(".main",       CLK_MAIN, CLK_TYPE_GEN3_MAIN, CLK_EXTAL),
+       DEF_BASE(".pll0",       CLK_PLL0, CLK_TYPE_GEN3_PLL0, CLK_MAIN),
+       DEF_BASE(".pll1",       CLK_PLL1, CLK_TYPE_GEN3_PLL1, CLK_MAIN),
+       DEF_BASE(".pll2",       CLK_PLL2, CLK_TYPE_GEN3_PLL2, CLK_MAIN),
+       DEF_BASE(".pll3",       CLK_PLL3, CLK_TYPE_GEN3_PLL3, CLK_MAIN),
+       DEF_BASE(".pll4",       CLK_PLL4, CLK_TYPE_GEN3_PLL4, CLK_MAIN),
+
+       DEF_FIXED(".pll1_div2", CLK_PLL1_DIV2,     CLK_PLL1,       2, 1),
+       DEF_FIXED(".pll1_div4", CLK_PLL1_DIV4,     CLK_PLL1_DIV2,  2, 1),
+       DEF_FIXED(".s0",        CLK_S0,            CLK_PLL1_DIV2,  2, 1),
+       DEF_FIXED(".s1",        CLK_S1,            CLK_PLL1_DIV2,  3, 1),
+       DEF_FIXED(".s2",        CLK_S2,            CLK_PLL1_DIV2,  4, 1),
+       DEF_FIXED(".s3",        CLK_S3,            CLK_PLL1_DIV2,  6, 1),
+
+       /* Core Clock Outputs */
+       DEF_FIXED("ztr",        R8A7796_CLK_ZTR,   CLK_PLL1_DIV2,  6, 1),
+       DEF_FIXED("ztrd2",      R8A7796_CLK_ZTRD2, CLK_PLL1_DIV2, 12, 1),
+       DEF_FIXED("zt",         R8A7796_CLK_ZT,    CLK_PLL1_DIV2,  4, 1),
+       DEF_FIXED("zx",         R8A7796_CLK_ZX,    CLK_PLL1_DIV2,  2, 1),
+       DEF_FIXED("s0d1",       R8A7796_CLK_S0D1,  CLK_S0,         1, 1),
+       DEF_FIXED("s0d2",       R8A7796_CLK_S0D2,  CLK_S0,         2, 1),
+       DEF_FIXED("s0d3",       R8A7796_CLK_S0D3,  CLK_S0,         3, 1),
+       DEF_FIXED("s0d4",       R8A7796_CLK_S0D4,  CLK_S0,         4, 1),
+       DEF_FIXED("s0d6",       R8A7796_CLK_S0D6,  CLK_S0,         6, 1),
+       DEF_FIXED("s0d8",       R8A7796_CLK_S0D8,  CLK_S0,         8, 1),
+       DEF_FIXED("s0d12",      R8A7796_CLK_S0D12, CLK_S0,        12, 1),
+       DEF_FIXED("s1d1",       R8A7796_CLK_S1D1,  CLK_S1,         1, 1),
+       DEF_FIXED("s1d2",       R8A7796_CLK_S1D2,  CLK_S1,         2, 1),
+       DEF_FIXED("s1d4",       R8A7796_CLK_S1D4,  CLK_S1,         4, 1),
+       DEF_FIXED("s2d1",       R8A7796_CLK_S2D1,  CLK_S2,         1, 1),
+       DEF_FIXED("s2d2",       R8A7796_CLK_S2D2,  CLK_S2,         2, 1),
+       DEF_FIXED("s2d4",       R8A7796_CLK_S2D4,  CLK_S2,         4, 1),
+       DEF_FIXED("s3d1",       R8A7796_CLK_S3D1,  CLK_S3,         1, 1),
+       DEF_FIXED("s3d2",       R8A7796_CLK_S3D2,  CLK_S3,         2, 1),
+       DEF_FIXED("s3d4",       R8A7796_CLK_S3D4,  CLK_S3,         4, 1),
+
+       DEF_FIXED("cl",         R8A7796_CLK_CL,    CLK_PLL1_DIV2, 48, 1),
+       DEF_FIXED("cp",         R8A7796_CLK_CP,    CLK_EXTAL,      2, 1),
+};
+
+static const struct mssr_mod_clk r8a7796_mod_clks[] __initconst = {
+       DEF_MOD("scif2",                 310,   R8A7796_CLK_S3D4),
+       DEF_MOD("intc-ap",               408,   R8A7796_CLK_S3D1),
+};
+
+static const unsigned int r8a7796_crit_mod_clks[] __initconst = {
+       MOD_CLK_ID(408),        /* INTC-AP (GIC) */
+};
+
+
+/*
+ * CPG Clock Data
+ */
+
+/*
+ *   MD                EXTAL           PLL0    PLL1    PLL2    PLL3    PLL4
+ * 14 13 19 17 (MHz)
+ *-------------------------------------------------------------------
+ * 0  0  0  0  16.66 x 1       x180    x192    x144    x192    x144
+ * 0  0  0  1  16.66 x 1       x180    x192    x144    x128    x144
+ * 0  0  1  0  Prohibited setting
+ * 0  0  1  1  16.66 x 1       x180    x192    x144    x192    x144
+ * 0  1  0  0  20    x 1       x150    x160    x120    x160    x120
+ * 0  1  0  1  20    x 1       x150    x160    x120    x106    x120
+ * 0  1  1  0  Prohibited setting
+ * 0  1  1  1  20    x 1       x150    x160    x120    x160    x120
+ * 1  0  0  0  25    x 1       x120    x128    x96     x128    x96
+ * 1  0  0  1  25    x 1       x120    x128    x96     x84     x96
+ * 1  0  1  0  Prohibited setting
+ * 1  0  1  1  25    x 1       x120    x128    x96     x128    x96
+ * 1  1  0  0  33.33 / 2       x180    x192    x144    x192    x144
+ * 1  1  0  1  33.33 / 2       x180    x192    x144    x128    x144
+ * 1  1  1  0  Prohibited setting
+ * 1  1  1  1  33.33 / 2       x180    x192    x144    x192    x144
+ */
+#define CPG_PLL_CONFIG_INDEX(md)       ((((md) & BIT(14)) >> 11) | \
+                                        (((md) & BIT(13)) >> 11) | \
+                                        (((md) & BIT(19)) >> 18) | \
+                                        (((md) & BIT(17)) >> 17))
+
+static const struct rcar_gen3_cpg_pll_config cpg_pll_configs[16] __initconst = {
+       /* EXTAL div    PLL1 mult       PLL3 mult */
+       { 1,            192,            192,    },
+       { 1,            192,            128,    },
+       { 0, /* Prohibited setting */           },
+       { 1,            192,            192,    },
+       { 1,            160,            160,    },
+       { 1,            160,            106,    },
+       { 0, /* Prohibited setting */           },
+       { 1,            160,            160,    },
+       { 1,            128,            128,    },
+       { 1,            128,            84,     },
+       { 0, /* Prohibited setting */           },
+       { 1,            128,            128,    },
+       { 2,            192,            192,    },
+       { 2,            192,            128,    },
+       { 0, /* Prohibited setting */           },
+       { 2,            192,            192,    },
+};
+
+static int __init r8a7796_cpg_mssr_init(struct device *dev)
+{
+       const struct rcar_gen3_cpg_pll_config *cpg_pll_config;
+       u32 cpg_mode = rcar_gen3_read_mode_pins();
+
+       cpg_pll_config = &cpg_pll_configs[CPG_PLL_CONFIG_INDEX(cpg_mode)];
+       if (!cpg_pll_config->extal_div) {
+               dev_err(dev, "Prohibited setting (cpg_mode=0x%x)\n", cpg_mode);
+               return -EINVAL;
+       }
+
+       return rcar_gen3_cpg_init(cpg_pll_config, CLK_EXTALR);
+}
+
+const struct cpg_mssr_info r8a7796_cpg_mssr_info __initconst = {
+       /* Core Clocks */
+       .core_clks = r8a7796_core_clks,
+       .num_core_clks = ARRAY_SIZE(r8a7796_core_clks),
+       .last_dt_core_clk = LAST_DT_CORE_CLK,
+       .num_total_core_clks = MOD_CLK_BASE,
+
+       /* Module Clocks */
+       .mod_clks = r8a7796_mod_clks,
+       .num_mod_clks = ARRAY_SIZE(r8a7796_mod_clks),
+       .num_hw_mod_clks = 12 * 32,
+
+       /* Critical Module Clocks */
+       .crit_mod_clks = r8a7796_crit_mod_clks,
+       .num_crit_mod_clks = ARRAY_SIZE(r8a7796_crit_mod_clks),
+
+       /* Callbacks */
+       .init = r8a7796_cpg_mssr_init,
+       .cpg_clk_register = rcar_gen3_cpg_clk_register,
+};
diff --git a/drivers/clk/renesas/rcar-gen3-cpg.c b/drivers/clk/renesas/rcar-gen3-cpg.c
new file mode 100644 (file)
index 0000000..bb4f2f9
--- /dev/null
@@ -0,0 +1,359 @@
+/*
+ * R-Car Gen3 Clock Pulse Generator
+ *
+ * Copyright (C) 2015-2016 Glider bvba
+ *
+ * Based on clk-rcar-gen3.c
+ *
+ * Copyright (C) 2015 Renesas Electronics Corp.
+ *
+ * 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.
+ */
+
+#include <linux/bug.h>
+#include <linux/clk.h>
+#include <linux/clk-provider.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/slab.h>
+
+#include "renesas-cpg-mssr.h"
+#include "rcar-gen3-cpg.h"
+
+#define CPG_PLL0CR             0x00d8
+#define CPG_PLL2CR             0x002c
+#define CPG_PLL4CR             0x01f4
+
+
+/*
+ * SDn Clock
+ */
+#define CPG_SD_STP_HCK         BIT(9)
+#define CPG_SD_STP_CK          BIT(8)
+
+#define CPG_SD_STP_MASK                (CPG_SD_STP_HCK | CPG_SD_STP_CK)
+#define CPG_SD_FC_MASK         (0x7 << 2 | 0x3 << 0)
+
+#define CPG_SD_DIV_TABLE_DATA(stp_hck, stp_ck, sd_srcfc, sd_fc, sd_div) \
+{ \
+       .val = ((stp_hck) ? CPG_SD_STP_HCK : 0) | \
+              ((stp_ck) ? CPG_SD_STP_CK : 0) | \
+              ((sd_srcfc) << 2) | \
+              ((sd_fc) << 0), \
+       .div = (sd_div), \
+}
+
+struct sd_div_table {
+       u32 val;
+       unsigned int div;
+};
+
+struct sd_clock {
+       struct clk_hw hw;
+       void __iomem *reg;
+       const struct sd_div_table *div_table;
+       unsigned int div_num;
+       unsigned int div_min;
+       unsigned int div_max;
+};
+
+/* SDn divider
+ *                     sd_srcfc   sd_fc   div
+ * stp_hck   stp_ck    (div)      (div)     = sd_srcfc x sd_fc
+ *-------------------------------------------------------------------
+ *  0         0         0 (1)      1 (4)      4
+ *  0         0         1 (2)      1 (4)      8
+ *  1         0         2 (4)      1 (4)     16
+ *  1         0         3 (8)      1 (4)     32
+ *  1         0         4 (16)     1 (4)     64
+ *  0         0         0 (1)      0 (2)      2
+ *  0         0         1 (2)      0 (2)      4
+ *  1         0         2 (4)      0 (2)      8
+ *  1         0         3 (8)      0 (2)     16
+ *  1         0         4 (16)     0 (2)     32
+ */
+static const struct sd_div_table cpg_sd_div_table[] = {
+/*     CPG_SD_DIV_TABLE_DATA(stp_hck,  stp_ck,   sd_srcfc,   sd_fc,  sd_div) */
+       CPG_SD_DIV_TABLE_DATA(0,        0,        0,          1,        4),
+       CPG_SD_DIV_TABLE_DATA(0,        0,        1,          1,        8),
+       CPG_SD_DIV_TABLE_DATA(1,        0,        2,          1,       16),
+       CPG_SD_DIV_TABLE_DATA(1,        0,        3,          1,       32),
+       CPG_SD_DIV_TABLE_DATA(1,        0,        4,          1,       64),
+       CPG_SD_DIV_TABLE_DATA(0,        0,        0,          0,        2),
+       CPG_SD_DIV_TABLE_DATA(0,        0,        1,          0,        4),
+       CPG_SD_DIV_TABLE_DATA(1,        0,        2,          0,        8),
+       CPG_SD_DIV_TABLE_DATA(1,        0,        3,          0,       16),
+       CPG_SD_DIV_TABLE_DATA(1,        0,        4,          0,       32),
+};
+
+#define to_sd_clock(_hw) container_of(_hw, struct sd_clock, hw)
+
+static int cpg_sd_clock_enable(struct clk_hw *hw)
+{
+       struct sd_clock *clock = to_sd_clock(hw);
+       u32 val, sd_fc;
+       unsigned int i;
+
+       val = clk_readl(clock->reg);
+
+       sd_fc = val & CPG_SD_FC_MASK;
+       for (i = 0; i < clock->div_num; i++)
+               if (sd_fc == (clock->div_table[i].val & CPG_SD_FC_MASK))
+                       break;
+
+       if (i >= clock->div_num)
+               return -EINVAL;
+
+       val &= ~(CPG_SD_STP_MASK);
+       val |= clock->div_table[i].val & CPG_SD_STP_MASK;
+
+       clk_writel(val, clock->reg);
+
+       return 0;
+}
+
+static void cpg_sd_clock_disable(struct clk_hw *hw)
+{
+       struct sd_clock *clock = to_sd_clock(hw);
+
+       clk_writel(clk_readl(clock->reg) | CPG_SD_STP_MASK, clock->reg);
+}
+
+static int cpg_sd_clock_is_enabled(struct clk_hw *hw)
+{
+       struct sd_clock *clock = to_sd_clock(hw);
+
+       return !(clk_readl(clock->reg) & CPG_SD_STP_MASK);
+}
+
+static unsigned long cpg_sd_clock_recalc_rate(struct clk_hw *hw,
+                                               unsigned long parent_rate)
+{
+       struct sd_clock *clock = to_sd_clock(hw);
+       unsigned long rate = parent_rate;
+       u32 val, sd_fc;
+       unsigned int i;
+
+       val = clk_readl(clock->reg);
+
+       sd_fc = val & CPG_SD_FC_MASK;
+       for (i = 0; i < clock->div_num; i++)
+               if (sd_fc == (clock->div_table[i].val & CPG_SD_FC_MASK))
+                       break;
+
+       if (i >= clock->div_num)
+               return -EINVAL;
+
+       return DIV_ROUND_CLOSEST(rate, clock->div_table[i].div);
+}
+
+static unsigned int cpg_sd_clock_calc_div(struct sd_clock *clock,
+                                         unsigned long rate,
+                                         unsigned long parent_rate)
+{
+       unsigned int div;
+
+       if (!rate)
+               rate = 1;
+
+       div = DIV_ROUND_CLOSEST(parent_rate, rate);
+
+       return clamp_t(unsigned int, div, clock->div_min, clock->div_max);
+}
+
+static long cpg_sd_clock_round_rate(struct clk_hw *hw, unsigned long rate,
+                                     unsigned long *parent_rate)
+{
+       struct sd_clock *clock = to_sd_clock(hw);
+       unsigned int div = cpg_sd_clock_calc_div(clock, rate, *parent_rate);
+
+       return DIV_ROUND_CLOSEST(*parent_rate, div);
+}
+
+static int cpg_sd_clock_set_rate(struct clk_hw *hw, unsigned long rate,
+                                  unsigned long parent_rate)
+{
+       struct sd_clock *clock = to_sd_clock(hw);
+       unsigned int div = cpg_sd_clock_calc_div(clock, rate, parent_rate);
+       u32 val;
+       unsigned int i;
+
+       for (i = 0; i < clock->div_num; i++)
+               if (div == clock->div_table[i].div)
+                       break;
+
+       if (i >= clock->div_num)
+               return -EINVAL;
+
+       val = clk_readl(clock->reg);
+       val &= ~(CPG_SD_STP_MASK | CPG_SD_FC_MASK);
+       val |= clock->div_table[i].val & (CPG_SD_STP_MASK | CPG_SD_FC_MASK);
+       clk_writel(val, clock->reg);
+
+       return 0;
+}
+
+static const struct clk_ops cpg_sd_clock_ops = {
+       .enable = cpg_sd_clock_enable,
+       .disable = cpg_sd_clock_disable,
+       .is_enabled = cpg_sd_clock_is_enabled,
+       .recalc_rate = cpg_sd_clock_recalc_rate,
+       .round_rate = cpg_sd_clock_round_rate,
+       .set_rate = cpg_sd_clock_set_rate,
+};
+
+static struct clk * __init cpg_sd_clk_register(const struct cpg_core_clk *core,
+                                              void __iomem *base,
+                                              const char *parent_name)
+{
+       struct clk_init_data init;
+       struct sd_clock *clock;
+       struct clk *clk;
+       unsigned int i;
+
+       clock = kzalloc(sizeof(*clock), GFP_KERNEL);
+       if (!clock)
+               return ERR_PTR(-ENOMEM);
+
+       init.name = core->name;
+       init.ops = &cpg_sd_clock_ops;
+       init.flags = CLK_IS_BASIC | CLK_SET_RATE_PARENT;
+       init.parent_names = &parent_name;
+       init.num_parents = 1;
+
+       clock->reg = base + core->offset;
+       clock->hw.init = &init;
+       clock->div_table = cpg_sd_div_table;
+       clock->div_num = ARRAY_SIZE(cpg_sd_div_table);
+
+       clock->div_max = clock->div_table[0].div;
+       clock->div_min = clock->div_max;
+       for (i = 1; i < clock->div_num; i++) {
+               clock->div_max = max(clock->div_max, clock->div_table[i].div);
+               clock->div_min = min(clock->div_min, clock->div_table[i].div);
+       }
+
+       clk = clk_register(NULL, &clock->hw);
+       if (IS_ERR(clk))
+               kfree(clock);
+
+       return clk;
+}
+
+
+static const struct rcar_gen3_cpg_pll_config *cpg_pll_config __initdata;
+static unsigned int cpg_clk_extalr __initdata;
+
+struct clk * __init rcar_gen3_cpg_clk_register(struct device *dev,
+       const struct cpg_core_clk *core, const struct cpg_mssr_info *info,
+       struct clk **clks, void __iomem *base)
+{
+       const struct clk *parent;
+       unsigned int mult = 1;
+       unsigned int div = 1;
+       u32 value;
+
+       parent = clks[core->parent];
+       if (IS_ERR(parent))
+               return ERR_CAST(parent);
+
+       switch (core->type) {
+       case CLK_TYPE_GEN3_MAIN:
+               div = cpg_pll_config->extal_div;
+               break;
+
+       case CLK_TYPE_GEN3_PLL0:
+               /*
+                * PLL0 is a configurable multiplier clock. Register it as a
+                * fixed factor clock for now as there's no generic multiplier
+                * clock implementation and we currently have no need to change
+                * the multiplier value.
+                */
+               value = readl(base + CPG_PLL0CR);
+               mult = (((value >> 24) & 0x7f) + 1) * 2;
+               break;
+
+       case CLK_TYPE_GEN3_PLL1:
+               mult = cpg_pll_config->pll1_mult;
+               break;
+
+       case CLK_TYPE_GEN3_PLL2:
+               /*
+                * PLL2 is a configurable multiplier clock. Register it as a
+                * fixed factor clock for now as there's no generic multiplier
+                * clock implementation and we currently have no need to change
+                * the multiplier value.
+                */
+               value = readl(base + CPG_PLL2CR);
+               mult = (((value >> 24) & 0x7f) + 1) * 2;
+               break;
+
+       case CLK_TYPE_GEN3_PLL3:
+               mult = cpg_pll_config->pll3_mult;
+               break;
+
+       case CLK_TYPE_GEN3_PLL4:
+               /*
+                * PLL4 is a configurable multiplier clock. Register it as a
+                * fixed factor clock for now as there's no generic multiplier
+                * clock implementation and we currently have no need to change
+                * the multiplier value.
+                */
+               value = readl(base + CPG_PLL4CR);
+               mult = (((value >> 24) & 0x7f) + 1) * 2;
+               break;
+
+       case CLK_TYPE_GEN3_SD:
+               return cpg_sd_clk_register(core, base, __clk_get_name(parent));
+
+       case CLK_TYPE_GEN3_R:
+               /*
+                * RINT is default.
+                * Only if EXTALR is populated, we switch to it.
+                */
+               value = readl(base + CPG_RCKCR) & 0x3f;
+
+               if (clk_get_rate(clks[cpg_clk_extalr])) {
+                       parent = clks[cpg_clk_extalr];
+                       value |= BIT(15);
+               }
+
+               writel(value, base + CPG_RCKCR);
+               break;
+
+       default:
+               return ERR_PTR(-EINVAL);
+       }
+
+       return clk_register_fixed_factor(NULL, core->name,
+                                        __clk_get_name(parent), 0, mult, div);
+}
+
+/*
+ * Reset register definitions.
+ */
+#define MODEMR 0xe6160060
+
+u32 __init rcar_gen3_read_mode_pins(void)
+{
+       void __iomem *modemr = ioremap_nocache(MODEMR, 4);
+       u32 mode;
+
+       BUG_ON(!modemr);
+       mode = ioread32(modemr);
+       iounmap(modemr);
+
+       return mode;
+}
+
+int __init rcar_gen3_cpg_init(const struct rcar_gen3_cpg_pll_config *config,
+                             unsigned int clk_extalr)
+{
+       cpg_pll_config = config;
+       cpg_clk_extalr = clk_extalr;
+       return 0;
+}
diff --git a/drivers/clk/renesas/rcar-gen3-cpg.h b/drivers/clk/renesas/rcar-gen3-cpg.h
new file mode 100644 (file)
index 0000000..f699085
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * R-Car Gen3 Clock Pulse Generator
+ *
+ * Copyright (C) 2015-2016 Glider bvba
+ *
+ * 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.
+ */
+
+#ifndef __CLK_RENESAS_RCAR_GEN3_CPG_H__
+#define __CLK_RENESAS_RCAR_GEN3_CPG_H__
+
+enum rcar_gen3_clk_types {
+       CLK_TYPE_GEN3_MAIN = CLK_TYPE_CUSTOM,
+       CLK_TYPE_GEN3_PLL0,
+       CLK_TYPE_GEN3_PLL1,
+       CLK_TYPE_GEN3_PLL2,
+       CLK_TYPE_GEN3_PLL3,
+       CLK_TYPE_GEN3_PLL4,
+       CLK_TYPE_GEN3_SD,
+       CLK_TYPE_GEN3_R,
+};
+
+#define DEF_GEN3_SD(_name, _id, _parent, _offset)      \
+       DEF_BASE(_name, _id, CLK_TYPE_GEN3_SD, _parent, .offset = _offset)
+
+struct rcar_gen3_cpg_pll_config {
+       unsigned int extal_div;
+       unsigned int pll1_mult;
+       unsigned int pll3_mult;
+};
+
+#define CPG_RCKCR      0x240
+
+u32 rcar_gen3_read_mode_pins(void);
+struct clk *rcar_gen3_cpg_clk_register(struct device *dev,
+       const struct cpg_core_clk *core, const struct cpg_mssr_info *info,
+       struct clk **clks, void __iomem *base);
+int rcar_gen3_cpg_init(const struct rcar_gen3_cpg_pll_config *config,
+                      unsigned int clk_extalr);
+
+#endif
index 210cd74..e1365e7 100644 (file)
@@ -508,6 +508,12 @@ static const struct of_device_id cpg_mssr_match[] = {
                .compatible = "renesas,r8a7795-cpg-mssr",
                .data = &r8a7795_cpg_mssr_info,
        },
+#endif
+#ifdef CONFIG_ARCH_R8A7796
+       {
+               .compatible = "renesas,r8a7796-cpg-mssr",
+               .data = &r8a7796_cpg_mssr_info,
+       },
 #endif
        { /* sentinel */ }
 };
index 0d1e3e8..ee7edfa 100644 (file)
@@ -131,4 +131,5 @@ struct cpg_mssr_info {
 };
 
 extern const struct cpg_mssr_info r8a7795_cpg_mssr_info;
+extern const struct cpg_mssr_info r8a7796_cpg_mssr_info;
 #endif
index 36c9749..5738635 100644 (file)
@@ -238,7 +238,6 @@ enum clk_id {
        tegra_clk_sor0,
        tegra_clk_sor0_lvds,
        tegra_clk_sor1,
-       tegra_clk_sor1_brick,
        tegra_clk_sor1_src,
        tegra_clk_spdif,
        tegra_clk_spdif_2x,
index 29d04c6..af85c8a 100644 (file)
@@ -594,15 +594,17 @@ static u32 mux_pllp_plld_plld2_clkm_idx[] = {
        [0] = 0, [1] = 2, [2] = 5, [3] = 6
 };
 
-static const char *mux_plldp_sor1_src[] = {
-       "pll_dp", "clk_sor1_src"
-};
-#define mux_plldp_sor1_src_idx NULL
-
-static const char *mux_clkm_sor1_brick_sor1_src[] = {
-       "clk_m", "sor1_brick", "sor1_src", "sor1_brick"
-};
-#define mux_clkm_sor1_brick_sor1_src_idx NULL
+static const char *mux_sor_safe_sor1_brick_sor1_src[] = {
+       /*
+        * Bit 0 of the mux selects sor1_brick, irrespective of bit 1, so the
+        * sor1_brick parent appears twice in the list below. This is merely
+        * to support clk_get_parent() if firmware happened to set these bits
+        * to 0b11. While not an invalid setting, code should always set the
+        * bits to 0b01 to select sor1_brick.
+        */
+       "sor_safe", "sor1_brick", "sor1_src", "sor1_brick"
+};
+#define mux_sor_safe_sor1_brick_sor1_src_idx NULL
 
 static const char *mux_pllp_pllre_clkm[] = {
        "pll_p", "pll_re_out1", "clk_m"
@@ -778,8 +780,7 @@ static struct tegra_periph_init_data periph_clks[] = {
        MUX8("nvjpg", mux_pllc2_c_c3_pllp_plla1_clkm, CLK_SOURCE_NVJPG, 195, 0, tegra_clk_nvjpg),
        MUX8("ape", mux_plla_pllc4_out0_pllc_pllc4_out1_pllp_pllc4_out2_clkm, CLK_SOURCE_APE, 198, TEGRA_PERIPH_ON_APB, tegra_clk_ape),
        MUX8_NOGATE_LOCK("sor1_src", mux_pllp_plld_plld2_clkm, CLK_SOURCE_SOR1, tegra_clk_sor1_src, &sor1_lock),
-       NODIV("sor1_brick", mux_plldp_sor1_src, CLK_SOURCE_SOR1, 14, MASK(1), 183, 0, tegra_clk_sor1_brick, &sor1_lock),
-       NODIV("sor1", mux_clkm_sor1_brick_sor1_src, CLK_SOURCE_SOR1, 15, MASK(1), 183, 0, tegra_clk_sor1, &sor1_lock),
+       NODIV("sor1", mux_sor_safe_sor1_brick_sor1_src, CLK_SOURCE_SOR1, 14, MASK(2), 183, 0, tegra_clk_sor1, &sor1_lock),
        MUX8("sdmmc_legacy", mux_pllp_out3_clkm_pllp_pllc4, CLK_SOURCE_SDMMC_LEGACY, 193, TEGRA_PERIPH_ON_APB | TEGRA_PERIPH_NO_RESET, tegra_clk_sdmmc_legacy),
        MUX8("qspi", mux_pllp_pllc_pllc_out1_pllc4_out2_pllc4_out1_clkm_pllc4_out0, CLK_SOURCE_QSPI, 211, TEGRA_PERIPH_ON_APB, tegra_clk_qspi),
        I2C("vii2c", mux_pllp_pllc_clkm, CLK_SOURCE_VI_I2C, 208, tegra_clk_vi_i2c),
index 456cf58..aab32af 100644 (file)
@@ -1366,9 +1366,9 @@ static u32 pll_expo_p_to_pdiv(u32 p, u32 *pdiv)
 
 static struct tegra_clk_pll_freq_table pll_x_freq_table[] = {
        /* 1 GHz */
-       { 12000000, 1000000000, 166, 1, 1, 0 }, /* actual: 996.0 MHz */
-       { 13000000, 1000000000, 153, 1, 1, 0 }, /* actual: 994.0 MHz */
-       { 38400000, 1000000000, 156, 3, 1, 0 }, /* actual: 998.4 MHz */
+       { 12000000, 1000000000, 166, 1, 2, 0 }, /* actual: 996.0 MHz */
+       { 13000000, 1000000000, 153, 1, 2, 0 }, /* actual: 994.0 MHz */
+       { 38400000, 1000000000, 156, 3, 2, 0 }, /* actual: 998.4 MHz */
        {        0,          0,   0, 0, 0, 0 },
 };
 
@@ -1417,9 +1417,9 @@ static struct div_nmp pllc_nmp = {
 };
 
 static struct tegra_clk_pll_freq_table pll_cx_freq_table[] = {
-       { 12000000, 510000000, 85, 1, 1, 0 },
-       { 13000000, 510000000, 78, 1, 1, 0 }, /* actual: 507.0 MHz */
-       { 38400000, 510000000, 79, 3, 1, 0 }, /* actual: 505.6 MHz */
+       { 12000000, 510000000, 85, 1, 2, 0 },
+       { 13000000, 510000000, 78, 1, 2, 0 }, /* actual: 507.0 MHz */
+       { 38400000, 510000000, 79, 3, 2, 0 }, /* actual: 505.6 MHz */
        {        0,         0,  0, 0, 0, 0 },
 };
 
@@ -1532,9 +1532,9 @@ static struct div_nmp pllss_nmp = {
 };
 
 static struct tegra_clk_pll_freq_table pll_c4_vco_freq_table[] = {
-       { 12000000, 600000000, 50, 1, 0, 0 },
-       { 13000000, 600000000, 46, 1, 0, 0 }, /* actual: 598.0 MHz */
-       { 38400000, 600000000, 62, 4, 0, 0 }, /* actual: 595.2 MHz */
+       { 12000000, 600000000, 50, 1, 1, 0 },
+       { 13000000, 600000000, 46, 1, 1, 0 }, /* actual: 598.0 MHz */
+       { 38400000, 600000000, 62, 4, 1, 0 }, /* actual: 595.2 MHz */
        {        0,         0,  0, 0, 0, 0 },
 };
 
@@ -1583,19 +1583,19 @@ static struct tegra_clk_pll_params pll_c4_vco_params = {
 };
 
 static struct tegra_clk_pll_freq_table pll_m_freq_table[] = {
-       { 12000000,  800000000,  66, 1, 0, 0 }, /* actual: 792.0 MHz */
-       { 13000000,  800000000,  61, 1, 0, 0 }, /* actual: 793.0 MHz */
-       { 38400000,  297600000,  93, 4, 2, 0 },
-       { 38400000,  400000000, 125, 4, 2, 0 },
-       { 38400000,  532800000, 111, 4, 1, 0 },
-       { 38400000,  665600000, 104, 3, 1, 0 },
-       { 38400000,  800000000, 125, 3, 1, 0 },
-       { 38400000,  931200000,  97, 4, 0, 0 },
-       { 38400000, 1065600000, 111, 4, 0, 0 },
-       { 38400000, 1200000000, 125, 4, 0, 0 },
-       { 38400000, 1331200000, 104, 3, 0, 0 },
-       { 38400000, 1459200000,  76, 2, 0, 0 },
-       { 38400000, 1600000000, 125, 3, 0, 0 },
+       { 12000000,  800000000,  66, 1, 1, 0 }, /* actual: 792.0 MHz */
+       { 13000000,  800000000,  61, 1, 1, 0 }, /* actual: 793.0 MHz */
+       { 38400000,  297600000,  93, 4, 3, 0 },
+       { 38400000,  400000000, 125, 4, 3, 0 },
+       { 38400000,  532800000, 111, 4, 2, 0 },
+       { 38400000,  665600000, 104, 3, 2, 0 },
+       { 38400000,  800000000, 125, 3, 2, 0 },
+       { 38400000,  931200000,  97, 4, 1, 0 },
+       { 38400000, 1065600000, 111, 4, 1, 0 },
+       { 38400000, 1200000000, 125, 4, 1, 0 },
+       { 38400000, 1331200000, 104, 3, 1, 0 },
+       { 38400000, 1459200000,  76, 2, 1, 0 },
+       { 38400000, 1600000000, 125, 3, 1, 0 },
        {        0,          0,   0, 0, 0, 0 },
 };
 
@@ -1705,9 +1705,9 @@ static struct tegra_clk_pll_params pll_e_params = {
 };
 
 static struct tegra_clk_pll_freq_table pll_re_vco_freq_table[] = {
-       { 12000000, 672000000, 56, 1, 0, 0 },
-       { 13000000, 672000000, 51, 1, 0, 0 }, /* actual: 663.0 MHz */
-       { 38400000, 672000000, 70, 4, 0, 0 },
+       { 12000000, 672000000, 56, 1, 1, 0 },
+       { 13000000, 672000000, 51, 1, 1, 0 }, /* actual: 663.0 MHz */
+       { 38400000, 672000000, 70, 4, 1, 0 },
        {        0,         0,  0, 0, 0, 0 },
 };
 
@@ -1754,8 +1754,8 @@ static struct div_nmp pllp_nmp = {
 };
 
 static struct tegra_clk_pll_freq_table pll_p_freq_table[] = {
-       { 12000000, 408000000, 34, 1, 0, 0 },
-       { 38400000, 408000000, 85, 8, 0, 0 }, /* cf = 4.8MHz, allowed exception */
+       { 12000000, 408000000, 34, 1, 1, 0 },
+       { 38400000, 408000000, 85, 8, 1, 0 }, /* cf = 4.8MHz, allowed exception */
        {        0,         0,  0, 0, 0, 0 },
 };
 
@@ -1820,14 +1820,14 @@ static struct div_nmp plla_nmp = {
 };
 
 static struct tegra_clk_pll_freq_table pll_a_freq_table[] = {
-       { 12000000, 282240000, 47, 1, 1, 1, 0xf148 }, /* actual: 282240234 */
-       { 12000000, 368640000, 61, 1, 1, 1, 0xfe15 }, /* actual: 368640381 */
-       { 12000000, 240000000, 60, 1, 2, 1,      0 },
-       { 13000000, 282240000, 43, 1, 1, 1, 0xfd7d }, /* actual: 282239807 */
-       { 13000000, 368640000, 56, 1, 1, 1, 0x06d8 }, /* actual: 368640137 */
-       { 13000000, 240000000, 55, 1, 2, 1,      0 }, /* actual: 238.3 MHz */
-       { 38400000, 282240000, 44, 3, 1, 1, 0xf333 }, /* actual: 282239844 */
-       { 38400000, 368640000, 57, 3, 1, 1, 0x0333 }, /* actual: 368639844 */
+       { 12000000, 282240000, 47, 1, 2, 1, 0xf148 }, /* actual: 282240234 */
+       { 12000000, 368640000, 61, 1, 2, 1, 0xfe15 }, /* actual: 368640381 */
+       { 12000000, 240000000, 60, 1, 3, 1,      0 },
+       { 13000000, 282240000, 43, 1, 2, 1, 0xfd7d }, /* actual: 282239807 */
+       { 13000000, 368640000, 56, 1, 2, 1, 0x06d8 }, /* actual: 368640137 */
+       { 13000000, 240000000, 55, 1, 3, 1,      0 }, /* actual: 238.3 MHz */
+       { 38400000, 282240000, 44, 3, 2, 1, 0xf333 }, /* actual: 282239844 */
+       { 38400000, 368640000, 57, 3, 2, 1, 0x0333 }, /* actual: 368639844 */
        { 38400000, 240000000, 75, 3, 3, 1,      0 },
        {        0,         0,  0, 0, 0, 0,      0 },
 };
@@ -1873,9 +1873,9 @@ static struct div_nmp plld_nmp = {
 };
 
 static struct tegra_clk_pll_freq_table pll_d_freq_table[] = {
-       { 12000000, 594000000, 99, 1, 1, 0,      0 },
-       { 13000000, 594000000, 91, 1, 1, 0, 0xfc4f }, /* actual: 594000183 */
-       { 38400000, 594000000, 30, 1, 1, 0, 0x0e00 },
+       { 12000000, 594000000, 99, 1, 2, 0,      0 },
+       { 13000000, 594000000, 91, 1, 2, 0, 0xfc4f }, /* actual: 594000183 */
+       { 38400000, 594000000, 30, 1, 2, 0, 0x0e00 },
        {        0,         0,  0, 0, 0, 0,      0 },
 };
 
@@ -1911,9 +1911,9 @@ static struct tegra_clk_pll_params pll_d_params = {
 };
 
 static struct tegra_clk_pll_freq_table tegra210_pll_d2_freq_table[] = {
-       { 12000000, 594000000, 99, 1, 1, 0, 0xf000 },
-       { 13000000, 594000000, 91, 1, 1, 0, 0xfc4f }, /* actual: 594000183 */
-       { 38400000, 594000000, 30, 1, 1, 0, 0x0e00 },
+       { 12000000, 594000000, 99, 1, 2, 0, 0xf000 },
+       { 13000000, 594000000, 91, 1, 2, 0, 0xfc4f }, /* actual: 594000183 */
+       { 38400000, 594000000, 30, 1, 2, 0, 0x0e00 },
        {        0,         0,  0, 0, 0, 0,      0 },
 };
 
@@ -1935,8 +1935,9 @@ static struct tegra_clk_pll_params pll_d2_params = {
        .sdm_din_mask = PLLA_SDM_DIN_MASK,
        .sdm_ctrl_reg = PLLD2_MISC1,
        .sdm_ctrl_en_mask = PLLD2_SDM_EN_MASK,
-       .ssc_ctrl_reg = PLLD2_MISC1,
-       .ssc_ctrl_en_mask = PLLD2_SSC_EN_MASK,
+       /* disable spread-spectrum for pll_d2 */
+       .ssc_ctrl_reg = 0,
+       .ssc_ctrl_en_mask = 0,
        .round_p_to_pdiv = pll_qlin_p_to_pdiv,
        .pdiv_tohw = pll_qlin_pdiv_to_hw,
        .div_nmp = &pllss_nmp,
@@ -1955,9 +1956,9 @@ static struct tegra_clk_pll_params pll_d2_params = {
 };
 
 static struct tegra_clk_pll_freq_table pll_dp_freq_table[] = {
-       { 12000000, 270000000, 90, 1, 3, 0, 0xf000 },
-       { 13000000, 270000000, 83, 1, 3, 0, 0xf000 }, /* actual: 269.8 MHz */
-       { 38400000, 270000000, 28, 1, 3, 0, 0xf400 },
+       { 12000000, 270000000, 90, 1, 4, 0, 0xf000 },
+       { 13000000, 270000000, 83, 1, 4, 0, 0xf000 }, /* actual: 269.8 MHz */
+       { 38400000, 270000000, 28, 1, 4, 0, 0xf400 },
        {        0,         0,  0, 0, 0, 0,      0 },
 };
 
@@ -2007,9 +2008,9 @@ static struct div_nmp pllu_nmp = {
 };
 
 static struct tegra_clk_pll_freq_table pll_u_freq_table[] = {
-       { 12000000, 480000000, 40, 1, 0, 0 },
-       { 13000000, 480000000, 36, 1, 0, 0 }, /* actual: 468.0 MHz */
-       { 38400000, 480000000, 25, 2, 0, 0 },
+       { 12000000, 480000000, 40, 1, 1, 0 },
+       { 13000000, 480000000, 36, 1, 1, 0 }, /* actual: 468.0 MHz */
+       { 38400000, 480000000, 25, 2, 1, 0 },
        {        0,         0,  0, 0, 0, 0 },
 };
 
@@ -2154,6 +2155,8 @@ static struct tegra_clk tegra210_clks[tegra_clk_max] __initdata = {
        [tegra_clk_dpaux1] = { .dt_id = TEGRA210_CLK_DPAUX1, .present = true },
        [tegra_clk_sor0] = { .dt_id = TEGRA210_CLK_SOR0, .present = true },
        [tegra_clk_sor0_lvds] = { .dt_id = TEGRA210_CLK_SOR0_LVDS, .present = true },
+       [tegra_clk_sor1] = { .dt_id = TEGRA210_CLK_SOR1, .present = true },
+       [tegra_clk_sor1_src] = { .dt_id = TEGRA210_CLK_SOR1_SRC, .present = true },
        [tegra_clk_gpu] = { .dt_id = TEGRA210_CLK_GPU, .present = true },
        [tegra_clk_pll_g_ref] = { .dt_id = TEGRA210_CLK_PLL_G_REF, .present = true, },
        [tegra_clk_uartb_8] = { .dt_id = TEGRA210_CLK_UARTB, .present = true },
index 0b2733d..ab37f4d 100644 (file)
@@ -12,8 +12,12 @@ menuconfig RESET_CONTROLLER
 
          If unsure, say no.
 
+if RESET_CONTROLLER
+
 config RESET_OXNAS
        bool
 
 source "drivers/reset/sti/Kconfig"
 source "drivers/reset/hisilicon/Kconfig"
+
+endif
index f173fc3..03dc1bb 100644 (file)
@@ -3,6 +3,7 @@ obj-$(CONFIG_ARCH_LPC18XX) += reset-lpc18xx.o
 obj-$(CONFIG_ARCH_SOCFPGA) += reset-socfpga.o
 obj-$(CONFIG_ARCH_BERLIN) += reset-berlin.o
 obj-$(CONFIG_MACH_PISTACHIO) += reset-pistachio.o
+obj-$(CONFIG_ARCH_MESON) += reset-meson.o
 obj-$(CONFIG_ARCH_SUNXI) += reset-sunxi.o
 obj-$(CONFIG_ARCH_STI) += sti/
 obj-$(CONFIG_ARCH_HISI) += hisilicon/
index 72b32bd..395dc9c 100644 (file)
@@ -93,6 +93,43 @@ void reset_controller_unregister(struct reset_controller_dev *rcdev)
 }
 EXPORT_SYMBOL_GPL(reset_controller_unregister);
 
+static void devm_reset_controller_release(struct device *dev, void *res)
+{
+       reset_controller_unregister(*(struct reset_controller_dev **)res);
+}
+
+/**
+ * devm_reset_controller_register - resource managed reset_controller_register()
+ * @dev: device that is registering this reset controller
+ * @rcdev: a pointer to the initialized reset controller device
+ *
+ * Managed reset_controller_register(). For reset controllers registered by
+ * this function, reset_controller_unregister() is automatically called on
+ * driver detach. See reset_controller_register() for more information.
+ */
+int devm_reset_controller_register(struct device *dev,
+                                  struct reset_controller_dev *rcdev)
+{
+       struct reset_controller_dev **rcdevp;
+       int ret;
+
+       rcdevp = devres_alloc(devm_reset_controller_release, sizeof(*rcdevp),
+                             GFP_KERNEL);
+       if (!rcdevp)
+               return -ENOMEM;
+
+       ret = reset_controller_register(rcdev);
+       if (!ret) {
+               *rcdevp = rcdev;
+               devres_add(dev, rcdevp);
+       } else {
+               devres_free(rcdevp);
+       }
+
+       return ret;
+}
+EXPORT_SYMBOL_GPL(devm_reset_controller_register);
+
 /**
  * reset_control_reset - reset the controlled device
  * @rstc: reset controller
index ccb940a..16d410c 100644 (file)
@@ -112,7 +112,7 @@ static int ath79_reset_probe(struct platform_device *pdev)
        ath79_reset->rcdev.of_reset_n_cells = 1;
        ath79_reset->rcdev.nr_resets = 32;
 
-       err = reset_controller_register(&ath79_reset->rcdev);
+       err = devm_reset_controller_register(&pdev->dev, &ath79_reset->rcdev);
        if (err)
                return err;
 
@@ -131,7 +131,6 @@ static int ath79_reset_remove(struct platform_device *pdev)
        struct ath79_reset *ath79_reset = platform_get_drvdata(pdev);
 
        unregister_restart_handler(&ath79_reset->restart_nb);
-       reset_controller_unregister(&ath79_reset->rcdev);
 
        return 0;
 }
diff --git a/drivers/reset/reset-meson.c b/drivers/reset/reset-meson.c
new file mode 100644 (file)
index 0000000..c32f11a
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ * This file is provided under a dual BSD/GPLv2 license.  When using or
+ * redistributing this file, you may do so under either license.
+ *
+ * GPL LICENSE SUMMARY
+ *
+ * Copyright (c) 2016 BayLibre, SAS.
+ * Author: Neil Armstrong <narmstrong@baylibre.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * 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/>.
+ * The full GNU General Public License is included in this distribution
+ * in the file called COPYING.
+ *
+ * BSD LICENSE
+ *
+ * Copyright (c) 2016 BayLibre, SAS.
+ * Author: Neil Armstrong <narmstrong@baylibre.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <linux/err.h>
+#include <linux/module.h>
+#include <linux/io.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/reset-controller.h>
+#include <linux/slab.h>
+#include <linux/types.h>
+
+#define REG_COUNT      8
+#define BITS_PER_REG   32
+
+struct meson_reset {
+       void __iomem *reg_base;
+       struct reset_controller_dev rcdev;
+};
+
+static int meson_reset_reset(struct reset_controller_dev *rcdev,
+                             unsigned long id)
+{
+       struct meson_reset *data =
+               container_of(rcdev, struct meson_reset, rcdev);
+       unsigned int bank = id / BITS_PER_REG;
+       unsigned int offset = id % BITS_PER_REG;
+       void __iomem *reg_addr = data->reg_base + (bank << 2);
+
+       if (bank >= REG_COUNT)
+               return -EINVAL;
+
+       writel(BIT(offset), reg_addr);
+
+       return 0;
+}
+
+static const struct reset_control_ops meson_reset_ops = {
+       .reset          = meson_reset_reset,
+};
+
+static const struct of_device_id meson_reset_dt_ids[] = {
+        { .compatible = "amlogic,meson8b-reset", },
+        { .compatible = "amlogic,meson-gxbb-reset", },
+        { /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(of, meson_reset_dt_ids);
+
+static int meson_reset_probe(struct platform_device *pdev)
+{
+       struct meson_reset *data;
+       struct resource *res;
+
+       data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+       if (!data)
+               return -ENOMEM;
+
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       data->reg_base = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(data->reg_base))
+               return PTR_ERR(data->reg_base);
+
+       platform_set_drvdata(pdev, data);
+
+       data->rcdev.owner = THIS_MODULE;
+       data->rcdev.nr_resets = REG_COUNT * BITS_PER_REG;
+       data->rcdev.ops = &meson_reset_ops;
+       data->rcdev.of_node = pdev->dev.of_node;
+
+       return devm_reset_controller_register(&pdev->dev, &data->rcdev);
+}
+
+static struct platform_driver meson_reset_driver = {
+       .probe  = meson_reset_probe,
+       .driver = {
+               .name           = "meson_reset",
+               .of_match_table = meson_reset_dt_ids,
+       },
+};
+
+module_platform_driver(meson_reset_driver);
+
+MODULE_AUTHOR("Neil Armstrong <narmstrong@baylibre.com>");
+MODULE_DESCRIPTION("Amlogic Meson Reset Controller driver");
+MODULE_LICENSE("Dual BSD/GPL");
index c60fb2d..9449805 100644 (file)
@@ -112,21 +112,11 @@ static int oxnas_reset_probe(struct platform_device *pdev)
        data->rcdev.ops = &oxnas_reset_ops;
        data->rcdev.of_node = pdev->dev.of_node;
 
-       return reset_controller_register(&data->rcdev);
-}
-
-static int oxnas_reset_remove(struct platform_device *pdev)
-{
-       struct oxnas_reset *data = platform_get_drvdata(pdev);
-
-       reset_controller_unregister(&data->rcdev);
-
-       return 0;
+       return devm_reset_controller_register(&pdev->dev, &data->rcdev);
 }
 
 static struct platform_driver oxnas_reset_driver = {
        .probe  = oxnas_reset_probe,
-       .remove = oxnas_reset_remove,
        .driver = {
                .name           = "oxnas-reset",
                .of_match_table = oxnas_reset_dt_ids,
index 72a97a1..bbc4c06 100644 (file)
@@ -121,16 +121,7 @@ static int pistachio_reset_probe(struct platform_device *pdev)
        rd->rcdev.ops = &pistachio_reset_ops;
        rd->rcdev.of_node = np;
 
-       return reset_controller_register(&rd->rcdev);
-}
-
-static int pistachio_reset_remove(struct platform_device *pdev)
-{
-       struct pistachio_reset_data *data = platform_get_drvdata(pdev);
-
-       reset_controller_unregister(&data->rcdev);
-
-       return 0;
+       return devm_reset_controller_register(dev, &rd->rcdev);
 }
 
 static const struct of_device_id pistachio_reset_dt_ids[] = {
@@ -141,7 +132,6 @@ MODULE_DEVICE_TABLE(of, pistachio_reset_dt_ids);
 
 static struct platform_driver pistachio_reset_driver = {
        .probe  = pistachio_reset_probe,
-       .remove = pistachio_reset_remove,
        .driver = {
                .name           = "pistachio-reset",
                .of_match_table = pistachio_reset_dt_ids,
index cd05a70..12add9b 100644 (file)
@@ -134,16 +134,7 @@ static int socfpga_reset_probe(struct platform_device *pdev)
        data->rcdev.ops = &socfpga_reset_ops;
        data->rcdev.of_node = pdev->dev.of_node;
 
-       return reset_controller_register(&data->rcdev);
-}
-
-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;
+       return devm_reset_controller_register(dev, &data->rcdev);
 }
 
 static const struct of_device_id socfpga_reset_dt_ids[] = {
@@ -153,7 +144,6 @@ static const struct of_device_id socfpga_reset_dt_ids[] = {
 
 static struct platform_driver socfpga_reset_driver = {
        .probe  = socfpga_reset_probe,
-       .remove = socfpga_reset_remove,
        .driver = {
                .name           = "socfpga-reset",
                .of_match_table = socfpga_reset_dt_ids,
index 677f865..3080190 100644 (file)
@@ -165,21 +165,11 @@ static int sunxi_reset_probe(struct platform_device *pdev)
        data->rcdev.ops = &sunxi_reset_ops;
        data->rcdev.of_node = pdev->dev.of_node;
 
-       return reset_controller_register(&data->rcdev);
-}
-
-static int sunxi_reset_remove(struct platform_device *pdev)
-{
-       struct sunxi_reset_data *data = platform_get_drvdata(pdev);
-
-       reset_controller_unregister(&data->rcdev);
-
-       return 0;
+       return devm_reset_controller_register(&pdev->dev, &data->rcdev);
 }
 
 static struct platform_driver sunxi_reset_driver = {
        .probe  = sunxi_reset_probe,
-       .remove = sunxi_reset_remove,
        .driver = {
                .name           = "sunxi-reset",
                .of_match_table = sunxi_reset_dt_ids,
index a7e87bc..138f2f2 100644 (file)
@@ -122,16 +122,7 @@ static int zynq_reset_probe(struct platform_device *pdev)
        priv->rcdev.ops = &zynq_reset_ops;
        priv->rcdev.of_node = pdev->dev.of_node;
 
-       return reset_controller_register(&priv->rcdev);
-}
-
-static int zynq_reset_remove(struct platform_device *pdev)
-{
-       struct zynq_reset_data *priv = platform_get_drvdata(pdev);
-
-       reset_controller_unregister(&priv->rcdev);
-
-       return 0;
+       return devm_reset_controller_register(&pdev->dev, &priv->rcdev);
 }
 
 static const struct of_device_id zynq_reset_dt_ids[] = {
@@ -141,7 +132,6 @@ static const struct of_device_id zynq_reset_dt_ids[] = {
 
 static struct platform_driver zynq_reset_driver = {
        .probe  = zynq_reset_probe,
-       .remove = zynq_reset_remove,
        .driver = {
                .name           = KBUILD_MODNAME,
                .of_match_table = zynq_reset_dt_ids,
index f8c15a3..6131785 100644 (file)
@@ -2,7 +2,6 @@ if ARCH_STI
 
 config STI_RESET_SYSCFG
        bool
-       select RESET_CONTROLLER
 
 config STIH415_RESET
        bool
index 151fcd3..cd85cd5 100644 (file)
@@ -5,3 +5,4 @@ obj-$(CONFIG_ARCH_R8A7791)      += rcar-sysc.o r8a7791-sysc.o
 obj-$(CONFIG_ARCH_R8A7793)     += rcar-sysc.o r8a7791-sysc.o
 obj-$(CONFIG_ARCH_R8A7794)     += rcar-sysc.o r8a7794-sysc.o
 obj-$(CONFIG_ARCH_R8A7795)     += rcar-sysc.o r8a7795-sysc.o
+obj-$(CONFIG_ARCH_R8A7796)     += rcar-sysc.o r8a7796-sysc.o
diff --git a/drivers/soc/renesas/r8a7796-sysc.c b/drivers/soc/renesas/r8a7796-sysc.c
new file mode 100644 (file)
index 0000000..f700c84
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Renesas R-Car M3-W System Controller
+ *
+ * Copyright (C) 2016 Glider bvba
+ *
+ * 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.
+ */
+
+#include <linux/bug.h>
+#include <linux/kernel.h>
+
+#include <dt-bindings/power/r8a7796-sysc.h>
+
+#include "rcar-sysc.h"
+
+static const struct rcar_sysc_area r8a7796_areas[] __initconst = {
+       { "always-on",      0, 0, R8A7796_PD_ALWAYS_ON, -1, PD_ALWAYS_ON },
+       { "ca57-scu",   0x1c0, 0, R8A7796_PD_CA57_SCU,  R8A7796_PD_ALWAYS_ON,
+         PD_SCU },
+       { "ca57-cpu0",   0x80, 0, R8A7796_PD_CA57_CPU0, R8A7796_PD_CA57_SCU,
+         PD_CPU_NOCR },
+       { "ca57-cpu1",   0x80, 1, R8A7796_PD_CA57_CPU1, R8A7796_PD_CA57_SCU,
+         PD_CPU_NOCR },
+       { "ca53-scu",   0x140, 0, R8A7796_PD_CA53_SCU,  R8A7796_PD_ALWAYS_ON,
+         PD_SCU },
+       { "ca53-cpu0",  0x200, 0, R8A7796_PD_CA53_CPU0, R8A7796_PD_CA53_SCU,
+         PD_CPU_NOCR },
+       { "ca53-cpu1",  0x200, 1, R8A7796_PD_CA53_CPU1, R8A7796_PD_CA53_SCU,
+         PD_CPU_NOCR },
+       { "ca53-cpu2",  0x200, 2, R8A7796_PD_CA53_CPU2, R8A7796_PD_CA53_SCU,
+         PD_CPU_NOCR },
+       { "ca53-cpu3",  0x200, 3, R8A7796_PD_CA53_CPU3, R8A7796_PD_CA53_SCU,
+         PD_CPU_NOCR },
+       { "cr7",        0x240, 0, R8A7796_PD_CR7,       R8A7796_PD_ALWAYS_ON },
+       { "a3vc",       0x380, 0, R8A7796_PD_A3VC,      R8A7796_PD_ALWAYS_ON },
+       { "a2vc0",      0x3c0, 0, R8A7796_PD_A2VC0,     R8A7796_PD_A3VC },
+       { "a2vc1",      0x3c0, 1, R8A7796_PD_A2VC1,     R8A7796_PD_A3VC },
+       { "3dg-a",      0x100, 0, R8A7796_PD_3DG_A,     R8A7796_PD_ALWAYS_ON },
+       { "3dg-b",      0x100, 1, R8A7796_PD_3DG_B,     R8A7796_PD_3DG_A },
+       { "a3ir",       0x180, 0, R8A7796_PD_A3IR,      R8A7796_PD_ALWAYS_ON },
+};
+
+const struct rcar_sysc_info r8a7796_sysc_info __initconst = {
+       .areas = r8a7796_areas,
+       .num_areas = ARRAY_SIZE(r8a7796_areas),
+};
index 79dbc77..fc997d4 100644 (file)
@@ -302,6 +302,9 @@ static const struct of_device_id rcar_sysc_matches[] = {
 #endif
 #ifdef CONFIG_ARCH_R8A7795
        { .compatible = "renesas,r8a7795-sysc", .data = &r8a7795_sysc_info },
+#endif
+#ifdef CONFIG_ARCH_R8A7796
+       { .compatible = "renesas,r8a7796-sysc", .data = &r8a7796_sysc_info },
 #endif
        { /* sentinel */ }
 };
index 5e76617..4ac3d7b 100644 (file)
@@ -55,4 +55,5 @@ extern const struct rcar_sysc_info r8a7790_sysc_info;
 extern const struct rcar_sysc_info r8a7791_sysc_info;
 extern const struct rcar_sysc_info r8a7794_sysc_info;
 extern const struct rcar_sysc_info r8a7795_sysc_info;
+extern const struct rcar_sysc_info r8a7796_sysc_info;
 #endif /* __SOC_RENESAS_RCAR_SYSC_H__ */
diff --git a/include/dt-bindings/clock/r8a7796-cpg-mssr.h b/include/dt-bindings/clock/r8a7796-cpg-mssr.h
new file mode 100644 (file)
index 0000000..1e59426
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2016 Renesas Electronics Corp.
+ *
+ * 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 __DT_BINDINGS_CLOCK_R8A7796_CPG_MSSR_H__
+#define __DT_BINDINGS_CLOCK_R8A7796_CPG_MSSR_H__
+
+#include <dt-bindings/clock/renesas-cpg-mssr.h>
+
+/* r8a7796 CPG Core Clocks */
+#define R8A7796_CLK_Z                  0
+#define R8A7796_CLK_Z2                 1
+#define R8A7796_CLK_ZR                 2
+#define R8A7796_CLK_ZG                 3
+#define R8A7796_CLK_ZTR                        4
+#define R8A7796_CLK_ZTRD2              5
+#define R8A7796_CLK_ZT                 6
+#define R8A7796_CLK_ZX                 7
+#define R8A7796_CLK_S0D1               8
+#define R8A7796_CLK_S0D2               9
+#define R8A7796_CLK_S0D3               10
+#define R8A7796_CLK_S0D4               11
+#define R8A7796_CLK_S0D6               12
+#define R8A7796_CLK_S0D8               13
+#define R8A7796_CLK_S0D12              14
+#define R8A7796_CLK_S1D1               15
+#define R8A7796_CLK_S1D2               16
+#define R8A7796_CLK_S1D4               17
+#define R8A7796_CLK_S2D1               18
+#define R8A7796_CLK_S2D2               19
+#define R8A7796_CLK_S2D4               20
+#define R8A7796_CLK_S3D1               21
+#define R8A7796_CLK_S3D2               22
+#define R8A7796_CLK_S3D4               23
+#define R8A7796_CLK_LB                 24
+#define R8A7796_CLK_CL                 25
+#define R8A7796_CLK_ZB3                        26
+#define R8A7796_CLK_ZB3D2              27
+#define R8A7796_CLK_ZB3D4              28
+#define R8A7796_CLK_CR                 29
+#define R8A7796_CLK_CRD2               30
+#define R8A7796_CLK_SD0H               31
+#define R8A7796_CLK_SD0                        32
+#define R8A7796_CLK_SD1H               33
+#define R8A7796_CLK_SD1                        34
+#define R8A7796_CLK_SD2H               35
+#define R8A7796_CLK_SD2                        36
+#define R8A7796_CLK_SD3H               37
+#define R8A7796_CLK_SD3                        38
+#define R8A7796_CLK_SSP2               39
+#define R8A7796_CLK_SSP1               40
+#define R8A7796_CLK_SSPRS              41
+#define R8A7796_CLK_RPC                        42
+#define R8A7796_CLK_RPCD2              43
+#define R8A7796_CLK_MSO                        44
+#define R8A7796_CLK_CANFD              45
+#define R8A7796_CLK_HDMI               46
+#define R8A7796_CLK_CSI0               47
+#define R8A7796_CLK_CSIREF             48
+#define R8A7796_CLK_CP                 49
+#define R8A7796_CLK_CPEX               50
+#define R8A7796_CLK_R                  51
+#define R8A7796_CLK_OSC                        52
+
+#endif /* __DT_BINDINGS_CLOCK_R8A7796_CPG_MSSR_H__ */
index bd3530e..35288b2 100644 (file)
 #define TEGRA210_CLK_CLK_OUT_3 279
 #define TEGRA210_CLK_BLINK 280
 /* 281 */
-/* 282 */
+#define TEGRA210_CLK_SOR1_SRC 282
 /* 283 */
 #define TEGRA210_CLK_XUSB_HOST_SRC 284
 #define TEGRA210_CLK_XUSB_FALCON_SRC 285
diff --git a/include/dt-bindings/power/r8a7796-sysc.h b/include/dt-bindings/power/r8a7796-sysc.h
new file mode 100644 (file)
index 0000000..5b4daab
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2016 Glider bvba
+ *
+ * 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.
+ */
+#ifndef __DT_BINDINGS_POWER_R8A7796_SYSC_H__
+#define __DT_BINDINGS_POWER_R8A7796_SYSC_H__
+
+/*
+ * These power domain indices match the numbers of the interrupt bits
+ * representing the power areas in the various Interrupt Registers
+ * (e.g. SYSCISR, Interrupt Status Register)
+ */
+
+#define R8A7796_PD_CA57_CPU0            0
+#define R8A7796_PD_CA57_CPU1            1
+#define R8A7796_PD_CA53_CPU0            5
+#define R8A7796_PD_CA53_CPU1            6
+#define R8A7796_PD_CA53_CPU2            7
+#define R8A7796_PD_CA53_CPU3            8
+#define R8A7796_PD_CA57_SCU            12
+#define R8A7796_PD_CR7                 13
+#define R8A7796_PD_A3VC                        14
+#define R8A7796_PD_3DG_A               17
+#define R8A7796_PD_3DG_B               18
+#define R8A7796_PD_CA53_SCU            21
+#define R8A7796_PD_A3IR                        24
+#define R8A7796_PD_A2VC0               25
+#define R8A7796_PD_A2VC1               26
+
+/* Always-on power area */
+#define R8A7796_PD_ALWAYS_ON           32
+
+#endif /* __DT_BINDINGS_POWER_R8A7796_SYSC_H__ */
diff --git a/include/dt-bindings/reset/amlogic,meson-gxbb-reset.h b/include/dt-bindings/reset/amlogic,meson-gxbb-reset.h
new file mode 100644 (file)
index 0000000..524d607
--- /dev/null
@@ -0,0 +1,210 @@
+/*
+ * This file is provided under a dual BSD/GPLv2 license.  When using or
+ * redistributing this file, you may do so under either license.
+ *
+ * GPL LICENSE SUMMARY
+ *
+ * Copyright (c) 2016 BayLibre, SAS.
+ * Author: Neil Armstrong <narmstrong@baylibre.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * 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/>.
+ * The full GNU General Public License is included in this distribution
+ * in the file called COPYING.
+ *
+ * BSD LICENSE
+ *
+ * Copyright (c) 2016 BayLibre, SAS.
+ * Author: Neil Armstrong <narmstrong@baylibre.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _DT_BINDINGS_AMLOGIC_MESON_GXBB_RESET_H
+#define _DT_BINDINGS_AMLOGIC_MESON_GXBB_RESET_H
+
+/*     RESET0                                  */
+#define RESET_HIU                      0
+/*                                     1       */
+#define RESET_DOS_RESET                        2
+#define RESET_DDR_TOP                  3
+#define RESET_DCU_RESET                        4
+#define RESET_VIU                      5
+#define RESET_AIU                      6
+#define RESET_VID_PLL_DIV              7
+/*                                     8       */
+#define RESET_PMUX                     9
+#define RESET_VENC                     10
+#define RESET_ASSIST                   11
+#define RESET_AFIFO2                   12
+#define RESET_VCBUS                    13
+/*                                     14      */
+/*                                     15      */
+#define RESET_GIC                      16
+#define RESET_CAPB3_DECODE             17
+#define RESET_NAND_CAPB3               18
+#define RESET_HDMITX_CAPB3             19
+#define RESET_MALI_CAPB3               20
+#define RESET_DOS_CAPB3                        21
+#define RESET_SYS_CPU_CAPB3            22
+#define RESET_CBUS_CAPB3               23
+#define RESET_AHB_CNTL                 24
+#define RESET_AHB_DATA                 25
+#define RESET_VCBUS_CLK81              26
+#define RESET_MMC                      27
+#define RESET_MIPI_0                   28
+#define RESET_MIPI_1                   29
+#define RESET_MIPI_2                   30
+#define RESET_MIPI_3                   31
+/*     RESET1                                  */
+#define RESET_CPPM                     32
+#define RESET_DEMUX                    33
+#define RESET_USB_OTG                  34
+#define RESET_DDR                      35
+#define RESET_AO_RESET                 36
+#define RESET_BT656                    37
+#define RESET_AHB_SRAM                 38
+/*                                     39      */
+#define RESET_PARSER                   40
+#define RESET_BLKMV                    41
+#define RESET_ISA                      42
+#define RESET_ETHERNET                 43
+#define RESET_SD_EMMC_A                        44
+#define RESET_SD_EMMC_B                        45
+#define RESET_SD_EMMC_C                        46
+#define RESET_ROM_BOOT                 47
+#define RESET_SYS_CPU_0                        48
+#define RESET_SYS_CPU_1                        49
+#define RESET_SYS_CPU_2                        50
+#define RESET_SYS_CPU_3                        51
+#define RESET_SYS_CPU_CORE_0           52
+#define RESET_SYS_CPU_CORE_1           53
+#define RESET_SYS_CPU_CORE_2           54
+#define RESET_SYS_CPU_CORE_3           55
+#define RESET_SYS_PLL_DIV              56
+#define RESET_SYS_CPU_AXI              57
+#define RESET_SYS_CPU_L2               58
+#define RESET_SYS_CPU_P                        59
+#define RESET_SYS_CPU_MBIST            60
+/*                                     61      */
+/*                                     62      */
+/*                                     63      */
+/*     RESET2                                  */
+#define RESET_VD_RMEM                  64
+#define RESET_AUDIN                    65
+#define RESET_HDMI_TX                  66
+/*                                     67      */
+/*                                     68      */
+/*                                     69      */
+#define RESET_GE2D                     70
+#define RESET_PARSER_REG               71
+#define RESET_PARSER_FETCH             72
+#define RESET_PARSER_CTL               73
+#define RESET_PARSER_TOP               74
+/*                                     75      */
+/*                                     76      */
+#define RESET_AO_CPU_RESET             77
+#define RESET_MALI                     78
+#define RESET_HDMI_SYSTEM_RESET                79
+/*                                     80-95   */
+/*     RESET3                                  */
+#define RESET_RING_OSCILLATOR          96
+#define RESET_SYS_CPU                  97
+#define RESET_EFUSE                    98
+#define RESET_SYS_CPU_BVCI             99
+#define RESET_AIFIFO                   100
+#define RESET_TVFE                     101
+#define RESET_AHB_BRIDGE_CNTL          102
+/*                                     103     */
+#define RESET_AUDIO_DAC                        104
+#define RESET_DEMUX_TOP                        105
+#define RESET_DEMUX_DES                        106
+#define RESET_DEMUX_S2P_0              107
+#define RESET_DEMUX_S2P_1              108
+#define RESET_DEMUX_RESET_0            109
+#define RESET_DEMUX_RESET_1            110
+#define RESET_DEMUX_RESET_2            111
+/*                                     112-127 */
+/*     RESET4                                  */
+/*                                     128     */
+/*                                     129     */
+/*                                     130     */
+/*                                     131     */
+#define RESET_DVIN_RESET               132
+#define RESET_RDMA                     133
+#define RESET_VENCI                    134
+#define RESET_VENCP                    135
+/*                                     136     */
+#define RESET_VDAC                     137
+#define RESET_RTC                      138
+/*                                     139     */
+#define RESET_VDI6                     140
+#define RESET_VENCL                    141
+#define RESET_I2C_MASTER_2             142
+#define RESET_I2C_MASTER_1             143
+/*                                     144-159 */
+/*     RESET5                                  */
+/*                                     160-191 */
+/*     RESET6                                  */
+#define RESET_PERIPHS_GENERAL          192
+#define RESET_PERIPHS_SPICC            193
+#define RESET_PERIPHS_SMART_CARD       194
+#define RESET_PERIPHS_SAR_ADC          195
+#define RESET_PERIPHS_I2C_MASTER_0     196
+#define RESET_SANA                     197
+/*                                     198     */
+#define RESET_PERIPHS_STREAM_INTERFACE 199
+#define RESET_PERIPHS_SDIO             200
+#define RESET_PERIPHS_UART_0           201
+#define RESET_PERIPHS_UART_1_2         202
+#define RESET_PERIPHS_ASYNC_0          203
+#define RESET_PERIPHS_ASYNC_1          204
+#define RESET_PERIPHS_SPI_0            205
+#define RESET_PERIPHS_SDHC             206
+#define RESET_UART_SLIP                        207
+/*                                     208-223 */
+/*     RESET7                                  */
+#define RESET_USB_DDR_0                        224
+#define RESET_USB_DDR_1                        225
+#define RESET_USB_DDR_2                        226
+#define RESET_USB_DDR_3                        227
+/*                                     228     */
+#define RESET_DEVICE_MMC_ARB           229
+/*                                     230     */
+#define RESET_VID_LOCK                 231
+#define RESET_A9_DMC_PIPEL             232
+/*                                     233-255 */
+
+#endif
diff --git a/include/dt-bindings/reset/amlogic,meson8b-reset.h b/include/dt-bindings/reset/amlogic,meson8b-reset.h
new file mode 100644 (file)
index 0000000..614aff2
--- /dev/null
@@ -0,0 +1,175 @@
+/*
+ * This file is provided under a dual BSD/GPLv2 license.  When using or
+ * redistributing this file, you may do so under either license.
+ *
+ * GPL LICENSE SUMMARY
+ *
+ * Copyright (c) 2016 BayLibre, SAS.
+ * Author: Neil Armstrong <narmstrong@baylibre.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * 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/>.
+ * The full GNU General Public License is included in this distribution
+ * in the file called COPYING.
+ *
+ * BSD LICENSE
+ *
+ * Copyright (c) 2016 BayLibre, SAS.
+ * Author: Neil Armstrong <narmstrong@baylibre.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _DT_BINDINGS_AMLOGIC_MESON8B_RESET_H
+#define _DT_BINDINGS_AMLOGIC_MESON8B_RESET_H
+
+/*     RESET0                                  */
+#define RESET_HIU                      0
+#define RESET_VLD                      1
+#define RESET_IQIDCT                   2
+#define RESET_MC                       3
+/*                                     8       */
+#define RESET_VIU                      5
+#define RESET_AIU                      6
+#define RESET_MCPU                     7
+#define RESET_CCPU                     8
+#define RESET_PMUX                     9
+#define RESET_VENC                     10
+#define RESET_ASSIST                   11
+#define RESET_AFIFO2                   12
+#define RESET_MDEC                     13
+#define RESET_VLD_PART                 14
+#define RESET_VIFIFO                   15
+/*                                     16-31   */
+/*     RESET1                                  */
+/*                                     32      */
+#define RESET_DEMUX                    33
+#define RESET_USB_OTG                  34
+#define RESET_DDR                      35
+#define RESET_VDAC_1                   36
+#define RESET_BT656                    37
+#define RESET_AHB_SRAM                 38
+#define RESET_AHB_BRIDGE               39
+#define RESET_PARSER                   40
+#define RESET_BLKMV                    41
+#define RESET_ISA                      42
+#define RESET_ETHERNET                 43
+#define RESET_ABUF                     44
+#define RESET_AHB_DATA                 45
+#define RESET_AHB_CNTL                 46
+#define RESET_ROM_BOOT                 47
+/*                                     48-63   */
+/*     RESET2                                  */
+#define RESET_VD_RMEM                  64
+#define RESET_AUDIN                    65
+#define RESET_DBLK                     66
+#define RESET_PIC_DC                   66
+#define RESET_PSC                      66
+#define RESET_NAND                     66
+#define RESET_GE2D                     70
+#define RESET_PARSER_REG               71
+#define RESET_PARSER_FETCH             72
+#define RESET_PARSER_CTL               73
+#define RESET_PARSER_TOP               74
+#define RESET_HDMI_APB                 75
+#define RESET_AUDIO_APB                        76
+#define RESET_MEDIA_CPU                        77
+#define RESET_MALI                     78
+#define RESET_HDMI_SYSTEM_RESET                79
+/*                                     80-95   */
+/*     RESET3                                  */
+#define RESET_RING_OSCILLATOR          96
+#define RESET_SYS_CPU_0                        97
+#define RESET_EFUSE                    98
+#define RESET_SYS_CPU_BVCI             99
+#define RESET_AIFIFO                   100
+#define RESET_AUDIO_PLL_MODULATOR      101
+#define RESET_AHB_BRIDGE_CNTL          102
+#define RESET_SYS_CPU_1                        103
+#define RESET_AUDIO_DAC                        104
+#define RESET_DEMUX_TOP                        105
+#define RESET_DEMUX_DES                        106
+#define RESET_DEMUX_S2P_0              107
+#define RESET_DEMUX_S2P_1              108
+#define RESET_DEMUX_RESET_0            109
+#define RESET_DEMUX_RESET_1            110
+#define RESET_DEMUX_RESET_2            111
+/*                                     112-127 */
+/*     RESET4                                  */
+#define RESET_PL310                    128
+#define RESET_A5_APB                   129
+#define RESET_A5_AXI                   130
+#define RESET_A5                       131
+#define RESET_DVIN                     132
+#define RESET_RDMA                     133
+#define RESET_VENCI                    134
+#define RESET_VENCP                    135
+#define RESET_VENCT                    136
+#define RESET_VDAC_4                   137
+#define RESET_RTC                      138
+#define RESET_A5_DEBUG                 139
+#define RESET_VDI6                     140
+#define RESET_VENCL                    141
+/*                                     142-159 */
+/*     RESET5                                  */
+#define RESET_DDR_PLL                  160
+#define RESET_MISC_PLL                 161
+#define RESET_SYS_PLL                  162
+#define RESET_HPLL_PLL                 163
+#define RESET_AUDIO_PLL                        164
+#define RESET_VID2_PLL                 165
+/*                                     166-191 */
+/*     RESET6                                  */
+#define RESET_PERIPHS_GENERAL          192
+#define RESET_PERIPHS_IR_REMOTE                193
+#define RESET_PERIPHS_SMART_CARD       194
+#define RESET_PERIPHS_SAR_ADC          195
+#define RESET_PERIPHS_I2C_MASTER_0     196
+#define RESET_PERIPHS_I2C_MASTER_1     197
+#define RESET_PERIPHS_I2C_SLAVE                198
+#define RESET_PERIPHS_STREAM_INTERFACE 199
+#define RESET_PERIPHS_SDIO             200
+#define RESET_PERIPHS_UART_0           201
+#define RESET_PERIPHS_UART_1           202
+#define RESET_PERIPHS_ASYNC_0          203
+#define RESET_PERIPHS_ASYNC_1          204
+#define RESET_PERIPHS_SPI_0            205
+#define RESET_PERIPHS_SPI_1            206
+#define RESET_PERIPHS_LED_PWM          207
+/*                                     208-223 */
+/*     RESET7                                  */
+/*                                     224-255 */
+
+#endif
index b91ba93..db1fe67 100644 (file)
@@ -53,4 +53,8 @@ struct reset_controller_dev {
 int reset_controller_register(struct reset_controller_dev *rcdev);
 void reset_controller_unregister(struct reset_controller_dev *rcdev);
 
+struct device;
+int devm_reset_controller_register(struct device *dev,
+                                  struct reset_controller_dev *rcdev);
+
 #endif
index ec0306c..067db57 100644 (file)
@@ -71,14 +71,14 @@ static inline struct reset_control *__of_reset_control_get(
                                        struct device_node *node,
                                        const char *id, int index, int shared)
 {
-       return ERR_PTR(-EINVAL);
+       return ERR_PTR(-ENOTSUPP);
 }
 
 static inline struct reset_control *__devm_reset_control_get(
                                        struct device *dev,
                                        const char *id, int index, int shared)
 {
-       return ERR_PTR(-EINVAL);
+       return ERR_PTR(-ENOTSUPP);
 }
 
 #endif /* CONFIG_RESET_CONTROLLER */