Here's an updated series to enable the RK3368 which addresses the concerns regarding the prefixing of GRF bit-definitions with a RK3368-prefix: while I had intended to temporarily pull the GMAC support to get around the underlying issue, moving the bit-definitions into the pinctrl-driver's implementation turned out to rather straightforward (and there's little use in having these definitions visible outside of the pinctrl driver anyway).
Thanks to everyone, who took the time to comment/discuss the initial version. This series (still) has a lot going on, but I didn't want to split it to allow everyone to understand the motivation between some of the changes to the SPL/TPL framework. The short summary of this is "enablement for DRAM init on the RK3368 with everything else that's necessary to do it using OF_PLATDATA in TPL". Enabling the RK3368 created a few more challenges that I'd expected: - I needed different stack locations, text addresses and sizes for TPL and SPL - the TPL stage was to use OF_PLATDATA and SPL was to use full OF_CONTROL - with the RK3368 TPL stage, there was a need to extend the back-to-bootrom support for Rockchip to AArch64 - I wanted to start folding some of the Rockchip specific SPL support (i.e. back-to-bootrom) back into the general SPL framework to allow using it as a general boot method So I ended up separating quite a bit of features between SPL and TPL while keeping things transparent to the few other boards using TPL (at least I hope that things are transparent, as we didn't have any of those in our lab to test on)... Tested with: RK3368-uQ7, Debian 9, Linux 4.13-rc1. Just one final remark: the DMC driver for the RK3368 currently covers the configuration we use on the RK3368-uQ7 (i.e. 32bit wide, 2 ranks) and is stress-tested (including 8-way SPEC runs) at all 3 supported speeds. I've built a bit of infrastructure (e.g. the way the memory-schedule is determined) that I hope will be a useful starting-point in unifying the drivers for the various closely related DRAM controllers (e.g. for the RK3288) for Rockchip devices in the future. Changes in v2: - dropped the RK3368_ prefix for the GRF constants - removed the RK3368-prefix on bit-definitions for GMAC pinctrl - removed the RK3368 prefix on the SD/MMC pin definitions - added SPI clock setup - moves the bit-definitions (for GRF registers) specific to the GMAC into the GMAC driver: these include interface speed selection and configuring the RGMII output mode - removes a 'u-boot,dm-pre-reloc' from dmc-node in rk3368.dtsi - copies the enum for the IOMUX config of the debug UART into the TPL support code, as the various constants are otherwise private to the pinctrl code (and we can't include pinctrl in the TPL stage due to size constraints/dependencies) - added in v2 - reuses the support for configuring the boot order using the u-boot,spl-boot-order property - drops the initialisation of the debug_uart - adds pinctrl-configuration for the preloader UART - marks pinctrl-node as 'u-boot,dm-pre-reloc' to ensure MMC2 (eMMC) works in the SPL stage - makes uart0 as 'u-boot,dm-pre-reloc' to allow initialising the preloader console (instead of relying solely on the debug UART) - adds support for SPI1 (and the on-module SPI flash) - splits the a 'u-boot.dtsi' off the DTS file - updates the defconfig for SPI and SPI flash support Klaus Goger (1): rockchip: board: puma_rk3399: rename ATF firmware Philipp Tomsich (55): spl: add a 'return to bootrom' boot method spl: configure 'return to bootrom' separately for SPL and TPL rockchip: back-to-bootrom: add 'back-to-bootrom' support for AArch64 rockchip: back-to-bootrom: split BACK_TO_BOOTROM for TPL/SPL rockchip: back-to-bootrom: simplify the #ifdef-check for LIBGENERIC in TPL/SPL spl: dm: Kconfig: use more specific prereqs for SPL_REGMAP and SPL_SYSCON spl: dm: Kconfig: split REGMAP/SYSCON support for TPL from SPL spl: dm: Kconfig: SPL_RAM depends on SPL_DM spl: dm: Kconfig: introduce TPL_RAM (in analogy to SPL_RAM) spl: dm: Kconfig: SPL_CLK depens on SPL_DM spl: dm: Kconfig: split CLK support for SPL and TPL spl: dm: Kconfig: split OF_CONTROL and OF_PLATDATA between SPL and TPL spl: dm: use CONFIG_IS_ENABLED to test for the DM option armv8: remove unused low-level modules from TPL armv8: spl: Support separate stack for TPL spl: allow a separate TEXT_BASE, LDSCRIPT and MAX_SIZE for TPL spl: Kconfig: split SYS_MALLOC_SIMPLE for TPL and SPL lib: spl: differentiate between TPL and SPL for libfdt/of_control/of_platdata spl: consistently use $(SPL_TPL_) to select features for SPL and TPL builds spl: add TPL_DRIVER_MISC_SUPPORT option drivers: spl: consistently use the $(SPL_TPL_) macro rockchip: Makefile: allow selective inclusion of sdram_common.o from TPL/SPL/U-Boot rockchip: rk3368: improve Kconfig text for the RK3368 rockchip: rk3368: mkimage: add support for the RK3368 rockchip: rk3368: pmugrf: add definitions for os_reg[0..3] rockchip: rk3368: spl: define COUNTER_FREQUENCY to 24MHz rockchip: rk3368: spl: add memory layout for TPL and SPL rockchip: rk3368: syscon: MSCH/PMUGRF/GRF support for OF_PLATDATA rockchip: rk3368: grf: use shifted-constants rockchip: pinctrl: rk3368: add GMAC (RGMII only) support rockchip: pinctrl: rk3368: add support for configuring the MMC pins rockchip: pinctrl: rk3368: move IOMUX bit-definitions to pinctrl driver rockchip: pinctrl: rk3368: add SPI support rockchip: clk: rk3368: implement bandwidth adjust for PLLs rockchip: clk: rk3368: support OF_PLATDATA for the RK3368 clk driver rockchip: clk: rk3368: do not change CPLL/GPLL before returning to BROM rockchip: clk: rk3368: implement DPLL (DRAM PLL) support rockchip: clk: rk3368: define DMA1_SRST_REQ and DMA2_SRST_REQ rockchip: clk: rk3368: implement MMC/SD clock reparenting rockchip: clk: rk3368: support configuring the DRAM PLL (from TPL) rockchip: clk: rk3368: add support for GMAC (SLCK_MAC) clock rockchip: clk: rk3368: mark 'priv' __maybe_unused in rk3368_clk_set_rate() rockchip: clk: rk3368: add support for configuring the SPI clocks net: gmac_rockchip: Add support for the RK3368 GMAC rockchip: Makefile: streamline SPL/TPL configuration rockchip: rk3368: add DRAM controller driver with DRAM initialisation rockchip: dts: rk3368: add DMC node in rk3368.dtsi rockchip: rk3368: spl: enable SPL_FRAMEWORK in rk3368_common.h rockchip: rk3368: spl: add TPL support rockchip: spl: make spl-boot-order code reusable (split from rk3399) rockchip: rk3368: spl: add SPL support rockchip: rk3368: spl: mark SPL and TPL as supported for ROCKCHIP_RK3368 rockchip: spi: enable support for the rk_spi driver for the RK3368 rockchip: board: lion-rk3368: add support for the RK3368-uQ7 rockchip: board: puma-rk3399: fix warnings in puma_rk3399/fit_spl_atf.its Makefile | 2 +- arch/arm/cpu/armv8/Makefile | 4 +- arch/arm/dts/Makefile | 1 + arch/arm/dts/rk3368-lion-u-boot.dtsi | 68 ++ arch/arm/dts/rk3368-lion.dts | 195 ++++ arch/arm/dts/rk3368.dtsi | 25 +- arch/arm/include/asm/arch-rockchip/cru_rk3368.h | 15 +- arch/arm/include/asm/arch-rockchip/ddr_rk3368.h | 187 ++++ arch/arm/include/asm/arch-rockchip/grf_rk3368.h | 326 +------ arch/arm/include/asm/spl.h | 1 + arch/arm/lib/crt0_64.S | 4 +- arch/arm/mach-rockchip/Kconfig | 37 +- arch/arm/mach-rockchip/Makefile | 51 +- arch/arm/mach-rockchip/bootrom.c | 4 +- arch/arm/mach-rockchip/rk3188-board-spl.c | 5 +- arch/arm/mach-rockchip/rk3188-board.c | 2 +- arch/arm/mach-rockchip/rk3288-board-spl.c | 4 +- arch/arm/mach-rockchip/rk3288-board.c | 4 +- arch/arm/mach-rockchip/rk3368-board-spl.c | 98 ++ arch/arm/mach-rockchip/rk3368-board-tpl.c | 168 ++++ arch/arm/mach-rockchip/rk3368/Kconfig | 21 + arch/arm/mach-rockchip/rk3368/Makefile | 1 - arch/arm/mach-rockchip/rk3368/sdram_rk3368.c | 60 -- arch/arm/mach-rockchip/rk3368/syscon_rk3368.c | 35 + arch/arm/mach-rockchip/rk3368/u-boot-tpl.lds | 13 + arch/arm/mach-rockchip/rk3399-board-spl.c | 106 +-- arch/arm/mach-rockchip/save_boot_param.S | 37 + arch/arm/mach-rockchip/spl-boot-order.c | 108 +++ board/theobroma-systems/lion_rk3368/Kconfig | 15 + board/theobroma-systems/lion_rk3368/MAINTAINERS | 10 + board/theobroma-systems/lion_rk3368/Makefile | 7 + board/theobroma-systems/lion_rk3368/README | 60 ++ .../theobroma-systems/lion_rk3368/fit_spl_atf.its | 51 ++ board/theobroma-systems/lion_rk3368/lion_rk3368.c | 25 + board/theobroma-systems/puma_rk3399/README | 2 +- .../theobroma-systems/puma_rk3399/fit_spl_atf.its | 20 +- common/Makefile | 8 +- common/spl/Kconfig | 39 + common/spl/Makefile | 35 +- common/spl/spl.c | 5 +- common/spl/spl_bootrom.c | 27 + configs/evb-rk3288_defconfig | 2 +- configs/fennec-rk3288_defconfig | 2 +- configs/firefly-rk3288_defconfig | 2 +- configs/lion-rk3368_defconfig | 88 ++ configs/miqi-rk3288_defconfig | 2 +- configs/popmetal-rk3288_defconfig | 2 +- configs/rock2_defconfig | 2 +- configs/rock_defconfig | 2 +- configs/tinker-rk3288_defconfig | 2 +- doc/README.rockchip | 2 +- .../clock/rockchip,rk3368-dmc.txt | 67 ++ drivers/Makefile | 36 +- drivers/clk/Kconfig | 12 +- drivers/clk/Makefile | 2 +- drivers/clk/rockchip/clk_rk3368.c | 302 ++++++- drivers/core/Kconfig | 23 +- drivers/core/Makefile | 4 +- drivers/net/gmac_rockchip.c | 78 ++ drivers/pinctrl/rockchip/pinctrl_rk3368.c | 508 ++++++++++- drivers/ram/Kconfig | 11 +- drivers/ram/Makefile | 2 + drivers/ram/rockchip/Makefile | 7 + drivers/ram/rockchip/dmc-rk3368.c | 990 +++++++++++++++++++++ drivers/spi/rk_spi.c | 9 + dts/Kconfig | 29 + include/configs/lion_rk3368.h | 19 + include/configs/rk3188_common.h | 2 +- include/configs/rk3288_common.h | 2 +- include/configs/rk3368_common.h | 14 + include/configs/rock.h | 2 +- include/configs/rockchip-common.h | 2 +- include/dt-bindings/memory/rk3368-dmc.h | 30 + include/linux/kconfig.h | 13 + include/spl.h | 10 + lib/Makefile | 10 +- scripts/Makefile.spl | 14 +- scripts/config_whitelist.txt | 4 + tools/rkcommon.c | 1 + 79 files changed, 3538 insertions(+), 657 deletions(-) create mode 100644 arch/arm/dts/rk3368-lion-u-boot.dtsi create mode 100644 arch/arm/dts/rk3368-lion.dts create mode 100644 arch/arm/include/asm/arch-rockchip/ddr_rk3368.h create mode 100644 arch/arm/mach-rockchip/rk3368-board-spl.c create mode 100644 arch/arm/mach-rockchip/rk3368-board-tpl.c delete mode 100644 arch/arm/mach-rockchip/rk3368/sdram_rk3368.c create mode 100644 arch/arm/mach-rockchip/rk3368/u-boot-tpl.lds create mode 100644 arch/arm/mach-rockchip/spl-boot-order.c create mode 100644 board/theobroma-systems/lion_rk3368/Kconfig create mode 100644 board/theobroma-systems/lion_rk3368/MAINTAINERS create mode 100644 board/theobroma-systems/lion_rk3368/Makefile create mode 100644 board/theobroma-systems/lion_rk3368/README create mode 100644 board/theobroma-systems/lion_rk3368/fit_spl_atf.its create mode 100644 board/theobroma-systems/lion_rk3368/lion_rk3368.c create mode 100644 common/spl/spl_bootrom.c create mode 100644 configs/lion-rk3368_defconfig create mode 100644 doc/device-tree-bindings/clock/rockchip,rk3368-dmc.txt create mode 100644 drivers/ram/rockchip/Makefile create mode 100644 drivers/ram/rockchip/dmc-rk3368.c create mode 100644 include/configs/lion_rk3368.h create mode 100644 include/dt-bindings/memory/rk3368-dmc.h -- 2.1.4 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot