All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb
@ 2021-05-10  6:58 Bin Meng
  2021-05-10  6:58 ` [PATCH v4 01/13] common: kconfig: Correct a typo in SPL_LOAD_FIT Bin Meng
                   ` (14 more replies)
  0 siblings, 15 replies; 25+ messages in thread
From: Bin Meng @ 2021-05-10  6:58 UTC (permalink / raw)
  To: u-boot

This series updates binman to handle creation of u-boot.itb image for
RISC-V boards.

Azure results: PASS
https://dev.azure.com/bmeng/GitHub/_build/results?buildId=363&view=results

The following tests were performed:
* booting qemu-riscv{32|64}_spl_defconfig on QEMU virt
* booting sifive_unleashed_defconfig on QEMU sifive_u

AE350 SPL defconfigs are not tested. @Rick, could you please test and report?

The series is available at u-boot-x86/riscv_binman for testing.


Changes in v4:
- update the makefile dependency on u-boot.img instead of u-boot.bin

Changes in v3:
- Fix the opensbi entry type in binman.dtsi
- new patch: "lib: kconfig: Limit BINMAN_FDT for OF_SEPARATE or OF_EMBED"
- rename the Kconfig option name to BINMAN_STANDALONE_FDT
- make BINMAN_STANDALONE_FDT default y for OF_BOARD as well
- reword the Kconfig option help message a little bit
- new patch: "riscv: ae350: Switch to use binman to generate u-boot.itb"
- remove USE_SPL_FIT_GENERATOR in ae350_ defconfigs

Changes in v2:
- drop patch: "binman: test: Correct the name of 170_fit_fdt_missing_prop.dts",
  as it was based on a wrong version
- drop patch: "makefile: Update clean rule to remove files generated by binman",
  as it is better to refactor binman to generate all intermediate files for
  makefile to clean
- drop "size = <16>" in the binman node
- new patch: "binman: Support packaging U-Boot for scenarios like OF_PRIOR_STAGE"
- new patch: "riscv: dts: Sort build targets in alphabetical order"
- new patch: "riscv: qemu: Switch to use binman to generate u-boot.itb"
- new patch: "riscv: Drop USE_SPL_FIT_GENERATOR"

Bin Meng (13):
  common: kconfig: Correct a typo in SPL_LOAD_FIT
  binman: Correct '-a' description in the doc
  binman: Correct the comment for ATF entry type
  binman: test: Rename 172_fit_fdt.dts to 170_fit_fdt.dts
  binman: Add support for RISC-V OpenSBI fw_dynamic blob
  makefile: Pass OpenSBI blob to binman make rules
  riscv: sifive: unleashed: Switch to use binman to generate u-boot.itb
  lib: kconfig: Limit BINMAN_FDT for OF_SEPARATE or OF_EMBED
  binman: Support packaging U-Boot for scenarios like OF_BOARD or
    OF_PRIOR_STAGE
  riscv: dts: Sort build targets in alphabetical order
  riscv: qemu: Switch to use binman to generate u-boot.itb
  riscv: ae350: Switch to use binman to generate u-boot.itb
  riscv: Drop USE_SPL_FIT_GENERATOR

 Makefile                                      |   4 +-
 arch/riscv/cpu/generic/Kconfig                |   1 +
 arch/riscv/dts/Makefile                       |   3 +-
 arch/riscv/dts/ae350_32.dts                   |   2 +
 arch/riscv/dts/ae350_64.dts                   |   2 +
 arch/riscv/dts/binman.dtsi                    |  78 ++++++++++++++
 .../dts/hifive-unleashed-a00-u-boot.dtsi      |   1 +
 arch/riscv/dts/qemu-virt.dts                  |   8 ++
 arch/riscv/lib/mkimage_fit_opensbi.sh         | 100 ------------------
 board/AndesTech/ax25-ae350/Kconfig            |   1 +
 board/sifive/unleashed/Kconfig                |   1 +
 common/Kconfig.boot                           |   5 +-
 configs/ae350_rv32_spl_defconfig              |   1 +
 configs/ae350_rv32_spl_xip_defconfig          |   1 +
 configs/ae350_rv64_spl_defconfig              |   1 +
 configs/ae350_rv64_spl_xip_defconfig          |   1 +
 configs/qemu-riscv32_spl_defconfig            |   1 +
 configs/qemu-riscv64_spl_defconfig            |   1 +
 dts/Kconfig                                   |  18 ++++
 lib/Kconfig                                   |   2 +-
 tools/binman/binman.rst                       |   4 +-
 tools/binman/entries.rst                      |  13 +++
 tools/binman/etype/atf_bl31.py                |   2 +-
 tools/binman/etype/opensbi.py                 |  23 ++++
 tools/binman/ftest.py                         |  17 ++-
 .../test/{172_fit_fdt.dts => 170_fit_fdt.dts} |   0
 tools/binman/test/201_opensbi.dts             |  14 +++
 27 files changed, 191 insertions(+), 114 deletions(-)
 create mode 100644 arch/riscv/dts/binman.dtsi
 create mode 100644 arch/riscv/dts/qemu-virt.dts
 delete mode 100755 arch/riscv/lib/mkimage_fit_opensbi.sh
 create mode 100644 tools/binman/etype/opensbi.py
 rename tools/binman/test/{172_fit_fdt.dts => 170_fit_fdt.dts} (100%)
 create mode 100644 tools/binman/test/201_opensbi.dts

-- 
2.25.1

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

