From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jagan Teki Date: Fri, 10 Jan 2020 00:16:21 +0530 Subject: [PATCH v7 6/7] rockchip: Add Single boot image (with binman, pad_cat) In-Reply-To: <20200109184622.3098-1-jagan@amarulasolutions.com> References: <20200109184622.3098-1-jagan@amarulasolutions.com> Message-ID: <20200109184622.3098-7-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 All rockchip platforms support TPL or SPL-based bootloader in mainline with U-Boot proper as final stage. For each stage we need to burn the image on to flash with respective offsets. This patch creates a single boot image component using - binman, for arm32 rockchip platforms - pad_cat, for arm64 rockchip platforms. This would help users to get rid of burning different boot stage images. The new image called 'u-boot-rockchip.bin' which can burn into flash like: =E2=82=B9 sudo dd if=3Du-boot-rockchip.bin of=3D/dev/sda seek=3D64 This would support all rockchip platforms, except rk3128 since it doesn't support for SPL yet. Cc: Matwey V. Kornilov Cc: Wadim Egorov Signed-off-by: Jagan Teki Reviewed-by: Kever Yang --- Makefile | 14 ++++++++++++-- arch/arm/Kconfig | 1 + arch/arm/dts/rk3036-u-boot.dtsi | 2 ++ arch/arm/dts/rk3188-u-boot.dtsi | 2 ++ arch/arm/dts/rk3288-u-boot.dtsi | 2 ++ arch/arm/dts/rockchip-u-boot.dtsi | 21 +++++++++++++++++++++ configs/phycore-rk3288_defconfig | 2 -- include/configs/rockchip-common.h | 3 +++ 8 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 arch/arm/dts/rockchip-u-boot.dtsi diff --git a/Makefile b/Makefile index 5361524f77..1d71a77cbb 100644 --- a/Makefile +++ b/Makefile @@ -909,7 +909,7 @@ ALL-y +=3D u-boot-with-dtb.bin endif =20 ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy) -ALL-y +=3D idbloader.img +ALL-y +=3D u-boot-rockchip.bin endif =20 LDFLAGS_u-boot +=3D $(LDFLAGS_FINAL) @@ -1395,7 +1395,17 @@ idbloader.img: spl/u-boot-spl.bin FORCE $(call if_changed,mkimage) endif =20 -endif +ifeq ($(CONFIG_ARM64),) +u-boot-rockchip.bin: idbloader.img u-boot.img FORCE + $(call if_changed,binman) +else +OBJCOPYFLAGS_u-boot-rockchip.bin =3D -I binary -O binary \ + --pad-to=3D$(CONFIG_SPL_PAD_TO) --gap-fill=3D0xff +u-boot-rockchip.bin: idbloader.img u-boot.itb FORCE + $(call if_changed,pad_cat) +endif # CONFIG_ARM64 + +endif # CONFIG_ARCH_ROCKCHIP =20 ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy) MKIMAGEFLAGS_lpc32xx-spl.img =3D -T lpc32xximage -a $(CONFIG_SPL_TEXT_BASE) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index f9dab073ea..7bd99ba3bb 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1590,6 +1590,7 @@ config ARCH_STM32MP config ARCH_ROCKCHIP bool "Support Rockchip SoCs" select BLK + select BINMAN if !ARM64 select DM select DM_GPIO select DM_I2C diff --git a/arch/arm/dts/rk3036-u-boot.dtsi b/arch/arm/dts/rk3036-u-boot.d= tsi index 1e7d079315..41ac054b81 100644 --- a/arch/arm/dts/rk3036-u-boot.dtsi +++ b/arch/arm/dts/rk3036-u-boot.dtsi @@ -2,3 +2,5 @@ /* * Copyright (C) 2019 Jagan Teki */ + +#include "rockchip-u-boot.dtsi" diff --git a/arch/arm/dts/rk3188-u-boot.dtsi b/arch/arm/dts/rk3188-u-boot.d= tsi index 1e7d079315..41ac054b81 100644 --- a/arch/arm/dts/rk3188-u-boot.dtsi +++ b/arch/arm/dts/rk3188-u-boot.dtsi @@ -2,3 +2,5 @@ /* * Copyright (C) 2019 Jagan Teki */ + +#include "rockchip-u-boot.dtsi" 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/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-bo= ot.dtsi new file mode 100644 index 0000000000..a2559e2db0 --- /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.bin"; + pad-byte =3D <0xff>; + + blob { + filename =3D "idbloader.img"; + }; + + u-boot-img { + offset =3D ; + }; + }; +}; diff --git a/configs/phycore-rk3288_defconfig b/configs/phycore-rk3288_defc= onfig index 2f10c7a3b3..ee164a9083 100644 --- a/configs/phycore-rk3288_defconfig +++ b/configs/phycore-rk3288_defconfig @@ -19,8 +19,6 @@ CONFIG_DEFAULT_FDT_FILE=3D"rk3288-phycore-rdk.dtb" CONFIG_DISPLAY_BOARDINFO_LATE=3Dy CONFIG_SPL_STACK_R=3Dy CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=3D0x2000 -CONFIG_SPL_I2C_SUPPORT=3Dy -CONFIG_SPL_POWER_SUPPORT=3Dy CONFIG_CMD_GPIO=3Dy CONFIG_CMD_GPT=3Dy CONFIG_CMD_I2C=3Dy diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-c= ommon.h index 68e1105a4b..b55e09a9ca 100644 --- a/include/configs/rockchip-common.h +++ b/include/configs/rockchip-common.h @@ -9,6 +9,9 @@ =20 #define CONFIG_SYS_NS16550_MEM32 =20 +/* ((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512) */ +#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