With driver model SPL support in place the remaining driver difference between U-Boot proper and SPL is that SPL does not support device tree. This series adds this support, using a Rockchip board as an example.
One problem with device tree is that U-Boot has no way of dropping features it does not need or use. For SPL this problem needs to be solved and this series uses a new 'fdtgrep' tool for this. The 45KB Firefly device tree reduces to 558 bytes when unused material is removed. This series includes some changes aimed at reduce code size in SPL, including: - dropping alias sequence support (the aliases node) since many boards just use a single UART in SPL - adding a smaller panic() function that does not support printf()-format strings - removing device unbind code which will never be used in SPL Overall the resulting SPL binary is 8694 bytes with my Linaro 4.8.2 compiler, including the device tree, using Thumb-2 and with a hacked build so that CONFIG_USE_PRIVATE_LIBGCC is enabled. Of this: 1768 bytes is driver model core code 1556 bytes is device tree code 558 bytes is the device tree itself 4756 is other code, including serial drivers, rodata and data The last figure includes rodata incorrectly added by the tool chain [1]. With a bug-fixed gcc 4.9.2 the total size is 6758 bytes including device tree. Approximately 750 bytes is used for strings and driver data (root device and serial) associated with driver model and device tree. This adds up an overhead of around 4750 bytes for driver model and device tree, including the code, rodata and device tree itself. It should therefore be possible to use driver model and device tree in SPL for board that have enough SRAM. Clearly 4KB is impossible without further work (perhaps removing some error strings). I suspect 8KB would be tricky, allowing only 3KB for stack and other code. But 16KB should work OK. SRAM sizes for recent SoCs I am aware of are: Rockchip RK3288: 96KB Tegra 124: 128KB Samsung Exynos 5420: 384KB The Rockchip Firefly was chosen for this work since it is a fairly recent board and is readily available. Rockchip engineers have been actively upstreaming code to Linux in the past year and there is a very full-featured U-Boot available. But it is invisible to most U-Boot people - mainline Rockchip support seems well overdue. This series does not make a serious start on that, since it only prints a message in SPL and then hangs, but additional work should get it booting to a prompt. This series has not yet been tested on a Radxa Rock Pro but is likely to work there also, using the Firefly config. Future work will add support for this board also. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54303 Changes in v2: - Simplify the support for CONFIG_SYS_NS16550_MEM32 - Also drop the memory table space - Add a new patch for memalign_simple() - Add new patch to remove unused strings from a device tree - Add new patch with fdt_first/next_region() functions - Add new patch with fdtgrep tool - Add new patch to reduce SPL device tree size with fdtgrep - Tidy up license headers and remove SPL #ifdefs - Tidy up license headers - Tidy up license headers and remove SPL #ifdefs - Drop use of CONFIG_USE_PRIVATE_LIBGCC=y - Tidy up license headers and remove SPL #ifdefs Simon Glass (18): dm: ns16550: Support CONFIG_SYS_NS16550_MEM32 with driver model fdt: arm: Drop device tree padding dts: Disable device tree for SPL on all boards dm: serial: Don't support CONFIG_CONS_INDEX with device tree Add a simple version of memalign() Remove SPL undefine of CONFIG_OF_CONTROL mkimage: Display a better list of available image types fdt: Add a function to remove unused strings from a device tree fdt: Add fdt_first/next_region() functions fdt: Add fdtgrep tool dm: Reduce SPL device tree size dm: rockchip: Add serial support rockchip: Bring in RK3288 device tree file includes and bindings rockchip: Add base SoC files rockchip: Add basic support for firefly-rk3288 rockchip: Add the beginnings of an image tool rockchip: Add a simple README rockchip: Add basic support for jerry Makefile | 2 +- arch/arm/Kconfig | 18 + arch/arm/Makefile | 1 + arch/arm/cpu/armv7/exynos/Kconfig | 8 + arch/arm/cpu/armv7/s5pc1xx/Kconfig | 2 + arch/arm/cpu/u-boot-spl.lds | 2 +- arch/arm/dts/Makefile | 6 +- arch/arm/dts/cros-ec-sbs.dtsi | 16 + arch/arm/dts/rk3288-firefly.dts | 44 + arch/arm/dts/rk3288-firefly.dtsi | 454 ++++++ arch/arm/dts/rk3288-jerry.dts | 203 +++ arch/arm/dts/rk3288-thermal.dtsi | 88 ++ arch/arm/dts/rk3288-veyron-chromebook.dtsi | 200 +++ arch/arm/dts/rk3288-veyron.dtsi | 808 +++++++++++ arch/arm/dts/rk3288.dtsi | 1458 ++++++++++++++++++++ arch/arm/include/asm/arch-rockchip/clock.h | 12 + arch/arm/include/asm/arch-rockchip/gpio.h | 5 + arch/arm/include/asm/arch-rockchip/grf.h | 181 +++ arch/arm/mach-rockchip/Kconfig | 23 + arch/arm/mach-rockchip/Makefile | 12 + arch/arm/mach-rockchip/board-spl.c | 54 + arch/arm/mach-rockchip/board.c | 17 + arch/arm/mach-rockchip/common.c | 11 + arch/arm/mach-rockchip/rk3288/Kconfig | 26 + arch/arm/mach-tegra/Kconfig | 3 + board/firefly/firefly-rk3288/Kconfig | 15 + board/firefly/firefly-rk3288/MAINTAINERS | 6 + board/firefly/firefly-rk3288/Makefile | 7 + board/firefly/firefly-rk3288/firefly-rk3288.c | 7 + board/google/chromebook_jerry/Kconfig | 15 + board/google/chromebook_jerry/MAINTAINERS | 6 + board/google/chromebook_jerry/Makefile | 7 + board/google/chromebook_jerry/jerry.c | 7 + board/google/common/Makefile | 2 +- common/image.c | 59 +- common/malloc_simple.c | 14 + configs/am335x_boneblack_vboot_defconfig | 1 + configs/arches_defconfig | 1 + configs/canyonlands_defconfig | 1 + configs/chromebook_jerry_defconfig | 10 + configs/firefly-rk3288_defconfig | 10 + configs/galileo_defconfig | 1 + configs/microblaze-generic_defconfig | 1 + configs/odroid_defconfig | 1 + configs/origen_defconfig | 1 + configs/s5pc210_universal_defconfig | 1 + configs/socfpga_socrates_defconfig | 1 + configs/trats2_defconfig | 1 + configs/trats_defconfig | 1 + configs/zynq_microzed_defconfig | 1 + configs/zynq_zc70x_defconfig | 1 + configs/zynq_zc770_xm010_defconfig | 1 + configs/zynq_zc770_xm012_defconfig | 1 + configs/zynq_zc770_xm013_defconfig | 1 + configs/zynq_zed_defconfig | 1 + configs/zynq_zybo_defconfig | 1 + doc/README.rockchip | 83 ++ .../clock/rockchip,rk3288-cru.txt | 61 + doc/device-tree-bindings/clock/rockchip.txt | 77 ++ .../pinctrl/rockchip,pinctrl.txt | 157 +++ .../thermal/rockchip-thermal.txt | 68 + drivers/core/Makefile | 2 + drivers/serial/Kconfig | 9 + drivers/serial/Makefile | 1 + drivers/serial/ns16550.c | 4 + drivers/serial/serial-uclass.c | 69 +- drivers/serial/serial_rockchip.c | 41 + dts/Kconfig | 12 + include/config_uncmd_spl.h | 2 + include/configs/chromebook_jerry.h | 50 + include/configs/firefly-rk3288.h | 50 + include/dt-bindings/clock/rk3288-cru.h | 370 +++++ include/dt-bindings/clock/rockchip,rk808.h | 11 + include/dt-bindings/pinctrl/rockchip.h | 26 + include/dt-bindings/power-domain/rk3288.h | 11 + include/image.h | 12 + include/libfdt.h | 256 +++- include/ns16550.h | 2 +- lib/libfdt/Makefile | 2 +- lib/libfdt/fdt_region.c | 492 +++++++ lib/libfdt/fdt_rw.c | 32 + scripts/Makefile.spl | 28 + scripts/Makefile.uncmd_spl | 2 + tools/Makefile | 7 +- tools/fdtgrep.c | 1234 +++++++++++++++++ tools/mkimage.c | 59 +- tools/rkimage.c | 63 + 87 files changed, 7057 insertions(+), 73 deletions(-) create mode 100644 arch/arm/dts/cros-ec-sbs.dtsi create mode 100644 arch/arm/dts/rk3288-firefly.dts create mode 100644 arch/arm/dts/rk3288-firefly.dtsi create mode 100644 arch/arm/dts/rk3288-jerry.dts create mode 100644 arch/arm/dts/rk3288-thermal.dtsi create mode 100644 arch/arm/dts/rk3288-veyron-chromebook.dtsi create mode 100644 arch/arm/dts/rk3288-veyron.dtsi create mode 100644 arch/arm/dts/rk3288.dtsi create mode 100644 arch/arm/include/asm/arch-rockchip/clock.h create mode 100644 arch/arm/include/asm/arch-rockchip/gpio.h create mode 100644 arch/arm/include/asm/arch-rockchip/grf.h create mode 100644 arch/arm/mach-rockchip/Kconfig create mode 100644 arch/arm/mach-rockchip/Makefile create mode 100644 arch/arm/mach-rockchip/board-spl.c create mode 100644 arch/arm/mach-rockchip/board.c create mode 100644 arch/arm/mach-rockchip/common.c create mode 100644 arch/arm/mach-rockchip/rk3288/Kconfig create mode 100644 board/firefly/firefly-rk3288/Kconfig create mode 100644 board/firefly/firefly-rk3288/MAINTAINERS create mode 100644 board/firefly/firefly-rk3288/Makefile create mode 100644 board/firefly/firefly-rk3288/firefly-rk3288.c create mode 100644 board/google/chromebook_jerry/Kconfig create mode 100644 board/google/chromebook_jerry/MAINTAINERS create mode 100644 board/google/chromebook_jerry/Makefile create mode 100644 board/google/chromebook_jerry/jerry.c create mode 100644 configs/chromebook_jerry_defconfig create mode 100644 configs/firefly-rk3288_defconfig create mode 100644 doc/README.rockchip create mode 100644 doc/device-tree-bindings/clock/rockchip,rk3288-cru.txt create mode 100644 doc/device-tree-bindings/clock/rockchip.txt create mode 100644 doc/device-tree-bindings/pinctrl/rockchip,pinctrl.txt create mode 100644 doc/device-tree-bindings/thermal/rockchip-thermal.txt create mode 100644 drivers/serial/serial_rockchip.c create mode 100644 include/configs/chromebook_jerry.h create mode 100644 include/configs/firefly-rk3288.h create mode 100644 include/dt-bindings/clock/rk3288-cru.h create mode 100644 include/dt-bindings/clock/rockchip,rk808.h create mode 100644 include/dt-bindings/pinctrl/rockchip.h create mode 100644 include/dt-bindings/power-domain/rk3288.h create mode 100644 lib/libfdt/fdt_region.c create mode 100644 tools/fdtgrep.c create mode 100644 tools/rkimage.c -- 2.2.0.rc0.207.ga3a616c _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot