Merge tag 'mmc-6-23' of https://github.com/MrVan/u-boot
authorTom Rini <trini@konsulko.com>
Mon, 8 Jul 2019 19:49:50 +0000 (15:49 -0400)
committerTom Rini <trini@konsulko.com>
Mon, 8 Jul 2019 19:59:41 +0000 (15:59 -0400)
- Pull in the series to split fsl_esdhc for i.MX/non-i.MX cleanly

144 files changed:
.travis.yml
Kconfig
Makefile
arch/arm/dts/Makefile
arch/arm/dts/bcm2835-rpi-a-plus.dts
arch/arm/dts/bcm2835-rpi-a.dts
arch/arm/dts/bcm2835-rpi-b-plus.dts
arch/arm/dts/bcm2835-rpi-b-rev2.dts
arch/arm/dts/bcm2835-rpi-b.dts
arch/arm/dts/bcm2835-rpi-cm1-io1.dts [new file with mode: 0644]
arch/arm/dts/bcm2835-rpi-cm1.dtsi [new file with mode: 0644]
arch/arm/dts/bcm2835-rpi-zero-w.dts
arch/arm/dts/bcm2835-rpi-zero.dts [new file with mode: 0644]
arch/arm/dts/bcm2835-rpi.dtsi
arch/arm/dts/bcm2835.dtsi
arch/arm/dts/bcm2836-rpi-2-b.dts
arch/arm/dts/bcm2836-rpi.dtsi [new file with mode: 0644]
arch/arm/dts/bcm2836.dtsi
arch/arm/dts/bcm2837-rpi-3-a-plus.dts [new file with mode: 0644]
arch/arm/dts/bcm2837-rpi-3-b-plus.dts [new file with mode: 0644]
arch/arm/dts/bcm2837-rpi-3-b.dts
arch/arm/dts/bcm2837-rpi-cm3-io3.dts [new file with mode: 0644]
arch/arm/dts/bcm2837-rpi-cm3.dtsi [new file with mode: 0644]
arch/arm/dts/bcm2837.dtsi
arch/arm/dts/bcm283x-rpi-lan7515.dtsi [new file with mode: 0644]
arch/arm/dts/bcm283x-rpi-smsc9512.dtsi
arch/arm/dts/bcm283x-rpi-usb-otg.dtsi [new file with mode: 0644]
arch/arm/dts/bcm283x.dtsi
arch/arm/dts/imx53-m53.dtsi [new file with mode: 0644]
arch/arm/dts/imx53-m53menlo-u-boot.dtsi [new file with mode: 0644]
arch/arm/dts/imx53-m53menlo.dts [new file with mode: 0644]
arch/arm/dts/imx53.dtsi
arch/arm/dts/imx6dl-wandboard-revb1.dts
arch/arm/dts/imx6q-wandboard-revb1.dts [new file with mode: 0644]
arch/arm/dts/imx6qdl-wandboard-revb1.dtsi
arch/arm/dts/imx6qdl-wandboard-revd1.dtsi [new file with mode: 0644]
arch/arm/dts/imx6qdl-wandboard.dtsi
arch/arm/dts/imx6qp-wandboard-revd1.dts [new file with mode: 0644]
arch/arm/dts/rk3288-tinker-u-boot.dtsi [new file with mode: 0644]
arch/arm/dts/rk3288-tinker.dts
arch/arm/dts/rk3288-u-boot.dtsi [new file with mode: 0644]
arch/arm/dts/rk3288-veyron-speedy-u-boot.dtsi
arch/arm/dts/rk3288-vyasa-u-boot.dtsi
arch/arm/dts/rk3288.dtsi
arch/arm/dts/rk3328-rock64-u-boot.dtsi [new file with mode: 0644]
arch/arm/dts/rk3328-rock64.dts [new file with mode: 0644]
arch/arm/dts/rk3399-gru.dtsi
arch/arm/dts/rk3399-puma.dtsi
arch/arm/dts/rk3399-rockpro64-u-boot.dtsi
arch/arm/dts/rk3399-u-boot.dtsi
arch/arm/dts/stm32f746-disco-u-boot.dtsi
arch/arm/dts/stm32f769-disco-u-boot.dtsi
arch/arm/mach-bcm283x/include/mach/mbox.h
arch/arm/mach-imx/hab.c
arch/arm/mach-mediatek/Kconfig
arch/arm/mach-mediatek/cpu.c
arch/arm/mach-rockchip/Kconfig
arch/arm/mach-rockchip/Makefile
arch/arm/mach-rockchip/make_fit_atf.py
arch/arm/mach-rockchip/rk3288/Kconfig
arch/arm/mach-rockchip/rk3328-board-spl.c [new file with mode: 0644]
arch/arm/mach-rockchip/rk3399-board-spl.c
arch/arm/mach-rockchip/rk3399-board-tpl.c
arch/arm/mach-stm32/soc.c
arch/arm/mach-uniphier/arm32/debug_ll.S
arch/arm/mach-uniphier/debug-uart/Makefile
arch/arm/mach-uniphier/debug-uart/debug-uart-ld20.c [deleted file]
arch/arm/mach-uniphier/debug-uart/debug-uart.c
arch/arm/mach-uniphier/debug-uart/debug-uart.h
arch/arm/mach-uniphier/dram_init.c
arch/arm/mach-uniphier/sc-regs.h
arch/arm/mach-uniphier/sg-regs.h
arch/mips/Kconfig
arch/mips/mach-mtmips/cpu.c
arch/sandbox/dts/test.dts
arch/x86/cpu/tangier/Kconfig
arch/x86/dts/edison.dts
arch/x86/lib/init_helpers.c
board/amlogic/p200/MAINTAINERS
board/amlogic/p201/MAINTAINERS
board/amlogic/p212/MAINTAINERS
board/amlogic/q200/MAINTAINERS
board/amlogic/s400/MAINTAINERS
board/amlogic/u200/MAINTAINERS
board/atmel/common/board.c
board/menlo/m53menlo/m53menlo.c
board/rockchip/evb_rk3328/MAINTAINERS
board/rockchip/evb_rk3399/evb-rk3399.c
board/technexion/pico-imx7d/README
board/theobroma-systems/puma_rk3399/README
board/theobroma-systems/puma_rk3399/fit_spl_atf.its [deleted file]
board/theobroma-systems/puma_rk3399/fit_spl_atf.sh [new file with mode: 0755]
board/theobroma-systems/puma_rk3399/puma-rk3399.c
board/vamrs/rock960_rk3399/README
board/vamrs/rock960_rk3399/rock960-rk3399.c
board/wandboard/README
board/wandboard/wandboard.c
common/board_r.c
common/spl/spl_atf.c
common/spl/spl_sdp.c
configs/edison_defconfig
configs/evb-rk3328_defconfig
configs/m53menlo_defconfig
configs/poplar_defconfig
configs/puma-rk3399_defconfig
configs/rock64-rk3328_defconfig [new file with mode: 0644]
configs/rpi_3_b_plus_defconfig [new file with mode: 0644]
configs/tinker-rk3288_defconfig
configs/wandboard_defconfig
doc/README.rockchip
drivers/core/uclass.c
drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c
drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c
drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c
drivers/pinctrl/uniphier/pinctrl-uniphier-ld6b.c
drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c
drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c
drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c
drivers/pinctrl/uniphier/pinctrl-uniphier-pxs3.c
drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c
drivers/usb/dwc3/dwc3-generic.c
drivers/usb/gadget/f_sdp.c
drivers/usb/host/ehci-mx6.c
drivers/video/pwm_backlight.c
drivers/watchdog/Kconfig
drivers/watchdog/Makefile
drivers/watchdog/tangier_wdt.c
include/configs/apalis_imx6.h
include/configs/m53menlo.h
include/configs/pico-imx7d.h
include/configs/rk3328_common.h
include/configs/rpi.h
include/configs/tinker_rk3288.h
include/configs/wandboard.h
include/dm/uclass-id.h
include/dt-bindings/clock/bcm2835-aux.h
include/dt-bindings/clock/bcm2835.h
include/dt-bindings/net/microchip-lan78xx.h [new file with mode: 0644]
include/dt-bindings/pinctrl/bcm2835.h
include/dt-bindings/soc/bcm2835-pm.h [new file with mode: 0644]
include/efi_api.h
include/sdp.h
test/dm/Makefile
test/dm/nop.c [new file with mode: 0644]

index e4e7e65..6662ca1 100644 (file)
@@ -50,6 +50,7 @@ install:
  - . /tmp/venv/bin/activate
  - pip install pytest==2.8.7
  - pip install python-subunit
+ - pip install pyelftools
  - grub-mkimage -o ~/grub_x86.efi -O i386-efi normal  echo lsefimmap lsefi lsefisystab efinet tftp minicmd
  - grub-mkimage -o ~/grub_x64.efi -O x86_64-efi normal  echo lsefimmap lsefi lsefisystab efinet tftp minicmd
  - mkdir ~/grub2-arm
diff --git a/Kconfig b/Kconfig
index 6b44256..df8f294 100644 (file)
--- a/Kconfig
+++ b/Kconfig
@@ -250,7 +250,7 @@ config BUILD_TARGET
        default "u-boot-with-spl.sfp" if TARGET_SOCFPGA_GEN5
        default "u-boot-spl.kwb" if ARCH_MVEBU && SPL
        default "u-boot-elf.srec" if RCAR_GEN3
-       default "u-boot.itb" if SPL_LOAD_FIT && ARCH_SUNXI
+       default "u-boot.itb" if SPL_LOAD_FIT && (ROCKCHIP_RK3399 || ARCH_SUNXI)
        default "u-boot.kwb" if KIRKWOOD
        default "u-boot-with-spl.bin" if ARCH_AT91 && SPL_NAND_SUPPORT
        help
index 6335834..516260f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@
 VERSION = 2019
 PATCHLEVEL = 07
 SUBLEVEL =
-EXTRAVERSION = -rc4
+EXTRAVERSION =
 NAME =
 
 # *DOCUMENTATION*
@@ -1847,7 +1847,8 @@ clean: $(clean-dirs)
                -o -name modules.builtin -o -name '.tmp_*.o.*' \
                -o -name 'dsdt.aml' -o -name 'dsdt.asl.tmp' -o -name 'dsdt.c' \
                -o -name '*.efi' -o -name '*.gcno' -o -name '*.so' \) \
-               -type f -print | xargs rm -f
+               -type f -print | xargs rm -f \
+               bl31.c bl31.elf bl31_*.bin image.map
 
 # mrproper - Delete all generated files, including .config
 #
index 4dfc2c6..20dbc2f 100644 (file)
@@ -93,7 +93,8 @@ dtb-$(CONFIG_ROCKCHIP_RK3288) += \
        rk3288-vyasa.dtb
 
 dtb-$(CONFIG_ROCKCHIP_RK3328) += \
-       rk3328-evb.dtb
+       rk3328-evb.dtb \
+       rk3328-rock64.dtb
 
 dtb-$(CONFIG_ROCKCHIP_RK3368) += \
        rk3368-lion.dtb \
@@ -536,15 +537,14 @@ dtb-$(CONFIG_VF610) += vf500-colibri.dtb \
        vf610-bk4r1.dtb
 
 dtb-$(CONFIG_MX53) += imx53-cx9020.dtb \
-       imx53-kp.dtb
+       imx53-kp.dtb \
+       imx53-m53menlo.dtb
 
 dtb-$(CONFIG_MX6Q) += \
        imx6-apalis.dtb \
        imx6q-display5.dtb \
        imx6q-logicpd.dtb \
-       imx6q-novena.dtb
-
-dtb-$(CONFIG_TARGET_TBS2910) += \
+       imx6q-novena.dtb \
        imx6q-tbs2910.dtb
 
 dtb-$(CONFIG_MX6QDL) += \
@@ -552,19 +552,19 @@ dtb-$(CONFIG_MX6QDL) += \
        imx6dl-icore-mipi.dtb \
        imx6dl-icore-rqs.dtb \
        imx6dl-mamoj.dtb \
+       imx6dl-sabreauto.dtb \
+       imx6dl-sabresd.dtb \
+       imx6dl-wandboard-revb1.dtb \
        imx6q-cm-fx6.dtb \
        imx6q-icore.dtb \
        imx6q-icore-mipi.dtb \
        imx6q-icore-rqs.dtb \
        imx6q-sabreauto.dtb \
        imx6q-sabresd.dtb \
-       imx6dl-sabreauto.dtb \
-       imx6dl-sabresd.dtb \
+       imx6q-wandboard-revb1.dtb \
        imx6qp-sabreauto.dtb \
-       imx6qp-sabresd.dtb
-
-dtb-$(CONFIG_TARGET_WANDBOARD) += \
-       imx6dl-wandboard-revb1.dtb
+       imx6qp-sabresd.dtb \
+       imx6qp-wandboard-revd1.dtb
 
 dtb-$(CONFIG_MX6SL) += imx6sl-evk.dtb
 
@@ -737,14 +737,19 @@ dtb-$(CONFIG_TARGET_VINCO) += \
        at91-vinco.dtb
 
 dtb-$(CONFIG_ARCH_BCM283X) += \
-       bcm2835-rpi-a-plus.dtb \
        bcm2835-rpi-a.dtb \
+       bcm2835-rpi-a-plus.dtb \
+       bcm2835-rpi-b.dtb \
        bcm2835-rpi-b-plus.dtb \
        bcm2835-rpi-b-rev2.dtb \
-       bcm2835-rpi-b.dtb \
-       bcm2835-rpi-zero-w.dtb \
+       bcm2835-rpi-cm1-io1.dtb \
+       bcm2835-rpi-zero.dtb \
+       bcm2835-rpi-zero-w.dtb\
        bcm2836-rpi-2-b.dtb \
-       bcm2837-rpi-3-b.dtb
+       bcm2837-rpi-3-a-plus.dtb \
+       bcm2837-rpi-3-b.dtb \
+       bcm2837-rpi-3-b-plus.dtb \
+       bcm2837-rpi-cm3-io3.dtb
 
 dtb-$(CONFIG_ARCH_BCM63158) += \
        bcm963158.dtb
index 9f86649..db8a601 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /dts-v1/;
 #include "bcm2835.dtsi"
 #include "bcm2835-rpi.dtsi"
 
        leds {
                act {
-                       gpios = <&gpio 47 0>;
+                       gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
                };
 
                pwr {
                        label = "PWR";
-                       gpios = <&gpio 35 0>;
+                       gpios = <&gpio 35 GPIO_ACTIVE_HIGH>;
                        default-state = "keep";
                        linux,default-trigger = "default-on";
                };
@@ -30,8 +31,8 @@
         * "FOO" = GPIO line named "FOO" on the schematic
         * "FOO_N" = GPIO line named "FOO" on schematic, active low
         */
-       gpio-line-names = "SDA0",
-                         "SCL0",
+       gpio-line-names = "ID_SDA",
+                         "ID_SCL",
                          "SDA1",
                          "SCL1",
                          "GPIO_GCLK",
        hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
 };
 
+&pwm {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio45>;
+       status = "okay";
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_gpio14>;
index 4b1af06..067d1f0 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /dts-v1/;
 #include "bcm2835.dtsi"
 #include "bcm2835-rpi.dtsi"
@@ -9,7 +10,7 @@
 
        leds {
                act {
-                       gpios = <&gpio 16 1>;
+                       gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
                };
        };
 };
        hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>;
 };
 
+&pwm {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio45>;
+       status = "okay";
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_gpio14>;
index a846f1e..1e40d67 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /dts-v1/;
 #include "bcm2835.dtsi"
 #include "bcm2835-rpi.dtsi"
 
        leds {
                act {
-                       gpios = <&gpio 47 0>;
+                       gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
                };
 
                pwr {
                        label = "PWR";
-                       gpios = <&gpio 35 0>;
+                       gpios = <&gpio 35 GPIO_ACTIVE_HIGH>;
                        default-state = "keep";
                        linux,default-trigger = "default-on";
                };
@@ -32,8 +33,8 @@
         * "FOO" = GPIO line named "FOO" on the schematic
         * "FOO_N" = GPIO line named "FOO" on schematic, active low
         */
-       gpio-line-names = "SDA0",
-                         "SCL0",
+       gpio-line-names = "ID_SDA",
+                         "ID_SCL",
                          "SDA1",
                          "SCL1",
                          "GPIO_GCLK",
        hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
 };
 
+&pwm {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio45>;
+       status = "okay";
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_gpio14>;
index e860964..28e7513 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /dts-v1/;
 #include "bcm2835.dtsi"
 #include "bcm2835-rpi.dtsi"
@@ -10,7 +11,7 @@
 
        leds {
                act {
-                       gpios = <&gpio 16 1>;
+                       gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
                };
        };
 };
 };
 
 &hdmi {
-       hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
+       hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>;
+};
+
+&pwm {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio45>;
+       status = "okay";
 };
 
 &uart0 {
index 5d77f3f..31ff602 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /dts-v1/;
 #include "bcm2835.dtsi"
 #include "bcm2835-rpi.dtsi"
@@ -10,7 +11,7 @@
 
        leds {
                act {
-                       gpios = <&gpio 16 1>;
+                       gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
                };
        };
 };
        hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>;
 };
 
+&pwm {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio45>;
+       status = "okay";
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_gpio14>;
diff --git a/arch/arm/dts/bcm2835-rpi-cm1-io1.dts b/arch/arm/dts/bcm2835-rpi-cm1-io1.dts
new file mode 100644 (file)
index 0000000..4764a25
--- /dev/null
@@ -0,0 +1,88 @@
+// SPDX-License-Identifier: GPL-2.0
+/dts-v1/;
+#include "bcm2835-rpi-cm1.dtsi"
+#include "bcm283x-rpi-usb-host.dtsi"
+
+/ {
+       compatible = "raspberrypi,compute-module", "brcm,bcm2835";
+       model = "Raspberry Pi Compute Module IO board rev1";
+};
+
+&gpio {
+       /*
+        * This is based on the official GPU firmware DT blob.
+        *
+        * Legend:
+        * "NC" = not connected (no rail from the SoC)
+        * "FOO" = GPIO line named "FOO" on the schematic
+        * "FOO_N" = GPIO line named "FOO" on schematic, active low
+        */
+       gpio-line-names = "GPIO0",
+                         "GPIO1",
+                         "GPIO2",
+                         "GPIO3",
+                         "GPIO4",
+                         "GPIO5",
+                         "GPIO6",
+                         "GPIO7",
+                         "GPIO8",
+                         "GPIO9",
+                         "GPIO10",
+                         "GPIO11",
+                         "GPIO12",
+                         "GPIO13",
+                         "GPIO14",
+                         "GPIO15",
+                         "GPIO16",
+                         "GPIO17",
+                         "GPIO18",
+                         "GPIO19",
+                         "GPIO20",
+                         "GPIO21",
+                         "GPIO22",
+                         "GPIO23",
+                         "GPIO24",
+                         "GPIO25",
+                         "GPIO26",
+                         "GPIO27",
+                         "GPIO28",
+                         "GPIO29",
+                         "GPIO30",
+                         "GPIO31",
+                         "GPIO32",
+                         "GPIO33",
+                         "GPIO34",
+                         "GPIO35",
+                         "GPIO36",
+                         "GPIO37",
+                         "GPIO38",
+                         "GPIO39",
+                         "GPIO40",
+                         "GPIO41",
+                         "GPIO42",
+                         "GPIO43",
+                         "GPIO44",
+                         "GPIO45",
+                         "HDMI_HPD_N",
+                         /* Also used as ACT LED */
+                         "EMMC_EN_N",
+                         /* Used by eMMC */
+                         "SD_CLK_R",
+                         "SD_CMD_R",
+                         "SD_DATA0_R",
+                         "SD_DATA1_R",
+                         "SD_DATA2_R",
+                         "SD_DATA3_R";
+
+       pinctrl-0 = <&gpioout &alt0>;
+};
+
+&hdmi {
+       hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_gpio14>;
+       status = "okay";
+};
diff --git a/arch/arm/dts/bcm2835-rpi-cm1.dtsi b/arch/arm/dts/bcm2835-rpi-cm1.dtsi
new file mode 100644 (file)
index 0000000..ef22c2d
--- /dev/null
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: GPL-2.0
+/dts-v1/;
+#include "bcm2835.dtsi"
+#include "bcm2835-rpi.dtsi"
+
+/ {
+       leds {
+               act {
+                       gpios = <&gpio 47 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       reg_3v3: fixed-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "3V3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               regulator-always-on;
+       };
+
+       reg_1v8: fixed-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "1V8";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               regulator-always-on;
+       };
+};
+
+&sdhost {
+       non-removable;
+       vmmc-supply = <&reg_3v3>;
+       vqmmc-supply = <&reg_1v8>;
+};
index 7817054..ba0167d 100644 (file)
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2017 Stefan Wahren <stefan.wahren@i2se.com>
+ */
+
 /dts-v1/;
 #include "bcm2835.dtsi"
 #include "bcm2835-rpi.dtsi"
-#include "bcm283x-rpi-smsc9512.dtsi"
-#include "bcm283x-rpi-usb-host.dtsi"
+#include "bcm283x-rpi-usb-otg.dtsi"
 
 / {
        compatible = "raspberrypi,model-zero-w", "brcm,bcm2835";
        model = "Raspberry Pi Zero W";
 
+       chosen {
+               /* 8250 auxiliary UART instead of pl011 */
+               stdout-path = "serial1:115200n8";
+       };
+
        leds {
                act {
-                       gpios = <&gpio 47 0>;
+                       gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
                };
        };
+
+       wifi_pwrseq: wifi-pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               reset-gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
+       };
 };
 
-&uart1 {
-    pinctrl-names = "default";
-    pinctrl-0 = <&uart1_gpio14>;
-    status = "okay";
+&gpio {
+       /*
+        * This is based on the official GPU firmware DT blob.
+        *
+        * Legend:
+        * "NC" = not connected (no rail from the SoC)
+        * "FOO" = GPIO line named "FOO" on the schematic
+        * "FOO_N" = GPIO line named "FOO" on schematic, active low
+        */
+       gpio-line-names = "ID_SDA",
+                         "ID_SCL",
+                         "SDA1",
+                         "SCL1",
+                         "GPIO_GCLK",
+                         "GPIO5",
+                         "GPIO6",
+                         "SPI_CE1_N",
+                         "SPI_CE0_N",
+                         "SPI_MISO",
+                         "SPI_MOSI",
+                         "SPI_SCLK",
+                         "GPIO12",
+                         "GPIO13",
+                         /* Serial port */
+                         "TXD0",
+                         "RXD0",
+                         "GPIO16",
+                         "GPIO17",
+                         "GPIO18",
+                         "GPIO19",
+                         "GPIO20",
+                         "GPIO21",
+                         "GPIO22",
+                         "GPIO23",
+                         "GPIO24",
+                         "GPIO25",
+                         "GPIO26",
+                         "GPIO27",
+                         "SDA0",
+                         "SCL0",
+                         "NC", /* GPIO30 */
+                         "NC", /* GPIO31 */
+                         "NC", /* GPIO32 */
+                         "NC", /* GPIO33 */
+                         "NC", /* GPIO34 */
+                         "NC", /* GPIO35 */
+                         "NC", /* GPIO36 */
+                         "NC", /* GPIO37 */
+                         "NC", /* GPIO38 */
+                         "NC", /* GPIO39 */
+                         "CAM_GPIO1", /* GPIO40 */
+                         "WL_ON", /* GPIO41 */
+                         "NC", /* GPIO42 */
+                         "WIFI_CLK", /* GPIO43 */
+                         "CAM_GPIO0", /* GPIO44 */
+                         "BT_ON", /* GPIO45 */
+                         "HDMI_HPD_N",
+                         "STATUS_LED_N",
+                         /* Used by SD Card */
+                         "SD_CLK_R",
+                         "SD_CMD_R",
+                         "SD_DATA0_R",
+                         "SD_DATA1_R",
+                         "SD_DATA2_R",
+                         "SD_DATA3_R";
+
+       pinctrl-0 = <&gpioout &alt0>;
 };
 
 &hdmi {
        hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
 };
+
+&sdhci {
+       #address-cells = <1>;
+       #size-cells = <0>;
+       pinctrl-0 = <&emmc_gpio34 &gpclk2_gpio43>;
+       mmc-pwrseq = <&wifi_pwrseq>;
+       non-removable;
+       status = "okay";
+
+       brcmf: wifi@1 {
+               reg = <1>;
+               compatible = "brcm,bcm4329-fmac";
+       };
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_gpio32 &uart0_ctsrts_gpio30>;
+       status = "okay";
+
+       bluetooth {
+               compatible = "brcm,bcm43438-bt";
+               max-speed = <2000000>;
+               shutdown-gpios = <&gpio 45 GPIO_ACTIVE_HIGH>;
+       };
+};
+
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart1_gpio14>;
+       status = "okay";
+};
diff --git a/arch/arm/dts/bcm2835-rpi-zero.dts b/arch/arm/dts/bcm2835-rpi-zero.dts
new file mode 100644 (file)
index 0000000..3b35a8a
--- /dev/null
@@ -0,0 +1,105 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2016 Stefan Wahren <stefan.wahren@i2se.com>
+ */
+
+/dts-v1/;
+#include "bcm2835.dtsi"
+#include "bcm2835-rpi.dtsi"
+#include "bcm283x-rpi-usb-otg.dtsi"
+
+/ {
+       compatible = "raspberrypi,model-zero", "brcm,bcm2835";
+       model = "Raspberry Pi Zero";
+
+       leds {
+               act {
+                       gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
+               };
+       };
+};
+
+&gpio {
+       /*
+        * This is based on the official GPU firmware DT blob.
+        *
+        * Legend:
+        * "NC" = not connected (no rail from the SoC)
+        * "FOO" = GPIO line named "FOO" on the schematic
+        * "FOO_N" = GPIO line named "FOO" on schematic, active low
+        */
+       gpio-line-names = "ID_SDA",
+                         "ID_SCL",
+                         "SDA1",
+                         "SCL1",
+                         "GPIO_GCLK",
+                         "GPIO5",
+                         "GPIO6",
+                         "SPI_CE1_N",
+                         "SPI_CE0_N",
+                         "SPI_MISO",
+                         "SPI_MOSI",
+                         "SPI_SCLK",
+                         "GPIO12",
+                         "GPIO13",
+                         /* Serial port */
+                         "TXD0",
+                         "RXD0",
+                         "GPIO16",
+                         "GPIO17",
+                         "GPIO18",
+                         "GPIO19",
+                         "GPIO20",
+                         "GPIO21",
+                         "GPIO22",
+                         "GPIO23",
+                         "GPIO24",
+                         "GPIO25",
+                         "GPIO26",
+                         "GPIO27",
+                         "SDA0",
+                         "SCL0",
+                         "NC", /* GPIO30 */
+                         "NC", /* GPIO31 */
+                         "CAM_GPIO1", /* GPIO32 */
+                         "NC", /* GPIO33 */
+                         "NC", /* GPIO34 */
+                         "NC", /* GPIO35 */
+                         "NC", /* GPIO36 */
+                         "NC", /* GPIO37 */
+                         "NC", /* GPIO38 */
+                         "NC", /* GPIO39 */
+                         "NC", /* GPIO40 */
+                         "CAM_GPIO0", /* GPIO41 */
+                         "NC", /* GPIO42 */
+                         "NC", /* GPIO43 */
+                         "NC", /* GPIO44 */
+                         "NC", /* GPIO45 */
+                         "HDMI_HPD_N",
+                         "STATUS_LED_N",
+                         /* Used by SD Card */
+                         "SD_CLK_R",
+                         "SD_CMD_R",
+                         "SD_DATA0_R",
+                         "SD_DATA1_R",
+                         "SD_DATA2_R",
+                         "SD_DATA3_R";
+
+       pinctrl-0 = <&gpioout &alt0 &i2s_alt0>;
+
+       /* I2S interface */
+       i2s_alt0: i2s_alt0 {
+               brcm,pins = <18 19 20 21>;
+               brcm,function = <BCM2835_FSEL_ALT0>;
+       };
+};
+
+&hdmi {
+       hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_gpio14>;
+       status = "okay";
+};
index 8b95832..715d50c 100644 (file)
@@ -1,7 +1,7 @@
 #include <dt-bindings/power/raspberrypi-power.h>
 
 / {
-       memory {
+       memory@0 {
                device_type = "memory";
                reg = <0 0x10000000>;
        };
@@ -18,7 +18,7 @@
 
        soc {
                firmware: firmware {
-                       compatible = "raspberrypi,bcm2835-firmware";
+                       compatible = "raspberrypi,bcm2835-firmware", "simple-bus";
                        mboxes = <&mailbox>;
                };
 
                        firmware = <&firmware>;
                        #power-domain-cells = <1>;
                };
+
+               vchiq: mailbox@7e00b840 {
+                       compatible = "brcm,bcm2835-vchiq";
+                       reg = <0x7e00b840 0x3c>;
+                       interrupts = <0 2>;
+               };
        };
 };
 
 &sdhci {
        pinctrl-names = "default";
        pinctrl-0 = <&emmc_gpio48>;
-       status = "okay";
        bus-width = <4>;
 };
 
 &sdhost {
        pinctrl-names = "default";
        pinctrl-0 = <&sdhost_gpio48>;
-       bus-width = <4>;
-};
-
-&pwm {
-       pinctrl-names = "default";
-       pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio45>;
        status = "okay";
+       bus-width = <4>;
 };
 
 &usb {
        power-domains = <&power RPI_POWER_DOMAIN_USB>;
 };
 
-&v3d {
-       power-domains = <&power RPI_POWER_DOMAIN_V3D>;
-};
-
 &hdmi {
        power-domains = <&power RPI_POWER_DOMAIN_HDMI>;
        status = "okay";
index 659b6e9..a5c3824 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include "bcm283x.dtsi"
 
 / {
        soc {
                ranges = <0x7e000000 0x20000000 0x02000000>;
                dma-ranges = <0x40000000 0x00000000 0x20000000>;
+       };
 
-               arm-pmu {
-                       compatible = "arm,arm1176-pmu";
-               };
+       arm-pmu {
+               compatible = "arm,arm1176-pmu";
        };
 };
 
index e8de414..7b4e651 100644 (file)
@@ -1,6 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
 /dts-v1/;
 #include "bcm2836.dtsi"
-#include "bcm2835-rpi.dtsi"
+#include "bcm2836-rpi.dtsi"
 #include "bcm283x-rpi-smsc9514.dtsi"
 #include "bcm283x-rpi-usb-host.dtsi"
 
@@ -8,18 +9,18 @@
        compatible = "raspberrypi,2-model-b", "brcm,bcm2836";
        model = "Raspberry Pi 2 Model B";
 
-       memory {
+       memory@0 {
                reg = <0 0x40000000>;
        };
 
        leds {
                act {
-                       gpios = <&gpio 47 0>;
+                       gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
                };
 
                pwr {
                        label = "PWR";
-                       gpios = <&gpio 35 0>;
+                       gpios = <&gpio 35 GPIO_ACTIVE_HIGH>;
                        default-state = "keep";
                        linux,default-trigger = "default-on";
                };
 };
 
 &gpio {
+       /*
+        * Taken from rpi_SCH_2b_1p2_reduced.pdf and
+        * the official GPU firmware DT blob.
+        *
+        * Legend:
+        * "NC" = not connected (no rail from the SoC)
+        * "FOO" = GPIO line named "FOO" on the schematic
+        * "FOO_N" = GPIO line named "FOO" on schematic, active low
+        */
+       gpio-line-names = "ID_SDA",
+                         "ID_SCL",
+                         "SDA1",
+                         "SCL1",
+                         "GPIO_GCLK",
+                         "GPIO5",
+                         "GPIO6",
+                         "SPI_CE1_N",
+                         "SPI_CE0_N",
+                         "SPI_MISO",
+                         "SPI_MOSI",
+                         "SPI_SCLK",
+                         "GPIO12",
+                         "GPIO13",
+                         /* Serial port */
+                         "TXD0",
+                         "RXD0",
+                         "GPIO16",
+                         "GPIO17",
+                         "GPIO18",
+                         "GPIO19",
+                         "GPIO20",
+                         "GPIO21",
+                         "GPIO22",
+                         "GPIO23",
+                         "GPIO24",
+                         "GPIO25",
+                         "GPIO26",
+                         "GPIO27",
+                         "SDA0",
+                         "SCL0",
+                         "", /* GPIO30 */
+                         "LAN_RUN",
+                         "CAM_GPIO1",
+                         "", /* GPIO33 */
+                         "", /* GPIO34 */
+                         "PWR_LOW_N",
+                         "", /* GPIO36 */
+                         "", /* GPIO37 */
+                         "USB_LIMIT",
+                         "", /* GPIO39 */
+                         "PWM0_OUT",
+                         "CAM_GPIO0",
+                         "SMPS_SCL",
+                         "SMPS_SDA",
+                         "ETHCLK",
+                         "PWM1_OUT",
+                         "HDMI_HPD_N",
+                         "STATUS_LED",
+                         /* Used by SD Card */
+                         "SD_CLK_R",
+                         "SD_CMD_R",
+                         "SD_DATA0_R",
+                         "SD_DATA1_R",
+                         "SD_DATA2_R",
+                         "SD_DATA3_R";
+
        pinctrl-0 = <&gpioout &alt0 &i2s_alt0>;
 
        /* I2S interface */
        hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
 };
 
+&pwm {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio45>;
+       status = "okay";
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_gpio14>;
diff --git a/arch/arm/dts/bcm2836-rpi.dtsi b/arch/arm/dts/bcm2836-rpi.dtsi
new file mode 100644 (file)
index 0000000..c4c858b
--- /dev/null
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "bcm2835-rpi.dtsi"
+
+&vchiq {
+       compatible = "brcm,bcm2836-vchiq", "brcm,bcm2835-vchiq";
+};
index 2c26d0b..c933e84 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include "bcm283x.dtsi"
 
 / {
@@ -8,28 +9,28 @@
                         <0x40000000 0x40000000 0x00001000>;
                dma-ranges = <0xc0000000 0x00000000 0x3f000000>;
 
-               local_intc: local_intc {
+               local_intc: local_intc@40000000 {
                        compatible = "brcm,bcm2836-l1-intc";
                        reg = <0x40000000 0x100>;
                        interrupt-controller;
-                       #interrupt-cells = <1>;
+                       #interrupt-cells = <2>;
                        interrupt-parent = <&local_intc>;
                };
+       };
 
-               arm-pmu {
-                       compatible = "arm,cortex-a7-pmu";
-                       interrupt-parent = <&local_intc>;
-                       interrupts = <9>;
-               };
+       arm-pmu {
+               compatible = "arm,cortex-a7-pmu";
+               interrupt-parent = <&local_intc>;
+               interrupts = <9 IRQ_TYPE_LEVEL_HIGH>;
        };
 
        timer {
                compatible = "arm,armv7-timer";
                interrupt-parent = <&local_intc>;
-               interrupts = <0>, // PHYS_SECURE_PPI
-                            <1>, // PHYS_NONSECURE_PPI
-                            <3>, // VIRT_PPI
-                            <2>; // HYP_PPI
+               interrupts = <0 IRQ_TYPE_LEVEL_HIGH>, // PHYS_SECURE_PPI
+                            <1 IRQ_TYPE_LEVEL_HIGH>, // PHYS_NONSECURE_PPI
+                            <3 IRQ_TYPE_LEVEL_HIGH>, // VIRT_PPI
+                            <2 IRQ_TYPE_LEVEL_HIGH>; // HYP_PPI
                always-on;
        };
 
@@ -75,7 +76,7 @@
        compatible = "brcm,bcm2836-armctrl-ic";
        reg = <0x7e00b200 0x200>;
        interrupt-parent = <&local_intc>;
-       interrupts = <8>;
+       interrupts = <8 IRQ_TYPE_LEVEL_HIGH>;
 };
 
 &cpu_thermal {
diff --git a/arch/arm/dts/bcm2837-rpi-3-a-plus.dts b/arch/arm/dts/bcm2837-rpi-3-a-plus.dts
new file mode 100644 (file)
index 0000000..7f4437a
--- /dev/null
@@ -0,0 +1,175 @@
+// SPDX-License-Identifier: GPL-2.0
+/dts-v1/;
+#include "bcm2837.dtsi"
+#include "bcm2836-rpi.dtsi"
+#include "bcm283x-rpi-usb-host.dtsi"
+
+/ {
+       compatible = "raspberrypi,3-model-a-plus", "brcm,bcm2837";
+       model = "Raspberry Pi 3 Model A+";
+
+       chosen {
+               /* 8250 auxiliary UART instead of pl011 */
+               stdout-path = "serial1:115200n8";
+       };
+
+       memory@0 {
+               reg = <0 0x20000000>;
+       };
+
+       leds {
+               act {
+                       gpios = <&gpio 29 GPIO_ACTIVE_HIGH>;
+               };
+
+               pwr {
+                       label = "PWR";
+                       gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
+               };
+       };
+};
+
+&firmware {
+       expgpio: gpio {
+               compatible = "raspberrypi,firmware-gpio";
+               gpio-controller;
+               #gpio-cells = <2>;
+               gpio-line-names = "",
+                                 "BT_WL_ON",
+                                 "STATUS_LED_R",
+                                 "",
+                                 "",
+                                 "CAM_GPIO0",
+                                 "CAM_GPIO1",
+                                 "";
+               status = "okay";
+       };
+};
+
+&gpio {
+       /*
+        * This is mostly based on the official GPU firmware DT blob.
+        *
+        * Legend:
+        * "NC" = not connected (no rail from the SoC)
+        * "FOO" = GPIO line named "FOO" on the schematic
+        * "FOO_N" = GPIO line named "FOO" on schematic, active low
+        */
+       gpio-line-names = "ID_SDA",
+                         "ID_SCL",
+                         "SDA1",
+                         "SCL1",
+                         "GPIO_GCLK",
+                         "GPIO5",
+                         "GPIO6",
+                         "SPI_CE1_N",
+                         "SPI_CE0_N",
+                         "SPI_MISO",
+                         "SPI_MOSI",
+                         "SPI_SCLK",
+                         "GPIO12",
+                         "GPIO13",
+                         /* Serial port */
+                         "TXD1",
+                         "RXD1",
+                         "GPIO16",
+                         "GPIO17",
+                         "GPIO18",
+                         "GPIO19",
+                         "GPIO20",
+                         "GPIO21",
+                         "GPIO22",
+                         "GPIO23",
+                         "GPIO24",
+                         "GPIO25",
+                         "GPIO26",
+                         "GPIO27",
+                         "HDMI_HPD_N",
+                         "STATUS_LED_G",
+                         /* Used by BT module */
+                         "CTS0",
+                         "RTS0",
+                         "TXD0",
+                         "RXD0",
+                         /* Used by Wifi */
+                         "SD1_CLK",
+                         "SD1_CMD",
+                         "SD1_DATA0",
+                         "SD1_DATA1",
+                         "SD1_DATA2",
+                         "SD1_DATA3",
+                         "PWM0_OUT",
+                         "PWM1_OUT",
+                         "", /* GPIO42 */
+                         "WIFI_CLK",
+                         "SDA0",
+                         "SCL0",
+                         "SMPS_SCL",
+                         "SMPS_SDA",
+                         /* Used by SD Card */
+                         "SD_CLK_R",
+                         "SD_CMD_R",
+                         "SD_DATA0_R",
+                         "SD_DATA1_R",
+                         "SD_DATA2_R",
+                         "SD_DATA3_R";
+};
+
+&hdmi {
+       hpd-gpios = <&gpio 28 GPIO_ACTIVE_LOW>;
+};
+
+&pwm {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio41>;
+       status = "okay";
+};
+
+/*
+ * SDHCI is used to control the SDIO for wireless
+ *
+ * WL_REG_ON and BT_REG_ON of the CYW43455 Wifi/BT module are driven
+ * by a single GPIO. We can't give GPIO control to one of the drivers,
+ * otherwise the other part would get unexpectedly disturbed.
+ */
+&sdhci {
+       #address-cells = <1>;
+       #size-cells = <0>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&emmc_gpio34>;
+       status = "okay";
+       bus-width = <4>;
+       non-removable;
+
+       brcmf: wifi@1 {
+               reg = <1>;
+               compatible = "brcm,bcm4329-fmac";
+       };
+};
+
+/* SDHOST is used to drive the SD card */
+&sdhost {
+       pinctrl-names = "default";
+       pinctrl-0 = <&sdhost_gpio48>;
+       status = "okay";
+       bus-width = <4>;
+};
+
+/* uart0 communicates with the BT module */
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_gpio32 &gpclk2_gpio43>;
+       status = "okay";
+
+       bluetooth {
+               compatible = "brcm,bcm43438-bt";
+               max-speed = <2000000>;
+       };
+};
+
+/* uart1 is mapped to the pin header */
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart1_gpio14>;
+       status = "okay";
+};
diff --git a/arch/arm/dts/bcm2837-rpi-3-b-plus.dts b/arch/arm/dts/bcm2837-rpi-3-b-plus.dts
new file mode 100644 (file)
index 0000000..c6fa34c
--- /dev/null
@@ -0,0 +1,178 @@
+// SPDX-License-Identifier: GPL-2.0
+/dts-v1/;
+#include "bcm2837.dtsi"
+#include "bcm2836-rpi.dtsi"
+#include "bcm283x-rpi-lan7515.dtsi"
+#include "bcm283x-rpi-usb-host.dtsi"
+
+/ {
+       compatible = "raspberrypi,3-model-b-plus", "brcm,bcm2837";
+       model = "Raspberry Pi 3 Model B+";
+
+       chosen {
+               /* 8250 auxiliary UART instead of pl011 */
+               stdout-path = "serial1:115200n8";
+       };
+
+       memory@0 {
+               reg = <0 0x40000000>;
+       };
+
+       leds {
+               act {
+                       gpios = <&gpio 29 GPIO_ACTIVE_HIGH>;
+               };
+
+               pwr {
+                       label = "PWR";
+                       gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       wifi_pwrseq: wifi-pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>;
+       };
+};
+
+&firmware {
+       expgpio: gpio {
+               compatible = "raspberrypi,firmware-gpio";
+               gpio-controller;
+               #gpio-cells = <2>;
+               gpio-line-names = "BT_ON",
+                                 "WL_ON",
+                                 "STATUS_LED_R",
+                                 "LAN_RUN",
+                                 "",
+                                 "CAM_GPIO0",
+                                 "CAM_GPIO1",
+                                 "";
+               status = "okay";
+       };
+};
+
+&gpio {
+       /*
+        * Taken from rpi_SCH_3bplus_1p0_reduced.pdf and
+        * the official GPU firmware DT blob.
+        *
+        * Legend:
+        * "NC" = not connected (no rail from the SoC)
+        * "FOO" = GPIO line named "FOO" on the schematic
+        * "FOO_N" = GPIO line named "FOO" on schematic, active low
+        */
+       gpio-line-names = "ID_SDA",
+                         "ID_SCL",
+                         "SDA1",
+                         "SCL1",
+                         "GPIO_GCLK",
+                         "GPIO5",
+                         "GPIO6",
+                         "SPI_CE1_N",
+                         "SPI_CE0_N",
+                         "SPI_MISO",
+                         "SPI_MOSI",
+                         "SPI_SCLK",
+                         "GPIO12",
+                         "GPIO13",
+                         /* Serial port */
+                         "TXD1",
+                         "RXD1",
+                         "GPIO16",
+                         "GPIO17",
+                         "GPIO18",
+                         "GPIO19",
+                         "GPIO20",
+                         "GPIO21",
+                         "GPIO22",
+                         "GPIO23",
+                         "GPIO24",
+                         "GPIO25",
+                         "GPIO26",
+                         "GPIO27",
+                         "HDMI_HPD_N",
+                         "STATUS_LED_G",
+                         /* Used by BT module */
+                         "CTS0",
+                         "RTS0",
+                         "TXD0",
+                         "RXD0",
+                         /* Used by Wifi */
+                         "SD1_CLK",
+                         "SD1_CMD",
+                         "SD1_DATA0",
+                         "SD1_DATA1",
+                         "SD1_DATA2",
+                         "SD1_DATA3",
+                         "PWM0_OUT",
+                         "PWM1_OUT",
+                         "ETHCLK",
+                         "WIFI_CLK",
+                         "SDA0",
+                         "SCL0",
+                         "SMPS_SCL",
+                         "SMPS_SDA",
+                         /* Used by SD Card */
+                         "SD_CLK_R",
+                         "SD_CMD_R",
+                         "SD_DATA0_R",
+                         "SD_DATA1_R",
+                         "SD_DATA2_R",
+                         "SD_DATA3_R";
+};
+
+&hdmi {
+       hpd-gpios = <&gpio 28 GPIO_ACTIVE_LOW>;
+};
+
+&pwm {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio41>;
+       status = "okay";
+};
+
+/* SDHCI is used to control the SDIO for wireless */
+&sdhci {
+       #address-cells = <1>;
+       #size-cells = <0>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&emmc_gpio34>;
+       status = "okay";
+       bus-width = <4>;
+       non-removable;
+       mmc-pwrseq = <&wifi_pwrseq>;
+
+       brcmf: wifi@1 {
+               reg = <1>;
+               compatible = "brcm,bcm4329-fmac";
+       };
+};
+
+/* SDHOST is used to drive the SD card */
+&sdhost {
+       pinctrl-names = "default";
+       pinctrl-0 = <&sdhost_gpio48>;
+       status = "okay";
+       bus-width = <4>;
+};
+
+/* uart0 communicates with the BT module */
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_gpio32 &gpclk2_gpio43>;
+       status = "okay";
+
+       bluetooth {
+               compatible = "brcm,bcm43438-bt";
+               max-speed = <2000000>;
+               shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>;
+       };
+};
+
+/* uart1 is mapped to the pin header */
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart1_gpio14>;
+       status = "okay";
+};
index 20725ca..ce71f57 100644 (file)
@@ -1,6 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
 /dts-v1/;
 #include "bcm2837.dtsi"
-#include "bcm2835-rpi.dtsi"
+#include "bcm2836-rpi.dtsi"
 #include "bcm283x-rpi-smsc9514.dtsi"
 #include "bcm283x-rpi-usb-host.dtsi"
 
        compatible = "raspberrypi,3-model-b", "brcm,bcm2837";
        model = "Raspberry Pi 3 Model B";
 
-       memory {
+       chosen {
+               /* 8250 auxiliary UART instead of pl011 */
+               stdout-path = "serial1:115200n8";
+       };
+
+       memory@0 {
                reg = <0 0x40000000>;
        };
 
        leds {
                act {
-                       gpios = <&gpio 47 0>;
+                       gpios = <&expgpio 2 GPIO_ACTIVE_HIGH>;
                };
        };
+
+       wifi_pwrseq: wifi-pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>;
+       };
+};
+
+&firmware {
+       expgpio: gpio {
+               compatible = "raspberrypi,firmware-gpio";
+               gpio-controller;
+               #gpio-cells = <2>;
+               gpio-line-names = "BT_ON",
+                                 "WL_ON",
+                                 "STATUS_LED",
+                                 "LAN_RUN",
+                                 "HDMI_HPD_N",
+                                 "CAM_GPIO0",
+                                 "CAM_GPIO1",
+                                 "PWR_LOW_N";
+               status = "okay";
+       };
+};
+
+&gpio {
+       /*
+        * Taken from rpi_SCH_3b_1p2_reduced.pdf and
+        * the official GPU firmware DT blob.
+        *
+        * Legend:
+        * "NC" = not connected (no rail from the SoC)
+        * "FOO" = GPIO line named "FOO" on the schematic
+        * "FOO_N" = GPIO line named "FOO" on schematic, active low
+        */
+       gpio-line-names = "ID_SDA",
+                         "ID_SCL",
+                         "SDA1",
+                         "SCL1",
+                         "GPIO_GCLK",
+                         "GPIO5",
+                         "GPIO6",
+                         "SPI_CE1_N",
+                         "SPI_CE0_N",
+                         "SPI_MISO",
+                         "SPI_MOSI",
+                         "SPI_SCLK",
+                         "GPIO12",
+                         "GPIO13",
+                         /* Serial port */
+                         "TXD1",
+                         "RXD1",
+                         "GPIO16",
+                         "GPIO17",
+                         "GPIO18",
+                         "GPIO19",
+                         "GPIO20",
+                         "GPIO21",
+                         "GPIO22",
+                         "GPIO23",
+                         "GPIO24",
+                         "GPIO25",
+                         "GPIO26",
+                         "GPIO27",
+                         "", /* GPIO 28 */
+                         "LAN_RUN_BOOT",
+                         /* Used by BT module */
+                         "CTS0",
+                         "RTS0",
+                         "TXD0",
+                         "RXD0",
+                         /* Used by Wifi */
+                         "SD1_CLK",
+                         "SD1_CMD",
+                         "SD1_DATA0",
+                         "SD1_DATA1",
+                         "SD1_DATA2",
+                         "SD1_DATA3",
+                         "PWM0_OUT",
+                         "PWM1_OUT",
+                         "ETHCLK",
+                         "WIFI_CLK",
+                         "SDA0",
+                         "SCL0",
+                         "SMPS_SCL",
+                         "SMPS_SDA",
+                         /* Used by SD Card */
+                         "SD_CLK_R",
+                         "SD_CMD_R",
+                         "SD_DATA0_R",
+                         "SD_DATA1_R",
+                         "SD_DATA2_R",
+                         "SD_DATA3_R";
+};
+
+&pwm {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio41>;
+       status = "okay";
+};
+
+&hdmi {
+       hpd-gpios = <&expgpio 4 GPIO_ACTIVE_LOW>;
 };
 
 /* uart0 communicates with the BT module */
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_gpio32 &gpclk2_gpio43>;
        status = "okay";
+
+       bluetooth {
+               compatible = "brcm,bcm43438-bt";
+               max-speed = <2000000>;
+               shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>;
+       };
 };
 
 /* uart1 is mapped to the pin header */
 
 /* SDHCI is used to control the SDIO for wireless */
 &sdhci {
+       #address-cells = <1>;
+       #size-cells = <0>;
        pinctrl-names = "default";
        pinctrl-0 = <&emmc_gpio34>;
        status = "okay";
        bus-width = <4>;
        non-removable;
+       mmc-pwrseq = <&wifi_pwrseq>;
+
+       brcmf: wifi@1 {
+               reg = <1>;
+               compatible = "brcm,bcm4329-fmac";
+       };
 };
 
 /* SDHOST is used to drive the SD card */
diff --git a/arch/arm/dts/bcm2837-rpi-cm3-io3.dts b/arch/arm/dts/bcm2837-rpi-cm3-io3.dts
new file mode 100644 (file)
index 0000000..6c8233a
--- /dev/null
@@ -0,0 +1,87 @@
+// SPDX-License-Identifier: GPL-2.0
+/dts-v1/;
+#include "bcm2837-rpi-cm3.dtsi"
+#include "bcm283x-rpi-usb-host.dtsi"
+
+/ {
+       compatible = "raspberrypi,3-compute-module", "brcm,bcm2837";
+       model = "Raspberry Pi Compute Module 3 IO board V3.0";
+};
+
+&gpio {
+       /*
+        * This is based on the official GPU firmware DT blob.
+        *
+        * Legend:
+        * "NC" = not connected (no rail from the SoC)
+        * "FOO" = GPIO line named "FOO" on the schematic
+        * "FOO_N" = GPIO line named "FOO" on schematic, active low
+        */
+       gpio-line-names = "GPIO0",
+                         "GPIO1",
+                         "GPIO2",
+                         "GPIO3",
+                         "GPIO4",
+                         "GPIO5",
+                         "GPIO6",
+                         "GPIO7",
+                         "GPIO8",
+                         "GPIO9",
+                         "GPIO10",
+                         "GPIO11",
+                         "GPIO12",
+                         "GPIO13",
+                         "GPIO14",
+                         "GPIO15",
+                         "GPIO16",
+                         "GPIO17",
+                         "GPIO18",
+                         "GPIO19",
+                         "GPIO20",
+                         "GPIO21",
+                         "GPIO22",
+                         "GPIO23",
+                         "GPIO24",
+                         "GPIO25",
+                         "GPIO26",
+                         "GPIO27",
+                         "GPIO28",
+                         "GPIO29",
+                         "GPIO30",
+                         "GPIO31",
+                         "GPIO32",
+                         "GPIO33",
+                         "GPIO34",
+                         "GPIO35",
+                         "GPIO36",
+                         "GPIO37",
+                         "GPIO38",
+                         "GPIO39",
+                         "GPIO40",
+                         "GPIO41",
+                         "GPIO42",
+                         "GPIO43",
+                         "GPIO44",
+                         "GPIO45",
+                         "GPIO46",
+                         "GPIO47",
+                         /* Used by eMMC */
+                         "SD_CLK_R",
+                         "SD_CMD_R",
+                         "SD_DATA0_R",
+                         "SD_DATA1_R",
+                         "SD_DATA2_R",
+                         "SD_DATA3_R";
+
+       pinctrl-0 = <&gpioout &alt0>;
+};
+
+&hdmi {
+       hpd-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>;
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_gpio14>;
+       status = "okay";
+};
diff --git a/arch/arm/dts/bcm2837-rpi-cm3.dtsi b/arch/arm/dts/bcm2837-rpi-cm3.dtsi
new file mode 100644 (file)
index 0000000..81399b2
--- /dev/null
@@ -0,0 +1,52 @@
+// SPDX-License-Identifier: GPL-2.0
+/dts-v1/;
+#include "bcm2837.dtsi"
+#include "bcm2836-rpi.dtsi"
+
+/ {
+       memory@0 {
+               reg = <0 0x40000000>;
+       };
+
+       reg_3v3: fixed-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "3V3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               regulator-always-on;
+       };
+
+       reg_1v8: fixed-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "1V8";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               regulator-always-on;
+       };
+};
+
+&firmware {
+       expgpio: gpio {
+               compatible = "raspberrypi,firmware-gpio";
+               gpio-controller;
+               #gpio-cells = <2>;
+               gpio-line-names = "HDMI_HPD_N",
+                                 "EMMC_EN_N",
+                                 "NC",
+                                 "NC",
+                                 "NC",
+                                 "NC",
+                                 "NC",
+                                 "NC";
+               status = "okay";
+       };
+};
+
+&sdhost {
+       pinctrl-names = "default";
+       pinctrl-0 = <&sdhost_gpio48>;
+       bus-width = <4>;
+       vmmc-supply = <&reg_3v3>;
+       vqmmc-supply = <&reg_1v8>;
+       status = "okay";
+};
index bc1cca5..beb6c50 100644 (file)
@@ -8,22 +8,28 @@
                         <0x40000000 0x40000000 0x00001000>;
                dma-ranges = <0xc0000000 0x00000000 0x3f000000>;
 
-               local_intc: local_intc {
+               local_intc: local_intc@40000000 {
                        compatible = "brcm,bcm2836-l1-intc";
                        reg = <0x40000000 0x100>;
                        interrupt-controller;
-                       #interrupt-cells = <1>;
+                       #interrupt-cells = <2>;
                        interrupt-parent = <&local_intc>;
                };
        };
 
+       arm-pmu {
+               compatible = "arm,cortex-a53-pmu";
+               interrupt-parent = <&local_intc>;
+               interrupts = <9 IRQ_TYPE_LEVEL_HIGH>;
+       };
+
        timer {
                compatible = "arm,armv7-timer";
                interrupt-parent = <&local_intc>;
-               interrupts = <0>, // PHYS_SECURE_PPI
-                            <1>, // PHYS_NONSECURE_PPI
-                            <3>, // VIRT_PPI
-                            <2>; // HYP_PPI
+               interrupts = <0 IRQ_TYPE_LEVEL_HIGH>, // PHYS_SECURE_PPI
+                            <1 IRQ_TYPE_LEVEL_HIGH>, // PHYS_NONSECURE_PPI
+                            <3 IRQ_TYPE_LEVEL_HIGH>, // VIRT_PPI
+                            <2 IRQ_TYPE_LEVEL_HIGH>; // HYP_PPI
                always-on;
        };
 
@@ -73,7 +79,7 @@
        compatible = "brcm,bcm2836-armctrl-ic";
        reg = <0x7e00b200 0x200>;
        interrupt-parent = <&local_intc>;
