Skip to contentSkip to conversation

rockchip: Add Binman support

PATCH Superseded Jagan Teki 5 participants 14 messages Oct 17, 2019 – Nov 15, 2019 3 messages not in the archive

Subsystems (3)

v3 of 7 Superseded Latest is v7 →

lore
Share & tools
lore

Jagan Teki

author
#0 lore raw

v3 cover rockchip: Add Binman support

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

This series add binman support for TPL-based targets, binman for SPL-alone boards add in future.

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

[1] http://patchwork.ozlabs.org/cover/1092198/

Any inputs?
Jagan.

Jagan Teki (5):
Makefile: Add rockchip image type
Makefile: Rename idbloader.img with u-boot-spl-rockchip.bin
arm: dts: rk3368: Add rk3368-u-boot.dtsi
rockchip: Add Binman support
doc: boards: Add rockchip documentation

 Makefile                                |  23 ++++-
 arch/arm/Kconfig                        |   1 +
 arch/arm/dts/rk3288-u-boot.dtsi         |   2 +
 arch/arm/dts/rk3328-u-boot.dtsi         |   2 +
 arch/arm/dts/rk3368-geekbox-u-boot.dtsi |   2 +
 arch/arm/dts/rk3368-lion-u-boot.dtsi    |   2 +
 arch/arm/dts/rk3368-px5-evb-u-boot.dtsi |   3 +
 arch/arm/dts/rk3368-sheep-u-boot.dtsi   |   2 +
 arch/arm/dts/rk3368-u-boot.dtsi         |   6 ++
 arch/arm/dts/rk3399-u-boot.dtsi         |   2 +
 arch/arm/dts/rockchip-u-boot.dtsi       |  21 ++++
 doc/board/rockchip/index.rst            |  10 ++
 doc/board/rockchip/rockchip.rst         | 125 ++++++++++++++++++++++++
 include/configs/rockchip-common.h       |   2 +
 14 files changed, 200 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/dts/rk3368-u-boot.dtsi
 create mode 100644 arch/arm/dts/rockchip-u-boot.dtsi
 create mode 100644 doc/board/rockchip/index.rst
 create mode 100644 doc/board/rockchip/rockchip.rst
Signature · 1 line
2.18.0.321.gffc6fa0e3

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

author
#2 lore raw

PATCH v3 1/5 Makefile: Add rockchip image type

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

---
 Makefile | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
Makefile +8 -1
index 6fda3268e7..ec55e0f6a4 100644
@@ -1334,7 +1334,14 @@ 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
+
+ifeq ($(CONFIG_SPI_FLASH_SUPPORT),y)
+ROCKCHIP_IMG_TYPE := rkspi
+else
+ROCKCHIP_IMG_TYPE := rksd
+endif
+
+MKIMAGEFLAGS_u-boot-tpl.img = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
 tpl/u-boot-tpl.img: tpl/u-boot-tpl.bin FORCE
 	$(call if_changed,mkimage)
 idbloader.img: tpl/u-boot-tpl.img spl/u-boot-spl.bin FORCE
Signature · 1 line
2.18.0.321.gffc6fa0e3
Reviewed-by on v3 1/5
#3 lore raw

Re: [PATCH v3 1/5] Makefile: Add rockchip image type

Quoted 7 lines · Jagan Teki

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

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

Thanks,
- Kever

Quoted 14 lines
---
  Makefile | 9 ++++++++-
  1 file changed, 8 insertions(+), 1 deletion(-)
Makefile +1 -1
index 6fda3268e7..ec55e0f6a4 100644
@@ -1334,7 +1334,14 @@ 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
+

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

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

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

author
#4 lore raw

PATCH v3 2/5 Makefile: Rename idbloader.img with u-boot-spl-rockchip.bin

In reply to a message not in the archive

idbloader.img name is specific to rockchip, where it usually created using rockchip tools. Since the image is created as per U-Boot generic builds like SPL, better to follow the generic U-Boot naming notation like other SoC's following.

Enable idbloader.img with u-boot-spl-rockchip.bin and create the same in spl directory since it is SPL file and Makefile.spl will clean it by default.

---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -2
index ec55e0f6a4..918b5d53e0 100644
@@ -887,7 +887,7 @@ ALL-y += u-boot-with-dtb.bin
 endif
 
 ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL)$(CONFIG_TPL),yyy)
