Skip to contentSkip to conversation

rockchip: Add Binman support

PATCH Superseded Jagan Teki 4 participants 15 messages Oct 23, 2019 – Nov 10, 2019 5 messages not in the archive

Subsystems (3)

v4 of 7 Superseded Latest is v7 →

lore
Share & tools
lore

Jagan Teki

author
#0 lore raw

v4 cover rockchip: Add Binman support

This is v4 set for Binman support in rockchip, [1] here is previous patchset.

This series add single boot image with binman for arm32 and pad_cat for arm64 rockchip platforms both TPL + SPL and SPL-alone targets.

Changes for v4:
- support all rockchip platforms
- add new patches for dtsi changes
- update documentation
- format proper commit message
- rebase on master
Changes for v3:
- rebase on master
- add binman for rk3288, rk3328, rk3368, rk3399
- added rst documentation for rockchip Changes for v2:
- Add few clean target patches
- update bl31.elf env handling code, with logging
- support puma itb, via BL31 and PMUM0 env
- enable BUILD_TARGET for ROCKCHIP_RK3399
- add patch to build rockchip dtbs based on SoC types

[1] https://patchwork.ozlabs.org/cover/1178957/

Jagan Teki (7):
Makefile: Add rockchip image type
Makefile: rockchip: Suffix platform type with tpl name
Makefile: rockchip: Support SPL-alone mkimage
Makefile: rockchip: Use u-boot preferred spl name
arm: dts: rk3036: Add rk3036-u-boot.dtsi
rockchip: Add Single boot image (with binman, pad_cat)
doc: boards: Add rockchip documentation

 Makefile                            |  36 ++++++--
 arch/arm/Kconfig                    |   1 +
 arch/arm/dts/rk3036-sdk-u-boot.dtsi |   2 +
 arch/arm/dts/rk3036-u-boot.dtsi     |   6 ++
 arch/arm/dts/rk3288-u-boot.dtsi     |   2 +
 arch/arm/dts/rockchip-u-boot.dtsi   |  21 +++++
 doc/board/rockchip/index.rst        |  10 +++
 doc/board/rockchip/rockchip.rst     | 128 ++++++++++++++++++++++++++++
 include/configs/rockchip-common.h   |   2 +
 9 files changed, 203 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/dts/rk3036-u-boot.dtsi
 create mode 100644 arch/arm/dts/rockchip-u-boot.dtsi
 create mode 100644 doc/board/rockchip/index.rst
 create mode 100644 doc/board/rockchip/rockchip.rst
Signature · 1 line
2.18.0.321.gffc6fa0e3

A message that is not in the archive (sent off-list or not yet received): 20191023195652.7158-1-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org

author
#2 lore raw

PATCH v4 1/7 Makefile: Add rockchip image type

Add rockchip image type support. right now the image type marked with rksd, So create image type variable with required image type like rksd or rkspi.

---
 Makefile | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
Makefile +9 -1
index 6fda3268e7..3e05d3fcfe 100644
@@ -1334,7 +1334,15 @@ u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_PAYLOAD) FORCE
 	$(call if_changed,pad_cat)
 
 ifeq ($(CONFIG_ARCH_ROCKCHIP),y)
-MKIMAGEFLAGS_u-boot-tpl.img = -n $(CONFIG_SYS_SOC) -T rksd
+
+# rockchip image type
+ifeq ($(CONFIG_SPI_FLASH_SUPPORT),y)
+ROCKCHIP_IMG_TYPE := rkspi
+else
+ROCKCHIP_IMG_TYPE := rksd
+endif
+
+MKIMAGEFLAGS_u-boot-tpl.img = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
 tpl/u-boot-tpl.img: tpl/u-boot-tpl.bin FORCE
 	$(call if_changed,mkimage)
 idbloader.img: tpl/u-boot-tpl.img spl/u-boot-spl.bin FORCE
Signature · 1 line
2.18.0.321.gffc6fa0e3
Reviewed-by on v4 1/7
#3 lore raw

Re: [PATCH v4 1/7] Makefile: Add rockchip image type

Quoted 7 lines · Jagan Teki

Add rockchip image type support. right now the image type marked with rksd, So create image type variable with required image type like rksd or rkspi.

Cc Kever Yang <[email protected]>
Cc Matwey V. Kornilov <[email protected]>

Thanks,
- Kever

Quoted 15 lines
---
  Makefile | 10 +++++++++-
  1 file changed, 9 insertions(+), 1 deletion(-)
Makefile +2 -1
index 6fda3268e7..3e05d3fcfe 100644
@@ -1334,7 +1334,15 @@ u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_PAYLOAD) FORCE
  	$(call if_changed,pad_cat)
 
  ifeq ($(CONFIG_ARCH_ROCKCHIP),y)
-MKIMAGEFLAGS_u-boot-tpl.img = -n $(CONFIG_SYS_SOC) -T rksd
+
+# rockchip image type

