Skip to contentSkip to conversation

rk3399: make u-boot-rockchip-with-spl.bin

PATCH Superseded Jagan Teki 5 participants 12 messages Apr 26, 2019 3 messages not in the archive

Subsystems (4)

v1 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Jagan Teki

author
#0 lore raw

cover rk3399: make u-boot-rockchip-with-spl.bin

This series will create single bootable image 'u-boot-rockchip-with-spl.bin' for rk3399 platform with single make command instead of building u-boot separately for u-boot.itb and burn them separately for SPL and U-Boot proper.

This series has dependecy with[1]

travis-ci issue:
- need to include 'python-pyelftools' package, tried but can't succeed
- right now build failed if BL31 is not exported, but this would manage to create dummy arm64 elf but any help on this would appreciate.

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

Any inputs?
Jagan.

Jagan Teki (5):
arm64: rockchip: dts: rk3399: Create -u-boot.dtsi files
rockchip: rk3399: Get bl31.elf via BL31 env
Kconfig: Add u-boot.itb BUILD_TARGET for Rockchip Makefile.spl: Create u-boot-spl-rockchip.bin for rk3399
rockchip: rk3399: Create single image using BINMAN

 Kconfig                                 |  2 +-
 Makefile                                | 13 +++++++++++++
 arch/arm/dts/rk3399-evb-u-boot.dtsi     |  7 +++++++
 arch/arm/dts/rk3399-evb.dts             |  2 --
 arch/arm/dts/rk3399-ficus-u-boot.dtsi   |  7 +++++++
 arch/arm/dts/rk3399-ficus.dts           |  1 -
 arch/arm/dts/rk3399-firefly-u-boot.dtsi |  7 +++++++
 arch/arm/dts/rk3399-firefly.dts         |  2 --
 arch/arm/dts/rk3399-gru-bob-u-boot.dtsi |  7 +++++++
 arch/arm/dts/rk3399-gru-bob.dts         |  1 -
 arch/arm/dts/rk3399-gru.dtsi            |  1 -
 arch/arm/dts/rk3399-puma-ddr1600.dts    |  2 +-
 arch/arm/dts/rk3399-puma.dtsi           |  3 ---
 arch/arm/dts/rk3399-rock960-u-boot.dtsi |  7 +++++++
 arch/arm/dts/rk3399-rock960.dts         |  1 -
 arch/arm/dts/rk3399-u-boot.dtsi         | 21 +++++++++++++++++++++
 arch/arm/mach-rockchip/Kconfig          |  9 +++++++++
 arch/arm/mach-rockchip/make_fit_atf.py  |  5 ++++-
 doc/README.rockchip                     | 15 ++++-----------
 include/configs/rk3399_common.h         |  2 ++
 scripts/Makefile.spl                    | 21 +++++++++++++++++++++
 21 files changed, 111 insertions(+), 25 deletions(-)
 create mode 100644 arch/arm/dts/rk3399-evb-u-boot.dtsi
 create mode 100644 arch/arm/dts/rk3399-ficus-u-boot.dtsi
 create mode 100644 arch/arm/dts/rk3399-firefly-u-boot.dtsi
 create mode 100644 arch/arm/dts/rk3399-gru-bob-u-boot.dtsi
 create mode 100644 arch/arm/dts/rk3399-rock960-u-boot.dtsi
Signature · 1 line
2.18.0.321.gffc6fa0e3

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

author
#2 lore raw

PATCH 1/5 arm64: rockchip: dts: rk3399: Create -u-boot.dtsi files

We have a base rk3399-u-boot.dtsi which enabled sdmmc for SPL, extend the same with spi1 so-that the SPL spi boot boards can make use of the same.

So, to make use of this common rk3399-u-boot.dtsi we have to include this in respective dts files.

So, this patch will create all preliminary infrastructure, like
- create -u-boot.dtsi
- include rk3399-u-boot.dtsi
- move sdram dtsi into -u-boot.dtsi
- drop sdmmc, u-boot,dm-pre-reloc
- drop spi1, u-boot,dm-pre-reloc

This would help to
- sync the dts(i) files from Linux whenever required instead of adding specific nodes.
- easy to add u-boot specific changes like binman node into common -u-boot.dtsi file