-       interrupts = <8>;
+       interrupts = <8 IRQ_TYPE_LEVEL_HIGH>;
 };
 
 &cpu_thermal {
diff --git a/arch/arm/dts/bcm283x-rpi-lan7515.dtsi b/arch/arm/dts/bcm283x-rpi-lan7515.dtsi
new file mode 100644 (file)
index 0000000..70bece6
--- /dev/null
@@ -0,0 +1,41 @@
+// SPDX-License-Identifier: GPL-2.0
+#include <dt-bindings/net/microchip-lan78xx.h>
+
+/ {
+       aliases {
+               ethernet0 = &ethernet;
+       };
+};
+
+&usb {
+       usb-port@1 {
+               compatible = "usb424,2514";
+               reg = <1>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               usb-port@1 {
+                       compatible = "usb424,2514";
+                       reg = <1>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       ethernet: ethernet@1 {
+                               compatible = "usb424,7800";
+                               reg = <1>;
+
+                               mdio {
+                                       #address-cells = <0x1>;
+                                       #size-cells = <0x0>;
+                                       eth_phy: ethernet-phy@1 {
+                                               reg = <1>;
+                                               microchip,led-modes = <
+                                                       LAN78XX_LINK_1000_ACTIVITY
+                                                       LAN78XX_LINK_10_100_ACTIVITY
+                                               >;
+                                       };
+                               };
+                       };
+               };
+       };
+};
index 9a0599f..967e081 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 / {
        aliases {
                ethernet0 = &ethernet;
diff --git a/arch/arm/dts/bcm283x-rpi-usb-otg.dtsi b/arch/arm/dts/bcm283x-rpi-usb-otg.dtsi
new file mode 100644 (file)
index 0000000..e2fd961
--- /dev/null
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0
+&usb {
+       dr_mode = "otg";
+       g-rx-fifo-size = <256>;
+       g-np-tx-fifo-size = <32>;
+       /*
+        * According to dwc2 the sum of all device EP
+        * fifo sizes shouldn't exceed 3776 bytes.
+        */
+       g-tx-fifo-size = <256 256 512 512 512 768 768>;
+};
index e45ba58..9777644 100644 (file)
@@ -2,6 +2,8 @@
 #include <dt-bindings/clock/bcm2835.h>
 #include <dt-bindings/clock/bcm2835-aux.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/soc/bcm2835-pm.h>
 
 /* firmware-provided startup stubs live here, where the secondary CPUs are
  * spinning.
        #address-cells = <1>;
        #size-cells = <1>;
 
+       aliases {
+               serial0 = &uart0;
+               serial1 = &uart1;
+       };
+
        chosen {
-               bootargs = "earlyprintk console=ttyAMA0";
+               stdout-path = "serial0:115200n8";
        };
 
        thermal-zones {
@@ -44,7 +51,7 @@
                };
        };
 
-       soc: soc {
+       soc {
                compatible = "simple-bus";
                #address-cells = <1>;
                #size-cells = <1>;
                        clock-frequency = <1000000>;
                };
 
+               txp@7e004000 {
+                       compatible = "brcm,bcm2835-txp";
+                       reg = <0x7e004000 0x20>;
+                       interrupts = <1 11>;
+               };
+
                dma: dma@7e007000 {
                        compatible = "brcm,bcm2835-dma";
                        reg = <0x7e007000 0xf00>;
                        #interrupt-cells = <2>;
                };
 
-               watchdog@7e100000 {
-                       compatible = "brcm,bcm2835-pm-wdt";
-                       reg = <0x7e100000 0x28>;
+               pm: watchdog@7e100000 {
+                       compatible = "brcm,bcm2835-pm", "brcm,bcm2835-pm-wdt";
+                       #power-domain-cells = <1>;
+                       #reset-cells = <1>;
+                       reg = <0x7e100000 0x114>,
+                             <0x7e00a000 0x24>;
+                       clocks = <&clocks BCM2835_CLOCK_V3D>,
+                                <&clocks BCM2835_CLOCK_PERI_IMAGE>,
+                                <&clocks BCM2835_CLOCK_H264>,
+                                <&clocks BCM2835_CLOCK_ISP>;
+                       clock-names = "v3d", "peri_image", "h264", "isp";
+                       system-power-controller;
                };
 
                clocks: cprman@7e101000 {
                rng@7e104000 {
                        compatible = "brcm,bcm2835-rng";
                        reg = <0x7e104000 0x10>;
+                       interrupts = <2 29>;
                };
 
                mailbox: mailbox@7e00b880 {
                        gpclk2_gpio43: gpclk2_gpio43 {
                                brcm,pins = <43>;
                                brcm,function = <BCM2835_FSEL_ALT0>;
+                               brcm,pull = <BCM2835_PUD_OFF>;
                        };
 
                        i2c0_gpio0: i2c0_gpio0 {
                        uart0_ctsrts_gpio30: uart0_ctsrts_gpio30 {
                                brcm,pins = <30 31>;
                                brcm,function = <BCM2835_FSEL_ALT3>;
+                               brcm,pull = <BCM2835_PUD_UP BCM2835_PUD_OFF>;
                        };
                        uart0_gpio32: uart0_gpio32 {
                                brcm,pins = <32 33>;
                                brcm,function = <BCM2835_FSEL_ALT3>;
+                               brcm,pull = <BCM2835_PUD_OFF BCM2835_PUD_UP>;
                        };
                        uart0_gpio36: uart0_gpio36 {
                                brcm,pins = <36 37>;
 
                i2s: i2s@7e203000 {
                        compatible = "brcm,bcm2835-i2s";
-                       reg = <0x7e203000 0x20>,
-                             <0x7e101098 0x02>;
+                       reg = <0x7e203000 0x24>;
+                       clocks = <&clocks BCM2835_CLOCK_PCM>;
 
                        dmas = <&dma 2>,
                               <&dma 3>;
                        interrupts = <2 14>; /* pwa1 */
                };
 
+               dpi: dpi@7e208000 {
+                       compatible = "brcm,bcm2835-dpi";
+                       reg = <0x7e208000 0x8c>;
+                       clocks = <&clocks BCM2835_CLOCK_VPU>,
+                                <&clocks BCM2835_CLOCK_DPI>;
+                       clock-names = "core", "pixel";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+               };
+
                dsi0: dsi@7e209000 {
                        compatible = "brcm,bcm2835-dsi0";
                        reg = <0x7e209000 0x78>;
                        status = "disabled";
                };
 
-               aux: aux@0x7e215000 {
+               aux: aux@7e215000 {
                        compatible = "brcm,bcm2835-aux";
                        #clock-cells = <1>;
                        reg = <0x7e215000 0x8>;
                        compatible = "brcm,bcm2835-v3d";
                        reg = <0x7ec00000 0x1000>;
                        interrupts = <1 10>;
+                       power-domains = <&pm BCM2835_POWER_DOMAIN_GRAFX_V3D>;
                };
 
                vc4: gpu {
 
        usbphy: phy {
                compatible = "usb-nop-xceiv";
+               #phy-cells = <0>;
        };
 };
-
-#include "bcm283x-uboot.dtsi"
diff --git a/arch/arm/dts/imx53-m53.dtsi b/arch/arm/dts/imx53-m53.dtsi
new file mode 100644 (file)
index 0000000..fe5e0d3
--- /dev/null
@@ -0,0 +1,132 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (C) 2014 Marek Vasut <marex@denx.de>
+ */
+
+#include "imx53.dtsi"
+
+/ {
+       model = "Aries/DENX M53";
+       compatible = "aries,imx53-m53", "denx,imx53-m53", "fsl,imx53";
+
+       memory@70000000 {
+               device_type = "memory";
+               reg = <0x70000000 0x20000000>,
+                     <0xb0000000 0x20000000>;
+       };
+
+       regulators {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               reg_3p2v: regulator@0 {
+                       compatible = "regulator-fixed";
+                       reg = <0>;
+                       regulator-name = "3P2V";
+                       regulator-min-microvolt = <3200000>;
+                       regulator-max-microvolt = <3200000>;
+                       regulator-always-on;
+               };
+
+               reg_backlight: regulator@1 {
+                       compatible = "regulator-fixed";
+                       reg = <1>;
+                       regulator-name = "lcd-supply";
+                       regulator-min-microvolt = <3200000>;
+                       regulator-max-microvolt = <3200000>;
+                       regulator-always-on;
+               };
+       };
+};
+
+&i2c2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c2>;
+       clock-frequency = <400000>;
+       status = "okay";
+
+       touchscreen@41 {
+               compatible = "st,stmpe610";
+               reg = <0x41>;
+               id = <0>;
+               blocks = <0x5>;
+               interrupts = <6 0x0>;
+               interrupt-parent = <&gpio7>;
+               irq-trigger = <0x1>;
+
+               stmpe_touchscreen {
+                       compatible = "st,stmpe-ts";
+                       st,sample-time = <4>;
+                       st,mod-12b = <1>;
+                       st,ref-sel = <0>;
+                       st,adc-freq = <1>;
+                       st,ave-ctrl = <3>;
+                       st,touch-det-delay = <3>;
+                       st,settling = <4>;
+                       st,fraction-z = <7>;
+                       st,i-drive = <1>;
+               };
+       };
+
+       eeprom: eeprom@50 {
+               compatible = "atmel,24c128";
+               reg = <0x50>;
+               pagesize = <32>;
+       };
+
+       rtc: rtc@68 {
+               compatible = "st,m41t62";
+               reg = <0x68>;
+       };
+};
+
+&iomuxc {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_hog>;
+
+       imx53-m53evk {
+               pinctrl_hog: hoggrp {
+                       fsl,pins = <
+                               MX53_PAD_GPIO_0__CCM_SSI_EXT1_CLK       0x80000000
+                               MX53_PAD_EIM_EB3__GPIO2_31              0x80000000
+                               MX53_PAD_PATA_DA_0__GPIO7_6             0x80000000
+                       >;
+               };
+
+               pinctrl_i2c2: i2c2grp {
+                       fsl,pins = <
+                               MX53_PAD_EIM_D16__I2C2_SDA              0xc0000000
+                               MX53_PAD_EIM_EB2__I2C2_SCL              0xc0000000
+                       >;
+               };
+
+               pinctrl_nand: nandgrp {
+                       fsl,pins = <
+                               MX53_PAD_NANDF_WE_B__EMI_NANDF_WE_B     0x4
+                               MX53_PAD_NANDF_RE_B__EMI_NANDF_RE_B     0x4
+                               MX53_PAD_NANDF_CLE__EMI_NANDF_CLE       0x4
+                               MX53_PAD_NANDF_ALE__EMI_NANDF_ALE       0x4
+                               MX53_PAD_NANDF_WP_B__EMI_NANDF_WP_B     0xe0
+                               MX53_PAD_NANDF_RB0__EMI_NANDF_RB_0      0xe0
+                               MX53_PAD_NANDF_CS0__EMI_NANDF_CS_0      0x4
+                               MX53_PAD_PATA_DATA0__EMI_NANDF_D_0      0xa4
+                               MX53_PAD_PATA_DATA1__EMI_NANDF_D_1      0xa4
+                               MX53_PAD_PATA_DATA2__EMI_NANDF_D_2      0xa4
+                               MX53_PAD_PATA_DATA3__EMI_NANDF_D_3      0xa4
+                               MX53_PAD_PATA_DATA4__EMI_NANDF_D_4      0xa4
+                               MX53_PAD_PATA_DATA5__EMI_NANDF_D_5      0xa4
+                               MX53_PAD_PATA_DATA6__EMI_NANDF_D_6      0xa4
+                               MX53_PAD_PATA_DATA7__EMI_NANDF_D_7      0xa4
+                       >;
+               };
+       };
+};
+
+&nfc {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_nand>;
+       nand-bus-width = <8>;
+       nand-ecc-mode = "hw";
+       status = "okay";
+};
diff --git a/arch/arm/dts/imx53-m53menlo-u-boot.dtsi b/arch/arm/dts/imx53-m53menlo-u-boot.dtsi
new file mode 100644 (file)
index 0000000..329fa3b
--- /dev/null
@@ -0,0 +1,42 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2019 Marek Vasut <marex@denx.de>
+ */
+
+/ {
+       soc {
+               u-boot,dm-pre-reloc;
+
+               aips@50000000 {
+                       u-boot,dm-pre-reloc;
+               };
+       };
+};
+
+&gpio1 {
+       u-boot,dm-pre-reloc;
+};
+
+&gpio2 {
+       u-boot,dm-pre-reloc;
+};
+
+&gpio3 {
+       u-boot,dm-pre-reloc;
+};
+
+&gpio4 {
+       u-boot,dm-pre-reloc;
+};
+
+&gpio5 {
+       u-boot,dm-pre-reloc;
+};
+
+&gpio6 {
+       u-boot,dm-pre-reloc;
+};
+
+&gpio7 {
+       u-boot,dm-pre-reloc;
+};
diff --git a/arch/arm/dts/imx53-m53menlo.dts b/arch/arm/dts/imx53-m53menlo.dts
new file mode 100644 (file)
index 0000000..a6805ec
--- /dev/null
@@ -0,0 +1,312 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2019 Marek Vasut <marex@denx.de>
+ */
+
+/dts-v1/;
+#include "imx53-m53.dtsi"
+#include "imx53-m53menlo-u-boot.dtsi"
+
+/ {
+       model = "MENLO M53 EMBEDDED DEVICE";
+       compatible = "menlo,m53menlo", "fsl,imx53";
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_led>;
+
+               user1 {
+                       label = "TestLed601";
+                       gpios = <&gpio6 1 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "mmc0";
+               };
+
+               user2 {
+                       label = "TestLed602";
+                       gpios = <&gpio6 2 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "heartbeat";
+               };
+
+               eth {
+                       label = "EthLedYe";
+                       gpios = <&gpio2 11 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "none";
+               };
+       };
+
+       panel {
+               compatible = "edt,etm070080dh6";
+               enable-gpios = <&gpio6 0 GPIO_ACTIVE_HIGH>;
+
+               port {
+                       panel_in: endpoint {
+                               remote-endpoint = <&lvds0_out>;
+                       };
+               };
+       };
+
+       reg_usbh1_vbus: regulator-usbh1-vbus {
+               compatible = "regulator-fixed";
+               regulator-name = "vbus";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               gpio = <&gpio1 2 GPIO_ACTIVE_LOW>;
+       };
+};
+
+&can1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_can1>;
+       status = "okay";
+};
+
+&can2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_can2>;
+       status = "okay";
+};
+
+&clks {
+       assigned-clocks = <&clks IMX5_CLK_CKO1_SEL>,
+                         <&clks IMX5_CLK_CKO1_PODF>,
+                         <&clks IMX5_CLK_CKO1>;
+       assigned-clock-parents = <&clks IMX5_CLK_AHB>;
+       assigned-clock-rates = <133333334>, <33333334>, <33333334>;
+};
+
+&esdhc1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_esdhc1>;
+       cd-gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
+       wp-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
+
+&fec {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_fec>;
+       phy-mode = "rmii";
+       status = "okay";
+};
+
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c1>;
+       status = "okay";
+
+       touchscreen@38 {
+               compatible = "edt,edt-ft5x06";
+               reg = <0x38>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_edt_ft5x06>;
+               interrupt-parent = <&gpio6>;
+               interrupts = <5 IRQ_TYPE_EDGE_FALLING>;
+               reset-gpios = <&gpio2 9 GPIO_ACTIVE_LOW>;
+               wake-gpios = <&gpio2 10 GPIO_ACTIVE_HIGH>;
+       };
+
+       eeprom@50 {
+               compatible = "atmel,24c64";
+               reg = <0x50>;
+               pagesize = <32>;
+       };
+
+       dac@60 {
+               compatible = "microchip,mcp4725";
+               reg = <0x60>;
+       };
+};
+
+&i2c2 {
+       touchscreen@41 {
+               status = "disabled";
+       };
+};
+
+&i2c3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c3>;
+       status = "okay";
+};
+
+&iomuxc {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_hog>;
+
+       imx53-m53evk {
+               hoggrp {
+                       fsl,pins = <
+                               MX53_PAD_GPIO_0__CCM_SSI_EXT1_CLK       0x1c4
+                               MX53_PAD_EIM_EB3__GPIO2_31              0x1d5
+                               MX53_PAD_PATA_DA_0__GPIO7_6             0x1d5
+                               MX53_PAD_GPIO_19__CCM_CLKO              0x1d5
+                               MX53_PAD_CSI0_MCLK__CCM_CSI0_MCLK       0x1d5
+                               MX53_PAD_CSI0_DAT4__GPIO5_22            0x1d5
+                               MX53_PAD_CSI0_DAT5__GPIO5_23            0x1d5
+                               MX53_PAD_CSI0_DAT6__GPIO5_24            0x1d5
+                               MX53_PAD_CSI0_DAT7__GPIO5_25            0x1d5
+                               MX53_PAD_CSI0_DAT8__GPIO5_26            0x1d5
+                               MX53_PAD_CSI0_DAT9__GPIO5_27            0x1d5
+                               MX53_PAD_CSI0_DAT10__GPIO5_28           0x1d5
+                               MX53_PAD_CSI0_DAT11__GPIO5_29           0x1d5
+                               MX53_PAD_CSI0_DAT14__GPIO6_0            0x1d5
+                       >;
+               };
+
+               pinctrl_led: ledgrp {
+                       fsl,pins = <
+                               MX53_PAD_CSI0_DAT15__GPIO6_1            0x1d5
+                               MX53_PAD_CSI0_DAT16__GPIO6_2            0x1d5
+                       >;
+               };
+
+               pinctrl_can1: can1grp {
+                       fsl,pins = <
+                               MX53_PAD_GPIO_7__CAN1_TXCAN             0x1c4
+                               MX53_PAD_GPIO_8__CAN1_RXCAN             0x1c4
+                       >;
+               };
+
+               pinctrl_can2: can2grp {
+                       fsl,pins = <
+                               MX53_PAD_KEY_COL4__CAN2_TXCAN           0x1c4
+                               MX53_PAD_KEY_ROW4__CAN2_RXCAN           0x1c4
+                       >;
+               };
+
+               pinctrl_display_gpio: display-gpiogrp {
+                       fsl,pins = <
+                               MX53_PAD_CSI0_DAT12__GPIO5_30           0x1d5 /* Reset */
+                               MX53_PAD_CSI0_DAT13__GPIO5_31           0x1d5 /* Interrupt */
+                       >;
+               };
+
+               pinctrl_edt_ft5x06: edt-ft5x06grp {
+                       fsl,pins = <
+                               MX53_PAD_PATA_DATA9__GPIO2_9            0x1d5 /* Reset */
+                               MX53_PAD_CSI0_DAT19__GPIO6_5            0x1d5 /* Interrupt */
+                               MX53_PAD_PATA_DATA10__GPIO2_10          0x1d5 /* Wake */
+                       >;
+               };
+
+               pinctrl_esdhc1: esdhc1grp {
+                       fsl,pins = <
+                               MX53_PAD_SD1_DATA0__ESDHC1_DAT0         0x1d5
+                               MX53_PAD_SD1_DATA1__ESDHC1_DAT1         0x1d5
+                               MX53_PAD_SD1_DATA2__ESDHC1_DAT2         0x1d5
+                               MX53_PAD_SD1_DATA3__ESDHC1_DAT3         0x1d5
+                               MX53_PAD_SD1_CMD__ESDHC1_CMD            0x1d5
+                               MX53_PAD_SD1_CLK__ESDHC1_CLK            0x1d5
+                       >;
+               };
+
+               pinctrl_fec: fecgrp {
+                       fsl,pins = <
+                               MX53_PAD_FEC_MDC__FEC_MDC               0x4
+                               MX53_PAD_FEC_MDIO__FEC_MDIO             0x1fc
+                               MX53_PAD_FEC_REF_CLK__FEC_TX_CLK        0x180
+                               MX53_PAD_FEC_RX_ER__FEC_RX_ER           0x180
+                               MX53_PAD_FEC_CRS_DV__FEC_RX_DV          0x180
+                               MX53_PAD_FEC_RXD1__FEC_RDATA_1          0x180
+                               MX53_PAD_FEC_RXD0__FEC_RDATA_0          0x180
+                               MX53_PAD_FEC_TX_EN__FEC_TX_EN           0x4
+                               MX53_PAD_FEC_TXD1__FEC_TDATA_1          0x4
+                               MX53_PAD_FEC_TXD0__FEC_TDATA_0          0x4
+                       >;
+               };
+
+               pinctrl_i2c1: i2c1grp {
+                       fsl,pins = <
+                               MX53_PAD_EIM_D21__I2C1_SCL              0x400001e4
+                               MX53_PAD_EIM_D28__I2C1_SDA              0x400001e4
+                       >;
+               };
+
+               pinctrl_i2c3: i2c3grp {
+                       fsl,pins = <
+                               MX53_PAD_GPIO_6__I2C3_SDA               0x400001e4
+                               MX53_PAD_GPIO_5__I2C3_SCL               0x400001e4
+                       >;
+               };
+
+               pinctrl_lvds0: lvds0grp {
+                       /* LVDS pins only have pin mux configuration */
+                       fsl,pins = <
+                               MX53_PAD_LVDS0_CLK_P__LDB_LVDS0_CLK     0x80000000
+                               MX53_PAD_LVDS0_TX0_P__LDB_LVDS0_TX0     0x80000000
+                               MX53_PAD_LVDS0_TX1_P__LDB_LVDS0_TX1     0x80000000
+                               MX53_PAD_LVDS0_TX2_P__LDB_LVDS0_TX2     0x80000000
+                               MX53_PAD_LVDS0_TX3_P__LDB_LVDS0_TX3     0x80000000
+                       >;
+               };
+
+               pinctrl_uart1: uart1grp {
+                       fsl,pins = <
+                               MX53_PAD_PATA_DIOW__UART1_TXD_MUX       0x1e4
+                               MX53_PAD_PATA_DMACK__UART1_RXD_MUX      0x1e4
+                       >;
+               };
+
+               pinctrl_uart2: uart2grp {
+                       fsl,pins = <
+                               MX53_PAD_PATA_BUFFER_EN__UART2_RXD_MUX  0x1e4
+                               MX53_PAD_PATA_DMARQ__UART2_TXD_MUX      0x1e4
+                       >;
+               };
+
+               pinctrl_usb: usbgrp {
+                       fsl,pins = <
+                               MX53_PAD_GPIO_2__GPIO1_2                0x1d5
+                               MX53_PAD_GPIO_3__USBOH3_USBH1_OC        0x1d5
+                       >;
+               };
+       };
+};
+
+&ldb {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_lvds0>;
+       status = "okay";
+
+       lvds0: lvds-channel@0 {
+               reg = <0>;
+               fsl,data-mapping = "spwg";
+               fsl,data-width = <18>;
+               status = "okay";
+
+               port@2 {
+                       reg = <2>;
+
+                       lvds0_out: endpoint {
+                               remote-endpoint = <&panel_in>;
+                       };
+               };
+       };
+};
+
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart1>;
+       status = "okay";
+};
+
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart2>;
+       status = "okay";
+};
+
+&usbh1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usb>;
+       vbus-supply = <&reg_usbh1_vbus>;
+       phy_type = "utmi";
+       dr_mode = "peripheral";
+       status = "okay";
+};
+
+&usbotg {
+       dr_mode = "peripheral";
+       status = "okay";
+};
index 211ff5f..ed341cf 100644 (file)
@@ -1,17 +1,8 @@
-/*
- * Copyright 2016 Beckhoff Automation
- * Copyright 2011 Freescale Semiconductor, Inc.
- * Copyright 2011 Linaro Ltd.
- *
- * The code contained herein is licensed under the GNU General Public
- * License. You may obtain a copy of the GNU General Public License
- * Version 2 or later at the following locations:
- *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
- */
-
-#include "skeleton.dtsi"
+// SPDX-License-Identifier: GPL-2.0+
+//
+// Copyright 2011 Freescale Semiconductor, Inc.
+// Copyright 2011 Linaro Ltd.
+
 #include "imx53-pinfunc.h"
 #include <dt-bindings/clock/imx5-clock.h>
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 
 / {
+       #address-cells = <1>;
+       #size-cells = <1>;
+       /*
+        * The decompressor and also some bootloaders rely on a
+        * pre-existing /chosen node to be available to insert the
+        * command line and merge other ATAGS info.
+        */
+       chosen {};
+
        aliases {
-               serial1 = &uart2;
+               ethernet0 = &fec;
                gpio0 = &gpio1;
                gpio1 = &gpio2;
                gpio2 = &gpio3;
                mmc1 = &esdhc2;
                mmc2 = &esdhc3;
                mmc3 = &esdhc4;
-               usb1 = &usbh1;
+               serial0 = &uart1;
+               serial1 = &uart2;
+               serial2 = &uart3;
+               serial3 = &uart4;
+               serial4 = &uart5;
+               spi0 = &ecspi1;
+               spi1 = &ecspi2;
+               spi2 = &cspi;
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               cpu0: cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a8";
+                       reg = <0x0>;
+                       clocks = <&clks IMX5_CLK_ARM>;
+                       clock-latency = <61036>;
+                       voltage-tolerance = <5>;
+                       operating-points = <
+                               /* kHz */
+                                166666  850000
+                                400000  900000
+                                800000 1050000
+                               1000000 1200000
+                               1200000 1300000
+                       >;
+               };
+       };
+
+       display-subsystem {
+               compatible = "fsl,imx-display-subsystem";
+               ports = <&ipu_di0>, <&ipu_di1>;
+       };
+
+       capture_subsystem {
+               compatible = "fsl,imx-capture-subsystem";
+               ports = <&ipu_csi0>, <&ipu_csi1>;
        };
 
        tzic: tz-interrupt-controller@fffc000 {
                reg = <0x0fffc000 0x4000>;
        };
 
+       clocks {
+               ckil {
+                       compatible = "fsl,imx-ckil", "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <32768>;
+               };
+
+               ckih1 {
+                       compatible = "fsl,imx-ckih1", "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <22579200>;
+               };
+
+               ckih2 {
+                       compatible = "fsl,imx-ckih2", "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <0>;
+               };
+
+               osc {
+                       compatible = "fsl,imx-osc", "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <24000000>;
+               };
+       };
+
+       pmu: pmu {
+               compatible = "arm,cortex-a8-pmu";
+               interrupt-parent = <&tzic>;
+               interrupts = <77>;
+       };
+
+       usbphy0: usbphy-0 {
+               compatible = "usb-nop-xceiv";
+               clocks = <&clks IMX5_CLK_USB_PHY1_GATE>;
+               clock-names = "main_clk";
+               #phy-cells = <0>;
+               status = "okay";
+       };
+
+       usbphy1: usbphy-1 {
+               compatible = "usb-nop-xceiv";
+               clocks = <&clks IMX5_CLK_USB_PHY2_GATE>;
+               clock-names = "main_clk";
+               #phy-cells = <0>;
+               status = "okay";
+       };
+
        soc {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "simple-bus";
                interrupt-parent = <&tzic>;
                ranges;
-               u-boot,dm-pre-reloc;
+
+               sata: sata@10000000 {
+                       compatible = "fsl,imx53-ahci";
+                       reg = <0x10000000 0x1000>;
+                       interrupts = <28>;
+                       clocks = <&clks IMX5_CLK_SATA_GATE>,
+                                <&clks IMX5_CLK_SATA_REF>,
+                                <&clks IMX5_CLK_AHB>;
+                       clock-names = "sata", "sata_ref", "ahb";
+                       status = "disabled";
+               };
+
+               ipu: ipu@18000000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "fsl,imx53-ipu";
+                       reg = <0x18000000 0x08000000>;
+                       interrupts = <11 10>;
+                       clocks = <&clks IMX5_CLK_IPU_GATE>,
+                                <&clks IMX5_CLK_IPU_DI0_GATE>,
+                                <&clks IMX5_CLK_IPU_DI1_GATE>;
+                       clock-names = "bus", "di0", "di1";
+                       resets = <&src 2>;
+
+                       ipu_csi0: port@0 {
+                               reg = <0>;
+
+                               ipu_csi0_from_parallel_sensor: endpoint {
+                               };
+                       };
+
+                       ipu_csi1: port@1 {
+                               reg = <1>;
+
+                               ipu_csi1_from_parallel_sensor: endpoint {
+                               };
+                       };
+
+                       ipu_di0: port@2 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               reg = <2>;
+
+                               ipu_di0_disp0: endpoint@0 {
+                                       reg = <0>;
+                               };
+
+                               ipu_di0_lvds0: endpoint@1 {
+                                       reg = <1>;
+                                       remote-endpoint = <&lvds0_in>;
+                               };
+                       };
+
+                       ipu_di1: port@3 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               reg = <3>;
+
+                               ipu_di1_disp1: endpoint@0 {
+                                       reg = <0>;
+                               };
+
+                               ipu_di1_lvds1: endpoint@1 {
+                                       reg = <1>;
+                                       remote-endpoint = <&lvds1_in>;
+                               };
+
+                               ipu_di1_tve: endpoint@2 {
+                                       reg = <2>;
+                                       remote-endpoint = <&tve_in>;
+                               };
+                       };
+               };
+
+               gpu: gpu@30000000 {
+                       compatible = "amd,imageon-200.0", "amd,imageon";
+                       reg = <0x30000000 0x20000>;
+                       reg-names = "kgsl_3d0_reg_memory";
+                       interrupts = <12>;
+                       interrupt-names = "kgsl_3d0_irq";
+                       clocks = <&clks IMX5_CLK_GPU3D_GATE>, <&clks IMX5_CLK_GARB_GATE>;
+                       clock-names = "core_clk", "mem_iface_clk";
+               };
 
                aips@50000000 { /* AIPS1 */
                        compatible = "fsl,aips-bus", "simple-bus";
                                        status = "disabled";
                                };
 
+                               uart3: serial@5000c000 {
+                                       compatible = "fsl,imx53-uart", "fsl,imx21-uart";
+                                       reg = <0x5000c000 0x4000>;
+                                       interrupts = <33>;
+                                       clocks = <&clks IMX5_CLK_UART3_IPG_GATE>,
+                                                <&clks IMX5_CLK_UART3_PER_GATE>;
+                                       clock-names = "ipg", "per";
+                                       dmas = <&sdma 42 4 0>, <&sdma 43 4 0>;
+                                       dma-names = "rx", "tx";
+                                       status = "disabled";
+                               };
+
+                               ecspi1: spi@50010000 {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       compatible = "fsl,imx53-ecspi", "fsl,imx51-ecspi";
+                                       reg = <0x50010000 0x4000>;
+                                       interrupts = <36>;
+                                       clocks = <&clks IMX5_CLK_ECSPI1_IPG_GATE>,
+                                                <&clks IMX5_CLK_ECSPI1_PER_GATE>;
+                                       clock-names = "ipg", "per";
+                                       status = "disabled";
+                               };
+
+                               ssi2: ssi@50014000 {
+                                       #sound-dai-cells = <0>;
+                                       compatible = "fsl,imx53-ssi",
+                                                       "fsl,imx51-ssi",
+                                                       "fsl,imx21-ssi";
+                                       reg = <0x50014000 0x4000>;
+                                       interrupts = <30>;
+                                       clocks = <&clks IMX5_CLK_SSI2_IPG_GATE>,
+                                                <&clks IMX5_CLK_SSI2_ROOT_GATE>;
+                                       clock-names = "ipg", "baud";
+                                       dmas = <&sdma 24 1 0>,
+                                              <&sdma 25 1 0>;
+                                       dma-names = "rx", "tx";
+                                       fsl,fifo-depth = <15>;
+                                       status = "disabled";
+                               };
+
                                esdhc3: esdhc@50020000 {
                                        compatible = "fsl,imx53-esdhc";
                                        reg = <0x50020000 0x4000>;
                                };
                        };
 