-ALL-y += idbloader.img
+ALL-y += spl/u-boot-spl-rockchip.bin
 endif
 
 LDFLAGS_u-boot += $(LDFLAGS_FINAL)
@@ -1344,7 +1344,7 @@ 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
+spl/u-boot-spl-rockchip.bin: tpl/u-boot-tpl.img spl/u-boot-spl.bin FORCE
 	$(call if_changed,cat)
 endif
 
Signature · 1 line
2.18.0.321.gffc6fa0e3
#5 lore raw

Re: [PATCH v3 2/5] Makefile: Rename idbloader.img with u-boot-spl-rockchip.bin

Jagan,

Quoted 1 line · Jagan Teki

idbloader.img name is specific to rockchip,

This is specific for rockchip, like rksd, rkspi type in mkimage, since it's clear for what it stands for,

I think it can also used in U-Boot.

Quoted 2 lines

where it usually
created using rockchip tools.

No, idbloader stands for the image with idb header packaged with two stage loader, eg. TPL+SPL

or ddr.bin+miniloader.bin, and maybe ddr.bin + SPL, TPL+miniloader.bin,

not related to rockchip tools, it can also be created with U-Boot mkimage tool.

Quoted 20 lines

Since the image is created as
per U-Boot generic builds like SPL, better to follow the generic U-Boot naming notation like other SoC's following.

Enable idbloader.img with u-boot-spl-rockchip.bin and create the same in spl directory since it is SPL file and Makefile.spl will clean it by default.

Cc Kever Yang <[email protected]>
Cc Matwey V. Kornilov <[email protected]>
---
  Makefile | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
Makefile +0 -0
index ec55e0f6a4..918b5d53e0 100644

Makefile ALL-y += u-boot-with-dtb.bin · line 890

Quoted 5 lines
Makefile +1 -1
@@ -887,7 +887,7 @@ ALL-y += u-boot-with-dtb.bin
  endif
 
  ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL)$(CONFIG_TPL),yyy)
-ALL-y += idbloader.img
+ALL-y += spl/u-boot-spl-rockchip.bin

This idbloader including IDB header, TPL, and SPL, I don't think name it as spl and

put it in spl directory make any sense.

I though the origin output file use postfix '.bin' and those image after pack and can  be

dd to storage directly better to use postfix '.img'.

About the clean, it will be better to be clean like other '.img' file in the Makefile.

Thanks,

- Kever

Makefile endif · line 1350

Quoted 12 lines
Makefile +1 -1
  endif
 
  LDFLAGS_u-boot += $(LDFLAGS_FINAL)
@@ -1344,7 +1344,7 @@ 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
+spl/u-boot-spl-rockchip.bin: tpl/u-boot-tpl.img spl/u-boot-spl.bin FORCE
  	$(call if_changed,cat)
  endif
 

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

#6 lore raw

Re: [PATCH v3 2/5] Makefile: Rename idbloader.img with u-boot-spl-rockchip.bin

Hi Kever,

Quoted 16 lines · Kever Yang

Jagan,

Quoted 1 line · Jagan Teki

idbloader.img name is specific to rockchip,

This is specific for rockchip, like rksd, rkspi type in mkimage, since it's clear for what it stands for,

I think it can also used in U-Boot.

Quoted 2 lines

where it usually
created using rockchip tools.

Quoted 7 lines

No, idbloader stands for the image with idb header packaged with two stage loader, eg. TPL+SPL

or ddr.bin+miniloader.bin, and maybe ddr.bin + SPL, TPL+miniloader.bin,

not related to rockchip tools, it can also be created with U-Boot mkimage tool.

I understand what idbloader contains, it is like rockchip SPL. but the main concern here is the naming convention used in U-Boot. It would be a standard way of using naming conventions where the final output naming conventions should have u-boot support stages(TPL, SPL, U-Boot) and platform specific name. This way it is less confused what exactly it contains.

Moreover most of the platform specific bin ended up using this type of conventions.

- u-boot-spl-mtk.bin - Mediatek SPL bin
- u-boot-mtk.bin - Mediatek U-Boot bin (would be final image)
- u-boot-sunxi-with-spl.bin - Allwinner U-Boot with SPL
- u-boot-x86-start16-tpl.bin

Similar naming conventions used for tegra, x86 etc.

I'm completely aware of what you're trying to abbreviate idbloader.img, but having u-boot-spl-rockchip.bin is more readable and understand than idbloader.

