Merge git://git.denx.de/u-boot-marvell
authorTom Rini <trini@konsulko.com>
Fri, 3 May 2019 18:22:23 +0000 (14:22 -0400)
committerTom Rini <trini@konsulko.com>
Fri, 3 May 2019 18:22:23 +0000 (14:22 -0400)
- Fix in kwbimage (return code checking) (Young Xiao)
- Misc updates to Turris Omnia (Marek)

175 files changed:
MAINTAINERS
arch/arm/Kconfig
arch/arm/cpu/armv8/start.S
arch/arm/dts/Makefile
arch/arm/dts/am335x-osd335x-common.dtsi [new file with mode: 0644]
arch/arm/dts/am335x-pocketbeagle.dts [new file with mode: 0644]
arch/arm/dts/at91sam9g20-taurus.dts
arch/arm/dts/k3-am654-base-board-u-boot.dtsi
arch/arm/dts/k3-am654-r5-base-board.dts
arch/arm/dts/logicpd-som-lv-baseboard.dtsi
arch/arm/dts/rk3399-evb.dts
arch/arm/dts/rk3399-firefly.dts
arch/arm/dts/rk3399-opp.dtsi [new file with mode: 0644]
arch/arm/dts/rk3399-orangepi-u-boot.dtsi [new file with mode: 0644]
arch/arm/dts/rk3399-orangepi.dts [new file with mode: 0644]
arch/arm/dts/rk3399-puma.dtsi
arch/arm/dts/rk3399-u-boot.dtsi [new file with mode: 0644]
arch/arm/include/asm/arch-rockchip/ddr_rk3188.h
arch/arm/include/asm/arch-rockchip/hardware.h
arch/arm/include/asm/gpio.h
arch/arm/lib/vectors.S
arch/arm/mach-rockchip/Kconfig
arch/arm/mach-rockchip/boot_mode.c
arch/arm/mach-rockchip/bootrom.c
arch/arm/mach-rockchip/rk3036-board-spl.c
arch/arm/mach-rockchip/rk3036-board.c
arch/arm/mach-rockchip/rk3036/Kconfig
arch/arm/mach-rockchip/rk3036/Makefile
arch/arm/mach-rockchip/rk3036/clk_rk3036.c
arch/arm/mach-rockchip/rk3036/rk3036.c [new file with mode: 0644]
arch/arm/mach-rockchip/rk3036/sdram_rk3036.c
arch/arm/mach-rockchip/rk3036/syscon_rk3036.c
arch/arm/mach-rockchip/rk3128-board.c
arch/arm/mach-rockchip/rk3128/Kconfig
arch/arm/mach-rockchip/rk3128/clk_rk3128.c
arch/arm/mach-rockchip/rk3128/syscon_rk3128.c
arch/arm/mach-rockchip/rk3188-board-spl.c
arch/arm/mach-rockchip/rk3188-board.c
arch/arm/mach-rockchip/rk3188/Kconfig
arch/arm/mach-rockchip/rk3188/Makefile
arch/arm/mach-rockchip/rk3188/clk_rk3188.c
arch/arm/mach-rockchip/rk3188/rk3188.c [new file with mode: 0644]
arch/arm/mach-rockchip/rk3188/syscon_rk3188.c
arch/arm/mach-rockchip/rk322x-board-spl.c
arch/arm/mach-rockchip/rk322x-board.c
arch/arm/mach-rockchip/rk322x/Kconfig
arch/arm/mach-rockchip/rk322x/Makefile
arch/arm/mach-rockchip/rk322x/clk_rk322x.c
arch/arm/mach-rockchip/rk322x/rk322x.c [new file with mode: 0644]
arch/arm/mach-rockchip/rk322x/syscon_rk322x.c
arch/arm/mach-rockchip/rk3288-board-spl.c
arch/arm/mach-rockchip/rk3288-board-tpl.c
arch/arm/mach-rockchip/rk3288-board.c
arch/arm/mach-rockchip/rk3288/Kconfig
arch/arm/mach-rockchip/rk3288/clk_rk3288.c
arch/arm/mach-rockchip/rk3288/rk3288.c
arch/arm/mach-rockchip/rk3288/syscon_rk3288.c
arch/arm/mach-rockchip/rk3328/Kconfig
arch/arm/mach-rockchip/rk3328/clk_rk3328.c
arch/arm/mach-rockchip/rk3328/rk3328.c
arch/arm/mach-rockchip/rk3328/syscon_rk3328.c
arch/arm/mach-rockchip/rk3368-board-spl.c
arch/arm/mach-rockchip/rk3368-board-tpl.c
arch/arm/mach-rockchip/rk3368/Kconfig
arch/arm/mach-rockchip/rk3368/clk_rk3368.c
arch/arm/mach-rockchip/rk3368/rk3368.c
arch/arm/mach-rockchip/rk3368/syscon_rk3368.c
arch/arm/mach-rockchip/rk3399-board-spl.c
arch/arm/mach-rockchip/rk3399-board.c
arch/arm/mach-rockchip/rk3399/Kconfig
arch/arm/mach-rockchip/rk3399/clk_rk3399.c
arch/arm/mach-rockchip/rk3399/rk3399.c
arch/arm/mach-rockchip/rk3399/syscon_rk3399.c
arch/arm/mach-rockchip/rk_timer.c
arch/arm/mach-rockchip/rv1108/Kconfig
arch/arm/mach-rockchip/rv1108/clk_rv1108.c
arch/arm/mach-rockchip/rv1108/syscon_rv1108.c
arch/arm/mach-rockchip/sdram_common.c
board/elgin/elgin_rv1108/elgin_rv1108.c
board/rockchip/evb_rk3036/evb_rk3036.c
board/rockchip/evb_rk3229/evb_rk3229.c
board/rockchip/evb_rk3399/MAINTAINERS
board/rockchip/evb_rk3399/evb-rk3399.c
board/rockchip/evb_rv1108/evb_rv1108.c
board/rockchip/kylin_rk3036/kylin_rk3036.c
board/rockchip/sheep_rk3368/sheep_rk3368.c
board/siemens/taurus/Kconfig
board/siemens/taurus/taurus.c
board/theobroma-systems/lion_rk3368/lion_rk3368.c
board/theobroma-systems/puma_rk3399/puma-rk3399.c
board/ti/am335x/mux.c
board/vamrs/rock960_rk3399/rock960-rk3399.c
cmd/bootefi.c
cmd/efidebug.c
cmd/gpt.c
cmd/nvedit_efi.c
cmd/rockusb.c
configs/am335x_evm_defconfig
configs/axm_defconfig
configs/kylin-rk3036_defconfig
configs/orangepi-rk3399_defconfig [new file with mode: 0644]
configs/puma-rk3399_defconfig
configs/taurus_defconfig
disk/part_efi.c
doc/README.davinci
doc/git-mailrc
drivers/clk/rockchip/clk_rk3036.c
drivers/clk/rockchip/clk_rk3128.c
drivers/clk/rockchip/clk_rk3188.c
drivers/clk/rockchip/clk_rk322x.c
drivers/clk/rockchip/clk_rk3288.c
drivers/clk/rockchip/clk_rk3328.c
drivers/clk/rockchip/clk_rk3368.c
drivers/clk/rockchip/clk_rk3399.c
drivers/clk/rockchip/clk_rv1108.c
drivers/dma/ti/k3-udma.c
drivers/firmware/ti_sci.c
drivers/gpio/rk_gpio.c
drivers/i2c/rk_i2c.c
drivers/mmc/rockchip_dw_mmc.c
drivers/net/gmac_rockchip.c
drivers/pinctrl/pinctrl-uclass.c
drivers/pwm/rk_pwm.c
drivers/ram/rockchip/dmc-rk3368.c
drivers/ram/rockchip/sdram_rk3128.c
drivers/ram/rockchip/sdram_rk3188.c
drivers/ram/rockchip/sdram_rk322x.c
drivers/ram/rockchip/sdram_rk3288.c
drivers/ram/rockchip/sdram_rk3328.c
drivers/ram/rockchip/sdram_rk3399.c
drivers/reset/reset-rockchip.c
drivers/serial/serial_rockchip.c
drivers/sound/rockchip_sound.c
drivers/spi/rk_spi.c
drivers/sysreset/sysreset_rockchip.c
drivers/timer/rockchip_timer.c
drivers/usb/gadget/f_rockusb.c
drivers/video/rockchip/rk3288_hdmi.c
drivers/video/rockchip/rk3288_mipi.c
drivers/video/rockchip/rk3288_vop.c
drivers/video/rockchip/rk3399_hdmi.c
drivers/video/rockchip/rk3399_mipi.c
drivers/video/rockchip/rk3399_vop.c
drivers/video/rockchip/rk_edp.c
drivers/video/rockchip/rk_hdmi.c
drivers/video/rockchip/rk_lvds.c
drivers/video/rockchip/rk_mipi.c
drivers/video/rockchip/rk_vop.c
drivers/video/rockchip/rk_vop.h
drivers/watchdog/Kconfig
fs/btrfs/btrfs.c
fs/btrfs/super.c
include/configs/rk3036_common.h
include/configs/rk3188_common.h
include/configs/rk322x_common.h
include/configs/rk3288_common.h
include/configs/rk3368_common.h
include/configs/rv1108_common.h
include/configs/taurus.h
include/dt-bindings/pinctrl/k3-am65.h [deleted file]
include/dt-bindings/pinctrl/k3.h [new file with mode: 0644]
include/efi_loader.h
include/efi_selftest.h
include/fs.h
lib/Kconfig
lib/efi_loader/efi_bootmgr.c
lib/efi_loader/efi_boottime.c
lib/efi_loader/efi_memory.c
lib/efi_loader/efi_setup.c
lib/efi_selftest/efi_selftest_miniapp_exit.c
lib/efi_selftest/efi_selftest_startimage_exit.c
lib/uuid.c
lib/vsprintf.c
scripts/config_whitelist.txt
tools/Makefile

index 09f31cd483b610f81c1c16fb696d7e4e1ceed33c..5891fd08b6a700c967f74dc441089dcfbffb037f 100644 (file)
@@ -239,6 +239,7 @@ F:  arch/arm/mach-rmobile/
 ARM ROCKCHIP
 M:     Simon Glass <sjg@chromium.org>
 M:     Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
+M:     Kever Yang <kever.yang@rock-chips.com>
 S:     Maintained
 T:     git git://git.denx.de/u-boot-rockchip.git
 F:     arch/arm/include/asm/arch-rockchip/
@@ -586,7 +587,7 @@ S:  Maintained
 F:     arch/mips/mach-jz47xx/
 
 MMC
-M:     Jaehoon Chung <jh80.chung@samsung.com>
+M:     Peng Fan <peng.fan@nxp.com>
 S:     Maintained
 T:     git git://git.denx.de/u-boot-mmc.git
 F:     drivers/mmc/
index e84f3d7debf13749d1cec82b50fc45b4eacab984..49f01f1ff17ddbc331525a3af441d888aefecf28 100644 (file)
@@ -1439,6 +1439,7 @@ config ARCH_ROCKCHIP
        select SYS_THUMB_BUILD if !ARM64
        imply ADC
        imply CMD_DM
+       imply DEBUG_UART_BOARD_INIT
        imply DISTRO_DEFAULTS
        imply FAT_WRITE
        imply SARADC_ROCKCHIP
index fe52166e28f08f637094dfb714bebe6bc2e529ad..ecee9e37a501e228d7bc3f450d37a387d37c8ed3 100644 (file)
@@ -26,7 +26,11 @@ _start:
  * order to boot, allow them to set that in their boot0.h file and then
  * use it here.
  */
+#ifdef CONFIG_ARCH_ROCKCHIP
+#include <asm/arch-rockchip/boot0.h>
+#else
 #include <asm/arch/boot0.h>
+#endif
 #else
        b       reset
 #endif
index dfa5b02958779edc891f4a376c2b7d3d70cd6b8f..8e082f28403a8d9510719f6abc84abfef9ece75d 100644 (file)
@@ -74,6 +74,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += \
        rk3288-fennec.dtb \
        rk3288-firefly.dtb \
        rk3288-miqi.dtb \
+       rk3399-orangepi.dtb \
        rk3288-phycore-rdk.dtb \
        rk3288-popmetal.dtb \
        rk3288-rock2-square.dtb \
@@ -255,6 +256,7 @@ dtb-$(CONFIG_AM33XX) += \
        am335x-evmsk.dtb \
        am335x-bonegreen.dtb \
        am335x-icev2.dtb \
+       am335x-pocketbeagle.dtb \
        am335x-pxm50.dtb \
        am335x-rut.dtb \
        am335x-shc.dtb \
diff --git a/arch/arm/dts/am335x-osd335x-common.dtsi b/arch/arm/dts/am335x-osd335x-common.dtsi
new file mode 100644 (file)
index 0000000..f8ff473
--- /dev/null
@@ -0,0 +1,124 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Author: Robert Nelson <robertcnelson@gmail.com>
+ */
+
+/ {
+       cpus {
+               cpu@0 {
+                       cpu0-supply = <&dcdc2_reg>;
+               };
+       };
+
+       memory@80000000 {
+               device_type = "memory";
+               reg = <0x80000000 0x20000000>; /* 512 MB */
+       };
+};
+
+&cpu0_opp_table {
+       /*
+       * Octavo Systems:
+       * The EFUSE_SMA register is not programmed for any of the AM335x wafers
+       * we get and we are not programming them during our production test.
+       * Therefore, from a DEVICE_ID revision point of view, the silicon looks
+       * like it is Revision 2.1.  However, from an EFUSE_SMA point of view for
+       * the HW OPP table, the silicon looks like it is Revision 1.0 (ie the
+       * EFUSE_SMA register reads as all zeros).
+       */
+       oppnitro-1000000000 {
+               opp-supported-hw = <0x06 0x0100>;
+       };
+};
+
+&am33xx_pinmux {
+       i2c0_pins: pinmux-i2c0-pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0)       /* (C17) I2C0_SDA.I2C0_SDA */
+                       AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0)       /* (C16) I2C0_SCL.I2C0_SCL */
+               >;
+       };
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins>;
+
+       status = "okay";
+       clock-frequency = <400000>;
+
+       tps: tps@24 {
+               reg = <0x24>;
+       };
+};
+
+/include/ "tps65217.dtsi"
+
+&tps {
+       interrupts = <7>; /* NMI */
+       interrupt-parent = <&intc>;
+
+       ti,pmic-shutdown-controller;
+
+       pwrbutton {
+               interrupts = <2>;
+               status = "okay";
+       };
+
+       regulators {
+               dcdc1_reg: regulator@0 {
+                       regulator-name = "vdds_dpr";
+                       regulator-always-on;
+               };
+
+               dcdc2_reg: regulator@1 {
+                       /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */
+                       regulator-name = "vdd_mpu";
+                       regulator-min-microvolt = <925000>;
+                       regulator-max-microvolt = <1351500>;
+                       regulator-boot-on;
+                       regulator-always-on;
+               };
+
+               dcdc3_reg: regulator@2 {
+                       /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
+                       regulator-name = "vdd_core";
+                       regulator-min-microvolt = <925000>;
+                       regulator-max-microvolt = <1150000>;
+                       regulator-boot-on;
+                       regulator-always-on;
+               };
+
+               ldo1_reg: regulator@3 {
+                       regulator-name = "vio,vrtc,vdds";
+                       regulator-always-on;
+               };
+
+               ldo2_reg: regulator@4 {
+                       regulator-name = "vdd_3v3aux";
+                       regulator-always-on;
+               };
+
+               ldo3_reg: regulator@5 {
+                       regulator-name = "vdd_1v8";
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-always-on;
+               };
+
+               ldo4_reg: regulator@6 {
+                       regulator-name = "vdd_3v3a";
+                       regulator-always-on;
+               };
+       };
+};
+
+&aes {
+       status = "okay";
+};
+
+&sham {
+       status = "okay";
+};
diff --git a/arch/arm/dts/am335x-pocketbeagle.dts b/arch/arm/dts/am335x-pocketbeagle.dts
new file mode 100644 (file)
index 0000000..62fe5ca
--- /dev/null
@@ -0,0 +1,237 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Author: Robert Nelson <robertcnelson@gmail.com>
+ */
+/dts-v1/;
+
+#include "am33xx.dtsi"
+#include "am335x-osd335x-common.dtsi"
+
+/ {
+       model = "TI AM335x PocketBeagle";
+       compatible = "ti,am335x-pocketbeagle", "ti,am335x-bone", "ti,am33xx";
+
+       chosen {
+               stdout-path = &uart0;
+       };
+
+       leds {
+               pinctrl-names = "default";
+               pinctrl-0 = <&usr_leds_pins>;
+
+               compatible = "gpio-leds";
+
+               usr0 {
+                       label = "beaglebone:green:usr0";
+                       gpios = <&gpio1 21 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "heartbeat";
+                       default-state = "off";
+               };
+
+               usr1 {
+                       label = "beaglebone:green:usr1";
+                       gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "mmc0";
+                       default-state = "off";
+               };
+
+               usr2 {
+                       label = "beaglebone:green:usr2";
+                       gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "cpu0";
+                       default-state = "off";
+               };
+
+               usr3 {
+                       label = "beaglebone:green:usr3";
+                       gpios = <&gpio1 24 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+               };
+       };
+
+       vmmcsd_fixed: fixedregulator0 {
+               compatible = "regulator-fixed";
+               regulator-name = "vmmcsd_fixed";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+       };
+};
+
+&am33xx_pinmux {
+       i2c2_pins: pinmux-i2c2-pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x97c, PIN_INPUT_PULLUP | MUX_MODE3)       /* (D17) uart1_rtsn.I2C2_SCL */
+                       AM33XX_IOPAD(0x978, PIN_INPUT_PULLUP | MUX_MODE3)       /* (D18) uart1_ctsn.I2C2_SDA */
+               >;
+       };
+
+       ehrpwm0_pins: pinmux-ehrpwm0-pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x990, PIN_OUTPUT_PULLDOWN | MUX_MODE1)    /* (A13) mcasp0_aclkx.ehrpwm0A */
+               >;
+       };
+
+       ehrpwm1_pins: pinmux-ehrpwm1-pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x848, PIN_OUTPUT_PULLDOWN | MUX_MODE6)    /* (U14) gpmc_a2.ehrpwm1A */
+               >;
+       };
+
+       mmc0_pins: pinmux-mmc0-pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE7)              /* (C15) spi0_cs1.gpio0[6] */
+                       AM33XX_IOPAD(0x8fc, PIN_INPUT_PULLUP | MUX_MODE0)       /* (G16) mmc0_dat0.mmc0_dat0 */
+                       AM33XX_IOPAD(0x8f8, PIN_INPUT_PULLUP | MUX_MODE0)       /* (G15) mmc0_dat1.mmc0_dat1 */
+                       AM33XX_IOPAD(0x8f4, PIN_INPUT_PULLUP | MUX_MODE0)       /* (F18) mmc0_dat2.mmc0_dat2 */
+                       AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0)       /* (F17) mmc0_dat3.mmc0_dat3 */
+                       AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0)       /* (G18) mmc0_cmd.mmc0_cmd */
+                       AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0)       /* (G17) mmc0_clk.mmc0_clk */
+                       AM33XX_IOPAD(0x9a0, PIN_INPUT | MUX_MODE4)              /* (B12) mcasp0_aclkr.mmc0_sdwp */
+               >;
+       };
+
+       spi0_pins: pinmux-spi0-pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x950, PIN_INPUT_PULLUP | MUX_MODE0)       /* (A17) spi0_sclk.spi0_sclk */
+                       AM33XX_IOPAD(0x954, PIN_INPUT_PULLUP | MUX_MODE0)       /* (B17) spi0_d0.spi0_d0 */
+                       AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE0)       /* (B16) spi0_d1.spi0_d1 */
+                       AM33XX_IOPAD(0x95c, PIN_INPUT_PULLUP | MUX_MODE0)       /* (A16) spi0_cs0.spi0_cs0 */
+               >;
+       };
+
+       spi1_pins: pinmux-spi1-pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x964, PIN_INPUT_PULLUP | MUX_MODE4)       /* (C18) eCAP0_in_PWM0_out.spi1_sclk */
+                       AM33XX_IOPAD(0x968, PIN_INPUT_PULLUP | MUX_MODE4)       /* (E18) uart0_ctsn.spi1_d0 */
+                       AM33XX_IOPAD(0x96c, PIN_INPUT_PULLUP | MUX_MODE4)       /* (E17) uart0_rtsn.spi1_d1 */
+                       AM33XX_IOPAD(0x9b0, PIN_INPUT_PULLUP | MUX_MODE4)       /* (A15) xdma_event_intr0.spi1_cs1 */
+               >;
+       };
+
+       usr_leds_pins: pinmux-usr-leds-pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x854, PIN_OUTPUT | MUX_MODE7)             /* (V15) gpmc_a5.gpio1[21] - USR_LED_0 */
+                       AM33XX_IOPAD(0x858, PIN_OUTPUT | MUX_MODE7)             /* (U15) gpmc_a6.gpio1[22] - USR_LED_1 */
+                       AM33XX_IOPAD(0x85c, PIN_OUTPUT | MUX_MODE7)             /* (T15) gpmc_a7.gpio1[23] - USR_LED_2 */
+                       AM33XX_IOPAD(0x860, PIN_OUTPUT | MUX_MODE7)             /* (V16) gpmc_a8.gpio1[24] - USR_LED_3 */
+               >;
+       };
+
+       uart0_pins: pinmux-uart0-pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0)       /* (E15) uart0_rxd.uart0_rxd */
+                       AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* (E16) uart0_txd.uart0_txd */
+               >;
+       };
+
+       uart4_pins: pinmux-uart4-pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x870, PIN_INPUT_PULLUP | MUX_MODE6)       /* (T17) gpmc_wait0.uart4_rxd */
+                       AM33XX_IOPAD(0x874, PIN_OUTPUT_PULLDOWN | MUX_MODE6)    /* (U17) gpmc_wpn.uart4_txd */
+               >;
+       };
+};
+
+&epwmss0 {
+       status = "okay";
+};
+
+&ehrpwm0 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&ehrpwm0_pins>;
+};
+
+&epwmss1 {
+       status = "okay";
+};
+
+&ehrpwm1 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&ehrpwm1_pins>;
+};
+
+&i2c0 {
+       eeprom: eeprom@50 {
+               compatible = "atmel,24c256";
+               reg = <0x50>;
+       };
+};
+
+&i2c2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins>;
+
+       status = "okay";
+       clock-frequency = <400000>;
+};
+
+&mmc1 {
+       status = "okay";
+       vmmc-supply = <&vmmcsd_fixed>;
+       bus-width = <4>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins>;
+       cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
+};
+
+&rtc {
+       system-power-controller;
+};
+
+&tscadc {
+       status = "okay";
+       adc {
+               ti,adc-channels = <0 1 2 3 4 5 6 7>;
+               ti,chan-step-avg = <16 16 16 16 16 16 16 16>;
+               ti,chan-step-opendelay = <0x98 0x98 0x98 0x98 0x98 0x98 0x98 0x98>;
+               ti,chan-step-sampledelay = <0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0>;
+       };
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins>;
+
+       status = "okay";
+};
+
+&uart4 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart4_pins>;
+
+       status = "okay";
+};
+
+&usb {
+       status = "okay";
+};
+
+&usb_ctrl_mod {
+       status = "okay";
+};
+
+&usb0_phy {
+       status = "okay";
+};
+
+&usb0 {
+       status = "okay";
+       dr_mode = "otg";
+};
+
+&usb1_phy {
+       status = "okay";
+};
+
+&usb1 {
+       status = "okay";
+       dr_mode = "host";
+};
+
+&cppi41dma  {
+       status = "okay";
+};
index cee228bb8cf5e57c4449f3eb954bfb8cee32003b..c00c5a8b8dda6ba65384496bc962151aaf5fa2a1 100644 (file)
@@ -15,7 +15,7 @@
 
 / {
        model = "Siemens taurus";
-       compatible = "atmel,at91sam9g20ek", "atmel,at91sam9g20", "atmel,at91sam9";
+       compatible = "atmel,at91sam9g20", "atmel,at91sam9";
 
        chosen {
                u-boot,dm-pre-reloc;
                        clock-frequency = <18432000>;
                };
        };
+};
 