-                       iomuxc: iomuxc@53fa8000 {
-                               compatible = "fsl,imx53-iomuxc";
-                               reg = <0x53fa8000 0x4000>;
-                       };
-
-                       gpr: iomuxc-gpr@53fa8000 {
-                               compatible = "fsl,imx53-iomuxc-gpr", "syscon";
-                               reg = <0x53fa8000 0xc>;
+                       aipstz1: bridge@53f00000 {
+                               compatible = "fsl,imx53-aipstz";
+                               reg = <0x53f00000 0x60>;
                        };
 
-                       uart2: serial@53fc0000 {
-                               compatible = "fsl,imx7d-uart", "fsl,imx53-uart", "fsl,imx21-uart";
-                               reg = <0x53fc0000 0x4000>;
-                               interrupts = <32>;
-                               clocks = <&clks IMX5_CLK_UART2_IPG_GATE>,
-                                        <&clks IMX5_CLK_UART2_PER_GATE>;
-                               clock-names = "ipg", "per";
-                               dmas = <&sdma 12 4 0>, <&sdma 13 4 0>;
-                               dma-names = "rx", "tx";
+                       usbotg: usb@53f80000 {
+                               compatible = "fsl,imx53-usb", "fsl,imx27-usb";
+                               reg = <0x53f80000 0x0200>;
+                               interrupts = <18>;
+                               clocks = <&clks IMX5_CLK_USBOH3_GATE>;
+                               fsl,usbmisc = <&usbmisc 0>;
+                               fsl,usbphy = <&usbphy0>;
                                status = "disabled";
                        };
 
                                reg = <0x53f80200 0x0200>;
                                interrupts = <14>;
                                clocks = <&clks IMX5_CLK_USBOH3_GATE>;
+                               fsl,usbmisc = <&usbmisc 1>;
+                               fsl,usbphy = <&usbphy1>;
                                dr_mode = "host";
                                status = "disabled";
                        };
 
-                       clks: ccm@53fd4000{
-                               compatible = "fsl,imx53-ccm";
-                               reg = <0x53fd4000 0x4000>;
-                               interrupts = <0 71 0x04 0 72 0x04>;
-                               #clock-cells = <1>;
+                       usbh2: usb@53f80400 {
+                               compatible = "fsl,imx53-usb", "fsl,imx27-usb";
+                               reg = <0x53f80400 0x0200>;
+                               interrupts = <16>;
+                               clocks = <&clks IMX5_CLK_USBOH3_GATE>;
+                               fsl,usbmisc = <&usbmisc 2>;
+                               dr_mode = "host";
+                               status = "disabled";
+                       };
+
+                       usbh3: usb@53f80600 {
+                               compatible = "fsl,imx53-usb", "fsl,imx27-usb";
+                               reg = <0x53f80600 0x0200>;
+                               interrupts = <17>;
+                               clocks = <&clks IMX5_CLK_USBOH3_GATE>;
+                               fsl,usbmisc = <&usbmisc 3>;
+                               dr_mode = "host";
+                               status = "disabled";
+                       };
+
+                       usbmisc: usbmisc@53f80800 {
+                               #index-cells = <1>;
+                               compatible = "fsl,imx53-usbmisc";
+                               reg = <0x53f80800 0x200>;
+                               clocks = <&clks IMX5_CLK_USBOH3_GATE>;
                        };
 
                        gpio1: gpio@53f84000 {
                                #interrupt-cells = <2>;
                        };
 
+                       kpp: kpp@53f94000 {
+                               compatible = "fsl,imx53-kpp", "fsl,imx21-kpp";
+                               reg = <0x53f94000 0x4000>;
+                               interrupts = <60>;
+                               clocks = <&clks IMX5_CLK_DUMMY>;
+                               status = "disabled";
+                       };
+
+                       wdog1: wdog@53f98000 {
+                               compatible = "fsl,imx53-wdt", "fsl,imx21-wdt";
+                               reg = <0x53f98000 0x4000>;
+                               interrupts = <58>;
+                               clocks = <&clks IMX5_CLK_DUMMY>;
+                       };
+
+                       wdog2: wdog@53f9c000 {
+                               compatible = "fsl,imx53-wdt", "fsl,imx21-wdt";
+                               reg = <0x53f9c000 0x4000>;
+                               interrupts = <59>;
+                               clocks = <&clks IMX5_CLK_DUMMY>;
+                               status = "disabled";
+                       };
+
+                       gpt: timer@53fa0000 {
+                               compatible = "fsl,imx53-gpt", "fsl,imx31-gpt";
+                               reg = <0x53fa0000 0x4000>;
+                               interrupts = <39>;
+                               clocks = <&clks IMX5_CLK_GPT_IPG_GATE>,
+                                        <&clks IMX5_CLK_GPT_HF_GATE>;
+                               clock-names = "ipg", "per";
+                       };
+
+                       srtc: rtc@53fa4000 {
+                               compatible = "fsl,imx53-rtc";
+                               reg = <0x53fa4000 0x4000>;
+                               interrupts = <24>;
+                               clocks = <&clks IMX5_CLK_SRTC_GATE>;
+                       };
+
+                       iomuxc: iomuxc@53fa8000 {
+                               compatible = "fsl,imx53-iomuxc";
+                               reg = <0x53fa8000 0x4000>;
+                       };
+
+                       gpr: iomuxc-gpr@53fa8000 {
+                               compatible = "fsl,imx53-iomuxc-gpr", "syscon";
+                               reg = <0x53fa8000 0xc>;
+                       };
+
+                       ldb: ldb@53fa8008 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               compatible = "fsl,imx53-ldb";
+                               reg = <0x53fa8008 0x4>;
+                               gpr = <&gpr>;
+                               clocks = <&clks IMX5_CLK_LDB_DI0_SEL>,
+                                        <&clks IMX5_CLK_LDB_DI1_SEL>,
+                                        <&clks IMX5_CLK_IPU_DI0_SEL>,
+                                        <&clks IMX5_CLK_IPU_DI1_SEL>,
+                                        <&clks IMX5_CLK_LDB_DI0_GATE>,
+                                        <&clks IMX5_CLK_LDB_DI1_GATE>;
+                               clock-names = "di0_pll", "di1_pll",
+                                             "di0_sel", "di1_sel",
+                                             "di0", "di1";
+                               status = "disabled";
+
+                               lvds-channel@0 {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       reg = <0>;
+                                       status = "disabled";
+
+                                       port@0 {
+                                               reg = <0>;
+
+                                               lvds0_in: endpoint {
+                                                       remote-endpoint = <&ipu_di0_lvds0>;
+                                               };
+                                       };
+
+                                       port@2 {
+                                               reg = <2>;
+                                       };
+                               };
+
+                               lvds-channel@1 {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       reg = <1>;
+                                       status = "disabled";
+
+                                       port@1 {
+                                               reg = <1>;
+
+                                               lvds1_in: endpoint {
+                                                       remote-endpoint = <&ipu_di1_lvds1>;
+                                               };
+                                       };
+
+                                       port@2 {
+                                               reg = <2>;
+                                       };
+                               };
+                       };
+
+                       pwm1: pwm@53fb4000 {
+                               #pwm-cells = <2>;
+                               compatible = "fsl,imx53-pwm", "fsl,imx27-pwm";
+                               reg = <0x53fb4000 0x4000>;
+                               clocks = <&clks IMX5_CLK_PWM1_IPG_GATE>,
+                                        <&clks IMX5_CLK_PWM1_HF_GATE>;
+                               clock-names = "ipg", "per";
+                               interrupts = <61>;
+                       };
+
+                       pwm2: pwm@53fb8000 {
+                               #pwm-cells = <2>;
+                               compatible = "fsl,imx53-pwm", "fsl,imx27-pwm";
+                               reg = <0x53fb8000 0x4000>;
+                               clocks = <&clks IMX5_CLK_PWM2_IPG_GATE>,
+                                        <&clks IMX5_CLK_PWM2_HF_GATE>;
+                               clock-names = "ipg", "per";
+                               interrupts = <94>;
+                       };
+
+                       uart1: serial@53fbc000 {
+                               compatible = "fsl,imx53-uart", "fsl,imx21-uart";
+                               reg = <0x53fbc000 0x4000>;
+                               interrupts = <31>;
+                               clocks = <&clks IMX5_CLK_UART1_IPG_GATE>,
+                                        <&clks IMX5_CLK_UART1_PER_GATE>;
+                               clock-names = "ipg", "per";
+                               dmas = <&sdma 18 4 0>, <&sdma 19 4 0>;
+                               dma-names = "rx", "tx";
+                               status = "disabled";
+                       };
+
+                       uart2: serial@53fc0000 {
+                               compatible = "fsl,imx53-uart", "fsl,imx21-uart";
+                               reg = <0x53fc0000 0x4000>;
+                               interrupts = <32>;
+                               clocks = <&clks IMX5_CLK_UART2_IPG_GATE>,
+                                        <&clks IMX5_CLK_UART2_PER_GATE>;
+                               clock-names = "ipg", "per";
+                               dmas = <&sdma 12 4 0>, <&sdma 13 4 0>;
+                               dma-names = "rx", "tx";
+                               status = "disabled";
+                       };
+
+                       can1: can@53fc8000 {
+                               compatible = "fsl,imx53-flexcan", "fsl,imx25-flexcan";
+                               reg = <0x53fc8000 0x4000>;
+                               interrupts = <82>;
+                               clocks = <&clks IMX5_CLK_CAN1_IPG_GATE>,
+                                        <&clks IMX5_CLK_CAN1_SERIAL_GATE>;
+                               clock-names = "ipg", "per";
+                               status = "disabled";
+                       };
+
+                       can2: can@53fcc000 {
+                               compatible = "fsl,imx53-flexcan", "fsl,imx25-flexcan";
+                               reg = <0x53fcc000 0x4000>;
+                               interrupts = <83>;
+                               clocks = <&clks IMX5_CLK_CAN2_IPG_GATE>,
+                                        <&clks IMX5_CLK_CAN2_SERIAL_GATE>;
+                               clock-names = "ipg", "per";
+                               status = "disabled";
+                       };
+
+                       src: src@53fd0000 {
+                               compatible = "fsl,imx53-src", "fsl,imx51-src";
+                               reg = <0x53fd0000 0x4000>;
+                               #reset-cells = <1>;
+                       };
+
+                       clks: ccm@53fd4000{
+                               compatible = "fsl,imx53-ccm";
+                               reg = <0x53fd4000 0x4000>;
+                               interrupts = <0 71 0x04 0 72 0x04>;
+                               #clock-cells = <1>;
+                       };
+
                        gpio5: gpio@53fdc000 {
                                compatible = "fsl,imx53-gpio", "fsl,imx35-gpio";
                                reg = <0x53fdc000 0x4000>;
                                clocks = <&clks IMX5_CLK_I2C3_GATE>;
                                status = "disabled";
                        };
+
+                       uart4: serial@53ff0000 {
+                               compatible = "fsl,imx53-uart", "fsl,imx21-uart";
+                               reg = <0x53ff0000 0x4000>;
+                               interrupts = <13>;
+                               clocks = <&clks IMX5_CLK_UART4_IPG_GATE>,
+                                        <&clks IMX5_CLK_UART4_PER_GATE>;
+                               clock-names = "ipg", "per";
+                               dmas = <&sdma 2 4 0>, <&sdma 3 4 0>;
+                               dma-names = "rx", "tx";
+                               status = "disabled";
+                       };
                };
 
                aips@60000000 { /* AIPS2 */
                        reg = <0x60000000 0x10000000>;
                        ranges;
 
+                       aipstz2: bridge@63f00000 {
+                               compatible = "fsl,imx53-aipstz";
+                               reg = <0x63f00000 0x60>;
+                       };
+
+                       iim: iim@63f98000 {
+                               compatible = "fsl,imx53-iim", "fsl,imx27-iim";
+                               reg = <0x63f98000 0x4000>;
+                               interrupts = <69>;
+                               clocks = <&clks IMX5_CLK_IIM_GATE>;
+                       };
+
+                       uart5: serial@63f90000 {
+                               compatible = "fsl,imx53-uart", "fsl,imx21-uart";
+                               reg = <0x63f90000 0x4000>;
+                               interrupts = <86>;
+                               clocks = <&clks IMX5_CLK_UART5_IPG_GATE>,
+                                        <&clks IMX5_CLK_UART5_PER_GATE>;
+                               clock-names = "ipg", "per";
+                               dmas = <&sdma 16 4 0>, <&sdma 17 4 0>;
+                               dma-names = "rx", "tx";
+                               status = "disabled";
+                       };
+
+                       tigerp: tigerp@63fa0000 {
+                               compatible = "fsl,imx53-tigerp", "fsl,imx51-tigerp";
+                               reg = <0x63fa0000 0x28>;
+                       };
+
+                       owire: owire@63fa4000 {
+                               compatible = "fsl,imx53-owire", "fsl,imx21-owire";
+                               reg = <0x63fa4000 0x4000>;
+                               clocks = <&clks IMX5_CLK_OWIRE_GATE>;
+                               status = "disabled";
+                       };
+
+                       ecspi2: spi@63fac000 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               compatible = "fsl,imx53-ecspi", "fsl,imx51-ecspi";
+                               reg = <0x63fac000 0x4000>;
+                               interrupts = <37>;
+                               clocks = <&clks IMX5_CLK_ECSPI2_IPG_GATE>,
+                                        <&clks IMX5_CLK_ECSPI2_PER_GATE>;
+                               clock-names = "ipg", "per";
+                               status = "disabled";
+                       };
+
                        sdma: sdma@63fb0000 {
                                compatible = "fsl,imx53-sdma", "fsl,imx35-sdma";
                                reg = <0x63fb0000 0x4000>;
                                interrupts = <6>;
                                clocks = <&clks IMX5_CLK_SDMA_GATE>,
-                                        <&clks IMX5_CLK_SDMA_GATE>;
+                                        <&clks IMX5_CLK_AHB>;
                                clock-names = "ipg", "ahb";
                                #dma-cells = <3>;
                                fsl,sdma-ram-script-name = "imx/sdma/sdma-imx53.bin";
                        };
 
-                       fec: ethernet@63fec000 {
-                               compatible = "fsl,imx53-fec", "fsl,imx25-fec";
-                               reg = <0x63fec000 0x4000>;
-                               interrupts = <87>;
-                               clocks = <&clks IMX5_CLK_FEC_GATE>,
-                                        <&clks IMX5_CLK_FEC_GATE>,
-                                        <&clks IMX5_CLK_FEC_GATE>;
-                               clock-names = "ipg", "ahb", "ptp";
+                       cspi: spi@63fc0000 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               compatible = "fsl,imx53-cspi", "fsl,imx35-cspi";
+                               reg = <0x63fc0000 0x4000>;
+                               interrupts = <38>;
+                               clocks = <&clks IMX5_CLK_CSPI_IPG_GATE>,
+                                        <&clks IMX5_CLK_CSPI_IPG_GATE>;
+                               clock-names = "ipg", "per";
                                status = "disabled";
                        };
 
                                clocks = <&clks IMX5_CLK_I2C1_GATE>;
                                status = "disabled";
                        };
-               };
-
-               ipu: ipu@18000000 {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       compatible = "fsl,imx53-ipu";
-                       reg = <0x18000000 0x08000000>;
-                       interrupts = <11 10>;
-                       clocks = <&clks IMX5_CLK_IPU_GATE>,
-                                <&clks IMX5_CLK_IPU_DI0_GATE>,
-                                <&clks IMX5_CLK_IPU_DI1_GATE>;
-                       clock-names = "bus", "di0", "di1";
-                       resets = <&src 2>;
-                       u-boot,dm-pre-reloc;
 
-                       ipu_csi0: port@0 {
-                               reg = <0>;
+                       ssi1: ssi@63fcc000 {
+                               #sound-dai-cells = <0>;
+                               compatible = "fsl,imx53-ssi", "fsl,imx51-ssi",
+                                               "fsl,imx21-ssi";
+                               reg = <0x63fcc000 0x4000>;
+                               interrupts = <29>;
+                               clocks = <&clks IMX5_CLK_SSI1_IPG_GATE>,
+                                        <&clks IMX5_CLK_SSI1_ROOT_GATE>;
+                               clock-names = "ipg", "baud";
+                               dmas = <&sdma 28 0 0>,
+                                      <&sdma 29 0 0>;
+                               dma-names = "rx", "tx";
+                               fsl,fifo-depth = <15>;
+                               status = "disabled";
                        };
 
-                       ipu_csi1: port@1 {
-                               reg = <1>;
+                       audmux: audmux@63fd0000 {
+                               compatible = "fsl,imx53-audmux", "fsl,imx31-audmux";
+                               reg = <0x63fd0000 0x4000>;
+                               status = "disabled";
                        };
 
-                       ipu_di0: port@2 {
-                               #address-cells = <1>;
-                               #size-cells = <0>;
-                               reg = <2>;
-
-                               ipu_di0_disp0: endpoint@0 {
-                                       reg = <0>;
-                               };
-
-                               ipu_di0_lvds0: endpoint@1 {
-                                       reg = <1>;
-                                       remote-endpoint = <&lvds0_in>;
-                               };
+                       nfc: nand@63fdb000 {
+                               compatible = "fsl,imx53-nand";
+                               reg = <0x63fdb000 0x1000 0xf7ff0000 0x10000>;
+                               interrupts = <8>;
+                               clocks = <&clks IMX5_CLK_NFC_GATE>;
+                               status = "disabled";
                        };
 
-                       ipu_di1: port@3 {
-                               #address-cells = <1>;
-                               #size-cells = <0>;
-                               reg = <3>;
-
-                               ipu_di1_disp1: endpoint@0 {
-                                       reg = <0>;
-                               };
-
-                               ipu_di1_lvds1: endpoint@1 {
-                                       reg = <1>;
-                                       remote-endpoint = <&lvds1_in>;
-                               };
+                       ssi3: ssi@63fe8000 {
+                               #sound-dai-cells = <0>;
+                               compatible = "fsl,imx53-ssi", "fsl,imx51-ssi",
+                                               "fsl,imx21-ssi";
+                               reg = <0x63fe8000 0x4000>;
+                               interrupts = <96>;
+                               clocks = <&clks IMX5_CLK_SSI3_IPG_GATE>,
+                                        <&clks IMX5_CLK_SSI3_ROOT_GATE>;
+                               clock-names = "ipg", "baud";
+                               dmas = <&sdma 46 0 0>,
+                                      <&sdma 47 0 0>;
+                               dma-names = "rx", "tx";
+                               fsl,fifo-depth = <15>;
+                               status = "disabled";
+                       };
 
-                               ipu_di1_tve: endpoint@2 {
-                                       reg = <2>;
-                                       remote-endpoint = <&tve_in>;
-                               };
+                       fec: ethernet@63fec000 {
+                               compatible = "fsl,imx53-fec", "fsl,imx25-fec";
+                               reg = <0x63fec000 0x4000>;
+                               interrupts = <87>;
+                               clocks = <&clks IMX5_CLK_FEC_GATE>,
+                                        <&clks IMX5_CLK_FEC_GATE>,
+                                        <&clks IMX5_CLK_FEC_GATE>;
+                               clock-names = "ipg", "ahb", "ptp";
+                               status = "disabled";
                        };
-               };
 
-               tve: tve@63ff0000 {
+                       tve: tve@63ff0000 {
                                compatible = "fsl,imx53-tve";
                                reg = <0x63ff0000 0x1000>;
                                interrupts = <92>;
                                                remote-endpoint = <&ipu_di1_tve>;
                                        };
                                };
-               };
-
-               src: src@53fd0000 {
-                               compatible = "fsl,imx53-src", "fsl,imx51-src";
-                               reg = <0x53fd0000 0x4000>;
-                               #reset-cells = <1>;
-               };
-
-               ldb: ldb@53fa8008 {
-                               #address-cells = <1>;
-                               #size-cells = <0>;
-                               compatible = "fsl,imx53-ldb";
-                               reg = <0x53fa8008 0x4>;
-                               gpr = <&gpr>;
-                               clocks = <&clks IMX5_CLK_LDB_DI0_SEL>,
-                                        <&clks IMX5_CLK_LDB_DI1_SEL>,
-                                        <&clks IMX5_CLK_IPU_DI0_SEL>,
-                                        <&clks IMX5_CLK_IPU_DI1_SEL>,
-                                        <&clks IMX5_CLK_LDB_DI0_GATE>,
-                                        <&clks IMX5_CLK_LDB_DI1_GATE>;
-                               clock-names = "di0_pll", "di1_pll",
-                                             "di0_sel", "di1_sel",
-                                             "di0", "di1";
-                               status = "disabled";
-
-                               lvds-channel@0 {
-                                       #address-cells = <1>;
-                                       #size-cells = <0>;
-                                       reg = <0>;
-                                       status = "disabled";
-
-                                       port@0 {
-                                               reg = <0>;
-
-                                               lvds0_in: endpoint {
-                                                       remote-endpoint = <&ipu_di0_lvds0>;
-                                               };
-                                       };
-
-                                       port@2 {
-                                               reg = <2>;
-                                       };
-                               };
-
-                               lvds-channel@1 {
-                                       #address-cells = <1>;
-                                       #size-cells = <0>;
-                                       reg = <1>;
-                                       status = "disabled";
+                       };
 
-                                       port@1 {
-                                               reg = <1>;
+                       vpu: vpu@63ff4000 {
+                               compatible = "fsl,imx53-vpu", "cnm,coda7541";
+                               reg = <0x63ff4000 0x1000>;
+                               interrupts = <9>;
+                               clocks = <&clks IMX5_CLK_VPU_REFERENCE_GATE>,
+                                        <&clks IMX5_CLK_VPU_GATE>;
+                               clock-names = "per", "ahb";
+                               resets = <&src 1>;
+                               iram = <&ocram>;
+                       };
 
-                                               lvds1_in: endpoint {
-                                                       remote-endpoint = <&ipu_di1_lvds1>;
-                                               };
-                                       };
+                       sahara: crypto@63ff8000 {
+                               compatible = "fsl,imx53-sahara";
+                               reg = <0x63ff8000 0x4000>;
+                               interrupts = <19 20>;
+                               clocks = <&clks IMX5_CLK_SAHARA_IPG_GATE>,
+                                        <&clks IMX5_CLK_SAHARA_IPG_GATE>;
+                               clock-names = "ipg", "ahb";
+                       };
+               };
 
-                                       port@2 {
-                                               reg = <2>;
-                                       };
-                               };
+               ocram: sram@f8000000 {
+                       compatible = "mmio-sram";
+                       reg = <0xf8000000 0x20000>;
+                       clocks = <&clks IMX5_CLK_OCRAM>;
                };
        };
 };
index 738db4f..c2946fb 100644 (file)
@@ -13,6 +13,7 @@
        compatible = "wand,imx6dl-wandboard", "fsl,imx6dl";
 
        memory@10000000 {
+               device_type = "memory";
                reg = <0x10000000 0x40000000>;
        };
 };
diff --git a/arch/arm/dts/imx6q-wandboard-revb1.dts b/arch/arm/dts/imx6q-wandboard-revb1.dts
new file mode 100644 (file)
index 0000000..f6ccbec
--- /dev/null
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ *
+ * Author: Fabio Estevam <fabio.estevam@freescale.com>
+ */
+/dts-v1/;
+#include "imx6q.dtsi"
+#include "imx6qdl-wandboard-revb1.dtsi"
+
+/ {
+       model = "Wandboard i.MX6 Quad Board rev B1";
+       compatible = "wand,imx6q-wandboard", "fsl,imx6q";
+
+       memory@10000000 {
+               device_type = "memory";
+               reg = <0x10000000 0x80000000>;
+       };
+};
+
+&sata {
+       status = "okay";
+};
index 855dc6f..e781a45 100644 (file)
@@ -1,13 +1,8 @@
-/*
- * Copyright 2013 Freescale Semiconductor, Inc.
- *
- * Author: Fabio Estevam <fabio.estevam@freescale.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.
- *
- */
+// SPDX-License-Identifier: GPL-2.0
+//
+// Copyright 2013 Freescale Semiconductor, Inc.
+//
+// Author: Fabio Estevam <fabio.estevam@freescale.com>
 
 #include "imx6qdl-wandboard.dtsi"
 
