]> git.sur5r.net Git - u-boot/commitdiff
Merge git://git.denx.de/u-boot-uniphier
authorTom Rini <trini@konsulko.com>
Fri, 1 Sep 2017 14:32:35 +0000 (10:32 -0400)
committerTom Rini <trini@konsulko.com>
Fri, 1 Sep 2017 14:32:35 +0000 (10:32 -0400)
- add {ofnode,dev}_read_resource_byname
- provide DT probe hook to Denali NAND driver
- update clk/reset driver
- update DT
- misc cleanups

51 files changed:
arch/arm/dts/uniphier-ld11-global.dts
arch/arm/dts/uniphier-ld11-ref.dts
arch/arm/dts/uniphier-ld11.dtsi
arch/arm/dts/uniphier-ld20-global.dts
arch/arm/dts/uniphier-ld20-ref.dts
arch/arm/dts/uniphier-ld20.dtsi
arch/arm/dts/uniphier-ld4-ref.dts
arch/arm/dts/uniphier-ld4.dtsi
arch/arm/dts/uniphier-ld6b-ref.dts
arch/arm/dts/uniphier-ld6b.dtsi
arch/arm/dts/uniphier-pinctrl.dtsi
arch/arm/dts/uniphier-pro4-ace.dts
arch/arm/dts/uniphier-pro4-ref.dts
arch/arm/dts/uniphier-pro4-sanji.dts
arch/arm/dts/uniphier-pro4.dtsi
arch/arm/dts/uniphier-pro5-4kbox.dts
arch/arm/dts/uniphier-pro5.dtsi
arch/arm/dts/uniphier-pxs2-gentil.dts
arch/arm/dts/uniphier-pxs2-vodka.dts
arch/arm/dts/uniphier-pxs2.dtsi
arch/arm/dts/uniphier-pxs3-ref.dts
arch/arm/dts/uniphier-pxs3.dtsi
arch/arm/dts/uniphier-sld8-ref.dts
arch/arm/dts/uniphier-sld8.dtsi
arch/arm/mach-uniphier/Kconfig
arch/arm/mach-uniphier/board_init.c
arch/arm/mach-uniphier/clk/pll-base-ld20.c
arch/arm/mach-uniphier/clk/pll-ld11.c
arch/arm/mach-uniphier/clk/pll-ld20.c
arch/arm/mach-uniphier/clk/pll-pxs3.c
arch/arm/mach-uniphier/sbc/sbc-pxs2.c
arch/arm/mach-uniphier/sc64-regs.h
configs/uniphier_ld4_sld8_defconfig
configs/uniphier_pro4_defconfig
configs/uniphier_pxs2_ld6b_defconfig
configs/uniphier_v8_defconfig
drivers/clk/uniphier/Makefile
drivers/clk/uniphier/clk-uniphier-core.c
drivers/clk/uniphier/clk-uniphier-sys.c [new file with mode: 0644]
drivers/clk/uniphier/clk-uniphier.h
drivers/core/ofnode.c
drivers/core/read.c
drivers/mtd/nand/Kconfig
drivers/mtd/nand/Makefile
drivers/mtd/nand/denali.c
drivers/mtd/nand/denali.h
drivers/mtd/nand/denali_dt.c [new file with mode: 0644]
drivers/reset/reset-uniphier.c
include/configs/uniphier.h
include/dm/ofnode.h
include/dm/read.h

index 7a650a02486acc0001060f7cc6f40c3780e13cdc..5ffe7dedf72378fe80b735f103ef4c8a2bccfdf8 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 /dts-v1/;
-/include/ "uniphier-ld11.dtsi"
+#include "uniphier-ld11.dtsi"
 
 / {
        model = "UniPhier LD11 Global Board (REF_LD11_GP)";
@@ -68,3 +68,7 @@
 &usb2 {
        status = "okay";
 };
+
+&nand {
+       status = "okay";
+};
index cc8ebe34c27cd35e131e7a05f66a5c5a63dca7e4..ffb473ad2e0fdbad76e43e50ddcaf3eb32f30c72 100644 (file)
@@ -8,9 +8,9 @@
  */
 
 /dts-v1/;
-/include/ "uniphier-ld11.dtsi"
-/include/ "uniphier-ref-daughter.dtsi"
-/include/ "uniphier-support-card.dtsi"
+#include "uniphier-ld11.dtsi"
+#include "uniphier-ref-daughter.dtsi"
+#include "uniphier-support-card.dtsi"
 
 / {
        model = "UniPhier LD11 Reference Board";
index 74f8f721a88891378a9992331f2c9adfad4cbdc5..0f172c31db69d531ce5bffeaccbd91427aa44a1b 100644 (file)
                        };
                };
 
-               aidet@5fc20000 {
-                       compatible = "simple-mfd", "syscon";
+               aidet: aidet@5fc20000 {
+                       compatible = "socionext,uniphier-ld11-aidet";
                        reg = <0x5fc20000 0x200>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
                };
 
                gic: interrupt-controller@5fe00000 {
                                compatible = "socionext,uniphier-ld11-reset";
                                #reset-cells = <1>;
                        };
+
+                       watchdog {
+                               compatible = "socionext,uniphier-wdt";
+                       };
                };
 
                nand: nand@68000000 {
                        pinctrl-names = "default";
                        pinctrl-0 = <&pinctrl_nand>;
                        clocks = <&sys_clk 2>;
-                       nand-ecc-strength = <8>;
                };
        };
 };
 
-/include/ "uniphier-pinctrl.dtsi"
+#include "uniphier-pinctrl.dtsi"
index 9f620d4101b54fa0a1d2aecee398813598891c41..fc2bc9d75d35e6f410a6f012b461cdcac03d6282 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 /dts-v1/;
-/include/ "uniphier-ld20.dtsi"
+#include "uniphier-ld20.dtsi"
 
 / {
        model = "UniPhier LD20 Global Board (REF_LD20_GP)";
@@ -50,3 +50,7 @@
 &i2c0 {
        status = "okay";
 };
+
+&nand {
+       status = "okay";
+};
index 494166aee24ce3c304045075c1a0938f6fdf43f2..1ca0c8620dc5ac33118a72beb5b586ab8ff0ce2f 100644 (file)
@@ -8,9 +8,9 @@
  */
 
 /dts-v1/;
-/include/ "uniphier-ld20.dtsi"
-/include/ "uniphier-ref-daughter.dtsi"
-/include/ "uniphier-support-card.dtsi"
+#include "uniphier-ld20.dtsi"
+#include "uniphier-ref-daughter.dtsi"
+#include "uniphier-support-card.dtsi"
 
 / {
        model = "UniPhier LD20 Reference Board";
index 44257aff35b98af2e50e5b1d29c9812f5759858c..a7fdaa74d1553fa349ca058f31342bcae6f1e5b9 100644 (file)
                sdctrl@59810000 {
                        compatible = "socionext,uniphier-ld20-sdctrl",
                                     "simple-mfd", "syscon";
-                       reg = <0x59810000 0x800>;
+                       reg = <0x59810000 0x400>;
 
                        sd_clk: clock {
                                compatible = "socionext,uniphier-ld20-sd-clock";
                        };
                };
 
-               aidet@5fc20000 {
-                       compatible = "simple-mfd", "syscon";
+               aidet: aidet@5fc20000 {
+                       compatible = "socionext,uniphier-ld20-aidet";
                        reg = <0x5fc20000 0x200>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
                };
 
                gic: interrupt-controller@5fe00000 {
                                compatible = "socionext,uniphier-ld20-reset";
                                #reset-cells = <1>;
                        };
+
+                       watchdog {
+                               compatible = "socionext,uniphier-wdt";
+                       };
                };
 
                usb: usb@65b00000 {
                        pinctrl-names = "default";
                        pinctrl-0 = <&pinctrl_nand>;
                        clocks = <&sys_clk 2>;
-                       nand-ecc-strength = <8>;
                };
        };
 };
 