Makefile u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_PAYLOAD) FORCE · line 1348

Quoted 10 lines
Makefile +7 -0
+ifeq ($(CONFIG_SPI_FLASH_SUPPORT),y)
+ROCKCHIP_IMG_TYPE := rkspi
+else
+ROCKCHIP_IMG_TYPE := rksd
+endif
+
+MKIMAGEFLAGS_u-boot-tpl.img = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
  tpl/u-boot-tpl.img: tpl/u-boot-tpl.bin FORCE
  	$(call if_changed,mkimage)
  idbloader.img: tpl/u-boot-tpl.img spl/u-boot-spl.bin FORCE

_______________________________________________
U-Boot mailing list
[email protected]
https://lists.denx.de/listinfo/u-boot

author
#4 lore raw

PATCH v4 2/7 Makefile: rockchip: Suffix platform type with tpl name

In reply to a message not in the archive

Most of the platforms uses the platform type on their boot stage image naming conventions in makefile like,

u-boot-x86-start16-tpl.bin - x86 start16 TPL bin u-boot-spl-mtk.bin - Mediatek SPL bin

This would help to understand the users to what that particular image belongs to? and less confused.

On that note, suffix platform type rockchip for existing u-boot-tpl.img so now it become u-boot-tpl-rockchip.bin

Also, bin is more conventional way to include it on tools like binman, pad_cat etc in future patches.

Note: usage of platform type doesn't follow consistent order as of now.

---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Makefile +3 -3
index 3e05d3fcfe..40cbf68fef 100644
@@ -1342,10 +1342,10 @@ else
 ROCKCHIP_IMG_TYPE := rksd
 endif
 
-MKIMAGEFLAGS_u-boot-tpl.img = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
-tpl/u-boot-tpl.img: tpl/u-boot-tpl.bin FORCE
+MKIMAGEFLAGS_u-boot-tpl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
+tpl/u-boot-tpl-rockchip.bin: tpl/u-boot-tpl.bin FORCE
 	$(call if_changed,mkimage)
-idbloader.img: tpl/u-boot-tpl.img spl/u-boot-spl.bin FORCE
+idbloader.img: tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin FORCE
 	$(call if_changed,cat)
 endif
 
Signature · 1 line
2.18.0.321.gffc6fa0e3

A message that is not in the archive (sent off-list or not yet received): 20191023195652.7158-3-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org

Reviewed-by
#6 lore raw

Re: [PATCH v4 2/7] Makefile: rockchip: Suffix platform type with tpl name

Quoted 12 lines · Jagan Teki

Most of the platforms uses the platform type on their boot stage image naming conventions in makefile like,

u-boot-x86-start16-tpl.bin - x86 start16 TPL bin u-boot-spl-mtk.bin - Mediatek SPL bin

This would help to understand the users to what that particular image belongs to? and less confused.

On that note, suffix platform type rockchip for existing u-boot-tpl.img so now it become u-boot-tpl-rockchip.bin

Quoted 7 lines

Also, bin is more conventional way to include it on tools like binman, pad_cat etc in future patches.

Note: usage of platform type doesn't follow consistent order as of now.

Thanks,
- Kever

Quoted 12 lines
---
  Makefile | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
Makefile +0 -0
index 3e05d3fcfe..40cbf68fef 100644
@@ -1342,10 +1342,10 @@ else
  ROCKCHIP_IMG_TYPE := rksd
  endif
 

Makefile else · line 1351

Quoted 10 lines
Makefile +3 -3
-MKIMAGEFLAGS_u-boot-tpl.img = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
-tpl/u-boot-tpl.img: tpl/u-boot-tpl.bin FORCE
+MKIMAGEFLAGS_u-boot-tpl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
+tpl/u-boot-tpl-rockchip.bin: tpl/u-boot-tpl.bin FORCE
  	$(call if_changed,mkimage)
-idbloader.img: tpl/u-boot-tpl.img spl/u-boot-spl.bin FORCE
+idbloader.img: tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin FORCE
  	$(call if_changed,cat)
  endif
 

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

author
#7 lore raw

PATCH v4 3/7 Makefile: rockchip: Support SPL-alone mkimage

In reply to a message not in the archive

Add SPL-alone mkimage tooling support via Makefile for few platforms or boards used in rockchip family.

With this users would get rid of explicitly creating mkimage tool for rockchip rksd or rkspi boot modes.

---
 Makefile | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
Makefile +9 -1
index 40cbf68fef..b58107d6ef 100644
@@ -886,7 +886,7 @@ ifeq ($(CONFIG_MPC85xx)$(CONFIG_OF_SEPARATE),yy)
 ALL-y += u-boot-with-dtb.bin
 endif
 
-ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL)$(CONFIG_TPL),yyy)
+ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy)
 ALL-y += idbloader.img
 endif
 
@@ -1342,11 +1342,19 @@ else
 ROCKCHIP_IMG_TYPE := rksd
 endif
 