diff --git a/arch/arm/dts/imx6qdl-wandboard-revd1.dtsi b/arch/arm/dts/imx6qdl-wandboard-revd1.dtsi
new file mode 100644 (file)
index 0000000..9390979
--- /dev/null
@@ -0,0 +1,195 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// Copyright 2013 Freescale Semiconductor, Inc.
+//
+// Author: Fabio Estevam <fabio.estevam@freescale.com>
+
+#include "imx6qdl-wandboard.dtsi"
+
+/ {
+       reg_eth_phy: regulator-eth-phy {
+               compatible = "regulator-fixed";
+               regulator-name = "ETH_PHY";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               gpio = <&gpio7 13 GPIO_ACTIVE_LOW>;
+       };
+};
+
+&hdmi {
+       ddc-i2c-bus = <&i2c2>;
+       status = "okay";
+};
+
+&i2c3 {
+       clock-frequency = <100000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c3>;
+       status = "okay";
+
+       pmic: pfuze100@8 {
+               compatible = "fsl,pfuze100";
+               reg = <0x08>;
+
+               regulators {
+                       sw1a_reg: sw1ab {
+                               regulator-min-microvolt = <300000>;
+                               regulator-max-microvolt = <1875000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                               regulator-ramp-delay = <6250>;
+                       };
+
+                       sw1c_reg: sw1c {
+                               regulator-min-microvolt = <300000>;
+                               regulator-max-microvolt = <1875000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                               regulator-ramp-delay = <6250>;
+                       };
+
+                       sw2_reg: sw2 {
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                               regulator-ramp-delay = <6250>;
+                       };
+
+                       sw3a_reg: sw3a {
+                               regulator-min-microvolt = <400000>;
+                               regulator-max-microvolt = <1975000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       sw3b_reg: sw3b {
+                               regulator-min-microvolt = <400000>;
+                               regulator-max-microvolt = <1975000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       sw4_reg: sw4 {
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+
+                       swbst_reg: swbst {
+                               regulator-min-microvolt = <5000000>;
+                               regulator-max-microvolt = <5150000>;
+                       };
+
+                       snvs_reg: vsnvs {
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <3000000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       vref_reg: vrefddr {
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       vgen1_reg: vgen1 {
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1550000>;
+                       };
+
+                       vgen2_reg: vgen2 {
+                               regulator-min-microvolt = <1500000>;
+                               regulator-max-microvolt = <1500000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       vgen3_reg: vgen3 {
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                       };
+
+                       vgen4_reg: vgen4 {
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                       };
+
+                       vgen5_reg: vgen5 {
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                       };
+
+                       vgen6_reg: vgen6 {
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                       };
+               };
+       };
+};
+
+&fec {
+       phy-supply = <&reg_eth_phy>;
+       status = "okay";
+};
+
+&iomuxc {
+       pinctrl-0 = <&pinctrl_hog>;
+
+       imx6qdl-wandboard {
+               pinctrl_hog: hoggrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_EIM_D22__USB_OTG_PWR         0x80000000      /* USB Power Enable */
+                               MX6QDL_PAD_GPIO_2__GPIO1_IO02           0x80000000      /* USDHC1 CD */
+                               MX6QDL_PAD_EIM_DA9__GPIO3_IO09          0x80000000      /* uSDHC3 CD */
+                               MX6QDL_PAD_EIM_D29__GPIO3_IO29          0x1f0b1         /* RGMII PHY reset */
+                       >;
+               };
+
+               pinctrl_enet: enetgrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_ENET_MDIO__ENET_MDIO         0x1b0b0
+                               MX6QDL_PAD_ENET_MDC__ENET_MDC           0x1b0b0
+                               MX6QDL_PAD_RGMII_TXC__RGMII_TXC         0x1b030
+                               MX6QDL_PAD_RGMII_TD0__RGMII_TD0         0x1b030
+                               MX6QDL_PAD_RGMII_TD1__RGMII_TD1         0x1b030
+                               MX6QDL_PAD_RGMII_TD2__RGMII_TD2         0x1b030
+                               MX6QDL_PAD_RGMII_TD3__RGMII_TD3         0x1b030
+                               MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL   0x1b030
+                               MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK    0x1b0b0
+                               MX6QDL_PAD_RGMII_RXC__RGMII_RXC         0x1b030
+                               MX6QDL_PAD_RGMII_RD0__RGMII_RD0         0x1b030
+                               MX6QDL_PAD_RGMII_RD1__RGMII_RD1         0x1b030
+                               MX6QDL_PAD_RGMII_RD2__RGMII_RD2         0x1b030
+                               MX6QDL_PAD_RGMII_RD3__RGMII_RD3         0x1b030
+                               MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL   0x1b030
+                               MX6QDL_PAD_GPIO_6__ENET_IRQ             0x000b1
+                       >;
+               };
+
+               pinctrl_i2c3: i2c3grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_GPIO_5__I2C3_SCL             0x4001b8b1
+                               MX6QDL_PAD_GPIO_16__I2C3_SDA            0x4001b8b1
+                       >;
+               };
+
+               pinctrl_spdif: spdifgrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_GPIO_19__SPDIF_OUT           0x1b0b0
+                       >;
+               };
+       };
+};
+
+&usdhc2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usdhc2>;
+       bus-width = <4>;
+       no-1-8-v;
+       non-removable;
+       status = "okay";
+};
index 4d03d49..90aa43d 100644 (file)
@@ -8,6 +8,14 @@
 #include <dt-bindings/gpio/gpio.h>
 
 / {
+       aliases {
+               mmc0 = &usdhc3;
+       };
+
+       chosen {
+               stdout-path = &uart1;
+       };
+
        sound {
                compatible = "fsl,imx6-wandboard-sgtl5000",
                             "fsl,imx-audio-sgtl5000";
                VDDIO-supply = <&reg_3p3v>;
                lrclk-strength = <3>;
        };
-
-       pmic: pfuze100@8 {
-               compatible = "fsl,pfuze100";
-               reg = <0x08>;
-
-               regulators {
-                       sw1a_reg: sw1ab {
-                               regulator-min-microvolt = <300000>;
-                               regulator-max-microvolt = <1875000>;
-                               regulator-boot-on;
-                               regulator-always-on;
-                               regulator-ramp-delay = <6250>;
-                       };
-
-                       sw1c_reg: sw1c {
-                               regulator-min-microvolt = <300000>;
-                               regulator-max-microvolt = <1875000>;
-                               regulator-boot-on;
-                               regulator-always-on;
-                               regulator-ramp-delay = <6250>;
-                       };
-
-                       sw2_reg: sw2 {
-                               regulator-min-microvolt = <800000>;
-                               regulator-max-microvolt = <3300000>;
-                               regulator-boot-on;
-                               regulator-always-on;
-                               regulator-ramp-delay = <6250>;
-                       };
-
-                       sw3a_reg: sw3a {
-                               regulator-min-microvolt = <400000>;
-                               regulator-max-microvolt = <1975000>;
-                               regulator-boot-on;
-                               regulator-always-on;
-                       };
-
-                       sw3b_reg: sw3b {
-                               regulator-min-microvolt = <400000>;
-                               regulator-max-microvolt = <1975000>;
-                               regulator-boot-on;
-                               regulator-always-on;
-                       };
-
-                       sw4_reg: sw4 {
-                               regulator-min-microvolt = <800000>;
-                               regulator-max-microvolt = <3300000>;
-                               regulator-always-on;
-                       };
-
-                       swbst_reg: swbst {
-                               regulator-min-microvolt = <5000000>;
-                               regulator-max-microvolt = <5150000>;
-                       };
-
-                       snvs_reg: vsnvs {
-                               regulator-min-microvolt = <1000000>;
-                               regulator-max-microvolt = <3000000>;
-                               regulator-boot-on;
-                               regulator-always-on;
-                       };
-
-                       vref_reg: vrefddr {
-                               regulator-boot-on;
-                               regulator-always-on;
-                       };
-
-                       vgen1_reg: vgen1 {
-                               regulator-min-microvolt = <800000>;
-                               regulator-max-microvolt = <1550000>;
-                       };
-
-                       vgen2_reg: vgen2 {
-                               regulator-min-microvolt = <800000>;
-                               regulator-max-microvolt = <1550000>;
-                       };
-
-                       vgen3_reg: vgen3 {
-                               regulator-min-microvolt = <1800000>;
-                               regulator-max-microvolt = <3300000>;
-                       };
-
-                       vgen4_reg: vgen4 {
-                               regulator-min-microvolt = <1800000>;
-                               regulator-max-microvolt = <3300000>;
-                               regulator-always-on;
-                       };
-
-                       vgen5_reg: vgen5 {
-                               regulator-min-microvolt = <1800000>;
-                               regulator-max-microvolt = <3300000>;
-                               regulator-always-on;
-                       };
-
-                       vgen6_reg: vgen6 {
-                               regulator-min-microvolt = <1800000>;
-                               regulator-max-microvolt = <3300000>;
-                               regulator-always-on;
-                       };
-               };
-       };
 };
 
 &iomuxc {
 &fec {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_enet>;
-       phy-mode = "rgmii";
+       phy-mode = "rgmii-id";
        phy-reset-gpios = <&gpio3 29 GPIO_ACTIVE_LOW>;
        interrupts-extended = <&gpio1 6 IRQ_TYPE_LEVEL_HIGH>,
                              <&intc 0 119 IRQ_TYPE_LEVEL_HIGH>;
diff --git a/arch/arm/dts/imx6qp-wandboard-revd1.dts b/arch/arm/dts/imx6qp-wandboard-revd1.dts
new file mode 100644 (file)
index 0000000..08d8b78
--- /dev/null
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ *
+ * Author: Fabio Estevam <fabio.estevam@freescale.com>
+ */
+/dts-v1/;
+#include "imx6qp.dtsi"
+#include "imx6qdl-wandboard-revd1.dtsi"
+
+/ {
+       model = "Wandboard i.MX6 QuadPlus Board revD1";
+       compatible = "wand,imx6qp-wandboard", "fsl,imx6qp";
+
+       memory@10000000 {
+               device_type = "memory";
+               reg = <0x10000000 0x80000000>;
+       };
+};
+
+&sata {
+       status = "okay";
+};
diff --git a/arch/arm/dts/rk3288-tinker-u-boot.dtsi b/arch/arm/dts/rk3288-tinker-u-boot.dtsi
new file mode 100644 (file)
index 0000000..2efb309
--- /dev/null
@@ -0,0 +1,54 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Rockchip Electronics Co., Ltd
+ */
+
+#include "rk3288-u-boot.dtsi"
+
+&pinctrl {
+       u-boot,dm-pre-reloc;
+};
+
+&uart2 {
+       u-boot,dm-pre-reloc;
+};
+
+&sdmmc {
+       u-boot,dm-pre-reloc;
+};
+
+&emmc {
+       u-boot,dm-pre-reloc;
+};
+
+&gpio3 {
+       u-boot,dm-pre-reloc;
+};
+
+&gpio8 {
+       u-boot,dm-pre-reloc;
+};
+
+&pcfg_pull_none_drv_8ma {
+       u-boot,dm-spl;
+};
+
+&pcfg_pull_up_drv_8ma {
+       u-boot,dm-spl;
+};
+
+&sdmmc_bus4 {
+       u-boot,dm-spl;
+};
+
+&sdmmc_clk {
+       u-boot,dm-spl;
+};
+
+&sdmmc_cmd {
+       u-boot,dm-spl;
+};
+
+&sdmmc_pwr {
+       u-boot,dm-spl;
+};
index 3edd21c..94c3afe 100644 (file)
@@ -28,8 +28,6 @@
 
 
 &pinctrl {
-       u-boot,dm-pre-reloc;
-
        usb {
                host_vbus_drv: host-vbus-drv {
                        rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
@@ -42,7 +40,6 @@
 };
 
 &uart2 {
-       u-boot,dm-pre-reloc;
        reg-shift = <2>;
 };
 
        status = "okay";
 };
 
-&sdmmc {
-       u-boot,dm-pre-reloc;
-};
-
-&emmc {
-       u-boot,dm-pre-reloc;
-};
-
-&gpio3 {
-       u-boot,dm-pre-reloc;
-};
-
-&gpio8 {
-       u-boot,dm-pre-reloc;
-};
-
 &i2c2 {
     m24c08@50 {
         compatible = "at,24c08", "i2c-eeprom";
diff --git a/arch/arm/dts/rk3288-u-boot.dtsi b/arch/arm/dts/rk3288-u-boot.dtsi
new file mode 100644 (file)
index 0000000..4cf75c7
--- /dev/null
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Rockchip Electronics Co., Ltd
+ */
+
+&dmc {
+       u-boot,dm-pre-reloc;
+};
+
+&pmu {
+       u-boot,dm-pre-reloc;
+};
+
+&sgrf {
+       u-boot,dm-pre-reloc;
+};
+
+&cru {
+       u-boot,dm-pre-reloc;
+};
+
+&grf {
+       u-boot,dm-pre-reloc;
+};
+
+&vopb {
+       u-boot,dm-pre-reloc;
+};
+
+&vopl {
+       u-boot,dm-pre-reloc;
+};
+
+&noc {
+       u-boot,dm-pre-reloc;
+};
index 22ba349..eccc069 100644 (file)
@@ -3,6 +3,8 @@
  * Copyright 2015 Google, Inc
  */
 
+#include "rk3288-u-boot.dtsi"
+
 &dmc {
        rockchip,pctl-timing = <0x215 0xc8 0x0 0x35 0x26 0x2 0x70 0x2000d
                0x6 0x0 0x8 0x4 0x17 0x24 0xd 0x6
index 379b1e3..7730d17 100644 (file)
@@ -3,6 +3,8 @@
  * Copyright (C) 2017 Jagan Teki <jagan@amarulasolutions.com>
  */
 
+#include "rk3288-u-boot.dtsi"
+
 &dmc {
        rockchip,pctl-timing = <0x29a 0xc8 0x1f8 0x42 0x4e 0x4 0xea 0xa
                0x5 0x0 0xa 0x7 0x19 0x24 0xa 0x7
index 487d22c..866fc08 100644 (file)
        };
 
        dmc: dmc@ff610000 {
-               u-boot,dm-pre-reloc;
                compatible = "rockchip,rk3288-dmc", "syscon";
                rockchip,cru = <&cru>;
                rockchip,grf = <&grf>;
        };
 
        pmu: power-management@ff730000 {
-               u-boot,dm-pre-reloc;
                compatible = "rockchip,rk3288-pmu", "syscon";
                reg = <0xff730000 0x100>;
        };
 
        sgrf: syscon@ff740000 {
-               u-boot,dm-pre-reloc;
                compatible = "rockchip,rk3288-sgrf", "syscon";
                reg = <0xff740000 0x1000>;
        };
                compatible = "rockchip,rk3288-cru";
                reg = <0xff760000 0x1000>;
                rockchip,grf = <&grf>;
-               u-boot,dm-pre-reloc;
                #clock-cells = <1>;
                #reset-cells = <1>;
                assigned-clocks = <&cru PLL_GPLL>, <&cru PLL_CPLL>,
        };
 
        grf: syscon@ff770000 {
-               u-boot,dm-pre-reloc;
                compatible = "rockchip,rk3288-grf", "syscon";
                reg = <0xff770000 0x1000>;
        };
        };
 
        vopb: vop@ff930000 {
-               u-boot,dm-pre-reloc;
                compatible = "rockchip,rk3288-vop";
                reg = <0xff930000 0x19c>;
                interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;
                iommus = <&vopl_mmu>;
                power-domains = <&power RK3288_PD_VIO>;
                status = "disabled";
-               u-boot,dm-pre-reloc;
                vopl_out: port {
                        #address-cells = <1>;
                        #size-cells = <0>;
        };
 
        noc: syscon@ffac0000 {
-               u-boot,dm-pre-reloc;
                compatible = "rockchip,rk3288-noc", "syscon";
                reg = <0xffac0000 0x2000>;
        };
diff --git a/arch/arm/dts/rk3328-rock64-u-boot.dtsi b/arch/arm/dts/rk3328-rock64-u-boot.dtsi
new file mode 100644 (file)
index 0000000..b077436
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * (C) Copyright 2018 Rockchip Electronics Co., Ltd
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+/ {
+       aliases {
+               mmc0 = &emmc;
+               mmc1 = &sdmmc;
+       };
+
+       chosen {
+               u-boot,spl-boot-order = &emmc, &sdmmc;
+       };
+};
+
+&cru {
+       u-boot,dm-pre-reloc;
+};
+
+&uart2 {
+       u-boot,dm-pre-reloc;
+};
+
+&emmc {
+       u-boot,dm-pre-reloc;
+       fifo-mode;
+};
+
+&sdmmc {
+       u-boot,dm-pre-reloc;
+       fifo-mode;
+};
diff --git a/arch/arm/dts/rk3328-rock64.dts b/arch/arm/dts/rk3328-rock64.dts
new file mode 100644 (file)
index 0000000..7bcc53f
--- /dev/null
@@ -0,0 +1,294 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2017 PINE64
+ */
+
+/dts-v1/;
+#include "rk3328.dtsi"
+
+/ {
+       model = "Pine64 Rock64";
+       compatible = "pine64,rock64", "rockchip,rk3328";
+
+       chosen {
+               stdout-path = "serial2:1500000n8";
+       };
+
+       gmac_clkin: external-gmac-clock {
+               compatible = "fixed-clock";
+               clock-frequency = <125000000>;
+               clock-output-names = "gmac_clkin";
+               #clock-cells = <0>;
+       };
+
+       vcc_sd: sdmmc-regulator {
+               compatible = "regulator-fixed";
+               gpio = <&gpio0 RK_PD6 GPIO_ACTIVE_LOW>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&sdmmc0m1_gpio>;
+               regulator-name = "vcc_sd";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&vcc_io>;
+       };
+
+       vcc_host_5v: vcc-host-5v-regulator {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&usb30_host_drv>;
+               regulator-name = "vcc_host_5v";
+               regulator-always-on;
+               regulator-boot-on;
+               vin-supply = <&vcc_sys>;
+       };
+
+       vcc_host1_5v: vcc_otg_5v: vcc-host1-5v-regulator {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&usb20_host_drv>;
+               regulator-name = "vcc_host1_5v";
+               regulator-always-on;
+               regulator-boot-on;
+               vin-supply = <&vcc_sys>;
+       };
+
+       vcc_sys: vcc-sys {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc_sys";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+       };
+};
+
+&cpu0 {
+       cpu-supply = <&vdd_arm>;
+};
+
+&cpu1 {
+       cpu-supply = <&vdd_arm>;
+};
+
+&cpu2 {
+       cpu-supply = <&vdd_arm>;
+};
+
+&cpu3 {
+       cpu-supply = <&vdd_arm>;
+};
+
+&emmc {
+       bus-width = <8>;
+       cap-mmc-highspeed;
+       mmc-hs200-1_8v;
+       non-removable;
+       pinctrl-names = "default";
+       pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
+       vmmc-supply = <&vcc_io>;
+       vqmmc-supply = <&vcc18_emmc>;
+       status = "okay";
+};
+
+&gmac2io {
+       assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
+       assigned-clock-parents = <&gmac_clkin>, <&gmac_clkin>;
+       clock_in_out = "input";
+       phy-supply = <&vcc_io>;
+       phy-mode = "rgmii";
+       pinctrl-names = "default";
+       pinctrl-0 = <&rgmiim1_pins>;
+       snps,force_thresh_dma_mode;
+       snps,reset-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
+       snps,reset-active-low;
+       snps,reset-delays-us = <0 10000 50000>;
+       tx_delay = <0x24>;
+       rx_delay = <0x18>;
+       status = "okay";
+};
+
+&i2c1 {
+       status = "okay";
+
+       rk805: rk805@18 {
+               compatible = "rockchip,rk805";
+               reg = <0x18>;
+               interrupt-parent = <&gpio2>;
+               interrupts = <6 IRQ_TYPE_LEVEL_LOW>;
+               #clock-cells = <1>;
+               clock-output-names = "xin32k", "rk805-clkout2";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pmic_int_l>;
+               rockchip,system-power-controller;
+               wakeup-source;
+
+               vcc1-supply = <&vcc_sys>;
+               vcc2-supply = <&vcc_sys>;
+               vcc3-supply = <&vcc_sys>;
+               vcc4-supply = <&vcc_sys>;
+               vcc5-supply = <&vcc_io>;
+               vcc6-supply = <&vcc_sys>;
+
+               regulators {
+                       vdd_logic: DCDC_REG1 {
+                               regulator-name = "vdd_logic";
+                               regulator-min-microvolt = <712500>;
+                               regulator-max-microvolt = <1450000>;
+                               regulator-ramp-delay = <12500>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <1000000>;
+                               };
+                       };
+
+                       vdd_arm: DCDC_REG2 {
+                               regulator-name = "vdd_arm";
+                               regulator-min-microvolt = <712500>;
+                               regulator-max-microvolt = <1450000>;
+                               regulator-ramp-delay = <12500>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <950000>;
+                               };
+                       };
+
+                       vcc_ddr: DCDC_REG3 {
+                               regulator-name = "vcc_ddr";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       vcc_io: DCDC_REG4 {
+                               regulator-name = "vcc_io";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <3300000>;
+                               };
+                       };
+
+                       vcc_18: LDO_REG1 {
+                               regulator-name = "vdd_18";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <1800000>;
+                               };
+                       };
+
+                       vcc18_emmc: LDO_REG2 {
+                               regulator-name = "vcc_18emmc";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <1800000>;
+                               };
+                       };
+
+                       vdd_10: LDO_REG3 {
+                               regulator-name = "vdd_10";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <1000000>;
+                               };
+                       };
+               };
+       };
+};
+
+&io_domains {
+       status = "okay";
+
+       vccio1-supply = <&vcc_io>;
+       vccio2-supply = <&vcc18_emmc>;
+       vccio3-supply = <&vcc_io>;
+       vccio4-supply = <&vcc_18>;
+       vccio5-supply = <&vcc_io>;
+       vccio6-supply = <&vcc_io>;
+       pmuio-supply = <&vcc_io>;
+};
+
+&pinctrl {
+       pmic {
+               pmic_int_l: pmic-int-l {
+                       rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
+               };
+       };
+
+       usb2 {
+               usb20_host_drv: usb20-host-drv {
+                       rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       usb3 {
+               usb30_host_drv: usb30-host-drv {
+                       rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+};
+
+&sdmmc {
+       bus-width = <4>;
+       cap-mmc-highspeed;
+       cap-sd-highspeed;
+       disable-wp;
+       max-frequency = <150000000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_dectn &sdmmc0_bus4>;
+       vmmc-supply = <&vcc_sd>;
+       status = "okay";
+};
+
+&spi0 {
+       status = "okay";
+
+       spiflash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+
+               /* maximum speed for Rockchip SPI */
+               spi-max-frequency = <50000000>;
+       };
+};
+
+&uart2 {
+       status = "okay";
+};
+
+&usb20_otg {
+       dr_mode = "host";
+       status = "okay";
+};
+
+&usb_host0_ehci {
+       status = "okay";
+};
+
+&usb_host0_ohci {
+       status = "okay";
+};
index ca0fc39..0e2e047 100644 (file)
@@ -629,7 +629,6 @@ ap_i2c_audio: &i2c8 {
 
 &uart2 {
        status = "okay";
-       u-boot,dm-pre-reloc;
 };
 
 &usb_host0_ohci {
index 897e0bd..74368da 100644 (file)
 };
 
 &uart0 {
-       u-boot,dm-pre-reloc;
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_xfer &uart0_cts>;
        status = "okay";
index 7bddc3a..50b0ca0 100644 (file)
@@ -4,3 +4,7 @@
  */
 
 #include "rk3399-u-boot.dtsi"
+
+&vdd_log {
+       regulator-init-microvolt = <950000>;
+};
index 0786c11..fcfce9a 100644 (file)
 &spi1 {
        u-boot,dm-pre-reloc;
 };
+
+&uart0 {
+       u-boot,dm-pre-reloc;
+};
+
+&uart2 {
+       u-boot,dm-pre-reloc;
+};
index ade7285..d8f9d8d 100644 (file)
        };
 };
 
-&clk_hse {
-       u-boot,dm-pre-reloc;
-};
-
 &fmc {
        /* Memory configuration from sdram datasheet MT48LC_4M32_B2B5-6A */
        bank1: bank@0 {
        };
 
        fmc_pins: fmc@0 {
-               u-boot,dm-pre-reloc;
                pins {
-                       u-boot,dm-pre-reloc;
                        pinmux = <STM32_PINMUX('D',10, AF12)>, /* D15 */
                                 <STM32_PINMUX('D', 9, AF12)>, /* D14 */
                                 <STM32_PINMUX('D', 8, AF12)>, /* D13 */
index 53a645d..209a82c 100644 (file)
                        slew-rate = <2>;
                };
        };
+
+       usart1_pins_a: usart1@0 {
+               u-boot,dm-pre-reloc;
+               pins1 {
+                       u-boot,dm-pre-reloc;
+               };
+               pins2 {
+                       u-boot,dm-pre-reloc;
+               };
+       };
 };
 
 &qspi {
index 2776a39..e3a893e 100644 (file)
@@ -348,7 +348,7 @@ struct bcm2835_mbox_tag_depth {
 };
 
 #define BCM2835_MBOX_TAG_GET_PIXEL_ORDER       0x00040006
-#define BCM2835_MBOX_TAG_TEST_PIXEL_ORDER      0x00044005
+#define BCM2835_MBOX_TAG_TEST_PIXEL_ORDER      0x00044006
 #define BCM2835_MBOX_TAG_SET_PIXEL_ORDER       0x00048006
 
 #define BCM2835_MBOX_PIXEL_ORDER_BGR           0
index d42a15e..24d1629 100644 (file)
@@ -17,7 +17,7 @@
 #define ALIGN_SIZE             0x1000
 #define MX6DQ_PU_IROM_MMU_EN_VAR       0x009024a8
 #define MX6DLS_PU_IROM_MMU_EN_VAR      0x00901dd0
-#define MX6SL_PU_IROM_MMU_EN_VAR       0x00900a18
+#define MX6SL_PU_IROM_MMU_EN_VAR       0x00901c60
 #define IS_HAB_ENABLED_BIT \
        (is_soc_type(MXC_SOC_MX7ULP) ? 0x80000000 :     \
         (is_soc_type(MXC_SOC_MX7) ? 0x2000000 : 0x2))
index b5e91d4..60aef15 100644 (file)
@@ -12,7 +12,6 @@ choice
 config TARGET_MT7623
        bool "MediaTek MT7623 SoC"
        select CPU_V7A
-       select ARCH_MISC_INIT
        help
          The MediaTek MT7623 is a ARM-based SoC with a quad-core Cortex-A7
          including NEON and GPU, Mali-450 graphics, several DDR3 options,
@@ -25,7 +24,6 @@ config TARGET_MT7629
        bool "MediaTek MT7629 SoC"
        select CPU_V7A
        select SPL
-       select ARCH_MISC_INIT
        help
          The MediaTek MT7629 is a ARM-based SoC with a dual-core Cortex-A7
          including DDR3, crypto engine, 3x3 11n/ac Wi-Fi, Gigabit Ethernet,
@@ -34,7 +32,6 @@ config TARGET_MT7629
 config TARGET_MT8516
        bool "MediaTek MT8516 SoC"
        select ARM64
-       select ARCH_MISC_INIT
        help
          The MediaTek MT8516 is a ARM64-based SoC with a quad-core Cortex-A35.
          including UART, SPI, USB2.0 and OTG, SD and MMC cards, NAND, PWM,
index b37e299..1923c9e 100644 (file)
@@ -8,18 +8,6 @@
 #include <wdt.h>
 #include <dm/uclass-internal.h>
 
-int arch_misc_init(void)
-{
-       struct udevice *wdt;
-       int ret;
-
-       ret = uclass_first_device_err(UCLASS_WDT, &wdt);
-       if (!ret)
-               wdt_stop(wdt);
-
-       return 0;
-}
-
 int arch_cpu_init(void)
 {
        icache_enable();
index c05e3c3..1090d21 100644 (file)
@@ -87,6 +87,21 @@ config ROCKCHIP_RK3288
        select SPL_BOARD_INIT if SPL
        select SUPPORT_SPL
        select SPL
+       select SUPPORT_TPL
+       imply TPL_BOOTROM_SUPPORT
+       imply TPL_CLK
+       imply TPL_DM
+       imply TPL_DRIVERS_MISC_SUPPORT
+       imply TPL_LIBCOMMON_SUPPORT
+       imply TPL_LIBGENERIC_SUPPORT
+       imply TPL_NEEDS_SEPARATE_TEXT_BASE
+       imply TPL_NEEDS_SEPARATE_STACK
+       imply TPL_OF_CONTROL
+       imply TPL_OF_PLATDATA
+       imply TPL_RAM
+       imply TPL_REGMAP
+       imply TPL_SERIAL_SUPPORT
+       imply TPL_SYSCON
        imply USB_FUNCTION_ROCKUSB
        imply CMD_ROCKUSB
        help
@@ -104,11 +119,21 @@ config TPL_TEXT_BASE
 config TPL_MAX_SIZE
        default 32768
 
+config TPL_STACK
+        default 0xff718000
+
 endif
 
 config ROCKCHIP_RK3328
        bool "Support Rockchip RK3328"
        select ARM64
+       select SUPPORT_SPL
+       select SPL
+       imply SPL_SERIAL_SUPPORT
+       imply SPL_SEPARATE_BSS
+       select ENABLE_ARM_SOC_BOOT0_HOOK
+       select DEBUG_UART_BOARD_INIT
+       select SYS_NS16550
        help
          The Rockchip RK3328 is a ARM-based SoC with a quad-core Cortex-A53.
          including NEON and GPU, 1MB L2 cache, Mali-T7 graphics, two
@@ -158,6 +183,7 @@ config ROCKCHIP_RK3399
        select SPL
        select SPL_ATF
        select SPL_ATF_NO_PLATFORM_PARAM if SPL_ATF
+       select SPL_BOARD_INIT if SPL
        select SPL_LOAD_FIT
        select SPL_CLK if SPL
        select SPL_PINCTRL if SPL
@@ -183,6 +209,7 @@ config ROCKCHIP_RK3399
        imply TPL_LIBCOMMON_SUPPORT
        imply TPL_LIBGENERIC_SUPPORT
        imply TPL_SYS_MALLOC_SIMPLE
+       imply TPL_BOARD_INIT
        imply TPL_BOOTROM_SUPPORT
        imply TPL_DRIVERS_MISC_SUPPORT
        imply TPL_OF_CONTROL
index 846c82d..23760a9 100644 (file)
@@ -18,6 +18,7 @@ obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o
 obj-spl-$(CONFIG_ROCKCHIP_RK3188) += rk3188-board-spl.o
 obj-spl-$(CONFIG_ROCKCHIP_RK322X) += rk322x-board-spl.o spl-boot-order.o
 obj-spl-$(CONFIG_ROCKCHIP_RK3288) += rk3288-board-spl.o
+obj-spl-$(CONFIG_ROCKCHIP_RK3328) += rk3328-board-spl.o
 obj-spl-$(CONFIG_ROCKCHIP_RK3368) += rk3368-board-spl.o spl-boot-order.o
 obj-spl-$(CONFIG_ROCKCHIP_RK3399) += rk3399-board-spl.o spl-boot-order.o
 
index 212bd0a..db0ae96 100755 (executable)
@@ -12,6 +12,7 @@
 import os
 import sys
 import getopt
+import logging
 
 # pip install pyelftools
 from elftools.elf.elffile import ELFFile
@@ -89,13 +90,17 @@ def append_conf_section(file, cnt, dtname, segments):
     file.write('\t\tconfig_%d {\n' % cnt)
     file.write('\t\t\tdescription = "%s";\n' % dtname)
     file.write('\t\t\tfirmware = "atf_1";\n')
-    file.write('\t\t\tloadables = "uboot",')
+    file.write('\t\t\tloadables = "uboot"')
+    if segments != 0:
+        file.write(',')
     for i in range(1, segments):
-        file.write('"atf_%d"' % (i))
+        file.write('"atf_%d"' % (i + 1))
         if i != (segments - 1):
             file.write(',')
         else:
             file.write(';\n')
+    if segments == 0:
+        file.write(';\n')
     file.write('\t\t\tfdt = "fdt_1";\n')
     file.write('\t\t};\n')
     file.write('\n')
@@ -171,8 +176,18 @@ def generate_atf_binary(bl31_file_name):
 
 def main():
     uboot_elf = "./u-boot"
-    bl31_elf = "./bl31.elf"
     fit_its = sys.stdout
+    if "BL31" in os.environ:
+        bl31_elf=os.getenv("BL31");
+    elif os.path.isfile("./bl31.elf"):
+        bl31_elf = "./bl31.elf"
+    else:
+        os.system("echo 'int main(){}' > bl31.c")
+        os.system("${CROSS_COMPILE}gcc -c bl31.c -o bl31.elf")
+        bl31_elf = "./bl31.elf"
+        logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)
+        logging.warning(' BL31 file bl31.elf NOT found, resulting binary is non-functional')
+        logging.warning(' Please read Building section in doc/README.rockchip')
 
     opts, args = getopt.getopt(sys.argv[1:], "o:u:b:h")
     for opt, val in opts:
index 50680ce..c5dcd06 100644 (file)
@@ -99,21 +99,7 @@ config TARGET_VYASA_RK3288
        bool "Vyasa-RK3288"
        select BOARD_LATE_INIT
        select ROCKCHIP_BROM_HELPER
-       select SUPPORT_TPL
        select TPL
-       select TPL_BOOTROM_SUPPORT
-       select TPL_CLK
-       select TPL_DM
-       select TPL_DRIVERS_MISC_SUPPORT
-       select TPL_LIBCOMMON_SUPPORT
-       select TPL_LIBGENERIC_SUPPORT
-       select TPL_NEEDS_SEPARATE_TEXT_BASE if SPL
-       select TPL_OF_CONTROL
-       select TPL_OF_PLATDATA
-       select TPL_RAM
-       select TPL_REGMAP
-       select TPL_SERIAL_SUPPORT
-       select TPL_SYSCON
        help
          Vyasa is a RK3288-based development board with 2 USB ports,
          HDMI, VGA, micro-SD card, audio, WiFi  and Gigabit Ethernet, It
@@ -132,6 +118,7 @@ config TARGET_ROCK2
 config TARGET_TINKER_RK3288
        bool "Tinker-RK3288"
         select BOARD_LATE_INIT
+       select TPL
        help
          Tinker is a RK3288-based development board with 2 USB ports, HDMI,
          micro-SD card, audio, Gigabit Ethernet. It also includes on-board
diff --git a/arch/arm/mach-rockchip/rk3328-board-spl.c b/arch/arm/mach-rockchip/rk3328-board-spl.c
new file mode 100644 (file)
index 0000000..7f49d05
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * (C) Copyright 2016 Rockchip Electronics Co., Ltd
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#include <common.h>
+#include <debug_uart.h>
+#include <dm.h>
+#include <dm/pinctrl.h>
+#include <ram.h>
+#include <spl.h>
+#include <asm/io.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+void board_debug_uart_init(void)
+{
+}
+
+void board_init_f(ulong dummy)
+{
+       struct udevice *dev;
+       int ret;
+
+       ret = spl_early_init();
+       if (ret) {
+               debug("spl_early_init() failed: %d\n", ret);
+               hang();
+       }
+
+       preloader_console_init();
+
+       ret = uclass_get_device(UCLASS_RAM, 0, &dev);
+       if (ret) {
+               debug("DRAM init failed: %d\n", ret);
+               return;
+       }
+}
+
+u32 spl_boot_mode(const u32 boot_device)
+{
+       return MMCSD_MODE_RAW;
+}
+
+u32 spl_boot_device(void)
+{
+       return BOOT_DEVICE_MMC1;
+}
+
+#ifdef CONFIG_SPL_LOAD_FIT
+int board_fit_config_name_match(const char *name)
+{
+       /* Just empty function now - can't decide what to choose */
+       debug("%s: %s\n", __func__, name);
+
+       return 0;
+}
+#endif
index 800ca80..890d800 100644 (file)
 #include <spl.h>
 #include <spl_gpio.h>
 #include <syscon.h>
+#include <asm/gpio.h>
 #include <asm/io.h>
 #include <asm/arch-rockchip/bootrom.h>
 #include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk3399.h>
 #include <asm/arch-rockchip/grf_rk3399.h>
 #include <asm/arch-rockchip/hardware.h>
 #include <asm/arch-rockchip/periph.h>
 #include <asm/arch-rockchip/sys_proto.h>
+#include <power/regulator.h>
 #include <dm/pinctrl.h>
 
 void board_return_to_bootrom(void)
@@ -161,7 +164,7 @@ void board_init_f(ulong dummy)
         * printhex8(0x1234);
         * printascii("string");
         */
-       printascii("U-Boot SPL board init\n");
+       debug("U-Boot SPL board init\n");
 #endif
 
        ret = spl_early_init();
@@ -202,6 +205,66 @@ void board_init_f(ulong dummy)
        }
 }
 
+#if defined(SPL_GPIO_SUPPORT)
+static void rk3399_force_power_on_reset(void)
+{
+       ofnode node;
+       struct gpio_desc sysreset_gpio;
+
+       debug("%s: trying to force a power-on reset\n", __func__);
+
+       node = ofnode_path("/config");
+       if (!ofnode_valid(node)) {
+               debug("%s: no /config node?\n", __func__);
+               return;
+       }
+
+       if (gpio_request_by_name_nodev(node, "sysreset-gpio", 0,
+                                      &sysreset_gpio, GPIOD_IS_OUT)) {
+               debug("%s: could not find a /config/sysreset-gpio\n", __func__);
+               return;
+       }
+
+       dm_gpio_set_value(&sysreset_gpio, 1);
+}
+#endif
+
+void spl_board_init(void)
+{
+#if defined(SPL_GPIO_SUPPORT)
+       struct rk3399_cru *cru = rockchip_get_cru();
+
+       /*
+        * The RK3399 resets only 'almost all logic' (see also in the TRM
+        * "3.9.4 Global software reset"), when issuing a software reset.
+        * This may cause issues during boot-up for some configurations of
+        * the application software stack.
+        *
+        * To work around this, we test whether the last reset reason was
+        * a power-on reset and (if not) issue an overtemp-reset to reset
+        * the entire module.
+        *
+        * While this was previously fixed by modifying the various places
+        * that could generate a software reset (e.g. U-Boot's sysreset
+        * driver, the ATF or Linux), we now have it here to ensure that
+        * we no longer have to track this through the various components.
+        */
+       if (cru->glb_rst_st != 0)
+               rk3399_force_power_on_reset();
+#endif
+
+#if defined(SPL_DM_REGULATOR)
+       /*
+        * Turning the eMMC and SPI back on (if disabled via the Qseven
+        * BIOS_ENABLE) signal is done through a always-on regulator).
+        */
+       if (regulators_enable_boot_on(false))
+               debug("%s: Cannot enable boot on regulator\n", __func__);
+#endif
+
+       preloader_console_init();
+}
+
 #ifdef CONFIG_SPL_LOAD_FIT
 int board_fit_config_name_match(const char *name)
 {
index 86d3ffe..4a30124 100644 (file)
@@ -8,6 +8,7 @@
 #include <dm.h>
 #include <ram.h>
 #include <spl.h>
+#include <version.h>
 #include <asm/io.h>
 #include <asm/arch-rockchip/bootrom.h>
 
@@ -46,7 +47,7 @@ void board_init_f(ulong dummy)
         * printhex8(0x1234);
         * printascii("string");
         */
-       printascii("U-Boot TPL board init\n");
+       debug("U-Boot TPL board init\n");
 #endif
        ret = spl_early_init();
        if (ret) {
@@ -73,6 +74,12 @@ u32 spl_boot_device(void)
        return BOOT_DEVICE_BOOTROM;
 }
 
+void spl_board_init(void)
+{
+       puts("\nU-Boot TPL "  PLAIN_VERSION " (" U_BOOT_DATE " - "
+            U_BOOT_TIME " " U_BOOT_TZ ")\n");
+}
+
 #ifdef CONFIG_SPL_LOAD_FIT
 int board_fit_config_name_match(const char *name)
 {
index 6ae31d3..41338a1 100644 (file)
@@ -18,7 +18,7 @@ int arch_cpu_init(void)
                 */
 #if defined(CONFIG_STM32F4)
                { 0x00000000, REGION_0, XN_DIS, PRIV_RW_USR_RW,
-               O_I_WB_RD_WR_ALLOC, REGION_16MB },
+               O_I_WB_RD_WR_ALLOC, REGION_512MB },
 #endif
 
                { 0x90000000, REGION_1, XN_DIS, PRIV_RW_USR_RW,
index 9fe3eaa..e56e1f6 100644 (file)
 #include CONFIG_DEBUG_LL_INCLUDE
 #endif
 
+#define SG_REVISION_TYPE_SHIFT         16
+#define SG_REVISION_TYPE_MASK          (0xff << SG_REVISION_TYPE_SHIFT)
 #define BAUDRATE               115200
 #define DIV_ROUND(x, d)                (((x) + ((d) / 2)) / (d))
 
+.macro sg_set_pinsel, pin, muxval, mux_bits, reg_stride, ra, rd
+       ldr     \ra, =(SG_PINCTRL_BASE + \pin * \mux_bits / 32 * \reg_stride)
+       ldr     \rd, [\ra]
+       and     \rd, \rd, #~(((1 << \mux_bits) - 1) << (\pin * \mux_bits % 32))
+       orr     \rd, \rd, #(\muxval << (\pin * \mux_bits % 32))
+       str     \rd, [\ra]
+.endm
+
 ENTRY(debug_ll_init)
        ldr             r0, =SG_REVISION
        ldr             r1, [r0]
index 5d78db5..81e9314 100644 (file)
@@ -7,8 +7,6 @@ obj-$(CONFIG_ARCH_UNIPHIER_SLD8)        += debug-uart-sld8.o
 obj-$(CONFIG_ARCH_UNIPHIER_PRO5)       += debug-uart-pro5.o
 obj-$(CONFIG_ARCH_UNIPHIER_PXS2)       += debug-uart-pxs2.o
 obj-$(CONFIG_ARCH_UNIPHIER_LD6B)       += debug-uart-ld6b.o
-obj-$(CONFIG_ARCH_UNIPHIER_LD11)       += debug-uart-ld20.o
-obj-$(CONFIG_ARCH_UNIPHIER_LD20)       += debug-uart-ld20.o
 endif
 
 obj-y                                  += debug-uart.o
diff --git a/arch/arm/mach-uniphier/debug-uart/debug-uart-ld20.c b/arch/arm/mach-uniphier/debug-uart/debug-uart-ld20.c
deleted file mode 100644 (file)
index b742feb..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright (C) 2016 Masahiro Yamada <yamada.masahiro@socionext.com>
- */
-
-#include <config.h>
-#include <linux/kernel.h>
-#include <linux/io.h>
-
-#include "../sc64-regs.h"
-#include "../sg-regs.h"
-#include "debug-uart.h"
-
-#define UNIPHIER_LD20_UART_CLK         58820000
-
-unsigned int uniphier_ld20_debug_uart_init(void)
-{
-       u32 tmp;
-
-       sg_set_iectrl(54);              /* TXD0 */
-       sg_set_iectrl(58);              /* TXD1 */
-       sg_set_iectrl(90);              /* TXD2 */
-       sg_set_iectrl(94);              /* TXD3 */
-       sg_set_pinsel(54, 0, 8, 4);     /* TXD0 -> TXD0 */
-       sg_set_pinsel(58, 1, 8, 4);     /* SPITXD1 -> TXD1 */
-       sg_set_pinsel(90, 1, 8, 4);     /* PC0WE -> TXD2 */
-       sg_set_pinsel(94, 1, 8, 4);     /* PCD00 -> TXD3 */
-
-       tmp = readl(SC_CLKCTRL4);
-       tmp |= SC_CLKCTRL4_PERI;
-       writel(tmp, SC_CLKCTRL4);
-
-       return DIV_ROUND_CLOSEST(UNIPHIER_LD20_UART_CLK, 16 * CONFIG_BAUDRATE);
-}
index 992b4a9..bc96b2e 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/io.h>
 #include <linux/serial_reg.h>
 
+#include "../sg-regs.h"
 #include "../soc-info.h"
 #include "debug-uart.h"
 
@@ -26,8 +27,36 @@ static void _debug_uart_putc(int c)
        writel(c, base + UNIPHIER_UART_TX);
 }
 
+#ifdef CONFIG_SPL_BUILD
+void sg_set_pinsel(unsigned int pin, unsigned int muxval,
+                  unsigned int mux_bits, unsigned int reg_stride)
+{
+       unsigned int shift = pin * mux_bits % 32;
+       unsigned long reg = SG_PINCTRL_BASE + pin * mux_bits / 32 * reg_stride;
+       u32 mask = (1U << mux_bits) - 1;
+       u32 tmp;
+
+       tmp = readl(reg);
+       tmp &= ~(mask << shift);
+       tmp |= (mask & muxval) << shift;
+       writel(tmp, reg);
+}
+
+void sg_set_iectrl(unsigned int pin)
+{
+       unsigned int bit = pin % 32;
+       unsigned long reg = SG_IECTRL + pin / 32 * 4;
+       u32 tmp;
+
+       tmp = readl(reg);
+       tmp |= 1 << bit;
+       writel(tmp, reg);
+}
+#endif
+
 void _debug_uart_init(void)
 {
+#ifdef CONFIG_SPL_BUILD
        void __iomem *base = (void __iomem *)CONFIG_DEBUG_UART_BASE;
        unsigned int divisor;
 
@@ -62,12 +91,6 @@ void _debug_uart_init(void)
                divisor = uniphier_ld6b_debug_uart_init();
                break;
 #endif
-#if defined(CONFIG_ARCH_UNIPHIER_LD11) || defined(CONFIG_ARCH_UNIPHIER_LD20)
-       case UNIPHIER_LD11_ID:
-       case UNIPHIER_LD20_ID:
-               divisor = uniphier_ld20_debug_uart_init();
-               break;
-#endif
        default:
                return;
        }
@@ -75,5 +98,6 @@ void _debug_uart_init(void)
        writel(UART_LCR_WLEN8 << 8, base + UNIPHIER_UART_LCR_MCR);
 
        writel(divisor, base + UNIPHIER_UART_LDR);
+#endif
 }
 DEBUG_UART_FUNCS
index 4cbd2f0..f4e98c0 100644 (file)
@@ -12,7 +12,9 @@ unsigned int uniphier_sld8_debug_uart_init(void);
 unsigned int uniphier_pro5_debug_uart_init(void);
 unsigned int uniphier_pxs2_debug_uart_init(void);
 unsigned int uniphier_ld6b_debug_uart_init(void);
-unsigned int uniphier_ld11_debug_uart_init(void);
-unsigned int uniphier_ld20_debug_uart_init(void);
+
+void sg_set_pinsel(unsigned int pin, unsigned int muxval,
+                  unsigned int mux_bits, unsigned int reg_stride);
+void sg_set_iectrl(unsigned int pin);
 
 #endif /* _MACH_DEBUG_UART_H */
index 7e7c1d9..fa4b3e3 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <linux/errno.h>
+#include <linux/io.h>
 #include <linux/kernel.h>
 #include <linux/printk.h>
 #include <linux/sizes.h>
index b105335..28de19c 100644 (file)
 
 #define SC_BASE_ADDR                   0x61840000
 
-#define SC_DPLLOSCCTRL                 (SC_BASE_ADDR | 0x1110)
-#define SC_DPLLOSCCTRL_DPLLST          (0x1 << 1)
-#define SC_DPLLOSCCTRL_DPLLEN          (0x1 << 0)
-
 #define SC_DPLLCTRL                    (SC_BASE_ADDR | 0x1200)
 #define SC_DPLLCTRL_SSC_EN             (0x1 << 31)
 #define SC_DPLLCTRL_FOUTMODE_MASK        (0xf << 16)
index 0497655..39ffed5 100644 (file)
 #define SG_PINMON0_CLK_MODE_AXOSEL_20480KHZ    (0x2 << 16)
 #define SG_PINMON0_CLK_MODE_AXOSEL_25000KHZ_A  (0x3 << 16)
 
-#ifdef __ASSEMBLY__
-
-       .macro  sg_set_pinsel, pin, muxval, mux_bits, reg_stride, ra, rd
-       ldr     \ra, =(SG_PINCTRL_BASE + \pin * \mux_bits / 32 * \reg_stride)
-       ldr     \rd, [\ra]
-       and     \rd, \rd, #~(((1 << \mux_bits) - 1) << (\pin * \mux_bits % 32))
-       orr     \rd, \rd, #(\muxval << (\pin * \mux_bits % 32))
-       str     \rd, [\ra]
-       .endm
-
-#else
-
-#include <linux/types.h>
-#include <linux/io.h>
-
-static inline void sg_set_pinsel(unsigned pin, unsigned muxval,
-                                unsigned mux_bits, unsigned reg_stride)
-{
-       unsigned shift = pin * mux_bits % 32;
-       unsigned long reg = SG_PINCTRL_BASE + pin * mux_bits / 32 * reg_stride;
-       u32 mask = (1U << mux_bits) - 1;
-       u32 tmp;
-
-       tmp = readl(reg);
-       tmp &= ~(mask << shift);
-       tmp |= (mask & muxval) << shift;
-       writel(tmp, reg);
-}
-
-static inline void sg_set_iectrl(unsigned pin)
-{
-       unsigned bit = pin % 32;
-       unsigned long reg = SG_IECTRL + pin / 32 * 4;
-       u32 tmp;
-
-       tmp = readl(reg);
-       tmp |= 1 << bit;
-       writel(tmp, reg);
-}
-
-static inline void sg_set_iectrl_range(unsigned min, unsigned max)
-{
-       int i;
-
-       for (i = min; i <= max; i++)
-               sg_set_iectrl(i);
-}
-
-#endif /* __ASSEMBLY__ */
-
 #endif /* UNIPHIER_SG_REGS_H */
index 5cb9bdf..e3e7945 100644 (file)
@@ -84,13 +84,13 @@ config ARCH_MTMIPS
        select DM_SERIAL
        imply DM_SPI
        imply DM_SPI_FLASH
+       select LAST_STAGE_INIT
        select MIPS_TUNE_24KC
        select OF_CONTROL
        select ROM_EXCEPTION_VECTORS
        select SUPPORTS_CPU_MIPS32_R1
        select SUPPORTS_CPU_MIPS32_R2
        select SUPPORTS_LITTLE_ENDIAN
-       select SYS_MALLOC_CLEAR_ON_INIT
        select SYSRESET
 
 config ARCH_JZ47XX
index b0a6397..7afc2c5 100644 (file)
@@ -68,3 +68,29 @@ int print_cpuinfo(void)
 
        return 0;
 }
+
+int last_stage_init(void)
+{
+       void *src, *dst;
+
+       src = malloc(SZ_64K);
+       dst = malloc(SZ_64K);
+       if (!src || !dst) {
+               printf("Can't allocate buffer for cache cleanup copy!\n");
+               return 0;
+       }
+
+       /*
+        * It has been noticed, that sometimes the d-cache is not in a
+        * "clean-state" when U-Boot is running on MT7688. This was
+        * detected when using the ethernet driver (which uses d-cache)
+        * and a TFTP command does not complete. Copying an area of 64KiB
+        * in DDR at a very late bootup time in U-Boot, directly before
+        * calling into the prompt, seems to fix this issue.
+        */
+       memcpy(dst, src, SZ_64K);
+       free(src);
+       free(dst);
+
+       return 0;
+}
index 8b2d645..c328258 100644 (file)
                sandbox,silent; /* Don't emit sounds while testing */
        };
 
+       nop-test_0 {
+               compatible = "sandbox,nop_sandbox1";
+               nop-test_1 {
+                       compatible = "sandbox,nop_sandbox2";
+                       bind = "True";
+               };
+               nop-test_2 {
+                       compatible = "sandbox,nop_sandbox2";
+                       bind = "False";
+               };
+       };
+
        misc-test {
                compatible = "sandbox,misc_sandbox";
        };
index a3bd167..d2b7ede 100644 (file)
@@ -10,7 +10,6 @@ config INTEL_TANGIER
        imply MMC_SDHCI
        imply MMC_SDHCI_SDMA
        imply MMC_SDHCI_TANGIER
-       imply TANGIER_WATCHDOG
        imply USB
        imply USB_DWC3
 
index e8564bb..c048765 100644 (file)
                reg = <0xff009000 0x1000>;
        };
 
+       watchdog: wdt@0 {
+               compatible = "intel,tangier-wdt";
+       };
+
        reset {
                compatible = "intel,reset-tangier";
                u-boot,dm-pre-reloc;
index ac85278..0481f45 100644 (file)
@@ -18,10 +18,7 @@ __weak ulong board_get_usable_ram_top(ulong total_size)
 
 int init_cache_f_r(void)
 {
-#if (CONFIG_IS_ENABLED(X86_32BIT_INIT) || \
-     (!defined(CONFIG_SPL_BUILD) && \
-      !CONFIG_IS_ENABLED(CONFIG_X86_RUN_64BIT))) && \
-    !defined(CONFIG_HAVE_FSP)
+#if CONFIG_IS_ENABLED(X86_32BIT_INIT) && !defined(CONFIG_HAVE_FSP)
        int ret;
 
        ret = mtrr_commit(false);
index 96fe92d..c20f056 100644 (file)
@@ -2,6 +2,7 @@ P200
 M:     Beniamino Galvani <b.galvani@gmail.com>
 M:     Neil Armstrong <narmstrong@baylibre.com>
 S:     Maintained
+L:     u-boot-amlogic@groups.io
 F:     board/amlogic/p200/
 F:     configs/nanopi-k2_defconfig
 F:     configs/odroid-c2_defconfig
index 3e84a8e..f84984d 100644 (file)
@@ -1,5 +1,6 @@
 P201
 M:     Neil Armstrong <narmstrong@baylibre.com>
 S:     Maintained
+L:     u-boot-amlogic@groups.io
 F:     board/amlogic/p201/
 F:     configs/p201_defconfig
index 74ad371..8848df0 100644 (file)
@@ -1,6 +1,7 @@
 P212
 M:     Neil Armstrong <narmstrong@baylibre.com>
 S:     Maintained
+L:     u-boot-amlogic@groups.io
 F:     board/amlogic/p212/
 F:     include/configs/p212.h
 F:     configs/khadas-vim_defconfig
index be86386..d3c5a46 100644 (file)
@@ -1,6 +1,7 @@
 Q200
 M:     Neil Armstrong <narmstrong@baylibre.com>
 S:     Maintained
+L:     u-boot-amlogic@groups.io
 F:     board/amlogic/q200/
 F:     include/configs/q200.h
 F:     configs/khadas-vim2_defconfig
index 9ca9836..da90cf9 100644 (file)
@@ -1,6 +1,7 @@
 S400
 M:     Neil Armstrong <narmstrong@baylibre.com>
 S:     Maintained
+L:     u-boot-amlogic@groups.io
 F:     board/amlogic/s400/
 F:     include/configs/s400.h
 F:     configs/s400_defconfig
index baf3813..5ae7f5e 100644 (file)
@@ -1,5 +1,6 @@
 U200
 M:     Neil Armstrong <narmstrong@baylibre.com>
 S:     Maintained
+L:     u-boot-amlogic@groups.io
 F:     board/amlogic/u200/
 F:     configs/u200_defconfig
index fc300a4..20c3b8c 100644 (file)
@@ -29,7 +29,7 @@ void at91_pda_detect(void)
 
        ret = w1_get_bus(AT91_PDA_EEPROM_DEFAULT_BUS, &bus);
        if (ret)
-               return;
+               goto pda_detect_err;
 
        for (device_find_first_child(bus, &dev);
             dev;
@@ -41,7 +41,7 @@ void at91_pda_detect(void)
                        ret = w1_eeprom_read_buf(dev, AT91_PDA_EEPROM_ID_OFFSET,
                                                 (u8 *)buf, AT91_PDA_EEPROM_ID_LENGTH);
                        if (ret)
-                               return;
+                               goto pda_detect_err;
                        break;
                }
        }
@@ -61,6 +61,8 @@ void at91_pda_detect(void)
                printf("PDA TM5000 detected\n");
                break;
        }