Quoted 33 lines
Quoted 21 lines

Since the image is created as
per U-Boot generic builds like SPL, better to follow the generic U-Boot naming notation like other SoC's following.

Enable idbloader.img with u-boot-spl-rockchip.bin and create the same in spl directory since it is SPL file and Makefile.spl will clean it by default.

Cc Kever Yang <[email protected]>
Cc Matwey V. Kornilov <[email protected]>
---
  Makefile | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
Makefile +0 -0
index ec55e0f6a4..918b5d53e0 100644

Makefile ALL-y += u-boot-with-dtb.bin · line 890

Quoted 5 lines
Makefile +1 -1
@@ -887,7 +887,7 @@ ALL-y += u-boot-with-dtb.bin
  endif
 
  ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL)$(CONFIG_TPL),yyy)
-ALL-y += idbloader.img
+ALL-y += spl/u-boot-spl-rockchip.bin

This idbloader including IDB header, TPL, and SPL, I don't think name it as spl and

put it in spl directory make any sense.

Quoted 7 lines

I though the origin output file use postfix '.bin' and those image after pack and can be

dd to storage directly better to use postfix '.img'.

About the clean, it will be better to be clean like other '.img' file in the Makefile.

This make sense, I have next version set where it used handle these so carefully.
_______________________________________________
U-Boot mailing list
[email protected]
https://lists.denx.de/listinfo/u-boot

#7 lore raw

Re: [PATCH v3 2/5] Makefile: Rename idbloader.img with u-boot-spl-rockchip.bin

Quoted 37 lines

From: Jagan Teki <[email protected]>
Date: Mon, 21 Oct 2019 10:56:39 +0530

Hi Kever,

Quoted 16 lines · Kever Yang

Jagan,

Quoted 1 line · Jagan Teki

idbloader.img name is specific to rockchip,

This is specific for rockchip, like rksd, rkspi type in mkimage, since it's clear for what it stands for,

I think it can also used in U-Boot.

Quoted 2 lines

where it usually
created using rockchip tools.

Quoted 7 lines

No, idbloader stands for the image with idb header packaged with two stage loader, eg. TPL+SPL

or ddr.bin+miniloader.bin, and maybe ddr.bin + SPL, TPL+miniloader.bin,

not related to rockchip tools, it can also be created with U-Boot mkimage tool.

I understand what idbloader contains, it is like rockchip SPL. but the main concern here is the naming convention used in U-Boot. It would be a standard way of using naming conventions where the final output naming conventions should have u-boot support stages(TPL, SPL, U-Boot) and platform specific name. This way it is less confused what exactly it contains.

Quoted 7 lines

Moreover most of the platform specific bin ended up using this type of conventions.

- u-boot-spl-mtk.bin - Mediatek SPL bin
- u-boot-mtk.bin - Mediatek U-Boot bin (would be final image)
- u-boot-sunxi-with-spl.bin - Allwinner U-Boot with SPL
- u-boot-x86-start16-tpl.bin

No real consistency there though...

Quoted 5 lines

Similar naming conventions used for tegra, x86 etc.

I'm completely aware of what you're trying to abbreviate idbloader.img, but having u-boot-spl-rockchip.bin is more readable and understand than idbloader.

As was discussed before, idbloader.img is the name used in external documentation.

Quoted 40 lines
Quoted 32 lines
Quoted 20 lines

Since the image is created as
per U-Boot generic builds like SPL, better to follow the generic U-Boot naming notation like other SoC's following.

Enable idbloader.img with u-boot-spl-rockchip.bin and create the same in spl directory since it is SPL file and Makefile.spl will clean it by default.

Cc Kever Yang <[email protected]>
Cc Matwey V. Kornilov <[email protected]>
---
  Makefile | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
Makefile +0 -0
index ec55e0f6a4..918b5d53e0 100644

Makefile ALL-y += u-boot-with-dtb.bin · line 890

Quoted 5 lines
Makefile +1 -1
@@ -887,7 +887,7 @@ ALL-y += u-boot-with-dtb.bin
  endif
 
  ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL)$(CONFIG_TPL),yyy)
-ALL-y += idbloader.img
+ALL-y += spl/u-boot-spl-rockchip.bin

This idbloader including IDB header, TPL, and SPL, I don't think name it as spl and

put it in spl directory make any sense.

Quoted 7 lines

I though the origin output file use postfix '.bin' and those image after pack and can be

dd to storage directly better to use postfix '.img'.

About the clean, it will be better to be clean like other '.img' file in the Makefile.

Quoted 6 lines

This make sense, I have next version set where it used handle these so carefully.
_______________________________________________
U-Boot mailing list
[email protected]
https://lists.denx.de/listinfo/u-boot

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

#8 lore raw

Re: [PATCH v3 2/5] Makefile: Rename idbloader.img with u-boot-spl-rockchip.bin

Quoted 41 lines · Mark Kettenis
Quoted 41 lines

From: Jagan Teki <[email protected]>
Date: Mon, 21 Oct 2019 10:56:39 +0530

Hi Kever,

Quoted 16 lines · Kever Yang

Jagan,

Quoted 1 line · Jagan Teki

idbloader.img name is specific to rockchip,

This is specific for rockchip, like rksd, rkspi type in mkimage, since it's clear for what it stands for,

I think it can also used in U-Boot.

Quoted 2 lines

where it usually
created using rockchip tools.

Quoted 7 lines

No, idbloader stands for the image with idb header packaged with two stage loader, eg. TPL+SPL

or ddr.bin+miniloader.bin, and maybe ddr.bin + SPL, TPL+miniloader.bin,

not related to rockchip tools, it can also be created with U-Boot mkimage tool.

I understand what idbloader contains, it is like rockchip SPL. but the main concern here is the naming convention used in U-Boot. It would be a standard way of using naming conventions where the final output naming conventions should have u-boot support stages(TPL, SPL, U-Boot) and platform specific name. This way it is less confused what exactly it contains.

Moreover most of the platform specific bin ended up using this type of conventions.

Quoted 6 lines
Quoted 4 lines

- u-boot-spl-mtk.bin - Mediatek SPL bin
- u-boot-mtk.bin - Mediatek U-Boot bin (would be final image)
- u-boot-sunxi-with-spl.bin - Allwinner U-Boot with SPL
- u-boot-x86-start16-tpl.bin

No real consistency there though...

Not sure what you pointed here, each bin listed above shows the platform and u-boot stage and prefix with u-boot- as well. of course all can't maintain the same but has mentioned details.

Quoted 9 lines
Quoted 6 lines

Similar naming conventions used for tegra, x86 etc.

I'm completely aware of what you're trying to abbreviate idbloader.img, but having u-boot-spl-rockchip.bin is more readable and understand than idbloader.

As was discussed before, idbloader.img is the name used in external documentation.

Yes, used in external documentation. when it comes to upstream it would follow as per existing platforms does atleast.
_______________________________________________
U-Boot mailing list
[email protected]
https://lists.denx.de/listinfo/u-boot

#9 lore raw

Re: [PATCH v3 2/5] Makefile: Rename idbloader.img with u-boot-spl-rockchip.bin

Hi Jagan,

Quoted 37 lines · Jagan Teki
Quoted 36 lines · Mark Kettenis
Quoted 36 lines

From: Jagan Teki <[email protected]>
Date: Mon, 21 Oct 2019 10:56:39 +0530

Hi Kever,

Quoted 13 lines · Kever Yang

Jagan,

Quoted 1 line · Jagan Teki

idbloader.img name is specific to rockchip,

This is specific for rockchip, like rksd, rkspi type in mkimage, since it's clear for what it stands for,

I think it can also used in U-Boot.

Quoted 2 lines

where it usually
created using rockchip tools.

Quoted 7 lines

No, idbloader stands for the image with idb header packaged with two stage loader, eg. TPL+SPL

or ddr.bin+miniloader.bin, and maybe ddr.bin + SPL, TPL+miniloader.bin,

not related to rockchip tools, it can also be created with U-Boot mkimage tool.

I understand what idbloader contains, it is like rockchip SPL. but the main concern here is the naming convention used in U-Boot. It would be a standard way of using naming conventions where the final output naming conventions should have u-boot support stages(TPL, SPL, U-Boot) and platform specific name. This way it is less confused what exactly it contains.

Moreover most of the platform specific bin ended up using this type of conventions.

Quoted 8 lines
Quoted 5 lines
Quoted 4 lines

- u-boot-spl-mtk.bin - Mediatek SPL bin
- u-boot-mtk.bin - Mediatek U-Boot bin (would be final image)
- u-boot-sunxi-with-spl.bin - Allwinner U-Boot with SPL
- u-boot-x86-start16-tpl.bin