+# TPL + SPL
+ifeq ($(CONFIG_SPL)$(CONFIG_TPL),yy)
 MKIMAGEFLAGS_u-boot-tpl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
 tpl/u-boot-tpl-rockchip.bin: tpl/u-boot-tpl.bin FORCE
 	$(call if_changed,mkimage)
 idbloader.img: tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin FORCE
 	$(call if_changed,cat)
+else
+MKIMAGEFLAGS_idbloader.img = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
+idbloader.img: spl/u-boot-spl.bin FORCE
+	$(call if_changed,mkimage)
+endif
+
 endif
 
 ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy)
Signature · 1 line
2.18.0.321.gffc6fa0e3

A message that is not in the archive (sent off-list or not yet received): 20191023195652.7158-4-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org

Reviewed-by
#9 lore raw

Re: [PATCH v4 3/7] Makefile: rockchip: Support SPL-alone mkimage

Quoted 7 lines · Jagan Teki

Add SPL-alone mkimage tooling support via Makefile for few platforms or boards used in rockchip family.

With this users would get rid of explicitly creating mkimage tool for rockchip rksd or rkspi boot modes.

Thanks,
- Kever

Quoted 27 lines
---
  Makefile | 10 +++++++++-
  1 file changed, 9 insertions(+), 1 deletion(-)
Makefile +3 -1
index 40cbf68fef..b58107d6ef 100644
@@ -886,7 +886,7 @@ ifeq ($(CONFIG_MPC85xx)$(CONFIG_OF_SEPARATE),yy)
  ALL-y += u-boot-with-dtb.bin
  endif
 
-ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL)$(CONFIG_TPL),yyy)
+ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy)
  ALL-y += idbloader.img
  endif
 
@@ -1342,11 +1342,19 @@ else
  ROCKCHIP_IMG_TYPE := rksd
  endif
 
+# TPL + SPL
+ifeq ($(CONFIG_SPL)$(CONFIG_TPL),yy)
  MKIMAGEFLAGS_u-boot-tpl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
  tpl/u-boot-tpl-rockchip.bin: tpl/u-boot-tpl.bin FORCE
  	$(call if_changed,mkimage)
  idbloader.img: tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin FORCE

Makefile else · line 1360

Quoted 10 lines
Makefile +6 -0
  	$(call if_changed,cat)
+else
+MKIMAGEFLAGS_idbloader.img = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
+idbloader.img: spl/u-boot-spl.bin FORCE
+	$(call if_changed,mkimage)
+endif
+
  endif
 
  ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy)

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

author
#10 lore raw

PATCH v4 4/7 Makefile: rockchip: Use u-boot preferred spl name

In reply to a message not in the archive

Most of the platforms uses the platform type and particular boot stage on their image naming conventions in makefile like,

u-boot-sunxi-with-spl.bin - Allwinner U-Boot with SPL u-boot-spl-mtk.bin - Mediatek SPL bin

This would help to understand the users to what that particular image belongs to? and less confused.

On that note, use u-boot-spl-rockchip.bin instead of idbloader.img. idbloader.img is still a proper naming for rockchip external documentation but u-boot preferred spl name would always good choice in upstream tree.

Also, bin is more conventional way to include it on tools like binman, pad_cat etc in future patches.

Note: usage of platform type, boot stage doesn't follow consistent oder as of now.

---
 Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Makefile +4 -4
index b58107d6ef..a4278170d4 100644
@@ -887,7 +887,7 @@ ALL-y += u-boot-with-dtb.bin
 endif
 
 ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy)
-ALL-y += idbloader.img
+ALL-y += u-boot-spl-rockchip.bin
 endif
 
 LDFLAGS_u-boot += $(LDFLAGS_FINAL)
@@ -1347,11 +1347,11 @@ ifeq ($(CONFIG_SPL)$(CONFIG_TPL),yy)
 MKIMAGEFLAGS_u-boot-tpl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
 tpl/u-boot-tpl-rockchip.bin: tpl/u-boot-tpl.bin FORCE
 	$(call if_changed,mkimage)
-idbloader.img: tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin FORCE
+u-boot-spl-rockchip.bin: tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin FORCE
 	$(call if_changed,cat)
 else
-MKIMAGEFLAGS_idbloader.img = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
-idbloader.img: spl/u-boot-spl.bin FORCE
+MKIMAGEFLAGS_u-boot-spl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
+u-boot-spl-rockchip.bin: spl/u-boot-spl.bin FORCE
 	$(call if_changed,mkimage)
 endif
 
Signature · 1 line
2.18.0.321.gffc6fa0e3
author
#11 lore raw

PATCH v4 5/7 arm: dts: rk3036: Add rk3036-u-boot.dtsi

In reply to a message not in the archive

Add U-Boot specific dtsi file for rk3036 SoC. This would help to add U-Boot specific dts nodes, properties which are common across rk3036.