+
+pda_detect_err:
        env_set("pda", (const char *)buf);
 }
 #else
index 35e9b02..f2227f6 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <dm.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/sys_proto.h>
@@ -28,6 +29,7 @@
 #include <spl.h>
 #include <splash.h>
 #include <usb/ehci-ci.h>
+#include <video_console.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -80,33 +82,6 @@ static void setup_iomux_uart(void)
        imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
 }
 
-#ifdef CONFIG_USB_EHCI_MX5
-int board_ehci_hcd_init(int port)
-{
-       if (port == 0) {
-               /* USB OTG PWRON */
-               imx_iomux_v3_setup_pad(NEW_PAD_CTRL(MX53_PAD_GPIO_4__GPIO1_4,
-                                                   PAD_CTL_PKE |
-                                                   PAD_CTL_DSE_HIGH));
-               gpio_direction_output(IMX_GPIO_NR(1, 4), 0);
-
-               /* USB OTG Over Current */
-               imx_iomux_v3_setup_pad(MX53_PAD_GPIO_18__GPIO7_13);
-       } else if (port == 1) {
-               /* USB Host PWRON */
-               imx_iomux_v3_setup_pad(NEW_PAD_CTRL(MX53_PAD_GPIO_2__GPIO1_2,
-                                                   PAD_CTL_PKE |
-                                                   PAD_CTL_DSE_HIGH));
-               gpio_direction_output(IMX_GPIO_NR(1, 2), 0);
-
-               /* USB Host Over Current */
-               imx_iomux_v3_setup_pad(MX53_PAD_GPIO_3__USBOH3_USBH1_OC);
-       }
-
-       return 0;
-}
-#endif
-
 static void setup_iomux_fec(void)
 {
        static const iomux_v3_cfg_t fec_pads[] = {
@@ -187,7 +162,6 @@ int board_mmc_init(bd_t *bis)
 }
 #endif
 
-#ifdef CONFIG_VIDEO
 static void enable_lvds_clock(struct display_info_t const *dev, const u8 hclk)
 {
        static struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)MXC_CCM_BASE;
@@ -215,6 +189,8 @@ static void enable_lvds_clock(struct display_info_t const *dev, const u8 hclk)
 
 static void enable_lvds_etm0430g0dh6(struct display_info_t const *dev)
 {
+       gpio_request(IMX_GPIO_NR(6, 0), "LCD");
+
        /* For ETM0430G0DH6 model, this must be enabled before the clock. */
        gpio_direction_output(IMX_GPIO_NR(6, 0), 1);
 
@@ -227,6 +203,8 @@ static void enable_lvds_etm0430g0dh6(struct display_info_t const *dev)
 
 static void enable_lvds_etm0700g0dh6(struct display_info_t const *dev)
 {
+       gpio_request(IMX_GPIO_NR(6, 0), "LCD");
+
        /*
         * Set LVDS clock to 33.28 MHz for the display. The PLL4 is set to
         * 233 MHz, divided by 7 by setting CCM_CSCMR2 LDB_DI0_IPU_DIV=1 .
@@ -330,7 +308,6 @@ struct display_info_t const displays[] = {
 };
 
 size_t display_count = ARRAY_SIZE(displays);
-#endif
 
 #ifdef CONFIG_SPLASH_SCREEN
 static struct splash_location default_splash_locations[] = {
@@ -349,6 +326,50 @@ int splash_screen_prepare(void)
 }
 #endif
 
+int board_late_init(void)
+{
+#if defined(CONFIG_VIDEO_IPUV3)
+       struct udevice *dev;
+       int xpos, ypos, ret;
+       char *s;
+       void *dst;
+       ulong addr, len;
+
+       splash_get_pos(&xpos, &ypos);
+
+       s = env_get("splashimage");
+       if (!s)
+               return 0;
+
+       addr = simple_strtoul(s, NULL, 16);
+       dst = malloc(CONFIG_SYS_VIDEO_LOGO_MAX_SIZE);
+       if (!dst)
+               return -ENOMEM;
+
+       ret = splash_screen_prepare();
+       if (ret < 0)
+               return ret;
+
+       len = CONFIG_SYS_VIDEO_LOGO_MAX_SIZE;
+       ret = gunzip(dst + 2, CONFIG_SYS_VIDEO_LOGO_MAX_SIZE - 2,
+                    (uchar *)addr, &len);
+       if (ret) {
+               printf("Error: no valid bmp or bmp.gz image at %lx\n", addr);
+               free(dst);
+               return ret;
+       }
+
+       ret = uclass_get_device(UCLASS_VIDEO, 0, &dev);
+       if (ret)
+               return ret;
+
+       ret = video_bmp_display(dev, (ulong)dst + 2, xpos, ypos, true);
+       if (ret)
+               return ret;
+#endif
+       return 0;
+}
+
 #define I2C_PAD_CTRL   (PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | \
                         PAD_CTL_PUS_100K_UP | PAD_CTL_ODE)
 
@@ -424,6 +445,8 @@ static void m53_set_clock(void)
        const u32 dramclk = 400;
        u32 cpuclk;
 
+       gpio_request(IMX_GPIO_NR(4, 0), "CPUCLK");
+
        imx_iomux_v3_setup_pad(NEW_PAD_CTRL(MX53_PAD_GPIO_10__GPIO4_0,
                                            PAD_CTL_DSE_HIGH | PAD_CTL_PKE));
        gpio_direction_input(IMX_GPIO_NR(4, 0));
index 2ee6e46..c661d2e 100644 (file)
@@ -4,3 +4,9 @@ S:      Maintained
 F:      board/rockchip/evb_rk3328
 F:      include/configs/evb_rk3328.h
 F:      configs/evb-rk3328_defconfig
+
+ROCK64-RK3328
+M:      Matwey V. Kornilov <matwey.kornilov@gmail.com>
+S:      Maintained
+F:      configs/rock64-rk3328_defconfig
+F:      arch/arm/dts/rk3328-rock64-u-boot.dtsi
index bf2ad98..eb1b832 100644 (file)
@@ -6,46 +6,14 @@
 #include <common.h>
 #include <dm.h>
 #include <dm/pinctrl.h>
-#include <dm/uclass-internal.h>
 #include <asm/arch-rockchip/periph.h>
 #include <power/regulator.h>
-#include <spl.h>
 
 int board_init(void)
 {
-       struct udevice *pinctrl, *regulator;
+       struct udevice *regulator;
        int ret;
 
-       /*
-        * The PWM do not have decicated interrupt number in dts and can
-        * not get periph_id by pinctrl framework, so let's init them here.
-        * The PWM2 and PWM3 are for pwm regulater.
-        */
-       ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
-       if (ret) {
-               debug("%s: Cannot find pinctrl device\n", __func__);
-               goto out;
-       }
-
-       /* Enable pwm0 for panel backlight */
-       ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_PWM0);
-       if (ret) {
-               debug("%s PWM0 pinctrl init fail! (ret=%d)\n", __func__, ret);
-               goto out;
-       }
-
-       ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_PWM2);
-       if (ret) {
-               debug("%s PWM2 pinctrl init fail!\n", __func__);
-               goto out;
-       }
-
-       ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_PWM3);
-       if (ret) {
-               debug("%s PWM3 pinctrl init fail!\n", __func__);
-               goto out;
-       }
-
        ret = regulators_enable_boot_on(false);
        if (ret)
                debug("%s: Cannot enable boot on regulator\n", __func__);
@@ -65,30 +33,3 @@ int board_init(void)
 out:
        return 0;
 }
-
-void spl_board_init(void)
-{
-       struct udevice *pinctrl;
-       int ret;
-
-       ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
-       if (ret) {
-               debug("%s: Cannot find pinctrl device\n", __func__);
-               goto err;
-       }
-
-       /* Enable debug UART */
-       ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_UART_DBG);
-       if (ret) {
-               debug("%s: Failed to set up console UART\n", __func__);
-               goto err;
-       }
-
-       preloader_console_init();
-       return;
-err:
-       printf("%s: Error %d\n", __func__, ret);
-
-       /* No way to report error here */
-       hang();
-}
index f21d830..6aa0d25 100644 (file)
@@ -11,7 +11,7 @@ $ make mrproper
 $ make pico-imx7d_defconfig
 $ make
 
-This generates the SPL and u-boot.img binaries.
+This generates the SPL and u-boot-dtb.img binaries.
 
 1. Loading U-Boot via USB Serial Download Protocol
 
@@ -32,15 +32,15 @@ to use an externally powered USB hub between the board and the host computer.
 
 Open a terminal program such as minicom.
 
-Copy SPL and u-boot.img to the imx_usb_loader folder.
+Copy SPL and u-boot-dtb.img to the imx_usb_loader folder.
 
 Load the SPL binary via USB:
 
 $ sudo ./imx_usb SPL
 
-Load the u-boot.img binary via USB:
+Load the u-boot-dtb.img binary via USB:
 
-$ sudo ./imx_usb u-boot.img
+$ sudo ./imx_usb u-boot-dtb.img
 
 Then U-Boot starts and its messages appear in the console program.
 
@@ -55,11 +55,11 @@ Run the DFU agent so we can flash the new images using dfu-util tool:
 
 => dfu 0 mmc 0
 
-Flash SPL and u-boot.img into the eMMC running the following commands on a PC:
+Flash SPL and u-boot-dtb.img into the eMMC running the following commands on a PC:
 
 $ sudo dfu-util -D SPL -a spl
 
-$ sudo dfu-util -D u-boot.img -a u-boot
+$ sudo dfu-util -D u-boot-dtb.img -a u-boot
 
 Remove power from the pico board.
 
index f67dfb4..9b31b0b 100644 (file)
@@ -60,7 +60,7 @@ Creating a SPL image for SD-Card/eMMC
 Creating a SPL image for SPI-NOR
   > tools/mkimage -n rk3399 -T rkspi -d spl/u-boot-spl.bin spl_nor.img
 Create the FIT image containing U-Boot proper, ATF, M0 Firmware, devicetree
-  > make CROSS_COMPILE=aarch64-linux-gnu- u-boot.itb
+  > make CROSS_COMPILE=aarch64-linux-gnu-
 
 Flash the image
 ===============
diff --git a/board/theobroma-systems/puma_rk3399/fit_spl_atf.its b/board/theobroma-systems/puma_rk3399/fit_spl_atf.its
deleted file mode 100644 (file)
index 530f059..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ OR X11 */
-/*
- * Copyright (C) 2017 Theobroma Systems Design und Consulting GmbH
- *
- * Minimal dts for a SPL FIT image payload.
- */
-
-/dts-v1/;
-
-/ {
-       description = "FIT image with U-Boot proper, ATF bl31, M0 Firmware, DTB";
-       #address-cells = <1>;
-
-       images {
-               uboot {
-                       description = "U-Boot (64-bit)";
-                       data = /incbin/("../../../u-boot-nodtb.bin");
-                       type = "standalone";
-                       os = "U-Boot";
-                       arch = "arm64";
-                       compression = "none";
-                       load = <0x00200000>;
-               };
-               atf {
-                       description = "ARM Trusted Firmware";
-                       data = /incbin/("../../../bl31-rk3399.bin");
-                       type = "firmware";
-                       arch = "arm64";
-                       os = "arm-trusted-firmware";
-                       compression = "none";
-                       load = <0x1000>;
-                       entry = <0x1000>;
-               };
-               pmu {
-                       description = "Cortex-M0 firmware";
-                       data = /incbin/("../../../rk3399m0.bin");
-                       type = "pmu-firmware";
-                       compression = "none";
-                       load = <0x180000>;
-                };
-               fdt {
-                       description = "RK3399-Q7 (Puma) flat device-tree";
-                       data = /incbin/("../../../u-boot.dtb");
-                       type = "flat_dt";
-                       compression = "none";
-               };
-       };
-
-       configurations {
-               default = "conf";
-               conf {
-                       description = "Theobroma Systems RK3399-Q7 (Puma) SoM";
-                       firmware = "atf";
-                       loadables = "uboot", "pmu";
-                       fdt = "fdt";
-               };
-       };
-};
diff --git a/board/theobroma-systems/puma_rk3399/fit_spl_atf.sh b/board/theobroma-systems/puma_rk3399/fit_spl_atf.sh
new file mode 100755 (executable)
index 0000000..420e7da
--- /dev/null
@@ -0,0 +1,94 @@
+#!/bin/sh
+#
+# SPDX-License-Identifier:      GPL-2.0+
+#
+# Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com>
+#
+# Based on the board/sunxi/mksunxi_fit_atf.sh
+#
+# Script to generate FIT image source for 64-bit puma boards with
+# U-Boot proper, ATF, PMU firmware and devicetree.
+#
+# usage: $0 <dt_name> [<dt_name> [<dt_name] ...]
+
+[ -z "$BL31" ] && BL31="bl31.bin"
+
+if [ ! -f $BL31 ]; then
+       echo "WARNING: BL31 file $BL31 NOT found, resulting binary is non-functional" >&2
+       echo "Please read Building section in doc/README.rockchip" >&2
+       BL31=/dev/null
+fi
+
+[ -z "$PMUM0" ] && PMUM0="rk3399m0.bin"
+
+if [ ! -f $PMUM0 ]; then
+       echo "WARNING: PMUM0 file $PMUM0 NOT found, resulting binary is non-functional" >&2
+       echo "Please read Building section in doc/README.rockchip" >&2
+       PMUM0=/dev/null
+fi
+
+cat << __HEADER_EOF
+/* SPDX-License-Identifier: GPL-2.0+ OR X11 */
+/*
+ * Copyright (C) 2017 Theobroma Systems Design und Consulting GmbH
+ *
+ * Minimal dts for a SPL FIT image payload.
+ */
+
+/dts-v1/;
+
+/ {
+       description = "FIT image with U-Boot proper, ATF bl31, M0 Firmware, DTB";
+       #address-cells = <1>;
+
+       images {
+               uboot {
+                       description = "U-Boot (64-bit)";
+                       data = /incbin/("u-boot-nodtb.bin");
+                       type = "standalone";
+                       arch = "arm64";
+                       compression = "none";
+                       load = <0x4a000000>;
+               };
+               atf {
+                       description = "ARM Trusted Firmware";
+                       data = /incbin/("$BL31");
+                       type = "firmware";
+                       arch = "arm64";
+                       os = "arm-trusted-firmware";
+                       compression = "none";
+                       load = <0x1000>;
+                       entry = <0x1000>;
+               };
+               pmu {
+                       description = "Cortex-M0 firmware";
+                       data = /incbin/("$PMUM0");
+                       type = "pmu-firmware";
+                       compression = "none";
+                       load = <0x180000>;
+                };
+               fdt {
+                       description = "RK3399-Q7 (Puma) flat device-tree";
+                       data = /incbin/("u-boot.dtb");
+                       type = "flat_dt";
+                       compression = "none";
+               };
+__HEADER_EOF
+
+cat << __CONF_HEADER_EOF
+       };
+
+       configurations {
+               default = "conf";
+               conf {
+                       description = "Theobroma Systems RK3399-Q7 (Puma) SoM";
+                       firmware = "atf";
+                       loadables = "uboot", "pmu";
+                       fdt = "fdt";
+               };
+__CONF_HEADER_EOF
+
+cat << __ITS_EOF
+       };
+};
+__ITS_EOF
index c6b509c..251cd2d 100644 (file)
 #include <dm/pinctrl.h>
 #include <dm/uclass-internal.h>
 #include <asm/io.h>
-#include <asm/gpio.h>
 #include <asm/setup.h>
 #include <asm/arch-rockchip/clock.h>
-#include <asm/arch-rockchip/cru_rk3399.h>
 #include <asm/arch-rockchip/hardware.h>
 #include <asm/arch-rockchip/grf_rk3399.h>
 #include <asm/arch-rockchip/periph.h>
@@ -38,62 +36,6 @@ int board_init(void)
        return 0;
 }
 
-static void rk3399_force_power_on_reset(void)
-{
-       ofnode node;
-       struct gpio_desc sysreset_gpio;
-
-       debug("%s: trying to force a power-on reset\n", __func__);
-
-       node = ofnode_path("/config");
-       if (!ofnode_valid(node)) {
-               debug("%s: no /config node?\n", __func__);
-               return;
-       }
-
-       if (gpio_request_by_name_nodev(node, "sysreset-gpio", 0,
-                                      &sysreset_gpio, GPIOD_IS_OUT)) {
-               debug("%s: could not find a /config/sysreset-gpio\n", __func__);
-               return;
-       }
-
-       dm_gpio_set_value(&sysreset_gpio, 1);
-}
-
-void spl_board_init(void)
-{
-       int  ret;
-       struct rk3399_cru *cru = rockchip_get_cru();
-
-       /*
-        * The RK3399 resets only 'almost all logic' (see also in the TRM
-        * "3.9.4 Global software reset"), when issuing a software reset.
-        * This may cause issues during boot-up for some configurations of
-        * the application software stack.
-        *
-        * To work around this, we test whether the last reset reason was
-        * a power-on reset and (if not) issue an overtemp-reset to reset
-        * the entire module.
-        *
-        * While this was previously fixed by modifying the various places
-        * that could generate a software reset (e.g. U-Boot's sysreset
-        * driver, the ATF or Linux), we now have it here to ensure that
-        * we no longer have to track this through the various components.
-        */
-       if (cru->glb_rst_st != 0)
-               rk3399_force_power_on_reset();
-
-       /*
-        * Turning the eMMC and SPI back on (if disabled via the Qseven
-        * BIOS_ENABLE) signal is done through a always-on regulator).
-        */
-       ret = regulators_enable_boot_on(false);
-       if (ret)
-               debug("%s: Cannot enable boot on regulator\n", __func__);
-
-       preloader_console_init();
-}
-
 static void setup_macaddr(void)
 {
 #if CONFIG_IS_ENABLED(CMD_NET)
index d143990..c5c675c 100644 (file)
@@ -61,7 +61,6 @@ Compile the U-Boot
   > export CROSS_COMPILE=aarch64-linux-gnu-
   > make rock960-rk3399_defconfig
   > make
-  > make u-boot.itb
 
 Compile the rkdeveloptool
 =========================
index 0f5ef3a..2eb7120 100644 (file)
@@ -5,11 +5,7 @@
 
 #include <common.h>
 #include <dm.h>
-#include <dm/pinctrl.h>
-#include <dm/uclass-internal.h>
-#include <asm/arch-rockchip/periph.h>
 #include <power/regulator.h>
-#include <spl.h>
 
 int board_init(void)
 {
@@ -21,30 +17,3 @@ int board_init(void)
 
        return 0;
 }
-
-void spl_board_init(void)
-{
-       struct udevice *pinctrl;
-       int ret;
-
-       ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
-       if (ret) {
-               debug("%s: Cannot find pinctrl device\n", __func__);
-               goto err;
-       }
-
-       /* Enable debug UART */
-       ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_UART_DBG);
-       if (ret) {
-               debug("%s: Failed to set up console UART\n", __func__);
-               goto err;
-       }
-
-       preloader_console_init();
-       return;
-err:
-       printf("%s: Error %d\n", __func__, ret);
-
-       /* No way to report error here */
-       hang();
-}
index e5170bc..f84f205 100644 (file)
@@ -29,7 +29,7 @@ $ sudo dd if=SPL of=/dev/mmcblk0 bs=1k seek=1; sync
 
 - Flash the u-boot.img image into the SD card:
 
-sudo dd if=u-boot.img of=/dev/mmcblk0 bs=1k seek=69; sync
+sudo dd if=u-boot-dtb.img of=/dev/mmcblk0 bs=1k seek=69; sync
 
 - Insert the SD card into the slot located in the bottom of the board (same side
 as the mx6 processor)
index 9d7a94f..74d7a17 100644 (file)
@@ -500,3 +500,21 @@ int checkboard(void)
 
        return 0;
 }