-/include/ "uniphier-pinctrl.dtsi"
+#include "uniphier-pinctrl.dtsi"
index 0520e3cff1a54a9f9831553a36d5c660bcf2ce0b..0f50acb24c2c2474f334d18520111bf49ecae7e8 100644 (file)
@@ -8,9 +8,9 @@
  */
 
 /dts-v1/;
-/include/ "uniphier-ld4.dtsi"
-/include/ "uniphier-ref-daughter.dtsi"
-/include/ "uniphier-support-card.dtsi"
+#include "uniphier-ld4.dtsi"
+#include "uniphier-ref-daughter.dtsi"
+#include "uniphier-support-card.dtsi"
 
 / {
        model = "UniPhier LD4 Reference Board";
index 18a105a58f9cfae9f232ebe0e1e03b28b70b824b..a3bcf227f4388707109a61f127fbb1c85d117219 100644 (file)
                        interrupt-controller;
                };
 
-               aidet@61830000 {
-                       compatible = "simple-mfd", "syscon";
+               aidet: aidet@61830000 {
+                       compatible = "socionext,uniphier-ld4-aidet";
                        reg = <0x61830000 0x200>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
                };
 
                sysctrl@61840000 {
                        reg = <0x68000000 0x20>, <0x68100000 0x1000>;
                        interrupts = <0 65 4>;
                        pinctrl-names = "default";
-                       pinctrl-0 = <&pinctrl_nand>;
+                       pinctrl-0 = <&pinctrl_nand2cs>;
                        clocks = <&sys_clk 2>;
-                       nand-ecc-strength = <8>;
                };
        };
 };
 
-/include/ "uniphier-pinctrl.dtsi"
+#include "uniphier-pinctrl.dtsi"
index b4bb5b546a03f502cd6d26392cb9f2cae9d678d6..bdb7f50ab3a045e105e72baa07ff5c597b48f0a0 100644 (file)
@@ -8,9 +8,9 @@
  */
 
 /dts-v1/;
-/include/ "uniphier-ld6b.dtsi"
-/include/ "uniphier-ref-daughter.dtsi"
-/include/ "uniphier-support-card.dtsi"
+#include "uniphier-ld6b.dtsi"
+#include "uniphier-ref-daughter.dtsi"
+#include "uniphier-support-card.dtsi"
 
 / {
        model = "UniPhier LD6b Reference Board";
index 8b9a79731bd33cf5f75ac03e626de878efed3542..9a7b25cc8233accb08c4720d66cfb792ebfb8bbb 100644 (file)
@@ -12,7 +12,7 @@
  * The D-chip (digital chip) is the same as the PXs2 die.
  * Reuse the PXs2 device tree with some properties overridden.
  */
-/include/ "uniphier-pxs2.dtsi"
+#include "uniphier-pxs2.dtsi"
 
 / {
        compatible = "socionext,uniphier-ld6b";
index f5c1552612596ea43a30275e73776629c55084ae..d5e8aafccbd63df13f2339cc4bc0059cf782d7a4 100644 (file)
@@ -8,6 +8,11 @@
  */
 
 &pinctrl {
+       pinctrl_aout: aout_grp {
+               groups = "aout";
+               function = "aout";
+       };
+
        pinctrl_emmc: emmc_grp {
                groups = "emmc", "emmc_dat8";
                function = "emmc";
index 9276f8d913b6cfc5b33f5eea0604824857302c78..8161ba83a0478db1b2d7c30232899ea1a5142899 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 /dts-v1/;
-/include/ "uniphier-pro4.dtsi"
+#include "uniphier-pro4.dtsi"
 
 / {
        model = "UniPhier Pro4 Ace Board";
index 13e1b3ec882898a9c5f3513e0474588680ef1dcb..360b31d6927a8994a5bd7aac0334daa026245ead 100644 (file)
@@ -8,9 +8,9 @@
  */
 
 /dts-v1/;
-/include/ "uniphier-pro4.dtsi"
-/include/ "uniphier-ref-daughter.dtsi"
-/include/ "uniphier-support-card.dtsi"
+#include "uniphier-pro4.dtsi"
+#include "uniphier-ref-daughter.dtsi"
+#include "uniphier-support-card.dtsi"
 
 / {
        model = "UniPhier Pro4 Reference Board";
index 568dbd5a4ae3421f96e6124002178467e6ff2003..778e2bb4b78dc75a4c0cf1a74b70bfef26992bd5 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 /dts-v1/;
-/include/ "uniphier-pro4.dtsi"
+#include "uniphier-pro4.dtsi"
 
 / {
        model = "UniPhier Pro4 Sanji Board";
index cbb848207cc1c718ef9d5f54192d0f2393f9bb6b..b45f23ce7c83d7b65294aba3a3e3c463eff49f13 100644 (file)
                        };
                };
 
-               aidet@5fc20000 {
-                       compatible = "simple-mfd", "syscon";
+               aidet: aidet@5fc20000 {
+                       compatible = "socionext,uniphier-pro4-aidet";
                        reg = <0x5fc20000 0x200>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
                };
 
                timer@60000200 {
                        pinctrl-names = "default";
                        pinctrl-0 = <&pinctrl_nand>;
                        clocks = <&sys_clk 2>;
-                       nand-ecc-strength = <8>;
                };
        };
 };
 
-/include/ "uniphier-pinctrl.dtsi"
+#include "uniphier-pinctrl.dtsi"
index d59309000b5a5abde6ccc334615ba1739a736b8e..05597d385edc8a786681b4dac9d8a083cac8469c 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 /dts-v1/;
-/include/ "uniphier-pro5.dtsi"
+#include "uniphier-pro5.dtsi"
 
 / {
        model = "UniPhier Pro5 4KBOX Board";
@@ -26,7 +26,7 @@
                i2c6 = &i2c6;
        };
 
-       memory {
+       memory@80000000 {
                device_type = "memory";
                reg = <0x80000000 0x40000000>;
        };
index 498354c45f906d50fc00a7472fa42b428f927ff5..94eb656512961720403a47187eba17c36b5beabb 100644 (file)
                sdctrl@59810000 {
                        compatible = "socionext,uniphier-pro5-sdctrl",
                                     "simple-mfd", "syscon";
-                       reg = <0x59810000 0x800>;
+                       reg = <0x59810000 0x400>;
                        u-boot,dm-pre-reloc;
 
                        sd_clk: clock {
                        };
                };
 
-               aidet@5fc20000 {
-                       compatible = "simple-mfd", "syscon";
+               aidet: aidet@5fc20000 {
+                       compatible = "socionext,uniphier-pro5-aidet";
                        reg = <0x5fc20000 0x200>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
                };
 
                timer@60000200 {
                        reg = <0x68000000 0x20>, <0x68100000 0x1000>;
                        interrupts = <0 65 4>;
                        pinctrl-names = "default";
-                       pinctrl-0 = <&pinctrl_nand>;
+                       pinctrl-0 = <&pinctrl_nand2cs>;
                        clocks = <&sys_clk 2>;
-                       nand-ecc-strength = <8>;
                };
 
                emmc: sdhc@68400000 {
        };
 };
 
-/include/ "uniphier-pinctrl.dtsi"
+#include "uniphier-pinctrl.dtsi"
index 6f691a8b42c8897b69c7e0ec9829db3a055d8872..7f0f972bde4f307c5e19df8173d50181131f88a4 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 /dts-v1/;
-/include/ "uniphier-pxs2.dtsi"
+#include "uniphier-pxs2.dtsi"
 
 / {
        model = "UniPhier PXs2 Gentil Board";
index d13e5f2b6c10c75aa34b6e53967bae6d62da274d..ec9ffb7df8b188540db902a60ec3d40900890d22 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 /dts-v1/;
-/include/ "uniphier-pxs2.dtsi"
+#include "uniphier-pxs2.dtsi"
 
 / {
        model = "UniPhier PXs2 Vodka Board";
index 32844f781f5a7719669f1c3e6c15ae4f74be435e..c304d90874f1efd0d5428f34d842513cc829ae74 100644 (file)
                sdctrl@59810000 {
                        compatible = "socionext,uniphier-pxs2-sdctrl",
                                     "simple-mfd", "syscon";
-                       reg = <0x59810000 0x800>;
+                       reg = <0x59810000 0x400>;
                        u-boot,dm-pre-reloc;
 
                        sd_clk: clock {
                        };
                };
 
-               aidet@5fc20000 {
-                       compatible = "simple-mfd", "syscon";
+               aidet: aidet@5fc20000 {
+                       compatible = "socionext,uniphier-pxs2-aidet";
                        reg = <0x5fc20000 0x200>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
                };
 
                timer@60000200 {
                        reg = <0x68000000 0x20>, <0x68100000 0x1000>;
                        interrupts = <0 65 4>;
                        pinctrl-names = "default";
-                       pinctrl-0 = <&pinctrl_nand>;
+                       pinctrl-0 = <&pinctrl_nand2cs>;
                        clocks = <&sys_clk 2>;
-                       nand-ecc-strength = <8>;
                };
        };
 };
 
-/include/ "uniphier-pinctrl.dtsi"
+#include "uniphier-pinctrl.dtsi"
index cb1eef43c4643753d83c68a63ef20aa45fb19ffb..1118dd7c6ea56efea610b2a4ba031e909f1d71e0 100644 (file)
@@ -4,13 +4,12 @@
  * Copyright (C) 2017 Socionext Inc.
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  *
- * SPDX-License-Identifier:    GPL-2.0+        X11
+ * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  */
 
 /dts-v1/;
-/include/ "uniphier-pxs3.dtsi"
-/include/ "uniphier-ref-daughter.dtsi"
-/include/ "uniphier-support-card.dtsi"
+#include "uniphier-pxs3.dtsi"
+#include "uniphier-support-card.dtsi"
 
 / {
        model = "UniPhier PXs3 Reference Board";
@@ -39,7 +38,7 @@
 };
 
 &ethsc {
-       interrupts = <0 48 4>;
+       interrupts = <0 52 4>;
 };
 
 &serial0 {
 &i2c0 {
        status = "okay";
 };
+
+&i2c1 {
+       status = "okay";
+};
+
+&i2c2 {
+       status = "okay";
+};
+
+&i2c3 {
+       status = "okay";
+};
+
+&usb0 {
+       status = "okay";
+};
+
+&usb1 {
+       status = "okay";
+};
index cdf7f9005f73fa2ee50ac40e0549300cd7749555..8944005ac0f65b009509a701a273a68aef1d6a41 100644 (file)
@@ -4,46 +4,10 @@
  * Copyright (C) 2017 Socionext Inc.
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  *
- * This file is dual-licensed: you can use it either under the terms
- * of the GPL or the X11 license, at your option. Note that this dual
- * licensing only applies to this file, and not this project as a
- * whole.
- *
- *  a) This file is free software; you can redistribute it and/or
- *     modify it under the terms of the GNU General Public License as
- *     published by the Free Software Foundation; either version 2 of the
- *     License, or (at your option) any later version.
- *
- *     This file 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.
- *
- * Or, alternatively,
- *
- *  b) Permission is hereby granted, free of charge, to any person
- *     obtaining a copy of this software and associated documentation
- *     files (the "Software"), to deal in the Software without
- *     restriction, including without limitation the rights to use,
- *     copy, modify, merge, publish, distribute, sublicense, and/or
- *     sell copies of the Software, and to permit persons to whom the
- *     Software is furnished to do so, subject to the following
- *     conditions:
- *
- *     The above copyright notice and this permission notice shall be
- *     included in all copies or substantial portions of the Software.
- *
- *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- *     OTHER DEALINGS IN THE SOFTWARE.
+ * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  */
 
-/memreserve/ 0x80000000 0x00080000;
+/memreserve/ 0x80000000 0x02000000;
 
 / {
        compatible = "socionext,uniphier-pxs3";
                        device_type = "cpu";
                        compatible = "arm,cortex-a53", "arm,armv8";
                        reg = <0 0x000>;
+                       clocks = <&sys_clk 33>;
                        enable-method = "psci";
+                       operating-points-v2 = <&cluster0_opp>;
                };
 
                cpu1: cpu@1 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a53", "arm,armv8";
                        reg = <0 0x001>;
+                       clocks = <&sys_clk 33>;
                        enable-method = "psci";
+                       operating-points-v2 = <&cluster0_opp>;
                };
 
                cpu2: cpu@2 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a53", "arm,armv8";
                        reg = <0 0x002>;
+                       clocks = <&sys_clk 33>;
                        enable-method = "psci";
+                       operating-points-v2 = <&cluster0_opp>;
                };
 
                cpu3: cpu@3 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a53", "arm,armv8";
                        reg = <0 0x003>;
+                       clocks = <&sys_clk 33>;
                        enable-method = "psci";
+                       operating-points-v2 = <&cluster0_opp>;
+               };
+       };
+
+       cluster0_opp: opp_table {
+               compatible = "operating-points-v2";
+               opp-shared;
+
+               opp-250000000 {
+                       opp-hz = /bits/ 64 <250000000>;
+                       clock-latency-ns = <300>;
+               };
+               opp-325000000 {
+                       opp-hz = /bits/ 64 <325000000>;
+                       clock-latency-ns = <300>;
+               };
+               opp-500000000 {
+                       opp-hz = /bits/ 64 <500000000>;
+                       clock-latency-ns = <300>;
+               };
+               opp-650000000 {
+                       opp-hz = /bits/ 64 <650000000>;
+                       clock-latency-ns = <300>;
+               };
+               opp-666667000 {
+                       opp-hz = /bits/ 64 <666667000>;
+                       clock-latency-ns = <300>;
+               };
+               opp-866667000 {
+                       opp-hz = /bits/ 64 <866667000>;
+                       clock-latency-ns = <300>;
+               };
+               opp-1000000000 {
+                       opp-hz = /bits/ 64 <1000000000>;
+                       clock-latency-ns = <300>;
+               };
+               opp-1300000000 {
+                       opp-hz = /bits/ 64 <1300000000>;
+                       clock-latency-ns = <300>;
                };
        };
 
                        clock-frequency = <58820000>;
                };
 
