Merge tag 'dm-pull-29jul19' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
[oweals/u-boot.git] / arch / arm / mach-rockchip / Kconfig
index 282d728b82d580664bf8742db4040aec520fa8c1..e337d06b9997c7f71e69a1cb16af365def073859 100644 (file)
@@ -7,6 +7,7 @@ config ROCKCHIP_RK3036
        select SPL
        imply USB_FUNCTION_ROCKUSB
        imply CMD_ROCKUSB
        select SPL
        imply USB_FUNCTION_ROCKUSB
        imply CMD_ROCKUSB
+       imply ROCKCHIP_COMMON_BOARD
        help
          The Rockchip RK3036 is a ARM-based SoC with a dual-core Cortex-A7
          including NEON and GPU, Mali-400 graphics, several DDR3 options
        help
          The Rockchip RK3036 is a ARM-based SoC with a dual-core Cortex-A7
          including NEON and GPU, Mali-400 graphics, several DDR3 options
@@ -16,6 +17,7 @@ config ROCKCHIP_RK3036
 config ROCKCHIP_RK3128
        bool "Support Rockchip RK3128"
        select CPU_V7A
 config ROCKCHIP_RK3128
        bool "Support Rockchip RK3128"
        select CPU_V7A
+       imply ROCKCHIP_COMMON_BOARD
        help
          The Rockchip RK3128 is a ARM-based SoC with a quad-core Cortex-A7
          including NEON and GPU, Mali-400 graphics, several DDR3 options
        help
          The Rockchip RK3128 is a ARM-based SoC with a quad-core Cortex-A7
          including NEON and GPU, Mali-400 graphics, several DDR3 options
@@ -34,8 +36,10 @@ config ROCKCHIP_RK3188
        select SPL_RAM
        select SPL_DRIVERS_MISC_SUPPORT
        select SPL_ROCKCHIP_EARLYRETURN_TO_BROM
        select SPL_RAM
        select SPL_DRIVERS_MISC_SUPPORT
        select SPL_ROCKCHIP_EARLYRETURN_TO_BROM
+       select SPL_ROCKCHIP_BACK_TO_BROM
        select BOARD_LATE_INIT
        select BOARD_LATE_INIT
-       select ROCKCHIP_BROM_HELPER
+       imply ROCKCHIP_COMMON_BOARD
+       imply SPL_ROCKCHIP_COMMON_BOARD
        help
          The Rockchip RK3188 is a ARM-based SoC with a quad-core Cortex-A9
          including NEON and GPU, 512KB L2 cache, Mali-400 graphics, two
        help
          The Rockchip RK3188 is a ARM-based SoC with a quad-core Cortex-A9
          including NEON and GPU, 512KB L2 cache, Mali-400 graphics, two
@@ -47,8 +51,23 @@ config ROCKCHIP_RK322X
        bool "Support Rockchip RK3228/RK3229"
        select CPU_V7A
        select SUPPORT_SPL
        bool "Support Rockchip RK3228/RK3229"
        select CPU_V7A
        select SUPPORT_SPL
+       select SUPPORT_TPL
        select SPL
        select SPL
-       select ROCKCHIP_BROM_HELPER
+       select SPL_DM
+       select SPL_OF_LIBFDT
+       select TPL
+       select TPL_DM
+       select TPL_OF_LIBFDT
+       select TPL_NEEDS_SEPARATE_TEXT_BASE if SPL
+       select TPL_NEEDS_SEPARATE_STACK if TPL
+       select SPL_DRIVERS_MISC_SUPPORT
+       imply ROCKCHIP_COMMON_BOARD
+       imply SPL_SERIAL_SUPPORT
+       imply SPL_ROCKCHIP_COMMON_BOARD
+       imply TPL_SERIAL_SUPPORT
+       imply TPL_ROCKCHIP_COMMON_BOARD
+       select TPL_LIBCOMMON_SUPPORT
+       select TPL_LIBGENERIC_SUPPORT
        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
        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
@@ -58,9 +77,25 @@ config ROCKCHIP_RK322X
 config ROCKCHIP_RK3288
        bool "Support Rockchip RK3288"
        select CPU_V7A
 config ROCKCHIP_RK3288
        bool "Support Rockchip RK3288"
        select CPU_V7A
-       select SPL_BOARD_INIT if SPL
        select SUPPORT_SPL
        select SPL
        select SUPPORT_SPL
        select SPL
+       select SUPPORT_TPL
+       imply ROCKCHIP_COMMON_BOARD
+       imply SPL_ROCKCHIP_COMMON_BOARD
+       imply TPL_CLK
+       imply TPL_DM
+       imply TPL_DRIVERS_MISC_SUPPORT
+       imply TPL_LIBCOMMON_SUPPORT
+       imply TPL_LIBGENERIC_SUPPORT
+       imply TPL_NEEDS_SEPARATE_TEXT_BASE
+       imply TPL_NEEDS_SEPARATE_STACK
+       imply TPL_OF_CONTROL
+       imply TPL_OF_PLATDATA
+       imply TPL_RAM
+       imply TPL_REGMAP
+       imply TPL_ROCKCHIP_COMMON_BOARD
+       imply TPL_SERIAL_SUPPORT
+       imply TPL_SYSCON
        imply USB_FUNCTION_ROCKUSB
        imply CMD_ROCKUSB
        help
        imply USB_FUNCTION_ROCKUSB
        imply CMD_ROCKUSB
        help
@@ -70,19 +105,18 @@ config ROCKCHIP_RK3288
          and video codec support. Peripherals include Gigabit Ethernet,
          USB2 host and OTG, SDIO, I2S, UARTs, SPI, I2C and PWMs.
 
          and video codec support. Peripherals include Gigabit Ethernet,
          USB2 host and OTG, SDIO, I2S, UARTs, SPI, I2C and PWMs.
 
-if ROCKCHIP_RK3288
-
-config TPL_TEXT_BASE
-       default 0xff704000
-
-config TPL_MAX_SIZE
-       default 32768
-
-endif
-
 config ROCKCHIP_RK3328
        bool "Support Rockchip RK3328"
        select ARM64
 config ROCKCHIP_RK3328
        bool "Support Rockchip RK3328"
        select ARM64
+       select SUPPORT_SPL
+       select SPL
+       imply ROCKCHIP_COMMON_BOARD
+       imply SPL_ROCKCHIP_COMMON_BOARD
+       imply SPL_SERIAL_SUPPORT
+       imply SPL_SEPARATE_BSS
+       select ENABLE_ARM_SOC_BOOT0_HOOK
+       select DEBUG_UART_BOARD_INIT
+       select SYS_NS16550
        help
          The Rockchip RK3328 is a ARM-based SoC with a quad-core Cortex-A53.
          including NEON and GPU, 1MB L2 cache, Mali-T7 graphics, two
        help
          The Rockchip RK3328 is a ARM-based SoC with a quad-core Cortex-A53.
          including NEON and GPU, 1MB L2 cache, Mali-T7 graphics, two
@@ -97,9 +131,12 @@ config ROCKCHIP_RK3368
        select SUPPORT_TPL
        select TPL_NEEDS_SEPARATE_TEXT_BASE if SPL
        select TPL_NEEDS_SEPARATE_STACK if TPL
        select SUPPORT_TPL
        select TPL_NEEDS_SEPARATE_TEXT_BASE if SPL
        select TPL_NEEDS_SEPARATE_STACK if TPL
+       imply ROCKCHIP_COMMON_BOARD
+       imply SPL_ROCKCHIP_COMMON_BOARD
        imply SPL_SEPARATE_BSS
        imply SPL_SERIAL_SUPPORT
        imply TPL_SERIAL_SUPPORT
        imply SPL_SEPARATE_BSS
        imply SPL_SERIAL_SUPPORT
        imply TPL_SERIAL_SUPPORT
+       imply TPL_ROCKCHIP_COMMON_BOARD
        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
        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
@@ -111,29 +148,50 @@ config ROCKCHIP_RK3368
          On-chip peripherals include Gigabit Ethernet, USB2 host and OTG, SDIO,
          I2S, UARTs, SPI, I2C and PWMs.
 
          On-chip peripherals include Gigabit Ethernet, USB2 host and OTG, SDIO,
          I2S, UARTs, SPI, I2C and PWMs.
 
-if ROCKCHIP_RK3368
-
-config TPL_TEXT_BASE
-        default 0xff8c1000
-
-config TPL_MAX_SIZE
-        default 28672
-
-config TPL_STACK
-        default 0xff8cffff
-
-endif
-
 config ROCKCHIP_RK3399
        bool "Support Rockchip RK3399"
        select ARM64
        select SUPPORT_SPL
 config ROCKCHIP_RK3399
        bool "Support Rockchip RK3399"
        select ARM64
        select SUPPORT_SPL
+       select SUPPORT_TPL
        select SPL
        select SPL
+       select SPL_ATF
+       select SPL_ATF_NO_PLATFORM_PARAM if SPL_ATF
+       select SPL_BOARD_INIT if SPL
+       select SPL_LOAD_FIT
+       select SPL_CLK if SPL
+       select SPL_PINCTRL if SPL
+       select SPL_RAM if SPL
+       select SPL_REGMAP if SPL
+       select SPL_SYSCON if SPL
+       select TPL_NEEDS_SEPARATE_TEXT_BASE if TPL
+       select TPL_NEEDS_SEPARATE_STACK if TPL
        select SPL_SEPARATE_BSS
        select SPL_SERIAL_SUPPORT
        select SPL_DRIVERS_MISC_SUPPORT
        select SPL_SEPARATE_BSS
        select SPL_SERIAL_SUPPORT
        select SPL_DRIVERS_MISC_SUPPORT
+       select CLK
+       select FIT
+       select PINCTRL
+       select RAM
+       select REGMAP
+       select SYSCON
+       select DM_PMIC
+       select DM_REGULATOR_FIXED
        select BOARD_LATE_INIT
        select BOARD_LATE_INIT
-       select ROCKCHIP_BROM_HELPER
+       imply ROCKCHIP_COMMON_BOARD
+       imply SPL_ROCKCHIP_COMMON_BOARD
+       imply TPL_SERIAL_SUPPORT
+       imply TPL_LIBCOMMON_SUPPORT
+       imply TPL_LIBGENERIC_SUPPORT
+       imply TPL_SYS_MALLOC_SIMPLE
+       imply TPL_DRIVERS_MISC_SUPPORT
+       imply TPL_OF_CONTROL
+       imply TPL_DM
+       imply TPL_REGMAP
+       imply TPL_SYSCON
+       imply TPL_RAM
+       imply TPL_CLK
+       imply TPL_TINY_MEMSET
+       imply TPL_ROCKCHIP_COMMON_BOARD
        help
          The Rockchip RK3399 is a ARM-based SoC with a dual-core Cortex-A72
          and quad-core Cortex-A53.
        help
          The Rockchip RK3399 is a ARM-based SoC with a dual-core Cortex-A72
          and quad-core Cortex-A53.
@@ -145,6 +203,7 @@ config ROCKCHIP_RK3399
 config ROCKCHIP_RV1108
        bool "Support Rockchip RV1108"
        select CPU_V7A
 config ROCKCHIP_RV1108
        bool "Support Rockchip RV1108"
        select CPU_V7A
+       imply ROCKCHIP_COMMON_BOARD
        help
          The Rockchip RV1108 is a ARM-based SoC with a single-core Cortex-A7
          and a DSP.
        help
          The Rockchip RV1108 is a ARM-based SoC with a single-core Cortex-A7
          and a DSP.
@@ -161,6 +220,7 @@ config SPL_ROCKCHIP_BACK_TO_BROM
        bool "SPL returns to bootrom"
        default y if ROCKCHIP_RK3036
        select ROCKCHIP_BROM_HELPER
        bool "SPL returns to bootrom"
        default y if ROCKCHIP_RK3036
        select ROCKCHIP_BROM_HELPER
+       select SPL_BOOTROM_SUPPORT
        depends on SPL
        help
          Rockchip SoCs have ability to load SPL & U-Boot binary. If enabled,
        depends on SPL
        help
          Rockchip SoCs have ability to load SPL & U-Boot binary. If enabled,
@@ -169,24 +229,41 @@ config SPL_ROCKCHIP_BACK_TO_BROM
 
 config TPL_ROCKCHIP_BACK_TO_BROM
        bool "TPL returns to bootrom"
 
 config TPL_ROCKCHIP_BACK_TO_BROM
        bool "TPL returns to bootrom"
-       default y if ROCKCHIP_RK3368
+       default y
        select ROCKCHIP_BROM_HELPER
        select ROCKCHIP_BROM_HELPER
+       select TPL_BOOTROM_SUPPORT
        depends on TPL
        help
          Rockchip SoCs have ability to load SPL & U-Boot binary. If enabled,
           SPL will return to the boot rom, which will then load the U-Boot
           binary to keep going on.
 
        depends on TPL
        help
          Rockchip SoCs have ability to load SPL & U-Boot binary. If enabled,
           SPL will return to the boot rom, which will then load the U-Boot
           binary to keep going on.
 
+config ROCKCHIP_COMMON_BOARD
+       bool "Rockchip common board file"
+       help
+         Rockchip SoCs have similar boot process, Common board file is mainly
+         in charge of common process of board_init() and board_late_init() for
+         U-Boot proper.
+
+config SPL_ROCKCHIP_COMMON_BOARD
+       bool "Rockchip SPL common board file"
+       depends on SPL
+       help
+         Rockchip SoCs have similar boot process, SPL is mainly in charge of
+         load and boot Trust ATF/U-Boot firmware, and DRAM init if there is
+         no TPL for the board.
+
+config TPL_ROCKCHIP_COMMON_BOARD
+       bool ""
+       depends on TPL
+       help
+         Rockchip SoCs have similar boot process, prefer to use TPL for DRAM
+         init and back to bootrom, and SPL as Trust ATF/U-Boot loader. TPL
+         common board is a basic TPL board init which can be shared for most
+         of SoCs to avoid copy-pase for different SoCs.
+
 config ROCKCHIP_BOOT_MODE_REG
        hex "Rockchip boot mode flag register address"
 config ROCKCHIP_BOOT_MODE_REG
        hex "Rockchip boot mode flag register address"
-       default 0x200081c8 if ROCKCHIP_RK3036
-       default 0x20004040 if ROCKCHIP_RK3188
-       default 0x110005c8 if ROCKCHIP_RK322X
-       default 0xff730094 if ROCKCHIP_RK3288
-       default 0xff738200 if ROCKCHIP_RK3368
-       default 0xff320300 if ROCKCHIP_RK3399
-       default 0x10300580 if ROCKCHIP_RV1108
-       default 0
        help
          The Soc will enter to different boot mode(defined in asm/arch-rockchip/boot_mode.h)
          according to the value from this register.
        help
          The Soc will enter to different boot mode(defined in asm/arch-rockchip/boot_mode.h)
          according to the value from this register.