+
+#ifdef CONFIG_SPL_LOAD_FIT
+int board_fit_config_name_match(const char *name)
+{
+       if (is_mx6dq()) {
+               if (!strcmp(name, "imx6q-wandboard-revb1"))
+                       return 0;
+       } else if (is_mx6dqp()) {
+               if (!strcmp(name, "imx6qp-wandboard-revd1"))
+                       return 0;
+       } else if (is_mx6dl() || is_mx6solo()) {
+               if (!strcmp(name, "imx6dl-wandboard-revb1"))
+                       return 0;
+       }
+
+       return -EINVAL;
+}
+#endif
index 150e8cd..df24021 100644 (file)
@@ -678,9 +678,6 @@ static init_fnc_t init_sequence_r[] = {
 #ifdef CONFIG_DM
        initr_dm,
 #endif
-#if defined(CONFIG_WDT)
-       initr_watchdog,
-#endif
 #if defined(CONFIG_ARM) || defined(CONFIG_NDS32) || defined(CONFIG_RISCV) || \
        defined(CONFIG_SANDBOX)
        board_init,     /* Setup chipselects */
@@ -700,6 +697,9 @@ static init_fnc_t init_sequence_r[] = {
        stdio_init_tables,
        initr_serial,
        initr_announce,
+#if defined(CONFIG_WDT)
+       initr_watchdog,
+#endif
        INIT_FUNC_WATCHDOG_RESET
 #ifdef CONFIG_NEEDS_MANUAL_RELOC
        initr_manual_reloc_cmdtable,
index cddab6a..4715f9d 100644 (file)
@@ -45,6 +45,7 @@ static struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl33_entry)
        SET_PARAM_HEAD(bl2_to_bl31_params, ATF_PARAM_BL31, ATF_VERSION_1, 0);
 
        /* Fill BL31 related information */
+       bl2_to_bl31_params->bl31_image_info = &bl31_params_mem.bl31_image_info;
        SET_PARAM_HEAD(bl2_to_bl31_params->bl31_image_info,
                       ATF_PARAM_IMAGE_BINARY, ATF_VERSION_1, 0);
 
index 7fc4404..806bf13 100644 (file)
@@ -29,10 +29,14 @@ static int spl_sdp_load_image(struct spl_image_info *spl_image,
                return -ENODEV;
        }
 
-       /* This command typically does not return but jumps to an image */
-       sdp_handle(controller_index);
-       pr_err("SDP ended\n");
+       /*
+        * This command either loads a legacy image, jumps and never returns,
+        * or it loads a FIT image and returns it to be handled by the SPL
+        * code.
+        */
+       ret = spl_sdp_handle(controller_index, spl_image);
+       debug("SDP ended\n");
 
-       return -EINVAL;
+       return ret;
 }
 SPL_LOAD_IMAGE_METHOD("USB SDP", 0, BOOT_DEVICE_BOARD, spl_sdp_load_image);
index 840c87a..4687544 100644 (file)
@@ -39,5 +39,7 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x8087
 CONFIG_USB_GADGET_PRODUCT_NUM=0x0a99
 CONFIG_USB_GADGET_DOWNLOAD=y
 # CONFIG_USB_HOST_ETHER is not set
+CONFIG_WDT=y
+CONFIG_WDT_TANGIER=y
 CONFIG_FAT_WRITE=y
 CONFIG_SHA1=y
index aff9c32..92d6817 100644 (file)
@@ -1,7 +1,10 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
+CONFIG_SPL_LIBCOMMON_SUPPORT=y
+CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_ROCKCHIP_RK3328=y
+CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BASE=0xFF130000
 CONFIG_DEBUG_UART_CLOCK=24000000
@@ -19,11 +22,15 @@ CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TIME=y
 CONFIG_DEFAULT_DEVICE_TREE="rk3328-evb"
+CONFIG_SPL_OF_CONTROL=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_REGMAP=y
+CONFIG_SPL_REGMAP=y
 CONFIG_SYSCON=y
+CONFIG_SPL_SYSCON=y
 CONFIG_CLK=y
+CONFIG_SPL_CLK=y
 CONFIG_FASTBOOT_BUF_ADDR=0x800800
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=1
index 9622cb7..3a5fa26 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_SYS_TEXT_BASE=0x71000000
 CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_SYS_MALLOC_F_LEN=0x8000
 CONFIG_TARGET_M53MENLO=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=2
@@ -17,9 +18,8 @@ CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/menlo/m53menlo/imximage.cfg"
 CONFIG_BOOTDELAY=1
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttymxc0,115200"
-# CONFIG_CONSOLE_MUX is not set
-CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_VERSION_VARIABLE=y
+CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_TEXT_BASE=0x70008000
 CONFIG_SPL_BOARD_INIT=y
 CONFIG_SPL_NAND_SUPPORT=y
@@ -27,11 +27,14 @@ CONFIG_SPL_WATCHDOG_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_DM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_FUSE=y
+CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND_TRIMFFS=y
+# CONFIG_CMD_PINMUX is not set
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
@@ -48,27 +51,37 @@ CONFIG_CMD_MTDPARTS=y
 CONFIG_MTDIDS_DEFAULT="nand0=mxc_nand"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=mxc_nand:1m(u-boot),512k(env1),512k(env2),-(ubi)"
 CONFIG_CMD_UBI=y
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="imx53-m53menlo"
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_DM=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_BOOTLIMIT=3
 CONFIG_SYS_BOOTCOUNT_MAGIC=0x0B01C041
+CONFIG_DM_GPIO=y
+CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC_IMX=y
 CONFIG_NAND=y
 CONFIG_NAND_MXC=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
 CONFIG_PHY_MICREL_KSZ8XXX=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_IMX5=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_RTC_M41T62=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
 CONFIG_USB_EHCI_MX5=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_MCS7830=y
 CONFIG_USB_ETHER_SMSC95XX=y
+CONFIG_DM_VIDEO=y
+CONFIG_SYS_WHITE_ON_BLACK=y
 CONFIG_VIDEO_IPUV3=y
-CONFIG_VIDEO=y
-# CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_IMX_WATCHDOG=y
 CONFIG_FAT_WRITE=y
-CONFIG_OF_LIBFDT=y
index dfde654..62eaaee 100644 (file)
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_TARGET_POPLAR=y
 CONFIG_SYS_TEXT_BASE=0x37000000
+CONFIG_SYS_MALLOC_F_LEN=0x4000
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_IDENT_STRING="poplar"
 CONFIG_DISTRO_DEFAULTS=y
index 03f0bfd..5cb2273 100644 (file)
@@ -15,13 +15,12 @@ CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_DEBUG_UART=y
-CONFIG_SPL_FIT_SOURCE="board/theobroma-systems/puma_rk3399/fit_spl_atf.its"
+CONFIG_SPL_FIT_GENERATOR="board/theobroma-systems/puma_rk3399/fit_spl_atf.sh"
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-puma-haikou.dtb"
 CONFIG_MISC_INIT_R=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_TEXT_BASE=0xff8c2000
-CONFIG_SPL_BOARD_INIT=y
 # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
 # CONFIG_SPL_LEGACY_IMAGE_SUPPORT is not set
 CONFIG_SPL_STACK_R=y
diff --git a/configs/rock64-rk3328_defconfig b/configs/rock64-rk3328_defconfig
new file mode 100644 (file)
index 0000000..6529ded
--- /dev/null
@@ -0,0 +1,91 @@
+CONFIG_SMBIOS_MANUFACTURER="pine64"
+CONFIG_SMBIOS_PRODUCT_NAME="rock64_rk3328"
+CONFIG_ARM=y
+CONFIG_ARCH_ROCKCHIP=y
+CONFIG_SPL_LIBCOMMON_SUPPORT=y
+CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_SYS_TEXT_BASE=0x00200000
+CONFIG_ROCKCHIP_RK3328=y
+CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x40000
+CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
+CONFIG_SPL_STACK_R_ADDR=0x600000
+CONFIG_DEBUG_UART_BASE=0xFF130000
+CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_DEBUG_UART=y
+CONFIG_NR_DRAM_BANKS=1
+# CONFIG_ANDROID_BOOT_IMAGE is not set
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_SPL_LOAD_FIT=y
+CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-rockchip/make_fit_atf.py"
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3328-rock64.dtb"
+# CONFIG_DISPLAY_CPUINFO is not set
+CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_SPL_STACK_R=y
+CONFIG_SPL_ATF=y
+CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y
+CONFIG_FASTBOOT_BUF_ADDR=0x800800
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=1
+CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_GPT=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_SF=y
+CONFIG_CMD_USB=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_TIME=y
+CONFIG_DEFAULT_DEVICE_TREE="rk3328-rock64"
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_REGMAP=y
+CONFIG_SPL_REGMAP=y
+CONFIG_SYSCON=y
+CONFIG_SPL_SYSCON=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
+CONFIG_ROCKCHIP_GPIO=y
+CONFIG_SYS_I2C_ROCKCHIP=y
+CONFIG_MMC_DW=y
+CONFIG_MMC_DW_ROCKCHIP=y
+CONFIG_SPI_FLASH=y
+CONFIG_SF_DEFAULT_SPEED=20000000
+CONFIG_DM_ETH=y
+CONFIG_ETH_DESIGNWARE=y
+CONFIG_GMAC_ROCKCHIP=y
+CONFIG_PHY=y
+CONFIG_PINCTRL=y
+CONFIG_SPL_PINCTRL=y
+CONFIG_PINCTRL_ROCKCHIP_RK3328=y
+CONFIG_DM_PMIC=y
+CONFIG_PMIC_RK8XX=y
+CONFIG_REGULATOR_PWM=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_REGULATOR_RK8XX=y
+CONFIG_PWM_ROCKCHIP=y
+CONFIG_RAM=y
+CONFIG_SPL_RAM=y
+CONFIG_DM_RESET=y
+CONFIG_BAUDRATE=1500000
+CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_SYSRESET=y
+CONFIG_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_GENERIC=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_GENERIC=y
+CONFIG_USB_DWC2=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Rockchip"
+CONFIG_USB_GADGET_VENDOR_NUM=0x2207
+CONFIG_USB_GADGET_PRODUCT_NUM=0x330a
+CONFIG_USB_GADGET_DWC2_OTG=y
+CONFIG_USE_TINY_PRINTF=y
+CONFIG_SPL_TINY_MEMSET=y
+CONFIG_ERRNO_STR=y
diff --git a/configs/rpi_3_b_plus_defconfig b/configs/rpi_3_b_plus_defconfig
new file mode 100644 (file)
index 0000000..2ae7b6d
--- /dev/null
@@ -0,0 +1,43 @@
+CONFIG_ARM=y
+CONFIG_ARCH_BCM283X=y
+CONFIG_SYS_TEXT_BASE=0x00080000
+CONFIG_TARGET_RPI_3=y
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_MISC_INIT_R=y
+# CONFIG_DISPLAY_CPUINFO is not set
+# CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_SYS_PROMPT="U-Boot> "
+# CONFIG_CMD_FLASH is not set
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_FS_UUID=y
+CONFIG_OF_EMBED=y
+CONFIG_DEFAULT_DEVICE_TREE="bcm2837-rpi-3-b-plus"
+CONFIG_ENV_FAT_INTERFACE="mmc"
+CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_DM_KEYBOARD=y
+CONFIG_DM_MMC=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_BCM2835=y
+CONFIG_PHYLIB=y
+CONFIG_DM_ETH=y
+CONFIG_PINCTRL=y
+# CONFIG_PINCTRL_GENERIC is not set
+# CONFIG_REQUIRE_SERIAL_CONSOLE is not set
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_DWC2=y
+CONFIG_USB_KEYBOARD=y
+CONFIG_USB_HOST_ETHER=y
+CONFIG_USB_ETHER_LAN78XX=y
+CONFIG_USB_ETHER_SMSC95XX=y
+CONFIG_DM_VIDEO=y
+CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_CONSOLE_SCROLL_LINES=10
+CONFIG_PHYS_TO_BUS=y
+CONFIG_OF_LIBFDT_OVERLAY=y
index 27a5fc0..482ee7d 100644 (file)
@@ -1,13 +1,12 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
-CONFIG_SYS_TEXT_BASE=0x00000000
+CONFIG_SYS_TEXT_BASE=0x01000000
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_ROCKCHIP_RK3288=y
-CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
+CONFIG_TPL_LDSCRIPT="arch/arm/mach-rockchip/u-boot-tpl.lds"
 CONFIG_TARGET_TINKER_RK3288=y
 CONFIG_NR_DRAM_BANKS=1
-CONFIG_SPL_SIZE_LIMIT=30720
-CONFIG_SPL_STACK_R_ADDR=0x80000
+CONFIG_SPL_SIZE_LIMIT=307200
 CONFIG_DEBUG_UART_BASE=0xff690000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
@@ -17,9 +16,7 @@ CONFIG_CONSOLE_MUX=y
 CONFIG_DEFAULT_FDT_FILE="rk3288-tinker.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_SPL_TEXT_BASE=0xff704000
-CONFIG_SPL_STACK_R=y
-CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
+CONFIG_SPL_TEXT_BASE=0
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
@@ -37,7 +34,7 @@ CONFIG_CMD_REGULATOR=y
 CONFIG_SPL_PARTITION_UUIDS=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="rk3288-tinker"
-CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_REGMAP=y
 CONFIG_SPL_REGMAP=y
index 3025c0d..c4a9624 100644 (file)
@@ -13,6 +13,9 @@ CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_CMD_HDMIDETECT=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_FIT=y
+CONFIG_SPL_FIT_PRINT=y
+CONFIG_SPL_LOAD_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd"
 # CONFIG_CONSOLE_MUX is not set
@@ -23,6 +26,8 @@ CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_BOUNCE_BUFFER=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL_TEXT_BASE=0x00908000
+CONFIG_SPL_SEPARATE_BSS=y
+CONFIG_SPL_FIT_IMAGE_TINY=y
 CONFIG_SPL_FS_EXT4=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
@@ -36,6 +41,8 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="imx6dl-wandboard-revb1"
+CONFIG_OF_LIST="imx6q-wandboard-revb1 imx6qp-wandboard-revd1 imx6dl-wandboard-revb1"
+CONFIG_MULTI_DTB_FIT=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_DM=y
index 264f7e4..02e2497 100644 (file)
@@ -48,9 +48,10 @@ Two RK3036 boards are supported:
    - EVB RK3036 - use evb-rk3036 configuration
    - Kylin - use kylin_rk3036 configuration
 
-One RK3328 board is supported:
+Two RK3328 board are supported:
 
-   - EVB RK3328
+   - EVB RK3328 - use evb-rk3328_defconfig
+   - Pine64 Rock64 board - use rock64-rk3328_defconfig
 
 Size RK3399 boards are supported (aarch64):
 
@@ -103,7 +104,6 @@ For example:
      => cd /path/to/u-boot
      => make nanopi-neo4-rk3399_defconfig
      => make
-     => make u-boot.itb
 
    - Get the rkbin
 
@@ -137,8 +137,8 @@ For example:
        => cd arm-trusted-firmware
        => make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 bl31
 
-       (copy bl31.bin into U-Boot root dir)
-       => cp build/rk3399/release/bl31/bl31.bin /path/to/u-boot/bl31-rk3399.bin
+       (export bl31.bin)
+       => export BL31=/path/to/arm-trusted-firmware/build/rk3399/release/bl31/bl31.bin
 
      For rest of rk3399 boards.
 
@@ -149,8 +149,8 @@ For example:
        => make realclean
        => make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399
 
-       (copy bl31.elf into U-Boot root dir)
-       => cp build/rk3399/release/bl31/bl31.elf /path/to/u-boot
+       (export bl31.elf)
+       => export BL31=/path/to/arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf
 
    - Compile PMU M0 firmware
 
@@ -162,15 +162,14 @@ For example:
      (export cross compiler path for Cortex-M0 PMU)
      => make CROSS_COMPILE=arm-cortex_m0-eabi-
 
-     (copy rk3399m0.bin into U-Boot root dir)
-     => cp rk3399m0.bin /path/to/u-boot
+     (export rk3399m0.bin)
+     => export PMUM0=/path/to/rk3399-cortex-m0/rk3399m0.bin
 
    - Compile U-Boot
 
      => cd /path/to/u-boot
      => make orangepi-rk3399_defconfig
      => make
-     => make u-boot.itb
 
      (Get spl/u-boot-spl-dtb.bin, u-boot.itb images and some boards would get
       spl/u-boot-spl.bin since it doesn't enable CONFIG_SPL_OF_CONTROL
@@ -310,6 +309,31 @@ tools/mkimage -n rk3188 -T rksd -d spl/u-boot-spl.bin out
 truncate -s %2048 u-boot.bin
 cat u-boot.bin | split -b 512 --filter='openssl rc4 -K 7C4E0304550509072D2C7B38170D1711' >> out
 
+Booting from an SD card on Pine64 Rock64 (RK3328)
+=================================================
+
+For Rock64 rk3328 board the following three parts are required:
+TPL, SPL, and the u-boot image tree blob. While u-boot-spl.bin and
+u-boot.itb are to be compiled as usual, TPL is currently not
+implemented in u-boot, so you need to pick one from rkbin:
+
+  - Get the rkbin
+
+    => git clone https://github.com/rockchip-linux/rkbin.git
+
+  - Create TPL/SPL image
+
+    => tools/mkimage -n rk3328 -T rksd -d rkbin/bin/rk33/rk3328_ddr_333MHz_v1.16.bin idbloader.img
+    => cat spl/u-boot-spl.bin >> idbloader.img
+
+  - Write TPL/SPL image at 64 sector
+
+    => sudo dd if=idbloader.img of=/dev/mmcblk0 seek=64
+
+  - Write u-boot image tree blob at 16384 sector
+
+    => sudo dd if=u-boot.itb of=/dev/mmcblk0 seek=16384
+
 Booting from an SD card on RK3399
 =================================
 
index fc3157d..dc9eb62 100644 (file)
@@ -757,3 +757,8 @@ int uclass_pre_remove_device(struct udevice *dev)
        return 0;
 }
 #endif
+
+UCLASS_DRIVER(nop) = {
+       .id             = UCLASS_NOP,
+       .name           = "nop",
+};
index f2c99d4..5efaa2f 100644 (file)
@@ -28,6 +28,10 @@ static const int i2c4_muxvals[] = {1, 1};
 static const unsigned nand_pins[] = {3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
                                     15, 16, 17};
 static const int nand_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+static const unsigned spi0_pins[] = {56, 57, 58, 59};