-       ahb {
-               apb {
-                       pinctrl@fffff400 {
-                               board {
-                                       pinctrl_pck0_as_mck: pck0_as_mck {
-                                               atmel,pins =
-                                                       <AT91_PIOC 1 AT91_PERIPH_B AT91_PINCTRL_NONE>;  /* PC1 periph B */
-                                       };
-
-                               };
-                       };
-
-                       dbgu: serial@fffff200 {
-                               u-boot,dm-pre-reloc;
-                               status = "okay";
-                       };
-
-                       usart0: serial@fffb0000 {
-                               pinctrl-0 =
-                                       <&pinctrl_usart0
-                                        &pinctrl_usart0_rts
-                                        &pinctrl_usart0_cts
-                                        &pinctrl_usart0_dtr_dsr
-                                        &pinctrl_usart0_dcd
-                                        &pinctrl_usart0_ri>;
-                               status = "okay";
-                       };
-
-                       usart1: serial@fffb4000 {
-                               status = "okay";
-                       };
-
-                       macb0: ethernet@fffc4000 {
-                               phy-mode = "rmii";
-                               status = "okay";
-                       };
-
-                       usb1: gadget@fffa4000 {
-                               atmel,vbus-gpio = <&pioC 5 GPIO_ACTIVE_HIGH>;
-                               status = "okay";
-                       };
-
-                       ssc0: ssc@fffbc000 {
-                               status = "okay";
-                               pinctrl-0 = <&pinctrl_ssc0_tx>;
-                       };
-
-                       spi0: spi@fffc8000 {
-                               cs-gpios = <0>, <&pioC 11 0>, <0>, <0>;
-                               mtd_dataflash@0 {
-                                       compatible = "atmel,at45", "atmel,dataflash";
-                                       spi-max-frequency = <50000000>;
-                                       reg = <1>;
-                               };
-                       };
-
-                       rtc@fffffd20 {
-                               atmel,rtt-rtc-time-reg = <&gpbr 0x0>;
-                               status = "okay";
-                       };
-
-                       watchdog@fffffd40 {
-                               timeout-sec = <15>;
-                               status = "okay";
-                       };
-
-                       gpbr: syscon@fffffd50 {
-                               status = "okay";
-                       };
-               };
+&dbgu {
+       status = "okay";
+};
 
-               nand0: nand@40000000 {
-                       nand-bus-width = <8>;
-                       nand-ecc-mode = "soft";
-                       nand-on-flash-bbt;
-                       status = "okay";
-               };
+&gpbr {
+       status = "okay";
+};
+
+&macb0 {
+       phy-mode = "rmii";
+       status = "okay";
+};
 
-               usb0: ohci@00500000 {
-                       num-ports = <2>;
-                       status = "okay";
+&nand0 {
+       nand-bus-width = <8>;
+       nand-ecc-mode = "soft";
+       nand-on-flash-bbt;
+       status = "okay";
+};
+
+&pinctrl {
+       u-boot,dm-pre-reloc;
+       board {
+               pinctrl_pck0_as_mck: pck0_as_mck {
+                       atmel,pins =
+                       /* PC1 periph B */
+                       <AT91_PIOC 1 AT91_PERIPH_B AT91_PINCTRL_NONE>;
                };
+
        };
 };
+
+&rtc {
+       atmel,rtt-rtc-time-reg = <&gpbr 0x0>;
+       status = "okay";
+};
+
+&spi0 {
+       cs-gpios = <0>, <&pioC 11 0>, <0>, <0>;
+       mtd_dataflash@0 {
+               compatible = "atmel,at45", "atmel,dataflash";
+               spi-max-frequency = <50000000>;
+               reg = <1>;
+       };
+};
+
+&ssc0 {
+       status = "okay";
+       pinctrl-0 = <&pinctrl_ssc0_tx>;
+};
+
+&usart0 {
+       pinctrl-0 =
+               <&pinctrl_usart0
+                &pinctrl_usart0_rts
+                &pinctrl_usart0_cts
+                &pinctrl_usart0_dtr_dsr
+                &pinctrl_usart0_dcd
+                &pinctrl_usart0_ri>;
+       status = "okay";
+};
+
+&usart1 {
+       status = "okay";
+};
+
+&usb0 {
+       num-ports = <2>;
+       status = "okay";
+};
+
+&usb1 {
+       atmel,vbus-gpio = <&pioC 5 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
+
+&watchdog {
+       u-boot,dm-pre-reloc;
+       timeout-sec = <15>;
+       status = "okay";
+};
index c5d23d0203abc755eea97b7b90405033ec9ce339..f5c8253831a2f27c12fbc7359462ca394873aeff 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
  */
 
-#include <dt-bindings/pinctrl/k3-am65.h>
+#include <dt-bindings/pinctrl/k3.h>
 #include <dt-bindings/dma/k3-udma.h>
 
 / {
        u-boot,dm-spl;
        main_uart0_pins_default: main_uart0_pins_default {
                pinctrl-single,pins = <
-                       AM65X_IOPAD(0x01e4, PIN_INPUT | MUX_MODE0)      /* (AF11) UART0_RXD */
-                       AM65X_IOPAD(0x01e8, PIN_OUTPUT | MUX_MODE0)     /* (AE11) UART0_TXD */
-                       AM65X_IOPAD(0x01ec, PIN_INPUT | MUX_MODE0)      /* (AG11) UART0_CTSn */
-                       AM65X_IOPAD(0x01f0, PIN_OUTPUT | MUX_MODE0)     /* (AD11) UART0_RTSn */
+                       AM65X_IOPAD(0x01e4, PIN_INPUT, 0)       /* (AF11) UART0_RXD */
+                       AM65X_IOPAD(0x01e8, PIN_OUTPUT, 0)      /* (AE11) UART0_TXD */
+                       AM65X_IOPAD(0x01ec, PIN_INPUT, 0)       /* (AG11) UART0_CTSn */
+                       AM65X_IOPAD(0x01f0, PIN_OUTPUT, 0)      /* (AD11) UART0_RTSn */
                >;
                u-boot,dm-spl;
        };
 
        main_mmc0_pins_default: main_mmc0_pins_default {
                pinctrl-single,pins = <
-                       AM65X_IOPAD(0x01a8, PIN_INPUT_PULLDOWN | MUX_MODE0) /* (B25) MMC0_CLK */
-                       AM65X_IOPAD(0x01aC, PIN_INPUT_PULLUP | MUX_MODE0) /* (B27) MMC0_CMD */
-                       AM65X_IOPAD(0x01a4, PIN_INPUT_PULLUP | MUX_MODE0) /* (A26) MMC0_DAT0 */
-                       AM65X_IOPAD(0x01a0, PIN_INPUT_PULLUP | MUX_MODE0) /* (E25) MMC0_DAT1 */
-                       AM65X_IOPAD(0x019c, PIN_INPUT_PULLUP | MUX_MODE0) /* (C26) MMC0_DAT2 */
-                       AM65X_IOPAD(0x0198, PIN_INPUT_PULLUP | MUX_MODE0) /* (A25) MMC0_DAT3 */
-                       AM65X_IOPAD(0x0194, PIN_INPUT_PULLUP | MUX_MODE0) /* (E24) MMC0_DAT4 */
-                       AM65X_IOPAD(0x0190, PIN_INPUT_PULLUP | MUX_MODE0) /* (A24) MMC0_DAT5 */
-                       AM65X_IOPAD(0x018c, PIN_INPUT_PULLUP | MUX_MODE0) /* (B26) MMC0_DAT6 */
-                       AM65X_IOPAD(0x0188, PIN_INPUT_PULLUP | MUX_MODE0) /* (D25) MMC0_DAT7 */
-                       AM65X_IOPAD(0x01b0, PIN_INPUT | MUX_MODE0) /* (C25) MMC0_DS */
+                       AM65X_IOPAD(0x01a8, PIN_INPUT_PULLDOWN, 0)      /* (B25) MMC0_CLK */
+                       AM65X_IOPAD(0x01aC, PIN_INPUT_PULLUP, 0)        /* (B27) MMC0_CMD */
+                       AM65X_IOPAD(0x01a4, PIN_INPUT_PULLUP, 0)        /* (A26) MMC0_DAT0 */
+                       AM65X_IOPAD(0x01a0, PIN_INPUT_PULLUP, 0)        /* (E25) MMC0_DAT1 */
+                       AM65X_IOPAD(0x019c, PIN_INPUT_PULLUP, 0)        /* (C26) MMC0_DAT2 */
+                       AM65X_IOPAD(0x0198, PIN_INPUT_PULLUP, 0)        /* (A25) MMC0_DAT3 */
+                       AM65X_IOPAD(0x0194, PIN_INPUT_PULLUP, 0)        /* (E24) MMC0_DAT4 */
+                       AM65X_IOPAD(0x0190, PIN_INPUT_PULLUP, 0)        /* (A24) MMC0_DAT5 */
+                       AM65X_IOPAD(0x018c, PIN_INPUT_PULLUP, 0)        /* (B26) MMC0_DAT6 */
+                       AM65X_IOPAD(0x0188, PIN_INPUT_PULLUP, 0)        /* (D25) MMC0_DAT7 */
+                       AM65X_IOPAD(0x01b0, PIN_INPUT, 0)                       /* (C25) MMC0_DS */
                >;
                u-boot,dm-spl;
        };
 
        main_mmc1_pins_default: main_mmc1_pins_default {
                pinctrl-single,pins = <
-                       AM65X_IOPAD(0x02d4, PIN_INPUT_PULLDOWN | MUX_MODE0) /* (C27) MMC1_CLK */
-                       AM65X_IOPAD(0x02d8, PIN_INPUT_PULLUP | MUX_MODE0) /* (C28) MMC1_CMD */
-                       AM65X_IOPAD(0x02d0, PIN_INPUT_PULLUP | MUX_MODE0) /* (D28) MMC1_DAT0 */
-                       AM65X_IOPAD(0x02cc, PIN_INPUT_PULLUP | MUX_MODE0) /* (E27) MMC1_DAT1 */
-                       AM65X_IOPAD(0x02c8, PIN_INPUT_PULLUP | MUX_MODE0) /* (D26) MMC1_DAT2 */
-                       AM65X_IOPAD(0x02c4, PIN_INPUT_PULLUP | MUX_MODE0) /* (D27) MMC1_DAT3 */
-                       AM65X_IOPAD(0x02dc, PIN_INPUT_PULLUP | MUX_MODE0) /* (B24) MMC1_SDCD */
-                       AM65X_IOPAD(0x02e0, PIN_INPUT | MUX_MODE0) /* (C24) MMC1_SDWP */
+                       AM65X_IOPAD(0x02d4, PIN_INPUT_PULLDOWN, 0)      /* (C27) MMC1_CLK */
+                       AM65X_IOPAD(0x02d8, PIN_INPUT_PULLUP, 0)        /* (C28) MMC1_CMD */
+                       AM65X_IOPAD(0x02d0, PIN_INPUT_PULLUP, 0)        /* (D28) MMC1_DAT0 */
+                       AM65X_IOPAD(0x02cc, PIN_INPUT_PULLUP, 0)        /* (E27) MMC1_DAT1 */
+                       AM65X_IOPAD(0x02c8, PIN_INPUT_PULLUP, 0)        /* (D26) MMC1_DAT2 */
+                       AM65X_IOPAD(0x02c4, PIN_INPUT_PULLUP, 0)        /* (D27) MMC1_DAT3 */
+                       AM65X_IOPAD(0x02dc, PIN_INPUT_PULLUP, 0)        /* (B24) MMC1_SDCD */
+                       AM65X_IOPAD(0x02e0, PIN_INPUT, 0)                       /* (C24) MMC1_SDWP */
                >;
                u-boot,dm-spl;
        };
index 081a2eceb291e3479293079b21a17c4058ca4198..a07038be70912b490eb65769da10818944f6995e 100644 (file)
@@ -99,7 +99,7 @@
 };
 
 &dmsc {
-       mboxes= <&mcu_secproxy 7>, <&mcu_secproxy 6>, <&mcu_secproxy 5>;
+       mboxes= <&mcu_secproxy 8>, <&mcu_secproxy 6>, <&mcu_secproxy 5>;
        mbox-names = "tx", "rx", "notify";
        ti,host-id = <4>;
        ti,secure-host;
        u-boot,dm-spl;
        wkup_uart0_pins_default: wkup_uart0_pins_default {
                pinctrl-single,pins = <
-                       AM65X_WKUP_IOPAD(0x00a0, PIN_INPUT | MUX_MODE0) /* (AB1) WKUP_UART0_RXD */
-                       AM65X_WKUP_IOPAD(0x00a4, PIN_OUTPUT | MUX_MODE0) /* (AB5) WKUP_UART0_TXD */
-                       AM65X_WKUP_IOPAD(0x00c8, PIN_INPUT | MUX_MODE1) /* (AC2) WKUP_GPIO0_6.WKUP_UART0_CTSn */
-                       AM65X_WKUP_IOPAD(0x00cc, PIN_OUTPUT | MUX_MODE1) /* (AC1) WKUP_GPIO0_7.WKUP_UART0_RTSn */
+                       AM65X_WKUP_IOPAD(0x00a0, PIN_INPUT, 0)  /* (AB1) WKUP_UART0_RXD */
+                       AM65X_WKUP_IOPAD(0x00a4, PIN_OUTPUT0) /* (AB5) WKUP_UART0_TXD */
+                       AM65X_WKUP_IOPAD(0x00c8, PIN_INPUT, 1)  /* (AC2) WKUP_GPIO0_6.WKUP_UART0_CTSn */
+                       AM65X_WKUP_IOPAD(0x00cc, PIN_OUTPUT1) /* (AC1) WKUP_GPIO0_7.WKUP_UART0_RTSn */
                >;
                u-boot,dm-spl;
        };
 
        wkup_vtt_pins_default: wkup_vtt_pins_default {
                pinctrl-single,pins = <
-                       AM65X_WKUP_IOPAD(0x0040, PIN_OUTPUT_PULLUP | MUX_MODE7) /* WKUP_GPIO0_28 */
+                       AM65X_WKUP_IOPAD(0x0040, PIN_OUTPUT_PULLUP, 7)  /* WKUP_GPIO0_28 */
                >;
                u-boot,dm-spl;
        };
index 4990ed90dcea44020002b7de85c951d8396acfc5..3524766515bf5525e2a738212fe17a998291963d 100644 (file)
        interrupts-extended = <&intc 83 &omap3_pmx_core 0x11a>;
        pinctrl-names = "default";
        pinctrl-0 = <&mmc1_pins>;
-       wp-gpios = <&gpio4 30 GPIO_ACTIVE_HIGH>;                /* gpio_126 */
-       cd-gpios = <&gpio4 14 IRQ_TYPE_LEVEL_LOW>;              /* gpio_110 */
+       wp-gpios = <&gpio4 30 GPIO_ACTIVE_HIGH>;        /* gpio_126 */
+       cd-gpios = <&gpio4 14 GPIO_ACTIVE_LOW>;         /* gpio_110 */
        vmmc-supply = <&vmmc1>;
        bus-width = <4>;
        cap-power-off-card;
index ce004d0d18dfb580d2a371427d7ccf4247434c65..9162f3dd508521cb9d1b288c308e29af8fb511dd 100644 (file)
 };
 
 &sdmmc {
-       u-boot,dm-pre-reloc;
        bus-width = <4>;
        status = "okay";
 };
index f90e7e88db143e1882c427d04e77eed4763de602..46f2ffaf8dd7003a44a0fed0715a437d00242c90 100644 (file)
 };
 
 &sdmmc {
-       u-boot,dm-pre-reloc;
        bus-width = <4>;
        status = "okay";
 };
diff --git a/arch/arm/dts/rk3399-opp.dtsi b/arch/arm/dts/rk3399-opp.dtsi
new file mode 100644 (file)
index 0000000..d6f1095
--- /dev/null
@@ -0,0 +1,133 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2016-2017 Fuzhou Rockchip Electronics Co., Ltd
+ */
+
+/ {
+       cluster0_opp: opp-table0 {
+               compatible = "operating-points-v2";
+               opp-shared;
+
+               opp00 {
+                       opp-hz = /bits/ 64 <408000000>;
+                       opp-microvolt = <800000>;
+                       clock-latency-ns = <40000>;
+               };
+               opp01 {
+                       opp-hz = /bits/ 64 <600000000>;
+                       opp-microvolt = <800000>;
+               };
+               opp02 {
+                       opp-hz = /bits/ 64 <816000000>;
+                       opp-microvolt = <850000>;
+               };
+               opp03 {
+                       opp-hz = /bits/ 64 <1008000000>;
+                       opp-microvolt = <925000>;
+               };
+               opp04 {
+                       opp-hz = /bits/ 64 <1200000000>;
+                       opp-microvolt = <1000000>;
+               };
+               opp05 {
+                       opp-hz = /bits/ 64 <1416000000>;
+                       opp-microvolt = <1125000>;
+               };
+       };
+
+       cluster1_opp: opp-table1 {
+               compatible = "operating-points-v2";
+               opp-shared;
+
+               opp00 {
+                       opp-hz = /bits/ 64 <408000000>;
+                       opp-microvolt = <800000>;
+                       clock-latency-ns = <40000>;
+               };
+               opp01 {
+                       opp-hz = /bits/ 64 <600000000>;
+                       opp-microvolt = <800000>;
+               };
+               opp02 {
+                       opp-hz = /bits/ 64 <816000000>;
+                       opp-microvolt = <825000>;
+               };
+               opp03 {
+                       opp-hz = /bits/ 64 <1008000000>;
+                       opp-microvolt = <875000>;
+               };
+               opp04 {
+                       opp-hz = /bits/ 64 <1200000000>;
+                       opp-microvolt = <950000>;
+               };
+               opp05 {
+                       opp-hz = /bits/ 64 <1416000000>;
+                       opp-microvolt = <1025000>;
+               };
+               opp06 {
+                       opp-hz = /bits/ 64 <1608000000>;
+                       opp-microvolt = <1100000>;
+               };
+               opp07 {
+                       opp-hz = /bits/ 64 <1800000000>;
+                       opp-microvolt = <1200000>;
+               };
+       };
+
+       gpu_opp_table: opp-table2 {
+               compatible = "operating-points-v2";
+
+               opp00 {
+                       opp-hz = /bits/ 64 <200000000>;
+                       opp-microvolt = <800000>;
+               };
+               opp01 {
+                       opp-hz = /bits/ 64 <297000000>;
+                       opp-microvolt = <800000>;
+               };
+               opp02 {
+                       opp-hz = /bits/ 64 <400000000>;
+                       opp-microvolt = <825000>;
+               };
+               opp03 {
+                       opp-hz = /bits/ 64 <500000000>;
+                       opp-microvolt = <875000>;
+               };
+               opp04 {
+                       opp-hz = /bits/ 64 <600000000>;
+                       opp-microvolt = <925000>;
+               };
+               opp05 {
+                       opp-hz = /bits/ 64 <800000000>;
+                       opp-microvolt = <1100000>;
+               };
+       };
+};
+
+&cpu_l0 {
+       operating-points-v2 = <&cluster0_opp>;
+};
+
+&cpu_l1 {
+       operating-points-v2 = <&cluster0_opp>;
+};
+
+&cpu_l2 {
+       operating-points-v2 = <&cluster0_opp>;
+};
+
+&cpu_l3 {
+       operating-points-v2 = <&cluster0_opp>;
+};
+
+&cpu_b0 {
+       operating-points-v2 = <&cluster1_opp>;
+};
+
+&cpu_b1 {
+       operating-points-v2 = <&cluster1_opp>;
+};
+
+&gpu {
+       operating-points-v2 = <&gpu_opp_table>;
+};
diff --git a/arch/arm/dts/rk3399-orangepi-u-boot.dtsi b/arch/arm/dts/rk3399-orangepi-u-boot.dtsi
new file mode 100644 (file)
index 0000000..236b61d
--- /dev/null
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com>
+ */
+
+#include "rk3399-u-boot.dtsi"
+#include "rk3399-sdram-ddr3-1333.dtsi"
diff --git a/arch/arm/dts/rk3399-orangepi.dts b/arch/arm/dts/rk3399-orangepi.dts
new file mode 100644 (file)
index 0000000..cf37b96
--- /dev/null
@@ -0,0 +1,771 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd.
+ */
+
+/dts-v1/;
+
+#include "dt-bindings/pwm/pwm.h"
+#include "dt-bindings/input/input.h"
+#include "rk3399.dtsi"
+#include "rk3399-opp.dtsi"
+
+/ {
+       model = "Orange Pi RK3399 Board";
+       compatible = "rockchip,rk3399-orangepi", "rockchip,rk3399";
+
+       chosen {
+               stdout-path = "serial2:1500000n8";
+       };
+
+       clkin_gmac: external-gmac-clock {
+               compatible = "fixed-clock";
+               clock-frequency = <125000000>;
+               clock-output-names = "clkin_gmac";
+               #clock-cells = <0>;
+       };
+
+       adc-keys {
+               compatible = "adc-keys";
+               io-channels = <&saradc 1>;
+               io-channel-names = "buttons";
+               keyup-threshold-microvolt = <1800000>;
+               poll-interval = <100>;
+
+               button-up {
+                       label = "Volume Up";
+                       linux,code = <KEY_VOLUMEUP>;
+                       press-threshold-microvolt = <100000>;
+               };
+
+               button-down {
+                       label = "Volume Down";
+                       linux,code = <KEY_VOLUMEDOWN>;
+                       press-threshold-microvolt = <300000>;
+               };
+
+               back {
+                       label = "Back";
+                       linux,code = <KEY_BACK>;
+                       press-threshold-microvolt = <985000>;
+               };
+
+               menu {
+                       label = "Menu";
+                       linux,code = <KEY_MENU>;
+                       press-threshold-microvolt = <1314000>;
+               };
+       };
+
+       dc_12v: dc-12v {
+               compatible = "regulator-fixed";
+               regulator-name = "dc_12v";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <12000000>;
+               regulator-max-microvolt = <12000000>;
+       };
+
+       keys: gpio-keys {
+               compatible = "gpio-keys";
+               autorepeat;
+
+               power {
+                       debounce-interval = <100>;
+                       gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
+                       label = "GPIO Power";
+                       linux,code = <KEY_POWER>;
+                       linux,input-type = <1>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pwr_btn>;
+                       wakeup-source;
+               };
+       };
+
+       sdio_pwrseq: sdio-pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               clocks = <&rk808 1>;
+               clock-names = "ext_clock";
+               pinctrl-names = "default";
+               pinctrl-0 = <&wifi_reg_on_h>;
+               reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
+       };
+
+       /* switched by pmic_sleep */
+       vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc1v8_s3";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               vin-supply = <&vcc_1v8>;
+       };
+
+       vcc3v0_sd: vcc3v0-sd {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&sdmmc0_pwr_h>;
+               regulator-boot-on;
+               regulator-max-microvolt = <3000000>;
+               regulator-min-microvolt = <3000000>;
+               regulator-name = "vcc3v0_sd";
+               vin-supply = <&vcc3v3_sys>;
+       };
+
+       vcc3v3_sys: vcc3v3-sys {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc3v3_sys";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&vcc_sys>;
+       };
+
+       vcc5v0_host: vcc5v0-host-regulator {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio4 RK_PD1 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&vcc5v0_host_en>;
+               regulator-name = "vcc5v0_host";
+               regulator-always-on;
+               vin-supply = <&vcc_sys>;
+       };
+
+       vcc5v0_typec0: vcc5v0-typec0-regulator {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&vcc5v0_typec0_en>;
+               regulator-name = "vcc5v0_typec0";
+               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>;
+               vin-supply = <&dc_12v>;
+       };
+
+       vdd_log: vdd-log {
+               compatible = "pwm-regulator";
+               pwms = <&pwm2 0 25000 1>;
+               regulator-name = "vdd_log";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <800000>;
+               regulator-max-microvolt = <1400000>;
+               vin-supply = <&vcc_sys>;
+       };
+};
+
+&cpu_l0 {
+       cpu-supply = <&vdd_cpu_l>;
+};
+
+&cpu_l1 {
+       cpu-supply = <&vdd_cpu_l>;
+};
+
+&cpu_l2 {
+       cpu-supply = <&vdd_cpu_l>;
+};
+
+&cpu_l3 {
+       cpu-supply = <&vdd_cpu_l>;
+};
+
+&cpu_b0 {
+       cpu-supply = <&vdd_cpu_b>;
+};
+
+&cpu_b1 {
+       cpu-supply = <&vdd_cpu_b>;
+};
+
+&emmc_phy {
+       status = "okay";
+};
+
+&gmac {
+       assigned-clocks = <&cru SCLK_RMII_SRC>;
+       assigned-clock-parents = <&clkin_gmac>;
+       clock_in_out = "input";
+       phy-supply = <&vcc3v3_s3>;
+       phy-mode = "rgmii";
+       pinctrl-names = "default";
+       pinctrl-0 = <&rgmii_pins>;
+       snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
+       snps,reset-active-low;
+       snps,reset-delays-us = <0 10000 50000>;
+       tx_delay = <0x28>;
+       rx_delay = <0x11>;
+       status = "okay";
+};
+
+&gpu {
+       mali-supply = <&vdd_gpu>;
+       status = "okay";
+};
+
+&hdmi {
+       ddc-i2c-bus = <&i2c3>;
+       status = "okay";
+};
+
+&hdmi_sound {
+       status = "okay";
+};
+
+&i2c0 {
+       clock-frequency = <400000>;
+       i2c-scl-rising-time-ns = <168>;
+       i2c-scl-falling-time-ns = <4>;
+       status = "okay";
+
+       rk808: pmic@1b {
+               compatible = "rockchip,rk808";
+               reg = <0x1b>;
+               interrupt-parent = <&gpio1>;
+               interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
+               #clock-cells = <1>;
+               clock-output-names = "rtc_clko_soc", "rtc_clko_wifi";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pmic_int_l>;
+               rockchip,system-power-controller;
+               wakeup-source;
+
+               vcc1-supply = <&vcc3v3_sys>;
+               vcc2-supply = <&vcc3v3_sys>;
+               vcc3-supply = <&vcc3v3_sys>;
+               vcc4-supply = <&vcc3v3_sys>;
+               vcc6-supply = <&vcc3v3_sys>;
+               vcc7-supply = <&vcc3v3_sys>;
+               vcc8-supply = <&vcc3v3_sys>;
+               vcc9-supply = <&vcc3v3_sys>;
+               vcc10-supply = <&vcc3v3_sys>;
+               vcc11-supply = <&vcc3v3_sys>;
+               vcc12-supply = <&vcc3v3_sys>;
+               vddio-supply = <&vcc_3v0>;
+
+               regulators {
+                       vdd_center: DCDC_REG1 {
+                               regulator-name = "vdd_center";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <700000>;
+                               regulator-max-microvolt = <1500000>;
+                               regulator-ramp-delay = <6001>;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vdd_cpu_l: DCDC_REG2 {
+                               regulator-name = "vdd_cpu_l";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <700000>;
+                               regulator-max-microvolt = <1500000>;
+                               regulator-ramp-delay = <6001>;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vcc_ddr: DCDC_REG3 {
+                               regulator-name = "vcc_ddr";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       vcc_1v8: DCDC_REG4 {
+                               regulator-name = "vcc_1v8";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <1800000>;
+                               };
+                       };
+
+                       vcc1v8_dvp: LDO_REG1 {
+                               regulator-name = "vcc1v8_dvp";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <3400000>;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vcc3v0_tp: LDO_REG2 {
+                               regulator-name = "vcc3v0_tp";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <3400000>;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vcc1v8_pmupll: LDO_REG3 {
+                               regulator-name = "vcc1v8_pmupll";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <2500000>;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <1800000>;
+                               };
+                       };
+
+                       vcc_sdio: LDO_REG4 {
+                               regulator-name = "vcc_sdio";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <3400000>;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <3000000>;
+                               };
+                       };
+
+                       vcca3v0_codec: LDO_REG5 {
+                               regulator-name = "vcca3v0_codec";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <3400000>;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vcc_1v5: LDO_REG6 {
+                               regulator-name = "vcc_1v5";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <2500000>;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <1500000>;
+                               };
+                       };
+
+                       vcca1v8_codec: LDO_REG7 {
+                               regulator-name = "vcca1v8_codec";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <2500000>;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vcc_3v0: LDO_REG8 {
+                               regulator-name = "vcc_3v0";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <3400000>;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <3000000>;
+                               };
+                       };
+
+                       vcc3v3_s3: SWITCH_REG1 {
+                               regulator-name = "vcc3v3_s3";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vcc3v3_s0: SWITCH_REG2 {
+                               regulator-name = "vcc3v3_s0";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+               };
+       };
+
+       vdd_cpu_b: regulator@40 {
+               compatible = "silergy,syr827";
+               reg = <0x40>;
+               fcs,suspend-voltage-selector = <1>;
+               regulator-name = "vdd_cpu_b";
+               regulator-min-microvolt = <712500>;
+               regulator-max-microvolt = <1500000>;
+               regulator-ramp-delay = <1000>;
+               regulator-always-on;
+               regulator-boot-on;
+               vin-supply = <&vcc3v3_sys>;
+
+               regulator-state-mem {
+                       regulator-off-in-suspend;
+               };
+       };
+
+       vdd_gpu: regulator@41 {
+               compatible = "silergy,syr828";
+               reg = <0x41>;
+               fcs,suspend-voltage-selector = <1>;
+               regulator-name = "vdd_gpu";
+               regulator-min-microvolt = <712500>;
+               regulator-max-microvolt = <1500000>;
+               regulator-ramp-delay = <1000>;
+               regulator-always-on;
+               regulator-boot-on;
+               vin-supply = <&vcc3v3_sys>;
+
+               regulator-state-mem {
+                       regulator-off-in-suspend;
+               };
+       };
+};
+
+&i2c1 {
+       i2c-scl-rising-time-ns = <450>;
+       i2c-scl-falling-time-ns = <15>;
+       status = "okay";
+};
+
+&i2c3 {
+       i2c-scl-rising-time-ns = <450>;
+       i2c-scl-falling-time-ns = <15>;
+       status = "okay";
+};
+
+&i2c4 {
+       clock-frequency = <400000>;
+       i2c-scl-rising-time-ns = <450>;
+       i2c-scl-falling-time-ns = <15>;
+       status = "okay";
+
+       ak09911@c {
+               compatible = "asahi-kasei,ak09911";
+               reg = <0x0c>;
+               vdd-supply = <&vcc3v3_s3>;
+       };
+
+       mpu6500@68 {
+               compatible = "invensense,mpu6500";
+               reg = <0x68>;
+               interrupt-parent = <&gpio1>;
+               interrupts = <RK_PC6 IRQ_TYPE_EDGE_RISING>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&gsensor_int_l>;
+               vddio-supply = <&vcc3v3_s3>;
+       };
+
+       lsm6ds3@6a {
+               compatible = "st,lsm6ds3";
+               reg = <0x6a>;
+               interrupt-parent = <&gpio1>;
+               interrupts = <RK_PD0 IRQ_TYPE_EDGE_RISING>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&gyr_int_l>;
+               vdd-supply = <&vcc3v3_s3>;
+               vddio-supply = <&vcc3v3_s3>;
+       };
+
+       cm32181@10 {
+               compatible = "capella,cm32181";
+               reg = <0x10>;
+               interrupt-parent = <&gpio4>;
+               interrupts = <RK_PD0 IRQ_TYPE_EDGE_RISING>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&light_int_l>;
+               vdd-supply = <&vcc3v3_s3>;
+       };
+};
+
+&io_domains {
+       status = "okay";
+       bt656-supply = <&vcc_3v0>;
+       audio-supply = <&vcca1v8_codec>;
+       sdmmc-supply = <&vcc_sdio>;
+       gpio1830-supply = <&vcc_3v0>;
+};
+
+&pmu_io_domains {
+       status = "okay";
+       pmu1830-supply = <&vcc_3v0>;
+};
+
+&pinctrl {
+       buttons {
+               pwr_btn: pwr-btn {
+                       rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
+               };
+       };
+
+       pmic {
+               pmic_int_l: pmic-int-l {
+                       rockchip,pins =
+                               <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
+               };
+       };
+
+       sd {
+               sdmmc0_pwr_h: sdmmc0-pwr-h {
+                       rockchip,pins =
+                               <RK_GPIO0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       usb2 {
+               vcc5v0_host_en: vcc5v0-host-en {
+                       rockchip,pins =
+                               <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
+               vcc5v0_typec0_en: vcc5v0-typec0-en {
+                       rockchip,pins =
+                               <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       sdio-pwrseq {
+               wifi_reg_on_h: wifi-reg-on-h {
+                       rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       wifi {
+               wifi_host_wake_l: wifi-host-wake-l {
+                       rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       bluetooth {
+               bt_reg_on_h: bt-enable-h {
+                       rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
+               bt_host_wake_l: bt-host-wake-l {
+                       rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
+               bt_wake_l: bt-wake-l {
+                       rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       mpu6500 {
+               gsensor_int_l: gsensor-int-l {
+                       rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       lsm6ds3 {
+               gyr_int_l: gyr-int-l {
+                       rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       cm32181 {
+               light_int_l: light-int-l {
+                       rockchip,pins = <4 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+};
+
+&pwm0 {
+       status = "okay";
+};
+
+&pwm2 {
+       status = "okay";
+};
+
+&saradc {
+       vref-supply = <&vcca1v8_s3>;
+       status = "okay";
+};
+
+&sdhci {
+       bus-width = <8>;
+       mmc-hs400-1_8v;
+       mmc-hs400-enhanced-strobe;
+       non-removable;
+       status = "okay";
+};
+
+&sdio0 {
+       bus-width = <4>;
+       cap-sd-highspeed;
+       cap-sdio-irq;
+       clock-frequency = <50000000>;
+       disable-wp;
+       keep-power-in-suspend;
+       max-frequency = <50000000>;
+       mmc-pwrseq = <&sdio_pwrseq>;
+       non-removable;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
+       sd-uhs-sdr104;
+       status = "okay";
+
+       brcmf: wifi@1 {
+               compatible = "brcm,bcm4329-fmac";
+               interrupt-parent = <&gpio0>;
+               interrupts = <RK_PA3 GPIO_ACTIVE_HIGH>;
+               interrupt-names = "host-wake";
+               pinctrl-names = "default";
+               pinctrl-0 = <&wifi_host_wake_l>;
+       };
+};
+
+&sdmmc {
+       bus-width = <4>;
+       cap-mmc-highspeed;
+       cap-sd-highspeed;
+       cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
+       clock-frequency = <150000000>;
+       disable-wp;
+       max-frequency = <150000000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
+       vmmc-supply = <&vcc3v0_sd>;
+       vqmmc-supply = <&vcc_sdio>;
+       status = "okay";
+};
+
+&tcphy0 {
+       status = "okay";
+};
+
+&tcphy1 {
+       status = "okay";
+};
+
+&tsadc {
+       rockchip,hw-tshut-mode = <1>;
+       rockchip,hw-tshut-polarity = <1>;
+       status = "okay";
+};
+
+&u2phy0 {
+       status = "okay";
+
+       u2phy0_otg: otg-port {
+               phy-supply = <&vcc5v0_typec0>;
+               status = "okay";
+       };
+
+       u2phy0_host: host-port {
+               phy-supply = <&vcc5v0_host>;
+               status = "okay";
+       };
+};
+
+&u2phy1 {
+       status = "okay";
+
+       u2phy1_otg: otg-port {
+               status = "okay";
+       };
+
+       u2phy1_host: host-port {
+               phy-supply = <&vcc5v0_host>;
+               status = "okay";
+       };
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
+       status = "okay";
+
+       bluetooth {
+               compatible = "brcm,bcm43438-bt";
+               clocks = <&rk808 1>;
+               clock-names = "ext_clock";
+               device-wakeup-gpios = <&gpio2 RK_PD2 GPIO_ACTIVE_HIGH>;
+               host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>;
+               shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&bt_host_wake_l &bt_wake_l &bt_reg_on_h>;
+       };
+};
+
+&uart2 {
+       status = "okay";
+};
+
+&usb_host0_ehci {
+       status = "okay";
+};
+
+&usb_host0_ohci {
+       status = "okay";
+};
+
+&usb_host1_ehci {
+       status = "okay";
+};
+
+&usb_host1_ohci {
+       status = "okay";
+};
+
+&usbdrd3_0 {
+       status = "okay";
+};
+
+&usbdrd_dwc3_0 {
+       status = "okay";
+       dr_mode = "otg";
+};
+
+&usbdrd3_1 {
+       status = "okay";
+};
+
+&usbdrd_dwc3_1 {
+       status = "okay";
+       dr_mode = "host";
+};
+
+&vopb {
+       status = "okay";
+};
+
+&vopb_mmu {
+       status = "okay";
+};
+
+&vopl {
+       status = "okay";
+};
+
+&vopl_mmu {
+       status = "okay";
+};
index aec13a28f1abc340ae9e035959fdc4fe99191e9b..319a610022c3d218cea885f43c6c227013ee9be1 100644 (file)
 };
 
 &sdmmc {
-       u-boot,dm-pre-reloc;
        clock-frequency = <150000000>;
        max-frequency = <40000000>;
        supports-sd;
diff --git a/arch/arm/dts/rk3399-u-boot.dtsi b/arch/arm/dts/rk3399-u-boot.dtsi
new file mode 100644 (file)
index 0000000..f533ed9
--- /dev/null
@@ -0,0 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com>
+ */
+
+&sdmmc {
+       u-boot,dm-pre-reloc;
+};
index a6d66d102bae54deb984be4119dbc0150e93c533..db83d0e7d3ba27f156aafb33089c4cd0e6d416ce 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef _ASM_ARCH_DDR_RK3188_H
 #define _ASM_ARCH_DDR_RK3188_H
 
-#include <asm/arch/ddr_rk3288.h>
+#include <asm/arch-rockchip/ddr_rk3288.h>
 
 /*
  * RK3188 Memory scheduler register map.
index cd94bdd1ba3a35ae267ec0b18dca097cf6a00a2e..62e8bed8f31e753c000afb90143b6d08c6e3c773 100644 (file)
@@ -10,8 +10,6 @@
 #define RK_SETBITS(set)                        RK_CLRSETBITS(0, set)
 #define RK_CLRBITS(clr)                        RK_CLRSETBITS(clr, 0)
 
-#define TIMER7_BASE            0xff810020
-
 #define rk_clrsetreg(addr, clr, set)   \
                                writel(((clr) | (set)) << 16 | (set), addr)
 #define rk_clrreg(addr, clr)           writel((clr) << 16, addr)
index 992a84152cfae333edd0606912e6e1533276714b..370031f2accbd6f6af538e0d8815306504fbae77 100644 (file)
@@ -1,6 +1,6 @@
 #if !defined(CONFIG_ARCH_UNIPHIER) && !defined(CONFIG_ARCH_STI) && \
        !defined(CONFIG_ARCH_K3) && !defined(CONFIG_ARCH_BCM6858) && \
-       !defined(CONFIG_ARCH_BCM63158)
+       !defined(CONFIG_ARCH_BCM63158) && !defined(CONFIG_ARCH_ROCKCHIP)
 #include <asm/arch/gpio.h>
 #endif
 #include <asm-generic/gpio.h>
index 2ca6e2494a7ad4dac2c2ae4ab4c8d573b6eb3f63..20f485142ef55c2d998eea59ec39fb836acef633 100644 (file)
  *   (1) defines '_start:' as appropriate
  *   (2) inserts the vector table using ARM_VECTORS as appropriate
  */
+#ifdef CONFIG_ARCH_ROCKCHIP
+#include <asm/arch-rockchip/boot0.h>
+#else
 #include <asm/arch/boot0.h>
-
+#endif
 #else
 
 /*
index b9a026abb5c5b9e985558a004736fa8eaa37f24f..282d728b82d580664bf8742db4040aec520fa8c1 100644 (file)
@@ -34,7 +34,6 @@ config ROCKCHIP_RK3188
        select SPL_RAM
        select SPL_DRIVERS_MISC_SUPPORT
        select SPL_ROCKCHIP_EARLYRETURN_TO_BROM
-       select DEBUG_UART_BOARD_INIT
        select BOARD_LATE_INIT
        select ROCKCHIP_BROM_HELPER
        help
@@ -50,7 +49,6 @@ config ROCKCHIP_RK322X
        select SUPPORT_SPL
        select SPL
        select ROCKCHIP_BROM_HELPER
-       select DEBUG_UART_BOARD_INIT
        help
          The Rockchip RK3229 is a ARM-based SoC with a dual-core Cortex-A7
          including NEON and GPU, Mali-400 graphics, several DDR3 options
@@ -102,7 +100,6 @@ config ROCKCHIP_RK3368
        imply SPL_SEPARATE_BSS
        imply SPL_SERIAL_SUPPORT
        imply TPL_SERIAL_SUPPORT
-       select DEBUG_UART_BOARD_INIT
        help
          The Rockchip RK3368 is a ARM-based SoC with a octa-core (organised
          into a big and little cluster with 4 cores each) Cortex-A53 including
@@ -135,7 +132,6 @@ config ROCKCHIP_RK3399
        select SPL_SEPARATE_BSS
        select SPL_SERIAL_SUPPORT
        select SPL_DRIVERS_MISC_SUPPORT
-       select DEBUG_UART_BOARD_INIT
        select BOARD_LATE_INIT
        select ROCKCHIP_BROM_HELPER
        help
@@ -192,7 +188,7 @@ config ROCKCHIP_BOOT_MODE_REG
        default 0x10300580 if ROCKCHIP_RV1108
        default 0
        help
-         The Soc will enter to different boot mode(defined in asm/arch/boot_mode.h)
+         The Soc will enter to different boot mode(defined in asm/arch-rockchip/boot_mode.h)
          according to the value from this register.
 
 config ROCKCHIP_SPL_RESERVE_IRAM
index f32b3c4ce56a0fc6bffbce9782cac339bfd114d7..08f80bd91aae0bb39d6588acea312bc9f3349f6a 100644 (file)
@@ -6,7 +6,7 @@
 #include <common.h>
 #include <adc.h>
 #include <asm/io.h>
-#include <asm/arch/boot_mode.h>
+#include <asm/arch-rockchip/boot_mode.h>
 
 #if (CONFIG_ROCKCHIP_BOOT_MODE_REG == 0)
 
index 2f2f73aeddfe642f2816375e8895231426d83d7c..9ccb45e6acd26e70cf3a782d428c28a95d1e4f08 100644 (file)
@@ -4,8 +4,8 @@
  */
 
 #include <common.h>
-#include <asm/arch/bootrom.h>
-#include <asm/arch/boot_mode.h>
+#include <asm/arch-rockchip/bootrom.h>
+#include <asm/arch-rockchip/boot_mode.h>
 #include <asm/io.h>
 #include <asm/setjmp.h>
 #include <asm/system.h>
index 5ec69f131161f1edc07aa9c14f9b81e1e222458b..110d06dba5ee032e1fcb185337a657896532527a 100644 (file)
@@ -6,31 +6,13 @@
 #include <common.h>
 #include <debug_uart.h>
 #include <asm/io.h>
-#include <asm/arch/bootrom.h>
-#include <asm/arch/grf_rk3036.h>
-#include <asm/arch/hardware.h>
-#include <asm/arch/sdram_rk3036.h>
-#include <asm/arch/timer.h>
-#include <asm/arch/uart.h>
-
-#define GRF_BASE       0x20008000
-
-#define DEBUG_UART_BASE        0x20068000
+#include <asm/arch-rockchip/bootrom.h>
+#include <asm/arch-rockchip/sdram_rk3036.h>
+#include <asm/arch-rockchip/timer.h>
 
 void board_init_f(ulong dummy)
 {
-#ifdef EARLY_DEBUG
-       struct rk3036_grf * const grf = (void *)GRF_BASE;
-       /*
-        * NOTE: sd card and debug uart use same iomux in rk3036,
-        * so if you enable uart,
-        * you can not boot from sdcard
-        */
-       rk_clrsetreg(&grf->gpio1c_iomux,
-                    GPIO1C3_MASK << GPIO1C3_SHIFT |
-                    GPIO1C2_MASK << GPIO1C2_SHIFT,
-                    GPIO1C3_UART2_SOUT << GPIO1C3_SHIFT |
-                    GPIO1C2_UART2_SIN << GPIO1C2_SHIFT);
+#ifdef CONFIG_DEBUG_UART
        debug_uart_init();
 #endif
        rockchip_timer_init();
index 872bed9606b1f99b457e715e6ecb08babdd82d89..2094a4336d0b584be2f51255cf97ad1bdbf3db7c 100644 (file)
@@ -9,11 +9,11 @@
 #include <ram.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/periph.h>
-#include <asm/arch/grf_rk3036.h>
-#include <asm/arch/boot_mode.h>
-#include <asm/arch/sdram_rk3036.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/periph.h>
+#include <asm/arch-rockchip/grf_rk3036.h>
+#include <asm/arch-rockchip/boot_mode.h>
+#include <asm/arch-rockchip/sdram_rk3036.h>
 #include <dm/pinctrl.h>
 
 DECLARE_GLOBAL_DATA_PTR;
index c63db343e26dfc2c273959800ca710dd44294d28..5e04d204482d8e7abf7657af39e2971ab693761b 100644 (file)
@@ -9,7 +9,7 @@ config TARGET_KYLIN_RK3036
        select BOARD_LATE_INIT
 
 config SYS_SOC
-       default "rockchip"
+       default "rk3036"
 
 config SYS_MALLOC_F_LEN
        default 0x400
index 20d28f7c21c182d1e5e2e470b2c28c58c33389b4..299fc50635d191d6a519a810a3884e602f14399f 100644 (file)
@@ -10,4 +10,5 @@ ifndef CONFIG_SPL_BUILD
 obj-y += syscon_rk3036.o
 endif
 
+obj-y += rk3036.o
 obj-y += sdram_rk3036.o
index 2145c59fcde65c07377d7b73013db34d9a669c16..20e2ed681321950576fb0210283cde34dc038a89 100644 (file)
@@ -7,8 +7,8 @@
 #include <common.h>
 #include <dm.h>
 #include <syscon.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3036.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk3036.h>
 
 int rockchip_get_clk(struct udevice **devp)
 {
diff --git a/arch/arm/mach-rockchip/rk3036/rk3036.c b/arch/arm/mach-rockchip/rk3036/rk3036.c
new file mode 100644 (file)
index 0000000..481af8a
--- /dev/null
@@ -0,0 +1,38 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2019 Rockchip Electronics Co., Ltd
+ */
+#include <asm/io.h>
+#include <asm/arch-rockchip/grf_rk3036.h>
+#include <asm/arch-rockchip/hardware.h>
+
+#ifdef CONFIG_DEBUG_UART_BOARD_INIT
+void board_debug_uart_init(void)
+{
+#define GRF_BASE       0x20008000
+       struct rk3036_grf * const grf = (void *)GRF_BASE;
+       enum {
+               GPIO1C3_SHIFT           = 6,
+               GPIO1C3_MASK            = 3 << GPIO1C3_SHIFT,
+               GPIO1C3_GPIO            = 0,
+               GPIO1C3_MMC0_D1,
+               GPIO1C3_UART2_SOUT,
+
+               GPIO1C2_SHIFT           = 4,
+               GPIO1C2_MASK            = 3 << GPIO1C2_SHIFT,
+               GPIO1C2_GPIO            = 0,
+               GPIO1C2_MMC0_D0,
+               GPIO1C2_UART2_SIN,
+       };
+       /*
+        * NOTE: sd card and debug uart use same iomux in rk3036,
+        * so if you enable uart,
+        * you can not boot from sdcard
+        */
+       rk_clrsetreg(&grf->gpio1c_iomux,
+                    GPIO1C3_MASK << GPIO1C3_SHIFT |
+                    GPIO1C2_MASK << GPIO1C2_SHIFT,
+                    GPIO1C3_UART2_SOUT << GPIO1C3_SHIFT |
+                    GPIO1C2_UART2_SIN << GPIO1C2_SHIFT);
+}
+#endif
index 2012d9fe04d5842ae6e71f2167a84059e57442eb..1d940a0d77ca5a8cba9eb38f8dfdd02478602532 100644 (file)
@@ -5,12 +5,12 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/types.h>
-#include <asm/arch/cru_rk3036.h>
-#include <asm/arch/grf_rk3036.h>
-#include <asm/arch/hardware.h>
-#include <asm/arch/sdram_rk3036.h>
-#include <asm/arch/timer.h>
-#include <asm/arch/uart.h>
+#include <asm/arch-rockchip/cru_rk3036.h>
+#include <asm/arch-rockchip/grf_rk3036.h>
+#include <asm/arch-rockchip/hardware.h>
+#include <asm/arch-rockchip/sdram_rk3036.h>
+#include <asm/arch-rockchip/timer.h>
+#include <asm/arch-rockchip/uart.h>
 
 /*
  * we can not fit the code to access the device tree in SPL
index d3f4cc77f1fca41b91dcd20ea0a5fe397f97e73d..c2fd16079902950043e0bf45fa93c1d9cf2645e5 100644 (file)
@@ -6,7 +6,7 @@
 #include <common.h>
 #include <dm.h>
 #include <syscon.h>
-#include <asm/arch/clock.h>
+#include <asm/arch-rockchip/clock.h>
 
 static const struct udevice_id rk3036_syscon_ids[] = {
        { .compatible = "rockchip,rk3036-grf", .data = ROCKCHIP_SYSCON_GRF },
index 7fd667a0b8ec94a43df1f27b488c758892035e94..b1c66382e356911cdee3838c991c0b91ead50eb1 100644 (file)
@@ -8,11 +8,11 @@
 #include <ram.h>
 #include <syscon.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/periph.h>
-#include <asm/arch/grf_rk3128.h>
-#include <asm/arch/boot_mode.h>
-#include <asm/arch/timer.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/periph.h>
+#include <asm/arch-rockchip/grf_rk3128.h>
+#include <asm/arch-rockchip/boot_mode.h>
+#include <asm/arch-rockchip/timer.h>
 #include <power/regulator.h>
 
 DECLARE_GLOBAL_DATA_PTR;
index 40655a22b59761d75f4587db284c9f0aead01124..a82b7dc063fee2c775cb27fdf0c484c42378e29c 100644 (file)
@@ -14,7 +14,7 @@ config TARGET_EVB_RK3128
 endchoice
 
 config SYS_SOC
-       default "rockchip"
+       default "rk3128"
 
 config SYS_MALLOC_F_LEN
        default 0x0800
index b9b0297579207541c60073e5469ff93411cc6a80..827750bf98b69e43643cc2715a6c6931b252965f 100644 (file)
@@ -6,8 +6,8 @@
 #include <common.h>
 #include <dm.h>
 #include <syscon.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3128.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk3128.h>
 
 int rockchip_get_clk(struct udevice **devp)
 {
index 8117895434c658d6ee7af4d3ebf3fca6b37c300e..1406d5d0d325d2aa6df49088ed9f3aee1aef3c70 100644 (file)
@@ -6,7 +6,7 @@
 #include <common.h>
 #include <dm.h>
 #include <syscon.h>
-#include <asm/arch/clock.h>
+#include <asm/arch-rockchip/clock.h>
 
 static const struct udevice_id rk3128_syscon_ids[] = {
        { .compatible = "rockchip,rk3128-grf", .data = ROCKCHIP_SYSCON_GRF },
index 5c09b0e4ae0b140d46acc5463b89062fd7e76415..77b9b36d3577c6e835652dc6217f5d230d02c75e 100644 (file)
 #include <syscon.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
-#include <asm/arch/bootrom.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/grf_rk3188.h>
-#include <asm/arch/hardware.h>
-#include <asm/arch/periph.h>
-#include <asm/arch/pmu_rk3188.h>
-#include <asm/arch/sdram.h>
-#include <asm/arch/timer.h>
+#include <asm/arch-rockchip/bootrom.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/grf_rk3188.h>
+#include <asm/arch-rockchip/hardware.h>
+#include <asm/arch-rockchip/periph.h>
+#include <asm/arch-rockchip/pmu_rk3188.h>
+#include <asm/arch-rockchip/sdram.h>
+#include <asm/arch-rockchip/timer.h>
 #include <dm/pinctrl.h>
 #include <dm/root.h>
 #include <dm/test.h>
@@ -93,38 +93,12 @@ static int setup_arm_clock(void)
        return ret;
 }
 
-void board_debug_uart_init(void)
-{
-       /* Enable early UART on the RK3188 */
-#define GRF_BASE       0x20008000
-       struct rk3188_grf * const grf = (void *)GRF_BASE;
-       enum {
-               GPIO1B1_SHIFT           = 2,
-               GPIO1B1_MASK            = 3,
-               GPIO1B1_GPIO            = 0,
-               GPIO1B1_UART2_SOUT,
-
-               GPIO1B0_SHIFT           = 0,
-               GPIO1B0_MASK            = 3,
-               GPIO1B0_GPIO            = 0,
-               GPIO1B0_UART2_SIN,
-       };
-
-       /* Enable early UART on the RK3188 */
-       rk_clrsetreg(&grf->gpio1b_iomux,
-                    GPIO1B1_MASK << GPIO1B1_SHIFT |
-                    GPIO1B0_MASK << GPIO1B0_SHIFT,
-                    GPIO1B1_UART2_SOUT << GPIO1B1_SHIFT |
-                    GPIO1B0_UART2_SIN << GPIO1B0_SHIFT);
-}
-
 void board_init_f(ulong dummy)
 {
        struct udevice *dev;
        int ret;
 
-#define EARLY_UART
-#ifdef EARLY_UART
+#ifdef CONFIG_DEBUG_UART
        /*
         * Debug UART can be used from here if required:
         *
index 3802395bc07fa124419164038f6dcf855111c873..e03759f78929abdfc6b85c12c46cefda51d4d0e6 100644 (file)
 #include <syscon.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/grf_rk3188.h>
-#include <asm/arch/periph.h>
-#include <asm/arch/pmu_rk3288.h>
-#include <asm/arch/boot_mode.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/grf_rk3188.h>
+#include <asm/arch-rockchip/periph.h>
+#include <asm/arch-rockchip/pmu_rk3288.h>
+#include <asm/arch-rockchip/boot_mode.h>
 #include <dm/pinctrl.h>
 
 __weak int rk_board_late_init(void)
index 2bb35662d19e52374cd32c7f605e5f4db9626823..a6fc691fb6c784e89eaec4f98d1600875657df16 100644 (file)
@@ -10,7 +10,7 @@ config TARGET_ROCK
          UART and GPIOs.
 
 config SYS_SOC
-       default "rockchip"
+       default "rk3188"
 
 config SYS_MALLOC_F_LEN
        default 0x0800
index 7fa010405b1c96d66a556c3302511c039df3e5f6..7dc123a3d2393dfac9bfdcecc340d9daf88b0032 100644 (file)
@@ -6,5 +6,6 @@
 
 ifndef CONFIG_TPL_BUILD
 obj-y += clk_rk3188.o
+obj-y += rk3188.o
 obj-y += syscon_rk3188.o
 endif
index e8fcec70cd4104519a2bebd67202814dc65ebad2..9d4fc37eda91e84444362f6708ce69991ebe54a5 100644 (file)
@@ -7,8 +7,8 @@
 #include <common.h>
 #include <dm.h>
 #include <syscon.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3188.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk3188.h>
 
 int rockchip_get_clk(struct udevice **devp)
 {
diff --git a/arch/arm/mach-rockchip/rk3188/rk3188.c b/arch/arm/mach-rockchip/rk3188/rk3188.c
new file mode 100644 (file)
index 0000000..933484e
--- /dev/null
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2019 Rockchip Electronics Co., Ltd
+ */
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch-rockchip/grf_rk3188.h>
+#include <asm/arch-rockchip/hardware.h>
+
+#ifdef CONFIG_DEBUG_UART_BOARD_INIT
+void board_debug_uart_init(void)
+{
+       /* Enable early UART on the RK3188 */
+#define GRF_BASE       0x20008000
+       struct rk3188_grf * const grf = (void *)GRF_BASE;
+       enum {
+               GPIO1B1_SHIFT           = 2,
+               GPIO1B1_MASK            = 3,
+               GPIO1B1_GPIO            = 0,
+               GPIO1B1_UART2_SOUT,
+               GPIO1B1_JTAG_TDO,
+
+               GPIO1B0_SHIFT           = 0,
+               GPIO1B0_MASK            = 3,
+               GPIO1B0_GPIO            = 0,
+               GPIO1B0_UART2_SIN,
+               GPIO1B0_JTAG_TDI,
+       };
+
+       rk_clrsetreg(&grf->gpio1b_iomux,
+                    GPIO1B1_MASK << GPIO1B1_SHIFT |
+                    GPIO1B0_MASK << GPIO1B0_SHIFT,
+                    GPIO1B1_UART2_SOUT << GPIO1B1_SHIFT |
+                    GPIO1B0_UART2_SIN << GPIO1B0_SHIFT);
+}
+#endif
index 6572bfa6a2b61a1db048ea947486dec2d4c15ed1..94f4ec7227dc58f1b8df6e78640eceff3ee1e206 100644 (file)
@@ -7,7 +7,7 @@
 #include <common.h>
 #include <dm.h>
 #include <syscon.h>
-#include <asm/arch/clock.h>
+#include <asm/arch-rockchip/clock.h>
 
 static const struct udevice_id rk3188_syscon_ids[] = {
        { .compatible = "rockchip,rk3188-noc", .data = ROCKCHIP_SYSCON_NOC },
index 1e718f26942925ec280829a875fdaab1c546e7b9..888310efbe10fd282eb9edada9a58be40bb385f0 100644 (file)
@@ -9,55 +9,14 @@
 #include <ram.h>
 #include <spl.h>
 #include <asm/io.h>
-#include <asm/arch/bootrom.h>
-#include <asm/arch/cru_rk322x.h>
-#include <asm/arch/grf_rk322x.h>
-#include <asm/arch/hardware.h>
-#include <asm/arch/timer.h>
-#include <asm/arch/uart.h>
+#include <asm/arch-rockchip/bootrom.h>
+#include <asm/arch-rockchip/hardware.h>
+#include <asm/arch-rockchip/timer.h>
 
 u32 spl_boot_device(void)
 {
        return BOOT_DEVICE_MMC1;
 }
-#define GRF_BASE       0x11000000
-#define SGRF_BASE      0x10140000
-
-#define DEBUG_UART_BASE        0x11030000
-
-void board_debug_uart_init(void)
-{
-       static struct rk322x_grf * const grf = (void *)GRF_BASE;
-       enum {
-               GPIO1B2_SHIFT           = 4,
-               GPIO1B2_MASK            = 3 << GPIO1B2_SHIFT,
-               GPIO1B2_GPIO            = 0,
-               GPIO1B2_UART1_SIN,
-               GPIO1B2_UART21_SIN,
-
-               GPIO1B1_SHIFT           = 2,
-               GPIO1B1_MASK            = 3 << GPIO1B1_SHIFT,
-               GPIO1B1_GPIO            = 0,
-               GPIO1B1_UART1_SOUT,
-               GPIO1B1_UART21_SOUT,
-       };
-       enum {
-               CON_IOMUX_UART2SEL_SHIFT= 8,
-               CON_IOMUX_UART2SEL_MASK = 1 << CON_IOMUX_UART2SEL_SHIFT,
-               CON_IOMUX_UART2SEL_2    = 0,
-               CON_IOMUX_UART2SEL_21,
-       };
-
-       /* Enable early UART2 channel 1 on the RK322x */
-       rk_clrsetreg(&grf->gpio1b_iomux,
-                    GPIO1B1_MASK | GPIO1B2_MASK,
-                    GPIO1B2_UART21_SIN << GPIO1B2_SHIFT |
-                    GPIO1B1_UART21_SOUT << GPIO1B1_SHIFT);
-       /* Set channel C as UART2 input */
-       rk_clrsetreg(&grf->con_iomux,
-                    CON_IOMUX_UART2SEL_MASK,
-                    CON_IOMUX_UART2SEL_21 << CON_IOMUX_UART2SEL_SHIFT);
-}
 
 #define SGRF_DDR_CON0 0x10150000
 void board_init_f(ulong dummy)
@@ -65,6 +24,7 @@ void board_init_f(ulong dummy)
        struct udevice *dev;
        int ret;
 
+#ifdef CONFIG_DEBUG_UART
        /*
         * Debug UART can be used from here if required:
         *
@@ -75,7 +35,7 @@ void board_init_f(ulong dummy)
         */
        debug_uart_init();
        printascii("SPL Init");
-
+#endif
        ret = spl_early_init();
        if (ret) {
                debug("spl_early_init() failed: %d\n", ret);
index 5659248178ab9d2e84d9b774b2418f970baad11d..6170c76f8b944297493bf87840fe62e03b2673a2 100644 (file)
@@ -8,10 +8,10 @@
 #include <ram.h>
 #include <syscon.h>
 #include <asm/io.h>
-#include <asm/arch/boot_mode.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/periph.h>
-#include <asm/arch/grf_rk322x.h>
+#include <asm/arch-rockchip/boot_mode.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/grf_rk322x.h>
+#include <asm/arch-rockchip/periph.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -29,37 +29,10 @@ int board_late_init(void)
 
 int board_init(void)
 {
-#include <asm/arch/grf_rk322x.h>
+#include <asm/arch-rockchip/grf_rk322x.h>
        /* Enable early UART2 channel 1 on the RK322x */
 #define GRF_BASE       0x11000000
-       struct rk322x_grf * const grf = (void *)GRF_BASE;
-       enum {
-               GPIO1B2_SHIFT           = 4,
-               GPIO1B2_MASK            = 3 << GPIO1B2_SHIFT,
-               GPIO1B2_GPIO            = 0,
-               GPIO1B2_UART21_SIN,
-
-               GPIO1B1_SHIFT           = 2,
-               GPIO1B1_MASK            = 3 << GPIO1B1_SHIFT,
-               GPIO1B1_GPIO            = 0,
-               GPIO1B1_UART1_SOUT,
-               GPIO1B1_UART21_SOUT,
-       };
-       enum {
-               CON_IOMUX_UART2SEL_SHIFT= 8,
-               CON_IOMUX_UART2SEL_MASK = 1 << CON_IOMUX_UART2SEL_SHIFT,
-               CON_IOMUX_UART2SEL_2    = 0,
-               CON_IOMUX_UART2SEL_21,
-       };
-
-       rk_clrsetreg(&grf->gpio1b_iomux,
-                    GPIO1B1_MASK | GPIO1B2_MASK,
-                    GPIO1B2_UART21_SIN << GPIO1B2_SHIFT |
-                    GPIO1B1_UART21_SOUT << GPIO1B1_SHIFT);
-       /* Set channel C as UART2 input */
-       rk_clrsetreg(&grf->con_iomux,
-                    CON_IOMUX_UART2SEL_MASK,
-                    CON_IOMUX_UART2SEL_21 << CON_IOMUX_UART2SEL_SHIFT);
+       static struct rk322x_grf * const grf = (void *)GRF_BASE;
 
        /*
        * The integrated macphy is enabled by default, disable it
index dc8071e4f3b57c456671bae169b34e6d0bf8f722..8a1f95f785951cc332a6921ab60df0d9ec283224 100644 (file)
@@ -5,7 +5,7 @@ config TARGET_EVB_RK3229
        select BOARD_LATE_INIT
 
 config SYS_SOC
-       default "rockchip"
+       default "rk322x"
 
 config SYS_MALLOC_F_LEN
        default 0x400
index ecb3e8dfda1809be1b7e8616ca11271351b8fd2d..89b0fed692671be4322c731944dd505832fe99f7 100644 (file)
@@ -4,6 +4,6 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-
 obj-y += clk_rk322x.o
+obj-y += rk322x.o
 obj-y += syscon_rk322x.o
index accf9443b004f0f7020c87a1d48d79791c29c569..958c7b82b92a0cdfa20fe88381338961713473f3 100644 (file)
@@ -6,8 +6,8 @@
 #include <common.h>
 #include <dm.h>
 #include <syscon.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk322x.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk322x.h>
 
 int rockchip_get_clk(struct udevice **devp)
 {
diff --git a/arch/arm/mach-rockchip/rk322x/rk322x.c b/arch/arm/mach-rockchip/rk322x/rk322x.c
new file mode 100644 (file)
index 0000000..e5250bc
--- /dev/null
@@ -0,0 +1,44 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2019 Rockchip Electronics Co., Ltd
+ */
+#include <asm/io.h>
+#include <asm/arch-rockchip/grf_rk322x.h>
+#include <asm/arch-rockchip/hardware.h>
+
+#ifdef CONFIG_DEBUG_UART_BOARD_INIT
+void board_debug_uart_init(void)
+{
+#define GRF_BASE       0x11000000
+       static struct rk322x_grf * const grf = (void *)GRF_BASE;
+       enum {
+               GPIO1B2_SHIFT           = 4,
+               GPIO1B2_MASK            = 3 << GPIO1B2_SHIFT,
+               GPIO1B2_GPIO            = 0,
+               GPIO1B2_UART1_SIN,
+               GPIO1B2_UART21_SIN,
+
+               GPIO1B1_SHIFT           = 2,
+               GPIO1B1_MASK            = 3 << GPIO1B1_SHIFT,
+               GPIO1B1_GPIO            = 0,
+               GPIO1B1_UART1_SOUT,
+               GPIO1B1_UART21_SOUT,
+       };
+       enum {
+               CON_IOMUX_UART2SEL_SHIFT = 8,
+               CON_IOMUX_UART2SEL_MASK = 1 << CON_IOMUX_UART2SEL_SHIFT,
+               CON_IOMUX_UART2SEL_2    = 0,
+               CON_IOMUX_UART2SEL_21,
+       };
+
+       /* Enable early UART2 channel 1 on the RK322x */
+       rk_clrsetreg(&grf->gpio1b_iomux,
+                    GPIO1B1_MASK | GPIO1B2_MASK,
+                    GPIO1B2_UART21_SIN << GPIO1B2_SHIFT |
+                    GPIO1B1_UART21_SOUT << GPIO1B1_SHIFT);
+       /* Set channel C as UART2 input */
+       rk_clrsetreg(&grf->con_iomux,
+                    CON_IOMUX_UART2SEL_MASK,
+                    CON_IOMUX_UART2SEL_21 << CON_IOMUX_UART2SEL_SHIFT);
+}
+#endif
index 9aa64f8f1f21c8805fd3f08c8652042e44d2d436..0d9dca8173cd466af636ad9be3554460fef76d13 100644 (file)
@@ -6,7 +6,7 @@
 #include <common.h>
 #include <dm.h>
 #include <syscon.h>
-#include <asm/arch/clock.h>
+#include <asm/arch-rockchip/clock.h>
 
 static const struct udevice_id rk322x_syscon_ids[] = {
        { .compatible = "rockchip,rk3228-grf", .data = ROCKCHIP_SYSCON_GRF },
index 93c772184d330a59f14c5c2b17d8d6a3434d0335..d8d215db8a0b6ff381ffa126fd05e51fdd598652 100644 (file)
 #include <spl.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
-#include <asm/arch/bootrom.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/hardware.h>
-#include <asm/arch/periph.h>
-#include <asm/arch/pmu_rk3288.h>
-#include <asm/arch/sdram.h>
-#include <asm/arch/sdram_common.h>
-#include <asm/arch/sys_proto.h>
-#include <asm/arch/timer.h>
+#include <asm/arch-rockchip/bootrom.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/hardware.h>
+#include <asm/arch-rockchip/periph.h>
+#include <asm/arch-rockchip/pmu_rk3288.h>
+#include <asm/arch-rockchip/sdram.h>
+#include <asm/arch-rockchip/sdram_common.h>
+#include <asm/arch-rockchip/sys_proto.h>
+#include <asm/arch-rockchip/timer.h>
 #include <dm/pinctrl.h>
 #include <dm/root.h>
 #include <dm/test.h>
@@ -109,16 +109,7 @@ void board_init_f(ulong dummy)
        struct udevice *dev;
        int ret;
 
-       /* Example code showing how to enable the debug UART on RK3288 */
-#include <asm/arch/grf_rk3288.h>
-       /* Enable early UART on the RK3288 */
-#define GRF_BASE       0xff770000
-       struct rk3288_grf * const grf = (void *)GRF_BASE;
-
-       rk_clrsetreg(&grf->gpio7ch_iomux, GPIO7C7_MASK << GPIO7C7_SHIFT |
-                    GPIO7C6_MASK << GPIO7C6_SHIFT,
-                    GPIO7C7_UART2DBG_SOUT << GPIO7C7_SHIFT |
-                    GPIO7C6_UART2DBG_SIN << GPIO7C6_SHIFT);
+#ifdef CONFIG_DEBUG_UART
        /*
         * Debug UART can be used from here if required:
         *
@@ -129,6 +120,7 @@ void board_init_f(ulong dummy)
         */
        debug_uart_init();
        debug("\nspl:debug uart enabled in %s\n", __func__);
+#endif
        ret = spl_early_init();
        if (ret) {
                debug("spl_early_init() failed: %d\n", ret);
index 2aa63f515a71d4e001d5f73d01f1426b238a6746..787129bbaeaf1f4f8f3be7047c4baa17243a8cdd 100644 (file)
 #include <spl.h>
 #include <version.h>
 #include <asm/io.h>
-#include <asm/arch/bootrom.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/grf_rk3288.h>
-#include <asm/arch/periph.h>
-#include <asm/arch/pmu_rk3288.h>
-#include <asm/arch/sys_proto.h>
-#include <asm/arch/timer.h>
+#include <asm/arch-rockchip/bootrom.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/sys_proto.h>
+#include <asm/arch-rockchip/timer.h>
 
-#define GRF_BASE               0xff770000
 void board_init_f(ulong dummy)
 {
        struct udevice *dev;
        int ret;
 
-       /* Example code showing how to enable the debug UART on RK3288 */
-       /* Enable early UART on the RK3288 */
-       struct rk3288_grf * const grf = (void *)GRF_BASE;
-
-       rk_clrsetreg(&grf->gpio7ch_iomux, GPIO7C7_MASK << GPIO7C7_SHIFT |
-                    GPIO7C6_MASK << GPIO7C6_SHIFT,
-                    GPIO7C7_UART2DBG_SOUT << GPIO7C7_SHIFT |
-                    GPIO7C6_UART2DBG_SIN << GPIO7C6_SHIFT);
+#ifdef CONFIG_DEBUG_UART
        /*
         * Debug UART can be used from here if required:
         *
@@ -41,7 +30,7 @@ void board_init_f(ulong dummy)
         * printascii("string");
         */
        debug_uart_init();
-
+#endif
        ret = spl_early_init();
        if (ret) {
                debug("spl_early_init() failed: %d\n", ret);
index 9c4f7f219f1359b8d96e1005d1c39ea23215d142..41e9786d46fa473658252ca9ee0d16c7a503b6bc 100644 (file)
@@ -9,12 +9,12 @@
 #include <ram.h>
 #include <syscon.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3288.h>
-#include <asm/arch/periph.h>
-#include <asm/arch/pmu_rk3288.h>
-#include <asm/arch/qos_rk3288.h>
-#include <asm/arch/boot_mode.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk3288.h>
+#include <asm/arch-rockchip/periph.h>
+#include <asm/arch-rockchip/pmu_rk3288.h>
+#include <asm/arch-rockchip/qos_rk3288.h>
+#include <asm/arch-rockchip/boot_mode.h>
 #include <asm/gpio.h>
 #include <dm/pinctrl.h>
 #include <dt-bindings/clock/rk3288-cru.h>
@@ -321,7 +321,6 @@ int board_early_init_f(void)
 {
        const uintptr_t GRF_SOC_CON0 = 0xff770244;
        const uintptr_t GRF_SOC_CON2 = 0xff77024c;
-       struct udevice *pinctrl;
        struct udevice *dev;
        int ret;
 
@@ -335,18 +334,7 @@ int board_early_init_f(void)
                debug("CLK init failed: %d\n", ret);
                return ret;
        }
-       ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
-       if (ret) {
-               debug("%s: Cannot find pinctrl device\n", __func__);
-               return ret;
-       }
 
-       /* Enable debug UART */
-       ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_UART_DBG);
-       if (ret) {
-               debug("%s: Failed to set up console UART\n", __func__);
-               return ret;
-       }
        rk_setreg(GRF_SOC_CON2, 1 << 0);
 
        /*
index bce80238813a768c1ed9e9ed564c0449869d9c58..50680ce606b4c22be1c012e836a31e2a662777db 100644 (file)
@@ -148,7 +148,7 @@ config ROCKCHIP_FAST_SPL
          and have the required PMIC code.
 
 config SYS_SOC
-       default "rockchip"
+       default "rk3288"
 
 config SYS_MALLOC_F_LEN
        default 0x0800
index 6ca2271869a652cf906efc9914e979b1924d3339..e64ee86f081f970ae5aadb34c7033c84f33c1d16 100644 (file)
@@ -7,8 +7,8 @@
 #include <common.h>
 #include <dm.h>
 #include <syscon.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3288.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk3288.h>
 
 int rockchip_get_clk(struct udevice **devp)
 {
index a725abc5a5640cf0daba060dac7a9fc10c6dab28..7941ca68a641e2c134d8527ef116bb1eca7e1f21 100644 (file)
@@ -3,16 +3,31 @@
  * Copyright (c) 2016 Rockchip Electronics Co., Ltd
  */
 #include <asm/io.h>
-#include <asm/arch/hardware.h>
+#include <asm/arch-rockchip/hardware.h>
+#include <asm/arch-rockchip/grf_rk3288.h>
 
-#define GRF_SOC_CON2 0xff77024c
+#define GRF_BASE       0xff770000
 
 int arch_cpu_init(void)
 {
        /* We do some SoC one time setting here. */
+       struct rk3288_grf * const grf = (void *)GRF_BASE;
 
        /* Use rkpwm by default */
-       rk_setreg(GRF_SOC_CON2, 1 << 0);
+       rk_setreg(&grf->soc_con2, 1 << 0);
 
        return 0;
 }
+
+#ifdef CONFIG_DEBUG_UART_BOARD_INIT
+void board_debug_uart_init(void)
+{
+       /* Enable early UART on the RK3288 */
+       struct rk3288_grf * const grf = (void *)GRF_BASE;
+
+       rk_clrsetreg(&grf->gpio7ch_iomux, GPIO7C7_MASK << GPIO7C7_SHIFT |
+                    GPIO7C6_MASK << GPIO7C6_SHIFT,
+                    GPIO7C7_UART2DBG_SOUT << GPIO7C7_SHIFT |
+                    GPIO7C6_UART2DBG_SIN << GPIO7C6_SHIFT);
+}
+#endif
index 3bc80281c7355e7af96d71a23fd76575c6c3f2ad..dff2caa5981b058024fe259b898a8cc69b16a20c 100644 (file)
@@ -7,7 +7,7 @@
 #include <common.h>
 #include <dm.h>
 #include <syscon.h>
-#include <asm/arch/clock.h>
+#include <asm/arch-rockchip/clock.h>
 
 static const struct udevice_id rk3288_syscon_ids[] = {
        { .compatible = "rockchip,rk3288-noc", .data = ROCKCHIP_SYSCON_NOC },
index 43afba243046877ee4d21e94daba2eb7258bf904..6c5c4303a356edb3f1d69144bc1de12436133da4 100644 (file)
@@ -13,7 +13,7 @@ config TARGET_EVB_RK3328
 endchoice
 
 config SYS_SOC
-       default "rockchip"
+       default "rk3328"
 
 config SYS_MALLOC_F_LEN
        default 0x0800
index e5c2ce5766fdc4a36d94ce01e40d756391a219a4..f64f0cbbe5600790c6ad84c5de1659e32aaac7b1 100644 (file)
@@ -5,8 +5,8 @@
 
 #include <common.h>
 #include <dm.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3328.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk3328.h>
 
 int rockchip_get_clk(struct udevice **devp)
 {
index a519f5fb846f55dcfbbd15b8f9780b829d718c64..1cf829dc3435c4e638fd12f005d3a8f74b7d9d53 100644 (file)
@@ -4,7 +4,7 @@
  */
 
 #include <common.h>
-#include <asm/arch/hardware.h>
+#include <asm/arch-rockchip/hardware.h>
 #include <asm/armv8/mmu.h>
 #include <asm/io.h>
 
index 28dd8cb20a53401cf201ef51ab15bd7d189dbcec..8a0eceb17877b15495ea4d56a91ff675ea3892a3 100644 (file)
@@ -4,7 +4,7 @@
  */
 
 #include <common.h>
-#include <asm/arch/clock.h>
+#include <asm/arch-rockchip/clock.h>
 #include <dm.h>
 #include <syscon.h>
 
index 230850ad6c57b49ec974613f7ea465b2e286f193..b055ed4aee00d09c39d4e70eb9546f0950c1a4ad 100644 (file)
@@ -9,17 +9,9 @@
 #include <ram.h>
 #include <spl.h>
 #include <asm/io.h>
-#include <asm/arch/cru_rk3368.h>
-#include <asm/arch/grf_rk3368.h>
-#include <asm/arch/hardware.h>
-#include <asm/arch/periph.h>
-#include <asm/arch/timer.h>
+#include <asm/arch-rockchip/periph.h>
 #include <dm/pinctrl.h>
 
-void board_debug_uart_init(void)
-{
-}
-
 void board_init_f(ulong dummy)
 {
        struct udevice *pinctrl;
index f90a1fdca7252fcdd06b0d3ff4238a5b1ff894b3..dc65a021c8124f81eeaebcb4095210c960a4ce6a 100644 (file)
 #include <spl.h>
 #include <syscon.h>
 #include <asm/io.h>
-#include <asm/arch/bootrom.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3368.h>
-#include <asm/arch/grf_rk3368.h>
-#include <asm/arch/hardware.h>
-#include <asm/arch/timer.h>
+#include <asm/arch-rockchip/bootrom.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk3368.h>
+#include <asm/arch-rockchip/hardware.h>
+#include <asm/arch-rockchip/timer.h>
 
 /*
  * The SPL (and also the full U-Boot stage on the RK3368) will run in
@@ -79,42 +78,12 @@ static void sgrf_init(void)
        rk_clrreg(&cru->softrst_con[4], DMA2_SRST_REQ);
 }
 
-void board_debug_uart_init(void)
-{
-       /*
-        * N.B.: This is called before the device-model has been
-        *       initialised. For this reason, we can not access
-        *       the GRF address range using the syscon API.
-        */
-       struct rk3368_grf * const grf =
-               (struct rk3368_grf * const)0xff770000;
-
-       enum {
-               GPIO2D1_MASK            = GENMASK(3, 2),
-               GPIO2D1_GPIO            = 0,
-               GPIO2D1_UART0_SOUT      = (1 << 2),
-
-               GPIO2D0_MASK            = GENMASK(1, 0),
-               GPIO2D0_GPIO            = 0,
-               GPIO2D0_UART0_SIN       = (1 << 0),
-       };
-
-#if defined(CONFIG_DEBUG_UART_BASE) && (CONFIG_DEBUG_UART_BASE == 0xff180000)
-       /* Enable early UART0 on the RK3368 */
-       rk_clrsetreg(&grf->gpio2d_iomux,
-                    GPIO2D0_MASK, GPIO2D0_UART0_SIN);
-       rk_clrsetreg(&grf->gpio2d_iomux,
-                    GPIO2D1_MASK, GPIO2D1_UART0_SOUT);
-#endif
-}
-
 void board_init_f(ulong dummy)
 {
        struct udevice *dev;
        int ret;
 
-#define EARLY_UART
-#ifdef EARLY_UART
+#ifdef CONFIG_DEBUG_UART
        /*
         * Debug UART can be used from here if required:
         *
index 7c9b722b002309fd82a77c0a80197492f871ebdd..325572a7e4079a69053982a3d8ca6dc02dcd795e 100644 (file)
@@ -43,7 +43,7 @@ config TARGET_EVB_PX5
 endchoice
 
 config SYS_SOC
-       default "rockchip"
+       default "rk3368"
 
 source "board/theobroma-systems/lion_rk3368/Kconfig"
 source "board/rockchip/sheep_rk3368/Kconfig"
index 722160dfdc5d6a68b76d2dd1165c1f5563e2da69..55e5dd768a9ff2184578ce4595b91b3d19fc6a72 100644 (file)
@@ -7,8 +7,8 @@
 #include <common.h>
 #include <dm.h>
 #include <syscon.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3368.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk3368.h>
 
 int rockchip_get_clk(struct udevice **devp)
 {
index 6d5d4cc760ae554a030faf43d4748a5584223404..1ed06c5352a07ebcbb3359249bd1840722b0e063 100644 (file)
@@ -7,9 +7,9 @@
 #include <common.h>
 #include <asm/armv8/mmu.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3368.h>
-#include <asm/arch/grf_rk3368.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk3368.h>
+#include <asm/arch-rockchip/grf_rk3368.h>
 #include <syscon.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -96,3 +96,34 @@ int arch_early_init_r(void)
        return mcu_init();
 }
 #endif
+
+#ifdef CONFIG_DEBUG_UART_BOARD_INIT
+void board_debug_uart_init(void)
+{
+       /*
+        * N.B.: This is called before the device-model has been
+        *       initialised. For this reason, we can not access
+        *       the GRF address range using the syscon API.
+        */
+#if defined(CONFIG_DEBUG_UART_BASE) && (CONFIG_DEBUG_UART_BASE == 0xff180000)
+       struct rk3368_grf * const grf =
+               (struct rk3368_grf * const)0xff770000;
+
+       enum {
+               GPIO2D1_MASK            = GENMASK(3, 2),
+               GPIO2D1_GPIO            = 0,
+               GPIO2D1_UART0_SOUT      = (1 << 2),
+
+               GPIO2D0_MASK            = GENMASK(1, 0),
+               GPIO2D0_GPIO            = 0,
+               GPIO2D0_UART0_SIN       = (1 << 0),
+       };
+
+       /* Enable early UART0 on the RK3368 */
+       rk_clrsetreg(&grf->gpio2d_iomux,
+                    GPIO2D0_MASK, GPIO2D0_UART0_SIN);
+       rk_clrsetreg(&grf->gpio2d_iomux,
+                    GPIO2D1_MASK, GPIO2D1_UART0_SOUT);
+#endif
+}
+#endif
index c08ce437ea41590f02039b62d3be62079ce2c67a..4ba94f2e805091c3d6bd5c12b87ff08bb966231e 100644 (file)
@@ -8,7 +8,7 @@
 #include <common.h>
 #include <dm.h>
 #include <syscon.h>
-#include <asm/arch/clock.h>
+#include <asm/arch-rockchip/clock.h>
 
 static const struct udevice_id rk3368_syscon_ids[] = {
        { .compatible = "rockchip,rk3368-grf",
index ccc136f388193c36a74eb68213dd2d499918525c..800ca800223b5c8a25374d165d6c4b9ffa289eb8 100644 (file)
 #include <spl_gpio.h>
 #include <syscon.h>
 #include <asm/io.h>
-#include <asm/arch/bootrom.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/grf_rk3399.h>
-#include <asm/arch/hardware.h>
-#include <asm/arch/periph.h>
-#include <asm/arch/sys_proto.h>
+#include <asm/arch-rockchip/bootrom.h>
+#include <asm/arch-rockchip/clock.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 <dm/pinctrl.h>
 
 void board_return_to_bootrom(void)
@@ -127,53 +127,6 @@ void secure_timer_init(void)
        writel(TIMER_EN | TIMER_FMODE, TIMER_CHN10_BASE + TIMER_CONTROL_REG);
 }
 
-void board_debug_uart_init(void)
-{
-#define GRF_BASE       0xff770000
-#define GPIO0_BASE     0xff720000
-#define PMUGRF_BASE    0xff320000
-       struct rk3399_grf_regs * const grf = (void *)GRF_BASE;
-#ifdef CONFIG_TARGET_CHROMEBOOK_BOB
-       struct rk3399_pmugrf_regs * const pmugrf = (void *)PMUGRF_BASE;
-       struct rockchip_gpio_regs * const gpio = (void *)GPIO0_BASE;
-#endif
-
-#if defined(CONFIG_DEBUG_UART_BASE) && (CONFIG_DEBUG_UART_BASE == 0xff180000)
-       /* Enable early UART0 on the RK3399 */
-       rk_clrsetreg(&grf->gpio2c_iomux,
-                    GRF_GPIO2C0_SEL_MASK,
-                    GRF_UART0BT_SIN << GRF_GPIO2C0_SEL_SHIFT);
-       rk_clrsetreg(&grf->gpio2c_iomux,
-                    GRF_GPIO2C1_SEL_MASK,
-                    GRF_UART0BT_SOUT << GRF_GPIO2C1_SEL_SHIFT);
-#else
-# ifdef CONFIG_TARGET_CHROMEBOOK_BOB
-       rk_setreg(&grf->io_vsel, 1 << 0);
-
-       /*
-        * Let's enable these power rails here, we are already running the SPI
-        * Flash based code.
-        */
-       spl_gpio_output(gpio, GPIO(BANK_B, 2), 1);  /* PP1500_EN */
-       spl_gpio_set_pull(&pmugrf->gpio0_p, GPIO(BANK_B, 2), GPIO_PULL_NORMAL);
-
-       spl_gpio_output(gpio, GPIO(BANK_B, 4), 1);  /* PP3000_EN */
-       spl_gpio_set_pull(&pmugrf->gpio0_p, GPIO(BANK_B, 4), GPIO_PULL_NORMAL);
-#endif /* CONFIG_TARGET_CHROMEBOOK_BOB */
-
-       /* Enable early UART2 channel C on the RK3399 */
-       rk_clrsetreg(&grf->gpio4c_iomux,
-                    GRF_GPIO4C3_SEL_MASK,
-                    GRF_UART2DGBC_SIN << GRF_GPIO4C3_SEL_SHIFT);
-       rk_clrsetreg(&grf->gpio4c_iomux,
-                    GRF_GPIO4C4_SEL_MASK,
-                    GRF_UART2DBGC_SOUT << GRF_GPIO4C4_SEL_SHIFT);
-       /* Set channel C as UART2 input */
-       rk_clrsetreg(&grf->soc_con7,
-                    GRF_UART_DBG_SEL_MASK,
-                    GRF_UART_DBG_SEL_C << GRF_UART_DBG_SEL_SHIFT);
-#endif
-}
 
 void board_init_f(ulong dummy)
 {
@@ -183,8 +136,7 @@ void board_init_f(ulong dummy)
        struct rk3399_grf_regs *grf;
        int ret;
 
-#define EARLY_UART
-#ifdef EARLY_UART
+#ifdef CONFIG_DEBUG_UART
        debug_uart_init();
 
 # ifdef CONFIG_TARGET_CHROMEBOOK_BOB
index 137ec714c2e04800242e22d7c3c456effe4d4426..443c87cccce118a396d88a9029e2fd4406ac6418 100644 (file)
@@ -4,7 +4,7 @@
  */
 
 #include <common.h>
-#include <asm/arch/boot_mode.h>
+#include <asm/arch-rockchip/boot_mode.h>
 
 int board_late_init(void)
 {
index 2408adb4206793de54eeb7277191fa4779083677..2c5c93c0b85916d9add22ba9d61632930f587940 100644 (file)
@@ -65,7 +65,7 @@ config TARGET_CHROMEBOOK_BOB
 endchoice
 
 config SYS_SOC
-       default "rockchip"
+       default "rk3399"
 
 config SYS_MALLOC_F_LEN
        default 0x0800
index 98f7482f79f1a89ac5d1fefacb718bf2029742f3..f0411c0a21ecadf00fb443bb181e57dc67ece590 100644 (file)
@@ -7,8 +7,8 @@
 #include <common.h>
 #include <dm.h>
 #include <syscon.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3399.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk3399.h>
 
 static int rockchip_get_cruclk(struct udevice **devp)
 {
index d8467d73335e3f9c2f8064f2af04dae489f9c80f..a7ccd4f3ed2c6177045883ba9a69bc638f0209a4 100644 (file)
@@ -4,13 +4,17 @@
  */
 
 #include <common.h>
+#include <spl_gpio.h>
 #include <asm/armv8/mmu.h>
 #include <asm/io.h>
-#include <asm/arch/hardware.h>
+#include <asm/arch-rockchip/gpio.h>
+#include <asm/arch-rockchip/grf_rk3399.h>
+#include <asm/arch-rockchip/hardware.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
 #define GRF_EMMCCORE_CON11 0xff77f02c
+#define GRF_BASE       0xff770000
 
 static struct mm_region rk3399_mem_map[] = {
        {
@@ -48,9 +52,60 @@ int dram_init_banksize(void)
 int arch_cpu_init(void)
 {
        /* We do some SoC one time setting here. */
+       struct rk3399_grf_regs * const grf = (void *)GRF_BASE;
 
        /* Emmc clock generator: disable the clock multipilier */
-       rk_clrreg(GRF_EMMCCORE_CON11, 0x0ff);
+       rk_clrreg(&grf->emmccore_con[11], 0x0ff);
 
        return 0;
 }
+
+#ifdef CONFIG_DEBUG_UART_BOARD_INIT
+void board_debug_uart_init(void)
+{
+#define GRF_BASE       0xff770000
+#define GPIO0_BASE     0xff720000
+#define PMUGRF_BASE    0xff320000
+       struct rk3399_grf_regs * const grf = (void *)GRF_BASE;
+#ifdef CONFIG_TARGET_CHROMEBOOK_BOB
+       struct rk3399_pmugrf_regs * const pmugrf = (void *)PMUGRF_BASE;
+       struct rockchip_gpio_regs * const gpio = (void *)GPIO0_BASE;
+#endif
+
+#if defined(CONFIG_DEBUG_UART_BASE) && (CONFIG_DEBUG_UART_BASE == 0xff180000)
+       /* Enable early UART0 on the RK3399 */
+       rk_clrsetreg(&grf->gpio2c_iomux,
+                    GRF_GPIO2C0_SEL_MASK,
+                    GRF_UART0BT_SIN << GRF_GPIO2C0_SEL_SHIFT);
+       rk_clrsetreg(&grf->gpio2c_iomux,
+                    GRF_GPIO2C1_SEL_MASK,
+                    GRF_UART0BT_SOUT << GRF_GPIO2C1_SEL_SHIFT);
+#else
+# ifdef CONFIG_TARGET_CHROMEBOOK_BOB
+       rk_setreg(&grf->io_vsel, 1 << 0);
+
+       /*
+        * Let's enable these power rails here, we are already running the SPI
+        * Flash based code.
+        */
+       spl_gpio_output(gpio, GPIO(BANK_B, 2), 1);  /* PP1500_EN */
+       spl_gpio_set_pull(&pmugrf->gpio0_p, GPIO(BANK_B, 2), GPIO_PULL_NORMAL);
+
+       spl_gpio_output(gpio, GPIO(BANK_B, 4), 1);  /* PP3000_EN */
+       spl_gpio_set_pull(&pmugrf->gpio0_p, GPIO(BANK_B, 4), GPIO_PULL_NORMAL);
+#endif /* CONFIG_TARGET_CHROMEBOOK_BOB */
+
+       /* Enable early UART2 channel C on the RK3399 */
+       rk_clrsetreg(&grf->gpio4c_iomux,
+                    GRF_GPIO4C3_SEL_MASK,
+                    GRF_UART2DGBC_SIN << GRF_GPIO4C3_SEL_SHIFT);
+       rk_clrsetreg(&grf->gpio4c_iomux,
+                    GRF_GPIO4C4_SEL_MASK,
+                    GRF_UART2DBGC_SOUT << GRF_GPIO4C4_SEL_SHIFT);
+       /* Set channel C as UART2 input */
+       rk_clrsetreg(&grf->soc_con7,
+                    GRF_UART_DBG_SEL_MASK,
+                    GRF_UART_DBG_SEL_C << GRF_UART_DBG_SEL_SHIFT);
+#endif
+}
+#endif
index 98f4be970f8255f3f4e06cfcdd80fcef0247a9f4..a8bb5b11e56e53ecd5e506a51e563ed49fd7f01b 100644 (file)
@@ -6,7 +6,7 @@
 #include <common.h>
 #include <dm.h>
 #include <syscon.h>
-#include <asm/arch/clock.h>
+#include <asm/arch-rockchip/clock.h>
 
 static const struct udevice_id rk3399_syscon_ids[] = {
        { .compatible = "rockchip,rk3399-grf", .data = ROCKCHIP_SYSCON_GRF },
index e751f29d0f64611f1377e11505b4266331cf032a..f20e64f48ece7ceb6d937286ed174eb7afd87593 100644 (file)
@@ -4,7 +4,7 @@
  */
 
 #include <common.h>
-#include <asm/arch/timer.h>
+#include <asm/arch-rockchip/timer.h>
 #include <asm/io.h>
 #include <linux/types.h>
 
index 8883aeae7a4e068045d52c6c256e7b81a9f53a74..e3a63b80e134c083ebd4c0fd17067493288f4a94 100644 (file)
@@ -23,7 +23,7 @@ config TARGET_ELGIN_RV1108
          RV1108 ELGIN is a board based on the Rockchip RV1108.
 
 config SYS_SOC
-       default "rockchip"
+       default "rv1108"
 
 config SYS_MALLOC_F_LEN
        default 0x400
index 5f3705cc390da05ee6b69c9f1f2aeea5973e2893..58a7e889cc36d145232090ee5beaa45219c5799b 100644 (file)
@@ -7,8 +7,8 @@
 #include <common.h>
 #include <dm.h>
 #include <syscon.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rv1108.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rv1108.h>
 
 int rockchip_get_clk(struct udevice **devp)
 {
index 5a0f0a56114ed891230c889a88c60e848958763a..babdf5720b248eb992a2f254b06f3cbbfc43472e 100644 (file)
@@ -6,7 +6,7 @@
 #include <common.h>
 #include <dm.h>
 #include <syscon.h>
-#include <asm/arch/clock.h>
+#include <asm/arch-rockchip/clock.h>
 
 static const struct udevice_id rv1108_syscon_ids[] = {
        { .compatible = "rockchip,rv1108-grf", .data = ROCKCHIP_SYSCON_GRF },
index a27138083ab9e11d9afbab52cf19e3286c19f761..8684dbd4fa67fca7691a4f523e0ccc648ec2d53a 100644 (file)
@@ -7,7 +7,7 @@
 #include <dm.h>
 #include <ram.h>
 #include <asm/io.h>
-#include <asm/arch/sdram_common.h>
+#include <asm/arch-rockchip/sdram_common.h>
 #include <dm/uclass-internal.h>
 
 DECLARE_GLOBAL_DATA_PTR;
index 3abc51441299e7c01282bf460f4a4799e51c89f9..0de1f4243ebd326de1a763e6b54320ba3b7b98a6 100644 (file)
@@ -7,8 +7,8 @@
 #include <common.h>
 #include <asm/io.h>
 #include <fdtdec.h>
-#include <asm/arch/grf_rv1108.h>
-#include <asm/arch/hardware.h>
+#include <asm/arch-rockchip/grf_rv1108.h>
+#include <asm/arch-rockchip/hardware.h>
 #include <asm/gpio.h>
 
 DECLARE_GLOBAL_DATA_PTR;
index d5acc4fe27f785ca03e4e70f1e186219866106cb..8c606463e45528f50781569d24a5f4b53d57fc80 100644 (file)
@@ -6,8 +6,8 @@
 #include <common.h>
 #include <dm.h>
 #include <asm/io.h>
-#include <asm/arch/uart.h>
-#include <asm/arch/sdram_rk3036.h>
+#include <asm/arch-rockchip/uart.h>
+#include <asm/arch-rockchip/sdram_rk3036.h>
 
 void get_ddr_config(struct rk3036_ddr_config *config)
 {
index 63c84fccfe84c472191e4db877784e432037b3bc..c64c62f7b0f5586b4c85e5d2ec3695dcda96d349 100644 (file)
@@ -6,5 +6,5 @@
 #include <common.h>
 #include <dm.h>
 #include <asm/io.h>
-#include <asm/arch/uart.h>
+#include <asm/arch-rockchip/uart.h>
 
index caad30641ec31eb41e9232419afab35a1f18366e..07ee8ce92c9e930a59c402632983ca0dba279e2e 100644 (file)
@@ -5,3 +5,10 @@ F:      board/rockchip/evb_rk3399
 F:      include/configs/evb_rk3399.h
 F:      configs/evb-rk3399_defconfig
 F:      configs/firefly-rk3399_defconfig
+
+ORANGEPI-RK3399
+M:     Jagan Teki <jagan@amarulasolutions.com>
+S:     Maintained
+F:     configs/orangepi-rk3399_defconfig
+F:     arch/arm/dts/rk3399-u-boot.dtsi
+F:     arch/arm/dts/rk3399-orangepi-u-boot.dtsi
index 3e9e83f3ad06c271d1ceb4f7e3b65dd86b98b659..bf2ad98c473d6f23650d6e39e61b7b6824eaadca 100644 (file)
@@ -7,7 +7,7 @@
 #include <dm.h>
 #include <dm/pinctrl.h>
 #include <dm/uclass-internal.h>
-#include <asm/arch/periph.h>
+#include <asm/arch-rockchip/periph.h>
 #include <power/regulator.h>
 #include <spl.h>
 
index 107929ee8a884b5f31860c1a233e9de81c0f94e1..457b110cd52c1faf8ccde74934a0208f1bcb0e05 100644 (file)
@@ -7,8 +7,8 @@
 #include <common.h>
 #include <asm/io.h>
 #include <fdtdec.h>
-#include <asm/arch/grf_rv1108.h>
-#include <asm/arch/hardware.h>
+#include <asm/arch-rockchip/grf_rv1108.h>
+#include <asm/arch-rockchip/hardware.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
index 3a2f08354f59e34521688ea7582898cf347ea497..2faeab9baf518245b42fe26e08fa5ed3d11209cf 100644 (file)
@@ -6,8 +6,8 @@
 #include <common.h>
 #include <dm.h>
 #include <asm/io.h>
-#include <asm/arch/uart.h>
-#include <asm/arch/sdram_rk3036.h>
+#include <asm/arch-rockchip/uart.h>
+#include <asm/arch-rockchip/sdram_rk3036.h>
 #include <asm/gpio.h>
 
 void get_ddr_config(struct rk3036_ddr_config *config)
index ea22cb985fe1974644de05ad0e2b5e8a32870208..9bb93c7d16696f8d67c453ee978963c733c7d273 100644 (file)
@@ -4,8 +4,8 @@
  */
 #include <common.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/grf_rk3368.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/grf_rk3368.h>
 #include <syscon.h>
 
 int mach_cpu_init(void)
index cf71e4ce561138996486a701dbc7b0130492512e..28816bc1a0c1b7ecd7ea83010dfa874d36887c8f 100644 (file)
@@ -9,4 +9,20 @@ config SYS_VENDOR
 config SYS_CONFIG_NAME
        default "taurus"
 
+choice
+       prompt "Board Type AXM/TAURUS"
+       default BOARD_AXM
+
+config BOARD_AXM
+       bool "AXM board type"
+       help
+         Select this, if you want to build for AXM board.
+
+config BOARD_TAURUS
+       bool "TAURUS board type"
+       help
+         Select this, if you want to build for TAURUS board.
+
+endchoice
+
 endif
index 8396ce502b0f90e0e58340d67cf6a24fd55d1ee9..6ea97eb4e87ccb8ab982096d709799a3bd9ba074 100644 (file)
@@ -197,11 +197,11 @@ void mem_init(void)
 
        /* Mirrors at A15 on ATMEL G20 SDRAM Controller with 64MB*/
        if (ram_size == 0x800) {
-               printf("\n\r 64MB");
+               printf("\n\r 64MB\n");
                sdramc_configure(AT91_SDRAMC_NC_9);
        } else {
                /* Size already initialized */
-               printf("\n\r 128MB");
+               printf("\n\r 128MB\n");
        }
 }
 #endif
@@ -282,24 +282,6 @@ int board_early_init_f(void)
        return 0;
 }
 
-/* FIXME gpio code here need to handle through DM_GPIO */
-#ifndef CONFIG_DM_SPI
-int spi_cs_is_valid(unsigned int bus, unsigned int cs)
-{
-       return bus == 0 && cs == 0;
-}
-
-void spi_cs_activate(struct spi_slave *slave)
-{
-       at91_set_gpio_value(TAURUS_SPI_CS_PIN, 0);
-}
-
-void spi_cs_deactivate(struct spi_slave *slave)
-{
-       at91_set_gpio_value(TAURUS_SPI_CS_PIN, 1);
-}
-#endif
-
 #ifdef CONFIG_USB_GADGET_AT91
 #include <linux/usb/at91_udc.h>
 
@@ -347,17 +329,6 @@ int dram_init(void)
        return 0;
 }
 
-#ifndef CONFIG_DM_ETH
-int board_eth_init(bd_t *bis)
-{
-       int rc = 0;
-#ifdef CONFIG_MACB
-       rc = macb_eth_initialize(0, (void *)ATMEL_BASE_EMAC0, 0x00);
-#endif
-       return rc;
-}
-#endif
-
 #if !defined(CONFIG_SPL_BUILD)
 #if defined(CONFIG_BOARD_AXM)
 /*
index e207535df05361a46e9c3490c25b71c371ad73d7..6cd5a5f18efd78b78ca93a32be41962f780dd250 100644 (file)
@@ -6,9 +6,9 @@
 #include <dm.h>
 #include <ram.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/grf_rk3368.h>
-#include <asm/arch/timer.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/grf_rk3368.h>
+#include <asm/arch-rockchip/timer.h>
 #include <syscon.h>
 
 int mach_cpu_init(void)
index 573e691457f75f0bed8cc72fffe52309ef85f336..c6b509c109c560b9c65483c41e34f0fbe05e94de 100644 (file)
 #include <asm/io.h>
 #include <asm/gpio.h>
 #include <asm/setup.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3399.h>
-#include <asm/arch/hardware.h>
-#include <asm/arch/grf_rk3399.h>
-#include <asm/arch/periph.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>
 #include <power/regulator.h>
 #include <u-boot/sha256.h>
 
index 04f4b8e69347d49e7fde115f9339b4cb35835a49..37a599768b1054ceea478656db38c4fee00ff133 100644 (file)
@@ -399,7 +399,6 @@ void enable_board_pin_mux(void)
                        configure_module_pin_mux(mii1_pin_mux);
                }
                /* Beaglebone LT pinmux */
-               configure_module_pin_mux(mii1_pin_mux);
                configure_module_pin_mux(mmc0_pin_mux);
 #if defined(CONFIG_NAND) && defined(CONFIG_EMMC_BOOT)
                configure_module_pin_mux(nand_pin_mux);
index d3775b22191b5e373812e412f2567bcae5de808e..0f5ef3a09a434b290012530c9f639ed07d9e5f39 100644 (file)
@@ -7,7 +7,7 @@
 #include <dm.h>
 #include <dm/pinctrl.h>
 #include <dm/uclass-internal.h>
-#include <asm/arch/periph.h>
+#include <asm/arch-rockchip/periph.h>
 #include <power/regulator.h>
 #include <spl.h>
 
index efaa548be4d84dd41bf7f4ee3ef78baf03e66ca3..f1d7d8bc6634f4b1624959667457bcd0bbb21372 100644 (file)
@@ -297,18 +297,21 @@ static efi_status_t efi_install_fdt(const char *fdt_opt)
 static efi_status_t do_bootefi_exec(efi_handle_t handle)
 {
        efi_status_t ret;
+       efi_uintn_t exit_data_size = 0;
+       u16 *exit_data = NULL;
 
        /* Transfer environment variable as load options */
        ret = set_load_options(handle, "bootargs");
        if (ret != EFI_SUCCESS)
                return ret;
 
-       /* we don't support much: */
-       env_set("efi_8be4df61-93ca-11d2-aa0d-00e098032b8c_OsIndicationsSupported",
-               "{ro,boot}(blob)0000000000000000");
-
        /* Call our payload! */
-       ret = EFI_CALL(efi_start_image(handle, NULL, NULL));
+       ret = EFI_CALL(efi_start_image(handle, &exit_data_size, &exit_data));
+       printf("## Application terminated, r = %lu\n", ret & ~EFI_ERROR_MASK);
+       if (ret && exit_data) {
+               printf("## %ls\n", exit_data);
+               efi_free_pool(exit_data);
+       }
 
        efi_restore_gd();
 
@@ -361,7 +364,6 @@ static int do_efibootmgr(const char *fdt_opt)
        }
 
        ret = do_bootefi_exec(handle);
-       printf("## Application terminated, r = %lu\n", ret & ~EFI_ERROR_MASK);
 
        if (ret != EFI_SUCCESS)
                return CMD_RET_FAILURE;
@@ -476,7 +478,6 @@ static int do_bootefi_image(const char *image_opt, const char *fdt_opt)
                goto out;
 
        ret = do_bootefi_exec(handle);
-       printf("## Application terminated, r = %lu\n", ret & ~EFI_ERROR_MASK);
 
 out:
        if (mem_handle)
index a40c4f4be286ba49142719a00cae482e22006e33..c4ac9dd634e2628fe19472a47fd435d0114fae7a 100644 (file)
@@ -11,6 +11,7 @@
 #include <efi_loader.h>
 #include <environment.h>
 #include <exports.h>
+#include <hexdump.h>
 #include <malloc.h>
 #include <search.h>
 #include <linux/ctype.h>
@@ -545,7 +546,10 @@ static int do_efi_boot_add(cmd_tbl_t *cmdtp, int flag,
                                + sizeof(struct efi_device_path); /* for END */
 
        /* optional data */
-       lo.optional_data = (u8 *)(argc == 6 ? "" : argv[6]);
+       if (argc < 6)
+               lo.optional_data = NULL;
+       else
+               lo.optional_data = (const u8 *)argv[6];
 
        size = efi_serialize_load_option(&lo, (u8 **)&data);
        if (!size) {
@@ -615,12 +619,13 @@ static int do_efi_boot_rm(cmd_tbl_t *cmdtp, int flag,
 /**
  * show_efi_boot_opt_data() - dump UEFI load option
  *
- * @id:                Load option number
- * @data:      Value of UEFI load option variable
+ * @id:                load option number
+ * @data:      value of UEFI load option variable
+ * @size:      size of the boot option
  *
  * Decode the value of UEFI load option variable and print information.
  */
-static void show_efi_boot_opt_data(int id, void *data)
+static void show_efi_boot_opt_data(int id, void *data, size_t size)
 {
        struct efi_load_option lo;
        char *label, *p;
@@ -638,7 +643,7 @@ static void show_efi_boot_opt_data(int id, void *data)
        utf16_utf8_strncpy(&p, lo.label, label_len16);
 
        printf("Boot%04X:\n", id);
-       printf("\tattributes: %c%c%c (0x%08x)\n",
+       printf("  attributes: %c%c%c (0x%08x)\n",
               /* ACTIVE */
               lo.attributes & LOAD_OPTION_ACTIVE ? 'A' : '-',
               /* FORCE RECONNECT */
@@ -646,14 +651,16 @@ static void show_efi_boot_opt_data(int id, void *data)
               /* HIDDEN */
               lo.attributes & LOAD_OPTION_HIDDEN ? 'H' : '-',
               lo.attributes);
-       printf("\tlabel: %s\n", label);
+       printf("  label: %s\n", label);
 
        dp_str = efi_dp_str(lo.file_path);
-       printf("\tfile_path: %ls\n", dp_str);
+       printf("  file_path: %ls\n", dp_str);
        efi_free_pool(dp_str);
 
-       printf("\tdata: %s\n", lo.optional_data);
-
+       printf("  data:\n");
+       print_hex_dump("    ", DUMP_PREFIX_OFFSET, 16, 1,
+                      lo.optional_data, size + (u8 *)data -
+                      (u8 *)lo.optional_data, true);
        free(label);
 }
 
@@ -686,13 +693,24 @@ static void show_efi_boot_opt(int id)
                                                data));
        }
        if (ret == EFI_SUCCESS)
-               show_efi_boot_opt_data(id, data);
+               show_efi_boot_opt_data(id, data, size);
        else if (ret == EFI_NOT_FOUND)
                printf("Boot%04X: not found\n", id);
 
        free(data);
 }
 
+static int u16_tohex(u16 c)
+{
+       if (c >= '0' && c <= '9')
+               return c - '0';
+       if (c >= 'A' && c <= 'F')
+               return c - 'A' + 10;
+
+       /* not hexadecimal */
+       return -1;
+}
+
 /**
  * show_efi_boot_dump() - dump all UEFI load options
  *
@@ -709,38 +727,58 @@ static void show_efi_boot_opt(int id)
 static int do_efi_boot_dump(cmd_tbl_t *cmdtp, int flag,
                            int argc, char * const argv[])
 {
-       char regex[256];
-       char * const regexlist[] = {regex};
-       char *variables = NULL, *boot, *value;
-       int len;
-       int id;
+       u16 *var_name16, *p;
+       efi_uintn_t buf_size, size;
+       efi_guid_t guid;
+       int id, i, digit;
+       efi_status_t ret;
 
        if (argc > 1)
                return CMD_RET_USAGE;
 
-       snprintf(regex, 256, "efi_.*-.*-.*-.*-.*_Boot[0-9A-F]+");
-
-       /* TODO: use GetNextVariableName? */
-       len = hexport_r(&env_htab, '\n', H_MATCH_REGEX | H_MATCH_KEY,
-                       &variables, 0, 1, regexlist);
-
-       if (!len)
-               return CMD_RET_SUCCESS;
-
-       if (len < 0)
+       buf_size = 128;
+       var_name16 = malloc(buf_size);
+       if (!var_name16)
                return CMD_RET_FAILURE;
 
-       boot = variables;
-       while (*boot) {
-               value = strstr(boot, "Boot") + 4;
-               id = (int)simple_strtoul(value, NULL, 16);
-               show_efi_boot_opt(id);
-               boot = strchr(boot, '\n');
-               if (!*boot)
+       var_name16[0] = 0;
+       for (;;) {
+               size = buf_size;
+               ret = EFI_CALL(efi_get_next_variable_name(&size, var_name16,
+                                                         &guid));
+               if (ret == EFI_NOT_FOUND)
                        break;
-               boot++;
+               if (ret == EFI_BUFFER_TOO_SMALL) {
+                       buf_size = size;
+                       p = realloc(var_name16, buf_size);
+                       if (!p) {
+                               free(var_name16);
+                               return CMD_RET_FAILURE;
+                       }
+                       var_name16 = p;
+                       ret = EFI_CALL(efi_get_next_variable_name(&size,
+                                                                 var_name16,
+                                                                 &guid));
+               }
+               if (ret != EFI_SUCCESS) {
+                       free(var_name16);
+                       return CMD_RET_FAILURE;
+               }
+
+               if (memcmp(var_name16, L"Boot", 8))
+                       continue;
+
+               for (id = 0, i = 0; i < 4; i++) {
+                       digit = u16_tohex(var_name16[4 + i]);
+                       if (digit < 0)
+                               break;
+                       id = (id << 4) + digit;
+               }
+               if (i == 4 && !var_name16[8])
+                       show_efi_boot_opt(id);
        }
-       free(variables);
+
+       free(var_name16);
 
        return CMD_RET_SUCCESS;
 }
index 638870352f406d11f5738f6739a2d6731c26468b..33cda513969f659c63f0975721eb61831e66fa2b 100644 (file)
--- a/cmd/gpt.c
+++ b/cmd/gpt.c
@@ -876,21 +876,21 @@ U_BOOT_CMD(gpt, CONFIG_SYS_MAXARGS, 1, do_gpt,
        " Example usage:\n"
        " gpt write mmc 0 $partitions\n"
        " gpt verify mmc 0 $partitions\n"
-       " read <interface> <dev>\n"
-       "    - read GPT into a data structure for manipulation\n"
-       " guid <interface> <dev>\n"
+       " gpt guid <interface> <dev>\n"
        "    - print disk GUID\n"
-       " guid <interface> <dev> <varname>\n"
+       " gpt guid <interface> <dev> <varname>\n"
        "    - set environment variable to disk GUID\n"
        " Example usage:\n"
        " gpt guid mmc 0\n"
        " gpt guid mmc 0 varname\n"
 #ifdef CONFIG_CMD_GPT_RENAME
        "gpt partition renaming commands:\n"
-       "gpt swap <interface> <dev> <name1> <name2>\n"
+       " gpt read <interface> <dev>\n"
+       "    - read GPT into a data structure for manipulation\n"
+       " gpt swap <interface> <dev> <name1> <name2>\n"
        "    - change all partitions named name1 to name2\n"
        "      and vice-versa\n"
-       "gpt rename <interface> <dev> <part> <name>\n"
+       " gpt rename <interface> <dev> <part> <name>\n"
        "    - rename the specified partition\n"
        " Example usage:\n"
        " gpt swap mmc 0 foo bar\n"
index e65b38dbf399b9fbb22969de561b3abb2d215d04..2805e8182b41fbafba75d44724b1c7b1933eb5d5 100644 (file)
@@ -291,8 +291,11 @@ static int append_value(char **bufp, size_t *sizep, char *data)
                if (!tmp_buf)
                        return -1;
 
-               if (hex2bin((u8 *)tmp_buf, data, len) < 0)
+               if (hex2bin((u8 *)tmp_buf, data, len) < 0) {
+                       printf("Error: illegal hexadecimal string\n");
+                       free(tmp_buf);
                        return -1;
+               }
 
                value = tmp_buf;
        } else { /* string */
index e0c1480d6d43705ce6cde47543db98414670fea4..9b70c6a6aff7bf0f16c4269e98d876680bfa5d0d 100644 (file)
@@ -8,7 +8,7 @@
 #include <console.h>
 #include <g_dnl.h>
 #include <usb.h>
-#include <asm/arch/f_rockusb.h>
+#include <asm/arch-rockchip/f_rockusb.h>
 
 static int do_rockusb(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 {
index 105ff01d14de3f0d6ee58becb2bb8fe47da7a8a5..967ee82bcadba644aaee392744c00facf2019a9d 100644 (file)
@@ -31,7 +31,7 @@ CONFIG_MTDPARTS_DEFAULT="mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),1
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="am335x-evm"
-CONFIG_OF_LIST="am335x-evm am335x-bone am335x-boneblack am335x-evmsk am335x-bonegreen am335x-icev2"
+CONFIG_OF_LIST="am335x-evm am335x-bone am335x-boneblack am335x-evmsk am335x-bonegreen am335x-icev2 am335x-pocketbeagle"
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_SPL_ENV_IS_NOWHERE=y
 CONFIG_BOOTCOUNT_LIMIT=y
index 59ea252f5bceb24cc98cc3b2af4777494fcdebde..bcc5a0aa4aaa806e87f118cf920171432d264a98 100644 (file)
@@ -1,46 +1,74 @@
 CONFIG_ARM=y
-CONFIG_SPL_SYS_THUMB_BUILD=y
+CONFIG_SYS_THUMB_BUILD=y
 # CONFIG_SPL_USE_ARCH_MEMCPY is not set
 # CONFIG_SPL_USE_ARCH_MEMSET is not set
 CONFIG_ARCH_AT91=y
+CONFIG_SPL_LDSCRIPT="arch/$(ARCH)/cpu/u-boot-spl.lds"
 CONFIG_SYS_TEXT_BASE=0x21000000
 CONFIG_TARGET_TAURUS=y
 CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
-CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_SPL_SYS_MALLOC_F_LEN=0x1000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
+CONFIG_DEBUG_UART_BASE=0xfffff200
+CONFIG_DEBUG_UART_CLOCK=18432000
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
-CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9G20,MACH_TYPE=2068,BOARD_AXM"
+CONFIG_DEBUG_UART=y
+CONFIG_TPL_SYS_MALLOC_F_LEN=0x1000
+CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9G20,MACH_TYPE=2068"
 CONFIG_BOOTDELAY=3
-CONFIG_USE_BOOTARGS=y
-CONFIG_BOOTARGS="\0addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}::off\0addtest=setenv bootargs ${bootargs} loglevel=4 test\0baudrate=115200\0boot_file=setenv bootfile /${project_dir}/kernel/uImage\0boot_retries=0\0bootcmd=run flash_self\0bootdelay=3\0ethact=macb0\0flash_nfs=run nand_kernel;run nfsargs;run addip;upgrade_available;bootm ${kernel_ram};reset\0flash_self=run nand_kernel;run setbootargs;upgrade_available;bootm ${kernel_ram};reset\0flash_self_test=run nand_kernel;run setbootargs addtest; upgrade_available;bootm ${kernel_ram};reset\0hostname=systemone\0kernel_Off=0x00200000\0kernel_Off_fallback=0x03800000\0kernel_ram=0x21500000\0kernel_size=0x00400000\0kernel_size_fallback=0x00400000\0loads_echo=1\0nand_kernel=nand read.e ${kernel_ram} ${kernel_Off} ${kernel_size}\0net_nfs=run boot_file;tftp ${kernel_ram} ${bootfile};run nfsargs;run addip;upgrade_available;bootm ${kernel_ram};reset\0netdev=eth0\0nfsargs=run root_path;setenv bootargs ${bootargs} root=/dev/nfs rw nfsroot=${serverip}:${rootpath} at91sam9_wdt.wdt_timeout=16\0partitionset_active=A\0preboot=echo;echo Type 'run flash_self' to use kernel and root filesystem on memory;echo Type 'run flash_nfs' to use kernel from memory and root filesystem over NFS;echo Type 'run net_nfs' to get Kernel over TFTP and mount root filesystem over NFS;echo\0project_dir=systemone\0root_path=setenv rootpath /home/projects/${project_dir}/rootfs\0rootfs=/dev/mtdblock5\0rootfs_fallback=/dev/mtdblock7\0setbootargs=setenv bootargs ${bootargs} console=ttyMTD,mtdoops root=${rootfs} rootfstype=jffs2 panic=7 at91sam9_wdt.wdt_timeout=16\0stderr=serial\0stdin=serial\0stdout=serial\0upgrade_available=0\0"
+CONFIG_USE_BOOTCOMMAND=y
+CONFIG_BOOTCOMMAND="run flash_self"
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_BOARD_EARLY_INIT_F=y
+# CONFIG_SPL_LEGACY_IMAGE_SUPPORT is not set
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
+# CONFIG_TPL_BANNER_PRINT is not set
+CONFIG_SPL_CRC32_SUPPORT=y
 CONFIG_SPL_NAND_SUPPORT=y
-CONFIG_SPL_SPI_LOAD=y
 CONFIG_HUSH_PARSER=y
+CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
+# CONFIG_CMD_PINMUX is not set
 CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
+CONFIG_CMD_MTDPARTS=y
 CONFIG_OF_CONTROL=y
-CONFIG_OF_EMBED=y
+CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="at91sam9g20-taurus"
+CONFIG_SPL_OF_PLATDATA=y
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_SPL_DM=y
+CONFIG_BLK=y
+CONFIG_HAVE_BLOCK_DEVICE=y
+CONFIG_CLK=y
+CONFIG_CLK_AT91=y
 # CONFIG_MMC is not set
 CONFIG_NAND=y
 CONFIG_NAND_ATMEL=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91=y
+CONFIG_SPECIFY_CONSOLE_INDEX=y
+CONFIG_DEBUG_UART_ATMEL=y
+CONFIG_ATMEL_USART=y
+CONFIG_WDT=y
+CONFIG_WDT_AT91=y
 CONFIG_USE_TINY_PRINTF=y
+CONFIG_HEXDUMP=y
+# CONFIG_EFI_LOADER is not set
index 393046edc8bfa2ef772803fd82b76718c4ac39ea..f6a18748a936de68a0942d3208786a7d10cff066 100644 (file)
@@ -7,8 +7,11 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_ROCKCHIP_RK3036=y
 CONFIG_TARGET_KYLIN_RK3036=y
 CONFIG_SPL_SYS_MALLOC_F_LEN=0x0
-CONFIG_NR_DRAM_BANKS=1
+CONFIG_DEBUG_UART_BASE=0x20068000
+CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_SPL_STACK_R_ADDR=0x80000
+CONFIG_DEBUG_UART=y
+CONFIG_NR_DRAM_BANKS=1
 # CONFIG_ANDROID_BOOT_IMAGE is not set
 CONFIG_DEFAULT_FDT_FILE="rk3036-kylin.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
@@ -46,6 +49,7 @@ CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_PINCTRL=y
 CONFIG_DM_REGULATOR_FIXED=y
 # CONFIG_SPL_DM_SERIAL is not set
+CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_SYSRESET=y
 CONFIG_USB=y
 CONFIG_USB_DWC2=y
diff --git a/configs/orangepi-rk3399_defconfig b/configs/orangepi-rk3399_defconfig
new file mode 100644 (file)
index 0000000..cdccf22
--- /dev/null
@@ -0,0 +1,75 @@
+CONFIG_ARM=y
+CONFIG_ARCH_ROCKCHIP=y
+CONFIG_SYS_TEXT_BASE=0x00200000
+CONFIG_SPL_LIBCOMMON_SUPPORT=y
+CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_SYS_MALLOC_F_LEN=0x4000
+CONFIG_ROCKCHIP_RK3399=y
+CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x4000
+CONFIG_DEBUG_UART_BASE=0xFF1A0000
+CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_SPL_STACK_R_ADDR=0x80000
+CONFIG_DEBUG_UART=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_FIT=y
+CONFIG_SPL_LOAD_FIT=y
+CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-rockchip/make_fit_atf.py"
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-orangepi.dtb"
+# CONFIG_DISPLAY_CPUINFO is not set
+CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_SPL_STACK_R=y
+CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x4000
+CONFIG_SPL_ATF=y
+CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y
+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_SPL_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="rk3399-orangepi"
+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_REGMAP=y
+CONFIG_SPL_REGMAP=y
+CONFIG_SYSCON=y
+CONFIG_SPL_SYSCON=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_ROCKCHIP_GPIO=y
+CONFIG_SYS_I2C_ROCKCHIP=y
+CONFIG_MMC_DW=y
+CONFIG_MMC_DW_ROCKCHIP=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_ROCKCHIP=y
+CONFIG_DM_ETH=y
+CONFIG_ETH_DESIGNWARE=y
+CONFIG_GMAC_ROCKCHIP=y
+CONFIG_PINCTRL=y
+CONFIG_SPL_PINCTRL=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_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_HOST_ETHER=y
+CONFIG_USB_ETHER_ASIX=y
+CONFIG_USB_ETHER_ASIX88179=y
+CONFIG_USB_ETHER_MCS7830=y
+CONFIG_USB_ETHER_RTL8152=y
+CONFIG_USB_ETHER_SMSC95XX=y
+CONFIG_USE_TINY_PRINTF=y
+CONFIG_ERRNO_STR=y
index f9f98c9590528ab46d3fcf4360fd2ea760393ff7..964464ac0fe0f35e0d5c4793a84f8c4945067ca6 100644 (file)
@@ -69,6 +69,7 @@ CONFIG_MMC_SDHCI_SDMA=y
 CONFIG_MMC_SDHCI_ROCKCHIP=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=20000000
+CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_PHY_MICREL=y
 CONFIG_PHY_MICREL_KSZ90X1=y
index 0da77d8c94aaab3952f9e2bf7a48122d522590b0..02a89592d747bb5d31ca6eb24c6e2dbb96288cd5 100644 (file)
@@ -1,36 +1,48 @@
 CONFIG_ARM=y
-CONFIG_SPL_SYS_THUMB_BUILD=y
+CONFIG_SYS_THUMB_BUILD=y
 # CONFIG_SPL_USE_ARCH_MEMCPY is not set
 # CONFIG_SPL_USE_ARCH_MEMSET is not set
 CONFIG_ARCH_AT91=y
 CONFIG_SPL_LDSCRIPT="arch/$(ARCH)/cpu/u-boot-spl.lds"
 CONFIG_SYS_TEXT_BASE=0x21000000
 CONFIG_TARGET_TAURUS=y
+CONFIG_BOARD_TAURUS=y
 CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
-CONFIG_SYS_MALLOC_F_LEN=0x1000
-CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_SPL_SYS_MALLOC_F_LEN=0x1000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
+CONFIG_DEBUG_UART_BASE=0xfffff200
+CONFIG_DEBUG_UART_CLOCK=18432000
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
-CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9G20,MACH_TYPE=2067,BOARD_TAURUS"
+CONFIG_DEBUG_UART=y
+CONFIG_TPL_SYS_MALLOC_F_LEN=0x1000
+CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9G20,MACH_TYPE=2067"
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 earlyprintk mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,256k(env),256k(env_redundant),256k(spare),512k(dtb),6M(kernel)ro,-(rootfs) root=/dev/mtdblock7 rw rootfstype=jffs2"
+CONFIG_USE_BOOTCOMMAND=y
+CONFIG_BOOTCOMMAND="nand read 0x22000000 0x200000 0x300000; bootm"
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_BOARD_EARLY_INIT_F=y
+# CONFIG_SPL_LEGACY_IMAGE_SUPPORT is not set
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
+# CONFIG_TPL_BANNER_PRINT is not set
+CONFIG_SPL_CRC32_SUPPORT=y
 CONFIG_SPL_NAND_SUPPORT=y
-CONFIG_SPL_SPI_LOAD=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot> "
+CONFIG_SYS_XTRACE="n"
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
+# CONFIG_CMD_PINMUX is not set
 CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
@@ -41,19 +53,30 @@ CONFIG_CMD_PING=y
 CONFIG_CMD_MTDPARTS=y
 # CONFIG_DOS_PARTITION is not set
 CONFIG_OF_CONTROL=y
-CONFIG_OF_EMBED=y
+CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="at91sam9g20-taurus"
+CONFIG_SPL_OF_PLATDATA=y
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_SPL_DM=y
+CONFIG_BLK=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
 CONFIG_DFU_NAND=y
 # CONFIG_MMC is not set
 CONFIG_NAND=y
 CONFIG_NAND_ATMEL=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91=y
+CONFIG_SPECIFY_CONSOLE_INDEX=y
+CONFIG_DEBUG_UART_ATMEL=y
+CONFIG_ATMEL_USART=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+# CONFIG_SPL_DM_USB is not set
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Siemens AG"
@@ -63,3 +86,5 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_WDT=y
 CONFIG_WDT_AT91=y
 CONFIG_USE_TINY_PRINTF=y
+CONFIG_HEXDUMP=y
+# CONFIG_EFI_LOADER is not set
index 239455b8161edbbefdeb211d9ff63a17a38453a1..c0fa753339c80216e45fd8f9d3e33093db0cb19c 100644 (file)
@@ -209,6 +209,8 @@ int get_disk_guid(struct blk_desc * dev_desc, char *guid)
        guid_bin = gpt_head->disk_guid.b;
        uuid_bin_to_str(guid_bin, guid, UUID_STR_FORMAT_GUID);
 
+       /* Remember to free pte */
+       free(gpt_pte);
        return 0;
 }
 
@@ -696,6 +698,10 @@ int gpt_verify_headers(struct blk_desc *dev_desc, gpt_header *gpt_head,
                       __func__);
                return -1;
        }
+
+       /* Free pte before allocating again */
+       free(*gpt_pte);
+
        if (is_gpt_valid(dev_desc, (dev_desc->lba - 1),
                         gpt_head, gpt_pte) != 1) {
                printf("%s: *** ERROR: Invalid Backup GPT ***\n",
index aa7c85011a377fe1e71690561d6ea28f88988a36..6522c24eea1668a4d4fa143ec4b53ca75041272d 100644 (file)
 Summary
 =======
 
-This README is about U-Boot support for TI's ARM 926EJS based family of SoCs.
-These SOCs are used for cameras, video security and surveillance, DVR's, etc.
-DaVinci SOC's comprise of DM644x, DM646x, DM35x and DM36x series of SOC's
-Additionally there are some SOCs meant for the audio market which though have
-an OMAP part number are very similar to the DaVinci series of SOC's
-Additionally, some family members contain a TI DSP and/or graphics
-co processors along with a host of other peripherals.
+Note: this document used to be about the entire family of DaVinci SOCs but the
+support for the DM* family and DA830 has since been dropped.
 
-Currently the following boards are supported:
-
-* TI DaVinci DM644x EVM
-
-* TI DaVinci DM646x EVM
-
-* TI DaVinci DM355 EVM
-
-* TI DaVinci DM365 EVM
+This README is about U-Boot support for TI's DA850 SoC. This SOC has an OMAP
+part number but is very similar to the DaVinci series.
 
-* TI DA830 EVM
+Currently the following boards are supported:
 
 * TI DA850 EVM
 
-* DM355 based Leopard board
-
-* DM644x based schmoogie board
-
-* DM644x based sffsdr board
+* TI OMAP-L138 LCDK
 
-* DM644x based sonata board
+* Lego EV3
 
 Build
 =====
 
-* TI DaVinci DM644x EVM:
-
-make davinci_dvevm_config
-make
-
-* TI DaVinci DM646x EVM:
-
-make davinci_dm6467evm_config
-make
-
-* TI DaVinci DM355 EVM:
-
-make davinci_dm355evm_config
-make
-
-* TI DaVinci DM365 EVM:
-
-make davinci_dm365evm_config
-make
-
-* TI DA830 EVM:
-
-make da830evm_config
-make
-
 * TI DA850 EVM:
 
 make da850evm_config
 make
 
-* DM355 based Leopard board:
-
-make davinci_dm355leopard_config
-make
-
-* DM644x based schmoogie board:
+* TI OMAP-L138 LCDK
 
-make davinci_schmoogie_config
+make omapl138_lcdk_defconfig
 make
 
-* DM644x based sffsdr board:
+* Lego EV3
 
-make davinci_sffsdr_config
-make
-
-* DM644x based sonata board:
-
-make davinci_sonata_config
+make legoev3_defconfig
 make
 
 Bootloaders
 ===============
 
-The DaVinci SOC's use 2 bootloaders. The low level initialization
-is done by a UBL(user boot loader). The UBL is written to a NAND/NOR/SPI flash
-by a programmer. During initial bootup, the ROM Bootloader reads the UBL
-from a storage device and loads it into the IRAM. The UBL then loads the U-Boot
-into the RAM.
-The programmers and UBL are always released as part of any standard TI
-software release associated with an SOC.
-
-Alternative boot method (DA850 EVM only):
-For the DA850 EVM an SPL (secondary program loader, see doc/README.SPL)
-is provided to load U-Boot directly from SPI flash. In this case, the
-SPL does the low level initialization that is otherwise done by the SPL.
-To build U-Boot with this SPL, do
-make da850evm_config
-make u-boot.ais
-and program the resulting u-boot.ais file to the SPI flash of the DA850 EVM.
+For DA850 an SPL (secondary program loader, see doc/README.SPL) is provided
+to load U-Boot directly from SPI flash. The SPL takes care of the low level
+initialization.
+
+The SPL is built as u-boot.ais for all DA850 defconfigs. The resulting
+image file can be programmed to the SPI flash of the DA850 EVM/LCDK.
 
 Environment Variables
 =====================
@@ -121,34 +60,14 @@ is used to obtain this information.
 Links
 =====
 
-1) TI DaVinci DM355 EVM:
-http://focus.ti.com/docs/prod/folders/print/tms320dm355.html
-http://www.spectrumdigital.com/product_info.php?cPath=103&products_id=203&osCsid=c499af6087317f11b3da19b4e8f1af32
-
-2) TI DaVinci DM365 EVM:
-http://focus.ti.com/docs/prod/folders/print/tms320dm365.html?247SEM=
-http://support.spectrumdigital.com/boards/evmdm365/revc/
-
-3) DaVinci DM355 based leopard board
-http://designsomething.org/leopardboard/default.aspx
-http://www.spectrumdigital.com/product_info.php?cPath=103&products_id=192&osCsid=67c20335668ffc57cb35727106eb24b1
-
-4) TI DaVinci DM6467 EVM:
-http://focus.ti.com/docs/prod/folders/print/tms320dm6467.html
-http://support.spectrumdigital.com/boards/evmdm6467/revf/
-
-5) TI DaVinci DM6446 EVM:
-http://focus.ti.com/docs/prod/folders/print/tms320dm6446.html
-http://www.spectrumdigital.com/product_info.php?cPath=103&products_id=222
-
-6) TI DA830 EVM
-http://focus.ti.com/apps/docs/gencontent.tsp?appId=1&contentId=52385
-http://www.spectrumdigital.com/product_info.php?cPath=37&products_id=214
-
-7) TI DA850 EVM
+1) TI DA850 EVM
 http://focus.ti.com/docs/prod/folders/print/omap-l138.html
 http://www.logicpd.com/products/development-kits/zoom-omap-l138-evm-development-kit
 
+2) TI OMAP-L138 LCDK
+http://focus.ti.com/docs/prod/folders/print/omap-l138.html
+http://www.ti.com/tool/TMDXLCDK138
+
 Davinci special defines
 =======================
 
index 13137017fe4f1d15e94bf8a347dfa3fc8b39e336..a63b76befc5c8601748cae2b8e857a4bc81f8d5b 100644 (file)
@@ -22,10 +22,12 @@ alias bmeng          Bin Meng <bmeng.cn@gmail.com>
 alias danielschwierzeck Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
 alias dinh           Dinh Nguyen <dinguyen@kernel.org>
 alias hs             Heiko Schocher <hs@denx.de>
+alias freenix        Peng Fan <peng.fan@nxp.com>
 alias iwamatsu       Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
 alias jaehoon        Jaehoon Chung <jh80.chung@samsung.com>
 alias jagan          Jagan Teki <jagan@amarulasolutions.com>
 alias jhersh         Joe Hershberger <joe.hershberger@ni.com>
+alias kevery         Kever Yang <kever.yang@rock-chips.com>
 alias lukma          Lukasz Majewski <lukma@denx.de>
 alias macpaul        Macpaul Lin <macpaul@andestech.com>
 alias marex          Marek Vasut <marex@denx.de>
@@ -70,7 +72,7 @@ alias tegra2         tegra
 alias ti             uboot, trini
 alias uniphier       uboot, masahiro
 alias zynq           uboot, monstr
-alias rockchip       uboot, sjg, Kever Yang <kever.yang@rock-chips.com>, ptomsich
+alias rockchip       uboot, sjg, kevery, ptomsich
 
 alias m68k           uboot, alisonwang, angelo_ts
 alias coldfire       m68k
@@ -110,7 +112,7 @@ alias kerneldoc      uboot, marex
 alias fdt            uboot, sjg
 alias i2c            uboot, hs
 alias kconfig        uboot, masahiro
-alias mmc            uboot, jaehoon
+alias mmc            uboot, freenix
 alias nand           uboot
 alias net            uboot, jhersh
 alias phy            uboot, jhersh
index 9c4e8901e8098977704276b3d6609f81ed3b6b4f..9bf9cedaf8cded8b5aaa08adf6d96dac773be83e 100644 (file)
@@ -9,9 +9,9 @@
 #include <errno.h>
 #include <syscon.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3036.h>
-#include <asm/arch/hardware.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk3036.h>
+#include <asm/arch-rockchip/hardware.h>
 #include <dm/lists.h>
 #include <dt-bindings/clock/rk3036-cru.h>
 #include <linux/log2.h>
index 7da785abc670ca3dd4755c930814d5580e0a0d80..efda8c830b07fc8c754224ba85948e9ae8646157 100644 (file)
@@ -9,9 +9,9 @@
 #include <errno.h>
 #include <syscon.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3128.h>
-#include <asm/arch/hardware.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk3128.h>
+#include <asm/arch-rockchip/hardware.h>
 #include <bitfield.h>
 #include <dm/lists.h>
 #include <dt-bindings/clock/rk3128-cru.h>
index db7479a237587c9f1dabb5f49664ca44cb23fd3d..9bb9959c9d3ac0512be40a741fa15b47c70d19c4 100644 (file)
 #include <mapmem.h>
 #include <syscon.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3188.h>
-#include <asm/arch/grf_rk3188.h>
-#include <asm/arch/hardware.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk3188.h>
+#include <asm/arch-rockchip/grf_rk3188.h>
+#include <asm/arch-rockchip/hardware.h>
 #include <dt-bindings/clock/rk3188-cru.h>
 #include <dm/device-internal.h>
 #include <dm/lists.h>
index 46a569c9ecdaa739b1aa8d440ea801a361567890..48ed14b2aff85342e0d1a1ba0a7f24e52fd0156e 100644 (file)
@@ -9,9 +9,9 @@
 #include <errno.h>
 #include <syscon.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk322x.h>
-#include <asm/arch/hardware.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk322x.h>
+#include <asm/arch-rockchip/hardware.h>
 #include <dm/lists.h>
 #include <dt-bindings/clock/rk3228-cru.h>
 #include <linux/log2.h>
index 930c99f4d9f1e57d6bfcb3a7b42bbee5ebadaf7d..375d7f8acbbb306e87aa963fa8e3a893c4e30bff 100644 (file)
 #include <mapmem.h>
 #include <syscon.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3288.h>
-#include <asm/arch/grf_rk3288.h>
-#include <asm/arch/hardware.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk3288.h>
+#include <asm/arch-rockchip/grf_rk3288.h>
+#include <asm/arch-rockchip/hardware.h>
 #include <dt-bindings/clock/rk3288-cru.h>
 #include <dm/device-internal.h>
 #include <dm/lists.h>
index 106621fe7cfce53e5297e9b0c82a1e008778d24e..a89e2ecc4ad6651cc73764448eb261d2a2d6a5e6 100644 (file)
@@ -9,10 +9,10 @@
 #include <dm.h>
 #include <errno.h>
 #include <syscon.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3328.h>
-#include <asm/arch/hardware.h>
-#include <asm/arch/grf_rk3328.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk3328.h>
+#include <asm/arch-rockchip/hardware.h>
+#include <asm/arch-rockchip/grf_rk3328.h>
 #include <asm/io.h>
 #include <dm/lists.h>
 #include <dt-bindings/clock/rk3328-cru.h>
index 9492cc2a36ef8d4bd388d548f5c2b8c72f2d6371..89cbae59c5e0ca1eb58fc4c0a9394354e9176bcf 100644 (file)
@@ -13,9 +13,9 @@
 #include <mapmem.h>
 #include <syscon.h>
 #include <bitfield.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3368.h>
-#include <asm/arch/hardware.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk3368.h>
+#include <asm/arch-rockchip/hardware.h>
 #include <asm/io.h>
 #include <dm/lists.h>
 #include <dt-bindings/clock/rk3368-cru.h>
index cab2bd994331dfa1f0afc053d08c97a2b4dc9a21..93a652e5ff4d0c9fe48425c4290dc6ffcfb01370 100644 (file)
@@ -13,9 +13,9 @@
 #include <syscon.h>
 #include <bitfield.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3399.h>
-#include <asm/arch/hardware.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk3399.h>
+#include <asm/arch-rockchip/hardware.h>
 #include <dm/lists.h>
 #include <dt-bindings/clock/rk3399-cru.h>
 
index 914e2f4b214d9f32fe24099a4d2c9c29fa437dbb..3ebb007fab36a31d1e3ba3f011ba76ebe6935e06 100644 (file)
@@ -11,9 +11,9 @@
 #include <errno.h>
 #include <syscon.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rv1108.h>
-#include <asm/arch/hardware.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rv1108.h>
+#include <asm/arch-rockchip/hardware.h>
 #include <dm/lists.h>
 #include <dt-bindings/clock/rv1108-cru.h>
 
index f78a01aa8f8cd8eec884808601357338205d8c52..a5fc7809bc41919c8cf964b907abbebbdb0cb8ca 100644 (file)
@@ -575,14 +575,6 @@ static int udma_get_tchan(struct udma_chan *uc)
 
        pr_debug("chan%d: got tchan%d\n", uc->id, uc->tchan->id);
 
-       if (udma_is_chan_running(uc)) {
-               dev_warn(ud->dev, "chan%d: tchan%d is running!\n", uc->id,
-                        uc->tchan->id);
-               udma_stop(uc);
-               if (udma_is_chan_running(uc))
-                       dev_err(ud->dev, "chan%d: won't stop!\n", uc->id);
-       }
-
        return 0;
 }
 
@@ -602,14 +594,6 @@ static int udma_get_rchan(struct udma_chan *uc)
 
        pr_debug("chan%d: got rchan%d\n", uc->id, uc->rchan->id);
 
-       if (udma_is_chan_running(uc)) {
-               dev_warn(ud->dev, "chan%d: rchan%d is running!\n", uc->id,
-                        uc->rchan->id);
-               udma_stop(uc);
-               if (udma_is_chan_running(uc))
-                       dev_err(ud->dev, "chan%d: won't stop!\n", uc->id);
-       }
-
        return 0;
 }
 
@@ -652,14 +636,6 @@ static int udma_get_chan_pair(struct udma_chan *uc)
 
        pr_debug("chan%d: got t/rchan%d pair\n", uc->id, chan_id);
 
-       if (udma_is_chan_running(uc)) {
-               dev_warn(ud->dev, "chan%d: t/rchan%d pair is running!\n",
-                        uc->id, chan_id);
-               udma_stop(uc);
-               if (udma_is_chan_running(uc))
-                       dev_err(ud->dev, "chan%d: won't stop!\n", uc->id);
-       }
-
        return 0;
 }
 
@@ -1071,6 +1047,15 @@ static int udma_alloc_chan_resources(struct udma_chan *uc)
                }
        }
 
+       if (udma_is_chan_running(uc)) {
+               dev_warn(ud->dev, "chan%d: is running!\n", uc->id);
+               udma_stop(uc);
+               if (udma_is_chan_running(uc)) {
+                       dev_err(ud->dev, "chan%d: won't stop!\n", uc->id);
+                       goto err_free_res;
+               }
+       }
+
        /* PSI-L pairing */
        ret = udma_navss_psil_pair(ud, uc->src_thread, uc->dst_thread);
        if (ret) {
@@ -1492,7 +1477,7 @@ static int udma_send(struct dma *dma, void *src, size_t len, void *metadata)
        u32 tc_ring_id;
        int ret;
 
-       if (!metadata)
+       if (metadata)
                packet_data = *((struct ti_udma_drv_packet_data *)metadata);
 
        if (dma->id >= (ud->rchan_cnt + ud->tchan_cnt)) {
index 1196ce07123d7189c78c189df86602509fa5f2a1..303aa6a631147168b260428bceba294c1417c160 100644 (file)
@@ -158,7 +158,7 @@ static inline int ti_sci_get_response(struct ti_sci_info *info,
        int ret;
 
        /* Receive the response */
-       ret = mbox_recv(chan, msg, info->desc->max_rx_timeout_ms);
+       ret = mbox_recv(chan, msg, info->desc->max_rx_timeout_ms * 1000);
        if (ret) {
                dev_err(info->dev, "%s: Message receive failed. ret = %d\n",
                        __func__, ret);
@@ -257,7 +257,8 @@ static int ti_sci_cmd_get_revision(struct ti_sci_handle *handle)
 
        info = handle_to_ti_sci_info(handle);
 
-       xfer = ti_sci_setup_one_xfer(info, TI_SCI_MSG_VERSION, 0x0,
+       xfer = ti_sci_setup_one_xfer(info, TI_SCI_MSG_VERSION,
+                                    TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
                                     (u32 *)&hdr, sizeof(struct ti_sci_msg_hdr),
                                     sizeof(*rev_info));
        if (IS_ERR(xfer)) {
@@ -499,8 +500,8 @@ static int ti_sci_get_device_state(const struct ti_sci_handle *handle,
 
        info = handle_to_ti_sci_info(handle);
 
-       /* Response is expected, so need of any flags */
-       xfer = ti_sci_setup_one_xfer(info, TI_SCI_MSG_GET_DEVICE_STATE, 0,
+       xfer = ti_sci_setup_one_xfer(info, TI_SCI_MSG_GET_DEVICE_STATE,
+                                    TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
@@ -2574,8 +2575,8 @@ static int ti_sci_cmd_change_fwl_owner(const struct ti_sci_handle *handle,
 
        info = handle_to_ti_sci_info(handle);
 
-       xfer = ti_sci_setup_one_xfer(info, TISCI_MSG_FWL_GET,
-                                    TISCI_MSG_FWL_CHANGE_OWNER,
+       xfer = ti_sci_setup_one_xfer(info, TISCI_MSG_FWL_CHANGE_OWNER,
+                                    TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
index 21df227717617cdbca1d26ddce869574b84d981d..3d96678a45a71a0ada12767aeba690ff33fa29fe 100644 (file)
@@ -12,7 +12,8 @@
 #include <linux/errno.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/gpio.h>
 #include <dm/pinctrl.h>
 #include <dt-bindings/clock/rk3288-cru.h>
 
index f9a5796b96b7bb19bac93daad5019ae602166bd1..cdd94bb05a9009c07e278667f086163e97597516 100644 (file)
@@ -12,9 +12,9 @@
 #include <errno.h>
 #include <i2c.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/i2c.h>
-#include <asm/arch/periph.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/i2c.h>
+#include <asm/arch-rockchip/periph.h>
 #include <dm/pinctrl.h>
 #include <linux/sizes.h>
 
index bf2d83a52c5c69428b86f8388dc9228f868525d5..b2a1201631a5cb2bfd9c7ee5ee73b265c3738bb1 100644 (file)
@@ -13,8 +13,8 @@
 #include <pwrseq.h>
 #include <syscon.h>
 #include <asm/gpio.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/periph.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/periph.h>
 #include <linux/err.h>
 
 struct rockchip_mmc_plat {
index c01ae758c76dbeb884c155d752671033ea79207a..26a612117506bf4059654cb48648bd290badab67 100644 (file)
 #include <phy.h>
 #include <syscon.h>
 #include <asm/io.h>
-#include <asm/arch/periph.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/hardware.h>
-#include <asm/arch/grf_rk322x.h>
-#include <asm/arch/grf_rk3288.h>
-#include <asm/arch/grf_rk3328.h>
-#include <asm/arch/grf_rk3368.h>
-#include <asm/arch/grf_rk3399.h>
-#include <asm/arch/grf_rv1108.h>
+#include <asm/arch-rockchip/periph.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/hardware.h>
+#include <asm/arch-rockchip/grf_rk322x.h>
+#include <asm/arch-rockchip/grf_rk3288.h>
+#include <asm/arch-rockchip/grf_rk3328.h>
+#include <asm/arch-rockchip/grf_rk3368.h>
+#include <asm/arch-rockchip/grf_rk3399.h>
+#include <asm/arch-rockchip/grf_rv1108.h>
 #include <dm/pinctrl.h>
 #include <dt-bindings/clock/rk3288-cru.h>
 #include "designware.h"
index 0e6c559d5efb21ed66325338ca86aadda70daed3..f01bc77a5761275013fef13e6d3e5476dc93aded 100644 (file)
@@ -116,6 +116,9 @@ static int pinconfig_post_bind(struct udevice *dev)
        ofnode node;
        int ret;
 
+       if (!dev_of_valid(dev))
+               return 0;
+
        dev_for_each_subnode(node, dev) {
                if (pre_reloc_only &&
                    !ofnode_pre_reloc(node))
index 9994cbafbffd8614ba4d45d6df7a72cb246167b9..88db294cf14911fcd6703068c5a4eb38036767cc 100644 (file)
@@ -12,7 +12,7 @@
 #include <regmap.h>
 #include <syscon.h>
 #include <asm/io.h>
-#include <asm/arch/pwm.h>
+#include <asm/arch-rockchip/pwm.h>
 #include <power/regulator.h>
 
 struct rk_pwm_priv {
index 8d1b9faacc01c39677317a30d5faf2de783921a1..92f584fadcb299d00853c8321380ff4e8dfdece3 100644 (file)
 #include <regmap.h>
 #include <syscon.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3368.h>
-#include <asm/arch/grf_rk3368.h>
-#include <asm/arch/ddr_rk3368.h>
-#include <asm/arch/sdram.h>
-#include <asm/arch/sdram_common.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk3368.h>
+#include <asm/arch-rockchip/grf_rk3368.h>
+#include <asm/arch-rockchip/ddr_rk3368.h>
+#include <asm/arch-rockchip/sdram.h>
+#include <asm/arch-rockchip/sdram_common.h>
 
 struct dram_info {
        struct ram_info info;
index df7b9887033b3836c365d6c55e938a3fbb3fc021..bfabc22a7d897e1cab9bf9930ee59a8eb0817e36 100644 (file)
@@ -7,9 +7,9 @@
 #include <dm.h>
 #include <ram.h>
 #include <syscon.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/grf_rk3128.h>
-#include <asm/arch/sdram_common.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/grf_rk3128.h>
+#include <asm/arch-rockchip/sdram_common.h>
 
 struct dram_info {
        struct ram_info info;
index fdd500aa472558913806f4cd4b70c384e29c9208..00e52ec949e721f63ef580d5b658740dc2f310fa 100644 (file)
 #include <regmap.h>
 #include <syscon.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3188.h>
-#include <asm/arch/ddr_rk3188.h>
-#include <asm/arch/grf_rk3188.h>
-#include <asm/arch/pmu_rk3188.h>
-#include <asm/arch/sdram.h>
-#include <asm/arch/sdram_common.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk3188.h>
+#include <asm/arch-rockchip/ddr_rk3188.h>
+#include <asm/arch-rockchip/grf_rk3188.h>
+#include <asm/arch-rockchip/pmu_rk3188.h>
+#include <asm/arch-rockchip/sdram.h>
+#include <asm/arch-rockchip/sdram_common.h>
 #include <linux/err.h>
 
 struct chan_info {
index 53835a9cd086249be920f367bb8d24e798fe6659..c596523d4ff03bc54ec8c59c4cfb5964128f6652 100644 (file)
 #include <regmap.h>
 #include <syscon.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk322x.h>
-#include <asm/arch/grf_rk322x.h>
-#include <asm/arch/hardware.h>
-#include <asm/arch/sdram_rk322x.h>
-#include <asm/arch/timer.h>
-#include <asm/arch/uart.h>
-#include <asm/arch/sdram_common.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk322x.h>
+#include <asm/arch-rockchip/grf_rk322x.h>
+#include <asm/arch-rockchip/hardware.h>
+#include <asm/arch-rockchip/sdram_rk322x.h>
+#include <asm/arch-rockchip/timer.h>
+#include <asm/arch-rockchip/uart.h>
+#include <asm/arch-rockchip/sdram_common.h>
 #include <asm/types.h>
 #include <linux/err.h>
 
index d1e52d84e7af156ffbae343f125bf55d896ce0d5..6bb025a851aa5418588e7dce8bc53311edd40565 100644 (file)
 #include <regmap.h>
 #include <syscon.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3288.h>
-#include <asm/arch/ddr_rk3288.h>
-#include <asm/arch/grf_rk3288.h>
-#include <asm/arch/pmu_rk3288.h>
-#include <asm/arch/sdram.h>
-#include <asm/arch/sdram_common.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk3288.h>
+#include <asm/arch-rockchip/ddr_rk3288.h>
+#include <asm/arch-rockchip/grf_rk3288.h>
+#include <asm/arch-rockchip/pmu_rk3288.h>
+#include <asm/arch-rockchip/sdram.h>
+#include <asm/arch-rockchip/sdram_common.h>
 #include <linux/err.h>
 #include <power/regulator.h>
 #include <power/rk8xx_pmic.h>
index e8b234d86651c881698ca86b1c8181e6ce4a0915..f4e0b1844703cbc88bad53bc9c9cd273cc0cfff1 100644 (file)
@@ -7,9 +7,9 @@
 #include <dm.h>
 #include <ram.h>
 #include <syscon.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/grf_rk3328.h>
-#include <asm/arch/sdram_common.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/grf_rk3328.h>
+#include <asm/arch-rockchip/sdram_common.h>
 
 struct dram_info {
        struct ram_info info;
index 94dd01156a7749a423d2d6d16adcc38c0be0bd5a..05ec5fc28d7f4b9301511e32d64b5731d0c3dea2 100644 (file)
 #include <regmap.h>
 #include <syscon.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/sdram_common.h>
-#include <asm/arch/sdram_rk3399.h>
-#include <asm/arch/cru_rk3399.h>
-#include <asm/arch/grf_rk3399.h>
-#include <asm/arch/hardware.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/sdram_common.h>
+#include <asm/arch-rockchip/sdram_rk3399.h>
+#include <asm/arch-rockchip/cru_rk3399.h>
+#include <asm/arch-rockchip/grf_rk3399.h>
+#include <asm/arch-rockchip/hardware.h>
 #include <linux/err.h>
 #include <time.h>
 
index af0713404959e28a78fdba76ab52c2f6210b5e5b..3871fc00d0743e33eab7533bae2807c2f5b2ef95 100644 (file)
@@ -7,7 +7,7 @@
 #include <dm.h>
 #include <reset-uclass.h>
 #include <linux/io.h>
-#include <asm/arch/hardware.h>
+#include <asm/arch-rockchip/hardware.h>
 #include <dm/lists.h>
 /*
  * Each reg has 16 bits reset signal for devices
index 35fefd74c696348577df53b3064a3196017dd7ce..b1718f72d1ba53316b0aae2bde3f4c5d150987aa 100644 (file)
@@ -9,7 +9,7 @@
 #include <dt-structs.h>
 #include <ns16550.h>
 #include <serial.h>
-#include <asm/arch/clock.h>
+#include <asm/arch-rockchip/clock.h>
 
 #if defined(CONFIG_ROCKCHIP_RK3188)
 struct rockchip_uart_platdata {
index e7fb9fb1646970dcbf196a5525a6ffc5a429c49d..a092dbc4458c62f2a98e7537490b485f497341f0 100644 (file)
@@ -13,7 +13,7 @@
 #include <i2s.h>
 #include <misc.h>
 #include <sound.h>
-#include <asm/arch/periph.h>
+#include <asm/arch-rockchip/periph.h>
 #include <dm/pinctrl.h>
 
 static int rockchip_sound_setup(struct udevice *dev)
index 14437c0a9afe65808786fea09109f97dbef94680..a68553b75bf1d58226cc3669d1553d15a83402ae 100644 (file)
@@ -2,6 +2,8 @@
 /*
  * spi driver for rockchip
  *
+ * (C) 2019 Theobroma Systems Design und Consulting GmbH
+ *
  * (C) Copyright 2015 Google, Inc
  *
  * (C) Copyright 2008-2013 Rockchip Electronics
 #include <spi.h>
 #include <linux/errno.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/periph.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/periph.h>
 #include <dm/pinctrl.h>
 #include "rk_spi.h"
 
 /* Change to 1 to output registers at the start of each transaction */
 #define DEBUG_RK_SPI   0
 
+struct rockchip_spi_params {
+       /* RXFIFO overruns and TXFIFO underruns stop the master clock */
+       bool master_manages_fifo;
+};
+
 struct rockchip_spi_platdata {
 #if CONFIG_IS_ENABLED(OF_PLATDATA)
        struct dtd_rockchip_rk3288_spi of_plat;
@@ -40,11 +47,8 @@ struct rockchip_spi_priv {
        unsigned int max_freq;
        unsigned int mode;
        ulong last_transaction_us;      /* Time of last transaction end */
-       u8 bits_per_word;               /* max 16 bits per word */
-       u8 n_bytes;
        unsigned int speed_hz;
        unsigned int last_speed_hz;
-       unsigned int tmode;
        uint input_rate;
 };
 
@@ -130,8 +134,13 @@ static void spi_cs_activate(struct udevice *dev, uint cs)
        if (plat->deactivate_delay_us && priv->last_transaction_us) {
                ulong delay_us;         /* The delay completed so far */
                delay_us = timer_get_us() - priv->last_transaction_us;
-               if (delay_us < plat->deactivate_delay_us)
-                       udelay(plat->deactivate_delay_us - delay_us);
+               if (delay_us < plat->deactivate_delay_us) {
+                       ulong additional_delay_us =
+                               plat->deactivate_delay_us - delay_us;
+                       debug("%s: delaying by %ld us\n",
+                             __func__, additional_delay_us);
+                       udelay(additional_delay_us);
+               }
        }
 
        debug("activate cs%u\n", cs);
@@ -263,8 +272,6 @@ static int rockchip_spi_probe(struct udevice *bus)
        }
        priv->input_rate = ret;
        debug("%s: rate = %u\n", __func__, priv->input_rate);
-       priv->bits_per_word = 8;
-       priv->tmode = TMOD_TR; /* Tx & Rx */
 
        return 0;
 }
@@ -274,28 +281,10 @@ static int rockchip_spi_claim_bus(struct udevice *dev)
        struct udevice *bus = dev->parent;
        struct rockchip_spi_priv *priv = dev_get_priv(bus);
        struct rockchip_spi *regs = priv->regs;
-       u8 spi_dfs, spi_tf;
        uint ctrlr0;
 
        /* Disable the SPI hardware */
-       rkspi_enable_chip(regs, 0);
-
-       switch (priv->bits_per_word) {
-       case 8:
-               priv->n_bytes = 1;
-               spi_dfs = DFS_8BIT;
-               spi_tf = HALF_WORD_OFF;
-               break;
-       case 16:
-               priv->n_bytes = 2;
-               spi_dfs = DFS_16BIT;
-               spi_tf = HALF_WORD_ON;
-               break;
-       default:
-               debug("%s: unsupported bits: %dbits\n", __func__,
-                     priv->bits_per_word);
-               return -EPROTONOSUPPORT;
-       }
+       rkspi_enable_chip(regs, false);
 
        if (priv->speed_hz != priv->last_speed_hz)
                rkspi_set_clk(priv, priv->speed_hz);
@@ -304,7 +293,7 @@ static int rockchip_spi_claim_bus(struct udevice *dev)
        ctrlr0 = OMOD_MASTER << OMOD_SHIFT;
 
        /* Data Frame Size */
-       ctrlr0 |= spi_dfs << DFS_SHIFT;
+       ctrlr0 |= DFS_8BIT << DFS_SHIFT;
 
        /* set SPI mode 0..3 */
        if (priv->mode & SPI_CPOL)
@@ -325,7 +314,7 @@ static int rockchip_spi_claim_bus(struct udevice *dev)
        ctrlr0 |= FBM_MSB << FBM_SHIFT;
 
        /* Byte and Halfword Transform */
-       ctrlr0 |= spi_tf << HALF_WORD_TX_SHIFT;
+       ctrlr0 |= HALF_WORD_OFF << HALF_WORD_TX_SHIFT;
 
        /* Rxd Sample Delay */
        ctrlr0 |= 0 << RXDSD_SHIFT;
@@ -334,7 +323,7 @@ static int rockchip_spi_claim_bus(struct udevice *dev)
        ctrlr0 |= FRF_SPI << FRF_SHIFT;
 
        /* Tx and Rx mode */
-       ctrlr0 |= (priv->tmode & TMOD_MASK) << TMOD_SHIFT;
+       ctrlr0 |= TMOD_TR << TMOD_SHIFT;
 
        writel(ctrlr0, &regs->ctrlr0);
 
@@ -351,6 +340,83 @@ static int rockchip_spi_release_bus(struct udevice *dev)
        return 0;
 }
 
+static inline int rockchip_spi_16bit_reader(struct udevice *dev,
+                                           u8 **din, int *len)
+{
+       struct udevice *bus = dev->parent;
+       const struct rockchip_spi_params * const data =
+               (void *)dev_get_driver_data(bus);
+       struct rockchip_spi_priv *priv = dev_get_priv(bus);
+       struct rockchip_spi *regs = priv->regs;
+       const u32 saved_ctrlr0 = readl(&regs->ctrlr0);
+#if defined(DEBUG)
+       u32 statistics_rxlevels[33] = { };
+#endif
+       u32 frames = *len / 2;
+       u8 *in = (u8 *)(*din);
+       u32 max_chunk_size = SPI_FIFO_DEPTH;
+
+       if (!frames)
+               return 0;
+
+       /*
+        * If we know that the hardware will manage RXFIFO overruns
+        * (i.e. stop the SPI clock until there's space in the FIFO),
+        * we the allow largest possible chunk size that can be
+        * represented in CTRLR1.
+        */
+       if (data && data->master_manages_fifo)
+               max_chunk_size = 0x10000;
+
+       // rockchip_spi_configure(dev, mode, size)
+       rkspi_enable_chip(regs, false);
+       clrsetbits_le32(&regs->ctrlr0,
+                       TMOD_MASK << TMOD_SHIFT,
+                       TMOD_RO << TMOD_SHIFT);
+       /* 16bit data frame size */
+       clrsetbits_le32(&regs->ctrlr0, DFS_MASK, DFS_16BIT);
+
+       /* Update caller's context */
+       const u32 bytes_to_process = 2 * frames;
+       *din += bytes_to_process;
+       *len -= bytes_to_process;
+
+       /* Process our frames */
+       while (frames) {
+               u32 chunk_size = min(frames, max_chunk_size);
+
+               frames -= chunk_size;
+
+               writew(chunk_size - 1, &regs->ctrlr1);
+               rkspi_enable_chip(regs, true);
+
+               do {
+                       u32 rx_level = readw(&regs->rxflr);
+#if defined(DEBUG)
+                       statistics_rxlevels[rx_level]++;
+#endif
+                       chunk_size -= rx_level;
+                       while (rx_level--) {
+                               u16 val = readw(regs->rxdr);
+                               *in++ = val & 0xff;
+                               *in++ = val >> 8;
+                       }
+               } while (chunk_size);
+
+               rkspi_enable_chip(regs, false);
+       }
+
+#if defined(DEBUG)
+       debug("%s: observed rx_level during processing:\n", __func__);
+       for (int i = 0; i <= 32; ++i)
+               if (statistics_rxlevels[i])
+                       debug("\t%2d: %d\n", i, statistics_rxlevels[i]);
+#endif
+       /* Restore the original transfer setup and return error-free. */
+       writel(saved_ctrlr0, &regs->ctrlr0);
+       return 0;
+}
+
 static int rockchip_spi_xfer(struct udevice *dev, unsigned int bitlen,
                           const void *dout, void *din, unsigned long flags)
 {
@@ -362,7 +428,7 @@ static int rockchip_spi_xfer(struct udevice *dev, unsigned int bitlen,
        const u8 *out = dout;
        u8 *in = din;
        int toread, towrite;
-       int ret;
+       int ret = 0;
 
        debug("%s: dout=%p, din=%p, len=%x, flags=%lx\n", __func__, dout, din,
              len, flags);
@@ -373,8 +439,18 @@ static int rockchip_spi_xfer(struct udevice *dev, unsigned int bitlen,
        if (flags & SPI_XFER_BEGIN)
                spi_cs_activate(dev, slave_plat->cs);
 
+       /*
+        * To ensure fast loading of firmware images (e.g. full U-Boot
+        * stage, ATF, Linux kernel) from SPI flash, we optimise the
+        * case of read-only transfers by using the full 16bits of each
+        * FIFO element.
+        */
+       if (!out)
+               ret = rockchip_spi_16bit_reader(dev, &in, &len);
+
+       /* This is the original 8bit reader/writer code */
        while (len > 0) {
-               int todo = min(len, 0xffff);
+               int todo = min(len, 0x10000);
 
                rkspi_enable_chip(regs, false);
                writel(todo - 1, &regs->ctrlr1);
@@ -397,9 +473,18 @@ static int rockchip_spi_xfer(struct udevice *dev, unsigned int bitlen,
                                toread--;
                        }
                }
-               ret = rkspi_wait_till_not_busy(regs);
-               if (ret)
-                       break;
+
+               /*
+                * In case that there's a transmit-component, we need to wait
+                * until the control goes idle before we can disable the SPI
+                * control logic (as this will implictly flush the FIFOs).
+                */
+               if (out) {
+                       ret = rkspi_wait_till_not_busy(regs);
+                       if (ret)
+                               break;
+               }
+
                len -= todo;
        }
 
@@ -446,10 +531,16 @@ static const struct dm_spi_ops rockchip_spi_ops = {
         */
 };
 
+const  struct rockchip_spi_params rk3399_spi_params = {
+       .master_manages_fifo = true,
+};
+
 static const struct udevice_id rockchip_spi_ids[] = {
        { .compatible = "rockchip,rk3288-spi" },
-       { .compatible = "rockchip,rk3368-spi" },
-       { .compatible = "rockchip,rk3399-spi" },
+       { .compatible = "rockchip,rk3368-spi",
+         .data = (ulong)&rk3399_spi_params },
+       { .compatible = "rockchip,rk3399-spi",
+         .data = (ulong)&rk3399_spi_params },
        { }
 };
 
index 93d7cfe463a88d6a1dd12355ff4b24749057ef01..0fc6b683f2beb4c01fcb983b55076c6eed866b4b 100644 (file)
@@ -8,9 +8,9 @@
 #include <errno.h>
 #include <sysreset.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3328.h>
-#include <asm/arch/hardware.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk3328.h>
+#include <asm/arch-rockchip/hardware.h>
 #include <linux/err.h>
 
 int rockchip_sysreset_request(struct udevice *dev, enum sysreset_t type)
index 69019740b0d1154c21e8c9cfa2b25b2b3f15cfea..54956e557a16e74e2de3b9a8791a7703da31ec72 100644 (file)
@@ -7,7 +7,7 @@
 #include <dm.h>
 #include <dm/ofnode.h>
 #include <mapmem.h>
-#include <asm/arch/timer.h>
+#include <asm/arch-rockchip/timer.h>
 #include <dt-structs.h>
 #include <timer.h>
 #include <asm/io.h>
index e81eb164b0d0a8afd1d031563769b644f8bdf326..f3d24772cdef0b30141e876497018884c30f8b91 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/compiler.h>
 #include <version.h>
 #include <g_dnl.h>
-#include <asm/arch/f_rockusb.h>
+#include <asm/arch-rockchip/f_rockusb.h>
 
 static inline struct f_rockusb *func_to_rockusb(struct usb_function *f)
 {
index eb3692c38711d72706b9ef6fe031fa5d72b40170..315d3adf27588c7508fbb84418ee7feac61f8d34 100644 (file)
@@ -13,9 +13,9 @@
 #include <syscon.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/hardware.h>
-#include <asm/arch/grf_rk3288.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/hardware.h>
+#include <asm/arch-rockchip/grf_rk3288.h>
 #include <power/regulator.h>
 #include "rk_hdmi.h"
 
index d268b465148e7d9838b8d8f7d9f4cee43995c0d6..7c4a4cc53b0e576bf601c0e6a04ed8937f5d622e 100644 (file)
 #include "rk_mipi.h"
 #include <syscon.h>
 #include <asm/gpio.h>
-#include <asm/hardware.h>
 #include <asm/io.h>
 #include <dm/uclass-internal.h>
 #include <linux/kernel.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3288.h>
-#include <asm/arch/grf_rk3288.h>
-#include <asm/arch/rockchip_mipi_dsi.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk3288.h>
+#include <asm/arch-rockchip/grf_rk3288.h>
+#include <asm/arch-rockchip/hardware.h>
+#include <asm/arch-rockchip/rockchip_mipi_dsi.h>
 
 #define MHz 1000000
 
index 7e953a628c191016900c40046b3cf0aceb122ab1..0f91dab1f255f4bb897085c3b9337d7176e2b1b7 100644 (file)
 #include <regmap.h>
 #include <syscon.h>
 #include <video.h>
-#include <asm/hardware.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/grf_rk3288.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/grf_rk3288.h>
+#include <asm/arch-rockchip/hardware.h>
 #include "rk_vop.h"
 
 DECLARE_GLOBAL_DATA_PTR;
index b75efe6fc32fbd449bc6e0cbb83016c98a650ee9..a62be9832750145d31eea6e88b9c0ad9b3e31c28 100644 (file)
@@ -13,9 +13,9 @@
 #include <syscon.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/hardware.h>
-#include <asm/arch/grf_rk3399.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/hardware.h>
+#include <asm/arch-rockchip/grf_rk3399.h>
 #include <power/regulator.h>
 #include "rk_hdmi.h"
 
index bb9007bf3633000c19133ac973e6bc35d1dee444..a93b73400bed0d744f33d6bbf5649edfa8037ab3 100644 (file)
 #include "rk_mipi.h"
 #include <syscon.h>
 #include <asm/gpio.h>
-#include <asm/hardware.h>
 #include <asm/io.h>
 #include <dm/uclass-internal.h>
 #include <linux/kernel.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3399.h>
-#include <asm/arch/grf_rk3399.h>
-#include <asm/arch/rockchip_mipi_dsi.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/rockchip_mipi_dsi.h>
 
 /* Select mipi dsi source, big or little vop */
 static int rk_mipi_dsi_source_select(struct udevice *dev)
index 7a02221ae0bea6d3a79980e83fb4c8245c4803ee..81c122d7a9ee319d8de21284f23b6036c78abacf 100644 (file)
@@ -10,7 +10,7 @@
 #include <dm.h>
 #include <regmap.h>
 #include <video.h>
-#include <asm/hardware.h>
+#include <asm/arch-rockchip/hardware.h>
 #include <asm/io.h>
 #include "rk_vop.h"
 
index e07410763248657c0e3671a38f4afd4b955a50ac..4330725a251380e5be1e3365fa75a707c40715a7 100644 (file)
@@ -14,9 +14,9 @@
 #include <syscon.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/edp_rk3288.h>
-#include <asm/arch/grf_rk3288.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/edp_rk3288.h>
+#include <asm/arch-rockchip/grf_rk3288.h>
 #include <dt-bindings/clock/rk3288-cru.h>
 
 #define MAX_CR_LOOP 5
index 13d07ee304815e16b907edc060d42d616a338e34..51931ceefae35cf3e64622f20f6a876a70ec32f5 100644 (file)
 #include <regmap.h>
 #include <syscon.h>
 #include <asm/gpio.h>
-#include <asm/hardware.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/hardware.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/hardware.h>
 #include "rk_hdmi.h"
 #include "rk_vop.h" /* for rk_vop_probe_regulators */
 
index f0a528c0d6da3b211169e80b6d485c4c855e5bec..cf5c0439b1ad063c31031f6bf869c0097af1c4bf 100644 (file)
@@ -12,9 +12,9 @@
 #include <syscon.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/lvds_rk3288.h>
-#include <asm/arch/grf_rk3288.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/lvds_rk3288.h>
+#include <asm/arch-rockchip/grf_rk3288.h>
 #include <dt-bindings/clock/rk3288-cru.h>
 #include <dt-bindings/video/rk3288.h>
 
index 4f1a0f3a5f7ffcc1a117e5f07a6f328962e44ba7..bcd039b7bc67d1932a48bff56431e8ff8c6dda26 100644 (file)
 #include "rk_mipi.h"
 #include <syscon.h>
 #include <asm/gpio.h>
-#include <asm/hardware.h>
 #include <asm/io.h>
 #include <dm/uclass-internal.h>
 #include <linux/kernel.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3399.h>
-#include <asm/arch/grf_rk3399.h>
-#include <asm/arch/rockchip_mipi_dsi.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/rockchip_mipi_dsi.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
index faf4f24db04f00fd0c879e12a415cba6bd184a6c..b56c3f336c99f4f4b5d3052a54f76feb3a2d72ec 100644 (file)
 #include <syscon.h>
 #include <video.h>
 #include <asm/gpio.h>
-#include <asm/hardware.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/edp_rk3288.h>
-#include <asm/arch/vop_rk3288.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/edp_rk3288.h>
+#include <asm/arch-rockchip/vop_rk3288.h>
 #include <dm/device-internal.h>
 #include <dm/uclass-internal.h>
 #include <power/regulator.h>
index 828974d394fe92f03455a130336f16e5d5e45818..8fa2f3893900979b7c94711c79a27030ec6f45b8 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef __RK_VOP_H__
 #define __RK_VOP_H__
 
-#include <asm/arch/vop_rk3288.h>
+#include <asm/arch-rockchip/vop_rk3288.h>
 
 struct rk_vop_priv {
        void *grf;
index 3bce0aa0b87889fd731bf0cc5b8c2a43558bed9e..16d47b88858ed2ac31b316ef7e2ad22ee655a509 100644 (file)
@@ -55,7 +55,7 @@ config WDT
        help
          Enable driver model for watchdog timer. At the moment the API
          is very simple and only supports four operations:
-         start, restart, stop and reset (expire immediately).
+         start, stop, reset and expire_now (expire immediately).
          What exactly happens when the timer expires is up to a particular
          device/driver.
 
index 6f35854823efbec0f2a1d97cf06e7420d88e3c23..cb7e18274221463528149ea9ad4c7569e2c21031 100644 (file)
@@ -119,17 +119,17 @@ int btrfs_ls(const char *path)
 
        if (inr == -1ULL) {
                printf("Cannot lookup path %s\n", path);
-               return 1;
+               return -1;
        }
 
        if (type != BTRFS_FT_DIR) {
                printf("Not a directory: %s\n", path);
-               return 1;
+               return -1;
        }
 
        if (btrfs_readdir(&root, inr, readdir_callback)) {
                printf("An error occured while listing directory %s\n", path);
-               return 1;
+               return -1;
        }
 
        return 0;
@@ -158,12 +158,12 @@ int btrfs_size(const char *file, loff_t *size)
 
        if (inr == -1ULL) {
                printf("Cannot lookup file %s\n", file);
-               return 1;
+               return -1;
        }
 
        if (type != BTRFS_FT_REG_FILE) {
                printf("Not a regular file: %s\n", file);
-               return 1;
+               return -1;
        }
 
        *size = inode.size;
@@ -183,12 +183,12 @@ int btrfs_read(const char *file, void *buf, loff_t offset, loff_t len,
 
        if (inr == -1ULL) {
                printf("Cannot lookup file %s\n", file);
-               return 1;
+               return -1;
        }
 
        if (type != BTRFS_FT_REG_FILE) {
                printf("Not a regular file: %s\n", file);
-               return 1;
+               return -1;
        }
 
        if (!len)
@@ -200,7 +200,7 @@ int btrfs_read(const char *file, void *buf, loff_t offset, loff_t len,
        rd = btrfs_file_read(&root, inr, offset, len, buf);
        if (rd == -1ULL) {
                printf("An error occured while reading file %s\n", file);
-               return 1;
+               return -1;
        }
 
        *actread = rd;
index 7aaf8f9b0d860569921bc746ff5021a400590f43..2dc4a6fcd7a3da9b331aa0b4d84329d7594df281 100644 (file)
@@ -198,17 +198,16 @@ int btrfs_read_superblock(void)
                        break;
 
                if (btrfs_check_super_csum(raw_sb)) {
-                       printf("%s: invalid checksum at superblock mirror %i\n",
-                              __func__, i);
+                       debug("%s: invalid checksum at superblock mirror %i\n",
+                             __func__, i);
                        continue;
                }
 
                btrfs_super_block_to_cpu(sb);
 
                if (sb->magic != BTRFS_MAGIC) {
-                       printf("%s: invalid BTRFS magic 0x%016llX at "
-                              "superblock mirror %i\n", __func__, sb->magic,
-                              i);
+                       debug("%s: invalid BTRFS magic 0x%016llX at "
+                             "superblock mirror %i\n", __func__, sb->magic, i);
                } else if (sb->bytenr != superblock_offsets[i]) {
                        printf("%s: invalid bytenr 0x%016llX (expected "
                               "0x%016llX) at superblock mirror %i\n",
@@ -224,7 +223,7 @@ int btrfs_read_superblock(void)
        }
 
        if (!btrfs_info.sb.generation) {
-               printf("%s: No valid BTRFS superblock found!\n", __func__);
+               debug("%s: No valid BTRFS superblock found!\n", __func__);
                return -1;
        }
 
index 6c02446a65a53c26e5e1b9a276392de4701bdeef..f5d09d18e5e2a44077bba6602daf3729fad4322e 100644 (file)
@@ -5,7 +5,7 @@
 #ifndef __CONFIG_RK3036_COMMON_H
 #define __CONFIG_RK3036_COMMON_H
 
-#include <asm/arch/hardware.h>
+#include <asm/arch-rockchip/hardware.h>
 #include "rockchip-common.h"
 
 #define CONFIG_SYS_MALLOC_LEN          (32 << 20)
index 4f6f4af957d7ff808e8d5e71ee060f53365b6382..1d417028467d19579ce50c25d64f10b9debeac07 100644 (file)
@@ -8,7 +8,7 @@
 
 #define CONFIG_SYS_CACHELINE_SIZE      64
 
-#include <asm/arch/hardware.h>
+#include <asm/arch-rockchip/hardware.h>
 #include "rockchip-common.h"
 
 #define CONFIG_SKIP_LOWLEVEL_INIT_ONLY
index 22eb064fadc3af0019db598944c52f01f8622640..3a96748f6b70be08c2101d748e3c13121619bd5d 100644 (file)
@@ -5,7 +5,7 @@
 #ifndef __CONFIG_RK322X_COMMON_H
 #define __CONFIG_RK322X_COMMON_H
 
-#include <asm/arch/hardware.h>
+#include <asm/arch-rockchip/hardware.h>
 #include "rockchip-common.h"
 
 #define CONFIG_SKIP_LOWLEVEL_INIT
index 3a1cbf28af8ea82896a63a819ec13644a2eee539..7c79ed6138241a4fa3ba81b956721ee90487edfa 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef __CONFIG_RK3288_COMMON_H
 #define __CONFIG_RK3288_COMMON_H
 
-#include <asm/arch/hardware.h>
+#include <asm/arch-rockchip/hardware.h>
 #include "rockchip-common.h"
 
 #define CONFIG_SKIP_LOWLEVEL_INIT_ONLY
index cf51f25bf3433d9ff46b4aee94e574f1839c8f43..bb2e96ba05d0363f90bbeea8d50a005fe62da024 100644 (file)
@@ -10,7 +10,7 @@
 
 #define CONFIG_SYS_CACHELINE_SIZE      64
 
-#include <asm/arch/hardware.h>
+#include <asm/arch-rockchip/hardware.h>
 #include <linux/sizes.h>
 
 #define CONFIG_SYS_SDRAM_BASE          0
index 952ea9fdca431a398c0bdd823db793beeba03544..6f61f015387982c99a21743f195d9e8b779d6caa 100644 (file)
@@ -5,7 +5,7 @@
 #ifndef __CONFIG_RV1108_COMMON_H
 #define __CONFIG_RV1108_COMMON_H
 
-#include <asm/arch/hardware.h>
+#include <asm/arch-rockchip/hardware.h>
 #include "rockchip-common.h"
 
 #define CONFIG_SYS_MALLOC_LEN          (32 << 20)
index c3353d74a9ec86e22366d10cbb64ee1dffc1d967..45a4a800c5809726641b47a861194d76fb180156 100644 (file)
@@ -41,6 +41,7 @@
 #define CONFIG_CMDLINE_TAG             /* enable passing of ATAGs */
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_INITRD_TAG
+
 #define CONFIG_SKIP_LOWLEVEL_INIT_ONLY
 
 /* general purpose I/O */
 #define CONFIG_AT91_GPIO
 #define CONFIG_AT91_GPIO_PULLUP        1       /* keep pullups on peripheral pins */
 
-/* serial console */
-#define CONFIG_ATMEL_USART
 #define CONFIG_USART_BASE              ATMEL_BASE_DBGU
 #define CONFIG_USART_ID                        ATMEL_ID_SYS
 
-
 /*
  * SDRAM: 1 bank, min 32, max 128 MB
  * Initialized before u-boot gets started.
 
 /* SPI EEPROM */
 #define TAURUS_SPI_MASK (1 << 4)
-#define TAURUS_SPI_CS_PIN      AT91_PIN_PA3
 
 #if defined(CONFIG_SPL_BUILD)
 /* SPL related */
 #define CONFIG_ENV_OFFSET              0x100000
 #define CONFIG_ENV_OFFSET_REDUND       0x180000
 #define CONFIG_ENV_SIZE                (SZ_128K)       /* 1 sector = 128 kB */
-#define CONFIG_BOOTCOMMAND     "nand read 0x22000000 0x200000 0x300000; bootm"
 
+#ifndef CONFIG_SPL_BUILD
+#if defined(CONFIG_BOARD_AXM)
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       "addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:" \
+               "${gatewayip}:${netmask}:${hostname}:${netdev}::off\0" \
+       "addtest=setenv bootargs ${bootargs} loglevel=4 test\0" \
+       "boot_file=setenv bootfile /${project_dir}/kernel/uImage\0" \
+       "boot_retries=0\0" \
+       "ethact=macb0\0" \
+       "flash_nfs=run nand_kernel;run nfsargs;run addip;" \
+               "upgrade_available;bootm ${kernel_ram};reset\0" \
+       "flash_self=run nand_kernel;run setbootargs;upgrade_available;" \
+               "bootm ${kernel_ram};reset\0" \
+       "flash_self_test=run nand_kernel;run setbootargs addtest;" \
+               "upgrade_available;bootm ${kernel_ram};reset\0" \
+       "hostname=systemone\0" \
+       "kernel_Off=0x00200000\0" \
+       "kernel_Off_fallback=0x03800000\0" \
+       "kernel_ram=0x21500000\0" \
+       "kernel_size=0x00400000\0" \
+       "kernel_size_fallback=0x00400000\0" \
+       "loads_echo=1\0" \
+       "nand_kernel=nand read.e ${kernel_ram} ${kernel_Off} " \
+               "${kernel_size}\0" \
+       "net_nfs=run boot_file;tftp ${kernel_ram} ${bootfile};" \
+               "run nfsargs;run addip;upgrade_available;" \
+               "bootm ${kernel_ram};reset\0" \
+       "netdev=eth0\0" \
+       "nfsargs=run root_path;setenv bootargs ${bootargs} root=/dev/nfs " \
+               "rw nfsroot=${serverip}:${rootpath} " \
+               "at91sam9_wdt.wdt_timeout=16\0" \
+       "partitionset_active=A\0" \
+       "preboot=echo;echo Type 'run flash_self' to use kernel and root " \
+               "filesystem on memory;echo Type 'run flash_nfs' to use " \
+               "kernel from memory and root filesystem over NFS;echo Type " \
+               "'run net_nfs' to get Kernel over TFTP and mount root " \
+               "filesystem over NFS;echo\0" \
+       "project_dir=systemone\0" \
+       "root_path=setenv rootpath /home/projects/${project_dir}/rootfs\0" \
+       "rootfs=/dev/mtdblock5\0" \
+       "rootfs_fallback=/dev/mtdblock7\0" \
+       "setbootargs=setenv bootargs ${bootargs} console=ttyMTD,mtdoops " \
+               "root=${rootfs} rootfstype=jffs2 panic=7 " \
+               "at91sam9_wdt.wdt_timeout=16\0" \
+       "stderr=serial\0" \
+       "stdin=serial\0" \
+       "stdout=serial\0" \
+       "upgrade_available=0\0"
+#endif
+#endif /* #ifndef CONFIG_SPL_BUILD */
 /*
  * Size of malloc() pool
  */
diff --git a/include/dt-bindings/pinctrl/k3-am65.h b/include/dt-bindings/pinctrl/k3-am65.h
deleted file mode 100644 (file)
index c86c9fd..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * This header provides constants for TI K3-AM65 pinctrl bindings.
- *
- * Copyright (C) 2018 Texas Instruments
- */
-#ifndef _DT_BINDINGS_PINCTRL_TI_K3_AM65_H
-#define _DT_BINDINGS_PINCTRL_TI_K3_AM65_H
-
-/* K3 mux mode options for each pin. See TRM for options */
-#define MUX_MODE0      0
-#define MUX_MODE1      1
-#define MUX_MODE2      2
-#define MUX_MODE3      3
-#define MUX_MODE4      4
-#define MUX_MODE5      5
-#define MUX_MODE6      6
-#define MUX_MODE7      7
-#define MUX_MODE15     15
-
-#define PULL_DISABLE           (1 << 16)
-#define PULL_UP                        (1 << 17)
-#define INPUT_EN               (1 << 18)
-#define SLEWCTRL_200MHZ                0
-#define SLEWCTRL_150MHZ                (1 << 19)
-#define SLEWCTRL_100MHZ                (2 << 19)
-#define SLEWCTRL_50MHZ         (3 << 19)
-#define TX_DIS                 (1 << 21)
-#define ISO_OVR                        (1 << 22)
-#define ISO_BYPASS             (1 << 23)
-#define DS_EN                  (1 << 24)
-#define DS_INPUT               (1 << 25)
-#define DS_FORCE_OUT_HIGH      (1 << 26)
-#define DS_PULL_UP_DOWN_EN     0
-#define DS_PULL_UP_DOWN_DIS    (1 << 27)
-#define DS_PULL_UP_SEL         (1 << 28)
-#define WAKEUP_ENABLE          (1 << 29)
-
-#define PIN_OUTPUT             (PULL_DISABLE)
-#define PIN_OUTPUT_PULLUP      (PULL_UP)
-#define PIN_OUTPUT_PULLDOWN    0
-#define PIN_INPUT              (INPUT_EN | PULL_DISABLE)
-#define PIN_INPUT_PULLUP       (INPUT_EN | PULL_UP)
-#define PIN_INPUT_PULLDOWN     (INPUT_EN)
-
-#define AM65X_IOPAD(pa, val)           (((pa) & 0x1fff)) (val)
-#define AM65X_WKUP_IOPAD(pa, val)      (((pa) & 0x1fff)) (val)
-
-#endif
diff --git a/include/dt-bindings/pinctrl/k3.h b/include/dt-bindings/pinctrl/k3.h
new file mode 100644 (file)
index 0000000..a67521c
--- /dev/null
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * This header provides constants for TI K3-AM65 pinctrl bindings.
+ *
+ * Copyright (C) 2018 Texas Instruments
+ */
+#ifndef _DT_BINDINGS_PINCTRL_TI_K3_AM65_H
+#define _DT_BINDINGS_PINCTRL_TI_K3_AM65_H
+
+#define PULL_DISABLE           (1 << 16)
+#define PULL_UP                        (1 << 17)
+#define INPUT_EN               (1 << 18)
+#define SLEWCTRL_200MHZ                0
+#define SLEWCTRL_150MHZ                (1 << 19)
+#define SLEWCTRL_100MHZ                (2 << 19)
+#define SLEWCTRL_50MHZ         (3 << 19)
+#define TX_DIS                 (1 << 21)
+#define ISO_OVR                        (1 << 22)
+#define ISO_BYPASS             (1 << 23)
+#define DS_EN                  (1 << 24)
+#define DS_INPUT               (1 << 25)
+#define DS_FORCE_OUT_HIGH      (1 << 26)
+#define DS_PULL_UP_DOWN_EN     0
+#define DS_PULL_UP_DOWN_DIS    (1 << 27)
+#define DS_PULL_UP_SEL         (1 << 28)
+#define WAKEUP_ENABLE          (1 << 29)
+
+#define PIN_OUTPUT             (PULL_DISABLE)
+#define PIN_OUTPUT_PULLUP      (PULL_UP)
+#define PIN_OUTPUT_PULLDOWN    0
+#define PIN_INPUT              (INPUT_EN | PULL_DISABLE)
+#define PIN_INPUT_PULLUP       (INPUT_EN | PULL_UP)
+#define PIN_INPUT_PULLDOWN     (INPUT_EN)
+
+#define AM65X_IOPAD(pa, val, muxmode)          (((pa) & 0x1fff)) ((val) | (muxmode))
+#define AM65X_WKUP_IOPAD(pa, val, muxmode)     (((pa) & 0x1fff)) ((val) | (muxmode))
+
+#endif
index 39ed8a6fa592de197fc483dbfb034a16b9e1708a..7af3f16ef840dd85856559825b3567025c4f0e02 100644 (file)
@@ -207,12 +207,17 @@ struct efi_object {
  * struct efi_loaded_image_obj - handle of a loaded image
  *
  * @header:            EFI object header
+ * @exit_status:       exit status passed to Exit()
+ * @exit_data_size:    exit data size passed to Exit()
+ * @exit_data:         exit data passed to Exit()
  * @exit_jmp:          long jump buffer for returning form started image
  * @entry:             entry address of the relocated image
  */
 struct efi_loaded_image_obj {
        struct efi_object header;
        efi_status_t exit_status;
+       efi_uintn_t *exit_data_size;
+       u16 **exit_data;
        struct jmp_buf_data exit_jmp;
        EFIAPI efi_status_t (*entry)(efi_handle_t image_handle,
                                     struct efi_system_table *st);
@@ -560,7 +565,7 @@ struct efi_load_option {
        u16 file_path_length;
        u16 *label;
        struct efi_device_path *file_path;
-       u8 *optional_data;
+       const u8 *optional_data;
 };
 
 void efi_deserialize_load_option(struct efi_load_option *lo, u8 *data);
index 49d3d6d0b47b96d2bfdf53f842f006090b8aa002..dd42e49023c3f29011cad9abf2b76a7c54724e35 100644 (file)
@@ -16,7 +16,7 @@
 
 #define EFI_ST_SUCCESS 0
 #define EFI_ST_FAILURE 1
-
+#define EFI_ST_SUCCESS_STR L"SUCCESS"
 /*
  * Prints a message.
  */
index 6854597700ff4d7298fec81f643ec9c249209b99..7601b0343bcd5f57ec649671c376a8b9531f36bc 100644 (file)
@@ -71,30 +71,33 @@ int fs_exists(const char *filename);
  */
 int fs_size(const char *filename, loff_t *size);
 
-/*
- * fs_read - Read file from the partition previously set by fs_set_blk_dev()
- * Note that not all filesystem types support either/both offset!=0 or len!=0.
+/**
+ * fs_read() - read file from the partition previously set by fs_set_blk_dev()
+ *
+ * Note that not all filesystem drivers support either or both of offset != 0
+ * and len != 0.
  *
- * @filename: Name of file to read from
- * @addr: The address to read into
- * @offset: The offset in file to read from
- * @len: The number of bytes to read. Maybe 0 to read entire file
- * @actread: Returns the actual number of bytes read
- * @return 0 if ok with valid *actread, -1 on error conditions
+ * @filename:  full path of the file to read from
+ * @addr:      address of the buffer to write to
+ * @offset:    offset in the file from where to start reading
+ * @len:       the number of bytes to read. Use 0 to read entire file.
+ * @actread:   returns the actual number of bytes read
+ * Return:     0 if OK with valid *actread, -1 on error conditions
  */
 int fs_read(const char *filename, ulong addr, loff_t offset, loff_t len,
            loff_t *actread);
 
-/*
- * fs_write - Write file to the partition previously set by fs_set_blk_dev()
- * Note that not all filesystem types support offset!=0.
+/**
+ * fs_write() - write file to the partition previously set by fs_set_blk_dev()
+ *
+ * Note that not all filesystem drivers support offset != 0.
  *
- * @filename: Name of file to read from
- * @addr: The address to read into
- * @offset: The offset in file to read from. Maybe 0 to write to start of file
- * @len: The number of bytes to write
- * @actwrite: Returns the actual number of bytes written
- * @return 0 if ok with valid *actwrite, -1 on error conditions
+ * @filename:  full path of the file to write to
+ * @addr:      address of the buffer to read from
+ * @offset:    offset in the file from where to start writing
+ * @len:       the number of bytes to write
+ * @actwrite:  returns the actual number of bytes written
+ * Return:     0 if OK with valid *actwrite, -1 on error conditions
  */
 int fs_write(const char *filename, ulong addr, loff_t offset, loff_t len,
             loff_t *actwrite);
index 05f82d4a5025e68c832f11fc901ff22f6f884cee..38012506d294ccf1884aa9f633ae5915e0e261a0 100644 (file)
@@ -359,7 +359,7 @@ config LZO
          This enables support for LZO compression algorithm.r
 
 config GZIP
-       bool "Enable gzip decompression support for SPL build"
+       bool "Enable gzip decompression support"
        select ZLIB
        default y
        help
index 4ccba2287572a659d8363144c70e70fcc31b5705..7bf51874c1c12443ac858ecbbb96e275be3da402 100644 (file)
@@ -53,19 +53,20 @@ void efi_deserialize_load_option(struct efi_load_option *lo, u8 *data)
  */
 unsigned long efi_serialize_load_option(struct efi_load_option *lo, u8 **data)
 {
-       unsigned long label_len, option_len;
+       unsigned long label_len;
        unsigned long size;
        u8 *p;
 
        label_len = (u16_strlen(lo->label) + 1) * sizeof(u16);
-       option_len = strlen((char *)lo->optional_data);
 
        /* total size */
        size = sizeof(lo->attributes);
        size += sizeof(lo->file_path_length);
        size += label_len;
        size += lo->file_path_length;
-       size += option_len + 1;
+       if (lo->optional_data)
+               size += (utf8_utf16_strlen((const char *)lo->optional_data)
+                                          + 1) * sizeof(u16);
        p = malloc(size);
        if (!p)
                return 0;
@@ -84,10 +85,10 @@ unsigned long efi_serialize_load_option(struct efi_load_option *lo, u8 **data)
        memcpy(p, lo->file_path, lo->file_path_length);
        p += lo->file_path_length;
 
-       memcpy(p, lo->optional_data, option_len);
-       p += option_len;
-       *(char *)p = '\0';
-
+       if (lo->optional_data) {
+               utf8_utf16_strcpy((u16 **)&p, (const char *)lo->optional_data);
+               p += sizeof(u16); /* size of trailing \0 */
+       }
        return size;
 }
 
index 601b0a2cb88db82d1f9c3ef15d7d41c04f1fde86..e5c46e9f0819b58e4dc80d422f8f44423daa550f 100644 (file)
@@ -423,10 +423,12 @@ static efi_status_t EFIAPI efi_free_pool_ext(void *buffer)
 }
 
 /**
- * efi_add_handle() - add a new object to the object list
- * @obj: object to be added
+ * efi_add_handle() - add a new handle to the object list
  *
- * The protocols list is initialized. The object handle is set.
+ * @handle:    handle to be added
+ *
+ * The protocols list is initialized. The handle is added to the list of known
+ * UEFI objects.
  */
 void efi_add_handle(efi_handle_t handle)
 {
@@ -618,7 +620,7 @@ efi_status_t efi_create_event(uint32_t type, efi_uintn_t notify_tpl,
        }
 
        if ((type & (EVT_NOTIFY_WAIT | EVT_NOTIFY_SIGNAL)) &&
-           (is_valid_tpl(notify_tpl) != EFI_SUCCESS))
+           (!notify_function || is_valid_tpl(notify_tpl) != EFI_SUCCESS))
                return EFI_INVALID_PARAMETER;
 
        evt = calloc(1, sizeof(struct efi_event));
@@ -2626,6 +2628,9 @@ efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle,
 
        efi_is_direct_boot = false;
 
+       image_obj->exit_data_size = exit_data_size;
+       image_obj->exit_data = exit_data;
+
        /* call the image! */
        if (setjmp(&image_obj->exit_jmp)) {
                /*
@@ -2669,6 +2674,41 @@ efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle,
        return EFI_CALL(systab.boottime->exit(image_handle, ret, 0, NULL));
 }
 
+/**
+ * efi_update_exit_data() - fill exit data parameters of StartImage()
+ *
+ * @image_obj          image handle
+ * @exit_data_size     size of the exit data buffer
+ * @exit_data          buffer with data returned by UEFI payload
+ * Return:             status code
+ */
+static efi_status_t efi_update_exit_data(struct efi_loaded_image_obj *image_obj,
+                                        efi_uintn_t exit_data_size,
+                                        u16 *exit_data)
+{
+       efi_status_t ret;
+
+       /*
+        * If exit_data is not provided to StartImage(), exit_data_size must be
+        * ignored.
+        */
+       if (!image_obj->exit_data)
+               return EFI_SUCCESS;
+       if (image_obj->exit_data_size)
+               *image_obj->exit_data_size = exit_data_size;
+       if (exit_data_size && exit_data) {
+               ret = efi_allocate_pool(EFI_BOOT_SERVICES_DATA,
+                                       exit_data_size,
+                                       (void **)image_obj->exit_data);
+               if (ret != EFI_SUCCESS)
+                       return ret;
+               memcpy(*image_obj->exit_data, exit_data, exit_data_size);
+       } else {
+               image_obj->exit_data = NULL;
+       }
+       return EFI_SUCCESS;
+}
+
 /**
  * efi_exit() - leave an EFI application or driver
  * @image_handle:   handle of the application or driver that is exiting
@@ -2709,6 +2749,15 @@ static efi_status_t EFIAPI efi_exit(efi_handle_t image_handle,
        if (ret != EFI_SUCCESS)
                goto out;
 
+       /* Exit data is only foreseen in case of failure. */
+       if (exit_status != EFI_SUCCESS) {
+               ret = efi_update_exit_data(image_obj, exit_data_size,
+                                          exit_data);
+               /* Exiting has priority. Don't return error to caller. */
+               if (ret != EFI_SUCCESS)
+                       EFI_PRINT("%s: out of memory\n", __func__);
+       }
+
        /* Make sure entry/exit counts for EFI world cross-overs match */
        EFI_EXIT(exit_status);
 
index 987cc6dc5f61aaaec7fea74c8e87ecbd0c927a90..776077cc35aa2f22fc55171127f7ba9bcf4d747d 100644 (file)
@@ -452,7 +452,7 @@ efi_status_t efi_free_pages(uint64_t memory, efi_uintn_t pages)
        uint64_t r = 0;
 
        /* Sanity check */
-       if (!memory || (memory & EFI_PAGE_MASK)) {
+       if (!memory || (memory & EFI_PAGE_MASK) || !pages) {
                printf("%s: illegal free 0x%llx, 0x%zx\n", __func__,
                       memory, pages);
                return EFI_INVALID_PARAMETER;
index b32a7b3f9346637d2719251aefafad683dd36982..87db51cbb74fa58c67fd5462e22ce67ca4b55afd 100644 (file)
@@ -79,6 +79,7 @@ out:
  */
 efi_status_t efi_init_obj_list(void)
 {
+       u64 os_indications_supported = 0; /* None */
        efi_status_t ret = EFI_SUCCESS;
 
        /* Initialize once only */
@@ -90,6 +91,16 @@ efi_status_t efi_init_obj_list(void)
        if (ret != EFI_SUCCESS)
                goto out;
 
+       /* Indicate supported features */
+       ret = EFI_CALL(efi_set_variable(L"OsIndicationsSupported",
+                                       &efi_global_variable_guid,
+                                       EFI_VARIABLE_BOOTSERVICE_ACCESS |
+                                       EFI_VARIABLE_RUNTIME_ACCESS,
+                                       sizeof(os_indications_supported),
+                                       &os_indications_supported));
+       if (ret != EFI_SUCCESS)
+               goto out;
+
        /* Initialize system table */
        ret = efi_initialize_system_table();
        if (ret != EFI_SUCCESS)
index b3ca109d811a4f28b08fddee5200a845134aa56f..6b5cfb01cf706b65a056d6becfbbf5d538ab485f 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #include <common.h>
-#include <efi_api.h>
+#include <efi_selftest.h>
 
 static efi_guid_t loaded_image_protocol_guid = EFI_LOADED_IMAGE_PROTOCOL_GUID;
 
@@ -66,15 +66,22 @@ efi_status_t EFIAPI efi_main(efi_handle_t handle,
                             struct efi_system_table *systable)
 {
        struct efi_simple_text_output_protocol *con_out = systable->con_out;
-       efi_status_t ret = EFI_UNSUPPORTED;
+       efi_status_t ret;
+       u16 text[] = EFI_ST_SUCCESS_STR;
 
        con_out->output_string(con_out, L"EFI application calling Exit\n");
 
-       if (check_loaded_image_protocol(handle, systable) != EFI_SUCCESS)
+       if (check_loaded_image_protocol(handle, systable) != EFI_SUCCESS) {
+               con_out->output_string(con_out,
+                                      L"Loaded image protocol missing\n");
                ret = EFI_NOT_FOUND;
+               goto out;
+       }
 
-       /* The return value is checked by the calling test */
-       systable->boottime->exit(handle, ret, 0, NULL);
+       /* This return value is expected by the calling test */
+       ret = EFI_UNSUPPORTED;
+out:
+       systable->boottime->exit(handle, ret, sizeof(text), text);
 
        /*
         * This statement should not be reached.
index fa4b7d4a9b6597a8455b61f9cf91690420058b08..96049dea868a16a8dc5c44b53aaa51561dc5f06e 100644 (file)
@@ -123,6 +123,9 @@ static int execute(void)
 {
        efi_status_t ret;
        efi_handle_t handle;
+       efi_uintn_t exit_data_size = 0;
+       u16 *exit_data = NULL;
+       u16 expected_text[] = EFI_ST_SUCCESS_STR;
 
        ret = boottime->load_image(false, image_handle, NULL, image,
                                   img.length, &handle);
@@ -130,11 +133,21 @@ static int execute(void)
                efi_st_error("Failed to load image\n");
                return EFI_ST_FAILURE;
        }
-       ret = boottime->start_image(handle, NULL, NULL);
+       ret = boottime->start_image(handle, &exit_data_size, &exit_data);
        if (ret != EFI_UNSUPPORTED) {
                efi_st_error("Wrong return value from application\n");
                return EFI_ST_FAILURE;
        }
+       if (!exit_data || exit_data_size != sizeof(expected_text) ||
+           efi_st_memcmp(exit_data, expected_text, sizeof(expected_text))) {
+               efi_st_error("Incorrect exit data\n");
+               return EFI_ST_FAILURE;
+       }
+       ret = boottime->free_pool(exit_data);
+       if (ret != EFI_SUCCESS) {
+               efi_st_error("Failed to free exit data\n");
+               return EFI_ST_FAILURE;
+       }
 
        return EFI_ST_SUCCESS;
 }
index fa20ee39fc3205e24b77f6faf86b5960b1ae0560..2d4d6ef7e461d15e85cf3a4dbd9a842af1b467bf 100644 (file)
@@ -238,6 +238,8 @@ void gen_rand_uuid(unsigned char *uuid_bin)
        unsigned int *ptr = (unsigned int *)&uuid;
        int i;
 
+       srand(get_ticks() + rand());
+
        /* Set all fields randomly */
        for (i = 0; i < sizeof(struct uuid) / sizeof(*ptr); i++)
                *(ptr + i) = cpu_to_be32(rand());
index 2403825dc98d9c0430eb5b76e8d0bbc83ae09440..3502b8088ff127e8fad7f9b16d4066925ef1039d 100644 (file)
@@ -16,7 +16,6 @@
 #include <efi_loader.h>
 #include <div64.h>
 #include <hexdump.h>
-#include <uuid.h>
 #include <stdarg.h>
 #include <linux/ctype.h>
 #include <linux/err.h>
index c450e1157a53b679c561cac3999e0f8e15522f9a..48ef03149ea836d5685999b7c11722717b9e943b 100644 (file)
@@ -118,7 +118,6 @@ CONFIG_BMP_32BPP
 CONFIG_BOARDDIR
 CONFIG_BOARDNAME
 CONFIG_BOARDNAME_LOCAL
-CONFIG_BOARD_AXM
 CONFIG_BOARD_COMMON
 CONFIG_BOARD_ECC_SUPPORT
 CONFIG_BOARD_IS_OPENRD_BASE
@@ -128,7 +127,6 @@ CONFIG_BOARD_NAME
 CONFIG_BOARD_POSTCLK_INIT
 CONFIG_BOARD_REVISION_TAG
 CONFIG_BOARD_SIZE_LIMIT
-CONFIG_BOARD_TAURUS
 CONFIG_BOOGER
 CONFIG_BOOTBLOCK
 CONFIG_BOOTFILE
index 12a3027e234e819ec7c01f75d51396abc101d702..eadeba417dcb33fac788ed0e1891c146f4176773 100644 (file)
@@ -272,6 +272,7 @@ subdir- += env
 
 ifneq ($(CROSS_BUILD_TOOLS),)
 override HOSTCC = $(CC)
+override HOSTCFLAGS = $(CFLAGS)
 
 quiet_cmd_crosstools_strip = STRIP   $^
       cmd_crosstools_strip = $(STRIP) $^; touch $@