All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/7] rockchip: Add Binman support
@ 2019-12-30  8:28 ` Jagan Teki
  0 siblings, 0 replies; 28+ messages in thread
From: Jagan Teki @ 2019-12-30  8:28 UTC (permalink / raw)
  To: Kever Yang, Simon Glass, Philipp Tomsich
  Cc: Jagan Teki, u-boot-0aAXYlwwYIKGBzrmiIFOJg,
	linux-amarula-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/,
	Akash Gajjar, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

This is v5 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 v5:
- collect kever review tag
- drop idbloader.img from clean target
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

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

Any inputs?
Jagan.

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                            |  39 +++++++--
 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, 204 insertions(+), 7 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

-- 
2.18.0.321.gffc6fa0e3

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH v5 0/7] rockchip: Add Binman support
@ 2019-12-30  8:28 ` Jagan Teki
  0 siblings, 0 replies; 28+ messages in thread
From: Jagan Teki @ 2019-12-30  8:28 UTC (permalink / raw)
  To: u-boot

This is v5 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 v5:
- collect kever review tag
- drop idbloader.img from clean target
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

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

Any inputs?
Jagan.

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                            |  39 +++++++--
 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, 204 insertions(+), 7 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

-- 
2.18.0.321.gffc6fa0e3

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH v5 1/7] Makefile: Add rockchip image type
  2019-12-30  8:28 ` Jagan Teki
@ 2019-12-30  8:28     ` Jagan Teki
  -1 siblings, 0 replies; 28+ messages in thread
From: Jagan Teki @ 2019-12-30  8:28 UTC (permalink / raw)
  To: Kever Yang, Simon Glass, Philipp Tomsich
  Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	u-boot-0aAXYlwwYIKGBzrmiIFOJg, Matwey V . Kornilov, Jagan Teki,
	linux-amarula-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/,
	Akash Gajjar

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 <kever.yang-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
Cc: Matwey V. Kornilov <matwey.kornilov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Signed-off-by: Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
Reviewed-by: Kever Yang <kever.yang-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
---
 Makefile | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index e20a206239..9998d238f3 100644
--- a/Makefile
+++ b/Makefile
@@ -1374,7 +1374,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
-- 
2.18.0.321.gffc6fa0e3

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v5 1/7] Makefile: Add rockchip image type
@ 2019-12-30  8:28     ` Jagan Teki
  0 siblings, 0 replies; 28+ messages in thread
From: Jagan Teki @ 2019-12-30  8:28 UTC (permalink / raw)
  To: u-boot

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 <kever.yang@rock-chips.com>
Cc: Matwey V. Kornilov <matwey.kornilov@gmail.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
---
 Makefile | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index e20a206239..9998d238f3 100644
--- a/Makefile
+++ b/Makefile
@@ -1374,7 +1374,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
-- 
2.18.0.321.gffc6fa0e3

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v5 2/7] Makefile: rockchip: Suffix platform type with tpl name
  2019-12-30  8:28 ` Jagan Teki
@ 2019-12-30  8:28     ` Jagan Teki
  -1 siblings, 0 replies; 28+ messages in thread
From: Jagan Teki @ 2019-12-30  8:28 UTC (permalink / raw)
  To: Kever Yang, Simon Glass, Philipp Tomsich
  Cc: Jagan Teki, u-boot-0aAXYlwwYIKGBzrmiIFOJg,
	linux-amarula-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/,
	Akash Gajjar, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

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.

Signed-off-by: Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
Reviewed-by: Kever Yang <kever.yang-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 9998d238f3..e519103be4 100644
--- a/Makefile
+++ b/Makefile
@@ -1382,10 +1382,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
 
-- 
2.18.0.321.gffc6fa0e3

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v5 2/7] Makefile: rockchip: Suffix platform type with tpl name
@ 2019-12-30  8:28     ` Jagan Teki
  0 siblings, 0 replies; 28+ messages in thread
From: Jagan Teki @ 2019-12-30  8:28 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 9998d238f3..e519103be4 100644
--- a/Makefile
+++ b/Makefile
@@ -1382,10 +1382,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
 
-- 
2.18.0.321.gffc6fa0e3

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v5 3/7] Makefile: rockchip: Support SPL-alone mkimage
  2019-12-30  8:28 ` Jagan Teki
@ 2019-12-30  8:28     ` Jagan Teki
  -1 siblings, 0 replies; 28+ messages in thread
From: Jagan Teki @ 2019-12-30  8:28 UTC (permalink / raw)
  To: Kever Yang, Simon Glass, Philipp Tomsich
  Cc: Jagan Teki, u-boot-0aAXYlwwYIKGBzrmiIFOJg,
	linux-amarula-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/,
	Akash Gajjar, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

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.

Signed-off-by: Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
Reviewed-by: Kever Yang <kever.yang-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
---
 Makefile | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index e519103be4..d8a0f68883 100644
--- a/Makefile
+++ b/Makefile
@@ -908,7 +908,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
 
@@ -1382,11 +1382,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)
-- 
2.18.0.321.gffc6fa0e3

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v5 3/7] Makefile: rockchip: Support SPL-alone mkimage
@ 2019-12-30  8:28     ` Jagan Teki
  0 siblings, 0 replies; 28+ messages in thread
From: Jagan Teki @ 2019-12-30  8:28 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
---
 Makefile | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index e519103be4..d8a0f68883 100644
--- a/Makefile
+++ b/Makefile
@@ -908,7 +908,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
 
@@ -1382,11 +1382,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)
-- 
2.18.0.321.gffc6fa0e3

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v5 4/7] Makefile: rockchip: Use u-boot preferred spl name
  2019-12-30  8:28 ` Jagan Teki
@ 2019-12-30  8:28     ` Jagan Teki
  -1 siblings, 0 replies; 28+ messages in thread
From: Jagan Teki @ 2019-12-30  8:28 UTC (permalink / raw)
  To: Kever Yang, Simon Glass, Philipp Tomsich
  Cc: Jagan Teki, u-boot-0aAXYlwwYIKGBzrmiIFOJg,
	linux-amarula-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/,
	Akash Gajjar, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

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.

Signed-off-by: Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
---
 Makefile | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index d8a0f68883..b48693e560 100644
--- a/Makefile
+++ b/Makefile
@@ -909,7 +909,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)
@@ -1387,11 +1387,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
 
@@ -1943,8 +1943,7 @@ CLEAN_DIRS  += $(MODVERDIR) \
 CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h tools/version.h \
 	       boot* u-boot* MLO* SPL System.map fit-dtb.blob* \
 	       u-boot-ivt.img.log u-boot-dtb.imx.log SPL.log u-boot.imx.log \
-	       lpc32xx-* bl31.c bl31.elf bl31_*.bin image.map tispl.bin* \
-	       idbloader.img
+	       lpc32xx-* bl31.c bl31.elf bl31_*.bin image.map tispl.bin*
 
 # Directories & files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config include/generated spl tpl \
-- 
2.18.0.321.gffc6fa0e3

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v5 4/7] Makefile: rockchip: Use u-boot preferred spl name
@ 2019-12-30  8:28     ` Jagan Teki
  0 siblings, 0 replies; 28+ messages in thread
From: Jagan Teki @ 2019-12-30  8:28 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
 Makefile | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index d8a0f68883..b48693e560 100644
--- a/Makefile
+++ b/Makefile
@@ -909,7 +909,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)
@@ -1387,11 +1387,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
 
@@ -1943,8 +1943,7 @@ CLEAN_DIRS  += $(MODVERDIR) \
 CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h tools/version.h \
 	       boot* u-boot* MLO* SPL System.map fit-dtb.blob* \
 	       u-boot-ivt.img.log u-boot-dtb.imx.log SPL.log u-boot.imx.log \
-	       lpc32xx-* bl31.c bl31.elf bl31_*.bin image.map tispl.bin* \
-	       idbloader.img
+	       lpc32xx-* bl31.c bl31.elf bl31_*.bin image.map tispl.bin*
 
 # Directories & files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config include/generated spl tpl \
-- 
2.18.0.321.gffc6fa0e3

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v5 5/7] arm: dts: rk3036: Add rk3036-u-boot.dtsi
  2019-12-30  8:28 ` Jagan Teki
@ 2019-12-30  8:28     ` Jagan Teki
  -1 siblings, 0 replies; 28+ messages in thread
From: Jagan Teki @ 2019-12-30  8:28 UTC (permalink / raw)
  To: Kever Yang, Simon Glass, Philipp Tomsich
  Cc: Jagan Teki, u-boot-0aAXYlwwYIKGBzrmiIFOJg,
	linux-amarula-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/,
	Akash Gajjar, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

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.

Signed-off-by: Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
Reviewed-by: Kever Yang <kever.yang-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
---
 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

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

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v5 5/7] arm: dts: rk3036: Add rk3036-u-boot.dtsi
@ 2019-12-30  8:28     ` Jagan Teki
  0 siblings, 0 replies; 28+ messages in thread
From: Jagan Teki @ 2019-12-30  8:28 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
---
 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

diff --git a/arch/arm/dts/rk3036-sdk-u-boot.dtsi b/arch/arm/dts/rk3036-sdk-u-boot.dtsi
index 6f15f4a8ec..754800c6e6 100644
--- a/arch/arm/dts/rk3036-sdk-u-boot.dtsi
+++ b/arch/arm/dts/rk3036-sdk-u-boot.dtsi
@@ -1,3 +1,5 @@
+#include "rk3036-u-boot.dtsi"
+
 &uart2 {
 	u-boot,dm-pre-reloc;
 };
diff --git a/arch/arm/dts/rk3036-u-boot.dtsi b/arch/arm/dts/rk3036-u-boot.dtsi
new file mode 100644
index 0000000000..1e7d079315
--- /dev/null
+++ b/arch/arm/dts/rk3036-u-boot.dtsi
@@ -0,0 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com>
+ */
-- 
2.18.0.321.gffc6fa0e3

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v5 6/7] rockchip: Add Single boot image (with binman, pad_cat)
  2019-12-30  8:28 ` Jagan Teki
@ 2019-12-30  8:28     ` Jagan Teki
  -1 siblings, 0 replies; 28+ messages in thread
From: Jagan Teki @ 2019-12-30  8:28 UTC (permalink / raw)
  To: Kever Yang, Simon Glass, Philipp Tomsich
  Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	u-boot-0aAXYlwwYIKGBzrmiIFOJg, Matwey V . Kornilov, Jagan Teki,
	linux-amarula-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/,
	Akash Gajjar

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 <kever.yang@rock-chips.com>
Cc: Matwey V. Kornilov <matwey.kornilov@gmail.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
---
 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

diff --git a/Makefile b/Makefile
index b48693e560..d5b6c45c89 100644
--- a/Makefile
+++ b/Makefile
@@ -909,7 +909,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)
@@ -1387,15 +1387,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)
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.dtsi
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 <jagan@amarulasolutions.com>
  */
+
+#include "rockchip-u-boot.dtsi"
diff --git a/arch/arm/dts/rk3288-u-boot.dtsi b/arch/arm/dts/rk3288-u-boot.dtsi
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
  */
 
+#include "rockchip-u-boot.dtsi"
+
 / {
 	chosen {
 		u-boot,spl-boot-order = \
diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
new file mode 100644
index 0000000000..bc0b1412a2
--- /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 <jagan@amarulasolutions.com>
+ */
+
+#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>;
+		};
+	};
+};
diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h
index 68e1105a4b..d7f5ca9fa4 100644
--- a/include/configs/rockchip-common.h
+++ b/include/configs/rockchip-common.h
@@ -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) */
-- 
2.18.0.321.gffc6fa0e3


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v5 6/7] rockchip: Add Single boot image (with binman, pad_cat)
@ 2019-12-30  8:28     ` Jagan Teki
  0 siblings, 0 replies; 28+ messages in thread
From: Jagan Teki @ 2019-12-30  8:28 UTC (permalink / raw)
  To: u-boot

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 <kever.yang@rock-chips.com>
Cc: Matwey V. Kornilov <matwey.kornilov@gmail.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
---
 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

diff --git a/Makefile b/Makefile
index b48693e560..d5b6c45c89 100644
--- a/Makefile
+++ b/Makefile
@@ -909,7 +909,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)
@@ -1387,15 +1387,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)
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.dtsi
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 <jagan@amarulasolutions.com>
  */
+
+#include "rockchip-u-boot.dtsi"
diff --git a/arch/arm/dts/rk3288-u-boot.dtsi b/arch/arm/dts/rk3288-u-boot.dtsi
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
  */
 
+#include "rockchip-u-boot.dtsi"
+
 / {
 	chosen {
 		u-boot,spl-boot-order = \
diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
new file mode 100644
index 0000000000..bc0b1412a2
--- /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 <jagan@amarulasolutions.com>
+ */
+
+#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>;
+		};
+	};
+};
diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h
index 68e1105a4b..d7f5ca9fa4 100644
--- a/include/configs/rockchip-common.h
+++ b/include/configs/rockchip-common.h
@@ -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) */
-- 
2.18.0.321.gffc6fa0e3

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v5 7/7] doc: boards: Add rockchip documentation
  2019-12-30  8:28 ` Jagan Teki
@ 2019-12-30  8:28     ` Jagan Teki
  -1 siblings, 0 replies; 28+ messages in thread
From: Jagan Teki @ 2019-12-30  8:28 UTC (permalink / raw)
  To: Kever Yang, Simon Glass, Philipp Tomsich
  Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	u-boot-0aAXYlwwYIKGBzrmiIFOJg, Matwey V . Kornilov, Jagan Teki,
	linux-amarula-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/,
	Akash Gajjar

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.

Cc: Kever Yang <kever.yang-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
Cc: Matwey V. Kornilov <matwey.kornilov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Signed-off-by: Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
---
 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

diff --git a/doc/board/rockchip/index.rst b/doc/board/rockchip/index.rst
new file mode 100644
index 0000000000..0c377e9bbb
--- /dev/null
+++ b/doc/board/rockchip/index.rst
@@ -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
diff --git a/doc/board/rockchip/rockchip.rst b/doc/board/rockchip/rockchip.rst
new file mode 100644
index 0000000000..625155e432
--- /dev/null
+++ b/doc/board/rockchip/rockchip.rst
@@ -0,0 +1,128 @@
+.. SPDX-License-Identifier: GPL-2.0+
+.. Copyright (C) 2019 Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
+
+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
+
+TODO
+----
+
+- Add rockchip idbloader image building
+- Describe steps for eMMC flashing
+- Add missing SoC's with it boards list
+
+.. Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
+.. Thu Oct 17 22:36:14 IST 2019
-- 
2.18.0.321.gffc6fa0e3

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v5 7/7] doc: boards: Add rockchip documentation
@ 2019-12-30  8:28     ` Jagan Teki
  0 siblings, 0 replies; 28+ messages in thread
From: Jagan Teki @ 2019-12-30  8:28 UTC (permalink / raw)
  To: u-boot

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.

Cc: Kever Yang <kever.yang@rock-chips.com>
Cc: Matwey V. Kornilov <matwey.kornilov@gmail.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
 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

diff --git a/doc/board/rockchip/index.rst b/doc/board/rockchip/index.rst
new file mode 100644
index 0000000000..0c377e9bbb
--- /dev/null
+++ b/doc/board/rockchip/index.rst
@@ -0,0 +1,10 @@
+.. SPDX-License-Identifier: GPL-2.0+
+.. Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com>
+
+Rockchip
+========
+
+.. toctree::
+   :maxdepth: 2
+
+   rockchip
diff --git a/doc/board/rockchip/rockchip.rst b/doc/board/rockchip/rockchip.rst
new file mode 100644
index 0000000000..625155e432
--- /dev/null
+++ b/doc/board/rockchip/rockchip.rst
@@ -0,0 +1,128 @@
+.. SPDX-License-Identifier: GPL-2.0+
+.. Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com>
+
+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
+
+TODO
+----
+
+- Add rockchip idbloader image building
+- Describe steps for eMMC flashing
+- Add missing SoC's with it boards list
+
+.. Jagan Teki <jagan@amarulasolutions.com>
+.. Thu Oct 17 22:36:14 IST 2019
-- 
2.18.0.321.gffc6fa0e3

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* Re: [PATCH v5 7/7] doc: boards: Add rockchip documentation
  2019-12-30  8:28     ` Jagan Teki
@ 2019-12-30  8:41       ` Matwey V. Kornilov
  -1 siblings, 0 replies; 28+ messages in thread
From: Matwey V. Kornilov @ 2019-12-30  8:41 UTC (permalink / raw)
  To: Jagan Teki
  Cc: U-Boot Mailing List, open list:ARM/Rockchip SoC support,
	Akash Gajjar, linux-amarula

Hello,

Thank you for the patch set.
Currently, I have the following concern about documentation and
overall proposed u-boot deploy procedure.

There is a use case, when I have to use Rockchip proprietary TPL
binary and deploy it instead of u-boot's one together with u-boot SPL
and ITB images.
It is required for debugging purposes because unfortunately u-boot TPL
is usually less stable that proprietary one. And switching the TPL
binary is basically the first step when I see random strange crashes.
It is a good way to locate an issue origin.

Could we somehow ensure that this backup deployment plan is still
possible and documented in the text here? It would be great if the
user could learn the procedure from the text, not from the source
code, recovering correct offsets.

пн, 30 дек. 2019 г. в 11:28, Jagan Teki <jagan@amarulasolutions.com>:
>
> 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.
>
> Cc: Kever Yang <kever.yang@rock-chips.com>
> Cc: Matwey V. Kornilov <matwey.kornilov@gmail.com>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> ---
>  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
>
> diff --git a/doc/board/rockchip/index.rst b/doc/board/rockchip/index.rst
> new file mode 100644
> index 0000000000..0c377e9bbb
> --- /dev/null
> +++ b/doc/board/rockchip/index.rst
> @@ -0,0 +1,10 @@
> +.. SPDX-License-Identifier: GPL-2.0+
> +.. Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com>
> +
> +Rockchip
> +========
> +
> +.. toctree::
> +   :maxdepth: 2
> +
> +   rockchip
> diff --git a/doc/board/rockchip/rockchip.rst b/doc/board/rockchip/rockchip.rst
> new file mode 100644
> index 0000000000..625155e432
> --- /dev/null
> +++ b/doc/board/rockchip/rockchip.rst
> @@ -0,0 +1,128 @@
> +.. SPDX-License-Identifier: GPL-2.0+
> +.. Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com>
> +
> +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
> +
> +TODO
> +----
> +
> +- Add rockchip idbloader image building
> +- Describe steps for eMMC flashing
> +- Add missing SoC's with it boards list
> +
> +.. Jagan Teki <jagan@amarulasolutions.com>
> +.. Thu Oct 17 22:36:14 IST 2019
> --
> 2.18.0.321.gffc6fa0e3
>


-- 
With best regards,
Matwey V. Kornilov

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH v5 7/7] doc: boards: Add rockchip documentation
@ 2019-12-30  8:41       ` Matwey V. Kornilov
  0 siblings, 0 replies; 28+ messages in thread
From: Matwey V. Kornilov @ 2019-12-30  8:41 UTC (permalink / raw)
  To: u-boot

Hello,

Thank you for the patch set.
Currently, I have the following concern about documentation and
overall proposed u-boot deploy procedure.

There is a use case, when I have to use Rockchip proprietary TPL
binary and deploy it instead of u-boot's one together with u-boot SPL
and ITB images.
It is required for debugging purposes because unfortunately u-boot TPL
is usually less stable that proprietary one. And switching the TPL
binary is basically the first step when I see random strange crashes.
It is a good way to locate an issue origin.

Could we somehow ensure that this backup deployment plan is still
possible and documented in the text here? It would be great if the
user could learn the procedure from the text, not from the source
code, recovering correct offsets.

пн, 30 дек. 2019 г. в 11:28, Jagan Teki <jagan@amarulasolutions.com>:
>
> 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.
>
> Cc: Kever Yang <kever.yang@rock-chips.com>
> Cc: Matwey V. Kornilov <matwey.kornilov@gmail.com>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> ---
>  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
>
> diff --git a/doc/board/rockchip/index.rst b/doc/board/rockchip/index.rst
> new file mode 100644
> index 0000000000..0c377e9bbb
> --- /dev/null
> +++ b/doc/board/rockchip/index.rst
> @@ -0,0 +1,10 @@
> +.. SPDX-License-Identifier: GPL-2.0+
> +.. Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com>
> +
> +Rockchip
> +========
> +
> +.. toctree::
> +   :maxdepth: 2
> +
> +   rockchip
> diff --git a/doc/board/rockchip/rockchip.rst b/doc/board/rockchip/rockchip.rst
> new file mode 100644
> index 0000000000..625155e432
> --- /dev/null
> +++ b/doc/board/rockchip/rockchip.rst
> @@ -0,0 +1,128 @@
> +.. SPDX-License-Identifier: GPL-2.0+
> +.. Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com>
> +
> +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
> +
> +TODO
> +----
> +
> +- Add rockchip idbloader image building
> +- Describe steps for eMMC flashing
> +- Add missing SoC's with it boards list
> +
> +.. Jagan Teki <jagan@amarulasolutions.com>
> +.. Thu Oct 17 22:36:14 IST 2019
> --
> 2.18.0.321.gffc6fa0e3
>


-- 
With best regards,
Matwey V. Kornilov

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v5 7/7] doc: boards: Add rockchip documentation
  2019-12-30  8:41       ` Matwey V. Kornilov
@ 2019-12-30  8:59           ` Jagan Teki
  -1 siblings, 0 replies; 28+ messages in thread
From: Jagan Teki @ 2019-12-30  8:59 UTC (permalink / raw)
  To: Matwey V. Kornilov
  Cc: U-Boot Mailing List, Simon Glass, Kever Yang,
	open list:ARM/Rockchip SoC support, Akash Gajjar,
	Philipp Tomsich, linux-amarula

Hi,

On Mon, Dec 30, 2019 at 2:11 PM Matwey V. Kornilov
<matwey.kornilov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> Hello,
>
> Thank you for the patch set.
> Currently, I have the following concern about documentation and
> overall proposed u-boot deploy procedure.
>
> There is a use case, when I have to use Rockchip proprietary TPL
> binary and deploy it instead of u-boot's one together with u-boot SPL
> and ITB images.
> It is required for debugging purposes because unfortunately u-boot TPL
> is usually less stable that proprietary one. And switching the TPL
> binary is basically the first step when I see random strange crashes.
> It is a good way to locate an issue origin.
>
> Could we somehow ensure that this backup deployment plan is still
> possible and documented in the text here? It would be great if the
> user could learn the procedure from the text, not from the source
> code, recovering correct offsets.

You mean to say rkbin => SPL => U-Boot proper ? if yes, I do agree
with this point and it is worth to document it as well. Kever, will
that be okay for you?

Jagan.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH v5 7/7] doc: boards: Add rockchip documentation
@ 2019-12-30  8:59           ` Jagan Teki
  0 siblings, 0 replies; 28+ messages in thread
From: Jagan Teki @ 2019-12-30  8:59 UTC (permalink / raw)
  To: u-boot

Hi,

On Mon, Dec 30, 2019 at 2:11 PM Matwey V. Kornilov
<matwey.kornilov@gmail.com> wrote:
>
> Hello,
>
> Thank you for the patch set.
> Currently, I have the following concern about documentation and
> overall proposed u-boot deploy procedure.
>
> There is a use case, when I have to use Rockchip proprietary TPL
> binary and deploy it instead of u-boot's one together with u-boot SPL
> and ITB images.
> It is required for debugging purposes because unfortunately u-boot TPL
> is usually less stable that proprietary one. And switching the TPL
> binary is basically the first step when I see random strange crashes.
> It is a good way to locate an issue origin.
>
> Could we somehow ensure that this backup deployment plan is still
> possible and documented in the text here? It would be great if the
> user could learn the procedure from the text, not from the source
> code, recovering correct offsets.

You mean to say rkbin => SPL => U-Boot proper ? if yes, I do agree
with this point and it is worth to document it as well. Kever, will
that be okay for you?

Jagan.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v5 7/7] doc: boards: Add rockchip documentation
  2019-12-30  8:59           ` Jagan Teki
@ 2019-12-31  7:50             ` Matwey V. Kornilov
  -1 siblings, 0 replies; 28+ messages in thread
From: Matwey V. Kornilov @ 2019-12-31  7:50 UTC (permalink / raw)
  To: Jagan Teki
  Cc: U-Boot Mailing List, open list:ARM/Rockchip SoC support,
	Akash Gajjar, linux-amarula

пн, 30 дек. 2019 г. в 11:59, Jagan Teki <jagan@amarulasolutions.com>:
>
> Hi,
>
> On Mon, Dec 30, 2019 at 2:11 PM Matwey V. Kornilov
> <matwey.kornilov@gmail.com> wrote:
> >
> > Hello,
> >
> > Thank you for the patch set.
> > Currently, I have the following concern about documentation and
> > overall proposed u-boot deploy procedure.
> >
> > There is a use case, when I have to use Rockchip proprietary TPL
> > binary and deploy it instead of u-boot's one together with u-boot SPL
> > and ITB images.
> > It is required for debugging purposes because unfortunately u-boot TPL
> > is usually less stable that proprietary one. And switching the TPL
> > binary is basically the first step when I see random strange crashes.
> > It is a good way to locate an issue origin.
> >
> > Could we somehow ensure that this backup deployment plan is still
> > possible and documented in the text here? It would be great if the
> > user could learn the procedure from the text, not from the source
> > code, recovering correct offsets.
>
> You mean to say rkbin => SPL => U-Boot proper ? if yes, I do agree

Yes, I mean so.
I think it would be great to have something like the section
describing where do the things came from and the layout which is under
the hood.

> with this point and it is worth to document it as well. Kever, will
> that be okay for you?
>
> Jagan.


--
With best regards,
Matwey V. Kornilov

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH v5 7/7] doc: boards: Add rockchip documentation
@ 2019-12-31  7:50             ` Matwey V. Kornilov
  0 siblings, 0 replies; 28+ messages in thread
From: Matwey V. Kornilov @ 2019-12-31  7:50 UTC (permalink / raw)
  To: u-boot

пн, 30 дек. 2019 г. в 11:59, Jagan Teki <jagan@amarulasolutions.com>:
>
> Hi,
>
> On Mon, Dec 30, 2019 at 2:11 PM Matwey V. Kornilov
> <matwey.kornilov@gmail.com> wrote:
> >
> > Hello,
> >
> > Thank you for the patch set.
> > Currently, I have the following concern about documentation and
> > overall proposed u-boot deploy procedure.
> >
> > There is a use case, when I have to use Rockchip proprietary TPL
> > binary and deploy it instead of u-boot's one together with u-boot SPL
> > and ITB images.
> > It is required for debugging purposes because unfortunately u-boot TPL
> > is usually less stable that proprietary one. And switching the TPL
> > binary is basically the first step when I see random strange crashes.
> > It is a good way to locate an issue origin.
> >
> > Could we somehow ensure that this backup deployment plan is still
> > possible and documented in the text here? It would be great if the
> > user could learn the procedure from the text, not from the source
> > code, recovering correct offsets.
>
> You mean to say rkbin => SPL => U-Boot proper ? if yes, I do agree

Yes, I mean so.
I think it would be great to have something like the section
describing where do the things came from and the layout which is under
the hood.

> with this point and it is worth to document it as well. Kever, will
> that be okay for you?
>
> Jagan.


--
With best regards,
Matwey V. Kornilov

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v5 6/7] rockchip: Add Single boot image (with binman, pad_cat)
  2019-12-30  8:28     ` Jagan Teki
@ 2019-12-31  7:54       ` Matwey V. Kornilov
  -1 siblings, 0 replies; 28+ messages in thread
From: Matwey V. Kornilov @ 2019-12-31  7:54 UTC (permalink / raw)
  To: Jagan Teki
  Cc: U-Boot Mailing List, open list:ARM/Rockchip SoC support,
	Akash Gajjar, linux-amarula

пн, 30 дек. 2019 г. в 11:28, Jagan Teki <jagan@amarulasolutions.com>:
>
> 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 <kever.yang@rock-chips.com>
> Cc: Matwey V. Kornilov <matwey.kornilov@gmail.com>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
> ---
>  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
>
> diff --git a/Makefile b/Makefile
> index b48693e560..d5b6c45c89 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -909,7 +909,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)
> @@ -1387,15 +1387,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)
> 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.dtsi
> 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 <jagan@amarulasolutions.com>
>   */
> +
> +#include "rockchip-u-boot.dtsi"
> diff --git a/arch/arm/dts/rk3288-u-boot.dtsi b/arch/arm/dts/rk3288-u-boot.dtsi
> 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
>   */
>
> +#include "rockchip-u-boot.dtsi"
> +
>  / {
>         chosen {
>                 u-boot,spl-boot-order = \
> diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
> new file mode 100644
> index 0000000000..bc0b1412a2
> --- /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 <jagan@amarulasolutions.com>
> + */
> +
> +#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>;
> +               };
> +       };
> +};
> diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h
> index 68e1105a4b..d7f5ca9fa4 100644
> --- a/include/configs/rockchip-common.h
> +++ b/include/configs/rockchip-common.h
> @@ -9,6 +9,8 @@
>
>  #define CONFIG_SYS_NS16550_MEM32
>
> +#define CONFIG_SPL_PAD_TO              8355840

I may be wrong, but shouldn't CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
be used here?

> +
>  #ifndef CONFIG_SPL_BUILD
>
>  /* First try to boot from SD (index 0), then eMMC (index 1) */
> --
> 2.18.0.321.gffc6fa0e3
>


-- 
With best regards,
Matwey V. Kornilov

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH v5 6/7] rockchip: Add Single boot image (with binman, pad_cat)
@ 2019-12-31  7:54       ` Matwey V. Kornilov
  0 siblings, 0 replies; 28+ messages in thread
From: Matwey V. Kornilov @ 2019-12-31  7:54 UTC (permalink / raw)
  To: u-boot

пн, 30 дек. 2019 г. в 11:28, Jagan Teki <jagan@amarulasolutions.com>:
>
> 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 <kever.yang@rock-chips.com>
> Cc: Matwey V. Kornilov <matwey.kornilov@gmail.com>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
> ---
>  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
>
> diff --git a/Makefile b/Makefile
> index b48693e560..d5b6c45c89 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -909,7 +909,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)
> @@ -1387,15 +1387,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)
> 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.dtsi
> 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 <jagan@amarulasolutions.com>
>   */
> +
> +#include "rockchip-u-boot.dtsi"
> diff --git a/arch/arm/dts/rk3288-u-boot.dtsi b/arch/arm/dts/rk3288-u-boot.dtsi
> 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
>   */
>
> +#include "rockchip-u-boot.dtsi"
> +
>  / {
>         chosen {
>                 u-boot,spl-boot-order = \
> diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
> new file mode 100644
> index 0000000000..bc0b1412a2
> --- /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 <jagan@amarulasolutions.com>
> + */
> +
> +#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>;
> +               };
> +       };
> +};
> diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h
> index 68e1105a4b..d7f5ca9fa4 100644
> --- a/include/configs/rockchip-common.h
> +++ b/include/configs/rockchip-common.h
> @@ -9,6 +9,8 @@
>
>  #define CONFIG_SYS_NS16550_MEM32
>
> +#define CONFIG_SPL_PAD_TO              8355840

I may be wrong, but shouldn't CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
be used here?

> +
>  #ifndef CONFIG_SPL_BUILD
>
>  /* First try to boot from SD (index 0), then eMMC (index 1) */
> --
> 2.18.0.321.gffc6fa0e3
>


-- 
With best regards,
Matwey V. Kornilov

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v5 6/7] rockchip: Add Single boot image (with binman, pad_cat)
  2019-12-31  7:54       ` Matwey V. Kornilov
@ 2019-12-31  8:04         ` Matwey V. Kornilov
  -1 siblings, 0 replies; 28+ messages in thread
From: Matwey V. Kornilov @ 2019-12-31  8:04 UTC (permalink / raw)
  To: Jagan Teki
  Cc: U-Boot Mailing List, open list:ARM/Rockchip SoC support,
	Akash Gajjar, linux-amarula

вт, 31 дек. 2019 г. в 10:54, Matwey V. Kornilov <matwey.kornilov@gmail.com>:
>
> пн, 30 дек. 2019 г. в 11:28, Jagan Teki <jagan@amarulasolutions.com>:
> >
> > 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 <kever.yang@rock-chips.com>
> > Cc: Matwey V. Kornilov <matwey.kornilov@gmail.com>
> > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
> > ---
> >  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
> >
> > diff --git a/Makefile b/Makefile
> > index b48693e560..d5b6c45c89 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -909,7 +909,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)
> > @@ -1387,15 +1387,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)
> > 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.dtsi
> > 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 <jagan@amarulasolutions.com>
> >   */
> > +
> > +#include "rockchip-u-boot.dtsi"
> > diff --git a/arch/arm/dts/rk3288-u-boot.dtsi b/arch/arm/dts/rk3288-u-boot.dtsi
> > 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
> >   */
> >
> > +#include "rockchip-u-boot.dtsi"
> > +
> >  / {
> >         chosen {
> >                 u-boot,spl-boot-order = \
> > diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
> > new file mode 100644
> > index 0000000000..bc0b1412a2
> > --- /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 <jagan@amarulasolutions.com>
> > + */
> > +
> > +#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>;
> > +               };
> > +       };
> > +};
> > diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h
> > index 68e1105a4b..d7f5ca9fa4 100644
> > --- a/include/configs/rockchip-common.h
> > +++ b/include/configs/rockchip-common.h
> > @@ -9,6 +9,8 @@
> >
> >  #define CONFIG_SYS_NS16550_MEM32
> >
> > +#define CONFIG_SPL_PAD_TO              8355840
>
> I may be wrong, but shouldn't CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
> be used here?

I.e.

#define CONFIG_SPL_PAD_TO ((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512)

>
> > +
> >  #ifndef CONFIG_SPL_BUILD
> >
> >  /* First try to boot from SD (index 0), then eMMC (index 1) */
> > --
> > 2.18.0.321.gffc6fa0e3
> >
>
>
> --
> With best regards,
> Matwey V. Kornilov



-- 
With best regards,
Matwey V. Kornilov

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH v5 6/7] rockchip: Add Single boot image (with binman, pad_cat)
@ 2019-12-31  8:04         ` Matwey V. Kornilov
  0 siblings, 0 replies; 28+ messages in thread
From: Matwey V. Kornilov @ 2019-12-31  8:04 UTC (permalink / raw)
  To: u-boot

вт, 31 дек. 2019 г. в 10:54, Matwey V. Kornilov <matwey.kornilov@gmail.com>:
>
> пн, 30 дек. 2019 г. в 11:28, Jagan Teki <jagan@amarulasolutions.com>:
> >
> > 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 <kever.yang@rock-chips.com>
> > Cc: Matwey V. Kornilov <matwey.kornilov@gmail.com>
> > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
> > ---
> >  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
> >
> > diff --git a/Makefile b/Makefile
> > index b48693e560..d5b6c45c89 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -909,7 +909,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)
> > @@ -1387,15 +1387,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)
> > 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.dtsi
> > 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 <jagan@amarulasolutions.com>
> >   */
> > +
> > +#include "rockchip-u-boot.dtsi"
> > diff --git a/arch/arm/dts/rk3288-u-boot.dtsi b/arch/arm/dts/rk3288-u-boot.dtsi
> > 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
> >   */
> >
> > +#include "rockchip-u-boot.dtsi"
> > +
> >  / {
> >         chosen {
> >                 u-boot,spl-boot-order = \
> > diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
> > new file mode 100644
> > index 0000000000..bc0b1412a2
> > --- /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 <jagan@amarulasolutions.com>
> > + */
> > +
> > +#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>;
> > +               };
> > +       };
> > +};
> > diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h
> > index 68e1105a4b..d7f5ca9fa4 100644
> > --- a/include/configs/rockchip-common.h
> > +++ b/include/configs/rockchip-common.h
> > @@ -9,6 +9,8 @@
> >
> >  #define CONFIG_SYS_NS16550_MEM32
> >
> > +#define CONFIG_SPL_PAD_TO              8355840
>
> I may be wrong, but shouldn't CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
> be used here?

I.e.

#define CONFIG_SPL_PAD_TO ((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512)

>
> > +
> >  #ifndef CONFIG_SPL_BUILD
> >
> >  /* First try to boot from SD (index 0), then eMMC (index 1) */
> > --
> > 2.18.0.321.gffc6fa0e3
> >
>
>
> --
> With best regards,
> Matwey V. Kornilov



-- 
With best regards,
Matwey V. Kornilov

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v5 6/7] rockchip: Add Single boot image (with binman, pad_cat)
  2019-12-31  8:04         ` Matwey V. Kornilov
@ 2020-01-03 17:35             ` Jagan Teki
  -1 siblings, 0 replies; 28+ messages in thread
From: Jagan Teki @ 2020-01-03 17:35 UTC (permalink / raw)
  To: Matwey V. Kornilov
  Cc: U-Boot Mailing List, Simon Glass, Kever Yang,
	open list:ARM/Rockchip SoC support, Akash Gajjar,
	Philipp Tomsich, linux-amarula

On Tue, Dec 31, 2019 at 1:34 PM Matwey V. Kornilov
<matwey.kornilov@gmail.com> wrote:
>
> вт, 31 дек. 2019 г. в 10:54, Matwey V. Kornilov <matwey.kornilov@gmail.com>:
> >
> > пн, 30 дек. 2019 г. в 11:28, Jagan Teki <jagan@amarulasolutions.com>:
> > >
> > > 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 <kever.yang@rock-chips.com>
> > > Cc: Matwey V. Kornilov <matwey.kornilov@gmail.com>
> > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > > Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
> > > ---
> > >  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
> > >
> > > diff --git a/Makefile b/Makefile
> > > index b48693e560..d5b6c45c89 100644
> > > --- a/Makefile
> > > +++ b/Makefile
> > > @@ -909,7 +909,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)
> > > @@ -1387,15 +1387,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)
> > > 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.dtsi
> > > 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 <jagan@amarulasolutions.com>
> > >   */
> > > +
> > > +#include "rockchip-u-boot.dtsi"
> > > diff --git a/arch/arm/dts/rk3288-u-boot.dtsi b/arch/arm/dts/rk3288-u-boot.dtsi
> > > 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
> > >   */
> > >
> > > +#include "rockchip-u-boot.dtsi"
> > > +
> > >  / {
> > >         chosen {
> > >                 u-boot,spl-boot-order = \
> > > diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
> > > new file mode 100644
> > > index 0000000000..bc0b1412a2
> > > --- /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 <jagan@amarulasolutions.com>
> > > + */
> > > +
> > > +#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>;
> > > +               };
> > > +       };
> > > +};
> > > diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h
> > > index 68e1105a4b..d7f5ca9fa4 100644
> > > --- a/include/configs/rockchip-common.h
> > > +++ b/include/configs/rockchip-common.h
> > > @@ -9,6 +9,8 @@
> > >
> > >  #define CONFIG_SYS_NS16550_MEM32
> > >
> > > +#define CONFIG_SPL_PAD_TO              8355840
> >
> > I may be wrong, but shouldn't CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
> > be used here?
>
> I.e.
>
> #define CONFIG_SPL_PAD_TO ((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512)

Yes,  I did try this logic. but arm64 compiler throwing warning during
build for this. (I'm using gcc 6.3.1)

  CAT     u-boot-rockchip.bin
aarch64-linux-gnu-objcopy: --pad-to: bad number:
((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512)

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH v5 6/7] rockchip: Add Single boot image (with binman, pad_cat)
@ 2020-01-03 17:35             ` Jagan Teki
  0 siblings, 0 replies; 28+ messages in thread
From: Jagan Teki @ 2020-01-03 17:35 UTC (permalink / raw)
  To: u-boot

On Tue, Dec 31, 2019 at 1:34 PM Matwey V. Kornilov
<matwey.kornilov@gmail.com> wrote:
>
> вт, 31 дек. 2019 г. в 10:54, Matwey V. Kornilov <matwey.kornilov@gmail.com>:
> >
> > пн, 30 дек. 2019 г. в 11:28, Jagan Teki <jagan@amarulasolutions.com>:
> > >
> > > 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 <kever.yang@rock-chips.com>
> > > Cc: Matwey V. Kornilov <matwey.kornilov@gmail.com>
> > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > > Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
> > > ---
> > >  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
> > >
> > > diff --git a/Makefile b/Makefile
> > > index b48693e560..d5b6c45c89 100644
> > > --- a/Makefile
> > > +++ b/Makefile
> > > @@ -909,7 +909,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)
> > > @@ -1387,15 +1387,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)
> > > 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.dtsi
> > > 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 <jagan@amarulasolutions.com>
> > >   */
> > > +
> > > +#include "rockchip-u-boot.dtsi"
> > > diff --git a/arch/arm/dts/rk3288-u-boot.dtsi b/arch/arm/dts/rk3288-u-boot.dtsi
> > > 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
> > >   */
> > >
> > > +#include "rockchip-u-boot.dtsi"
> > > +
> > >  / {
> > >         chosen {
> > >                 u-boot,spl-boot-order = \
> > > diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
> > > new file mode 100644
> > > index 0000000000..bc0b1412a2
> > > --- /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 <jagan@amarulasolutions.com>
> > > + */
> > > +
> > > +#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>;
> > > +               };
> > > +       };
> > > +};
> > > diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h
> > > index 68e1105a4b..d7f5ca9fa4 100644
> > > --- a/include/configs/rockchip-common.h
> > > +++ b/include/configs/rockchip-common.h
> > > @@ -9,6 +9,8 @@
> > >
> > >  #define CONFIG_SYS_NS16550_MEM32
> > >
> > > +#define CONFIG_SPL_PAD_TO              8355840
> >
> > I may be wrong, but shouldn't CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
> > be used here?
>
> I.e.
>
> #define CONFIG_SPL_PAD_TO ((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512)

Yes,  I did try this logic. but arm64 compiler throwing warning during
build for this. (I'm using gcc 6.3.1)

  CAT     u-boot-rockchip.bin
aarch64-linux-gnu-objcopy: --pad-to: bad number:
((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512)

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2020-01-03 17:35 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-30  8:28 [PATCH v5 0/7] rockchip: Add Binman support Jagan Teki
2019-12-30  8:28 ` Jagan Teki
     [not found] ` <20191230082819.30191-1-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
2019-12-30  8:28   ` [PATCH v5 1/7] Makefile: Add rockchip image type Jagan Teki
2019-12-30  8:28     ` Jagan Teki
2019-12-30  8:28   ` [PATCH v5 2/7] Makefile: rockchip: Suffix platform type with tpl name Jagan Teki
2019-12-30  8:28     ` Jagan Teki
2019-12-30  8:28   ` [PATCH v5 3/7] Makefile: rockchip: Support SPL-alone mkimage Jagan Teki
2019-12-30  8:28     ` Jagan Teki
2019-12-30  8:28   ` [PATCH v5 4/7] Makefile: rockchip: Use u-boot preferred spl name Jagan Teki
2019-12-30  8:28     ` Jagan Teki
2019-12-30  8:28   ` [PATCH v5 5/7] arm: dts: rk3036: Add rk3036-u-boot.dtsi Jagan Teki
2019-12-30  8:28     ` Jagan Teki
2019-12-30  8:28   ` [PATCH v5 6/7] rockchip: Add Single boot image (with binman, pad_cat) Jagan Teki
2019-12-30  8:28     ` Jagan Teki
2019-12-31  7:54     ` Matwey V. Kornilov
2019-12-31  7:54       ` Matwey V. Kornilov
2019-12-31  8:04       ` Matwey V. Kornilov
2019-12-31  8:04         ` Matwey V. Kornilov
     [not found]         ` <CAJs94EZgpHmkHAfDQUH_mqW82Jw_QJWiJgx_8Uny1ru1WfbrHw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-01-03 17:35           ` Jagan Teki
2020-01-03 17:35             ` Jagan Teki
2019-12-30  8:28   ` [PATCH v5 7/7] doc: boards: Add rockchip documentation Jagan Teki
2019-12-30  8:28     ` Jagan Teki
2019-12-30  8:41     ` Matwey V. Kornilov
2019-12-30  8:41       ` Matwey V. Kornilov
     [not found]       ` <CAJs94EYBrwf9Pt0R-_OypT-JHWGFpZYxRhKcUXWgXTFJi9O0HA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-12-30  8:59         ` Jagan Teki
2019-12-30  8:59           ` Jagan Teki
2019-12-31  7:50           ` Matwey V. Kornilov
2019-12-31  7:50             ` Matwey V. Kornilov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.