---
 arch/arm/dts/rk3399-evb-u-boot.dtsi     | 7 +++++++
 arch/arm/dts/rk3399-evb.dts             | 2 --
 arch/arm/dts/rk3399-ficus-u-boot.dtsi   | 7 +++++++
 arch/arm/dts/rk3399-ficus.dts           | 1 -
 arch/arm/dts/rk3399-firefly-u-boot.dtsi | 7 +++++++
 arch/arm/dts/rk3399-firefly.dts         | 2 --
 arch/arm/dts/rk3399-gru-bob-u-boot.dtsi | 7 +++++++
 arch/arm/dts/rk3399-gru-bob.dts         | 1 -
 arch/arm/dts/rk3399-gru.dtsi            | 1 -
 arch/arm/dts/rk3399-puma-ddr1600.dts    | 2 +-
 arch/arm/dts/rk3399-puma.dtsi           | 3 ---
 arch/arm/dts/rk3399-rock960-u-boot.dtsi | 7 +++++++
 arch/arm/dts/rk3399-rock960.dts         | 1 -
 arch/arm/dts/rk3399-u-boot.dtsi         | 4 ++++
 14 files changed, 40 insertions(+), 12 deletions(-)
 create mode 100644 arch/arm/dts/rk3399-evb-u-boot.dtsi
 create mode 100644 arch/arm/dts/rk3399-ficus-u-boot.dtsi
 create mode 100644 arch/arm/dts/rk3399-firefly-u-boot.dtsi
 create mode 100644 arch/arm/dts/rk3399-gru-bob-u-boot.dtsi
 create mode 100644 arch/arm/dts/rk3399-rock960-u-boot.dtsi
arch/arm/dts/rk3399-evb-u-boot.dtsi new file +7 -0
new file mode 100644
index 0000000000..20910e744b
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
+ */
+
+#include "rk3399-u-boot.dtsi"
+#include "rk3399-sdram-lpddr3-4GB-1600.dtsi"
arch/arm/dts/rk3399-evb.dts +0 -2
index ce004d0d18..a506e8da37 100644
@@ -7,7 +7,6 @@
 #include <dt-bindings/pwm/pwm.h>
 #include <dt-bindings/pinctrl/rockchip.h>
 #include "rk3399.dtsi"
-#include "rk3399-sdram-lpddr3-4GB-1600.dtsi"
 
 / {
 	model = "Rockchip RK3399 Evaluation Board";
@@ -155,7 +154,6 @@
 };
 
 &sdmmc {
-	u-boot,dm-pre-reloc;
 	bus-width = <4>;
 	status = "okay";
 };
arch/arm/dts/rk3399-ficus-u-boot.dtsi new file +7 -0
new file mode 100644
index 0000000000..67b63a8352
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
+ */
+
+#include "rk3399-u-boot.dtsi"
+#include "rk3399-sdram-ddr3-1600.dtsi"
arch/arm/dts/rk3399-ficus.dts +0 -1
index 4af0e4e383..4b2dd82b67 100644
@@ -8,7 +8,6 @@
 
 /dts-v1/;
 #include "rk3399-rock960.dtsi"
