mirror of
				https://xff.cz/git/u-boot/
				synced 2025-10-31 18:35:42 +01:00 
			
		
		
		
	rockchip: Add Single boot image (with binman, pad_cat)
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: ₹ sudo dd if=u-boot-rockchip.bin of=/dev/sda seek=64 This would support all rockchip platforms, except rk3128 since it doesn't support for SPL yet. Cc: Matwey V. Kornilov <matwey.kornilov@gmail.com> Cc: Wadim Egorov <w.egorov@phytec.de> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
This commit is contained in:
		
							
								
								
									
										14
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								Makefile
									
									
									
									
									
								
							| @@ -912,7 +912,7 @@ ALL-y += u-boot-with-dtb.bin | |||||||
| endif | endif | ||||||
|  |  | ||||||
| ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy) | ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy) | ||||||
| ALL-y += idbloader.img | ALL-y += u-boot-rockchip.bin | ||||||
| endif | endif | ||||||
|  |  | ||||||
| LDFLAGS_u-boot += $(LDFLAGS_FINAL) | LDFLAGS_u-boot += $(LDFLAGS_FINAL) | ||||||
| @@ -1399,7 +1399,17 @@ idbloader.img: spl/u-boot-spl.bin FORCE | |||||||
| 	$(call if_changed,mkimage) | 	$(call if_changed,mkimage) | ||||||
| endif | endif | ||||||
|  |  | ||||||
| endif | ifeq ($(CONFIG_ARM64),) | ||||||
|  | u-boot-rockchip.bin: idbloader.img u-boot.img FORCE | ||||||
|  | 	$(call if_changed,binman) | ||||||
|  | else | ||||||
|  | OBJCOPYFLAGS_u-boot-rockchip.bin = -I binary -O binary \ | ||||||
|  | 	--pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff | ||||||
|  | u-boot-rockchip.bin: idbloader.img u-boot.itb FORCE | ||||||
|  | 	$(call if_changed,pad_cat) | ||||||
|  | endif # CONFIG_ARM64 | ||||||
|  |  | ||||||
|  | endif # CONFIG_ARCH_ROCKCHIP | ||||||
|  |  | ||||||
| ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy) | ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy) | ||||||
| MKIMAGEFLAGS_lpc32xx-spl.img = -T lpc32xximage -a $(CONFIG_SPL_TEXT_BASE) | MKIMAGEFLAGS_lpc32xx-spl.img = -T lpc32xximage -a $(CONFIG_SPL_TEXT_BASE) | ||||||
|   | |||||||
| @@ -1625,6 +1625,7 @@ config ARCH_STM32MP | |||||||
| config ARCH_ROCKCHIP | config ARCH_ROCKCHIP | ||||||
| 	bool "Support Rockchip SoCs" | 	bool "Support Rockchip SoCs" | ||||||
| 	select BLK | 	select BLK | ||||||
|  | 	select BINMAN if !ARM64 | ||||||
| 	select DM | 	select DM | ||||||
| 	select DM_GPIO | 	select DM_GPIO | ||||||
| 	select DM_I2C | 	select DM_I2C | ||||||
|   | |||||||
| @@ -2,3 +2,5 @@ | |||||||
| /* | /* | ||||||
|  * Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com> |  * Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com> | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
|  | #include "rockchip-u-boot.dtsi" | ||||||
|   | |||||||
| @@ -2,3 +2,5 @@ | |||||||
| /* | /* | ||||||
|  * Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com> |  * Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com> | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
|  | #include "rockchip-u-boot.dtsi" | ||||||
|   | |||||||
| @@ -3,6 +3,8 @@ | |||||||
|  * Copyright (C) 2019 Rockchip Electronics Co., Ltd |  * Copyright (C) 2019 Rockchip Electronics Co., Ltd | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
|  | #include "rockchip-u-boot.dtsi" | ||||||
|  |  | ||||||
| / { | / { | ||||||
| 	chosen { | 	chosen { | ||||||
| 		u-boot,spl-boot-order = \ | 		u-boot,spl-boot-order = \ | ||||||
|   | |||||||
							
								
								
									
										21
									
								
								arch/arm/dts/rockchip-u-boot.dtsi
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								arch/arm/dts/rockchip-u-boot.dtsi
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | |||||||
|  | // SPDX-License-Identifier: GPL-2.0+ | ||||||
|  | /* | ||||||
|  |  * Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com> | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  | #include <config.h> | ||||||
|  |  | ||||||
|  | / { | ||||||
|  | 	binman { | ||||||
|  | 		filename = "u-boot-rockchip.bin"; | ||||||
|  | 		pad-byte = <0xff>; | ||||||
|  |  | ||||||
|  | 		blob { | ||||||
|  | 			filename = "idbloader.img"; | ||||||
|  | 		}; | ||||||
|  |  | ||||||
|  | 		u-boot-img { | ||||||
|  | 			offset = <CONFIG_SPL_PAD_TO>; | ||||||
|  | 		}; | ||||||
|  | 	}; | ||||||
|  | }; | ||||||
| @@ -19,8 +19,6 @@ CONFIG_DEFAULT_FDT_FILE="rk3288-phycore-rdk.dtb" | |||||||
| CONFIG_DISPLAY_BOARDINFO_LATE=y | CONFIG_DISPLAY_BOARDINFO_LATE=y | ||||||
| CONFIG_SPL_STACK_R=y | CONFIG_SPL_STACK_R=y | ||||||
| CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000 | CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000 | ||||||
| CONFIG_SPL_I2C_SUPPORT=y |  | ||||||
| CONFIG_SPL_POWER_SUPPORT=y |  | ||||||
| CONFIG_CMD_GPIO=y | CONFIG_CMD_GPIO=y | ||||||
| CONFIG_CMD_GPT=y | CONFIG_CMD_GPT=y | ||||||
| CONFIG_CMD_I2C=y | CONFIG_CMD_I2C=y | ||||||
|   | |||||||
| @@ -9,6 +9,9 @@ | |||||||
|  |  | ||||||
| #define CONFIG_SYS_NS16550_MEM32 | #define CONFIG_SYS_NS16550_MEM32 | ||||||
|  |  | ||||||
|  | /* ((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512) */ | ||||||
|  | #define CONFIG_SPL_PAD_TO		8355840 | ||||||
|  |  | ||||||
| #ifndef CONFIG_SPL_BUILD | #ifndef CONFIG_SPL_BUILD | ||||||
|  |  | ||||||
| /* First try to boot from SD (index 0), then eMMC (index 1) */ | /* First try to boot from SD (index 0), then eMMC (index 1) */ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user