No real consistency there though...

Not sure what you pointed here, each bin listed above shows the platform and u-boot stage and prefix with u-boot- as well. of course all can't maintain the same but has mentioned details.

The image for Vendor's BootRom is always vendor specific, so I don't think invent
a new name for idbloader.img make any sense.
I know what's the u-boot.bin, u-boot.itb, u-boot-spl.bin, u-boot-tpl.bin, because all the boards use them in the same way,  but I don't know what is u-boot-spl-mtk.bin or u-boot-sunxi-with-spl.bin, and also names like lpc32xx-***, because they always specific for the SoC vendor, people never know what it's before they work on this platform.
For  idbloader.img, it already used for  a period of time, it's document in both Rockchip document and U-Boot document, developers know what it's when they see this name, I don't think add a new name for it and add a new document and discards the document with old name is a good idea, it only confuse developers. You can have a new name for binman output  for that's new output, but I would like not to invent new name for idbloader until most of developers think that's really necessary.

Thanks,
- Kever

Quoted 11 lines
Quoted 8 lines
Quoted 6 lines

Similar naming conventions used for tegra, x86 etc.

I'm completely aware of what you're trying to abbreviate idbloader.img, but having u-boot-spl-rockchip.bin is more readable and understand than idbloader.

As was discussed before, idbloader.img is the name used in external documentation.

Yes, used in external documentation. when it comes to upstream it would follow as per existing platforms does atleast.

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

author
#10 lore raw

PATCH v3 3/5 arm: dts: rk3368: Add rk3368-u-boot.dtsi

In reply to a message not in the archive

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

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

---
 arch/arm/dts/rk3368-geekbox-u-boot.dtsi | 2 ++
 arch/arm/dts/rk3368-lion-u-boot.dtsi    | 2 ++
 arch/arm/dts/rk3368-px5-evb-u-boot.dtsi | 3 +++
 arch/arm/dts/rk3368-sheep-u-boot.dtsi   | 2 ++
 arch/arm/dts/rk3368-u-boot.dtsi         | 4 ++++
 5 files changed, 13 insertions(+)
 create mode 100644 arch/arm/dts/rk3368-u-boot.dtsi
arch/arm/dts/rk3368-geekbox-u-boot.dtsi +2 -0
index 30ea9e433a..0b724fa45f 100644
@@ -3,6 +3,8 @@
  * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
  */
 
+#include "rk3368-u-boot.dtsi"
+
 &pinctrl {
 	u-boot,dm-pre-reloc;
 };
arch/arm/dts/rk3368-lion-u-boot.dtsi +2 -0
index edc93e438f..5050d3dee8 100644
@@ -3,6 +3,8 @@
  * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
  */
 