+               gpio: gpio@55000000 {
+                       compatible = "socionext,uniphier-pxs3-gpio";
+                       reg = <0x55000000 0x200>;
+                       interrupt-parent = <&aidet>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       gpio-ranges = <&pinctrl 0 0 0>,
+                                     <&pinctrl 96 0 0>,
+                                     <&pinctrl 160 0 0>;
+                       gpio-ranges-group-names = "gpio_range0",
+                                                 "gpio_range1",
+                                                 "gpio_range2";
+               };
+
                i2c0: i2c@58780000 {
                        compatible = "socionext,uniphier-fi2c";
                        status = "disabled";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        interrupts = <0 43 4>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_i2c2>;
                        clocks = <&peri_clk 6>;
                        clock-frequency = <100000>;
                };
                sdctrl@59810000 {
                        compatible = "socionext,uniphier-pxs3-sdctrl",
                                     "simple-mfd", "syscon";
-                       reg = <0x59810000 0x800>;
+                       reg = <0x59810000 0x400>;
 
                        sd_clk: clock {
                                compatible = "socionext,uniphier-pxs3-sd-clock";
 
                emmc: sdhc@5a000000 {
                        compatible = "socionext,uniphier-sd4hc", "cdns,sd4hc";
-                       status = "disabled";
                        reg = <0x5a000000 0x400>;
                        interrupts = <0 78 4>;
                        pinctrl-names = "default";
                        bus-width = <8>;
                        mmc-ddr-1_8v;
                        mmc-hs200-1_8v;
+                       cdns,phy-input-delay-legacy = <4>;
+                       cdns,phy-input-delay-mmc-highspeed = <2>;
+                       cdns,phy-input-delay-mmc-ddr = <3>;
+                       cdns,phy-dll-delay-sdclk = <21>;
+                       cdns,phy-dll-delay-sdclk-hsmmc = <21>;
                };
 
                sd: sdhc@5a400000 {
                        };
                };
 
-               aidet@5fc20000 {
-                       compatible = "simple-mfd", "syscon";
+               aidet: aidet@5fc20000 {
+                       compatible = "socionext,uniphier-pxs3-aidet";
                        reg = <0x5fc20000 0x200>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
                };
 
                gic: interrupt-controller@5fe00000 {
                                compatible = "socionext,uniphier-pxs3-reset";
                                #reset-cells = <1>;
                        };
+
+                       watchdog {
+                               compatible = "socionext,uniphier-wdt";
+                       };
+               };
+
+               usb0: usb@65b00000 {
+                       compatible = "socionext,uniphier-pxs3-dwc3";
+                       status = "disabled";
+                       reg = <0x65b00000 0x1000>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_usb0>, <&pinctrl_usb2>;
+                       dwc3@65a00000 {
+                               compatible = "snps,dwc3";
+                               reg = <0x65a00000 0x10000>;
+                               interrupts = <0 134 4>;
+                               dr_mode = "host";
+                               tx-fifo-resize;
+                       };
+               };
+
+               usb1: usb@65d00000 {
+                       compatible = "socionext,uniphier-pxs3-dwc3";
+                       status = "disabled";
+                       reg = <0x65d00000 0x1000>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_usb1>, <&pinctrl_usb3>;
+                       dwc3@65c00000 {
+                               compatible = "snps,dwc3";
+                               reg = <0x65c00000 0x10000>;
+                               interrupts = <0 137 4>;
+                               dr_mode = "host";
+                               tx-fifo-resize;
+                       };
                };
 
                nand: nand@68000000 {
-                       compatible = "socionext,denali-nand-v5b";
+                       compatible = "socionext,uniphier-denali-nand-v5b";
                        status = "disabled";
                        reg-names = "nand_data", "denali_reg";
                        reg = <0x68000000 0x20>, <0x68100000 0x1000>;
                        pinctrl-names = "default";
                        pinctrl-0 = <&pinctrl_nand>;
                        clocks = <&sys_clk 2>;
-                       nand-ecc-strength = <8>;
                };
        };
 };
 
-/include/ "uniphier-pinctrl.dtsi"
+#include "uniphier-pinctrl.dtsi"
index 6ddf2a1b1df7a5e0312537f7957b48c4c1fb8459..3557bb7fed57d839253bef7c20ddfd9a5678f5f6 100644 (file)
@@ -8,9 +8,9 @@
  */
 
 /dts-v1/;
-/include/ "uniphier-sld8.dtsi"
-/include/ "uniphier-ref-daughter.dtsi"
-/include/ "uniphier-support-card.dtsi"
+#include "uniphier-sld8.dtsi"
+#include "uniphier-ref-daughter.dtsi"
+#include "uniphier-support-card.dtsi"
 
 / {
        model = "UniPhier sLD8 Reference Board";
index 7d6370f6afe2bac975af5288b3f788d3cd147254..a3de26b40cc9bb9e54ef4b707fd8cdbb490a6750 100644 (file)
                        interrupt-controller;
                };
 
-               aidet@61830000 {
-                       compatible = "simple-mfd", "syscon";
+               aidet: aidet@61830000 {
+                       compatible = "socionext,uniphier-sld8-aidet";
                        reg = <0x61830000 0x200>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
                };
 
                sysctrl@61840000 {
                        reg = <0x68000000 0x20>, <0x68100000 0x1000>;
                        interrupts = <0 65 4>;
                        pinctrl-names = "default";
-                       pinctrl-0 = <&pinctrl_nand>;
+                       pinctrl-0 = <&pinctrl_nand2cs>;
                        clocks = <&sys_clk 2>;
-                       nand-ecc-strength = <8>;
                };
        };
 };
 
-/include/ "uniphier-pinctrl.dtsi"
+#include "uniphier-pinctrl.dtsi"
index 6a7e239e0d288c6bbf6df0f3b95980b6dddff686..ee2211241235210573341bf3366d5093d6501f1d 100644 (file)
@@ -9,7 +9,6 @@ config ARCH_UNIPHIER_32BIT
        select CPU_V7_HAS_NONSEC
        select ARMV7_NONSEC
        select ARCH_SUPPORT_PSCI
-       imply NAND
 
 choice
         prompt "UniPhier SoC select"