+static const int spi0_muxvals[] = {0, 0, 0, 0};
+static const unsigned spi1_pins[] = {169, 170, 171, 172};
+static const int spi1_muxvals[] = {1, 1, 1, 1};
 static const unsigned system_bus_pins[] = {1, 2, 6, 7, 8, 9, 10, 11, 12, 13,
                                           14, 15, 16, 17};
 static const int system_bus_muxvals[] = {0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -58,6 +62,8 @@ static const struct uniphier_pinctrl_group uniphier_ld11_groups[] = {
        UNIPHIER_PINCTRL_GROUP(i2c3),
        UNIPHIER_PINCTRL_GROUP(i2c4),
        UNIPHIER_PINCTRL_GROUP(nand),
+       UNIPHIER_PINCTRL_GROUP(spi0),
+       UNIPHIER_PINCTRL_GROUP(spi1),
        UNIPHIER_PINCTRL_GROUP(system_bus),
        UNIPHIER_PINCTRL_GROUP(system_bus_cs1),
        UNIPHIER_PINCTRL_GROUP(uart0),
@@ -77,6 +83,8 @@ static const char * const uniphier_ld11_functions[] = {
        UNIPHIER_PINMUX_FUNCTION(i2c3),
        UNIPHIER_PINMUX_FUNCTION(i2c4),
        UNIPHIER_PINMUX_FUNCTION(nand),
+       UNIPHIER_PINMUX_FUNCTION(spi0),
+       UNIPHIER_PINMUX_FUNCTION(spi1),
        UNIPHIER_PINMUX_FUNCTION(system_bus),
        UNIPHIER_PINMUX_FUNCTION(uart0),
        UNIPHIER_PINMUX_FUNCTION(uart1),
index 8ec87f2..d3c5833 100644 (file)
@@ -43,6 +43,14 @@ static const unsigned nand_pins[] = {3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
 static const int nand_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
 static const unsigned sd_pins[] = {10, 11, 12, 13, 14, 15, 16, 17};
 static const int sd_muxvals[] = {3, 3, 3, 3, 3, 3, 3, 3};  /* No SDVOLC */
+static const unsigned spi0_pins[] = {56, 57, 58, 59};
+static const int spi0_muxvals[] = {0, 0, 0, 0};
+static const unsigned spi1_pins[] = {169, 170, 171, 172};
+static const int spi1_muxvals[] = {1, 1, 1, 1};
+static const unsigned spi2_pins[] = {86, 87, 88, 89};
+static const int spi2_muxvals[] = {1, 1, 1, 1};
+static const unsigned spi3_pins[] = {74, 75, 76, 77};
+static const int spi3_muxvals[] = {1, 1, 1, 1};
 static const unsigned system_bus_pins[] = {1, 2, 6, 7, 8, 9, 10, 11, 12, 13,
                                           14, 15, 16, 17};
 static const int system_bus_muxvals[] = {0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -77,6 +85,10 @@ static const struct uniphier_pinctrl_group uniphier_ld20_groups[] = {
        UNIPHIER_PINCTRL_GROUP(i2c4),
        UNIPHIER_PINCTRL_GROUP(nand),
        UNIPHIER_PINCTRL_GROUP(sd),
+       UNIPHIER_PINCTRL_GROUP(spi0),
+       UNIPHIER_PINCTRL_GROUP(spi1),
+       UNIPHIER_PINCTRL_GROUP(spi2),
+       UNIPHIER_PINCTRL_GROUP(spi3),
        UNIPHIER_PINCTRL_GROUP(system_bus),
        UNIPHIER_PINCTRL_GROUP(system_bus_cs1),
        UNIPHIER_PINCTRL_GROUP(uart0),
@@ -99,6 +111,10 @@ static const char * const uniphier_ld20_functions[] = {
        UNIPHIER_PINMUX_FUNCTION(i2c4),
        UNIPHIER_PINMUX_FUNCTION(nand),
        UNIPHIER_PINMUX_FUNCTION(sd),
+       UNIPHIER_PINMUX_FUNCTION(spi0),
+       UNIPHIER_PINMUX_FUNCTION(spi1),
+       UNIPHIER_PINMUX_FUNCTION(spi2),
+       UNIPHIER_PINMUX_FUNCTION(spi3),
        UNIPHIER_PINMUX_FUNCTION(system_bus),
        UNIPHIER_PINMUX_FUNCTION(uart0),
        UNIPHIER_PINMUX_FUNCTION(uart1),
index c822bcc..bf1a9e9 100644 (file)
@@ -37,6 +37,8 @@ static const unsigned nand_cs1_pins[] = {22, 23};
 static const int nand_cs1_muxvals[] = {0, 0};
 static const unsigned sd_pins[] = {44, 45, 46, 47, 48, 49, 50, 51, 52};
 static const int sd_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
+static const unsigned spi0_pins[] = {135, 136, 137, 138};
+static const int spi0_muxvals[] = {12, 12, 12, 12};
 static const unsigned system_bus_pins[] = {16, 17, 18, 19, 20, 165, 166, 167,
                                           168, 169, 170, 171, 172, 173};
 static const int system_bus_muxvals[] = {0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1,
@@ -80,6 +82,7 @@ static const struct uniphier_pinctrl_group uniphier_ld4_groups[] = {
        UNIPHIER_PINCTRL_GROUP(nand),
        UNIPHIER_PINCTRL_GROUP(nand_cs1),
        UNIPHIER_PINCTRL_GROUP(sd),
+       UNIPHIER_PINCTRL_GROUP(spi0),
        UNIPHIER_PINCTRL_GROUP(system_bus),
        UNIPHIER_PINCTRL_GROUP(system_bus_cs0),
        UNIPHIER_PINCTRL_GROUP(system_bus_cs1),
@@ -106,6 +109,7 @@ static const char * const uniphier_ld4_functions[] = {
        UNIPHIER_PINMUX_FUNCTION(i2c3),
        UNIPHIER_PINMUX_FUNCTION(nand),
        UNIPHIER_PINMUX_FUNCTION(sd),
+       UNIPHIER_PINMUX_FUNCTION(spi0),
        UNIPHIER_PINMUX_FUNCTION(system_bus),
        UNIPHIER_PINMUX_FUNCTION_SPL(uart0),
        UNIPHIER_PINMUX_FUNCTION_SPL(uart1),
index 30d4116..f22c046 100644 (file)
@@ -37,6 +37,10 @@ static const unsigned nand_cs1_pins[] = {37, 38};
 static const int nand_cs1_muxvals[] = {0, 0};
 static const unsigned sd_pins[] = {47, 48, 49, 50, 51, 52, 53, 54, 55};
 static const int sd_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
+static const unsigned spi0_pins[] = {199, 200, 201, 202};
+static const int spi0_muxvals[] = {8, 8, 8, 8};
+static const unsigned spi1_pins[] = {93, 94, 95, 96};
+static const int spi1_muxvals[] = {1, 1, 1, 1};
 static const unsigned system_bus_pins[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
                                           11, 12, 13};
 static const int system_bus_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -84,6 +88,8 @@ static const struct uniphier_pinctrl_group uniphier_ld6b_groups[] = {
        UNIPHIER_PINCTRL_GROUP(nand),
        UNIPHIER_PINCTRL_GROUP(nand_cs1),
        UNIPHIER_PINCTRL_GROUP(sd),
+       UNIPHIER_PINCTRL_GROUP(spi0),
+       UNIPHIER_PINCTRL_GROUP(spi1),
        UNIPHIER_PINCTRL_GROUP(system_bus),
        UNIPHIER_PINCTRL_GROUP(system_bus_cs1),
        UNIPHIER_PINCTRL_GROUP(system_bus_cs2),
@@ -112,6 +118,8 @@ static const char * const uniphier_ld6b_functions[] = {
        UNIPHIER_PINMUX_FUNCTION(i2c3),
        UNIPHIER_PINMUX_FUNCTION(nand),
        UNIPHIER_PINMUX_FUNCTION(sd),
+       UNIPHIER_PINMUX_FUNCTION(spi0),
+       UNIPHIER_PINMUX_FUNCTION(spi1),
        UNIPHIER_PINMUX_FUNCTION(system_bus),
        UNIPHIER_PINMUX_FUNCTION_SPL(uart0),
        UNIPHIER_PINMUX_FUNCTION_SPL(uart1),
index eb5978a..8bae163 100644 (file)
@@ -50,6 +50,10 @@ static const int sd_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
 static const unsigned sd1_pins[] = {319, 320, 321, 322, 323, 324, 325, 326,
                                    327};
 static const int sd1_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
+static const unsigned spi0_pins[] = {199, 200, 201, 202};
+static const int spi0_muxvals[] = {11, 11, 11, 11};
+static const unsigned spi1_pins[] = {195, 196, 197, 198, 235, 238, 239};
+static const int spi1_muxvals[] = {11, 11, 11, 11, 11, 11, 11};
 static const unsigned system_bus_pins[] = {25, 26, 27, 28, 29, 30, 31, 32, 33,
                                           34, 35, 36, 37, 38};
 static const int system_bus_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -103,6 +107,8 @@ static const struct uniphier_pinctrl_group uniphier_pro4_groups[] = {
        UNIPHIER_PINCTRL_GROUP(nand_cs1),
        UNIPHIER_PINCTRL_GROUP(sd),
        UNIPHIER_PINCTRL_GROUP(sd1),
+       UNIPHIER_PINCTRL_GROUP(spi0),
+       UNIPHIER_PINCTRL_GROUP(spi1),
        UNIPHIER_PINCTRL_GROUP(system_bus),
        UNIPHIER_PINCTRL_GROUP(system_bus_cs0),
        UNIPHIER_PINCTRL_GROUP(system_bus_cs1),
@@ -135,6 +141,8 @@ static const char * const uniphier_pro4_functions[] = {
        UNIPHIER_PINMUX_FUNCTION(nand),
        UNIPHIER_PINMUX_FUNCTION(sd),
        UNIPHIER_PINMUX_FUNCTION(sd1),
+       UNIPHIER_PINMUX_FUNCTION(spi0),
+       UNIPHIER_PINMUX_FUNCTION(spi1),
        UNIPHIER_PINMUX_FUNCTION(system_bus),
        UNIPHIER_PINMUX_FUNCTION_SPL(uart0),
        UNIPHIER_PINMUX_FUNCTION_SPL(uart1),
index 685d8be..1f4931b 100644 (file)
@@ -37,6 +37,12 @@ static const unsigned nand_cs1_pins[] = {26, 27};
 static const int nand_cs1_muxvals[] = {0, 0};
 static const unsigned sd_pins[] = {250, 251, 252, 253, 254, 255, 256, 257, 258};
 static const int sd_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
+static const unsigned spi0_pins[] = {120, 121, 122, 123};
+static const int spi0_muxvals[] = {0, 0, 0, 0};
+static const unsigned spi1_pins[] = {134, 139, 85, 86};
+static const int spi1_muxvals[] = {1, 1, 1, 1};
+static const unsigned spi2_pins[] = {55, 56, 57, 58, 82, 83, 84};
+static const int spi2_muxvals[] = {0, 0, 0, 0, 1, 1, 1};
 static const unsigned system_bus_pins[] = {4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
                                           14, 15, 16, 17};
 static const int system_bus_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -88,6 +94,9 @@ static const struct uniphier_pinctrl_group uniphier_pro5_groups[] = {
        UNIPHIER_PINCTRL_GROUP(nand),
        UNIPHIER_PINCTRL_GROUP(nand_cs1),
        UNIPHIER_PINCTRL_GROUP(sd),
+       UNIPHIER_PINCTRL_GROUP(spi0),
+       UNIPHIER_PINCTRL_GROUP(spi1),
+       UNIPHIER_PINCTRL_GROUP(spi2),
        UNIPHIER_PINCTRL_GROUP(system_bus),
        UNIPHIER_PINCTRL_GROUP(system_bus_cs0),
        UNIPHIER_PINCTRL_GROUP(system_bus_cs1),
@@ -117,6 +126,9 @@ static const char * const uniphier_pro5_functions[] = {
        UNIPHIER_PINMUX_FUNCTION(i2c6),
        UNIPHIER_PINMUX_FUNCTION(nand),
        UNIPHIER_PINMUX_FUNCTION(sd),
+       UNIPHIER_PINMUX_FUNCTION(spi0),
+       UNIPHIER_PINMUX_FUNCTION(spi1),
+       UNIPHIER_PINMUX_FUNCTION(spi2),
        UNIPHIER_PINMUX_FUNCTION(system_bus),
        UNIPHIER_PINMUX_FUNCTION_SPL(uart0),
        UNIPHIER_PINMUX_FUNCTION_SPL(uart1),
index 8609f1b..038a7dd 100644 (file)
@@ -46,6 +46,10 @@ static const unsigned nand_cs1_pins[] = {37, 38};
 static const int nand_cs1_muxvals[] = {8, 8};
 static const unsigned sd_pins[] = {47, 48, 49, 50, 51, 52, 53, 54, 55};
 static const int sd_muxvals[] = {8, 8, 8, 8, 8, 8, 8, 8, 8};
+static const unsigned spi0_pins[] = {199, 200, 201, 202};
+static const int spi0_muxvals[] = {8, 8, 8, 8};
+static const unsigned spi1_pins[] = {93, 94, 95, 96};
+static const int spi1_muxvals[] = {1, 1, 1, 1};
 static const unsigned system_bus_pins[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
                                           11, 12, 13};
 static const int system_bus_muxvals[] = {8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
@@ -88,6 +92,8 @@ static const struct uniphier_pinctrl_group uniphier_pxs2_groups[] = {
        UNIPHIER_PINCTRL_GROUP(nand),
        UNIPHIER_PINCTRL_GROUP(nand_cs1),
        UNIPHIER_PINCTRL_GROUP(sd),
+       UNIPHIER_PINCTRL_GROUP(spi0),
+       UNIPHIER_PINCTRL_GROUP(spi1),
        UNIPHIER_PINCTRL_GROUP(system_bus),
        UNIPHIER_PINCTRL_GROUP(system_bus_cs1),
        UNIPHIER_PINCTRL_GROUP_SPL(uart0),
@@ -115,6 +121,8 @@ static const char * const uniphier_pxs2_functions[] = {
        UNIPHIER_PINMUX_FUNCTION(i2c6),
        UNIPHIER_PINMUX_FUNCTION(nand),
        UNIPHIER_PINMUX_FUNCTION(sd),
+       UNIPHIER_PINMUX_FUNCTION(spi0),
+       UNIPHIER_PINMUX_FUNCTION(spi1),
        UNIPHIER_PINMUX_FUNCTION(system_bus),
        UNIPHIER_PINMUX_FUNCTION_SPL(uart0),
        UNIPHIER_PINMUX_FUNCTION_SPL(uart1),
index 5b4a514..452d76d 100644 (file)
@@ -41,6 +41,10 @@ static const unsigned nand_pins[] = {16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
 static const int nand_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
 static const unsigned sd_pins[] = {43, 44, 45, 46, 47, 48, 49, 50, 51};
 static const int sd_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
+static const unsigned spi0_pins[] = {100, 101, 102, 103};
+static const int spi0_muxvals[] = {0, 0, 0, 0};
+static const unsigned spi1_pins[] = {112, 113, 114, 115};
+static const int spi1_muxvals[] = {2, 2, 2, 2};
 static const unsigned system_bus_pins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
                                           12, 13, 14};
 static const int system_bus_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -77,6 +81,8 @@ static const struct uniphier_pinctrl_group uniphier_pxs3_groups[] = {
        UNIPHIER_PINCTRL_GROUP(i2c3),
        UNIPHIER_PINCTRL_GROUP(nand),
        UNIPHIER_PINCTRL_GROUP(sd),
+       UNIPHIER_PINCTRL_GROUP(spi0),
+       UNIPHIER_PINCTRL_GROUP(spi1),
        UNIPHIER_PINCTRL_GROUP(system_bus),
        UNIPHIER_PINCTRL_GROUP(system_bus_cs1),
        UNIPHIER_PINCTRL_GROUP(uart0),
@@ -101,6 +107,8 @@ static const char * const uniphier_pxs3_functions[] = {
        UNIPHIER_PINMUX_FUNCTION(i2c3),
        UNIPHIER_PINMUX_FUNCTION(nand),
        UNIPHIER_PINMUX_FUNCTION(sd),
+       UNIPHIER_PINMUX_FUNCTION(spi0),
+       UNIPHIER_PINMUX_FUNCTION(spi1),
        UNIPHIER_PINMUX_FUNCTION(system_bus),
        UNIPHIER_PINMUX_FUNCTION(uart0),
        UNIPHIER_PINMUX_FUNCTION(uart1),
index c072fc5..1e38ba1 100644 (file)
@@ -37,6 +37,8 @@ static const unsigned nand_cs1_pins[] = {22, 23};
 static const int nand_cs1_muxvals[] = {0, 0};
 static const unsigned sd_pins[] = {32, 33, 34, 35, 36, 37, 38, 39, 40};
 static const int sd_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
+static const unsigned spi0_pins[] = {118, 119, 120, 121};
+static const int spi0_muxvals[] = {3, 3, 3, 3};
 static const unsigned system_bus_pins[] = {136, 137, 138, 139, 140, 141, 142,
                                           143, 144, 145, 146, 147, 148, 149};
 static const int system_bus_muxvals[] = {-1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -78,6 +80,7 @@ static const struct uniphier_pinctrl_group uniphier_sld8_groups[] = {
        UNIPHIER_PINCTRL_GROUP(nand),
        UNIPHIER_PINCTRL_GROUP(nand_cs1),
        UNIPHIER_PINCTRL_GROUP(sd),
+       UNIPHIER_PINCTRL_GROUP(spi0),
        UNIPHIER_PINCTRL_GROUP(system_bus),
        UNIPHIER_PINCTRL_GROUP(system_bus_cs1),
        UNIPHIER_PINCTRL_GROUP(system_bus_cs2),
@@ -103,6 +106,7 @@ static const char * const uniphier_sld8_functions[] = {
        UNIPHIER_PINMUX_FUNCTION(i2c3),
        UNIPHIER_PINMUX_FUNCTION(nand),
        UNIPHIER_PINMUX_FUNCTION(sd),
+       UNIPHIER_PINMUX_FUNCTION(spi0),
        UNIPHIER_PINMUX_FUNCTION(system_bus),
        UNIPHIER_PINMUX_FUNCTION_SPL(uart0),
        UNIPHIER_PINMUX_FUNCTION_SPL(uart1),
index 3e6c494..406bf0b 100644 (file)
@@ -337,7 +337,7 @@ static int dwc3_glue_remove(struct udevice *dev)
 
        clk_release_bulk(&glue->clks);
 
-       return dm_scan_fdt_dev(dev);
+       return 0;
 }
 
 static const struct udevice_id dwc3_glue_ids[] = {
@@ -350,7 +350,7 @@ static const struct udevice_id dwc3_glue_ids[] = {
 
 U_BOOT_DRIVER(dwc3_generic_wrapper) = {
        .name   = "dwc3-generic-wrapper",
-       .id     = UCLASS_MISC,
+       .id     = UCLASS_NOP,
        .of_match = dwc3_glue_ids,
        .bind = dwc3_glue_bind,
        .probe = dwc3_glue_probe,
index ae97ab2..fab7ce6 100644 (file)
@@ -638,7 +638,20 @@ static u32 sdp_jump_imxheader(void *address)
        return 0;
 }
 
-static void sdp_handle_in_ep(void)
+#ifdef CONFIG_SPL_BUILD
+#ifdef CONFIG_SPL_LOAD_FIT
+static ulong sdp_fit_read(struct spl_load_info *load, ulong sector,
+                         ulong count, void *buf)
+{
+       debug("%s: sector %lx, count %lx, buf %lx\n",
+             __func__, sector, count, (ulong)buf);
+       memcpy(buf, (void *)(load->dev + sector), count);
+       return count;
+}
+#endif
+#endif
+
+static void sdp_handle_in_ep(struct spl_image_info *spl_image)
 {
        u8 *data = sdp_func->in_req->buf;
        u32 status;
@@ -690,10 +703,25 @@ static void sdp_handle_in_ep(void)
                /* If imx header fails, try some U-Boot specific headers */
                if (status) {
 #ifdef CONFIG_SPL_BUILD
+                       image_header_t *header =
+                               sdp_ptr(sdp_func->jmp_address);
+#ifdef CONFIG_SPL_LOAD_FIT
+                       if (image_get_magic(header) == FDT_MAGIC) {
+                               struct spl_load_info load;
+
+                               debug("Found FIT\n");
+                               load.dev = header;
+                               load.bl_len = 1;
+                               load.read = sdp_fit_read;
+                               spl_load_simple_fit(spl_image, &load, 0,
+                                                   header);
+
+                               return;
+                       }
+#endif
                        /* In SPL, allow jumps to U-Boot images */
                        struct spl_image_info spl_image = {};
-                       spl_parse_image_header(&spl_image,
-                               (struct image_header *)sdp_func->jmp_address);
+                       spl_parse_image_header(&spl_image, header);
                        jump_to_image_no_args(&spl_image);
 #else
                        /* In U-Boot, allow jumps to scripts */
@@ -715,19 +743,32 @@ static void sdp_handle_in_ep(void)
        };
 }
 
-void sdp_handle(int controller_index)
+#ifndef CONFIG_SPL_BUILD
+int sdp_handle(int controller_index)
+#else
+int spl_sdp_handle(int controller_index, struct spl_image_info *spl_image)
+#endif
 {
        printf("SDP: handle requests...\n");
        while (1) {
                if (ctrlc()) {
                        puts("\rCTRL+C - Operation aborted.\n");
-                       return;
+                       return -EINVAL;
                }
 
+#ifdef CONFIG_SPL_BUILD
+               if (spl_image->flags & SPL_FIT_FOUND)
+                       return 0;
+#endif
+
                WATCHDOG_RESET();
                usb_gadget_handle_interrupts(controller_index);
 
-               sdp_handle_in_ep();
+#ifdef CONFIG_SPL_BUILD
+               sdp_handle_in_ep(spl_image);
+#else
+               sdp_handle_in_ep(NULL);
+#endif
        }
 }
 
index 33abfea..e9e6ed5 100644 (file)
@@ -503,6 +503,42 @@ static int ehci_usb_ofdata_to_platdata(struct udevice *dev)
        return 0;
 }
 
+static int ehci_usb_bind(struct udevice *dev)
+{
+       /*
+        * TODO:
+        * This driver is only partly converted to DT probing and still uses
+        * a tremendous amount of hard-coded addresses. To make things worse,
+        * the driver depends on specific sequential indexing of controllers,
+        * from which it derives offsets in the PHY and ANATOP register sets.
+        *
+        * Here we attempt to calculate these indexes from DT information as
+        * well as we can. The USB controllers on all existing iMX6/iMX7 SoCs
+        * are placed next to each other, at addresses incremented by 0x200.
+        * Thus, the index is derived from the multiple of 0x200 offset from
+        * the first controller address.
+        *
+        * However, to complete conversion of this driver to DT probing, the
+        * following has to be done:
+        * - DM clock framework support for iMX must be implemented
+        * - usb_power_config() has to be converted to clock framework
+        *   -> Thus, the ad-hoc "index" variable goes away.
+        * - USB PHY handling has to be factored out into separate driver
+        *   -> Thus, the ad-hoc "index" variable goes away from the PHY
+        *      code, the PHY driver must parse it's address from DT. This
+        *      USB driver must find the PHY driver via DT phandle.
+        *   -> usb_power_config() shall be moved to PHY driver
+        * With these changes in place, the ad-hoc indexing goes away and
+        * the driver is fully converted to DT probing.
+        */
+       fdt_size_t size;
+       fdt_addr_t addr = devfdt_get_addr_size_index(dev, 0, &size);
+
+       dev->req_seq = (addr - USB_BASE_ADDR) / size;
+
+       return 0;
+}
+
 static int ehci_usb_probe(struct udevice *dev)
 {
        struct usb_platdata *plat = dev_get_platdata(dev);
@@ -564,6 +600,7 @@ U_BOOT_DRIVER(usb_mx6) = {
        .id     = UCLASS_USB,
        .of_match = mx6_usb_ids,
        .ofdata_to_platdata = ehci_usb_ofdata_to_platdata,
+       .bind   = ehci_usb_bind,
        .probe  = ehci_usb_probe,
        .remove = ehci_deregister,
        .ops    = &ehci_usb_ops,
index a587977..ad20bf2 100644 (file)
@@ -67,6 +67,9 @@ static int set_pwm(struct pwm_backlight_priv *priv)
                return log_ret(ret);
 
        ret = pwm_set_invert(priv->pwm, priv->channel, priv->polarity);
+       if (ret == -ENOSYS && !priv->polarity)
+               ret = 0;
+
        return log_ret(ret);
 }
 
index dbafb74..ee0ddff 100644 (file)
@@ -41,15 +41,6 @@ config OMAP_WATCHDOG
        help
          Say Y here to enable the OMAP3+ watchdog driver.
 
-config TANGIER_WATCHDOG
-       bool "Intel Tangier watchdog"
-       depends on INTEL_MID
-       select HW_WATCHDOG
-       help
-         This enables support for watchdog controller available on
-         Intel Tangier SoC. If you're using a board with Intel Tangier
-         SoC, say Y here.
-
 config ULP_WATCHDOG
        bool "i.MX7ULP watchdog"
        help
@@ -170,4 +161,12 @@ config XILINX_TB_WATCHDOG
           Select this to enable Xilinx Axi watchdog timer, which can be found on some
           Xilinx Microblaze Platforms.
 
+config WDT_TANGIER
+       bool "Intel Tangier watchdog timer support"
+       depends on WDT && INTEL_MID
+       help
+         This enables support for watchdog controller available on
+         Intel Tangier SoC. If you're using a board with Intel Tangier
+         SoC, say Y here.
+
 endmenu
index e3f4fdb..68c989a 100644 (file)
@@ -14,7 +14,6 @@ obj-$(CONFIG_S5P)               += s5p_wdt.o
 obj-$(CONFIG_XILINX_TB_WATCHDOG) += xilinx_tb_wdt.o
 obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o
 obj-$(CONFIG_DESIGNWARE_WATCHDOG) += designware_wdt.o
-obj-$(CONFIG_TANGIER_WATCHDOG) += tangier_wdt.o
 obj-$(CONFIG_ULP_WATCHDOG) += ulp_wdog.o
 obj-$(CONFIG_WDT) += wdt-uclass.o
 obj-$(CONFIG_WDT_SANDBOX) += sandbox_wdt.o
@@ -29,3 +28,4 @@ obj-$(CONFIG_WDT_MT7621) += mt7621_wdt.o
 obj-$(CONFIG_WDT_MTK) += mtk_wdt.o
 obj-$(CONFIG_WDT_SP805) += sp805_wdt.o
 obj-$(CONFIG_WDT_STM32MP) += stm32mp_wdt.o
+obj-$(CONFIG_WDT_TANGIER) += tangier_wdt.o
index be4a8f4..ba265cf 100644 (file)
@@ -3,20 +3,21 @@
  * Copyright (c) 2017 Intel Corporation
  */
 #include <common.h>
-#include <watchdog.h>
+#include <dm.h>
+#include <wdt.h>
+#include <div64.h>
 #include <asm/scu.h>
 
 /* Hardware timeout in seconds */
 #define WDT_PRETIMEOUT         15
 #define WDT_TIMEOUT_MIN                (1 + WDT_PRETIMEOUT)
 #define WDT_TIMEOUT_MAX                170
-#define WDT_DEFAULT_TIMEOUT    90
 
-#ifndef CONFIG_WATCHDOG_TIMEOUT_MSECS
-#define WATCHDOG_HEARTBEAT 60000
-#else
-#define WATCHDOG_HEARTBEAT CONFIG_WATCHDOG_TIMEOUT_MSECS
-#endif
+/*
+ * Note, firmware chooses 90 seconds as a default timeout for watchdog on
+ * Intel Tangier SoC. It means that without handling it in the running code
+ * the reboot will happen.
+ */
 
 enum {
        SCU_WATCHDOG_START                      = 0,
@@ -25,39 +26,33 @@ enum {
        SCU_WATCHDOG_SET_ACTION_ON_TIMEOUT      = 3,
 };
 
-void hw_watchdog_reset(void)
+static int tangier_wdt_reset(struct udevice *dev)
 {
-       static unsigned long last;
-       unsigned long now;
-
-       if (gd->timer)
-               now = timer_get_us();
-       else
-               now = rdtsc() / 1000;
-
-       /* Do not flood SCU */
-       if (last > now)
-               last = 0;
-
-       if (unlikely((now - last) > (WDT_PRETIMEOUT / 2) * 1000000)) {
-               last = now;
-               scu_ipc_simple_command(IPCMSG_WATCHDOG_TIMER, SCU_WATCHDOG_KEEPALIVE);
-       }
+       scu_ipc_simple_command(IPCMSG_WATCHDOG_TIMER, SCU_WATCHDOG_KEEPALIVE);
+       return 0;
 }
 
-int hw_watchdog_disable(void)
+static int tangier_wdt_stop(struct udevice *dev)
 {
        return scu_ipc_simple_command(IPCMSG_WATCHDOG_TIMER, SCU_WATCHDOG_STOP);
 }
 
-void hw_watchdog_init(void)
+static int tangier_wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags)
 {
-       u32 timeout = WATCHDOG_HEARTBEAT / 1000;
+       u32 timeout_sec;
        int in_size;
        struct ipc_wd_start {
                u32 pretimeout;
                u32 timeout;
-       } ipc_wd_start = { timeout - WDT_PRETIMEOUT, timeout };
+       } ipc_wd_start;
+
+       /* Calculate timeout in seconds and restrict to min and max value */
+       do_div(timeout_ms, 1000);
+       timeout_sec = clamp_t(u32, timeout_ms, WDT_TIMEOUT_MIN, WDT_TIMEOUT_MAX);
+
+       /* Update values in the IPC request */
+       ipc_wd_start.pretimeout = timeout_sec - WDT_PRETIMEOUT;
+       ipc_wd_start.timeout = timeout_sec;
 
        /*
         * SCU expects the input size for watchdog IPC
@@ -67,4 +62,31 @@ void hw_watchdog_init(void)
 
        scu_ipc_command(IPCMSG_WATCHDOG_TIMER, SCU_WATCHDOG_START,
                        (u32 *)&ipc_wd_start, in_size, NULL, 0);
+
+       return 0;
 }
+
+static const struct wdt_ops tangier_wdt_ops = {
+       .reset = tangier_wdt_reset,
+       .start = tangier_wdt_start,
+       .stop = tangier_wdt_stop,
+};
+
+static const struct udevice_id tangier_wdt_ids[] = {
+       { .compatible = "intel,tangier-wdt" },
+       { /* sentinel */ }
+};
+
+static int tangier_wdt_probe(struct udevice *dev)
+{
+       debug("%s: Probing wdt%u\n", __func__, dev->seq);
+       return 0;
+}
+
+U_BOOT_DRIVER(wdt_tangier) = {
+       .name = "wdt_tangier",
+       .id = UCLASS_WDT,
+       .of_match = tangier_wdt_ids,
+       .ops = &tangier_wdt_ops,
+       .probe = tangier_wdt_probe,
+};
index 4b0a3fb..db37fa7 100644 (file)
@@ -58,6 +58,7 @@
 #define IMX_FEC_BASE                   ENET_BASE_ADDR
 #define CONFIG_FEC_XCV_TYPE            RGMII
 #define CONFIG_ETHPRIME                        "FEC"
+#define PHY_ANEG_TIMEOUT               15000 /* PHY needs longer aneg time */
 #define CONFIG_FEC_MXC_PHYADDR         6
 #define CONFIG_TFTP_TSIZE
 
        "imx6q-apalis-cam-eval.dtb fat 0 1"
 
 #define EMMC_BOOTCMD \
-       "set_emmcargs emmcargs ip=off root=PARTUUID=${uuid} ro,noatime " \
-               "rootfstype=ext4 rootwait\0" \
+       "set_emmcargs=setenv emmcargs ip=off root=PARTUUID=${uuid} " \
+               "ro,noatime rootfstype=ext4 rootwait\0" \
        "emmcboot=run setup; run emmcfinduuid; run set_emmcargs; " \
                "setenv bootargs ${defargs} ${emmcargs} ${setupargs} " \
                "${vidargs}; echo Booting from internal eMMC chip...; " \
index fc0b1f4..7b68c1c 100644 (file)
 /*
  * LCD
  */
-#ifdef CONFIG_VIDEO
 #define CONFIG_VIDEO_BMP_RLE8
 #define CONFIG_VIDEO_BMP_GZIP
 #define CONFIG_SPLASH_SCREEN
 #define CONFIG_BMP_16BPP
 #define CONFIG_VIDEO_LOGO
 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (2 << 20)
-#endif
 
 /* LVDS display */
 #define CONFIG_SYS_LDB_CLOCK                   33260000
        "splashfile=boot/usplash.bmp.gz\0"                              \
        "splashimage=0x88000000\0"                                      \
        "splashpos=m,m\0"                                               \
+       "stdout=serial,vidconsole\0"                                    \
+       "stderr=serial,vidconsole\0"                                    \
        "addcons="                                                      \
                "setenv bootargs ${bootargs} "                          \
                "console=${consdev},${baudrate}\0"                      \
index 9a3b3b1..9101540 100644 (file)
@@ -79,7 +79,6 @@
 #define CONFIG_SYS_MMC_IMG_LOAD_PART   1
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
-       "script=boot.scr\0" \
        "image=zImage\0" \
        "splashpos=m,m\0" \
        "console=ttymxc4\0" \
index 71aad70..2a81c80 100644 (file)
 
 #define CONFIG_SYS_INIT_SP_ADDR                0x00300000
 #define CONFIG_SYS_LOAD_ADDR           0x00800800
+#define CONFIG_SPL_STACK               0x00400000
+#define CONFIG_SPL_MAX_SIZE            0x100000
+#define CONFIG_SPL_BSS_START_ADDR      0x2000000
+#define CONFIG_SPL_BSS_MAX_SIZE                0x2000
 
 #define CONFIG_SYS_BOOTM_LEN   (64 << 20)      /* 64M */
 
index 9ce4176..f76c7d1 100644 (file)
        "fdt_addr_r=0x02600000\0" \
        "ramdisk_addr_r=0x02700000\0"
 
+#if CONFIG_IS_ENABLED(CMD_MMC)
+       #define BOOT_TARGET_MMC(func) \
+               func(MMC, mmc, 0) \
+               func(MMC, mmc, 1)
+#else
+       #define BOOT_TARGET_MMC(func)
+#endif
+
+#if CONFIG_IS_ENABLED(CMD_USB)
+       #define BOOT_TARGET_USB(func) func(USB, usb, 0)
+#else
+       #define BOOT_TARGET_USB(func)
+#endif
+
+#if CONFIG_IS_ENABLED(CMD_PXE)
+       #define BOOT_TARGET_PXE(func) func(PXE, pxe, na)
+#else
+       #define BOOT_TARGET_PXE(func)
+#endif
+
+#if CONFIG_IS_ENABLED(CMD_DHCP)
+       #define BOOT_TARGET_DHCP(func) func(DHCP, dhcp, na)
+#else
+       #define BOOT_TARGET_DHCP(func)
+#endif
+
 #define BOOT_TARGET_DEVICES(func) \
-       func(MMC, mmc, 0) \
-       func(MMC, mmc, 1) \
-       func(USB, usb, 0) \
-       func(PXE, pxe, na) \
-       func(DHCP, dhcp, na)
+       BOOT_TARGET_MMC(func) \
+       BOOT_TARGET_USB(func) \
+       BOOT_TARGET_PXE(func) \
+       BOOT_TARGET_DHCP(func)
+
 #include <config_distro_bootcmd.h>
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
index 5adae68..32057b3 100644 (file)
@@ -18,5 +18,6 @@
        func(DHCP, dchp, na)
 
 #define CONFIG_SYS_MMC_ENV_DEV 1
+#define CONFIG_SYS_MONITOR_LEN (600 * 1024)
 
 #endif
index 2e6262f..bdcd5e9 100644 (file)
 #define BOOT_TARGET_DEVICES(func) \
        func(MMC, mmc, 0) \
        func(MMC, mmc, 1) \
+       func(MMC, mmc, 2) \
        func(SATA, sata, 0) \
        func(USB, usb, 0) \
        func(PXE, pxe, na) \
index 09e0ad5..4183928 100644 (file)
@@ -62,6 +62,7 @@ enum uclass_id {
        UCLASS_MMC,             /* SD / MMC card or chip */
        UCLASS_MOD_EXP,         /* RSA Mod Exp device */
        UCLASS_MTD,             /* Memory Technology Device (MTD) device */
+       UCLASS_NOP,             /* No-op devices */
        UCLASS_NORTHBRIDGE,     /* Intel Northbridge / SDRAM controller */
        UCLASS_NVME,            /* NVM Express device */
        UCLASS_PANEL,           /* Display panel, such as an LCD */
index d91156e..bb79de3 100644 (file)
@@ -1,14 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Copyright (C) 2015 Broadcom Corporation
- *
- * 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.
- *
- * This program is distributed "as is" WITHOUT ANY WARRANTY of any
- * kind, whether express or implied; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
  */
 
 #define BCM2835_AUX_CLOCK_UART         0
index a0c812b..2cec01f 100644 (file)
@@ -1,14 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Copyright (C) 2015 Broadcom Corporation
- *
- * 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.
- *
- * This program is distributed "as is" WITHOUT ANY WARRANTY of any
- * kind, whether express or implied; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
  */
 
 #define BCM2835_PLLA                   0
diff --git a/include/dt-bindings/net/microchip-lan78xx.h b/include/dt-bindings/net/microchip-lan78xx.h
new file mode 100644 (file)
index 0000000..0742ff0
--- /dev/null
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _DT_BINDINGS_MICROCHIP_LAN78XX_H
+#define _DT_BINDINGS_MICROCHIP_LAN78XX_H
+
+/* LED modes for LAN7800/LAN7850 embedded PHY */
+
+#define LAN78XX_LINK_ACTIVITY           0
+#define LAN78XX_LINK_1000_ACTIVITY      1
+#define LAN78XX_LINK_100_ACTIVITY       2
+#define LAN78XX_LINK_10_ACTIVITY        3
+#define LAN78XX_LINK_100_1000_ACTIVITY  4
+#define LAN78XX_LINK_10_1000_ACTIVITY   5
+#define LAN78XX_LINK_10_100_ACTIVITY    6
+#define LAN78XX_DUPLEX_COLLISION        8
+#define LAN78XX_COLLISION               9
+#define LAN78XX_ACTIVITY                10
+#define LAN78XX_AUTONEG_FAULT           12
+#define LAN78XX_FORCE_LED_OFF           14
+#define LAN78XX_FORCE_LED_ON            15
+
+#endif
index e4e4fdf..b5b2654 100644 (file)
@@ -1,14 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Header providing constants for bcm2835 pinctrl bindings.
  *
  * Copyright (C) 2015 Stefan Wahren <stefan.wahren@i2se.com>
- *
- * The code contained herein is licensed under the GNU General Public
- * License. You may obtain a copy of the GNU General Public License
- * Version 2 at the following locations:
- *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
  */
 
 #ifndef __DT_BINDINGS_PINCTRL_BCM2835_H__
diff --git a/include/dt-bindings/soc/bcm2835-pm.h b/include/dt-bindings/soc/bcm2835-pm.h
new file mode 100644 (file)
index 0000000..153d75b
--- /dev/null
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
+
+#ifndef _DT_BINDINGS_ARM_BCM2835_PM_H
+#define _DT_BINDINGS_ARM_BCM2835_PM_H
+
+#define BCM2835_POWER_DOMAIN_GRAFX             0
+#define BCM2835_POWER_DOMAIN_GRAFX_V3D         1
+#define BCM2835_POWER_DOMAIN_IMAGE             2
+#define BCM2835_POWER_DOMAIN_IMAGE_PERI                3
+#define BCM2835_POWER_DOMAIN_IMAGE_ISP         4
+#define BCM2835_POWER_DOMAIN_IMAGE_H264                5
+#define BCM2835_POWER_DOMAIN_USB               6
+#define BCM2835_POWER_DOMAIN_DSI0              7
+#define BCM2835_POWER_DOMAIN_DSI1              8
+#define BCM2835_POWER_DOMAIN_CAM0              9
+#define BCM2835_POWER_DOMAIN_CAM1              10
+#define BCM2835_POWER_DOMAIN_CCP2TX            11
+#define BCM2835_POWER_DOMAIN_HDMI              12
+
+#define BCM2835_POWER_DOMAIN_COUNT             13
+
+#define BCM2835_RESET_V3D                      0
+#define BCM2835_RESET_ISP                      1
+#define BCM2835_RESET_H264                     2
+
+#define BCM2835_RESET_COUNT                    3
+
+#endif /* _DT_BINDINGS_ARM_BCM2835_PM_H */
index 4de5d20..a36ecec 100644 (file)
@@ -242,7 +242,8 @@ struct efi_runtime_services {
                        unsigned long descriptor_size,
                        uint32_t descriptor_version,
                        struct efi_mem_desc *virtmap);
-       efi_status_t (*convert_pointer)(unsigned long dbg, void **address);
+       efi_status_t (EFIAPI *convert_pointer)(
+                       efi_uintn_t debug_disposition, void **address);
        efi_status_t (EFIAPI *get_variable)(u16 *variable_name,
                                            const efi_guid_t *vendor,
                                            u32 *attributes,
index f6252d0..6ac64fb 100644 (file)
 #define __SDP_H_
 
 int sdp_init(int controller_index);
-void sdp_handle(int controller_index);
+
+#ifdef CONFIG_SPL_BUILD
+#include <spl.h>
+
+int spl_sdp_handle(int controller_index, struct spl_image_info *spl_image);
+#else
+int sdp_handle(int controller_index);
+#endif
 
 #endif /* __SDP_H_ */
index 49857c5..aeb3aa0 100644 (file)
@@ -3,6 +3,7 @@
 # Copyright (c) 2013 Google, Inc
 
 obj-$(CONFIG_UT_DM) += bus.o
+obj-$(CONFIG_UT_DM) += nop.o
 obj-$(CONFIG_UT_DM) += test-driver.o
 obj-$(CONFIG_UT_DM) += test-fdt.o
 obj-$(CONFIG_UT_DM) += test-main.o
diff --git a/test/dm/nop.c b/test/dm/nop.c
new file mode 100644 (file)
index 0000000..2df29f3
--- /dev/null
@@ -0,0 +1,73 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Test for the NOP uclass
+ *
+ * (C) Copyright 2019 - Texas Instruments Incorporated - http://www.ti.com/
+ * Jean-Jacques Hiblot <jjhiblot@ti.com>
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <dm/ofnode.h>
+#include <dm/lists.h>
+#include <dm/device.h>
+#include <dm/test.h>
+#include <misc.h>
+#include <test/ut.h>
+
+static int noptest_bind(struct udevice *parent)
+{
+       ofnode ofnode = dev_read_first_subnode(parent);
+
+       while (ofnode_valid(ofnode)) {
+               struct udevice *dev;
+               const char *bind_flag = ofnode_read_string(ofnode, "bind");
+
+               if (bind_flag && (strcmp(bind_flag, "True") == 0))
+                       lists_bind_fdt(parent, ofnode, &dev, false);
+               ofnode = dev_read_next_subnode(ofnode);
+       }
+
+       return 0;
+}
+
+static const struct udevice_id noptest1_ids[] = {
+       {
+               .compatible = "sandbox,nop_sandbox1",
+       },
+       { }
+};
+
+U_BOOT_DRIVER(noptest_drv1) = {
+       .name   = "noptest1_drv",
+       .of_match       = noptest1_ids,
+       .id     = UCLASS_NOP,
+       .bind = noptest_bind,
+};
+
+static const struct udevice_id noptest2_ids[] = {
+       {
+               .compatible = "sandbox,nop_sandbox2",
+       },
+       { }
+};
+
+U_BOOT_DRIVER(noptest_drv2) = {
+       .name   = "noptest2_drv",
+       .of_match       = noptest2_ids,
+       .id     = UCLASS_NOP,
+};
+
+static int dm_test_nop(struct unit_test_state *uts)
+{
+       struct udevice *dev;
+
+       ut_assertok(uclass_get_device_by_name(UCLASS_NOP, "nop-test_0", &dev));
+       ut_assertok(uclass_get_device_by_name(UCLASS_NOP, "nop-test_1", &dev));
+       ut_asserteq(-ENODEV,
+                   uclass_get_device_by_name(UCLASS_NOP, "nop-test_2", &dev));
+
+       return 0;
+}
+
+DM_TEST(dm_test_nop, DM_TESTF_FLAT_TREE | DM_TESTF_SCAN_FDT);