From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jagan Teki Date: Fri, 18 Oct 2019 00:37:09 +0530 Subject: [U-Boot] [PATCH v3 4/5] rockchip: Add Binman support In-Reply-To: <20191017190710.29985-1-jagan@amarulasolutions.com> References: <20191017190710.29985-1-jagan@amarulasolutions.com> Message-ID: <20191017190710.29985-5-jagan@amarulasolutions.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de TPL-based rockchip platform like rk3288, rk3328, rk3368 and rk3399 has three stage boot loaders like TPL, SPL and U-Boot proper. For each stage we need to burn the image on to flash with respective offsets. This patch create a single image using binman, so that user can get rid of burning different stage boot images. The new image called 'u-boot-rockchip-with-tpl-spl.bin' which can burn into flash like: =E2=82=B9 sudo dd if=3Du-boot-rockchip-with-tpl-spl.bin of=3D/dev/sda seek= =3D64 This would easily extend if other rockchip family SoC's would make use of single image creation. Cc: Kever Yang Cc: Matwey V. Kornilov Signed-off-by: Jagan Teki --- Makefile | 10 ++++++++++ arch/arm/Kconfig | 1 + arch/arm/dts/rk3288-u-boot.dtsi | 2 ++ arch/arm/dts/rk3328-u-boot.dtsi | 2 ++ arch/arm/dts/rk3368-u-boot.dtsi | 2 ++ arch/arm/dts/rk3399-u-boot.dtsi | 2 ++ arch/arm/dts/rockchip-u-boot.dtsi | 21 +++++++++++++++++++++ include/configs/rockchip-common.h | 2 ++ 8 files changed, 42 insertions(+) create mode 100644 arch/arm/dts/rockchip-u-boot.dtsi diff --git a/Makefile b/Makefile index 918b5d53e0..049781e0ba 100644 --- a/Makefile +++ b/Makefile @@ -888,6 +888,7 @@ endif =20 ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL)$(CONFIG_TPL),yyy) ALL-y +=3D spl/u-boot-spl-rockchip.bin +ALL-y +=3D u-boot-rockchip-with-tpl-spl.bin endif =20 LDFLAGS_u-boot +=3D $(LDFLAGS_FINAL) @@ -1346,6 +1347,15 @@ tpl/u-boot-tpl.img: tpl/u-boot-tpl.bin FORCE $(call if_changed,mkimage) spl/u-boot-spl-rockchip.bin: tpl/u-boot-tpl.img spl/u-boot-spl.bin FORCE $(call if_changed,cat) + +ifdef CONFIG_SPL_LOAD_FIT +ROCKCHIP_UBOOT_IMG :=3D u-boot.itb +else +ROCKCHIP_UBOOT_IMG :=3D u-boot.img +endif + +u-boot-rockchip-with-tpl-spl.bin: spl/u-boot-spl-rockchip.bin $(ROCKCHIP_U= BOOT_IMG) FORCE + $(call if_changed,binman) endif =20 ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 1df2aba3c2..87fa1f43f4 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1594,6 +1594,7 @@ config ARCH_STM32MP config ARCH_ROCKCHIP bool "Support Rockchip SoCs" select BLK + select BINMAN if TPL && SPL select DM select DM_GPIO select DM_I2C diff --git a/arch/arm/dts/rk3288-u-boot.dtsi b/arch/arm/dts/rk3288-u-boot.d= tsi index 3f00a3b6d3..6d31735362 100644 --- a/arch/arm/dts/rk3288-u-boot.dtsi +++ b/arch/arm/dts/rk3288-u-boot.dtsi @@ -3,6 +3,8 @@ * Copyright (C) 2019 Rockchip Electronics Co., Ltd */ =20 +#include "rockchip-u-boot.dtsi" + / { chosen { u-boot,spl-boot-order =3D \ diff --git a/arch/arm/dts/rk3328-u-boot.dtsi b/arch/arm/dts/rk3328-u-boot.d= tsi index ffbd657e31..0c51a8dbfb 100644 --- a/arch/arm/dts/rk3328-u-boot.dtsi +++ b/arch/arm/dts/rk3328-u-boot.dtsi @@ -3,6 +3,8 @@ * (C) Copyright 2019 Rockchip Electronics Co., Ltd */ =20 +#include "rockchip-u-boot.dtsi" + / { aliases { mmc0 =3D &emmc; diff --git a/arch/arm/dts/rk3368-u-boot.dtsi b/arch/arm/dts/rk3368-u-boot.d= tsi index 1e7d079315..41ac054b81 100644 --- a/arch/arm/dts/rk3368-u-boot.dtsi +++ b/arch/arm/dts/rk3368-u-boot.dtsi @@ -2,3 +2,5 @@ /* * Copyright (C) 2019 Jagan Teki */ + +#include "rockchip-u-boot.dtsi" diff --git a/arch/arm/dts/rk3399-u-boot.dtsi b/arch/arm/dts/rk3399-u-boot.d= tsi index 2738a3889e..fe8a73d653 100644 --- a/arch/arm/dts/rk3399-u-boot.dtsi +++ b/arch/arm/dts/rk3399-u-boot.dtsi @@ -3,6 +3,8 @@ * Copyright (C) 2019 Jagan Teki */ =20 +#include "rockchip-u-boot.dtsi" + &pmu { u-boot,dm-pre-reloc; }; diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-bo= ot.dtsi new file mode 100644 index 0000000000..c496107119 --- /dev/null +++ b/arch/arm/dts/rockchip-u-boot.dtsi @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 Jagan Teki + */ + +#include + +/ { + binman { + filename =3D "u-boot-rockchip-with-tpl-spl.bin"; + pad-byte =3D <0xff>; + + blob { + filename =3D "spl/u-boot-spl-rockchip.bin"; + }; + + u-boot-img { + offset =3D ; + }; + }; +}; diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-c= ommon.h index 68e1105a4b..d7f5ca9fa4 100644 --- a/include/configs/rockchip-common.h +++ b/include/configs/rockchip-common.h @@ -9,6 +9,8 @@ =20 #define CONFIG_SYS_NS16550_MEM32 =20 +#define CONFIG_SPL_PAD_TO 8355840 + #ifndef CONFIG_SPL_BUILD =20 /* First try to boot from SD (index 0), then eMMC (index 1) */ --=20 2.18.0.321.gffc6fa0e3