index ed58d07f7e502e44d54420216d1040b383557d81..a6ee22e3392d77d8720d50b6cadc693e88fba6fd 100644 (file)
@@ -78,7 +78,6 @@ static void uniphier_ld20_misc_init(void)
 
 struct uniphier_initdata {
        unsigned int soc_id;
-       bool nand_2cs;
        void (*sbc_init)(void);
        void (*pll_init)(void);
        void (*clk_init)(void);
@@ -89,7 +88,6 @@ static const struct uniphier_initdata uniphier_initdata[] = {
 #if defined(CONFIG_ARCH_UNIPHIER_LD4)
        {
                .soc_id = UNIPHIER_LD4_ID,
-               .nand_2cs = true,
                .sbc_init = uniphier_ld4_sbc_init,
                .pll_init = uniphier_ld4_pll_init,
                .clk_init = uniphier_ld4_clk_init,
@@ -98,7 +96,6 @@ static const struct uniphier_initdata uniphier_initdata[] = {
 #if defined(CONFIG_ARCH_UNIPHIER_PRO4)
        {
                .soc_id = UNIPHIER_PRO4_ID,
-               .nand_2cs = false,
                .sbc_init = uniphier_sbc_init_savepin,
                .pll_init = uniphier_pro4_pll_init,
                .clk_init = uniphier_pro4_clk_init,
@@ -107,7 +104,6 @@ static const struct uniphier_initdata uniphier_initdata[] = {
 #if defined(CONFIG_ARCH_UNIPHIER_SLD8)
        {
                .soc_id = UNIPHIER_SLD8_ID,
-               .nand_2cs = true,
                .sbc_init = uniphier_ld4_sbc_init,
                .pll_init = uniphier_ld4_pll_init,
                .clk_init = uniphier_ld4_clk_init,
@@ -116,7 +112,6 @@ static const struct uniphier_initdata uniphier_initdata[] = {
 #if defined(CONFIG_ARCH_UNIPHIER_PRO5)
        {
                .soc_id = UNIPHIER_PRO5_ID,
-               .nand_2cs = true,
                .sbc_init = uniphier_sbc_init_savepin,
                .clk_init = uniphier_pro5_clk_init,
        },
@@ -124,7 +119,6 @@ static const struct uniphier_initdata uniphier_initdata[] = {
 #if defined(CONFIG_ARCH_UNIPHIER_PXS2)
        {
                .soc_id = UNIPHIER_PXS2_ID,
-               .nand_2cs = true,
                .sbc_init = uniphier_pxs2_sbc_init,
                .clk_init = uniphier_pxs2_clk_init,
        },
@@ -132,7 +126,6 @@ static const struct uniphier_initdata uniphier_initdata[] = {
 #if defined(CONFIG_ARCH_UNIPHIER_LD6B)
        {
                .soc_id = UNIPHIER_LD6B_ID,
-               .nand_2cs = true,
                .sbc_init = uniphier_pxs2_sbc_init,
                .clk_init = uniphier_pxs2_clk_init,
        },
@@ -140,7 +133,6 @@ static const struct uniphier_initdata uniphier_initdata[] = {
 #if defined(CONFIG_ARCH_UNIPHIER_LD11)
        {
                .soc_id = UNIPHIER_LD11_ID,
-               .nand_2cs = false,
                .sbc_init = uniphier_ld11_sbc_init,
                .pll_init = uniphier_ld11_pll_init,
                .clk_init = uniphier_ld11_clk_init,
@@ -150,7 +142,6 @@ static const struct uniphier_initdata uniphier_initdata[] = {
 #if defined(CONFIG_ARCH_UNIPHIER_LD20)
        {
                .soc_id = UNIPHIER_LD20_ID,
-               .nand_2cs = false,
                .sbc_init = uniphier_ld11_sbc_init,
                .pll_init = uniphier_ld20_pll_init,
                .clk_init = uniphier_ld20_clk_init,
@@ -160,7 +151,6 @@ static const struct uniphier_initdata uniphier_initdata[] = {
 #if defined(CONFIG_ARCH_UNIPHIER_PXS3)
        {
                .soc_id = UNIPHIER_PXS3_ID,
-               .nand_2cs = false,
                .sbc_init = uniphier_pxs2_sbc_init,
                .pll_init = uniphier_pxs3_pll_init,
                .clk_init = uniphier_pxs3_clk_init,
@@ -172,7 +162,6 @@ UNIPHIER_DEFINE_SOCDATA_FUNC(uniphier_get_initdata, uniphier_initdata)
 int board_init(void)
 {
        const struct uniphier_initdata *initdata;
-       int ret;
 
        led_puts("U0");
 
@@ -188,33 +177,24 @@ int board_init(void)
 
        led_puts("U0");
 
-       if (IS_ENABLED(CONFIG_NAND_DENALI)) {
-               ret = uniphier_pin_init(initdata->nand_2cs ?
-                                       "nand2cs_grp" : "nand_grp");
-               if (ret)
-                       pr_err("failed to init NAND pins\n");
-       }
-
-       led_puts("U1");
-
        if (initdata->pll_init)
                initdata->pll_init();
 
-       led_puts("U2");
+       led_puts("U1");
 
        if (initdata->clk_init)
                initdata->clk_init();
 
-       led_puts("U3");
+       led_puts("U2");
 
        if (initdata->misc_init)
                initdata->misc_init();
 
-       led_puts("U4");
+       led_puts("U3");
 
        uniphier_setup_xirq();
 
-       led_puts("U5");
+       led_puts("U4");
 
        support_card_late_init();
 
index 697eb7aabf01c4889b6acce5ff79d080d23fb780..3aa42f8bfdcd9909e3aae3cc5bf8f31aeba94775 100644 (file)
@@ -88,7 +88,7 @@ int uniphier_ld20_sscpll_set_regi(unsigned long reg_base, unsigned regi)
        if (!base)
                return -ENOMEM;
 
-       tmp = readl(base + 8);  /* SSCPLLCTRL */
+       tmp = readl(base + 8);  /* SSCPLLCTRL3 */
        tmp &= ~SC_PLLCTRL3_REGI_MASK;
        tmp |= regi << SC_PLLCTRL3_REGI_SHIFT;
        writel(tmp, base + 8);
@@ -133,9 +133,9 @@ int uniphier_ld20_dspll_init(unsigned long reg_base)
        if (!base)
                return -ENOMEM;
 
-       tmp = readl(base + 8);          /* DSPLLCTRL2 */
+       tmp = readl(base + 4);          /* DSPLLCTRL2 */
        tmp |= SC_DSPLLCTRL2_K_LD;
-       writel(tmp, base + 8);
+       writel(tmp, base + 4);
 
        iounmap(base);
 
index 02befa298b465f06fe1af227a748f37686d6a148..1a7ec295252408a9aca747334c49fdb9af7e83ad 100644 (file)
@@ -4,13 +4,24 @@
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
-#include <common.h>
+#include <linux/delay.h>
 #include <linux/io.h>
 
 #include "../init.h"
 #include "../sc64-regs.h"
 #include "pll.h"
 
+/* PLL type: SSC */
+#define SC_CPLLCTRL    (SC_BASE_ADDR | 0x1400) /* CPU/ARM */
+#define SC_SPLLCTRL    (SC_BASE_ADDR | 0x1410) /* misc */
+#define SC_MPLLCTRL    (SC_BASE_ADDR | 0x1430) /* DSP */
+#define SC_VSPLLCTRL   (SC_BASE_ADDR | 0x1440) /* Video codec, VPE etc. */
+#define SC_DPLLCTRL    (SC_BASE_ADDR | 0x1460) /* DDR memory */
+
+/* PLL type: VPLL27 */
+#define SC_VPLL27FCTRL (SC_BASE_ADDR | 0x1500)
+#define SC_VPLL27ACTRL (SC_BASE_ADDR | 0x1520)
+
 void uniphier_ld11_pll_init(void)
 {
        uniphier_ld20_sscpll_init(SC_CPLLCTRL, 1960, 1, 2);     /* 2000MHz -> 1960MHz */
index 121a3690e83439c47b8a4b66cda02547bd3d808c..5e072c6dff77bc3559b00d573cbac8a4bd66d77a 100644 (file)
@@ -5,12 +5,31 @@
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
-#include <common.h>
+#include <linux/delay.h>
 
 #include "../init.h"
 #include "../sc64-regs.h"
 #include "pll.h"
 
+/* PLL type: SSC */
+#define SC_CPLLCTRL    (SC_BASE_ADDR | 0x1400) /* CPU/ARM */
+#define SC_SPLLCTRL    (SC_BASE_ADDR | 0x1410) /* misc */
+#define SC_SPLL2CTRL   (SC_BASE_ADDR | 0x1420) /* DSP */
+#define SC_MPLLCTRL    (SC_BASE_ADDR | 0x1430) /* Video codec */
+#define SC_VPPLLCTRL   (SC_BASE_ADDR | 0x1440) /* VPE etc. */
+#define SC_GPPLLCTRL   (SC_BASE_ADDR | 0x1450) /* GPU/Mali */
+#define SC_DPLL0CTRL   (SC_BASE_ADDR | 0x1460) /* DDR memory 0 */
+#define SC_DPLL1CTRL   (SC_BASE_ADDR | 0x1470) /* DDR memory 1 */
+#define SC_DPLL2CTRL   (SC_BASE_ADDR | 0x1480) /* DDR memory 2 */
+
+/* PLL type: VPLL27 */
+#define SC_VPLL27FCTRL (SC_BASE_ADDR | 0x1500)
+#define SC_VPLL27ACTRL (SC_BASE_ADDR | 0x1520)
+
+/* PLL type: DSPLL */
+#define SC_VPLL8KCTRL  (SC_BASE_ADDR | 0x1540)
+#define SC_A2PLLCTRL   (SC_BASE_ADDR | 0x15C0)
+
 void uniphier_ld20_pll_init(void)
 {
        uniphier_ld20_sscpll_init(SC_CPLLCTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 4);
index 201d3517a86a0f835f5df03385e586bc1980d59f..e84d52b80f3b900273aad7834288fa288b5c850c 100644 (file)
@@ -1,9 +1,64 @@
 /*
+ * Copyright (C) 2017 Socionext Inc.
+ *
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
+#include <linux/delay.h>
+
 #include "../init.h"
+#include "../sc64-regs.h"
+#include "pll.h"
+
+/* PLL type: SSC */
+#define SC_CPLLCTRL    (SC_BASE_ADDR | 0x1400) /* CPU/ARM */
+#define SC_SPLLCTRL    (SC_BASE_ADDR | 0x1410) /* misc */
+#define SC_SPLL2CTRL   (SC_BASE_ADDR | 0x1420) /* DSP */
+#define SC_VPPLLCTRL   (SC_BASE_ADDR | 0x1430) /* VPE */
+#define SC_VGPLLCTRL   (SC_BASE_ADDR | 0x1440)
+#define SC_DECPLLCTRL  (SC_BASE_ADDR | 0x1450)
+#define SC_ENCPLLCTRL  (SC_BASE_ADDR | 0x1460)
+#define SC_PXFPLLCTRL  (SC_BASE_ADDR | 0x1470)
+#define SC_DPLL0CTRL   (SC_BASE_ADDR | 0x1480) /* DDR memory 0 */
+#define SC_DPLL1CTRL   (SC_BASE_ADDR | 0x1490) /* DDR memory 1 */
+#define SC_DPLL2CTRL   (SC_BASE_ADDR | 0x14a0) /* DDR memory 2 */
+#define SC_VSPLLCTRL   (SC_BASE_ADDR | 0x14c0)
+
+/* PLL type: VPLL27 */
+#define SC_VPLL27FCTRL (SC_BASE_ADDR | 0x1500)
+#define SC_VPLL27ACTRL (SC_BASE_ADDR | 0x1520)
+
+/* PLL type: DSPLL */
+#define SC_VPLL8KCTRL  (SC_BASE_ADDR | 0x1540)
 
 void uniphier_pxs3_pll_init(void)
 {
+       uniphier_ld20_sscpll_init(SC_CPLLCTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 4);
+       /* do nothing for SPLL */
+       uniphier_ld20_sscpll_init(SC_SPLL2CTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 4);
+       uniphier_ld20_sscpll_init(SC_VPPLLCTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 2);
+       uniphier_ld20_sscpll_init(SC_VGPLLCTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 2);
+       uniphier_ld20_sscpll_init(SC_DECPLLCTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 2);
+       uniphier_ld20_sscpll_init(SC_ENCPLLCTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 4);
+       uniphier_ld20_sscpll_init(SC_PXFPLLCTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 2);
+       uniphier_ld20_sscpll_init(SC_VSPLLCTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 2);
+
+       mdelay(1);
+
+       uniphier_ld20_sscpll_ssc_en(SC_CPLLCTRL);
+       uniphier_ld20_sscpll_ssc_en(SC_SPLL2CTRL);
+       uniphier_ld20_sscpll_ssc_en(SC_VPPLLCTRL);
+       uniphier_ld20_sscpll_ssc_en(SC_VGPLLCTRL);
+       uniphier_ld20_sscpll_ssc_en(SC_DECPLLCTRL);
+       uniphier_ld20_sscpll_ssc_en(SC_ENCPLLCTRL);
+       uniphier_ld20_sscpll_ssc_en(SC_PXFPLLCTRL);
+       uniphier_ld20_sscpll_ssc_en(SC_DPLL0CTRL);
+       uniphier_ld20_sscpll_ssc_en(SC_DPLL1CTRL);
+       uniphier_ld20_sscpll_ssc_en(SC_DPLL2CTRL);
+       uniphier_ld20_sscpll_ssc_en(SC_VSPLLCTRL);
+
+       uniphier_ld20_vpll27_init(SC_VPLL27FCTRL);
+       uniphier_ld20_vpll27_init(SC_VPLL27ACTRL);
+
+       uniphier_ld20_dspll_init(SC_VPLL8KCTRL);
 }
index 342a086b7dfc45653273c5abfc6f0601250f10e8..0e0ba27bd97b3c2a1ed9629b418a86bc87f3959e 100644 (file)
@@ -16,4 +16,6 @@ void uniphier_pxs2_sbc_init(void)
        /* necessary for ROM boot ?? */
        /* system bus output enable */
        writel(0x17, PC0CTRL);
+
+       uniphier_pin_init("system_bus_grp");    /* PXs3 */
 }
index d3aa18530d97593bd0b43ce071f10363d59f09d6..d0a51f239c3808c2beede8c86631089d3b5bed59 100644 (file)
 
 #define SC_BASE_ADDR           0x61840000
 
-/* PLL type: SSC */
-#define SC_CPLLCTRL    (SC_BASE_ADDR | 0x1400) /* LD11/20: CPU/ARM */
-#define SC_SPLLCTRL    (SC_BASE_ADDR | 0x1410) /* LD11/20: misc */
-#define SC_SPLL2CTRL   (SC_BASE_ADDR | 0x1420) /* LD20: IPP */
-#define SC_MPLLCTRL    (SC_BASE_ADDR | 0x1430) /* LD11/20: Video codec */
-#define SC_VSPLLCTRL   (SC_BASE_ADDR | 0x1440) /* LD11 */
-#define SC_VPPLLCTRL   (SC_BASE_ADDR | 0x1440) /* LD20: VPE etc. */
-#define SC_GPPLLCTRL   (SC_BASE_ADDR | 0x1450) /* LD20: GPU/Mali */
-#define SC_DPLLCTRL    (SC_BASE_ADDR | 0x1460) /* LD11: DDR memory */
-#define SC_DPLL0CTRL   (SC_BASE_ADDR | 0x1460) /* LD20: DDR memory 0 */
-#define SC_DPLL1CTRL   (SC_BASE_ADDR | 0x1470) /* LD20: DDR memory 1 */
-#define SC_DPLL2CTRL   (SC_BASE_ADDR | 0x1480) /* LD20: DDR memory 2 */
-
-/* PLL type: VPLL27 */
-#define SC_VPLL27FCTRL (SC_BASE_ADDR | 0x1500)
-#define SC_VPLL27ACTRL (SC_BASE_ADDR | 0x1520)
-
-/* PLL type: DSPLL */
-#define SC_VPLL8KCTRL  (SC_BASE_ADDR | 0x1540)
-#define SC_A2PLLCTRL   (SC_BASE_ADDR | 0x15C0)
-
 #define SC_RSTCTRL             (SC_BASE_ADDR | 0x2000)
 #define SC_RSTCTRL3            (SC_BASE_ADDR | 0x2008)
 #define SC_RSTCTRL4            (SC_BASE_ADDR | 0x200c)
index be0ae70f1a89cd68e17d67f766e2923bfd2658f2..53872f6fa3e3558c90b5e884b98627e114ba28d4 100644 (file)
@@ -36,7 +36,9 @@ CONFIG_GPIO_UNIPHIER=y
 CONFIG_MISC=y
 CONFIG_I2C_EEPROM=y
 CONFIG_MMC_UNIPHIER=y
+CONFIG_NAND=y
 CONFIG_NAND_DENALI=y
+CONFIG_NAND_DENALI_DT=y
 CONFIG_SYS_NAND_DENALI_64BIT=y
 CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES=8
 CONFIG_SPL_NAND_DENALI=y
index 5ba8879af6aeb2f3660ba604ece779339ac8f2d3..baec769c54400f7b6d4759b084289a8b2f5c352c 100644 (file)
@@ -35,7 +35,9 @@ CONFIG_GPIO_UNIPHIER=y
 CONFIG_MISC=y
 CONFIG_I2C_EEPROM=y
 CONFIG_MMC_UNIPHIER=y
+CONFIG_NAND=y
 CONFIG_NAND_DENALI=y
+CONFIG_NAND_DENALI_DT=y
 CONFIG_SYS_NAND_DENALI_64BIT=y
 CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES=8
 CONFIG_SPL_NAND_DENALI=y
index 22c21548b6d7efe63cd6ce0814f13d4824e8b525..4ab56d804fedce64521de7a58491aa7746f9a313 100644 (file)
@@ -36,7 +36,9 @@ CONFIG_GPIO_UNIPHIER=y
 CONFIG_MISC=y
 CONFIG_I2C_EEPROM=y
 CONFIG_MMC_UNIPHIER=y
+CONFIG_NAND=y
 CONFIG_NAND_DENALI=y
+CONFIG_NAND_DENALI_DT=y
 CONFIG_SYS_NAND_DENALI_64BIT=y
 CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES=8
 CONFIG_SPL_NAND_DENALI=y
index 066685f7b00277cbca323e89707f8fd1d52460d2..f4e183574580fd4331d29e0262faf2b7613e4013 100644 (file)
@@ -31,6 +31,11 @@ CONFIG_I2C_EEPROM=y
 CONFIG_MMC_UNIPHIER=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_CADENCE=y
+CONFIG_NAND=y
+CONFIG_NAND_DENALI=y
+CONFIG_NAND_DENALI_DT=y
+CONFIG_SYS_NAND_DENALI_64BIT=y
+CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES=8
 CONFIG_SYSRESET=y
 CONFIG_SYSRESET_PSCI=y
 CONFIG_USB=y
index ed623aa56f755cfc5276f764ab24ced69270733a..54c7e09bd6062364f20cc257be5fe2470766e72a 100644 (file)
@@ -1,2 +1,3 @@
 obj-y  += clk-uniphier-core.o
+obj-y  += clk-uniphier-sys.o
 obj-y  += clk-uniphier-mio.o
index eed21b9a6871dfd5d6f3020198f787d6b6d03a2b..722cd6b060c8d02896aa08f4ec0de4a8394b8686 100644 (file)
@@ -146,6 +146,36 @@ static int uniphier_clk_probe(struct udevice *dev)
 }
 
 static const struct udevice_id uniphier_clk_match[] = {
+       /* System clock */
+       {
+               .compatible = "socionext,uniphier-ld4-clock",
+               .data = (ulong)&uniphier_pxs2_sys_clk_data,
+       },
+       {
+               .compatible = "socionext,uniphier-pro4-clock",
+               .data = (ulong)&uniphier_pxs2_sys_clk_data,
+       },
+       {
+               .compatible = "socionext,uniphier-sld8-clock",
+               .data = (ulong)&uniphier_pxs2_sys_clk_data,
+       },
+       {
+               .compatible = "socionext,uniphier-pro5-clock",
+               .data = (ulong)&uniphier_pxs2_sys_clk_data,
+       },
+       {
+               .compatible = "socionext,uniphier-pxs2-clock",
+               .data = (ulong)&uniphier_pxs2_sys_clk_data,
+       },
+       {
+               .compatible = "socionext,uniphier-ld11-clock",
+               .data = (ulong)&uniphier_ld20_sys_clk_data,
+       },
+       {
+               .compatible = "socionext,uniphier-ld20-clock",
+               .data = (ulong)&uniphier_ld20_sys_clk_data,
+       },
+       /* Media I/O clock */
        {
                .compatible = "socionext,uniphier-ld4-mio-clock",
                .data = (ulong)&uniphier_mio_clk_data,
diff --git a/drivers/clk/uniphier/clk-uniphier-sys.c b/drivers/clk/uniphier/clk-uniphier-sys.c
new file mode 100644 (file)
index 0000000..709fa50
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2016-2017 Socionext Inc.
+ *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include "clk-uniphier.h"
+
+const struct uniphier_clk_gate_data uniphier_pxs2_sys_clk_gate[] = {
+       UNIPHIER_CLK_GATE(8, 0x2104, 10),       /* stdmac */
+       UNIPHIER_CLK_GATE(12, 0x2104, 6),       /* gio (Pro4, Pro5) */
+       UNIPHIER_CLK_GATE(14, 0x2104, 16),      /* usb30 (Pro4, Pro5, PXs2) */
+       UNIPHIER_CLK_GATE(15, 0x2104, 17),      /* usb31 (Pro4, Pro5, PXs2) */
+       UNIPHIER_CLK_GATE(16, 0x2104, 19),      /* usb30-phy (PXs2) */
+       UNIPHIER_CLK_GATE(20, 0x2104, 20),      /* usb31-phy (PXs2) */
+       UNIPHIER_CLK_END
+};
+
+const struct uniphier_clk_data uniphier_pxs2_sys_clk_data = {
+       .gate = uniphier_pxs2_sys_clk_gate,
+};
+
+const struct uniphier_clk_gate_data uniphier_ld20_sys_clk_gate[] = {
+       UNIPHIER_CLK_GATE(8, 0x210c, 8),        /* stdmac */
+       UNIPHIER_CLK_GATE(14, 0x210c, 14),      /* usb30 (LD20) */
+       UNIPHIER_CLK_GATE(16, 0x210c, 12),      /* usb30-phy0 (LD20) */
+       UNIPHIER_CLK_GATE(17, 0x210c, 13),      /* usb30-phy1 (LD20) */
+       UNIPHIER_CLK_END
+};
+
+const struct uniphier_clk_data uniphier_ld20_sys_clk_data = {
+       .gate = uniphier_ld20_sys_clk_gate,
+};
index f9a560ee73d355cb38bdb0cb0d6faf92bb3f8c7f..770a3225e1a3bdddbad1a0319ef0e50e10f43047 100644 (file)
@@ -50,6 +50,8 @@ struct uniphier_clk_data {
                .rates = {(_reg),},                     \
        }
 
+extern const struct uniphier_clk_data uniphier_pxs2_sys_clk_data;
+extern const struct uniphier_clk_data uniphier_ld20_sys_clk_data;
 extern const struct uniphier_clk_data uniphier_mio_clk_data;
 
 #endif /* __CLK_UNIPHIER_H__ */
index c1a2e9f0daefdffef2b7087e91d5b23f86bb1c6e..0685b689d8467061aaa4ed6081538558eaa9fe98 100644 (file)
@@ -627,3 +627,15 @@ int ofnode_read_resource(ofnode node, uint index, struct resource *res)
                return 0;
        }
 }
+
+int ofnode_read_resource_byname(ofnode node, const char *name,
+                               struct resource *res)
+{
+       int index;
+
+       index = ofnode_stringlist_search(node, "reg-names", name);
+       if (index < 0)
+               return index;
+
+       return ofnode_read_resource(node, index, res);
+}
index fe40bed64de3c8f6d164b05a4e13e15eec377d35..6acb33388f560e5f9e828a99193b8a99861442ca 100644 (file)
@@ -164,3 +164,9 @@ int dev_read_resource(struct udevice *dev, uint index, struct resource *res)
 {
        return ofnode_read_resource(dev_ofnode(dev), index, res);
 }
+
+int dev_read_resource_byname(struct udevice *dev, const char *name,
+                            struct resource *res)
+{
+       return ofnode_read_resource_byname(dev_ofnode(dev), name, res);
+}
index 71d678fc66b5895878c153b559cd8561ebb1eaa7..85b26d608851591cca14dd36e1229db845215918 100644 (file)
@@ -16,6 +16,13 @@ config NAND_DENALI
        help
          Enable support for the Denali NAND controller.
 
+config NAND_DENALI_DT
+       bool "Support Denali NAND controller as a DT device"
+       depends on NAND_DENALI && OF_CONTROL && DM
+       help
+         Enable the driver for NAND flash on platforms using a Denali NAND
+         controller as a DT device.
+
 config SYS_NAND_DENALI_64BIT
        bool "Use 64-bit variant of Denali NAND controller"
        depends on NAND_DENALI
index c3d4a996f37fa7e9ffc28ddb1e7cee1f7a16a490..9f7d9d6ff7ae2ca04edfe29bd09f4af9da810fc1 100644 (file)
@@ -44,6 +44,7 @@ obj-$(CONFIG_NAND_ATMEL) += atmel_nand.o
 obj-$(CONFIG_NAND_ARASAN) += arasan_nfc.o
 obj-$(CONFIG_NAND_DAVINCI) += davinci_nand.o
 obj-$(CONFIG_NAND_DENALI) += denali.o
+obj-$(CONFIG_NAND_DENALI_DT) += denali_dt.o
 obj-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_nand.o
 obj-$(CONFIG_NAND_FSL_IFC) += fsl_ifc_nand.o
 obj-$(CONFIG_NAND_FSL_UPM) += fsl_upm.o
index 18280b0b2fe87092db40720d7e1355dbf04da9f8..47cf37d1d9b7d2934d1c5e04a0aef0361758c907 100644 (file)
@@ -1175,7 +1175,7 @@ static void denali_hw_init(struct denali_nand_info *denali)
 
 static struct nand_ecclayout nand_oob;
 
-static int denali_init(struct denali_nand_info *denali)
+int denali_init(struct denali_nand_info *denali)
 {
        struct mtd_info *mtd = nand_to_mtd(&denali->nand);
        int ret;
@@ -1273,6 +1273,7 @@ fail:
        return ret;
 }
 
+#ifndef CONFIG_NAND_DENALI_DT
 static int __board_nand_init(void)
 {
        struct denali_nand_info *denali;
@@ -1296,3 +1297,4 @@ void board_nand_init(void)
        if (__board_nand_init() < 0)
                pr_warn("Failed to initialize Denali NAND controller.\n");
 }
+#endif
index 0e098bddf11daddb2ad87c671cfea2ec0283f16f..694bce53a955f272891a81b43e5cec3f8f394c50 100644 (file)
@@ -464,4 +464,6 @@ struct denali_nand_info {
        uint32_t max_banks;
 };
 
+int denali_init(struct denali_nand_info *denali);
+
 #endif /* __DENALI_H__ */
diff --git a/drivers/mtd/nand/denali_dt.c b/drivers/mtd/nand/denali_dt.c
new file mode 100644 (file)
index 0000000..0a6155c
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2017 Socionext Inc.
+ *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <linux/io.h>
+#include <linux/ioport.h>
+
+#include "denali.h"
+
+static const struct udevice_id denali_nand_dt_ids[] = {
+       {
+               .compatible = "altr,socfpga-denali-nand",
+       },
+       {
+               .compatible = "socionext,uniphier-denali-nand-v5a",
+       },
+       {
+               .compatible = "socionext,uniphier-denali-nand-v5b",
+       },
+       { /* sentinel */ }
+};
+
+static int denali_dt_probe(struct udevice *dev)
+{
+       struct denali_nand_info *denali = dev_get_priv(dev);
+       struct resource res;
+       int ret;
+
+       ret = dev_read_resource_byname(dev, "denali_reg", &res);
+       if (ret)
+               return ret;
+
+       denali->flash_reg = devm_ioremap(dev, res.start, resource_size(&res));
+
+       ret = dev_read_resource_byname(dev, "nand_data", &res);
+       if (ret)
+               return ret;
+
+       denali->flash_mem = devm_ioremap(dev, res.start, resource_size(&res));
+
+       return denali_init(denali);
+}
+
+U_BOOT_DRIVER(denali_nand_dt) = {
+       .name = "denali-nand-dt",
+       .id = UCLASS_MISC,
+       .of_match = denali_nand_dt_ids,
+       .probe = denali_dt_probe,
+       .priv_auto_alloc_size = sizeof(struct denali_nand_info),
+};
+
+void board_nand_init(void)
+{
+       struct udevice *dev;
+       int ret;
+
+       ret = uclass_get_device_by_driver(UCLASS_MISC,
+                                         DM_GET_DRIVER(denali_nand_dt),
+                                         &dev);
+       if (ret && ret != -ENODEV)
+               printf("Failed to initialize Denali NAND controller. (error %d)\n",
+                      ret);
+}
index ebb2cae5eb3368eee2d1fed1674f761f762bb22d..c74d16fe206577fbdd640d6789324906b8f6dda2 100644 (file)
@@ -77,6 +77,17 @@ static const struct uniphier_reset_data uniphier_ld20_sys_reset_data[] = {
        UNIPHIER_RESET_END,
 };
 
+static const struct uniphier_reset_data uniphier_pxs3_sys_reset_data[] = {
+       UNIPHIER_RESETX(2, 0x200c, 0),          /* NAND */
+       UNIPHIER_RESETX(4, 0x200c, 2),          /* eMMC */
+       UNIPHIER_RESETX(8, 0x200c, 12),         /* STDMAC */
+       UNIPHIER_RESETX(12, 0x200c, 5),         /* USB30 (GIO0) */
+       UNIPHIER_RESETX(13, 0x200c, 6),         /* USB31 (GIO1) */
+       UNIPHIER_RESETX(16, 0x200c, 16),        /* USB30-PHY */
+       UNIPHIER_RESETX(20, 0x200c, 17),        /* USB31-PHY */
+       UNIPHIER_RESET_END,
+};
+
 /* Media I/O reset data */
 #define UNIPHIER_MIO_RESET_SD(id, ch)                  \
        UNIPHIER_RESETX((id), 0x110 + 0x200 * (ch), 0)
@@ -268,6 +279,10 @@ static const struct udevice_id uniphier_reset_match[] = {
                .compatible = "socionext,uniphier-ld20-reset",
                .data = (ulong)uniphier_ld20_sys_reset_data,
        },
+       {
+               .compatible = "socionext,uniphier-pxs3-reset",
+               .data = (ulong)uniphier_pxs3_sys_reset_data,
+       },
        /* Media I/O reset */
        {
                .compatible = "socionext,uniphier-ld4-mio-reset",
@@ -294,7 +309,15 @@ static const struct udevice_id uniphier_reset_match[] = {
                .data = (ulong)uniphier_mio_reset_data,
        },
        {
-               .compatible = "socionext,uniphier-ld20-mio-reset",
+               .compatible = "socionext,uniphier-ld11-sd-reset",
+               .data = (ulong)uniphier_mio_reset_data,
+       },
+       {
+               .compatible = "socionext,uniphier-ld20-sd-reset",
+               .data = (ulong)uniphier_mio_reset_data,
+       },
+       {
+               .compatible = "socionext,uniphier-pxs3-sd-reset",
                .data = (ulong)uniphier_mio_reset_data,
        },
        /* Peripheral reset */
@@ -326,6 +349,10 @@ static const struct udevice_id uniphier_reset_match[] = {
                .compatible = "socionext,uniphier-ld20-peri-reset",
                .data = (ulong)uniphier_pro4_peri_reset_data,
        },
+       {
+               .compatible = "socionext,uniphier-pxs3-peri-reset",
+               .data = (ulong)uniphier_pro4_peri_reset_data,
+       },
        { /* sentinel */ }
 };
 
index 9a64063c3ee675c79b7d783298bc2d63bc2f6cf8..884e59c35e411b847e45ec95e95f5d04e5a5bbce 100644 (file)
@@ -83,7 +83,6 @@
 #endif
 
 #define CONFIG_SYS_MAX_NAND_DEVICE                     1
-#define CONFIG_SYS_NAND_MAX_CHIPS                      2
 #define CONFIG_SYS_NAND_ONFI_DETECTION
 
 #define CONFIG_NAND_DENALI_ECC_SIZE                    1024
@@ -91,8 +90,6 @@
 #define CONFIG_SYS_NAND_REGS_BASE                      0x68100000
 #define CONFIG_SYS_NAND_DATA_BASE                      0x68000000
 
-#define CONFIG_SYS_NAND_BASE           (CONFIG_SYS_NAND_DATA_BASE + 0x10)
-
 #define CONFIG_SYS_NAND_USE_FLASH_BBT
 #define CONFIG_SYS_NAND_BAD_BLOCK_POS                  0
 
index 210ddb2e5d7464573ef6d8c85cd0cd1d2a85291a..de2769ed537695416d651660fc568d2d59e60cec 100644 (file)
@@ -625,5 +625,7 @@ int ofnode_read_simple_size_cells(ofnode node);
 bool ofnode_pre_reloc(ofnode node);
 
 int ofnode_read_resource(ofnode node, uint index, struct resource *res);
+int ofnode_read_resource_byname(ofnode node, const char *name,
+                               struct resource *res);
 
 #endif
index c3a4a5611a70aad6fd7b4669524c0f2d461195dd..49d69c990f6eb07f529c12f0af7b1b71b1a3cd1d 100644 (file)
@@ -359,13 +359,24 @@ int dev_read_enabled(struct udevice *dev);
 /**
  * dev_read_resource() - obtain an indexed resource from a device.
  *
- * @dev: devuce to examine
+ * @dev: device to examine
  * @index index of the resource to retrieve (0 = first)
  * @res returns the resource
  * @return 0 if ok, negative on error
  */
 int dev_read_resource(struct udevice *dev, uint index, struct resource *res);
 
+/**
+ * dev_read_resource_byname() - obtain a named resource from a device.
+ *
+ * @dev: device to examine
+ * @name: name of the resource to retrieve
+ * @res: returns the resource
+ * @return 0 if ok, negative on error
+ */
+int dev_read_resource_byname(struct udevice *dev, const char *name,
+                            struct resource *res);
+
 #else /* CONFIG_DM_DEV_READ_INLINE is enabled */
 
 static inline int dev_read_u32_default(struct udevice *dev,
@@ -513,6 +524,13 @@ static inline int dev_read_resource(struct udevice *dev, uint index,
        return ofnode_read_resource(dev_ofnode(dev), index, res);
 }
 
+static inline int dev_read_resource_byname(struct udevice *dev,
+                                          const char *name,
+                                          struct resource *res)
+{
+       return ofnode_read_resource_byname(dev_ofnode(dev), name, res);
+}
+
 #endif /* CONFIG_DM_DEV_READ_INLINE */
 
 /**