-#include "rk3399-sdram-ddr3-1600.dtsi"
 
 / {
 	model = "96boards RK3399 Ficus";
arch/arm/dts/rk3399-firefly-u-boot.dtsi new file +7 -0
new file mode 100644
index 0000000000..67b63a8352
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
+ */
+
+#include "rk3399-u-boot.dtsi"
+#include "rk3399-sdram-ddr3-1600.dtsi"
arch/arm/dts/rk3399-firefly.dts +0 -2
index f90e7e88db..a4cb64f8bd 100644
@@ -7,7 +7,6 @@
 #include <dt-bindings/pwm/pwm.h>
 #include <dt-bindings/pinctrl/rockchip.h>
 #include "rk3399.dtsi"
-#include "rk3399-sdram-ddr3-1600.dtsi"
 
 / {
 	model = "Firefly-RK3399 Board";
@@ -592,7 +591,6 @@
 };
 
 &sdmmc {
-	u-boot,dm-pre-reloc;
 	bus-width = <4>;
 	status = "okay";
 };
arch/arm/dts/rk3399-gru-bob-u-boot.dtsi new file +7 -0
new file mode 100644
index 0000000000..f0d31edefd
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
+ */
+
+#include "rk3399-u-boot.dtsi"
+#include "rk3399-sdram-lpddr3-samsung-4GB-1866.dtsi"
arch/arm/dts/rk3399-gru-bob.dts +0 -1
index 0e3d91fc28..1ee0dc0d9f 100644
@@ -7,7 +7,6 @@
 
 /dts-v1/;
 #include "rk3399-gru-chromebook.dtsi"
-#include "rk3399-sdram-lpddr3-samsung-4GB-1866.dtsi"
 
 / {
 	model = "Google Bob";
arch/arm/dts/rk3399-gru.dtsi +0 -1
index df19263acc..8b3d90fdc6 100644
@@ -545,7 +545,6 @@ ap_i2c_audio: &i2c8 {
 
 &spi1 {
 	status = "okay";
-	u-boot,dm-pre-reloc;
 
 	pinctrl-names = "default", "sleep";
 	pinctrl-1 = <&spi1_sleep>;
arch/arm/dts/rk3399-puma-ddr1600.dts +1 -1
index 337e0eabb4..b4fc2457f0 100644
@@ -6,5 +6,5 @@
 /dts-v1/;
 
 #include "rk3399-puma.dtsi"
+#include "rk3399-u-boot.dtsi"
 #include "rk3399-sdram-ddr3-1600.dtsi"
-
arch/arm/dts/rk3399-puma.dtsi +0 -3
index 8304f67192..2712ab6826 100644
@@ -492,7 +492,6 @@
 };
 
 &sdmmc {
-	u-boot,dm-pre-reloc;
 	clock-frequency = <150000000>;
 	max-frequency = <40000000>;
 	supports-sd;
@@ -648,8 +647,6 @@
 
 
 &spi1 {
-	u-boot,dm-pre-reloc;
-
 	status = "okay";
 
 	#address-cells = <1>;
arch/arm/dts/rk3399-rock960-u-boot.dtsi new file +7 -0
new file mode 100644
index 0000000000..7fb5072a9b
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
+ */
+
+#include "rk3399-u-boot.dtsi"
+#include "rk3399-sdram-lpddr3-2GB-1600.dtsi"
arch/arm/dts/rk3399-rock960.dts +0 -1
index 25c58b4261..7e06bc97e5 100644
@@ -5,7 +5,6 @@
 
 /dts-v1/;
 #include "rk3399-rock960.dtsi"
-#include "rk3399-sdram-lpddr3-2GB-1600.dtsi"
 
 / {
 	model = "96boards Rock960";
arch/arm/dts/rk3399-u-boot.dtsi +4 -0
index f533ed95eb..0786c1193a 100644
@@ -6,3 +6,7 @@
 &sdmmc {
 	u-boot,dm-pre-reloc;
 };
+
+&spi1 {
+	u-boot,dm-pre-reloc;
+};
Signature · 1 line
2.18.0.321.gffc6fa0e3

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

#4 lore raw

Re: [PATCH 1/5] arm64: rockchip: dts: rk3399: Create -u-boot.dtsi files

Hi,

Please split off this two commits to another dedicated series, with the patch introducing rk3399-u-boot.dtsi. You can then decide to introduce rk3399 boards support (in a third series) before or after.

Cheers,

Paul

Quoted 233 lines · Jagan Teki

We have a base rk3399-u-boot.dtsi which enabled sdmmc for SPL, extend the same with spi1 so-that the SPL spi boot boards can make use of the same.

So, to make use of this common rk3399-u-boot.dtsi we have to include this in respective dts files.

So, this patch will create all preliminary infrastructure, like
- create -u-boot.dtsi
- include rk3399-u-boot.dtsi
- move sdram dtsi into -u-boot.dtsi
- drop sdmmc, u-boot,dm-pre-reloc
- drop spi1, u-boot,dm-pre-reloc

This would help to
- sync the dts(i) files from Linux whenever required instead of adding specific nodes.
- easy to add u-boot specific changes like binman node into common -u-boot.dtsi file

---
 arch/arm/dts/rk3399-evb-u-boot.dtsi     | 7 +++++++
 arch/arm/dts/rk3399-evb.dts             | 2 --
 arch/arm/dts/rk3399-ficus-u-boot.dtsi   | 7 +++++++
 arch/arm/dts/rk3399-ficus.dts           | 1 -
 arch/arm/dts/rk3399-firefly-u-boot.dtsi | 7 +++++++
 arch/arm/dts/rk3399-firefly.dts         | 2 --
 arch/arm/dts/rk3399-gru-bob-u-boot.dtsi | 7 +++++++
 arch/arm/dts/rk3399-gru-bob.dts         | 1 -
 arch/arm/dts/rk3399-gru.dtsi            | 1 -
 arch/arm/dts/rk3399-puma-ddr1600.dts    | 2 +-
 arch/arm/dts/rk3399-puma.dtsi           | 3 ---
 arch/arm/dts/rk3399-rock960-u-boot.dtsi | 7 +++++++
 arch/arm/dts/rk3399-rock960.dts         | 1 -
 arch/arm/dts/rk3399-u-boot.dtsi         | 4 ++++
 14 files changed, 40 insertions(+), 12 deletions(-)
 create mode 100644 arch/arm/dts/rk3399-evb-u-boot.dtsi
 create mode 100644 arch/arm/dts/rk3399-ficus-u-boot.dtsi
 create mode 100644 arch/arm/dts/rk3399-firefly-u-boot.dtsi
 create mode 100644 arch/arm/dts/rk3399-gru-bob-u-boot.dtsi
 create mode 100644 arch/arm/dts/rk3399-rock960-u-boot.dtsi
arch/arm/dts/rk3399-evb-u-boot.dtsi new file +7 -0
new file mode 100644
index 0000000000..20910e744b
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Jagan Teki <[email protected]>
+ */
+
+#include "rk3399-u-boot.dtsi"
+#include "rk3399-sdram-lpddr3-4GB-1600.dtsi"
arch/arm/dts/rk3399-evb.dts +0 -2
index ce004d0d18..a506e8da37 100644
@@ -7,7 +7,6 @@
 #include <dt-bindings/pwm/pwm.h>
 #include <dt-bindings/pinctrl/rockchip.h>
 #include "rk3399.dtsi"
-#include "rk3399-sdram-lpddr3-4GB-1600.dtsi"
 
 / {
 	model = "Rockchip RK3399 Evaluation Board";
@@ -155,7 +154,6 @@
 };
 
 &sdmmc {
-	u-boot,dm-pre-reloc;
 	bus-width = <4>;
 	status = "okay";
 };
arch/arm/dts/rk3399-ficus-u-boot.dtsi new file +7 -0
new file mode 100644
index 0000000000..67b63a8352
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Jagan Teki <[email protected]>
+ */
+
+#include "rk3399-u-boot.dtsi"
+#include "rk3399-sdram-ddr3-1600.dtsi"
arch/arm/dts/rk3399-ficus.dts +0 -1
index 4af0e4e383..4b2dd82b67 100644
@@ -8,7 +8,6 @@
 
 /dts-v1/;
 #include "rk3399-rock960.dtsi"
-#include "rk3399-sdram-ddr3-1600.dtsi"
 
 / {
 	model = "96boards RK3399 Ficus";
arch/arm/dts/rk3399-firefly-u-boot.dtsi new file +7 -0
new file mode 100644
index 0000000000..67b63a8352
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Jagan Teki <[email protected]>
+ */
+
+#include "rk3399-u-boot.dtsi"
+#include "rk3399-sdram-ddr3-1600.dtsi"
arch/arm/dts/rk3399-firefly.dts +0 -2
index f90e7e88db..a4cb64f8bd 100644
@@ -7,7 +7,6 @@
 #include <dt-bindings/pwm/pwm.h>
 #include <dt-bindings/pinctrl/rockchip.h>
 #include "rk3399.dtsi"
-#include "rk3399-sdram-ddr3-1600.dtsi"
 
 / {
 	model = "Firefly-RK3399 Board";
@@ -592,7 +591,6 @@
 };
 
 &sdmmc {
-	u-boot,dm-pre-reloc;
 	bus-width = <4>;
 	status = "okay";
 };
arch/arm/dts/rk3399-gru-bob-u-boot.dtsi new file +7 -0
new file mode 100644
index 0000000000..f0d31edefd
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Jagan Teki <[email protected]>
+ */
+
+#include "rk3399-u-boot.dtsi"
+#include "rk3399-sdram-lpddr3-samsung-4GB-1866.dtsi"
arch/arm/dts/rk3399-gru-bob.dts +0 -1
index 0e3d91fc28..1ee0dc0d9f 100644
@@ -7,7 +7,6 @@
 
 /dts-v1/;
 #include "rk3399-gru-chromebook.dtsi"
-#include "rk3399-sdram-lpddr3-samsung-4GB-1866.dtsi"
 
 / {
 	model = "Google Bob";
arch/arm/dts/rk3399-gru.dtsi +0 -1
index df19263acc..8b3d90fdc6 100644
@@ -545,7 +545,6 @@ ap_i2c_audio: &i2c8 {
 
 &spi1 {
 	status = "okay";
-	u-boot,dm-pre-reloc;
 
 	pinctrl-names = "default", "sleep";
 	pinctrl-1 = <&spi1_sleep>;
arch/arm/dts/rk3399-puma-ddr1600.dts +1 -1
index 337e0eabb4..b4fc2457f0 100644
@@ -6,5 +6,5 @@
 /dts-v1/;
 
 #include "rk3399-puma.dtsi"
+#include "rk3399-u-boot.dtsi"
 #include "rk3399-sdram-ddr3-1600.dtsi"
-
arch/arm/dts/rk3399-puma.dtsi +0 -3
index 8304f67192..2712ab6826 100644
@@ -492,7 +492,6 @@
 };
 
 &sdmmc {
-	u-boot,dm-pre-reloc;
 	clock-frequency = <150000000>;
 	max-frequency = <40000000>;
 	supports-sd;
@@ -648,8 +647,6 @@
 
 
 &spi1 {
-	u-boot,dm-pre-reloc;
-
 	status = "okay";
 
 	#address-cells = <1>;
arch/arm/dts/rk3399-rock960-u-boot.dtsi new file +7 -0
new file mode 100644
index 0000000000..7fb5072a9b
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Jagan Teki <[email protected]>
+ */
+
+#include "rk3399-u-boot.dtsi"
+#include "rk3399-sdram-lpddr3-2GB-1600.dtsi"
arch/arm/dts/rk3399-rock960.dts +0 -1
index 25c58b4261..7e06bc97e5 100644
@@ -5,7 +5,6 @@
 
 /dts-v1/;
 #include "rk3399-rock960.dtsi"
-#include "rk3399-sdram-lpddr3-2GB-1600.dtsi"
 
 / {
 	model = "96boards Rock960";
arch/arm/dts/rk3399-u-boot.dtsi +0 -0
index f533ed95eb..0786c1193a 100644

arch/arm/dts/rk3399-u-boot.dtsi line 12

Quoted 7 lines
arch/arm/dts/rk3399-u-boot.dtsi +4 -0
@@ -6,3 +6,7 @@
 &sdmmc {
 	u-boot,dm-pre-reloc;
 };
+
+&spi1 {
+	u-boot,dm-pre-reloc;
+};

_______________________________________________
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): ed9636781f6a0f2f648506a46bff6a656b93ceb2.camel-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org

author
#6 lore raw

Re: [PATCH 1/5] arm64: rockchip: dts: rk3399: Create -u-boot.dtsi files

Quoted 6 lines · Paul Kocialkowski

Hi,

Please split off this two commits to another dedicated series, with the patch introducing rk3399-u-boot.dtsi. You can then decide to introduce rk3399 boards support (in a third series) before or after.

Just moved thins into initial and make it single patch change[1] and send as part of that series since it has rk3399-u-boot.dtsi which can make use of new boards on that series.

[1] https://patchwork.ozlabs.org/patch/1091720/

author
#7 lore raw

PATCH 2/5 rockchip: rk3399: Get bl31.elf via BL31 env

In reply to a message not in the archive

Right now rockchip platform need to copy bl31.elf into u-boot source directory to make use of building u-boot.itb.

So, add environment variable BL31 like Allwinner SoC so-that the bl31.elf would available via BL31.

---
 arch/arm/mach-rockchip/make_fit_atf.py | 5 ++++-
 doc/README.rockchip                    | 4 ++--
 2 files changed, 6 insertions(+), 3 deletions(-)
arch/arm/mach-rockchip/make_fit_atf.py +4 -1
index d1faff1957..99cf6f43dc 100755
@@ -194,8 +194,11 @@ def get_bl31_segments_info(bl31_file_name):
 
 def main():
     uboot_elf="./u-boot"
-    bl31_elf="./bl31.elf"
     FIT_ITS=sys.stdout
+    if "BL31" in os.environ:
+        bl31_elf=os.getenv("BL31");
+    else:
+        sys.exit("ERROR: Please export BL31 file, check doc/README.rockchip")
 
     opts, args = getopt.getopt(sys.argv[1:], "o:u:b:h")
     for opt, val in opts:
doc/README.rockchip +2 -2
index e8f6a2dfba..0db4771162 100644
@@ -138,8 +138,8 @@ For example:
      => make realclean
      => make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399
 
-     (copy bl31.elf U-Boot root dir)
-     => cp build/rk3399/release/bl31/bl31.elf /path/to/u-boot
+     (export bl31.elf)
+     => export BL31=/path/to/arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf
 
    - Compile U-Boot
 
Signature · 1 line
2.18.0.321.gffc6fa0e3
author
#8 lore raw

PATCH 3/5 Kconfig: Add u-boot.itb BUILD_TARGET for Rockchip

In reply to a message not in the archive

Add u-boot.itb BUILD_TARGET for Rockchip platform when SPL_LOAD_FIT is being used.

This can get rid of building itb explicitly with 'make u-boot.itb' all required images will now build just by make.

---
 Kconfig             | 2 +-
 doc/README.rockchip | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)
Kconfig +1 -1
index 5679a288ec..46f511123a 100644
@@ -230,7 +230,7 @@ config BUILD_TARGET
 	default "u-boot-with-spl.sfp" if TARGET_SOCFPGA_GEN5
 	default "u-boot-spl.kwb" if ARCH_MVEBU && SPL
 	default "u-boot-elf.srec" if RCAR_GEN3
-	default "u-boot.itb" if SPL_LOAD_FIT && ARCH_SUNXI
+	default "u-boot.itb" if SPL_LOAD_FIT && (ARCH_ROCKCHIP || ARCH_SUNXI)
 	default "u-boot.kwb" if KIRKWOOD
 	help
 	  Some SoCs need special image types (e.g. U-Boot binary
doc/README.rockchip +0 -2
index 0db4771162..124efd65e4 100644
@@ -103,7 +103,6 @@ For example:
      => cd /path/to/u-boot
      => make nanopi-neo4-rk3399_defconfig
      => make
-     => make u-boot.itb
 
    - Get the rkbin
 
@@ -146,7 +145,6 @@ For example:
      => cd /path/to/u-boot
      => make orangepi-rk3399_defconfig
      => make
-     => make u-boot.itb
 
      (Get spl/u-boot-spl-dtb.bin, u-boot.itb images and some boards would get
       spl/u-boot-spl.bin since it doesn't enable CONFIG_SPL_OF_CONTROL)
Signature · 1 line
2.18.0.321.gffc6fa0e3
author
#9 lore raw

PATCH 4/5 Makefile.spl: Create u-boot-spl-rockchip.bin for rk3399

In reply to a message not in the archive

Rockchip platform would require an explicit call to mkimage for creating bootable images which indeed specific to SoC family along with boot devices.

Example of creating bootable image for rk3399 family with SD boot device as

₹ mkimage -n rk3399 -T rksd -d ./spl/u-boot-spl-dtb.bin u-boot-spl-rockchip.bin

This patch would do the same think via Makefile.spl for rk3399.

This would be an initial version and it can easily expand further to support other families of SoC's with variety of boot stages like TPL, SPL.

---
 arch/arm/mach-rockchip/Kconfig |  8 ++++++++
 doc/README.rockchip            |  3 +--
 scripts/Makefile.spl           | 21 +++++++++++++++++++++
 3 files changed, 30 insertions(+), 2 deletions(-)
arch/arm/mach-rockchip/Kconfig +8 -0
index dbe7f11d39..286c870135 100644
@@ -222,6 +222,14 @@ config ROCKCHIP_SPL_RESERVE_IRAM
 config ROCKCHIP_BROM_HELPER
 	bool
 
+config SPL_ROCKCHIP_IMG_NAME
+	string "SPL Rockchip image name"
+	default "rk3399" if ROCKCHIP_RK3399
+	help
+	  To create SPL image for rockchip targets the image name would
+	  depends on the SoC family that would pass as an argument as
+	  '-n rk3399' to mkimage for creating Rockchip SPL boot image.
+
 config SPL_ROCKCHIP_EARLYRETURN_TO_BROM
         bool "SPL requires early-return (for RK3188-style BROM) to BROM"
 	depends on SPL && ENABLE_ARM_SOC_BOOT0_HOOK
doc/README.rockchip +1 -2
index 124efd65e4..73594dc61d 100644
@@ -397,11 +397,10 @@ Option 2: Package the image with SPL:
   - Prefix rk3399 header to SPL image
 
     => cd /path/to/u-boot
-    => ./tools/mkimage -n rk3399 -T rksd -d spl/u-boot-spl-dtb.bin out
 
   - Write prefixed SPL at 64th sector
 
-    => sudo dd if=out of=/dev/sdc seek=64
+    => sudo dd if=spl/u-boot-spl-rockchip.bin of=/dev/sdc seek=64
 
   - Write U-Boot proper at 16384 sector
 
scripts/Makefile.spl +21 -0
index 54b160d72b..49c0641aa2 100644
@@ -235,6 +235,10 @@ ALL-$(CONFIG_ARCH_ZYNQMP)	+= $(obj)/boot.bin
 
 ALL-$(CONFIG_ARCH_MEDIATEK)	+= $(obj)/u-boot-spl-mtk.bin
 
+ifdef CONFIG_ROCKCHIP_RK3399
+ALL-$(CONFIG_ARCH_ROCKCHIP)	+= $(obj)/u-boot-spl-rockchip.bin
+endif
+
 all:	$(ALL-y)
 
 quiet_cmd_cat = CAT     $@
@@ -369,6 +373,23 @@ MKIMAGEFLAGS_u-boot-spl-mtk.bin = -T mtk_image \
 $(obj)/u-boot-spl-mtk.bin: $(obj)/u-boot-spl.bin FORCE
 	$(call if_changed,mkimage)
 
+# Rockchip specific SPL build
+ifeq ($(CONFIG_ROCKCHIP_RK3399),y)
+
+ifeq ($(CONFIG_SPI_FLASH_SUPPORT),y)
+ROCKCHIP_IMG_TYPE := rkspi
+else
+ROCKCHIP_IMG_TYPE := rksd
+endif
+
+MKIMAGEFLAGS_u-boot-spl-rockchip.bin = -n $(CONFIG_SPL_ROCKCHIP_IMG_NAME) \
+	-T $(ROCKCHIP_IMG_TYPE) -d $(MKIMAGEOUTPUT)
+
+$(obj)/u-boot-spl-rockchip.bin: $(obj)/u-boot-spl.bin FORCE
+	$(call if_changed,mkimage)
+
+endif # CONFIG_ROCKCHIP_RK3399
+
 # Rule to link u-boot-spl
 # May be overridden by arch/$(ARCH)/config.mk
 quiet_cmd_u-boot-spl ?= LD      $@
Signature · 7 lines
2.18.0.321.gffc6fa0e3


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

PATCH 5/5 rockchip: rk3399: Create single image using BINMAN

In reply to a message not in the archive

RK3399 platform has two stage boot loaders like 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.

without this patch:
------------------
₹ sudo dd if=spl/u-boot-spl-rockchip.bin of=/dev/sdc seek=64 ₹ sudo dd if=u-boot.itb of=/dev/sdc seek=16384

with this patch:
---------------
₹ sudo dd if=u-boot-rockchip-with-spl.bin of=/dev/sdc seek=64

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

---
 Makefile                        | 13 +++++++++++++
 arch/arm/dts/rk3399-u-boot.dtsi | 17 +++++++++++++++++
 arch/arm/mach-rockchip/Kconfig  |  1 +
 doc/README.rockchip             |  8 ++------
 include/configs/rk3399_common.h |  2 ++
 5 files changed, 35 insertions(+), 6 deletions(-)
Makefile +13 -0
index 92e04dd689..e7f68d63c7 100644
@@ -851,6 +851,11 @@ ifeq ($(CONFIG_ARCH_SUNXI)$(CONFIG_SPL),yy)
 ALL-y += u-boot-sunxi-with-spl.bin
 endif
 
+# Build a combined spl + u-boot image for rockchip
+ifdef CONFIG_ROCKCHIP_RK3399
+ALL-$(CONFIG_ARCH_ROCKCHIP) += u-boot-rockchip-with-spl.bin
+endif
+
 # enable combined SPL/u-boot/dtb rules for tegra
 ifeq ($(CONFIG_TEGRA)$(CONFIG_SPL),yy)
 ALL-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin
@@ -1366,6 +1371,11 @@ u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.itb FORCE
 endif
 endif
 
+ifeq ($(CONFIG_ROCKCHIP_RK3399),y)
+u-boot-rockchip-with-spl.bin: spl/u-boot-spl-rockchip.bin u-boot.itb FORCE
+	@$(call if_changed,binman)
+endif # CONFIG_ROCKCHIP_RK3399
+
 ifneq ($(CONFIG_TEGRA),)
 ifneq ($(CONFIG_BINMAN),)
 # Makes u-boot-dtb-tegra.bin u-boot-tegra.bin u-boot-nodtb-tegra.bin
@@ -1664,6 +1674,9 @@ spl/u-boot-spl: tools prepare \
 spl/sunxi-spl.bin: spl/u-boot-spl
 	@:
 
+spl/u-boot-spl-rockchip.bin: spl/u-boot-spl
+	@:
+
 spl/sunxi-spl-with-ecc.bin: spl/sunxi-spl.bin
 	@:
 
arch/arm/dts/rk3399-u-boot.dtsi +17 -0
index 0786c1193a..abd0b091ab 100644
@@ -3,6 +3,23 @@
  * Copyright (C) 2019 Jagan Teki <[email protected]>
  */
 
+#include <config.h>
+
+/ {
+	binman {
+		filename = "u-boot-rockchip-with-spl.bin";
+		pad-byte = <0xff>;
+
+		blob {
+			filename = "spl/u-boot-spl-rockchip.bin";
+		};
+
+		u-boot-img {
+			offset = <CONFIG_SPL_PAD_TO>;
+		};
+	};
+};
+
 &sdmmc {
 	u-boot,dm-pre-reloc;
 };
arch/arm/mach-rockchip/Kconfig +1 -0
index 286c870135..7ac0ee3c2d 100644
@@ -130,6 +130,7 @@ endif
 config ROCKCHIP_RK3399
 	bool "Support Rockchip RK3399"
 	select ARM64
+	select BINMAN
 	select SUPPORT_SPL
 	select SPL
 	select SPL_ATF
doc/README.rockchip +2 -6
index 73594dc61d..791e528262 100644
@@ -398,13 +398,9 @@ Option 2: Package the image with SPL:
 
     => cd /path/to/u-boot
 
-  - Write prefixed SPL at 64th sector
+  - Write single spl + u-boot at 64th sector
 
-    => sudo dd if=spl/u-boot-spl-rockchip.bin of=/dev/sdc seek=64
-
-  - Write U-Boot proper at 16384 sector
-
-    => sudo dd if=u-boot.itb of=/dev/sdc seek=16384
+    => sudo dd if=u-boot-rockchip-with-spl.bin of=/dev/sdc seek=64
     => sync
 
 Put this SD (or micro-SD) card into your board and reset it. You should see
include/configs/rk3399_common.h +2 -0
index b412012582..a658f03ade 100644
@@ -38,6 +38,8 @@
 #define CONFIG_SYS_SDRAM_BASE		0
 #define SDRAM_MAX_SIZE			0xf8000000
 
+#define CONFIG_SPL_PAD_TO		8355840
+
 #ifndef CONFIG_SPL_BUILD
 
 #define ENV_MEM_LAYOUT_SETTINGS \
Signature · 7 lines
2.18.0.321.gffc6fa0e3


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
#11 lore raw
In reply to Jagan Teki

Hi Tom and Simon,

Quoted 11 lines · Jagan Teki

This series will create single bootable image 'u-boot-rockchip-with-spl.bin' for rk3399 platform with single make command instead of building u-boot separately for u-boot.itb and burn them separately for SPL and U-Boot proper.

This series has dependecy with[1]

travis-ci issue:
- need to include 'python-pyelftools' package, tried but can't succeed
- right now build failed if BL31 is not exported, but this would manage to create dummy arm64 elf but any help on this would appreciate.

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

#12 lore raw
Quoted 7 lines · Jagan Teki

Hi Tom and Simon,

Quoted 4 lines · Jagan Teki

This series will create single bootable image 'u-boot-rockchip-with-spl.bin' for rk3399 platform with single make command instead of building u-boot separately for u-boot.itb and burn them separately for SPL and U-Boot proper.

Quoted 8 lines
Quoted 6 lines

This series has dependecy with[1]

travis-ci issue:
- need to include 'python-pyelftools' package, tried but can't succeed
- right now build failed if BL31 is not exported, but this would manage to create dummy arm64 elf but any help on this would appreciate.

Any inputs on this?

I think we have the same issue regarding BL31 for ARM64 sunxi boards don't we?

It would be great to have a solution to this, and even better if it could scale to most ARM64 platforms too!

Cheers,

Paul

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

#13 lore raw
Quoted 15 lines · Paul Kocialkowski
Quoted 14 lines · Jagan Teki

Hi Tom and Simon,

Quoted 10 lines · Jagan Teki

This series will create single bootable image 'u-boot-rockchip-with-spl.bin' for rk3399 platform with single make command instead of building u-boot separately for u-boot.itb and burn them separately for SPL and U-Boot proper.

This series has dependecy with[1]

travis-ci issue:
- need to include 'python-pyelftools' package, tried but can't succeed
- right now build failed if BL31 is not exported, but this would manage to create dummy arm64 elf but any help on this would appreciate.

Quoted 7 lines
Quoted 1 line

Any inputs on this?

I think we have the same issue regarding BL31 for ARM64 sunxi boards don't we?

It would be great to have a solution to this, and even better if it could scale to most ARM64 platforms too!

As I said in another thread, yes, we really should look at how to make binman take care of this as every arm64 platform has the same problem and similar but not quite the same solution.

Signature · 1 line
Tom

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

#14 lore raw
In reply to Paul Kocialkowski
Quoted 16 lines · Paul Kocialkowski
Quoted 14 lines · Jagan Teki

Hi Tom and Simon,

Quoted 10 lines · Jagan Teki

This series will create single bootable image 'u-boot-rockchip-with-spl.bin' for rk3399 platform with single make command instead of building u-boot separately for u-boot.itb and burn them separately for SPL and U-Boot proper.

This series has dependecy with[1]

travis-ci issue:
- need to include 'python-pyelftools' package, tried but can't succeed
- right now build failed if BL31 is not exported, but this would manage to create dummy arm64 elf but any help on this would appreciate.

Quoted 7 lines
Quoted 1 line

Any inputs on this?

I think we have the same issue regarding BL31 for ARM64 sunxi boards don't we?

It would be great to have a solution to this, and even better if it could scale to most ARM64 platforms too!

I thought it would be specific with tools here, I have created some dummy bl31.elf if BL31 is not set but the arch/arm/mach-rockchip/make_fit_atf.py can't make the build. on the other hand I have compiled main(){} and created bl31.elf it is succeeding.

But for sunxi the build is going as normal by setting /dev/null if BL31 unset.

[ -z "$BL31" ] && BL31="bl31.bin"

if [ ! -f $BL31 ]; then
echo "WARNING: BL31 file $BL31 NOT found, resulting binary is
non-functional" >&2
echo "Please read the section on ARM Trusted Firmware (ATF) in
board/sunxi/README.sunxi64" >&2

        BL31=/dev/null
        echo $BL31

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