* [PATCH v4 01/13] common: kconfig: Correct a typo in SPL_LOAD_FIT
  2021-05-10  6:58 [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb Bin Meng
@ 2021-05-10  6:58 ` Bin Meng
  2021-05-10  6:58 ` [PATCH v4 02/13] binman: Correct '-a' description in the doc Bin Meng
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: Bin Meng @ 2021-05-10  6:58 UTC (permalink / raw)
  To: u-boot

It should be FDT, not FTD.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 common/Kconfig.boot | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/Kconfig.boot b/common/Kconfig.boot
index 5a18d62d78..94d82c27dd 100644
--- a/common/Kconfig.boot
+++ b/common/Kconfig.boot
@@ -204,7 +204,7 @@ config SPL_LOAD_FIT
 
 	  This path has the following limitations:
 
-	  1. "loadables" images, other than FTDs, which do not have a "load"
+	  1. "loadables" images, other than FDTs, which do not have a "load"
 	     property will not be loaded. This limitation also applies to FPGA
 	     images with the correct "compatible" string.
 	  2. For FPGA images, only the "compatible" = "u-boot,fpga-legacy"
-- 
2.25.1

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

* [PATCH v4 02/13] binman: Correct '-a' description in the doc
  2021-05-10  6:58 [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb Bin Meng
  2021-05-10  6:58 ` [PATCH v4 01/13] common: kconfig: Correct a typo in SPL_LOAD_FIT Bin Meng
@ 2021-05-10  6:58 ` Bin Meng
  2021-05-10  6:58 ` [PATCH v4 03/13] binman: Correct the comment for ATF entry type Bin Meng
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: Bin Meng @ 2021-05-10  6:58 UTC (permalink / raw)
  To: u-boot

It needs a space around '-a'.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 tools/binman/binman.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/binman/binman.rst b/tools/binman/binman.rst
index 1aa2459d50..b3df3a6428 100644
--- a/tools/binman/binman.rst
+++ b/tools/binman/binman.rst
@@ -322,9 +322,9 @@ Sometimes it is useful to pass binman the value of an entry property from the
 command line. For example some entries need access to files and it is not
 always convenient to put these filenames in the image definition (device tree).
 
-The-a option supports this::
+The -a option supports this::
 
-    -a<prop>=<value>
+    -a <prop>=<value>
 
 where::
 
-- 
2.25.1

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

* [PATCH v4 03/13] binman: Correct the comment for ATF entry type
  2021-05-10  6:58 [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb Bin Meng
  2021-05-10  6:58 ` [PATCH v4 01/13] common: kconfig: Correct a typo in SPL_LOAD_FIT Bin Meng
  2021-05-10  6:58 ` [PATCH v4 02/13] binman: Correct '-a' description in the doc Bin Meng
@ 2021-05-10  6:58 ` Bin Meng
  2021-05-10  6:58 ` [PATCH v4 04/13] binman: test: Rename 172_fit_fdt.dts to 170_fit_fdt.dts Bin Meng
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: Bin Meng @ 2021-05-10  6:58 UTC (permalink / raw)
  To: u-boot

This is wrongly referring to Intel ME, which should be ATF.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 tools/binman/etype/atf_bl31.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/binman/etype/atf_bl31.py b/tools/binman/etype/atf_bl31.py
index 163d714184..2041da416c 100644
--- a/tools/binman/etype/atf_bl31.py
+++ b/tools/binman/etype/atf_bl31.py
@@ -2,7 +2,7 @@
 # Copyright 2020 Google LLC
 # Written by Simon Glass <sjg@chromium.org>
 #
-# Entry-type module for Intel Management Engine binary blob
+# Entry-type module for ARM Trusted Firmware binary blob
 #
 
 from binman.etype.blob_named_by_arg import Entry_blob_named_by_arg
-- 
2.25.1

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

* [PATCH v4 04/13] binman: test: Rename 172_fit_fdt.dts to 170_fit_fdt.dts
  2021-05-10  6:58 [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb Bin Meng
                   ` (2 preceding siblings ...)
  2021-05-10  6:58 ` [PATCH v4 03/13] binman: Correct the comment for ATF entry type Bin Meng
@ 2021-05-10  6:58 ` Bin Meng
  2021-05-10  6:58 ` [PATCH v4 05/13] binman: Add support for RISC-V OpenSBI fw_dynamic blob Bin Meng
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: Bin Meng @ 2021-05-10  6:58 UTC (permalink / raw)
  To: u-boot

Currently there are 2 binman test cases using the same 172 number.
It seems that 172_fit_fdt.dts was originally named as 170_, but
commit c0f1ebe9c1b9 ("binman: Allow selecting default FIT configuration")
changed its name to 172_ for no reason. Let's change it back.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 tools/binman/ftest.py                                  | 10 +++++-----
 tools/binman/test/{172_fit_fdt.dts => 170_fit_fdt.dts} |  0
 2 files changed, 5 insertions(+), 5 deletions(-)
 rename tools/binman/test/{172_fit_fdt.dts => 170_fit_fdt.dts} (100%)

diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index f36823f51b..b0daccbc3b 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -3826,7 +3826,7 @@ class TestFunctional(unittest.TestCase):
             'default-dt': 'test-fdt2',
         }
         data = self._DoReadFileDtb(
-            '172_fit_fdt.dts',
+            '170_fit_fdt.dts',
             entry_args=entry_args,
             extra_indirs=[os.path.join(self._indir, TEST_FDT_SUBDIR)])[0]
         self.assertEqual(U_BOOT_NODTB_DATA, data[-len(U_BOOT_NODTB_DATA):])
@@ -3848,7 +3848,7 @@ class TestFunctional(unittest.TestCase):
     def testFitFdtMissingList(self):
         """Test handling of a missing 'of-list' entry arg"""
         with self.assertRaises(ValueError) as e:
-            self._DoReadFile('172_fit_fdt.dts')
+            self._DoReadFile('170_fit_fdt.dts')
         self.assertIn("Generator node requires 'of-list' entry argument",
                       str(e.exception))
 
@@ -3871,7 +3871,7 @@ class TestFunctional(unittest.TestCase):
         entry_args = {
             'of-list': '',
         }
-        data = self._DoReadFileDtb('172_fit_fdt.dts', entry_args=entry_args)[0]
+        data = self._DoReadFileDtb('170_fit_fdt.dts', entry_args=entry_args)[0]
 
     def testFitFdtMissing(self):
         """Test handling of a missing 'default-dt' entry arg"""
@@ -3880,7 +3880,7 @@ class TestFunctional(unittest.TestCase):
         }
         with self.assertRaises(ValueError) as e:
             self._DoReadFileDtb(
-                '172_fit_fdt.dts',
+                '170_fit_fdt.dts',
                 entry_args=entry_args,
                 extra_indirs=[os.path.join(self._indir, TEST_FDT_SUBDIR)])[0]
         self.assertIn("Generated 'default' node requires default-dt entry argument",
@@ -3894,7 +3894,7 @@ class TestFunctional(unittest.TestCase):
         }
         with self.assertRaises(ValueError) as e:
             self._DoReadFileDtb(
-                '172_fit_fdt.dts',
+                '170_fit_fdt.dts',
                 entry_args=entry_args,
                 extra_indirs=[os.path.join(self._indir, TEST_FDT_SUBDIR)])[0]
         self.assertIn("default-dt entry argument 'test-fdt3' not found in fdt list: test-fdt1, test-fdt2",
diff --git a/tools/binman/test/172_fit_fdt.dts b/tools/binman/test/170_fit_fdt.dts
similarity index 100%
rename from tools/binman/test/172_fit_fdt.dts
rename to tools/binman/test/170_fit_fdt.dts
-- 
2.25.1

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

* [PATCH v4 05/13] binman: Add support for RISC-V OpenSBI fw_dynamic blob
  2021-05-10  6:58 [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb Bin Meng
                   ` (3 preceding siblings ...)
  2021-05-10  6:58 ` [PATCH v4 04/13] binman: test: Rename 172_fit_fdt.dts to 170_fit_fdt.dts Bin Meng
@ 2021-05-10  6:58 ` Bin Meng
  2021-05-10  6:58 ` [PATCH v4 06/13] makefile: Pass OpenSBI blob to binman make rules Bin Meng
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: Bin Meng @ 2021-05-10  6:58 UTC (permalink / raw)
  To: u-boot

Add an entry for RISC-V OpenSBI's 'fw_dynamic' firmware payload.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

---

(no changes since v2)

Changes in v2:
- drop "size = <16>" in the binman node

 tools/binman/entries.rst          | 13 +++++++++++++
 tools/binman/etype/opensbi.py     | 23 +++++++++++++++++++++++
 tools/binman/ftest.py             |  7 +++++++
 tools/binman/test/201_opensbi.dts | 14 ++++++++++++++
 4 files changed, 57 insertions(+)
 create mode 100644 tools/binman/etype/opensbi.py
 create mode 100644 tools/binman/test/201_opensbi.dts

diff --git a/tools/binman/entries.rst b/tools/binman/entries.rst
index f1c3b7de7a..dcac700c46 100644
--- a/tools/binman/entries.rst
+++ b/tools/binman/entries.rst
@@ -761,6 +761,19 @@ binman.
 
 
 
+Entry: opensbi: RISC-V OpenSBI fw_dynamic blob
+----------------------------------------------
+
+Properties / Entry arguments:
+    - opensbi-path: Filename of file to read into entry. This is typically
+        called fw_dynamic.bin
+
+This entry holds the run-time firmware, typically started by U-Boot SPL.
+See the U-Boot README for your architecture or board for how to use it. See
+https://github.com/riscv/opensbi for more information about OpenSBI.
+
+
+
 Entry: powerpc-mpc85xx-bootpg-resetvec: PowerPC mpc85xx bootpg + resetvec code for U-Boot
 -----------------------------------------------------------------------------------------
 
diff --git a/tools/binman/etype/opensbi.py b/tools/binman/etype/opensbi.py
new file mode 100644
index 0000000000..74d473d535
--- /dev/null
+++ b/tools/binman/etype/opensbi.py
@@ -0,0 +1,23 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2021, Bin Meng <bmeng.cn@gmail.com>
+#
+# Entry-type module for RISC-V OpenSBI binary blob
+#
+
+from binman.etype.blob_named_by_arg import Entry_blob_named_by_arg
+
+class Entry_opensbi(Entry_blob_named_by_arg):
+    """RISC-V OpenSBI fw_dynamic blob
+
+    Properties / Entry arguments:
+        - opensbi-path: Filename of file to read into entry. This is typically
+            called fw_dynamic.bin
+
+    This entry holds the run-time firmware, typically started by U-Boot SPL.
+    See the U-Boot README for your architecture or board for how to use it. See
+    https://github.com/riscv/opensbi for more information about OpenSBI.
+    """
+    def __init__(self, section, etype, node):
+        super().__init__(section, etype, node, 'opensbi')
+        self.external = True
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index b0daccbc3b..5383eec489 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -76,6 +76,7 @@ FSP_M_DATA            = b'fsp_m'
 FSP_S_DATA            = b'fsp_s'
 FSP_T_DATA            = b'fsp_t'
 ATF_BL31_DATA         = b'bl31'
+OPENSBI_DATA          = b'opensbi'
 SCP_DATA              = b'scp'
 TEST_FDT1_DATA        = b'fdt1'
 TEST_FDT2_DATA        = b'test-fdt2'
@@ -178,6 +179,7 @@ class TestFunctional(unittest.TestCase):
         TestFunctional._MakeInputFile('compress', COMPRESS_DATA)
         TestFunctional._MakeInputFile('compress_big', COMPRESS_DATA_BIG)
         TestFunctional._MakeInputFile('bl31.bin', ATF_BL31_DATA)
+        TestFunctional._MakeInputFile('fw_dynamic.bin', OPENSBI_DATA)
         TestFunctional._MakeInputFile('scp.bin', SCP_DATA)
 
         # Add a few .dtb files for testing
@@ -4535,5 +4537,10 @@ class TestFunctional(unittest.TestCase):
         expected += tools.GetBytes(0, 88 - len(expected)) + U_BOOT_NODTB_DATA
         self.assertEqual(expected, data)
 
+    def testPackOpenSBI(self):
+        """Test that an image with an OpenSBI binary can be created"""
+        data = self._DoReadFile('201_opensbi.dts')
+        self.assertEqual(OPENSBI_DATA, data[:len(OPENSBI_DATA)])
+
 if __name__ == "__main__":
     unittest.main()
diff --git a/tools/binman/test/201_opensbi.dts b/tools/binman/test/201_opensbi.dts
new file mode 100644
index 0000000000..942183f990
--- /dev/null
+++ b/tools/binman/test/201_opensbi.dts
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	binman {
+		opensbi {
+			filename = "fw_dynamic.bin";
+		};
+	};
+};
-- 
2.25.1

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

* [PATCH v4 06/13] makefile: Pass OpenSBI blob to binman make rules
  2021-05-10  6:58 [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb Bin Meng
                   ` (4 preceding siblings ...)
  2021-05-10  6:58 ` [PATCH v4 05/13] binman: Add support for RISC-V OpenSBI fw_dynamic blob Bin Meng
@ 2021-05-10  6:58 ` Bin Meng
  2021-05-10  6:58 ` [PATCH v4 07/13] riscv: sifive: unleashed: Switch to use binman to generate u-boot.itb Bin Meng
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: Bin Meng @ 2021-05-10  6:58 UTC (permalink / raw)
  To: u-boot

This updates the make rules to pass OpenSBI blob to binman.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index 404977efa5..3d88559b67 100644
--- a/Makefile
+++ b/Makefile
@@ -1287,6 +1287,7 @@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \
 		-I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \
 		-I arch/$(ARCH)/dts -a of-list=$(CONFIG_OF_LIST) \
 		-a atf-bl31-path=${BL31} \
+		-a opensbi-path=${OPENSBI} \
 		-a default-dt=$(default_dt) \
 		-a scp-path=$(SCP) \
 		-a spl-bss-pad=$(if $(CONFIG_SPL_SEPARATE_BSS),,1) \
-- 
2.25.1

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

* [PATCH v4 07/13] riscv: sifive: unleashed: Switch to use binman to generate u-boot.itb
  2021-05-10  6:58 [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb Bin Meng
                   ` (5 preceding siblings ...)
  2021-05-10  6:58 ` [PATCH v4 06/13] makefile: Pass OpenSBI blob to binman make rules Bin Meng
@ 2021-05-10  6:58 ` Bin Meng
  2021-05-10  6:58 ` [PATCH v4 08/13] lib: kconfig: Limit BINMAN_FDT for OF_SEPARATE or OF_EMBED Bin Meng
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: Bin Meng @ 2021-05-10  6:58 UTC (permalink / raw)
  To: u-boot

At present SiFive Unleashed board uses the Makefile to create the FIT,
using USE_SPL_FIT_GENERATOR, which is deprecated as per the Makefile
warning. Update to use binman instead.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

---

(no changes since v3)

Changes in v3:
- Fix the opensbi entry type in binman.dtsi

 arch/riscv/dts/binman.dtsi                    | 70 +++++++++++++++++++
 .../dts/hifive-unleashed-a00-u-boot.dtsi      |  1 +
 board/sifive/unleashed/Kconfig                |  1 +
 configs/sifive_unleashed_defconfig            |  1 +
 4 files changed, 73 insertions(+)
 create mode 100644 arch/riscv/dts/binman.dtsi

diff --git a/arch/riscv/dts/binman.dtsi b/arch/riscv/dts/binman.dtsi
new file mode 100644
index 0000000000..e02597e73d
--- /dev/null
+++ b/arch/riscv/dts/binman.dtsi
@@ -0,0 +1,70 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2021, Bin Meng <bmeng.cn@gmail.com>
+ */
+
+#include <config.h>
+
+/ {
+	binman: binman {
+		multiple-images;
+	};
+};
+
+&binman {
+	itb {
+		filename = "u-boot.itb";
+
+		fit {
+			description = "Configuration to load OpenSBI before U-Boot";
+			#address-cells = <1>;
+			fit,fdt-list = "of-list";
+
+			images {
+				uboot {
+					description = "U-Boot";
+					type = "standalone";
+					os = "U-Boot";
+					arch = "riscv";
+					compression = "none";
+					load = <CONFIG_SYS_TEXT_BASE>;
+
+					uboot_blob: blob-ext {
+						filename = "u-boot-nodtb.bin";
+					};
+				};
+
+				opensbi {
+					description = "OpenSBI fw_dynamic Firmware";
+					type = "firmware";
+					os = "opensbi";
+					arch = "riscv";
+					compression = "none";
+					load = <CONFIG_SPL_OPENSBI_LOAD_ADDR>;
+					entry = <CONFIG_SPL_OPENSBI_LOAD_ADDR>;
+
+					opensbi_blob: opensbi {
+						filename = "fw_dynamic.bin";
+					};
+				};
+
+				@fdt-SEQ {
+					description = "NAME";
+					type = "flat_dt";
+					compression = "none";
+				};
+			};
+
+			configurations {
+				default = "conf-1";
+
+				@conf-SEQ {
+					description = "NAME";
+					firmware = "opensbi";
+					loadables = "uboot";
+					fdt = "fdt-SEQ";
+				};
+			};
+		};
+	};
+};
diff --git a/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi b/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi
index 1996149c95..51b566116d 100644
--- a/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi
+++ b/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi
@@ -3,6 +3,7 @@
  * Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com>
  */
 
+#include "binman.dtsi"
 #include "fu540-c000-u-boot.dtsi"
 #include "fu540-hifive-unleashed-a00-ddr.dtsi"
 
diff --git a/board/sifive/unleashed/Kconfig b/board/sifive/unleashed/Kconfig
index dbffd59c98..502916e86a 100644
--- a/board/sifive/unleashed/Kconfig
+++ b/board/sifive/unleashed/Kconfig
@@ -27,6 +27,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
 	def_bool y
 	select SIFIVE_FU540
 	select ENV_IS_IN_SPI_FLASH
+	select BINMAN
 	imply CMD_DHCP
 	imply CMD_EXT2
 	imply CMD_EXT4
diff --git a/configs/sifive_unleashed_defconfig b/configs/sifive_unleashed_defconfig
index 62416a7c1d..dc9313e572 100644
--- a/configs/sifive_unleashed_defconfig
+++ b/configs/sifive_unleashed_defconfig
@@ -14,6 +14,7 @@ CONFIG_RISCV_SMODE=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x84000000
+# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_DISPLAY_CPUINFO=y
 CONFIG_DISPLAY_BOARDINFO=y
 CONFIG_MISC_INIT_R=y
-- 
2.25.1

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

* [PATCH v4 08/13] lib: kconfig: Limit BINMAN_FDT for OF_SEPARATE or OF_EMBED
  2021-05-10  6:58 [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb Bin Meng
                   ` (6 preceding siblings ...)
  2021-05-10  6:58 ` [PATCH v4 07/13] riscv: sifive: unleashed: Switch to use binman to generate u-boot.itb Bin Meng
@ 2021-05-10  6:58 ` Bin Meng
  2021-05-10  6:58 ` [PATCH v4 09/13] binman: Support packaging U-Boot for scenarios like OF_BOARD or OF_PRIOR_STAGE Bin Meng
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: Bin Meng @ 2021-05-10  6:58 UTC (permalink / raw)
  To: u-boot

Generally speaking BINMAN_FDT makes sense for OF_SEPARATE or OF_EMBED.
For the other OF_CONTROL methods, it's quite possible binman node is
not available as binman is invoked during the build phase instead of
runtime. Let's only turn it on for OF_SEPARATE or OF_EMBED by default.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>

---

(no changes since v3)

Changes in v3:
- new patch: "lib: kconfig: Limit BINMAN_FDT for OF_SEPARATE or OF_EMBED"

 lib/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Kconfig b/lib/Kconfig
index 6d2d41de30..7d5990c940 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -25,7 +25,7 @@ config BCH
 config BINMAN_FDT
 	bool "Allow access to binman information in the device tree"
 	depends on BINMAN && DM && OF_CONTROL
-	default y
+	default y if OF_SEPARATE || OF_EMBED
 	help
 	  This enables U-Boot to access information about binman entries,
 	  stored in the device tree in a binman node. Typical uses are to
-- 
2.25.1

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

* [PATCH v4 09/13] binman: Support packaging U-Boot for scenarios like OF_BOARD or OF_PRIOR_STAGE
  2021-05-10  6:58 [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb Bin Meng
                   ` (7 preceding siblings ...)
  2021-05-10  6:58 ` [PATCH v4 08/13] lib: kconfig: Limit BINMAN_FDT for OF_SEPARATE or OF_EMBED Bin Meng
@ 2021-05-10  6:58 ` Bin Meng
  2021-05-10  6:58 ` [PATCH v4 10/13] riscv: dts: Sort build targets in alphabetical order Bin Meng
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: Bin Meng @ 2021-05-10  6:58 UTC (permalink / raw)
  To: u-boot

For scenarios like OF_BOARD or OF_PRIOR_STAGE, no device tree blob is
provided in the U-Boot build phase hence the binman node information
is not available. In order to support such use case, a new Kconfig
option BINMAN_STANDALONE_FDT is introduced, to tell the build system
that a device tree blob containing binman node is explicitly required
when using binman to package U-Boot.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>

---

Changes in v4:
- update the makefile dependency on u-boot.img instead of u-boot.bin

Changes in v3:
- rename the Kconfig option name to BINMAN_STANDALONE_FDT
- make BINMAN_STANDALONE_FDT default y for OF_BOARD as well
- reword the Kconfig option help message a little bit

Changes in v2:
- new patch: "binman: Support packaging U-Boot for scenarios like OF_PRIOR_STAGE"

 Makefile    |  3 ++-
 dts/Kconfig | 18 ++++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 3d88559b67..1dbf0b0b8c 100644
--- a/Makefile
+++ b/Makefile
@@ -918,6 +918,7 @@ endif
 endif
 INPUTS-$(CONFIG_TPL) += tpl/u-boot-tpl.bin
 INPUTS-$(CONFIG_OF_SEPARATE) += u-boot.dtb
+INPUTS-$(CONFIG_BINMAN_STANDALONE_FDT) += u-boot.dtb
 ifeq ($(CONFIG_SPL_FRAMEWORK),y)
 INPUTS-$(CONFIG_OF_SEPARATE) += u-boot-dtb.img
 endif
@@ -1392,7 +1393,7 @@ u-boot-lzma.img: u-boot.bin.lzma FORCE
 
 u-boot-dtb.img u-boot.img u-boot.kwb u-boot.pbl u-boot-ivt.img: \
 		$(if $(CONFIG_SPL_LOAD_FIT),u-boot-nodtb.bin \
-			$(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_OF_HOSTFILE),dts/dt.dtb) \
+			$(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_OF_HOSTFILE)$(CONFIG_BINMAN_STANDALONE_FDT),dts/dt.dtb) \
 		,$(UBOOT_BIN)) FORCE
 	$(call if_changed,mkimage)
 	$(BOARD_SIZE_CHECK)
diff --git a/dts/Kconfig b/dts/Kconfig
index 99ce75e1a2..dabe0080c1 100644
--- a/dts/Kconfig
+++ b/dts/Kconfig
@@ -19,6 +19,24 @@ config BINMAN
 	bool
 	select DTOC
 
+config BINMAN_STANDALONE_FDT
+	bool
+	depends on BINMAN
+	default y if OF_BOARD || OF_PRIOR_STAGE
+	help
+	  This option tells U-Boot build system that a standalone device tree
+	  source is explicitly required when using binman to package U-Boot.
+
+	  This is not necessary in a common scenario where a device tree source
+	  that contains the binman node is provided in the arch/<arch>/dts
+	  directory for a specific board. Such device tree sources are built for
+	  OF_SEPARATE or OF_EMBED. However for a scenario like the board device
+	  tree blob is not provided in the U-Boot build tree, but fed to U-Boot
+	  in the runtime, e.g.: in the OF_PRIOR_STAGE case that it is passed by
+	  a prior stage bootloader. For such scenario, a standalone device tree
+	  blob containing binman node to describe how to package U-Boot should
+	  be provided explicitly.
+
 menu "Device Tree Control"
 	depends on SUPPORT_OF_CONTROL
 
-- 
2.25.1

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

* [PATCH v4 10/13] riscv: dts: Sort build targets in alphabetical order
  2021-05-10  6:58 [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb Bin Meng
                   ` (8 preceding siblings ...)
  2021-05-10  6:58 ` [PATCH v4 09/13] binman: Support packaging U-Boot for scenarios like OF_BOARD or OF_PRIOR_STAGE Bin Meng
@ 2021-05-10  6:58 ` Bin Meng
  2021-05-10  6:58 ` [PATCH v4 11/13] riscv: qemu: Switch to use binman to generate u-boot.itb Bin Meng
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: Bin Meng @ 2021-05-10  6:58 UTC (permalink / raw)
  To: u-boot

Sort the RISC-V DTS build targets by their Kconfig target names in
alphabetical order.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>

---

(no changes since v2)

Changes in v2:
- new patch: "riscv: dts: Sort build targets in alphabetical order"

 arch/riscv/dts/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/dts/Makefile b/arch/riscv/dts/Makefile
index 8138d89d84..3780334875 100644
--- a/arch/riscv/dts/Makefile
+++ b/arch/riscv/dts/Makefile
@@ -1,9 +1,9 @@
 # SPDX-License-Identifier: GPL-2.0+
 
 dtb-$(CONFIG_TARGET_AX25_AE350) += ae350_32.dtb ae350_64.dtb
+dtb-$(CONFIG_TARGET_MICROCHIP_ICICLE) += microchip-mpfs-icicle-kit.dtb
 dtb-$(CONFIG_TARGET_SIFIVE_UNLEASHED) += hifive-unleashed-a00.dtb
 dtb-$(CONFIG_TARGET_SIPEED_MAIX) += k210-maix-bit.dtb
-dtb-$(CONFIG_TARGET_MICROCHIP_ICICLE) += microchip-mpfs-icicle-kit.dtb
 
 targets += $(dtb-y)
 
-- 
2.25.1

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

* [PATCH v4 11/13] riscv: qemu: Switch to use binman to generate u-boot.itb
  2021-05-10  6:58 [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb Bin Meng
                   ` (9 preceding siblings ...)
  2021-05-10  6:58 ` [PATCH v4 10/13] riscv: dts: Sort build targets in alphabetical order Bin Meng
@ 2021-05-10  6:58 ` Bin Meng
  2021-05-10  6:58 ` [PATCH v4 12/13] riscv: ae350: " Bin Meng
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: Bin Meng @ 2021-05-10  6:58 UTC (permalink / raw)
  To: u-boot

By utilizing the newly introduced BINMAN_STANDALONE_FDT option, along
with a new dedicated device tree source file for the QEMU virt target
used for binman only, we can now use binman to generate u-boot.itb.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

---

(no changes since v2)

Changes in v2:
- new patch: "riscv: qemu: Switch to use binman to generate u-boot.itb"

 arch/riscv/cpu/generic/Kconfig     | 1 +
 arch/riscv/dts/Makefile            | 1 +
 arch/riscv/dts/binman.dtsi         | 8 ++++++++
 arch/riscv/dts/qemu-virt.dts       | 8 ++++++++
 configs/qemu-riscv32_spl_defconfig | 2 ++
 configs/qemu-riscv64_spl_defconfig | 2 ++
 6 files changed, 22 insertions(+)
 create mode 100644 arch/riscv/dts/qemu-virt.dts

diff --git a/arch/riscv/cpu/generic/Kconfig b/arch/riscv/cpu/generic/Kconfig
index 198e36e969..a4934bb957 100644
--- a/arch/riscv/cpu/generic/Kconfig
+++ b/arch/riscv/cpu/generic/Kconfig
@@ -4,6 +4,7 @@
 
 config GENERIC_RISCV
 	bool
+	select BINMAN if SPL
 	select ARCH_EARLY_INIT_R
 	imply CPU
 	imply CPU_RISCV
diff --git a/arch/riscv/dts/Makefile b/arch/riscv/dts/Makefile
index 3780334875..26ef853282 100644
--- a/arch/riscv/dts/Makefile
+++ b/arch/riscv/dts/Makefile
@@ -2,6 +2,7 @@
 
 dtb-$(CONFIG_TARGET_AX25_AE350) += ae350_32.dtb ae350_64.dtb
 dtb-$(CONFIG_TARGET_MICROCHIP_ICICLE) += microchip-mpfs-icicle-kit.dtb
+dtb-$(CONFIG_TARGET_QEMU_VIRT) += qemu-virt.dtb
 dtb-$(CONFIG_TARGET_SIFIVE_UNLEASHED) += hifive-unleashed-a00.dtb
 dtb-$(CONFIG_TARGET_SIPEED_MAIX) += k210-maix-bit.dtb
 
diff --git a/arch/riscv/dts/binman.dtsi b/arch/riscv/dts/binman.dtsi
index e02597e73d..d26cfdb78a 100644
--- a/arch/riscv/dts/binman.dtsi
+++ b/arch/riscv/dts/binman.dtsi
@@ -48,21 +48,29 @@
 					};
 				};
 
+#ifndef CONFIG_OF_PRIOR_STAGE
 				@fdt-SEQ {
 					description = "NAME";
 					type = "flat_dt";
 					compression = "none";
 				};
+#endif
 			};
 
 			configurations {
 				default = "conf-1";
 
+#ifndef CONFIG_OF_PRIOR_STAGE
 				@conf-SEQ {
+#else
+				conf-1 {
+#endif
 					description = "NAME";
 					firmware = "opensbi";
 					loadables = "uboot";
+#ifndef CONFIG_OF_PRIOR_STAGE
 					fdt = "fdt-SEQ";
+#endif
 				};
 			};
 		};
diff --git a/arch/riscv/dts/qemu-virt.dts b/arch/riscv/dts/qemu-virt.dts
new file mode 100644
index 0000000000..fecff542b9
--- /dev/null
+++ b/arch/riscv/dts/qemu-virt.dts
@@ -0,0 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2021, Bin Meng <bmeng.cn@gmail.com>
+ */
+
+/dts-v1/;
+
+#include "binman.dtsi"
diff --git a/configs/qemu-riscv32_spl_defconfig b/configs/qemu-riscv32_spl_defconfig
index 18dfe33ca8..a4c156612a 100644
--- a/configs/qemu-riscv32_spl_defconfig
+++ b/configs/qemu-riscv32_spl_defconfig
@@ -2,11 +2,13 @@ CONFIG_RISCV=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_ENV_SIZE=0x20000
 CONFIG_SPL=y
+CONFIG_DEFAULT_DEVICE_TREE="qemu-virt"
 CONFIG_TARGET_QEMU_VIRT=y
 CONFIG_RISCV_SMODE=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x80200000
+# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_DISPLAY_CPUINFO=y
 CONFIG_DISPLAY_BOARDINFO=y
 # CONFIG_CMD_MII is not set
diff --git a/configs/qemu-riscv64_spl_defconfig b/configs/qemu-riscv64_spl_defconfig
index 897adf6a29..6c680483ce 100644
--- a/configs/qemu-riscv64_spl_defconfig
+++ b/configs/qemu-riscv64_spl_defconfig
@@ -2,12 +2,14 @@ CONFIG_RISCV=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_ENV_SIZE=0x20000
 CONFIG_SPL=y
+CONFIG_DEFAULT_DEVICE_TREE="qemu-virt"
 CONFIG_TARGET_QEMU_VIRT=y
 CONFIG_ARCH_RV64I=y
 CONFIG_RISCV_SMODE=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x80200000
+# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_DISPLAY_CPUINFO=y
 CONFIG_DISPLAY_BOARDINFO=y
 # CONFIG_CMD_MII is not set
-- 
2.25.1

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

* [PATCH v4 12/13] riscv: ae350: Switch to use binman to generate u-boot.itb
  2021-05-10  6:58 [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb Bin Meng
                   ` (10 preceding siblings ...)
  2021-05-10  6:58 ` [PATCH v4 11/13] riscv: qemu: Switch to use binman to generate u-boot.itb Bin Meng
@ 2021-05-10  6:58 ` Bin Meng
  2021-05-10  6:58 ` [PATCH v4 13/13] riscv: Drop USE_SPL_FIT_GENERATOR Bin Meng
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 25+ messages in thread
From: Bin Meng @ 2021-05-10  6:58 UTC (permalink / raw)
  To: u-boot

Use the new BINMAN_STANDALONE_FDT option for AE350 based SPL defconfigs,
so that binman is now used to generate u-boot.itb.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>

---

(no changes since v3)

Changes in v3:
- new patch: "riscv: ae350: Switch to use binman to generate u-boot.itb"

 arch/riscv/dts/ae350_32.dts          | 2 ++
 arch/riscv/dts/ae350_64.dts          | 2 ++
 board/AndesTech/ax25-ae350/Kconfig   | 1 +
 configs/ae350_rv32_spl_defconfig     | 2 ++
 configs/ae350_rv32_spl_xip_defconfig | 2 ++
 configs/ae350_rv64_spl_defconfig     | 2 ++
 configs/ae350_rv64_spl_xip_defconfig | 2 ++
 7 files changed, 13 insertions(+)

diff --git a/arch/riscv/dts/ae350_32.dts b/arch/riscv/dts/ae350_32.dts
index 3f8525fe56..a0ab5e9be2 100644
--- a/arch/riscv/dts/ae350_32.dts
+++ b/arch/riscv/dts/ae350_32.dts
@@ -1,5 +1,7 @@
 /dts-v1/;
 
+#include "binman.dtsi"
+
 / {
 	#address-cells = <1>;
 	#size-cells = <1>;
diff --git a/arch/riscv/dts/ae350_64.dts b/arch/riscv/dts/ae350_64.dts
index 482c707503..f654f4809a 100644
--- a/arch/riscv/dts/ae350_64.dts
+++ b/arch/riscv/dts/ae350_64.dts
@@ -1,5 +1,7 @@
 /dts-v1/;
 
+#include "binman.dtsi"
+
 / {
 	#address-cells = <2>;
 	#size-cells = <2>;
diff --git a/board/AndesTech/ax25-ae350/Kconfig b/board/AndesTech/ax25-ae350/Kconfig
index 321dd0cb10..e50f505a2b 100644
--- a/board/AndesTech/ax25-ae350/Kconfig
+++ b/board/AndesTech/ax25-ae350/Kconfig
@@ -31,6 +31,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
 	def_bool y
 	select RISCV_NDS
 	select SUPPORT_SPL
+	select BINMAN if SPL
 	imply SMP
 	imply SPL_RAM_SUPPORT
 	imply SPL_RAM_DEVICE
diff --git a/configs/ae350_rv32_spl_defconfig b/configs/ae350_rv32_spl_defconfig
index 153266f647..47c8e9a621 100644
--- a/configs/ae350_rv32_spl_defconfig
+++ b/configs/ae350_rv32_spl_defconfig
@@ -3,11 +3,13 @@ CONFIG_SYS_TEXT_BASE=0x01200000
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_ENV_SECT_SIZE=0x1000
 CONFIG_SPL=y
+CONFIG_DEFAULT_DEVICE_TREE="ae350_32"
 CONFIG_TARGET_AX25_AE350=y
 CONFIG_RISCV_SMODE=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x00200000
+# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTDELAY=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SYS_PROMPT="RISC-V # "
diff --git a/configs/ae350_rv32_spl_xip_defconfig b/configs/ae350_rv32_spl_xip_defconfig
index 651b1eb733..206ffe2720 100644
--- a/configs/ae350_rv32_spl_xip_defconfig
+++ b/configs/ae350_rv32_spl_xip_defconfig
@@ -4,12 +4,14 @@ CONFIG_NR_DRAM_BANKS=2
 CONFIG_ENV_SECT_SIZE=0x1000
 CONFIG_SPL_TEXT_BASE=0x80000000
 CONFIG_SPL=y
+CONFIG_DEFAULT_DEVICE_TREE="ae350_32"
 CONFIG_TARGET_AX25_AE350=y
 CONFIG_RISCV_SMODE=y
 CONFIG_XIP=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x80010000
+# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTDELAY=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SYS_PROMPT="RISC-V # "
diff --git a/configs/ae350_rv64_spl_defconfig b/configs/ae350_rv64_spl_defconfig
index f434091d47..ef04e4a4b6 100644
--- a/configs/ae350_rv64_spl_defconfig
+++ b/configs/ae350_rv64_spl_defconfig
@@ -3,12 +3,14 @@ CONFIG_SYS_TEXT_BASE=0x01200000
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_ENV_SECT_SIZE=0x1000
 CONFIG_SPL=y
+CONFIG_DEFAULT_DEVICE_TREE="ae350_64"
 CONFIG_TARGET_AX25_AE350=y
 CONFIG_ARCH_RV64I=y
 CONFIG_RISCV_SMODE=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x00200000
+# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTDELAY=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SYS_PROMPT="RISC-V # "
diff --git a/configs/ae350_rv64_spl_xip_defconfig b/configs/ae350_rv64_spl_xip_defconfig
index b0afdb4cfe..21b7e8895b 100644
--- a/configs/ae350_rv64_spl_xip_defconfig
+++ b/configs/ae350_rv64_spl_xip_defconfig
@@ -4,6 +4,7 @@ CONFIG_NR_DRAM_BANKS=2
 CONFIG_ENV_SECT_SIZE=0x1000
 CONFIG_SPL_TEXT_BASE=0x80000000
 CONFIG_SPL=y
+CONFIG_DEFAULT_DEVICE_TREE="ae350_64"
 CONFIG_TARGET_AX25_AE350=y
 CONFIG_ARCH_RV64I=y
 CONFIG_RISCV_SMODE=y
@@ -11,6 +12,7 @@ CONFIG_XIP=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x80010000
+# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTDELAY=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SYS_PROMPT="RISC-V # "
-- 
2.25.1

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

* [PATCH v4 13/13] riscv: Drop USE_SPL_FIT_GENERATOR
  2021-05-10  6:58 [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb Bin Meng
                   ` (11 preceding siblings ...)
  2021-05-10  6:58 ` [PATCH v4 12/13] riscv: ae350: " Bin Meng
@ 2021-05-10  6:58 ` Bin Meng
  2021-05-10  7:02 ` [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb Bin Meng
       [not found] ` <752D002CFF5D0F4FA35C0100F1D73F3FE5EA0826@ATCPCS12.andestech.com>
  14 siblings, 0 replies; 25+ messages in thread
From: Bin Meng @ 2021-05-10  6:58 UTC (permalink / raw)
  To: u-boot

Now that we have switched to binman to generate u-boot.itb for all
RISC-V boards, USE_SPL_FIT_GENERATOR is no longer needed and can
be dropped.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>

---

(no changes since v3)

Changes in v3:
- remove USE_SPL_FIT_GENERATOR in ae350_ defconfigs

Changes in v2:
- new patch: "riscv: Drop USE_SPL_FIT_GENERATOR"

 arch/riscv/lib/mkimage_fit_opensbi.sh | 100 --------------------------
 common/Kconfig.boot                   |   3 +-
 configs/ae350_rv32_spl_defconfig      |   1 -
 configs/ae350_rv32_spl_xip_defconfig  |   1 -
 configs/ae350_rv64_spl_defconfig      |   1 -
 configs/ae350_rv64_spl_xip_defconfig  |   1 -
 configs/qemu-riscv32_spl_defconfig    |   1 -
 configs/qemu-riscv64_spl_defconfig    |   1 -
 configs/sifive_unleashed_defconfig    |   1 -
 9 files changed, 1 insertion(+), 109 deletions(-)
 delete mode 100755 arch/riscv/lib/mkimage_fit_opensbi.sh

diff --git a/arch/riscv/lib/mkimage_fit_opensbi.sh b/arch/riscv/lib/mkimage_fit_opensbi.sh
deleted file mode 100755
index d6f95e5bfd..0000000000
--- a/arch/riscv/lib/mkimage_fit_opensbi.sh
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: GPL-2.0+
-#
-# script to generate FIT image source for RISC-V boards with OpenSBI
-# and, optionally, multiple device trees (given on the command line).
-#
-# usage: $0 [<dt_name> [<dt_name] ...]
-
-[ -z "$OPENSBI" ] && OPENSBI="fw_dynamic.bin"
-
-if [ -z "$UBOOT_LOAD_ADDR" ]; then
-	UBOOT_LOAD_ADDR="$(grep "^CONFIG_SYS_TEXT_BASE=" .config | awk 'BEGIN{FS="="} {print $2}')"
-fi
-
-if [ -z "$OPENSBI_LOAD_ADDR" ]; then
-	OPENSBI_LOAD_ADDR="$(grep "^CONFIG_SPL_OPENSBI_LOAD_ADDR=" .config | awk 'BEGIN{FS="="} {print $2}')"
-fi
-
-if [ ! -f $OPENSBI ]; then
-	echo "WARNING: OpenSBI binary \"$OPENSBI\" not found, resulting binary is not functional." >&2
-	OPENSBI=/dev/null
-fi
-
-cat << __HEADER_EOF
-/dts-v1/;
-
-/ {
-	description = "Configuration to load OpenSBI before U-Boot";
-
-	images {
-		uboot {
-			description = "U-Boot";
-			data = /incbin/("u-boot-nodtb.bin");
-			type = "standalone";
-			os = "U-Boot";
-			arch = "riscv";
-			compression = "none";
-			load = <$UBOOT_LOAD_ADDR>;
-		};
-		opensbi {
-			description = "RISC-V OpenSBI";
-			data = /incbin/("$OPENSBI");
-			type = "firmware";
-			os = "opensbi";
-			arch = "riscv";
-			compression = "none";
-			load = <$OPENSBI_LOAD_ADDR>;
-			entry = <$OPENSBI_LOAD_ADDR>;
-		};
-__HEADER_EOF
-
-cnt=1
-for dtname in $*
-do
-	cat << __FDT_IMAGE_EOF
-		fdt_$cnt {
-			description = "$(basename $dtname .dtb)";
-			data = /incbin/("$dtname");
-			type = "flat_dt";
-			compression = "none";
-		};
-__FDT_IMAGE_EOF
-cnt=$((cnt+1))
-done
-
-cat << __CONF_HEADER_EOF
-	};
-	configurations {
-		default = "config_1";
-
-__CONF_HEADER_EOF
-
-if [ $# -eq 0 ]; then
-cat << __CONF_SECTION_EOF
-		config_1 {
-			description = "U-Boot FIT";
-			firmware = "opensbi";
-			loadables = "uboot";
-		};
-__CONF_SECTION_EOF
-else
-cnt=1
-for dtname in $*
-do
-cat << __CONF_SECTION_EOF
-		config_$cnt {
-			description = "$(basename $dtname .dtb)";
-			firmware = "opensbi";
-			loadables = "uboot";
-			fdt = "fdt_$cnt";
-		};
-__CONF_SECTION_EOF
-cnt=$((cnt+1))
-done
-fi
-
-cat << __ITS_EOF
-	};
-};
-__ITS_EOF
diff --git a/common/Kconfig.boot b/common/Kconfig.boot
index 94d82c27dd..89a3161f1f 100644
--- a/common/Kconfig.boot
+++ b/common/Kconfig.boot
@@ -273,14 +273,13 @@ config SPL_FIT_SOURCE
 
 config USE_SPL_FIT_GENERATOR
 	bool "Use a script to generate the .its script"
-	default y if SPL_FIT && !ARCH_SUNXI
+	default y if SPL_FIT && (!ARCH_SUNXI && !RISCV)
 
 config SPL_FIT_GENERATOR
 	string ".its file generator script for U-Boot FIT image"
 	depends on USE_SPL_FIT_GENERATOR
 	default "arch/arm/mach-rockchip/make_fit_atf.py" if SPL_LOAD_FIT && ARCH_ROCKCHIP
 	default "arch/arm/mach-zynqmp/mkimage_fit_atf.sh" if SPL_LOAD_FIT && ARCH_ZYNQMP
-	default "arch/riscv/lib/mkimage_fit_opensbi.sh" if SPL_LOAD_FIT && RISCV
 	help
 	  Specifies a (platform specific) script file to generate the FIT
 	  source file used to build the U-Boot FIT image file. This gets
diff --git a/configs/ae350_rv32_spl_defconfig b/configs/ae350_rv32_spl_defconfig
index 47c8e9a621..25b4ada427 100644
--- a/configs/ae350_rv32_spl_defconfig
+++ b/configs/ae350_rv32_spl_defconfig
@@ -9,7 +9,6 @@ CONFIG_RISCV_SMODE=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x00200000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTDELAY=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SYS_PROMPT="RISC-V # "
diff --git a/configs/ae350_rv32_spl_xip_defconfig b/configs/ae350_rv32_spl_xip_defconfig
index 206ffe2720..c5d7ac3bc1 100644
--- a/configs/ae350_rv32_spl_xip_defconfig
+++ b/configs/ae350_rv32_spl_xip_defconfig
@@ -11,7 +11,6 @@ CONFIG_XIP=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x80010000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTDELAY=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SYS_PROMPT="RISC-V # "
diff --git a/configs/ae350_rv64_spl_defconfig b/configs/ae350_rv64_spl_defconfig
index ef04e4a4b6..61637a916e 100644
--- a/configs/ae350_rv64_spl_defconfig
+++ b/configs/ae350_rv64_spl_defconfig
@@ -10,7 +10,6 @@ CONFIG_RISCV_SMODE=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x00200000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTDELAY=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SYS_PROMPT="RISC-V # "
diff --git a/configs/ae350_rv64_spl_xip_defconfig b/configs/ae350_rv64_spl_xip_defconfig
index 21b7e8895b..6c63382f75 100644
--- a/configs/ae350_rv64_spl_xip_defconfig
+++ b/configs/ae350_rv64_spl_xip_defconfig
@@ -12,7 +12,6 @@ CONFIG_XIP=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x80010000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTDELAY=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SYS_PROMPT="RISC-V # "
diff --git a/configs/qemu-riscv32_spl_defconfig b/configs/qemu-riscv32_spl_defconfig
index a4c156612a..f30bd5f0a0 100644
--- a/configs/qemu-riscv32_spl_defconfig
+++ b/configs/qemu-riscv32_spl_defconfig
@@ -8,7 +8,6 @@ CONFIG_RISCV_SMODE=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x80200000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_DISPLAY_CPUINFO=y
 CONFIG_DISPLAY_BOARDINFO=y
 # CONFIG_CMD_MII is not set
diff --git a/configs/qemu-riscv64_spl_defconfig b/configs/qemu-riscv64_spl_defconfig
index 6c680483ce..ee91ece0ec 100644
--- a/configs/qemu-riscv64_spl_defconfig
+++ b/configs/qemu-riscv64_spl_defconfig
@@ -9,7 +9,6 @@ CONFIG_RISCV_SMODE=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x80200000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_DISPLAY_CPUINFO=y
 CONFIG_DISPLAY_BOARDINFO=y
 # CONFIG_CMD_MII is not set
diff --git a/configs/sifive_unleashed_defconfig b/configs/sifive_unleashed_defconfig
index dc9313e572..62416a7c1d 100644
--- a/configs/sifive_unleashed_defconfig
+++ b/configs/sifive_unleashed_defconfig
@@ -14,7 +14,6 @@ CONFIG_RISCV_SMODE=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x84000000
-# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_DISPLAY_CPUINFO=y
 CONFIG_DISPLAY_BOARDINFO=y
 CONFIG_MISC_INIT_R=y
-- 
2.25.1

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

* [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb
  2021-05-10  6:58 [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb Bin Meng
                   ` (12 preceding siblings ...)
  2021-05-10  6:58 ` [PATCH v4 13/13] riscv: Drop USE_SPL_FIT_GENERATOR Bin Meng
@ 2021-05-10  7:02 ` Bin Meng
       [not found] ` <752D002CFF5D0F4FA35C0100F1D73F3FE5EA0826@ATCPCS12.andestech.com>
  14 siblings, 0 replies; 25+ messages in thread
From: Bin Meng @ 2021-05-10  7:02 UTC (permalink / raw)
  To: u-boot

On Mon, May 10, 2021 at 2:58 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> This series updates binman to handle creation of u-boot.itb image for
> RISC-V boards.
>
> Azure results: PASS
> https://dev.azure.com/bmeng/GitHub/_build/results?buildId=363&view=results
>
> The following tests were performed:
> * booting qemu-riscv{32|64}_spl_defconfig on QEMU virt
> * booting sifive_unleashed_defconfig on QEMU sifive_u
>
> AE350 SPL defconfigs are not tested. @Rick, could you please test and report?

+Leo

>
> The series is available at u-boot-x86/riscv_binman for testing.
>
>
> Changes in v4:
> - update the makefile dependency on u-boot.img instead of u-boot.bin

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

* FW: [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb
       [not found] ` <752D002CFF5D0F4FA35C0100F1D73F3FE5EA0826@ATCPCS12.andestech.com>
@ 2021-05-10  7:06   ` Rick Chen
  2021-05-10  7:22     ` Rick Chen
  0 siblings, 1 reply; 25+ messages in thread
From: Rick Chen @ 2021-05-10  7:06 UTC (permalink / raw)
  To: u-boot

Hi Bin,

> From: Bin Meng <bmeng.cn@gmail.com>
> Sent: Monday, May 10, 2021 2:58 PM
> To: Simon Glass <sjg@chromium.org>; Rick Jian-Zhi Chen(???) <rick@andestech.com>; u-boot at lists.denx.de
> Subject: [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb
>
> This series updates binman to handle creation of u-boot.itb image for RISC-V boards.
>
> Azure results: PASS
> https://dev.azure.com/bmeng/GitHub/_build/results?buildId=363&view=results
>
> The following tests were performed:
> * booting qemu-riscv{32|64}_spl_defconfig on QEMU virt
> * booting sifive_unleashed_defconfig on QEMU sifive_u
>
> AE350 SPL defconfigs are not tested. @Rick, could you please test and report?

OK. I will verify it on AE350.

Thanks,
Rick

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

* FW: [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb
  2021-05-10  7:06   ` FW: " Rick Chen
@ 2021-05-10  7:22     ` Rick Chen
  2021-05-10  7:32       ` Bin Meng
  0 siblings, 1 reply; 25+ messages in thread
From: Rick Chen @ 2021-05-10  7:22 UTC (permalink / raw)
  To: u-boot

Hi Bin

> Hi Bin,
>
> > From: Bin Meng <bmeng.cn@gmail.com>
> > Sent: Monday, May 10, 2021 2:58 PM
> > To: Simon Glass <sjg@chromium.org>; Rick Jian-Zhi Chen(???) <rick@andestech.com>; u-boot at lists.denx.de
> > Subject: [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb
> >
> > This series updates binman to handle creation of u-boot.itb image for RISC-V boards.
> >
> > Azure results: PASS
> > https://dev.azure.com/bmeng/GitHub/_build/results?buildId=363&view=results
> >
> > The following tests were performed:
> > * booting qemu-riscv{32|64}_spl_defconfig on QEMU virt
> > * booting sifive_unleashed_defconfig on QEMU sifive_u
> >
> > AE350 SPL defconfigs are not tested. @Rick, could you please test and report?
>
> OK. I will verify it on AE350.

It fail as below messages:

U-Boot SPL 2021.07-rc1-00218-g468b3b3 (May 10 2021 - 15:13:03 +0800)
Trying to boot from RAM
alloc space exhausted
Could not get FIT buffer of 499076 bytes
        check CONFIG_SYS_SPL_MALLOC_SIZE
No device tree specified in SPL image
### ERROR ### Please RESET the board ###

Any comments ?

Thanks,
Rick

>
> Thanks,
> Rick

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

* FW: [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb
  2021-05-10  7:22     ` Rick Chen
@ 2021-05-10  7:32       ` Bin Meng
  2021-05-11  0:49         ` Rick Chen
  0 siblings, 1 reply; 25+ messages in thread
From: Bin Meng @ 2021-05-10  7:32 UTC (permalink / raw)
  To: u-boot

Hi Rick,

On Mon, May 10, 2021 at 3:22 PM Rick Chen <rickchen36@gmail.com> wrote:
>
> Hi Bin
>
> > Hi Bin,
> >
> > > From: Bin Meng <bmeng.cn@gmail.com>
> > > Sent: Monday, May 10, 2021 2:58 PM
> > > To: Simon Glass <sjg@chromium.org>; Rick Jian-Zhi Chen(???) <rick@andestech.com>; u-boot at lists.denx.de
> > > Subject: [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb
> > >
> > > This series updates binman to handle creation of u-boot.itb image for RISC-V boards.
> > >
> > > Azure results: PASS
> > > https://dev.azure.com/bmeng/GitHub/_build/results?buildId=363&view=results
> > >
> > > The following tests were performed:
> > > * booting qemu-riscv{32|64}_spl_defconfig on QEMU virt
> > > * booting sifive_unleashed_defconfig on QEMU sifive_u
> > >
> > > AE350 SPL defconfigs are not tested. @Rick, could you please test and report?
> >
> > OK. I will verify it on AE350.
>
> It fail as below messages:
>
> U-Boot SPL 2021.07-rc1-00218-g468b3b3 (May 10 2021 - 15:13:03 +0800)
> Trying to boot from RAM
> alloc space exhausted

Looks it is running out of memory.

> Could not get FIT buffer of 499076 bytes
>         check CONFIG_SYS_SPL_MALLOC_SIZE

Could you please try increasing CONFIG_SYS_SPL_MALLOC_SIZE?

> No device tree specified in SPL image
> ### ERROR ### Please RESET the board ###
>
> Any comments ?

Regards,
Bin

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

* FW: [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb
  2021-05-10  7:32       ` Bin Meng
@ 2021-05-11  0:49         ` Rick Chen
  2021-05-11  3:48           ` Bin Meng
  0 siblings, 1 reply; 25+ messages in thread
From: Rick Chen @ 2021-05-11  0:49 UTC (permalink / raw)
  To: u-boot

Hi Bin,

> Hi Rick,
>
> On Mon, May 10, 2021 at 3:22 PM Rick Chen <rickchen36@gmail.com> wrote:
> >
> > Hi Bin
> >
> > > Hi Bin,
> > >
> > > > From: Bin Meng <bmeng.cn@gmail.com>
> > > > Sent: Monday, May 10, 2021 2:58 PM
> > > > To: Simon Glass <sjg@chromium.org>; Rick Jian-Zhi Chen(???) <rick@andestech.com>; u-boot at lists.denx.de
> > > > Subject: [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb
> > > >
> > > > This series updates binman to handle creation of u-boot.itb image for RISC-V boards.
> > > >
> > > > Azure results: PASS
> > > > https://dev.azure.com/bmeng/GitHub/_build/results?buildId=363&view=results
> > > >
> > > > The following tests were performed:
> > > > * booting qemu-riscv{32|64}_spl_defconfig on QEMU virt
> > > > * booting sifive_unleashed_defconfig on QEMU sifive_u
> > > >
> > > > AE350 SPL defconfigs are not tested. @Rick, could you please test and report?
> > >
> > > OK. I will verify it on AE350.
> >
> > It fail as below messages:
> >
> > U-Boot SPL 2021.07-rc1-00218-g468b3b3 (May 10 2021 - 15:13:03 +0800)
> > Trying to boot from RAM
> > alloc space exhausted
>
> Looks it is running out of memory.
>
> > Could not get FIT buffer of 499076 bytes
> >         check CONFIG_SYS_SPL_MALLOC_SIZE
>
> Could you please try increasing CONFIG_SYS_SPL_MALLOC_SIZE?

I increased CONFIG_SYS_SPL_MALLOC_SIZE, but it is useless.
But it boots successfully after increase CONFIG_SPL_SYS_MALLOC_F_LEN larger.

Thanks,
Rick

>
> > No device tree specified in SPL image
> > ### ERROR ### Please RESET the board ###
> >
> > Any comments ?
>
> Regards,
> Bin

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

* FW: [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb
  2021-05-11  0:49         ` Rick Chen
@ 2021-05-11  3:48           ` Bin Meng
  2021-05-11  3:51             ` Rick Chen
  0 siblings, 1 reply; 25+ messages in thread
From: Bin Meng @ 2021-05-11  3:48 UTC (permalink / raw)
  To: u-boot

Hi Rick,

On Tue, May 11, 2021 at 8:49 AM Rick Chen <rickchen36@gmail.com> wrote:
>
> Hi Bin,
>
> > Hi Rick,
> >
> > On Mon, May 10, 2021 at 3:22 PM Rick Chen <rickchen36@gmail.com> wrote:
> > >
> > > Hi Bin
> > >
> > > > Hi Bin,
> > > >
> > > > > From: Bin Meng <bmeng.cn@gmail.com>
> > > > > Sent: Monday, May 10, 2021 2:58 PM
> > > > > To: Simon Glass <sjg@chromium.org>; Rick Jian-Zhi Chen(???) <rick@andestech.com>; u-boot at lists.denx.de
> > > > > Subject: [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb
> > > > >
> > > > > This series updates binman to handle creation of u-boot.itb image for RISC-V boards.
> > > > >
> > > > > Azure results: PASS
> > > > > https://dev.azure.com/bmeng/GitHub/_build/results?buildId=363&view=results
> > > > >
> > > > > The following tests were performed:
> > > > > * booting qemu-riscv{32|64}_spl_defconfig on QEMU virt
> > > > > * booting sifive_unleashed_defconfig on QEMU sifive_u
> > > > >
> > > > > AE350 SPL defconfigs are not tested. @Rick, could you please test and report?
> > > >
> > > > OK. I will verify it on AE350.
> > >
> > > It fail as below messages:
> > >
> > > U-Boot SPL 2021.07-rc1-00218-g468b3b3 (May 10 2021 - 15:13:03 +0800)
> > > Trying to boot from RAM
> > > alloc space exhausted
> >
> > Looks it is running out of memory.
> >
> > > Could not get FIT buffer of 499076 bytes
> > >         check CONFIG_SYS_SPL_MALLOC_SIZE
> >
> > Could you please try increasing CONFIG_SYS_SPL_MALLOC_SIZE?
>
> I increased CONFIG_SYS_SPL_MALLOC_SIZE, but it is useless.
> But it boots successfully after increase CONFIG_SPL_SYS_MALLOC_F_LEN larger.

Thanks for testing. I am not sure why AE350 fails to boot because this
series only changes the way to assemble the bits.

Could you please confirm if without this patch series, AE350 can boot?

Regards,
Bin

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

* FW: [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb
  2021-05-11  3:48           ` Bin Meng
@ 2021-05-11  3:51             ` Rick Chen
  2021-05-12  3:25               ` Rick Chen
  0 siblings, 1 reply; 25+ messages in thread
From: Rick Chen @ 2021-05-11  3:51 UTC (permalink / raw)
  To: u-boot

> Hi Rick,
>
> On Tue, May 11, 2021 at 8:49 AM Rick Chen <rickchen36@gmail.com> wrote:
> >
> > Hi Bin,
> >
> > > Hi Rick,
> > >
> > > On Mon, May 10, 2021 at 3:22 PM Rick Chen <rickchen36@gmail.com> wrote:
> > > >
> > > > Hi Bin
> > > >
> > > > > Hi Bin,
> > > > >
> > > > > > From: Bin Meng <bmeng.cn@gmail.com>
> > > > > > Sent: Monday, May 10, 2021 2:58 PM
> > > > > > To: Simon Glass <sjg@chromium.org>; Rick Jian-Zhi Chen(???) <rick@andestech.com>; u-boot at lists.denx.de
> > > > > > Subject: [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb
> > > > > >
> > > > > > This series updates binman to handle creation of u-boot.itb image for RISC-V boards.
> > > > > >
> > > > > > Azure results: PASS
> > > > > > https://dev.azure.com/bmeng/GitHub/_build/results?buildId=363&view=results
> > > > > >
> > > > > > The following tests were performed:
> > > > > > * booting qemu-riscv{32|64}_spl_defconfig on QEMU virt
> > > > > > * booting sifive_unleashed_defconfig on QEMU sifive_u
> > > > > >
> > > > > > AE350 SPL defconfigs are not tested. @Rick, could you please test and report?
> > > > >
> > > > > OK. I will verify it on AE350.
> > > >
> > > > It fail as below messages:
> > > >
> > > > U-Boot SPL 2021.07-rc1-00218-g468b3b3 (May 10 2021 - 15:13:03 +0800)
> > > > Trying to boot from RAM
> > > > alloc space exhausted
> > >
> > > Looks it is running out of memory.
> > >
> > > > Could not get FIT buffer of 499076 bytes
> > > >         check CONFIG_SYS_SPL_MALLOC_SIZE
> > >
> > > Could you please try increasing CONFIG_SYS_SPL_MALLOC_SIZE?
> >
> > I increased CONFIG_SYS_SPL_MALLOC_SIZE, but it is useless.
> > But it boots successfully after increase CONFIG_SPL_SYS_MALLOC_F_LEN larger.
>
> Thanks for testing. I am not sure why AE350 fails to boot because this
> series only changes the way to assemble the bits.
>
> Could you please confirm if without this patch series, AE350 can boot?

OK.

>
> Regards,
> Bin

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

* FW: [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb
  2021-05-11  3:51             ` Rick Chen
@ 2021-05-12  3:25               ` Rick Chen
  2021-05-12  3:32                 ` Bin Meng
  2021-05-17  2:09                 ` Bin Meng
  0 siblings, 2 replies; 25+ messages in thread
From: Rick Chen @ 2021-05-12  3:25 UTC (permalink / raw)
  To: u-boot

HI Bin,

>
> > Hi Rick,
> >
> > On Tue, May 11, 2021 at 8:49 AM Rick Chen <rickchen36@gmail.com> wrote:
> > >
> > > Hi Bin,
> > >
> > > > Hi Rick,
> > > >
> > > > On Mon, May 10, 2021 at 3:22 PM Rick Chen <rickchen36@gmail.com> wrote:
> > > > >
> > > > > Hi Bin
> > > > >
> > > > > > Hi Bin,
> > > > > >
> > > > > > > From: Bin Meng <bmeng.cn@gmail.com>
> > > > > > > Sent: Monday, May 10, 2021 2:58 PM
> > > > > > > To: Simon Glass <sjg@chromium.org>; Rick Jian-Zhi Chen(???) <rick@andestech.com>; u-boot at lists.denx.de
> > > > > > > Subject: [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb
> > > > > > >
> > > > > > > This series updates binman to handle creation of u-boot.itb image for RISC-V boards.
> > > > > > >
> > > > > > > Azure results: PASS
> > > > > > > https://dev.azure.com/bmeng/GitHub/_build/results?buildId=363&view=results
> > > > > > >
> > > > > > > The following tests were performed:
> > > > > > > * booting qemu-riscv{32|64}_spl_defconfig on QEMU virt
> > > > > > > * booting sifive_unleashed_defconfig on QEMU sifive_u
> > > > > > >
> > > > > > > AE350 SPL defconfigs are not tested. @Rick, could you please test and report?
> > > > > >
> > > > > > OK. I will verify it on AE350.
> > > > >
> > > > > It fail as below messages:
> > > > >
> > > > > U-Boot SPL 2021.07-rc1-00218-g468b3b3 (May 10 2021 - 15:13:03 +0800)
> > > > > Trying to boot from RAM
> > > > > alloc space exhausted
> > > >
> > > > Looks it is running out of memory.
> > > >
> > > > > Could not get FIT buffer of 499076 bytes
> > > > >         check CONFIG_SYS_SPL_MALLOC_SIZE
> > > >
> > > > Could you please try increasing CONFIG_SYS_SPL_MALLOC_SIZE?
> > >
> > > I increased CONFIG_SYS_SPL_MALLOC_SIZE, but it is useless.
> > > But it boots successfully after increase CONFIG_SPL_SYS_MALLOC_F_LEN larger.
> >
> > Thanks for testing. I am not sure why AE350 fails to boot because this
> > series only changes the way to assemble the bits.
> >
> > Could you please confirm if without this patch series, AE350 can boot?
>
> OK.

============================================
I have verified AE350 without your patch, it works as below:
============================================
U-Boot SPL 2021.07-rc1-00194-g07b5310 (May 12 2021 - 10:59:48 +0800)
Trying to boot from RAM

U-Boot 2021.07-rc1-00194-g07b5310 (May 12 2021 - 10:59:48 +0800)

DRAM:  1 GiB
Flash: 64 MiB
MMC:   mmc at f0e00000: 0
Loading Environment from SPIFlash... SF: Detected mx25u1635e with page
size 256 Bytes, erase size 4 KiB, total 2 MiB
OK
In:    serial at f0300000
Out:   serial at f0300000
Err:   serial at f0300000
Net:   no alias for ethernet0

Warning: mac at e0100000 (eth0) using random MAC address - 26:00:fa:12:76:ad
eth0: mac at e0100000
Hit any key to stop autoboot:  0
RISC-V #

=========================
With your patch, it fail as below:
=========================

U-Boot SPL 2021.07-rc1-00207-g28a2d21 (May 12 2021 - 11:09:11 +0800)
Trying to boot from RAM
alloc space exhausted
Could not get FIT buffer of 499076 bytes
        check CONFIG_SYS_SPL_MALLOC_SIZE
No device tree specified in SPL image

=======================================================
After increase CONFIG_SPL_SYS_MALLOC_F_LEN, it works as below
=======================================================
U-Boot SPL 2021.07-rc1-00207-g28a2d21 (May 12 2021 - 11:11:00 +0800)
Trying to boot from RAM


U-Boot 2021.07-rc1-00207-g28a2d21 (May 12 2021 - 11:11:00 +0800)

DRAM:  1 GiB
Flash: 64 MiB
MMC:   mmc at f0e00000: 0
Loading Environment from SPIFlash... SF: Detected mx25u1635e with page
size 256 Bytes, erase size 4 KiB, total 2 MiB
OK
In:    serial at f0300000
Out:   serial at f0300000
Err:   serial at f0300000
Net:   no alias for ethernet0

Warning: mac at e0100000 (eth0) using random MAC address - e6:58:7e:7c:5f:49
eth0: mac at e0100000
Hit any key to stop autoboot:  0
RISC-V #


I found that it need larger heap size when spl try to get fit image
with using binman to generate u-boot.itb instead of
USE_SPL_FIT_GENERATOR.
But it is OK. I will send a patch for AE350 later.

Thanks,
Rick




>
> >
> > Regards,
> > Bin

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

* FW: [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb
  2021-05-12  3:25               ` Rick Chen
@ 2021-05-12  3:32                 ` Bin Meng
  2021-05-17  2:09                 ` Bin Meng
  1 sibling, 0 replies; 25+ messages in thread
From: Bin Meng @ 2021-05-12  3:32 UTC (permalink / raw)
  To: u-boot

Hi Rick,

On Wed, May 12, 2021 at 11:25 AM Rick Chen <rickchen36@gmail.com> wrote:
>
> HI Bin,
>
> >
> > > Hi Rick,
> > >
> > > On Tue, May 11, 2021 at 8:49 AM Rick Chen <rickchen36@gmail.com> wrote:
> > > >
> > > > Hi Bin,
> > > >
> > > > > Hi Rick,
> > > > >
> > > > > On Mon, May 10, 2021 at 3:22 PM Rick Chen <rickchen36@gmail.com> wrote:
> > > > > >
> > > > > > Hi Bin
> > > > > >
> > > > > > > Hi Bin,
> > > > > > >
> > > > > > > > From: Bin Meng <bmeng.cn@gmail.com>
> > > > > > > > Sent: Monday, May 10, 2021 2:58 PM
> > > > > > > > To: Simon Glass <sjg@chromium.org>; Rick Jian-Zhi Chen(???) <rick@andestech.com>; u-boot at lists.denx.de
> > > > > > > > Subject: [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb
> > > > > > > >
> > > > > > > > This series updates binman to handle creation of u-boot.itb image for RISC-V boards.
> > > > > > > >
> > > > > > > > Azure results: PASS
> > > > > > > > https://dev.azure.com/bmeng/GitHub/_build/results?buildId=363&view=results
> > > > > > > >
> > > > > > > > The following tests were performed:
> > > > > > > > * booting qemu-riscv{32|64}_spl_defconfig on QEMU virt
> > > > > > > > * booting sifive_unleashed_defconfig on QEMU sifive_u
> > > > > > > >
> > > > > > > > AE350 SPL defconfigs are not tested. @Rick, could you please test and report?
> > > > > > >
> > > > > > > OK. I will verify it on AE350.
> > > > > >
> > > > > > It fail as below messages:
> > > > > >
> > > > > > U-Boot SPL 2021.07-rc1-00218-g468b3b3 (May 10 2021 - 15:13:03 +0800)
> > > > > > Trying to boot from RAM
> > > > > > alloc space exhausted
> > > > >
> > > > > Looks it is running out of memory.
> > > > >
> > > > > > Could not get FIT buffer of 499076 bytes
> > > > > >         check CONFIG_SYS_SPL_MALLOC_SIZE
> > > > >
> > > > > Could you please try increasing CONFIG_SYS_SPL_MALLOC_SIZE?
> > > >
> > > > I increased CONFIG_SYS_SPL_MALLOC_SIZE, but it is useless.
> > > > But it boots successfully after increase CONFIG_SPL_SYS_MALLOC_F_LEN larger.
> > >
> > > Thanks for testing. I am not sure why AE350 fails to boot because this
> > > series only changes the way to assemble the bits.
> > >
> > > Could you please confirm if without this patch series, AE350 can boot?
> >
> > OK.
>
> ============================================
> I have verified AE350 without your patch, it works as below:
> ============================================
> U-Boot SPL 2021.07-rc1-00194-g07b5310 (May 12 2021 - 10:59:48 +0800)
> Trying to boot from RAM
>
> U-Boot 2021.07-rc1-00194-g07b5310 (May 12 2021 - 10:59:48 +0800)
>
> DRAM:  1 GiB
> Flash: 64 MiB
> MMC:   mmc at f0e00000: 0
> Loading Environment from SPIFlash... SF: Detected mx25u1635e with page
> size 256 Bytes, erase size 4 KiB, total 2 MiB
> OK
> In:    serial at f0300000
> Out:   serial at f0300000
> Err:   serial at f0300000
> Net:   no alias for ethernet0
>
> Warning: mac at e0100000 (eth0) using random MAC address - 26:00:fa:12:76:ad
> eth0: mac at e0100000
> Hit any key to stop autoboot:  0
> RISC-V #
>
> =========================
> With your patch, it fail as below:
> =========================
>
> U-Boot SPL 2021.07-rc1-00207-g28a2d21 (May 12 2021 - 11:09:11 +0800)
> Trying to boot from RAM
> alloc space exhausted
> Could not get FIT buffer of 499076 bytes
>         check CONFIG_SYS_SPL_MALLOC_SIZE
> No device tree specified in SPL image
>
> =======================================================
> After increase CONFIG_SPL_SYS_MALLOC_F_LEN, it works as below
> =======================================================
> U-Boot SPL 2021.07-rc1-00207-g28a2d21 (May 12 2021 - 11:11:00 +0800)
> Trying to boot from RAM
>
>
> U-Boot 2021.07-rc1-00207-g28a2d21 (May 12 2021 - 11:11:00 +0800)
>
> DRAM:  1 GiB
> Flash: 64 MiB
> MMC:   mmc at f0e00000: 0
> Loading Environment from SPIFlash... SF: Detected mx25u1635e with page
> size 256 Bytes, erase size 4 KiB, total 2 MiB
> OK
> In:    serial at f0300000
> Out:   serial at f0300000
> Err:   serial at f0300000
> Net:   no alias for ethernet0
>
> Warning: mac at e0100000 (eth0) using random MAC address - e6:58:7e:7c:5f:49
> eth0: mac at e0100000
> Hit any key to stop autoboot:  0
> RISC-V #
>
>
> I found that it need larger heap size when spl try to get fit image
> with using binman to generate u-boot.itb instead of
> USE_SPL_FIT_GENERATOR.
> But it is OK. I will send a patch for AE350 later.

Thank you very much for your testing. Good to know we have a solution.

Regards,
Bin

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

* FW: [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb
  2021-05-12  3:25               ` Rick Chen
  2021-05-12  3:32                 ` Bin Meng
@ 2021-05-17  2:09                 ` Bin Meng
  2021-05-17  8:09                   ` Rick Chen
  1 sibling, 1 reply; 25+ messages in thread
From: Bin Meng @ 2021-05-17  2:09 UTC (permalink / raw)
  To: u-boot

Hi Rick,

On Wed, May 12, 2021 at 11:25 AM Rick Chen <rickchen36@gmail.com> wrote:
>
> HI Bin,
>
> >
> > > Hi Rick,
> > >
> > > On Tue, May 11, 2021 at 8:49 AM Rick Chen <rickchen36@gmail.com> wrote:
> > > >
> > > > Hi Bin,
> > > >
> > > > > Hi Rick,
> > > > >
> > > > > On Mon, May 10, 2021 at 3:22 PM Rick Chen <rickchen36@gmail.com> wrote:
> > > > > >
> > > > > > Hi Bin
> > > > > >
> > > > > > > Hi Bin,
> > > > > > >
> > > > > > > > From: Bin Meng <bmeng.cn@gmail.com>
> > > > > > > > Sent: Monday, May 10, 2021 2:58 PM
> > > > > > > > To: Simon Glass <sjg@chromium.org>; Rick Jian-Zhi Chen(???) <rick@andestech.com>; u-boot at lists.denx.de
> > > > > > > > Subject: [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb
> > > > > > > >
> > > > > > > > This series updates binman to handle creation of u-boot.itb image for RISC-V boards.
> > > > > > > >
> > > > > > > > Azure results: PASS
> > > > > > > > https://dev.azure.com/bmeng/GitHub/_build/results?buildId=363&view=results
> > > > > > > >
> > > > > > > > The following tests were performed:
> > > > > > > > * booting qemu-riscv{32|64}_spl_defconfig on QEMU virt
> > > > > > > > * booting sifive_unleashed_defconfig on QEMU sifive_u
> > > > > > > >
> > > > > > > > AE350 SPL defconfigs are not tested. @Rick, could you please test and report?
> > > > > > >
> > > > > > > OK. I will verify it on AE350.
> > > > > >
> > > > > > It fail as below messages:
> > > > > >
> > > > > > U-Boot SPL 2021.07-rc1-00218-g468b3b3 (May 10 2021 - 15:13:03 +0800)
> > > > > > Trying to boot from RAM
> > > > > > alloc space exhausted
> > > > >
> > > > > Looks it is running out of memory.
> > > > >
> > > > > > Could not get FIT buffer of 499076 bytes
> > > > > >         check CONFIG_SYS_SPL_MALLOC_SIZE
> > > > >
> > > > > Could you please try increasing CONFIG_SYS_SPL_MALLOC_SIZE?
> > > >
> > > > I increased CONFIG_SYS_SPL_MALLOC_SIZE, but it is useless.
> > > > But it boots successfully after increase CONFIG_SPL_SYS_MALLOC_F_LEN larger.
> > >
> > > Thanks for testing. I am not sure why AE350 fails to boot because this
> > > series only changes the way to assemble the bits.
> > >
> > > Could you please confirm if without this patch series, AE350 can boot?
> >
> > OK.
>
> ============================================
> I have verified AE350 without your patch, it works as below:
> ============================================
> U-Boot SPL 2021.07-rc1-00194-g07b5310 (May 12 2021 - 10:59:48 +0800)
> Trying to boot from RAM
>
> U-Boot 2021.07-rc1-00194-g07b5310 (May 12 2021 - 10:59:48 +0800)
>
> DRAM:  1 GiB
> Flash: 64 MiB
> MMC:   mmc at f0e00000: 0
> Loading Environment from SPIFlash... SF: Detected mx25u1635e with page
> size 256 Bytes, erase size 4 KiB, total 2 MiB
> OK
> In:    serial at f0300000
> Out:   serial at f0300000
> Err:   serial at f0300000
> Net:   no alias for ethernet0
>
> Warning: mac at e0100000 (eth0) using random MAC address - 26:00:fa:12:76:ad
> eth0: mac at e0100000
> Hit any key to stop autoboot:  0
> RISC-V #
>
> =========================
> With your patch, it fail as below:
> =========================
>
> U-Boot SPL 2021.07-rc1-00207-g28a2d21 (May 12 2021 - 11:09:11 +0800)
> Trying to boot from RAM
> alloc space exhausted
> Could not get FIT buffer of 499076 bytes
>         check CONFIG_SYS_SPL_MALLOC_SIZE
> No device tree specified in SPL image
>
> =======================================================
> After increase CONFIG_SPL_SYS_MALLOC_F_LEN, it works as below
> =======================================================
> U-Boot SPL 2021.07-rc1-00207-g28a2d21 (May 12 2021 - 11:11:00 +0800)
> Trying to boot from RAM
>
>
> U-Boot 2021.07-rc1-00207-g28a2d21 (May 12 2021 - 11:11:00 +0800)
>
> DRAM:  1 GiB
> Flash: 64 MiB
> MMC:   mmc at f0e00000: 0
> Loading Environment from SPIFlash... SF: Detected mx25u1635e with page
> size 256 Bytes, erase size 4 KiB, total 2 MiB
> OK
> In:    serial at f0300000
> Out:   serial at f0300000
> Err:   serial at f0300000
> Net:   no alias for ethernet0
>
> Warning: mac at e0100000 (eth0) using random MAC address - e6:58:7e:7c:5f:49
> eth0: mac at e0100000
> Hit any key to stop autoboot:  0
> RISC-V #
>
>
> I found that it need larger heap size when spl try to get fit image
> with using binman to generate u-boot.itb instead of
> USE_SPL_FIT_GENERATOR.
> But it is OK. I will send a patch for AE350 later.

A patch for AE350 to increase CONFIG_SPL_SYS_MALLOC_F_LEN needs to be
applied before this series.

Would you please send the AE350 patch, and get this series applied?

Regards,
Bin

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

* FW: [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb
  2021-05-17  2:09                 ` Bin Meng
@ 2021-05-17  8:09                   ` Rick Chen
  0 siblings, 0 replies; 25+ messages in thread
From: Rick Chen @ 2021-05-17  8:09 UTC (permalink / raw)
  To: u-boot

Hi Bin

> Hi Rick,
>
> On Wed, May 12, 2021 at 11:25 AM Rick Chen <rickchen36@gmail.com> wrote:
> >
> > HI Bin,
> >
> > >
> > > > Hi Rick,
> > > >
> > > > On Tue, May 11, 2021 at 8:49 AM Rick Chen <rickchen36@gmail.com> wrote:
> > > > >
> > > > > Hi Bin,
> > > > >
> > > > > > Hi Rick,
> > > > > >
> > > > > > On Mon, May 10, 2021 at 3:22 PM Rick Chen <rickchen36@gmail.com> wrote:
> > > > > > >
> > > > > > > Hi Bin
> > > > > > >
> > > > > > > > Hi Bin,
> > > > > > > >
> > > > > > > > > From: Bin Meng <bmeng.cn@gmail.com>
> > > > > > > > > Sent: Monday, May 10, 2021 2:58 PM
> > > > > > > > > To: Simon Glass <sjg@chromium.org>; Rick Jian-Zhi Chen(???) <rick@andestech.com>; u-boot at lists.denx.de
> > > > > > > > > Subject: [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb
> > > > > > > > >
> > > > > > > > > This series updates binman to handle creation of u-boot.itb image for RISC-V boards.
> > > > > > > > >
> > > > > > > > > Azure results: PASS
> > > > > > > > > https://dev.azure.com/bmeng/GitHub/_build/results?buildId=363&view=results
> > > > > > > > >
> > > > > > > > > The following tests were performed:
> > > > > > > > > * booting qemu-riscv{32|64}_spl_defconfig on QEMU virt
> > > > > > > > > * booting sifive_unleashed_defconfig on QEMU sifive_u
> > > > > > > > >
> > > > > > > > > AE350 SPL defconfigs are not tested. @Rick, could you please test and report?
> > > > > > > >
> > > > > > > > OK. I will verify it on AE350.
> > > > > > >
> > > > > > > It fail as below messages:
> > > > > > >
> > > > > > > U-Boot SPL 2021.07-rc1-00218-g468b3b3 (May 10 2021 - 15:13:03 +0800)
> > > > > > > Trying to boot from RAM
> > > > > > > alloc space exhausted
> > > > > >
> > > > > > Looks it is running out of memory.
> > > > > >
> > > > > > > Could not get FIT buffer of 499076 bytes
> > > > > > >         check CONFIG_SYS_SPL_MALLOC_SIZE
> > > > > >
> > > > > > Could you please try increasing CONFIG_SYS_SPL_MALLOC_SIZE?
> > > > >
> > > > > I increased CONFIG_SYS_SPL_MALLOC_SIZE, but it is useless.
> > > > > But it boots successfully after increase CONFIG_SPL_SYS_MALLOC_F_LEN larger.
> > > >
> > > > Thanks for testing. I am not sure why AE350 fails to boot because this
> > > > series only changes the way to assemble the bits.
> > > >
> > > > Could you please confirm if without this patch series, AE350 can boot?
> > >
> > > OK.
> >
> > ============================================
> > I have verified AE350 without your patch, it works as below:
> > ============================================
> > U-Boot SPL 2021.07-rc1-00194-g07b5310 (May 12 2021 - 10:59:48 +0800)
> > Trying to boot from RAM
> >
> > U-Boot 2021.07-rc1-00194-g07b5310 (May 12 2021 - 10:59:48 +0800)
> >
> > DRAM:  1 GiB
> > Flash: 64 MiB
> > MMC:   mmc at f0e00000: 0
> > Loading Environment from SPIFlash... SF: Detected mx25u1635e with page
> > size 256 Bytes, erase size 4 KiB, total 2 MiB
> > OK
> > In:    serial at f0300000
> > Out:   serial at f0300000
> > Err:   serial at f0300000
> > Net:   no alias for ethernet0
> >
> > Warning: mac at e0100000 (eth0) using random MAC address - 26:00:fa:12:76:ad
> > eth0: mac at e0100000
> > Hit any key to stop autoboot:  0
> > RISC-V #
> >
> > =========================
> > With your patch, it fail as below:
> > =========================
> >
> > U-Boot SPL 2021.07-rc1-00207-g28a2d21 (May 12 2021 - 11:09:11 +0800)
> > Trying to boot from RAM
> > alloc space exhausted
> > Could not get FIT buffer of 499076 bytes
> >         check CONFIG_SYS_SPL_MALLOC_SIZE
> > No device tree specified in SPL image
> >
> > =======================================================
> > After increase CONFIG_SPL_SYS_MALLOC_F_LEN, it works as below
> > =======================================================
> > U-Boot SPL 2021.07-rc1-00207-g28a2d21 (May 12 2021 - 11:11:00 +0800)
> > Trying to boot from RAM
> >
> >
> > U-Boot 2021.07-rc1-00207-g28a2d21 (May 12 2021 - 11:11:00 +0800)
> >
> > DRAM:  1 GiB
> > Flash: 64 MiB
> > MMC:   mmc at f0e00000: 0
> > Loading Environment from SPIFlash... SF: Detected mx25u1635e with page
> > size 256 Bytes, erase size 4 KiB, total 2 MiB
> > OK
> > In:    serial at f0300000
> > Out:   serial at f0300000
> > Err:   serial at f0300000
> > Net:   no alias for ethernet0
> >
> > Warning: mac at e0100000 (eth0) using random MAC address - e6:58:7e:7c:5f:49
> > eth0: mac at e0100000
> > Hit any key to stop autoboot:  0
> > RISC-V #
> >
> >
> > I found that it need larger heap size when spl try to get fit image
> > with using binman to generate u-boot.itb instead of
> > USE_SPL_FIT_GENERATOR.
> > But it is OK. I will send a patch for AE350 later.
>
> A patch for AE350 to increase CONFIG_SPL_SYS_MALLOC_F_LEN needs to be
> applied before this series.
>
> Would you please send the AE350 patch, and get this series applied?

OK, I will send the AE350 patch later.

Thanks,
Rick

>
> Regards,
> Bin

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

end of thread, other threads:[~2021-05-17  8:09 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-10  6:58 [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb Bin Meng
2021-05-10  6:58 ` [PATCH v4 01/13] common: kconfig: Correct a typo in SPL_LOAD_FIT Bin Meng
2021-05-10  6:58 ` [PATCH v4 02/13] binman: Correct '-a' description in the doc Bin Meng
2021-05-10  6:58 ` [PATCH v4 03/13] binman: Correct the comment for ATF entry type Bin Meng
2021-05-10  6:58 ` [PATCH v4 04/13] binman: test: Rename 172_fit_fdt.dts to 170_fit_fdt.dts Bin Meng
2021-05-10  6:58 ` [PATCH v4 05/13] binman: Add support for RISC-V OpenSBI fw_dynamic blob Bin Meng
2021-05-10  6:58 ` [PATCH v4 06/13] makefile: Pass OpenSBI blob to binman make rules Bin Meng
2021-05-10  6:58 ` [PATCH v4 07/13] riscv: sifive: unleashed: Switch to use binman to generate u-boot.itb Bin Meng
2021-05-10  6:58 ` [PATCH v4 08/13] lib: kconfig: Limit BINMAN_FDT for OF_SEPARATE or OF_EMBED Bin Meng
2021-05-10  6:58 ` [PATCH v4 09/13] binman: Support packaging U-Boot for scenarios like OF_BOARD or OF_PRIOR_STAGE Bin Meng
2021-05-10  6:58 ` [PATCH v4 10/13] riscv: dts: Sort build targets in alphabetical order Bin Meng
2021-05-10  6:58 ` [PATCH v4 11/13] riscv: qemu: Switch to use binman to generate u-boot.itb Bin Meng
2021-05-10  6:58 ` [PATCH v4 12/13] riscv: ae350: " Bin Meng
2021-05-10  6:58 ` [PATCH v4 13/13] riscv: Drop USE_SPL_FIT_GENERATOR Bin Meng
2021-05-10  7:02 ` [PATCH v4 00/13] riscv: Switch to use binman to generate u-boot.itb Bin Meng
     [not found] ` <752D002CFF5D0F4FA35C0100F1D73F3FE5EA0826@ATCPCS12.andestech.com>
2021-05-10  7:06   ` FW: " Rick Chen
2021-05-10  7:22     ` Rick Chen
2021-05-10  7:32       ` Bin Meng
2021-05-11  0:49         ` Rick Chen
2021-05-11  3:48           ` Bin Meng
2021-05-11  3:51             ` Rick Chen
2021-05-12  3:25               ` Rick Chen
2021-05-12  3:32                 ` Bin Meng
2021-05-17  2:09                 ` Bin Meng
2021-05-17  8:09                   ` Rick Chen

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.