Right now, the file is empty, will add required changes in future patches.

---
 arch/arm/dts/rk3036-sdk-u-boot.dtsi | 2 ++
 arch/arm/dts/rk3036-u-boot.dtsi     | 4 ++++
 2 files changed, 6 insertions(+)
 create mode 100644 arch/arm/dts/rk3036-u-boot.dtsi
arch/arm/dts/rk3036-sdk-u-boot.dtsi +2 -0
index 6f15f4a8ec..754800c6e6 100644
@@ -1,3 +1,5 @@
+#include "rk3036-u-boot.dtsi"
+
 &uart2 {
 	u-boot,dm-pre-reloc;
 };
arch/arm/dts/rk3036-u-boot.dtsi new file +4 -0
new file mode 100644
index 0000000000..1e7d079315
@@ -0,0 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
+ */
Signature · 1 line
2.18.0.321.gffc6fa0e3

A message that is not in the archive (sent off-list or not yet received): 20191023195652.7158-6-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org

Reviewed-by
#13 lore raw

Re: [PATCH v4 5/7] arm: dts: rk3036: Add rk3036-u-boot.dtsi

Quoted 8 lines · Jagan Teki

Add U-Boot specific dtsi file for rk3036 SoC. This would help to add U-Boot specific dts nodes, properties which are common across rk3036.

Right now, the file is empty, will add required changes in future patches.

Thanks,
- Kever

Quoted 22 lines
---
  arch/arm/dts/rk3036-sdk-u-boot.dtsi | 2 ++
  arch/arm/dts/rk3036-u-boot.dtsi     | 4 ++++
  2 files changed, 6 insertions(+)

create mode 100644 arch/arm/dts/rk3036-u-boot.dtsi

arch/arm/dts/rk3036-sdk-u-boot.dtsi +2 -0
index 6f15f4a8ec..754800c6e6 100644
@@ -1,3 +1,5 @@
+#include "rk3036-u-boot.dtsi"
+
  &uart2 {
  	u-boot,dm-pre-reloc;
  };
arch/arm/dts/rk3036-u-boot.dtsi new file +0 -0
new file mode 100644
index 0000000000..1e7d079315

arch/arm/dts/rk3036-u-boot.dtsi line 4

Quoted 4 lines
arch/arm/dts/rk3036-u-boot.dtsi new file +4 -0
@@ -0,0 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Jagan Teki <[email protected]>
+ */

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

author
#14 lore raw

PATCH v4 6/7 rockchip: Add Single boot image (with binman, pad_cat)

In reply to a message not in the archive

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 Kever Yang <[email protected]>
Cc Matwey V. Kornilov <[email protected]>
---
 Makefile                          | 18 ++++++++++++++----
 arch/arm/Kconfig                  |  1 +
 arch/arm/dts/rk3036-u-boot.dtsi   |  2 ++
 arch/arm/dts/rk3288-u-boot.dtsi   |  2 ++
 arch/arm/dts/rockchip-u-boot.dtsi | 21 +++++++++++++++++++++
 include/configs/rockchip-common.h |  2 ++
 6 files changed, 42 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/dts/rockchip-u-boot.dtsi
Makefile +14 -4
index a4278170d4..6c70106c6e 100644
@@ -887,7 +887,7 @@ ALL-y += u-boot-with-dtb.bin
 endif
 
 ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy)
-ALL-y += u-boot-spl-rockchip.bin
+ALL-y += u-boot-rockchip.bin
 endif
 
 LDFLAGS_u-boot += $(LDFLAGS_FINAL)
@@ -1347,15 +1347,25 @@ ifeq ($(CONFIG_SPL)$(CONFIG_TPL),yy)
 MKIMAGEFLAGS_u-boot-tpl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
 tpl/u-boot-tpl-rockchip.bin: tpl/u-boot-tpl.bin FORCE
 	$(call if_changed,mkimage)
-u-boot-spl-rockchip.bin: tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin FORCE
+spl/u-boot-spl-rockchip.bin: tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin FORCE
 	$(call if_changed,cat)
 else
 MKIMAGEFLAGS_u-boot-spl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
-u-boot-spl-rockchip.bin: spl/u-boot-spl.bin FORCE
+spl/u-boot-spl-rockchip.bin: spl/u-boot-spl.bin FORCE
 	$(call if_changed,mkimage)
 endif
 
-endif
+ifeq ($(CONFIG_ARM64),)
+u-boot-rockchip.bin: spl/u-boot-spl-rockchip.bin 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: spl/u-boot-spl-rockchip.bin u-boot.itb FORCE
+	$(call if_changed,pad_cat)
+endif # CONFIG_ARM64
+
+endif # CONFIG_ARCH_ROCKCHIP
 
 ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy)
 MKIMAGEFLAGS_lpc32xx-spl.img = -T lpc32xximage -a $(CONFIG_SPL_TEXT_BASE)
arch/arm/Kconfig +1 -0
index 1df2aba3c2..8107414626 100644
@@ -1594,6 +1594,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
arch/arm/dts/rk3036-u-boot.dtsi +2 -0
index 1e7d079315..41ac054b81 100644
@@ -2,3 +2,5 @@
 /*
  * Copyright (C) 2019 Jagan Teki <[email protected]>
  */
+
+#include "rockchip-u-boot.dtsi"
arch/arm/dts/rk3288-u-boot.dtsi +2 -0
index 3f00a3b6d3..6d31735362 100644
@@ -3,6 +3,8 @@
  * Copyright (C) 2019 Rockchip Electronics Co., Ltd
  */
 
+#include "rockchip-u-boot.dtsi"
+
 / {
 	chosen {
 		u-boot,spl-boot-order = \
arch/arm/dts/rockchip-u-boot.dtsi new file +21 -0
new file mode 100644
index 0000000000..bc0b1412a2
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Jagan Teki <[email protected]>
+ */
+
+#include <config.h>
+
+/ {
+	binman {
+		filename = "u-boot-rockchip.bin";
+		pad-byte = <0xff>;
+
+		blob {
+			filename = "spl/u-boot-spl-rockchip.bin";
+		};
+
+		u-boot-img {
+			offset = <CONFIG_SPL_PAD_TO>;
+		};
+	};
+};
include/configs/rockchip-common.h +2 -0
index 68e1105a4b..d7f5ca9fa4 100644
@@ -9,6 +9,8 @@
 
 #define CONFIG_SYS_NS16550_MEM32
 
+#define CONFIG_SPL_PAD_TO		8355840
+
 #ifndef CONFIG_SPL_BUILD
 
 /* First try to boot from SD (index 0), then eMMC (index 1) */
Signature · 7 lines
2.18.0.321.gffc6fa0e3


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

A message that is not in the archive (sent off-list or not yet received): 20191023195652.7158-7-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org

Reviewed-by
#16 lore raw

Re: [PATCH v4 6/7] rockchip: Add Single boot image (with binman, pad_cat)

Quoted 15 lines · Jagan Teki

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:

Quoted 8 lines

₹ 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 Kever Yang <[email protected]>
Cc Matwey V. Kornilov <[email protected]>

Thanks,
- Kever

Quoted 119 lines
---
  Makefile                          | 18 ++++++++++++++----
  arch/arm/Kconfig                  |  1 +
  arch/arm/dts/rk3036-u-boot.dtsi   |  2 ++
  arch/arm/dts/rk3288-u-boot.dtsi   |  2 ++
  arch/arm/dts/rockchip-u-boot.dtsi | 21 +++++++++++++++++++++
  include/configs/rockchip-common.h |  2 ++
  6 files changed, 42 insertions(+), 4 deletions(-)

create mode 100644 arch/arm/dts/rockchip-u-boot.dtsi

Makefile +14 -4
index a4278170d4..6c70106c6e 100644
@@ -887,7 +887,7 @@ ALL-y += u-boot-with-dtb.bin
  endif
 
  ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy)
-ALL-y += u-boot-spl-rockchip.bin
+ALL-y += u-boot-rockchip.bin
  endif
 
  LDFLAGS_u-boot += $(LDFLAGS_FINAL)
@@ -1347,15 +1347,25 @@ ifeq ($(CONFIG_SPL)$(CONFIG_TPL),yy)
  MKIMAGEFLAGS_u-boot-tpl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
  tpl/u-boot-tpl-rockchip.bin: tpl/u-boot-tpl.bin FORCE
  	$(call if_changed,mkimage)
-u-boot-spl-rockchip.bin: tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin FORCE
+spl/u-boot-spl-rockchip.bin: tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin FORCE
  	$(call if_changed,cat)
  else
  MKIMAGEFLAGS_u-boot-spl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
-u-boot-spl-rockchip.bin: spl/u-boot-spl.bin FORCE
+spl/u-boot-spl-rockchip.bin: spl/u-boot-spl.bin FORCE
  	$(call if_changed,mkimage)
  endif
 
-endif
+ifeq ($(CONFIG_ARM64),)
+u-boot-rockchip.bin: spl/u-boot-spl-rockchip.bin 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: spl/u-boot-spl-rockchip.bin u-boot.itb FORCE
+	$(call if_changed,pad_cat)
+endif # CONFIG_ARM64
+
+endif # CONFIG_ARCH_ROCKCHIP
 
  ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy)
  MKIMAGEFLAGS_lpc32xx-spl.img = -T lpc32xximage -a $(CONFIG_SPL_TEXT_BASE)
arch/arm/Kconfig +1 -0
index 1df2aba3c2..8107414626 100644
@@ -1594,6 +1594,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
arch/arm/dts/rk3036-u-boot.dtsi +2 -0
index 1e7d079315..41ac054b81 100644
@@ -2,3 +2,5 @@
  /*
   * Copyright (C) 2019 Jagan Teki <[email protected]>
   */
+
+#include "rockchip-u-boot.dtsi"
arch/arm/dts/rk3288-u-boot.dtsi +2 -0
index 3f00a3b6d3..6d31735362 100644
@@ -3,6 +3,8 @@
   * Copyright (C) 2019 Rockchip Electronics Co., Ltd
   */
 
+#include "rockchip-u-boot.dtsi"
+
  / {
  	chosen {
  		u-boot,spl-boot-order = \
arch/arm/dts/rockchip-u-boot.dtsi new file +21 -0
new file mode 100644
index 0000000000..bc0b1412a2
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Jagan Teki <[email protected]>
+ */
+
+#include <config.h>
+
+/ {
+	binman {
+		filename = "u-boot-rockchip.bin";
+		pad-byte = <0xff>;
+
+		blob {
+			filename = "spl/u-boot-spl-rockchip.bin";
+		};
+
+		u-boot-img {
+			offset = <CONFIG_SPL_PAD_TO>;
+		};
+	};
+};
include/configs/rockchip-common.h +0 -0
index 68e1105a4b..d7f5ca9fa4 100644

include/configs/rockchip-common.h line 16

Quoted 8 lines
include/configs/rockchip-common.h +2 -0
@@ -9,6 +9,8 @@
 
  #define CONFIG_SYS_NS16550_MEM32
 
+#define CONFIG_SPL_PAD_TO		8355840
+
  #ifndef CONFIG_SPL_BUILD
 
  /* First try to boot from SD (index 0), then eMMC (index 1) */

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

author
#17 lore raw

PATCH v4 7/7 doc: boards: Add rockchip documentation

In reply to a message not in the archive

Rockchip has documentation file, doc/README.rockchip but which is not so readable to add or understand the existing contents. Even the format that support is legacy readme in U-Boot.

Add rockchip specific documentation file using new rst format, which describes the information about Rockchip supported boards and it's usage steps.

Added minimal information about rk3288, rk3328, rk3368 and rk3399 boards and usage. This would indeed updated further based on the requirements and updates.

---
 doc/board/rockchip/index.rst    |  10 +++
 doc/board/rockchip/rockchip.rst | 128 ++++++++++++++++++++++++++++++++
 2 files changed, 138 insertions(+)
 create mode 100644 doc/board/rockchip/index.rst
 create mode 100644 doc/board/rockchip/rockchip.rst
doc/board/rockchip/index.rst new file +10 -0
new file mode 100644
index 0000000000..0c377e9bbb
@@ -0,0 +1,10 @@
+.. SPDX-License-Identifier: GPL-2.0+
+.. Copyright (C) 2019 Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
+
+Rockchip
+========
+
+.. toctree::
+   :maxdepth: 2
+
+   rockchip
doc/board/rockchip/rockchip.rst new file +128 -0

128 lines not on this page · raw message

Signature · 1 line
2.18.0.321.gffc6fa0e3
#18 lore raw

Re: [PATCH v4 7/7] doc: boards: Add rockchip documentation

Jagan,

Quoted 5 lines · Jagan Teki

Rockchip has documentation file, doc/README.rockchip but which is not so readable to add or understand the existing contents. Even the format that support is legacy readme in U-Boot.

Quoted 7 lines

Add rockchip specific documentation file using new rst format, which describes the information about Rockchip supported boards and it's usage steps.

Added minimal information about rk3288, rk3328, rk3368 and rk3399 boards and usage. This would indeed updated further based on the requirements and updates.

This patch move small part of content from doc/README.rockchip, I would prefer

to have a more complete version before it move to new document.

Thanks,

- Kever

Quoted 150 lines
Cc Kever Yang <[email protected]>
Cc Matwey V. Kornilov <[email protected]>
---
  doc/board/rockchip/index.rst    |  10 +++
  doc/board/rockchip/rockchip.rst | 128 ++++++++++++++++++++++++++++++++
  2 files changed, 138 insertions(+)

create mode 100644 doc/board/rockchip/index.rst create mode 100644 doc/board/rockchip/rockchip.rst

doc/board/rockchip/index.rst new file +10 -0
new file mode 100644
index 0000000000..0c377e9bbb
@@ -0,0 +1,10 @@
+.. SPDX-License-Identifier: GPL-2.0+
+.. Copyright (C) 2019 Jagan Teki <[email protected]>
+
+Rockchip
+========
+
+.. toctree::
+   :maxdepth: 2
+
+   rockchip
doc/board/rockchip/rockchip.rst new file +118 -0
new file mode 100644
index 0000000000..625155e432
@@ -0,0 +1,128 @@
+.. SPDX-License-Identifier: GPL-2.0+
+.. Copyright (C) 2019 Jagan Teki <[email protected]>
+
+ROCKCHIP
+========
+
+About this
+----------
+
+This document describes the information about Rockchip supported boards
+and it's usage steps.
+
+Rockchip boards
+---------------
+
+Rockchip is SoC solutions provider for tablets & PCs, streaming media
+TV boxes, AI audio & vision, IoT hardware.
+
+A wide range of Rockchip SoCs with associated boardsare supported in
+mainline U-Boot.
+
+List of mainline supported rockchip boards:
+
+* rk3288
+     - Evb-RK3288
+     - Firefly-RK3288
+     - mqmaker MiQi
+     - Phytec RK3288 PCM-947
+     - PopMetal-RK3288
+     - Radxa Rock 2 Square
+     - Tinker-RK3288
+     - Google Jerry
+     - Google Mickey
+     - Google Minnie
+     - Google Speedy
+     - Amarula Vyasa-RK3288
+* rk3328
+     - Rockchip RK3328 EVB
+     - Pine64 Rock64
+* rk3368
+     - GeekBox
+     - PX5 EVB
+     - Rockchip sheep board
+     - Theobroma Systems RK3368-uQ7 SoM
+* rk3399
+     - 96boards RK3399 Ficus
+     - 96boards Rock960
+     - Firefly-RK3399 Board
+     - Firefly ROC-RK3399-PC Board
+     - FriendlyElec NanoPC-T4
+     - FriendlyElec NanoPi M4
+     - FriendlyARM NanoPi NEO4
+     - Google Bob
+     - Khadas Edge
+     - Khadas Edge-Captain
+     - Khadas Edge-V
+     - Orange Pi RK3399 Board
+     - Pine64 RockPro64
+     - Radxa ROCK Pi 4
+     - Rockchip RK3399 Evaluation Board
+     - Theobroma Systems RK3399-Q7 SoM
+
+Building
+--------
+
+TF-A
+^^^^
+
+TF-A would require to build for ARM64 Rockchip SoCs platforms.
+
+To build TF-A::
+
+        git clone https://github.com/ARM-software/arm-trusted-firmware.git
+        cd arm-trusted-firmware
+        make realclean
+        make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399
+
+Specify the PLAT= with desired rockchip platform to build TF-A for.
+
+U-Boot
+^^^^^^
+
+To build rk3328 boards::
+
+        export BL31=/path/to/arm-trusted-firmware/to/bl31.elf
+        make evb-rk3328_defconfig
+        make
+
+To build rk3288 boards::
+
+        make evb-rk3288_defconfig
+        make
+
+To build rk3368 boards::
+
+        export BL31=/path/to/arm-trusted-firmware/to/bl31.elf
+        make evb-px5_defconfig
+        make
+
+To build rk3399 boards::
+
+        export BL31=/path/to/arm-trusted-firmware/to/bl31.elf
+        make evb-rk3399_defconfig
+        make
+
+Flashing
+--------
+
+SD Card
+^^^^^^^
+
+All rockchip platforms, except rk3128 (which doesn't use SPL) are now
+supporting single boot image using binman and pad_cat.
+
+To write an image that boots from an SD card (assumed to be /dev/sda)::
+
+        sudo dd if=u-boot-rockchip.bin of=/dev/sda seek=64
+        sync

doc/board/rockchip/rockchip.rst line 128

Quoted 10 lines
doc/board/rockchip/rockchip.rst new file +10 -0
+
+TODO
+----
+
+- Add rockchip idbloader image building
+- Describe steps for eMMC flashing
+- Add missing SoC's with it boards list
+
+.. Jagan Teki <[email protected]>
+.. Thu Oct 17 22:36:14 IST 2019

_______________________________________________
U-Boot mailing list
[email protected]
https://lists.denx.de/listinfo/u-boot

#19 lore raw

Re: [PATCH v4 7/7] doc: boards: Add rockchip documentation

I tried, it is hard to move all the data from doc/README.rochchip in one instance. I will mark it my TODO, it require close attention of existing doc to move. Please merge this an initial step.

Quoted 181 lines · Kever Yang,

Jagan,

Quoted 5 lines · Jagan Teki

Rockchip has documentation file, doc/README.rockchip but which is not so readable to add or understand the existing contents. Even the format that support is legacy readme in U-Boot.

Quoted 7 lines

Add rockchip specific documentation file using new rst format, which describes the information about Rockchip supported boards and it's usage steps.

Added minimal information about rk3288, rk3328, rk3368 and rk3399 boards and usage. This would indeed updated further based on the requirements and updates.

This patch move small part of content from doc/README.rockchip, I would prefer

to have a more complete version before it move to new document.

Thanks,

- Kever

Review

Quoted 27 lines
Cc Kever Yang <[email protected]>
Cc Matwey V. Kornilov <[email protected]>
---
  doc/board/rockchip/index.rst    |  10 +++
  doc/board/rockchip/rockchip.rst | 128 ++++++++++++++++++++++++++++++++
  2 files changed, 138 insertions(+)

create mode 100644 doc/board/rockchip/index.rst create mode 100644 doc/board/rockchip/rockchip.rst

doc/board/rockchip/index.rst new file +10 -0
new file mode 100644
index 0000000000..0c377e9bbb
@@ -0,0 +1,10 @@
+.. SPDX-License-Identifier: GPL-2.0+
+.. Copyright (C) 2019 Jagan Teki <[email protected]>
+
+Rockchip
+========
+
+.. toctree::
+   :maxdepth: 2
+
+   rockchip
(quoted diff) +0 -0

b/doc/board/rockchip/rockchip.rst

Quoted 68 lines

new file mode 100644
index 0000000000..625155e432

doc/board/rockchip/rockchip.rst new file +63 -0
@@ -0,0 +1,128 @@
+.. SPDX-License-Identifier: GPL-2.0+
+.. Copyright (C) 2019 Jagan Teki <[email protected]>
+
+ROCKCHIP
+========
+
+About this
+----------
+
+This document describes the information about Rockchip supported boards
+and it's usage steps.
+
+Rockchip boards
+---------------
+
+Rockchip is SoC solutions provider for tablets & PCs, streaming media
+TV boxes, AI audio & vision, IoT hardware.
+
+A wide range of Rockchip SoCs with associated boardsare supported in
+mainline U-Boot.
+
+List of mainline supported rockchip boards:
+
+* rk3288
+     - Evb-RK3288
+     - Firefly-RK3288
+     - mqmaker MiQi
+     - Phytec RK3288 PCM-947
+     - PopMetal-RK3288
+     - Radxa Rock 2 Square
+     - Tinker-RK3288
+     - Google Jerry
+     - Google Mickey
+     - Google Minnie
+     - Google Speedy
+     - Amarula Vyasa-RK3288
+* rk3328
+     - Rockchip RK3328 EVB
+     - Pine64 Rock64
+* rk3368
+     - GeekBox
+     - PX5 EVB
+     - Rockchip sheep board
+     - Theobroma Systems RK3368-uQ7 SoM
+* rk3399
+     - 96boards RK3399 Ficus
+     - 96boards Rock960
+     - Firefly-RK3399 Board
+     - Firefly ROC-RK3399-PC Board
+     - FriendlyElec NanoPC-T4
+     - FriendlyElec NanoPi M4
+     - FriendlyARM NanoPi NEO4
+     - Google Bob
+     - Khadas Edge
+     - Khadas Edge-Captain
+     - Khadas Edge-V
+     - Orange Pi RK3399 Board
+     - Pine64 RockPro64
+     - Radxa ROCK Pi 4
+     - Rockchip RK3399 Evaluation Board
+     - Theobroma Systems RK3399-Q7 SoM
+
+Building

doc/board/rockchip/rockchip.rst line 73

Quoted 10 lines
doc/board/rockchip/rockchip.rst new file +10 -0
+--------
+
+TF-A
+^^^^
+
+TF-A would require to build for ARM64 Rockchip SoCs platforms.
+
+To build TF-A::
+
+        git clone

https://github.com/ARM-software/arm-trusted-firmware.git

Quoted 47 lines
doc/board/rockchip/rockchip.rst new file +47 -0
+        cd arm-trusted-firmware
+        make realclean
+        make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399
+
+Specify the PLAT= with desired rockchip platform to build TF-A for.
+
+U-Boot
+^^^^^^
+
+To build rk3328 boards::
+
+        export BL31=/path/to/arm-trusted-firmware/to/bl31.elf
+        make evb-rk3328_defconfig
+        make
+
+To build rk3288 boards::
+
+        make evb-rk3288_defconfig
+        make
+
+To build rk3368 boards::
+
+        export BL31=/path/to/arm-trusted-firmware/to/bl31.elf
+        make evb-px5_defconfig
+        make
+
+To build rk3399 boards::
+
+        export BL31=/path/to/arm-trusted-firmware/to/bl31.elf
+        make evb-rk3399_defconfig
+        make
+
+Flashing
+--------
+
+SD Card
+^^^^^^^
+
+All rockchip platforms, except rk3128 (which doesn't use SPL) are now
+supporting single boot image using binman and pad_cat.
+
+To write an image that boots from an SD card (assumed to be /dev/sda)::
+
+        sudo dd if=u-boot-rockchip.bin of=/dev/sda seek=64
+        sync
+
+TODO
Quoted 11 lines

doc/board/rockchip/rockchip.rst line 128

Quoted 8 lines
doc/board/rockchip/rockchip.rst new file +8 -0
+----
+
+- Add rockchip idbloader image building
+- Describe steps for eMMC flashing
+- Add missing SoC's with it boards list
+
+.. Jagan Teki <[email protected]>
+.. Thu Oct 17 22:36:14 IST 2019

_______________________________________________
U-Boot mailing list
[email protected]
https://lists.denx.de/listinfo/u-boot