+#include "rk3368-u-boot.dtsi"
+
 / {
 	config {
 		u-boot,spl-payload-offset = <0x40000>; /* @ 256KB */
arch/arm/dts/rk3368-px5-evb-u-boot.dtsi +3 -0
index 002767a033..5fee02a65b 100644
@@ -2,6 +2,9 @@
 /*
  * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
  */
+
+#include "rk3368-u-boot.dtsi"
+
 / {
 	chosen {
 		u-boot,spl-boot-order = &emmc;
arch/arm/dts/rk3368-sheep-u-boot.dtsi +2 -0
index 30ea9e433a..0b724fa45f 100644
@@ -3,6 +3,8 @@
  * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
  */
 
+#include "rk3368-u-boot.dtsi"
+
 &pinctrl {
 	u-boot,dm-pre-reloc;
 };
arch/arm/dts/rk3368-u-boot.dtsi new file +4 -0
new file mode 100644
index 0000000000..1e7d079315
@@ -0,0 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
+ */
Signature · 1 line
2.18.0.321.gffc6fa0e3
author
#11 lore raw

PATCH v3 4/5 rockchip: Add Binman support

In reply to a message not in the archive

TPL-based rockchip platform like rk3288, rk3328, rk3368 and rk3399 has three stage boot loaders like TPL, SPL and U-Boot proper. For each stage we need to burn the image on to flash with respective offsets.

This patch create a single image using binman, so that user can get rid of burning different stage boot images.

The new image called 'u-boot-rockchip-with-tpl-spl.bin' which can burn into flash like:

₹ sudo dd if=u-boot-rockchip-with-tpl-spl.bin of=/dev/sda seek=64

This would easily extend if other rockchip family SoC's would make use of single image creation.

Cc Kever Yang <[email protected]>
Cc Matwey V. Kornilov <[email protected]>
---
 Makefile                          | 10 ++++++++++
 arch/arm/Kconfig                  |  1 +
 arch/arm/dts/rk3288-u-boot.dtsi   |  2 ++
 arch/arm/dts/rk3328-u-boot.dtsi   |  2 ++
 arch/arm/dts/rk3368-u-boot.dtsi   |  2 ++
 arch/arm/dts/rk3399-u-boot.dtsi   |  2 ++
 arch/arm/dts/rockchip-u-boot.dtsi | 21 +++++++++++++++++++++
 include/configs/rockchip-common.h |  2 ++
 8 files changed, 42 insertions(+)
 create mode 100644 arch/arm/dts/rockchip-u-boot.dtsi
Makefile +10 -0
index 918b5d53e0..049781e0ba 100644
@@ -888,6 +888,7 @@ endif
 
 ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL)$(CONFIG_TPL),yyy)
 ALL-y += spl/u-boot-spl-rockchip.bin
+ALL-y += u-boot-rockchip-with-tpl-spl.bin
 endif
 
 LDFLAGS_u-boot += $(LDFLAGS_FINAL)
@@ -1346,6 +1347,15 @@ tpl/u-boot-tpl.img: tpl/u-boot-tpl.bin FORCE
 	$(call if_changed,mkimage)
 spl/u-boot-spl-rockchip.bin: tpl/u-boot-tpl.img spl/u-boot-spl.bin FORCE
 	$(call if_changed,cat)
+
+ifdef CONFIG_SPL_LOAD_FIT
+ROCKCHIP_UBOOT_IMG := u-boot.itb
+else
+ROCKCHIP_UBOOT_IMG := u-boot.img
+endif
+
+u-boot-rockchip-with-tpl-spl.bin: spl/u-boot-spl-rockchip.bin $(ROCKCHIP_UBOOT_IMG) FORCE
+	$(call if_changed,binman)
 endif
 
 ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy)
arch/arm/Kconfig +1 -0
index 1df2aba3c2..87fa1f43f4 100644
@@ -1594,6 +1594,7 @@ config ARCH_STM32MP
 config ARCH_ROCKCHIP
 	bool "Support Rockchip SoCs"
 	select BLK
+	select BINMAN if TPL && SPL
 	select DM
 	select DM_GPIO
 	select DM_I2C
arch/arm/dts/rk3288-u-boot.dtsi +2 -0
index 3f00a3b6d3..6d31735362 100644
@@ -3,6 +3,8 @@
  * Copyright (C) 2019 Rockchip Electronics Co., Ltd
  */
 
+#include "rockchip-u-boot.dtsi"
+
 / {
 	chosen {
 		u-boot,spl-boot-order = \
arch/arm/dts/rk3328-u-boot.dtsi +2 -0
index ffbd657e31..0c51a8dbfb 100644
@@ -3,6 +3,8 @@
  * (C) Copyright 2019 Rockchip Electronics Co., Ltd
  */
 
+#include "rockchip-u-boot.dtsi"
+
 / {
 	aliases {
 		mmc0 = &emmc;
arch/arm/dts/rk3368-u-boot.dtsi +2 -0
index 1e7d079315..41ac054b81 100644
@@ -2,3 +2,5 @@
 /*
  * Copyright (C) 2019 Jagan Teki <[email protected]>
  */
+
+#include "rockchip-u-boot.dtsi"
arch/arm/dts/rk3399-u-boot.dtsi +2 -0
index 2738a3889e..fe8a73d653 100644
@@ -3,6 +3,8 @@
  * Copyright (C) 2019 Jagan Teki <[email protected]>
  */
 
+#include "rockchip-u-boot.dtsi"
+
 &pmu {
 	u-boot,dm-pre-reloc;
 };
arch/arm/dts/rockchip-u-boot.dtsi new file +21 -0
new file mode 100644
index 0000000000..c496107119
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Jagan Teki <[email protected]>
+ */
+
+#include <config.h>
+
+/ {
+	binman {
+		filename = "u-boot-rockchip-with-tpl-spl.bin";
+		pad-byte = <0xff>;
+
+		blob {
+			filename = "spl/u-boot-spl-rockchip.bin";
+		};
+
+		u-boot-img {
+			offset = <CONFIG_SPL_PAD_TO>;
+		};
+	};
+};
include/configs/rockchip-common.h +2 -0
index 68e1105a4b..d7f5ca9fa4 100644
@@ -9,6 +9,8 @@
 
 #define CONFIG_SYS_NS16550_MEM32
 
+#define CONFIG_SPL_PAD_TO		8355840
+
 #ifndef CONFIG_SPL_BUILD
 
 /* First try to boot from SD (index 0), then eMMC (index 1) */
Signature · 7 lines
2.18.0.321.gffc6fa0e3


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

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

author
#13 lore raw

Hi Simon,

Quoted 136 lines · Jagan Teki

TPL-based rockchip platform like rk3288, rk3328, rk3368 and rk3399 has three stage boot loaders like TPL, SPL and U-Boot proper. For each stage we need to burn the image on to flash with respective offsets.

This patch create a single image using binman, so that user can get rid of burning different stage boot images.

The new image called 'u-boot-rockchip-with-tpl-spl.bin' which can burn into flash like:

₹ sudo dd if=u-boot-rockchip-with-tpl-spl.bin of=/dev/sda seek=64

This would easily extend if other rockchip family SoC's would make use of single image creation.

Cc Kever Yang <[email protected]>
Cc Matwey V. Kornilov <[email protected]>
---
 Makefile                          | 10 ++++++++++
 arch/arm/Kconfig                  |  1 +
 arch/arm/dts/rk3288-u-boot.dtsi   |  2 ++
 arch/arm/dts/rk3328-u-boot.dtsi   |  2 ++
 arch/arm/dts/rk3368-u-boot.dtsi   |  2 ++
 arch/arm/dts/rk3399-u-boot.dtsi   |  2 ++
 arch/arm/dts/rockchip-u-boot.dtsi | 21 +++++++++++++++++++++
 include/configs/rockchip-common.h |  2 ++
 8 files changed, 42 insertions(+)
 create mode 100644 arch/arm/dts/rockchip-u-boot.dtsi
Makefile +10 -0
index 918b5d53e0..049781e0ba 100644
@@ -888,6 +888,7 @@ endif
 
 ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL)$(CONFIG_TPL),yyy)
 ALL-y += spl/u-boot-spl-rockchip.bin
+ALL-y += u-boot-rockchip-with-tpl-spl.bin
 endif
 
 LDFLAGS_u-boot += $(LDFLAGS_FINAL)
@@ -1346,6 +1347,15 @@ tpl/u-boot-tpl.img: tpl/u-boot-tpl.bin FORCE
        $(call if_changed,mkimage)
 spl/u-boot-spl-rockchip.bin: tpl/u-boot-tpl.img spl/u-boot-spl.bin FORCE
        $(call if_changed,cat)
+
+ifdef CONFIG_SPL_LOAD_FIT
+ROCKCHIP_UBOOT_IMG := u-boot.itb
+else
+ROCKCHIP_UBOOT_IMG := u-boot.img
+endif
+
+u-boot-rockchip-with-tpl-spl.bin: spl/u-boot-spl-rockchip.bin $(ROCKCHIP_UBOOT_IMG) FORCE
+       $(call if_changed,binman)
 endif
 
 ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy)
arch/arm/Kconfig +1 -0
index 1df2aba3c2..87fa1f43f4 100644
@@ -1594,6 +1594,7 @@ config ARCH_STM32MP
 config ARCH_ROCKCHIP
        bool "Support Rockchip SoCs"
        select BLK
+       select BINMAN if TPL && SPL
        select DM
        select DM_GPIO
        select DM_I2C
arch/arm/dts/rk3288-u-boot.dtsi +2 -0
index 3f00a3b6d3..6d31735362 100644
@@ -3,6 +3,8 @@
  * Copyright (C) 2019 Rockchip Electronics Co., Ltd
  */
 
+#include "rockchip-u-boot.dtsi"
+
 / {
        chosen {
                u-boot,spl-boot-order = \
arch/arm/dts/rk3328-u-boot.dtsi +2 -0
index ffbd657e31..0c51a8dbfb 100644
@@ -3,6 +3,8 @@
  * (C) Copyright 2019 Rockchip Electronics Co., Ltd
  */
 
+#include "rockchip-u-boot.dtsi"
+
 / {
        aliases {
                mmc0 = &emmc;
arch/arm/dts/rk3368-u-boot.dtsi +2 -0
index 1e7d079315..41ac054b81 100644
@@ -2,3 +2,5 @@
 /*
  * Copyright (C) 2019 Jagan Teki <[email protected]>
  */
+
+#include "rockchip-u-boot.dtsi"
arch/arm/dts/rk3399-u-boot.dtsi +2 -0
index 2738a3889e..fe8a73d653 100644
@@ -3,6 +3,8 @@
  * Copyright (C) 2019 Jagan Teki <[email protected]>
  */
 
+#include "rockchip-u-boot.dtsi"
+
 &pmu {
        u-boot,dm-pre-reloc;
 };
arch/arm/dts/rockchip-u-boot.dtsi new file +9 -0
new file mode 100644
index 0000000000..c496107119
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Jagan Teki <[email protected]>
+ */
+
+#include <config.h>
+
+/ {
+       binman {

arch/arm/dts/rockchip-u-boot.dtsi line 19

Quoted 10 lines
arch/arm/dts/rockchip-u-boot.dtsi new file +10 -0
+               filename = "u-boot-rockchip-with-tpl-spl.bin";
+               pad-byte = <0xff>;
+
+               blob {
+                       filename = "spl/u-boot-spl-rockchip.bin";
+               };
+
+               u-boot-img {
+                       offset = <CONFIG_SPL_PAD_TO>;
+               };

u-boot-img seems to be compatible or working with u-boot.itb but indeed Linux failed to boot with 'Starting kernel ...' does binman really know that this is itb? or some overlap on my image offset, not sure. any help?

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

author
#14 lore raw

PATCH v3 5/5 doc: boards: Add rockchip documentation

In reply to a message not in the archive

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

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

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

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

125 lines not on this page · raw message

Signature · 1 line
2.18.0.321.gffc6fa0e3

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

#16 lore raw

Re: [PATCH v3 5/5] doc: boards: Add rockchip documentation

Quoted 108 lines · Jagan Teki

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

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

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

---
  doc/board/rockchip/index.rst    |  10 +++
  doc/board/rockchip/rockchip.rst | 125 ++++++++++++++++++++++++++++++++
  2 files changed, 135 insertions(+)

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

doc/board/rockchip/index.rst new file +10 -0
new file mode 100644
index 0000000000..0c377e9bbb
@@ -0,0 +1,10 @@
+.. SPDX-License-Identifier: GPL-2.0+
+.. Copyright (C) 2019 Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
+
+Rockchip
+========
+
+.. toctree::
+   :maxdepth: 2
+
+   rockchip
doc/board/rockchip/rockchip.rst new file +63 -0
new file mode 100644
index 0000000000..782a0f1c7a
@@ -0,0 +1,125 @@
+.. 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

doc/board/rockchip/rockchip.rst line 73

Quoted 10 lines
doc/board/rockchip/rockchip.rst new file +10 -0
+--------
+
+TF-A
+^^^^
+
+TF-A would require to build for ARM64 Rockchip SoCs platforms.
+
+To build TF-A::
+
+        git clone https://github.com/ARM-software/arm-trusted-firmware.git

Nit: it's probably worth updating that to https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git

Robin.

Quoted 53 lines
doc/board/rockchip/rockchip.rst new file +52 -0
+        cd arm-trusted-firmware
+        make realclean
+        make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399
+
+Specify the PLAT= with desired rockchip platform to build TF-A for.
+
+U-Boot
+^^^^^^
+
+To build rk3328 boards::
+
+        export BL31=/path/to/arm-trusted-firmware/to/bl31.elf
+        make evb-rk3328_defconfig
+        make
+
+To build rk3288 boards::
+
+        make evb-rk3288_defconfig
+        make
+
+To build rk3368 boards::
+
+        export BL31=/path/to/arm-trusted-firmware/to/bl31.elf
+        make evb-px5_defconfig
+        make
+
+To build rk3399 boards::
+
+        export BL31=/path/to/arm-trusted-firmware/to/bl31.elf
+        make evb-rk3399_defconfig
+        make
+
+SD Card Flashing
+----------------
+
+To write an image that boots from an SD card (assumed to be /dev/sda):
+
+TPL + SPL::
+
+        sudo dd if=u-boot-rockchip-with-tpl-spl.bin of=/dev/sda seek=64
+        sync
+
+TODO
+----
+
+- Add SPL-alone SD Card flashing steps
+- 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