All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V5 0/9] arm64: binman: use binman symbols for imx
@ 2022-05-24  8:00 Peng Fan (OSS)
  2022-05-24  8:00 ` [PATCH V5 1/9] arm: dts: imx8m: update binman ddr firmware node name Peng Fan (OSS)
                   ` (8 more replies)
  0 siblings, 9 replies; 14+ messages in thread
From: Peng Fan (OSS) @ 2022-05-24  8:00 UTC (permalink / raw)
  To: sbabic, festevam, trini; +Cc: u-boot, alpernebiyasak, Peng Fan

From: Peng Fan <peng.fan@nxp.com>


V5:
 Introduce no-u-boot-any property to drop the X86 guard patch 1
 Add blob-ext type for ddr firmware node
 Include a missing dts change

V4:
 Fix three boards build failure

V3:
 Add R-b/T-b
 Fix build warning

V2:
 resolve some CI failure
 include patch 7

binman symbol is a good feature, but only used on X86 for now. This patchset
is to use it for i.MX8M platform.

The current imx8m ddr phy firmware consumes lots of space, because we pad
them to the largest 32KB and 16KB for IMEM and DMEM.

With this patchset we use binman symbols to get firmware location and size,
we could save near 36KB with i.MX8MP-EVK.

Please help check and test

Peng Fan (9):
  arm: dts: imx8m: update binman ddr firmware node name
  armv8: u-boot-spl.lds: mark __image_copy_start as symbol
  tools: binman: section: replace @ with -
  binman: introduce no-u-boot-any property
  arm: dts: imx8m: add no-u-boot-any property
  ddr: imx8m: helper: load ddr firmware according to binman symbols
  arm: dts: imx8m: shrink ddr firmware size to actual file size
  binman_sym: guard with CONFIG_SPL_BINMAN_SYMBOLS
  imx: imx8mm-icore: migrate to use BINMAN

 arch/arm/cpu/armv8/u-boot-spl.lds             |  2 +-
 arch/arm/dts/imx8mm-u-boot.dtsi               | 17 ++++---
 arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi    | 21 +++++---
 .../dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi  |  9 ++--
 arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi      | 21 +++++---
 arch/arm/dts/imx8mn-evk-u-boot.dtsi           | 21 +++++---
 .../dts/imx8mn-var-som-symphony-u-boot.dtsi   | 17 ++++---
 arch/arm/dts/imx8mn-venice-u-boot.dtsi        | 17 ++++---
 arch/arm/dts/imx8mp-u-boot.dtsi               | 21 +++++---
 arch/arm/dts/imx8mq-cm-u-boot.dtsi            | 21 +++++---
 arch/arm/dts/imx8mq-u-boot.dtsi               | 17 ++++---
 arch/arm/mach-imx/imx8m/Kconfig               |  1 +
 .../mach-imx/imx8m/imximage-8mm-lpddr4.cfg    | 10 +---
 configs/imx8mm-icore-mx8mm-ctouch2_defconfig  |  2 +-
 configs/imx8mm-icore-mx8mm-edimm2.2_defconfig |  2 +-
 drivers/ddr/imx/imx8m/helper.c                | 51 ++++++++++++++++---
 include/binman_sym.h                          |  2 +-
 tools/binman/binman.rst                       |  6 +++
 tools/binman/etype/section.py                 |  7 ++-
 tools/binman/test/u_boot_binman_syms.c        |  1 +
 tools/binman/test/u_boot_binman_syms_size.c   |  1 +
 21 files changed, 169 insertions(+), 98 deletions(-)

-- 
2.36.0


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

* [PATCH V5 1/9] arm: dts: imx8m: update binman ddr firmware node name
  2022-05-24  8:00 [PATCH V5 0/9] arm64: binman: use binman symbols for imx Peng Fan (OSS)
@ 2022-05-24  8:00 ` Peng Fan (OSS)
  2022-05-27 16:53   ` Alper Nebi Yasak
  2022-05-24  8:00 ` [PATCH V5 2/9] armv8: u-boot-spl.lds: mark __image_copy_start as symbol Peng Fan (OSS)
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 14+ messages in thread
From: Peng Fan (OSS) @ 2022-05-24  8:00 UTC (permalink / raw)
  To: sbabic, festevam, trini, NXP i.MX U-Boot Team,
	Ariel D'Alessandro, Michael Trimarchi, Tim Harvey
  Cc: u-boot, alpernebiyasak, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

We are migrating to use BINMAN SYMBOLS, the current name is not
a valid binman type, so update to unify them.

Also add `type = "blob-ext";` for generating a valid binman symbol

Tested-by: Tim Harvey <tharvey@gateworks.com> #imx8m[m,n,p]-venice
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/dts/imx8mm-u-boot.dtsi                   |  8 ++++----
 arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi        | 12 ++++++++----
 arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi |  4 ++--
 arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi          | 12 ++++++++----
 arch/arm/dts/imx8mn-evk-u-boot.dtsi               | 12 ++++++++----
 arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi  |  8 ++++----
 arch/arm/dts/imx8mn-venice-u-boot.dtsi            |  8 ++++----
 arch/arm/dts/imx8mp-u-boot.dtsi                   | 12 ++++++++----
 arch/arm/dts/imx8mq-cm-u-boot.dtsi                | 12 ++++++++----
 arch/arm/dts/imx8mq-u-boot.dtsi                   |  8 ++++----
 10 files changed, 58 insertions(+), 38 deletions(-)

diff --git a/arch/arm/dts/imx8mm-u-boot.dtsi b/arch/arm/dts/imx8mm-u-boot.dtsi
index 9f66cdb65a9..dc036894d82 100644
--- a/arch/arm/dts/imx8mm-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-u-boot.dtsi
@@ -39,25 +39,25 @@
 			filename = "u-boot-spl.bin";
 		};
 
-		1d-imem {
+		imem-1d {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		1d-dmem {
+		dmem-1d {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
 			size = <0x4000>;
 			type = "blob-ext";
 		};
 
-		2d-imem {
+		imem-2d {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		2d-dmem {
+		dmem-2d {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
 			size = <0x4000>;
 			type = "blob-ext";
diff --git a/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi b/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi
index eb1dd8debba..3c29f71ec6c 100644
--- a/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi
@@ -147,24 +147,28 @@
 			align-end = <4>;
 		};
 
-		blob_1: blob-ext@1 {
+		imem-1d {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
 			size = <0x8000>;
+			type = "blob-ext";
 		};
 
-		blob_2: blob-ext@2 {
+		dmem-1d {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
 			size = <0x4000>;
+			type = "blob-ext";
 		};
 
-		blob_3: blob-ext@3 {
+		imem-2d {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
 			size = <0x8000>;
+			type = "blob-ext";
 		};
 
-		blob_4: blob-ext@4 {
+		dmem-2d {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
 			size = <0x4000>;
+			type = "blob-ext";
 		};
 	};
 
diff --git a/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi b/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi
index 46a9d7fd78b..904f1d795a3 100644
--- a/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi
+++ b/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi
@@ -111,13 +111,13 @@
 			filename = "u-boot-spl.bin";
 		};
 
-		1d-imem {
+		imem-1d {
 			filename = "ddr3_imem_1d.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		1d_dmem {
+		dmem-1d {
 			filename = "ddr3_dmem_1d.bin";
 			size = <0x4000>;
 			type = "blob-ext";
diff --git a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
index 4d0ecb07d4f..3f6b67e22df 100644
--- a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
@@ -155,24 +155,28 @@
 			align-end = <4>;
 		};
 
-		blob_1: blob-ext@1 {
+		imem-1d {
 			filename = "ddr4_imem_1d_201810.bin";
 			size = <0x8000>;
+			type = "blob-ext";
 		};
 
-		blob_2: blob-ext@2 {
+		dmem-1d {
 			filename = "ddr4_dmem_1d_201810.bin";
 			size = <0x4000>;
+			type = "blob-ext";
 		};
 
-		blob_3: blob-ext@3 {
+		imem-2d {
 			filename = "ddr4_imem_2d_201810.bin";
 			size = <0x8000>;
+			type = "blob-ext";
 		};
 
-		blob_4: blob-ext@4 {
+		dmem-2d {
 			filename = "ddr4_dmem_2d_201810.bin";
 			size = <0x4000>;
+			type = "blob-ext";
 		};
 	};
 
diff --git a/arch/arm/dts/imx8mn-evk-u-boot.dtsi b/arch/arm/dts/imx8mn-evk-u-boot.dtsi
index 3db46d4cbcb..b73ce32221f 100644
--- a/arch/arm/dts/imx8mn-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-evk-u-boot.dtsi
@@ -36,24 +36,28 @@
 			align-end = <4>;
 		};
 
-		blob_1: blob-ext@1 {
+		imem-1d {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
 			size = <0x8000>;
+			type = "blob-ext";
 		};
 
-		blob_2: blob-ext@2 {
+		dmem-1d {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
 			size = <0x4000>;
+			type = "blob-ext";
 		};
 
-		blob_3: blob-ext@3 {
+		imem-2d {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
 			size = <0x8000>;
+			type = "blob-ext";
 		};
 
-		blob_4: blob-ext@4 {
+		dmem-2d {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
 			size = <0x4000>;
+			type = "blob-ext";
 		};
 	};
 
diff --git a/arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi b/arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi
index 6e37622cca7..c5fa37a3b8a 100644
--- a/arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi
@@ -130,25 +130,25 @@
 			filename = "u-boot-spl.bin";
 		};
 
-		1d-imem {
+		imem-1d {
 			filename = "ddr4_imem_1d.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		1d_dmem {
+		dmem-1d {
 			filename = "ddr4_dmem_1d.bin";
 			size = <0x4000>;
 			type = "blob-ext";
 		};
 
-		2d_imem {
+		imem-2d {
 			filename = "ddr4_imem_2d.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		2d_dmem {
+		dmem-2d {
 			filename = "ddr4_dmem_2d.bin";
 			size = <0x4000>;
 			type = "blob-ext";
diff --git a/arch/arm/dts/imx8mn-venice-u-boot.dtsi b/arch/arm/dts/imx8mn-venice-u-boot.dtsi
index 35819553879..1e8b0e2aeed 100644
--- a/arch/arm/dts/imx8mn-venice-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-venice-u-boot.dtsi
@@ -126,25 +126,25 @@
 			filename = "u-boot-spl.bin";
 		};
 
-		1d-imem {
+		imem-1d {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		1d_dmem {
+		dmem-1d {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
 			size = <0x4000>;
 			type = "blob-ext";
 		};
 
-		2d_imem {
+		imem-2d {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		2d_dmem {
+		dmem-2d {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
 			size = <0x4000>;
 			type = "blob-ext";
diff --git a/arch/arm/dts/imx8mp-u-boot.dtsi b/arch/arm/dts/imx8mp-u-boot.dtsi
index 20edd90cfad..aaf70d92dfb 100644
--- a/arch/arm/dts/imx8mp-u-boot.dtsi
+++ b/arch/arm/dts/imx8mp-u-boot.dtsi
@@ -61,24 +61,28 @@
 			align-end = <4>;
 		};
 
-		blob_1: blob-ext@1 {
+		imem-1d {
 			filename = "lpddr4_pmu_train_1d_imem_202006.bin";
 			size = <0x8000>;
+			type = "blob-ext";
 		};
 
-		blob_2: blob-ext@2 {
+		dmem-1d {
 			filename = "lpddr4_pmu_train_1d_dmem_202006.bin";
 			size = <0x4000>;
+			type = "blob-ext";
 		};
 
-		blob_3: blob-ext@3 {
+		imem-2d {
 			filename = "lpddr4_pmu_train_2d_imem_202006.bin";
 			size = <0x8000>;
+			type = "blob-ext";
 		};
 
-		blob_4: blob-ext@4 {
+		dmem-2d {
 			filename = "lpddr4_pmu_train_2d_dmem_202006.bin";
 			size = <0x4000>;
+			type = "blob-ext";
 		};
 	};
 
diff --git a/arch/arm/dts/imx8mq-cm-u-boot.dtsi b/arch/arm/dts/imx8mq-cm-u-boot.dtsi
index e2f4b0e740d..79a71c2a414 100644
--- a/arch/arm/dts/imx8mq-cm-u-boot.dtsi
+++ b/arch/arm/dts/imx8mq-cm-u-boot.dtsi
@@ -28,24 +28,28 @@
 			align-end = <4>;
 		};
 
-		blob_1: blob-ext@1 {
+		imem-1d {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
 			size = <0x8000>;
+			type = "blob-ext";
 		};
 
-		blob_2: blob-ext@2 {
+		dmem-1d {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
 			size = <0x4000>;
+			type = "blob-ext";
 		};
 
-		blob_3: blob-ext@3 {
+		imem-2d {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
 			size = <0x8000>;
+			type = "blob-ext";
 		};
 
-		blob_4: blob-ext@4 {
+		dmem-2d {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
 			size = <0x4000>;
+			type = "blob-ext";
 		};
 	};
 
diff --git a/arch/arm/dts/imx8mq-u-boot.dtsi b/arch/arm/dts/imx8mq-u-boot.dtsi
index 912a3d4a356..31c96f919c0 100644
--- a/arch/arm/dts/imx8mq-u-boot.dtsi
+++ b/arch/arm/dts/imx8mq-u-boot.dtsi
@@ -46,25 +46,25 @@
 			filename = "u-boot-spl.bin";
 		};
 
-		1d-imem {
+		imem-1d {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		1d-dmem {
+		dmem-1d {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
 			size = <0x4000>;
 			type = "blob-ext";
 		};
 
-		2d-imem {
+		imem-2d {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		2d-dmem {
+		dmem-2d {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
 			size = <0x4000>;
 			type = "blob-ext";
-- 
2.36.0


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

* [PATCH V5 2/9] armv8: u-boot-spl.lds: mark __image_copy_start as symbol
  2022-05-24  8:00 [PATCH V5 0/9] arm64: binman: use binman symbols for imx Peng Fan (OSS)
  2022-05-24  8:00 ` [PATCH V5 1/9] arm: dts: imx8m: update binman ddr firmware node name Peng Fan (OSS)
@ 2022-05-24  8:00 ` Peng Fan (OSS)
  2022-05-24  8:00 ` [PATCH V5 3/9] tools: binman: section: replace @ with - Peng Fan (OSS)
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Peng Fan (OSS) @ 2022-05-24  8:00 UTC (permalink / raw)
  To: sbabic, festevam, trini; +Cc: u-boot, alpernebiyasak, Peng Fan, Tim Harvey

From: Peng Fan <peng.fan@nxp.com>

In arch/arm/lib/sections.c there is below code:
char __image_copy_start[0] __section(".__image_copy_start");
But actually 'objdump -t spl/u-boot-spl' not able to find out
symbol '__image_copy_start' for binman update image-pos/size.

So update link file

Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Tim Harvey <tharvey@gateworks.com> #imx8m[m,n,p]-venice
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/cpu/armv8/u-boot-spl.lds | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv8/u-boot-spl.lds b/arch/arm/cpu/armv8/u-boot-spl.lds
index 730eb93dbc3..9b1e7d46287 100644
--- a/arch/arm/cpu/armv8/u-boot-spl.lds
+++ b/arch/arm/cpu/armv8/u-boot-spl.lds
@@ -23,7 +23,7 @@ SECTIONS
 {
 	.text : {
 		. = ALIGN(8);
-		*(.__image_copy_start)
+		__image_copy_start = .;
 		CPUDIR/start.o (.text*)
 		*(.text*)
 	} >.sram
-- 
2.36.0


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

* [PATCH V5 3/9] tools: binman: section: replace @ with -
  2022-05-24  8:00 [PATCH V5 0/9] arm64: binman: use binman symbols for imx Peng Fan (OSS)
  2022-05-24  8:00 ` [PATCH V5 1/9] arm: dts: imx8m: update binman ddr firmware node name Peng Fan (OSS)
  2022-05-24  8:00 ` [PATCH V5 2/9] armv8: u-boot-spl.lds: mark __image_copy_start as symbol Peng Fan (OSS)
@ 2022-05-24  8:00 ` Peng Fan (OSS)
  2022-05-27 16:53   ` Alper Nebi Yasak
  2022-05-24  8:00 ` [PATCH V5 4/9] binman: introduce no-u-boot-any property Peng Fan (OSS)
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 14+ messages in thread
From: Peng Fan (OSS) @ 2022-05-24  8:00 UTC (permalink / raw)
  To: sbabic, festevam, trini, Simon Glass, Alper Nebi Yasak
  Cc: u-boot, Peng Fan, Tim Harvey

From: Peng Fan <peng.fan@nxp.com>

In arch/arm/dts/imx8mp-u-boot.dtsi, there are blob-ext@1, blob-ext@2 and
etc which is for packing ddr phy firmware. However we could not declare
symbol name such as 'binman_sym_declare(ulong, blob_ext@1, image_pos)',
because '@' is not allowed, so we choose to declare the symbol
'binman_sym_declare(ulong, blob_ext_1, image_pos);' with '@' replaced with
'_'. It does not impact if there is no '@' in section name.

Tested-by: Tim Harvey <tharvey@gateworks.com> #imx8m[m,n,p]-venice
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 tools/binman/etype/section.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py
index bd67238b919..e3f362b442b 100644
--- a/tools/binman/etype/section.py
+++ b/tools/binman/etype/section.py
@@ -875,7 +875,7 @@ class Entry_section(Entry):
                 entries[entry.GetPath()] = entry
             for entry in to_add.values():
                 self._CollectEntries(entries, entries_by_name, entry)
-        entries_by_name[add_entry.name] = add_entry
+        entries_by_name[add_entry.name.replace('@', '-')] = add_entry
 
     def MissingArgs(self, entry, missing):
         """Report a missing argument, if enabled
-- 
2.36.0


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

* [PATCH V5 4/9] binman: introduce no-u-boot-any property
  2022-05-24  8:00 [PATCH V5 0/9] arm64: binman: use binman symbols for imx Peng Fan (OSS)
                   ` (2 preceding siblings ...)
  2022-05-24  8:00 ` [PATCH V5 3/9] tools: binman: section: replace @ with - Peng Fan (OSS)
@ 2022-05-24  8:00 ` Peng Fan (OSS)
  2022-05-27 16:54   ` Alper Nebi Yasak
  2022-05-24  8:00 ` [PATCH V5 5/9] arm: dts: imx8m: add " Peng Fan (OSS)
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 14+ messages in thread
From: Peng Fan (OSS) @ 2022-05-24  8:00 UTC (permalink / raw)
  To: sbabic, festevam, trini, Simon Glass, Alper Nebi Yasak; +Cc: u-boot, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

By default when BINMAN_SYMBOLS is enabled, common/spl/spl.c has a code
piece `binman_sym_declare(ulong, u_boot_any, image_pos);` which requires
u-boot* node in device tree binman node section. But some
platforms(i.MX8M) not need it. To avoid build break with BINMAN_SYMBOLS,
introduce a no-u-boot-any property.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 tools/binman/binman.rst       | 6 ++++++
 tools/binman/etype/section.py | 5 +++++
 2 files changed, 11 insertions(+)

diff --git a/tools/binman/binman.rst b/tools/binman/binman.rst
index 935839c433e..9dab83b45c8 100644
--- a/tools/binman/binman.rst
+++ b/tools/binman/binman.rst
@@ -502,6 +502,12 @@ no-expanded:
     `no-expanded` property disables this just for a single entry. Put the
     `no-expanded` boolean property in the node to select this behaviour.
 
+no-u-boot-any:
+    By default when BINMAN_SYMBOLS are enabled,
+    `binman_sym_declare(ulong, u_boot_any, image_pos);` requires a u-boot node
+    in binman section. Some platforms not need it with the help of this flag
+    set.
+
 The attributes supported for images and sections are described below. Several
 are similar to those for entries.
 
diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py
index e3f362b442b..a09c539a12b 100644
--- a/tools/binman/etype/section.py
+++ b/tools/binman/etype/section.py
@@ -164,6 +164,7 @@ class Entry_section(Entry):
         self._skip_at_start = None
         self._end_4gb = False
         self._ignore_missing = False
+        self._no_uboot_any = False
 
     def ReadNode(self):
         """Read properties from the section node"""
@@ -172,6 +173,7 @@ class Entry_section(Entry):
         self._sort = fdt_util.GetBool(self._node, 'sort-by-offset')
         self._end_4gb = fdt_util.GetBool(self._node, 'end-at-4gb')
         self._skip_at_start = fdt_util.GetInt(self._node, 'skip-at-start')
+        self._no_uboot_any = fdt_util.GetBool(self._node, 'no-u-boot-any')
         if self._end_4gb:
             if not self.size:
                 self.Raise("Section size must be provided when using end-at-4gb")
@@ -565,9 +567,12 @@ class Entry_section(Entry):
                         rest = name[len(root):]
                         if rest in ['', '-img', '-nodtb']:
                             entry = entries[name]
+
         if not entry:
             err = ("%s: Entry '%s' not found in list (%s)" %
                    (msg, entry_name, ','.join(entries.keys())))
+            if entry_name == 'u-boot-any' and self._no_uboot_any:
+                return None
             if optional:
                 print('Warning: %s' % err, file=sys.stderr)
                 return None
-- 
2.36.0


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

* [PATCH V5 5/9] arm: dts: imx8m: add no-u-boot-any property
  2022-05-24  8:00 [PATCH V5 0/9] arm64: binman: use binman symbols for imx Peng Fan (OSS)
                   ` (3 preceding siblings ...)
  2022-05-24  8:00 ` [PATCH V5 4/9] binman: introduce no-u-boot-any property Peng Fan (OSS)
@ 2022-05-24  8:00 ` Peng Fan (OSS)
  2022-05-24  8:00 ` [PATCH V5 6/9] ddr: imx8m: helper: load ddr firmware according to binman symbols Peng Fan (OSS)
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Peng Fan (OSS) @ 2022-05-24  8:00 UTC (permalink / raw)
  To: sbabic, festevam, trini, NXP i.MX U-Boot Team,
	Ariel D'Alessandro, Michael Trimarchi, Tim Harvey
  Cc: u-boot, alpernebiyasak, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Preparing to support BINMAN_SYMBOLS, i.MX8M no need u-boot-any in spl
stage, so add no-u-boot-any property to avoid binman report error.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/dts/imx8mm-u-boot.dtsi                   | 1 +
 arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi        | 1 +
 arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi | 1 +
 arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi          | 1 +
 arch/arm/dts/imx8mn-evk-u-boot.dtsi               | 1 +
 arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi  | 1 +
 arch/arm/dts/imx8mn-venice-u-boot.dtsi            | 1 +
 arch/arm/dts/imx8mp-u-boot.dtsi                   | 1 +
 arch/arm/dts/imx8mq-cm-u-boot.dtsi                | 1 +
 arch/arm/dts/imx8mq-u-boot.dtsi                   | 1 +
 10 files changed, 10 insertions(+)

diff --git a/arch/arm/dts/imx8mm-u-boot.dtsi b/arch/arm/dts/imx8mm-u-boot.dtsi
index dc036894d82..769b7963db1 100644
--- a/arch/arm/dts/imx8mm-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-u-boot.dtsi
@@ -33,6 +33,7 @@
 		align-size = <4>;
 		filename = "u-boot-spl-ddr.bin";
 		pad-byte = <0xff>;
+		no-u-boot-any;
 
 		u-boot-spl {
 			align-end = <4>;
diff --git a/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi b/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi
index 3c29f71ec6c..024d57712b8 100644
--- a/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi
@@ -142,6 +142,7 @@
 		pad-byte = <0xff>;
 		align-size = <4>;
 		align = <4>;
+		no-u-boot-any;
 
 		u-boot-spl {
 			align-end = <4>;
diff --git a/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi b/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi
index 904f1d795a3..8f95f0efe65 100644
--- a/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi
+++ b/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi
@@ -105,6 +105,7 @@
 		align-size = <4>;
 		filename = "u-boot-spl-ddr.bin";
 		pad-byte = <0xff>;
+		no-u-boot-any;
 
 		u-boot-spl {
 			align-end = <4>;
diff --git a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
index 3f6b67e22df..ef1f60bff8d 100644
--- a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
@@ -150,6 +150,7 @@
 		pad-byte = <0xff>;
 		align-size = <4>;
 		align = <4>;
+		no-u-boot-any;
 
 		u-boot-spl {
 			align-end = <4>;
diff --git a/arch/arm/dts/imx8mn-evk-u-boot.dtsi b/arch/arm/dts/imx8mn-evk-u-boot.dtsi
index b73ce32221f..bd035f2e780 100644
--- a/arch/arm/dts/imx8mn-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-evk-u-boot.dtsi
@@ -31,6 +31,7 @@
 		pad-byte = <0xff>;
 		align-size = <4>;
 		align = <4>;
+		no-u-boot-any;
 
 		u-boot-spl {
 			align-end = <4>;
diff --git a/arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi b/arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi
index c5fa37a3b8a..484b55d4668 100644
--- a/arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi
@@ -124,6 +124,7 @@
 		align-size = <4>;
 		filename = "u-boot-spl-ddr.bin";
 		pad-byte = <0xff>;
+		no-u-boot-any;
 
 		u-boot-spl {
 			align-end = <4>;
diff --git a/arch/arm/dts/imx8mn-venice-u-boot.dtsi b/arch/arm/dts/imx8mn-venice-u-boot.dtsi
index 1e8b0e2aeed..62ca7cae0ec 100644
--- a/arch/arm/dts/imx8mn-venice-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-venice-u-boot.dtsi
@@ -120,6 +120,7 @@
 		align-size = <4>;
 		filename = "u-boot-spl-ddr.bin";
 		pad-byte = <0xff>;
+		no-u-boot-any;
 
 		u-boot-spl {
 			align-end = <4>;
diff --git a/arch/arm/dts/imx8mp-u-boot.dtsi b/arch/arm/dts/imx8mp-u-boot.dtsi
index aaf70d92dfb..2c66e30708f 100644
--- a/arch/arm/dts/imx8mp-u-boot.dtsi
+++ b/arch/arm/dts/imx8mp-u-boot.dtsi
@@ -56,6 +56,7 @@
 		pad-byte = <0xff>;
 		align-size = <4>;
 		align = <4>;
+		no-u-boot-any;
 
 		u-boot-spl {
 			align-end = <4>;
diff --git a/arch/arm/dts/imx8mq-cm-u-boot.dtsi b/arch/arm/dts/imx8mq-cm-u-boot.dtsi
index 79a71c2a414..afa0d07296d 100644
--- a/arch/arm/dts/imx8mq-cm-u-boot.dtsi
+++ b/arch/arm/dts/imx8mq-cm-u-boot.dtsi
@@ -23,6 +23,7 @@
 		pad-byte = <0xff>;
 		align-size = <4>;
 		align = <4>;
+		no-u-boot-any;
 
 		u-boot-spl {
 			align-end = <4>;
diff --git a/arch/arm/dts/imx8mq-u-boot.dtsi b/arch/arm/dts/imx8mq-u-boot.dtsi
index 31c96f919c0..90014710ea5 100644
--- a/arch/arm/dts/imx8mq-u-boot.dtsi
+++ b/arch/arm/dts/imx8mq-u-boot.dtsi
@@ -40,6 +40,7 @@
 		align-size = <4>;
 		filename = "u-boot-spl-ddr.bin";
 		pad-byte = <0xff>;
+		no-u-boot-any;
 
 		u-boot-spl {
 			align-end = <4>;
-- 
2.36.0


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

* [PATCH V5 6/9] ddr: imx8m: helper: load ddr firmware according to binman symbols
  2022-05-24  8:00 [PATCH V5 0/9] arm64: binman: use binman symbols for imx Peng Fan (OSS)
                   ` (4 preceding siblings ...)
  2022-05-24  8:00 ` [PATCH V5 5/9] arm: dts: imx8m: add " Peng Fan (OSS)
@ 2022-05-24  8:00 ` Peng Fan (OSS)
  2022-05-24  8:00 ` [PATCH V5 7/9] arm: dts: imx8m: shrink ddr firmware size to actual file size Peng Fan (OSS)
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Peng Fan (OSS) @ 2022-05-24  8:00 UTC (permalink / raw)
  To: sbabic, festevam, trini; +Cc: u-boot, alpernebiyasak, Peng Fan, Tim Harvey

From: Peng Fan <peng.fan@nxp.com>

By reading binman symbols, we no need hard coded IMEM_LEN/DMEM_LEN after
we update the binman dtsi to drop 0x8000/0x4000 length for the firmware.

And that could save binary size for many KBs.

Tested-by: Tim Harvey <tharvey@gateworks.com> #imx8m[m,n,p]-venice
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/ddr/imx/imx8m/helper.c | 51 ++++++++++++++++++++++++++++------
 1 file changed, 43 insertions(+), 8 deletions(-)

diff --git a/drivers/ddr/imx/imx8m/helper.c b/drivers/ddr/imx/imx8m/helper.c
index f23904bf712..5d7f6110639 100644
--- a/drivers/ddr/imx/imx8m/helper.c
+++ b/drivers/ddr/imx/imx8m/helper.c
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <binman_sym.h>
 #include <log.h>
 #include <spl.h>
 #include <asm/global_data.h>
@@ -25,15 +26,30 @@ DECLARE_GLOBAL_DATA_PTR;
 #define DMEM_OFFSET_ADDR 0x00054000
 #define DDR_TRAIN_CODE_BASE_ADDR IP2APB_DDRPHY_IPS_BASE_ADDR(0)
 
+binman_sym_declare(ulong, imem_1d, image_pos);
+binman_sym_declare(ulong, imem_1d, size);
+
+binman_sym_declare(ulong, dmem_1d, image_pos);
+binman_sym_declare(ulong, dmem_1d, size);
+
+#if !IS_ENABLED(CONFIG_IMX8M_DDR3L)
+binman_sym_declare(ulong, imem_2d, image_pos);
+binman_sym_declare(ulong, imem_2d, size);
+
+binman_sym_declare(ulong, dmem_2d, image_pos);
+binman_sym_declare(ulong, dmem_2d, size);
+#endif
+
 /* We need PHY iMEM PHY is 32KB padded */
 void ddr_load_train_firmware(enum fw_type type)
 {
 	u32 tmp32, i;
 	u32 error = 0;
 	unsigned long pr_to32, pr_from32;
-	unsigned long fw_offset = type ? IMEM_2D_OFFSET : 0;
-	unsigned long imem_start = (unsigned long)&_end + fw_offset;
-	unsigned long dmem_start;
+	uint32_t fw_offset = type ? IMEM_2D_OFFSET : 0;
+	uint32_t imem_start = (unsigned long)&_end + fw_offset;
+	uint32_t dmem_start;
+	uint32_t imem_len = IMEM_LEN, dmem_len = DMEM_LEN;
 
 #ifdef CONFIG_SPL_OF_CONTROL
 	if (gd->fdt_blob && !fdt_check_header(gd->fdt_blob)) {
@@ -43,11 +59,30 @@ void ddr_load_train_firmware(enum fw_type type)
 	}
 #endif
 
-	dmem_start = imem_start + IMEM_LEN;
+	dmem_start = imem_start + imem_len;
+
+	if (CONFIG_IS_ENABLED(BINMAN_SYMBOLS)) {
+		switch (type) {
+		case FW_1D_IMAGE:
+			imem_start = binman_sym(ulong, imem_1d, image_pos);
+			imem_len = binman_sym(ulong, imem_1d, size);
+			dmem_start = binman_sym(ulong, dmem_1d, image_pos);
+			dmem_len = binman_sym(ulong, dmem_1d, size);
+			break;
+		case FW_2D_IMAGE:
+#if !IS_ENABLED(CONFIG_IMX8M_DDR3L)
+			imem_start = binman_sym(ulong, imem_2d, image_pos);
+			imem_len = binman_sym(ulong, imem_2d, size);
+			dmem_start = binman_sym(ulong, dmem_2d, image_pos);
+			dmem_len = binman_sym(ulong, dmem_2d, size);
+#endif
+			break;
+		}
+	}
 
 	pr_from32 = imem_start;
 	pr_to32 = DDR_TRAIN_CODE_BASE_ADDR + 4 * IMEM_OFFSET_ADDR;
-	for (i = 0x0; i < IMEM_LEN; ) {
+	for (i = 0x0; i < imem_len; ) {
 		tmp32 = readl(pr_from32);
 		writew(tmp32 & 0x0000ffff, pr_to32);
 		pr_to32 += 4;
@@ -59,7 +94,7 @@ void ddr_load_train_firmware(enum fw_type type)
 
 	pr_from32 = dmem_start;
 	pr_to32 = DDR_TRAIN_CODE_BASE_ADDR + 4 * DMEM_OFFSET_ADDR;
-	for (i = 0x0; i < DMEM_LEN; ) {
+	for (i = 0x0; i < dmem_len; ) {
 		tmp32 = readl(pr_from32);
 		writew(tmp32 & 0x0000ffff, pr_to32);
 		pr_to32 += 4;
@@ -72,7 +107,7 @@ void ddr_load_train_firmware(enum fw_type type)
 	debug("check ddr_pmu_train_imem code\n");
 	pr_from32 = imem_start;
 	pr_to32 = DDR_TRAIN_CODE_BASE_ADDR + 4 * IMEM_OFFSET_ADDR;
-	for (i = 0x0; i < IMEM_LEN; ) {
+	for (i = 0x0; i < imem_len; ) {
 		tmp32 = (readw(pr_to32) & 0x0000ffff);
 		pr_to32 += 4;
 		tmp32 += ((readw(pr_to32) & 0x0000ffff) << 16);
@@ -93,7 +128,7 @@ void ddr_load_train_firmware(enum fw_type type)
 	debug("check ddr4_pmu_train_dmem code\n");
 	pr_from32 = dmem_start;
 	pr_to32 = DDR_TRAIN_CODE_BASE_ADDR + 4 * DMEM_OFFSET_ADDR;
-	for (i = 0x0; i < DMEM_LEN;) {
+	for (i = 0x0; i < dmem_len;) {
 		tmp32 = (readw(pr_to32) & 0x0000ffff);
 		pr_to32 += 4;
 		tmp32 += ((readw(pr_to32) & 0x0000ffff) << 16);
-- 
2.36.0


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

* [PATCH V5 7/9] arm: dts: imx8m: shrink ddr firmware size to actual file size
  2022-05-24  8:00 [PATCH V5 0/9] arm64: binman: use binman symbols for imx Peng Fan (OSS)
                   ` (5 preceding siblings ...)
  2022-05-24  8:00 ` [PATCH V5 6/9] ddr: imx8m: helper: load ddr firmware according to binman symbols Peng Fan (OSS)
@ 2022-05-24  8:00 ` Peng Fan (OSS)
  2022-05-24  8:00 ` [PATCH V5 8/9] binman_sym: guard with CONFIG_SPL_BINMAN_SYMBOLS Peng Fan (OSS)
  2022-05-24  8:00 ` [PATCH V5 9/9] imx: imx8mm-icore: migrate to use BINMAN Peng Fan (OSS)
  8 siblings, 0 replies; 14+ messages in thread
From: Peng Fan (OSS) @ 2022-05-24  8:00 UTC (permalink / raw)
  To: sbabic, festevam, trini, NXP i.MX U-Boot Team,
	Ariel D'Alessandro, Michael Trimarchi, Tim Harvey
  Cc: u-boot, alpernebiyasak, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

After we switch to use BINMAN_SYMBOLS, there is no need to pad
the file size to 0x8000 and 0x4000. After we use BINMAN_SYMBOLS,
the u-boot-spl-ddr.bin shrink about 36KB with i.MX8MP-EVK.

Tested-by: Tim Harvey <tharvey@gateworks.com> #imx8m[m,n,p]-venice
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/dts/imx8mm-u-boot.dtsi                   | 8 ++++----
 arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi        | 8 ++++----
 arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi | 4 ++--
 arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi          | 8 ++++----
 arch/arm/dts/imx8mn-evk-u-boot.dtsi               | 8 ++++----
 arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi  | 8 ++++----
 arch/arm/dts/imx8mn-venice-u-boot.dtsi            | 8 ++++----
 arch/arm/dts/imx8mp-u-boot.dtsi                   | 8 ++++----
 arch/arm/dts/imx8mq-cm-u-boot.dtsi                | 8 ++++----
 arch/arm/dts/imx8mq-u-boot.dtsi                   | 8 ++++----
 10 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/arch/arm/dts/imx8mm-u-boot.dtsi b/arch/arm/dts/imx8mm-u-boot.dtsi
index 769b7963db1..7600bd3d30a 100644
--- a/arch/arm/dts/imx8mm-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-u-boot.dtsi
@@ -42,25 +42,25 @@
 
 		imem-1d {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		dmem-1d {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		imem-2d {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		dmem-2d {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 	};
diff --git a/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi b/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi
index 024d57712b8..090a17c93a7 100644
--- a/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi
@@ -150,26 +150,26 @@
 
 		imem-1d {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
-			size = <0x8000>;
 			type = "blob-ext";
+			align-end = <4>;
 		};
 
 		dmem-1d {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
-			size = <0x4000>;
 			type = "blob-ext";
+			align-end = <4>;
 		};
 
 		imem-2d {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
-			size = <0x8000>;
 			type = "blob-ext";
+			align-end = <4>;
 		};
 
 		dmem-2d {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
-			size = <0x4000>;
 			type = "blob-ext";
+			align-end = <4>;
 		};
 	};
 
diff --git a/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi b/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi
index 8f95f0efe65..6a79e2743f8 100644
--- a/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi
+++ b/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi
@@ -114,13 +114,13 @@
 
 		imem-1d {
 			filename = "ddr3_imem_1d.bin";
-			size = <0x8000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		dmem-1d {
 			filename = "ddr3_dmem_1d.bin";
-			size = <0x4000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 	};
diff --git a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
index ef1f60bff8d..7660ab8d58b 100644
--- a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
@@ -158,26 +158,26 @@
 
 		imem-1d {
 			filename = "ddr4_imem_1d_201810.bin";
-			size = <0x8000>;
 			type = "blob-ext";
+			align-end = <4>;
 		};
 
 		dmem-1d {
 			filename = "ddr4_dmem_1d_201810.bin";
-			size = <0x4000>;
 			type = "blob-ext";
+			align-end = <4>;
 		};
 
 		imem-2d {
 			filename = "ddr4_imem_2d_201810.bin";
-			size = <0x8000>;
 			type = "blob-ext";
+			align-end = <4>;
 		};
 
 		dmem-2d {
 			filename = "ddr4_dmem_2d_201810.bin";
-			size = <0x4000>;
 			type = "blob-ext";
+			align-end = <4>;
 		};
 	};
 
diff --git a/arch/arm/dts/imx8mn-evk-u-boot.dtsi b/arch/arm/dts/imx8mn-evk-u-boot.dtsi
index bd035f2e780..4ba563922ed 100644
--- a/arch/arm/dts/imx8mn-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-evk-u-boot.dtsi
@@ -39,26 +39,26 @@
 
 		imem-1d {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
-			size = <0x8000>;
 			type = "blob-ext";
+			align-end = <4>;
 		};
 
 		dmem-1d {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
-			size = <0x4000>;
 			type = "blob-ext";
+			align-end = <4>;
 		};
 
 		imem-2d {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
-			size = <0x8000>;
 			type = "blob-ext";
+			align-end = <4>;
 		};
 
 		dmem-2d {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
-			size = <0x4000>;
 			type = "blob-ext";
+			align-end = <4>;
 		};
 	};
 
diff --git a/arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi b/arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi
index 484b55d4668..f701cd18d70 100644
--- a/arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi
@@ -133,25 +133,25 @@
 
 		imem-1d {
 			filename = "ddr4_imem_1d.bin";
-			size = <0x8000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		dmem-1d {
 			filename = "ddr4_dmem_1d.bin";
-			size = <0x4000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		imem-2d {
 			filename = "ddr4_imem_2d.bin";
-			size = <0x8000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		dmem-2d {
 			filename = "ddr4_dmem_2d.bin";
-			size = <0x4000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 	};
diff --git a/arch/arm/dts/imx8mn-venice-u-boot.dtsi b/arch/arm/dts/imx8mn-venice-u-boot.dtsi
index 62ca7cae0ec..5ef9082cef3 100644
--- a/arch/arm/dts/imx8mn-venice-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-venice-u-boot.dtsi
@@ -129,25 +129,25 @@
 
 		imem-1d {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		dmem-1d {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		imem-2d {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		dmem-2d {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 	};
diff --git a/arch/arm/dts/imx8mp-u-boot.dtsi b/arch/arm/dts/imx8mp-u-boot.dtsi
index 2c66e30708f..9ad5d439d00 100644
--- a/arch/arm/dts/imx8mp-u-boot.dtsi
+++ b/arch/arm/dts/imx8mp-u-boot.dtsi
@@ -64,26 +64,26 @@
 
 		imem-1d {
 			filename = "lpddr4_pmu_train_1d_imem_202006.bin";
-			size = <0x8000>;
 			type = "blob-ext";
+			align-end = <4>;
 		};
 
 		dmem-1d {
 			filename = "lpddr4_pmu_train_1d_dmem_202006.bin";
-			size = <0x4000>;
 			type = "blob-ext";
+			align-end = <4>;
 		};
 
 		imem-2d {
 			filename = "lpddr4_pmu_train_2d_imem_202006.bin";
-			size = <0x8000>;
 			type = "blob-ext";
+			align-end = <4>;
 		};
 
 		dmem-2d {
 			filename = "lpddr4_pmu_train_2d_dmem_202006.bin";
-			size = <0x4000>;
 			type = "blob-ext";
+			align-end = <4>;
 		};
 	};
 
diff --git a/arch/arm/dts/imx8mq-cm-u-boot.dtsi b/arch/arm/dts/imx8mq-cm-u-boot.dtsi
index afa0d07296d..51db64bdd59 100644
--- a/arch/arm/dts/imx8mq-cm-u-boot.dtsi
+++ b/arch/arm/dts/imx8mq-cm-u-boot.dtsi
@@ -31,26 +31,26 @@
 
 		imem-1d {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
-			size = <0x8000>;
 			type = "blob-ext";
+			align-end = <4>;
 		};
 
 		dmem-1d {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
-			size = <0x4000>;
 			type = "blob-ext";
+			align-end = <4>;
 		};
 
 		imem-2d {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
-			size = <0x8000>;
 			type = "blob-ext";
+			align-end = <4>;
 		};
 
 		dmem-2d {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
-			size = <0x4000>;
 			type = "blob-ext";
+			align-end = <4>;
 		};
 	};
 
diff --git a/arch/arm/dts/imx8mq-u-boot.dtsi b/arch/arm/dts/imx8mq-u-boot.dtsi
index 90014710ea5..d0e1c521c33 100644
--- a/arch/arm/dts/imx8mq-u-boot.dtsi
+++ b/arch/arm/dts/imx8mq-u-boot.dtsi
@@ -49,25 +49,25 @@
 
 		imem-1d {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		dmem-1d {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		imem-2d {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		dmem-2d {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 	};
-- 
2.36.0


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

* [PATCH V5 8/9] binman_sym: guard with CONFIG_SPL_BINMAN_SYMBOLS
  2022-05-24  8:00 [PATCH V5 0/9] arm64: binman: use binman symbols for imx Peng Fan (OSS)
                   ` (6 preceding siblings ...)
  2022-05-24  8:00 ` [PATCH V5 7/9] arm: dts: imx8m: shrink ddr firmware size to actual file size Peng Fan (OSS)
@ 2022-05-24  8:00 ` Peng Fan (OSS)
  2022-05-27 16:54   ` Alper Nebi Yasak
  2022-05-24  8:00 ` [PATCH V5 9/9] imx: imx8mm-icore: migrate to use BINMAN Peng Fan (OSS)
  8 siblings, 1 reply; 14+ messages in thread
From: Peng Fan (OSS) @ 2022-05-24  8:00 UTC (permalink / raw)
  To: sbabic, festevam, trini, Simon Glass, Alper Nebi Yasak
  Cc: u-boot, Peng Fan, Tim Harvey

From: Peng Fan <peng.fan@nxp.com>

There is case that CONFIG_BINMAN is defined, but
CONFIG_SPL_BINMAN_SYMBOLS is not defined. In that case, there will be
build failure. So use CONFIG_SPL_BINMAN_SYMBOLS to guard the macros, and
define CONFIG_SPL_BINMAN_SYMBOLS in binman syms test.

Tested-by: Tim Harvey <tharvey@gateworks.com> #imx8m[m,n,p]-venice
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 include/binman_sym.h                        | 2 +-
 tools/binman/test/u_boot_binman_syms.c      | 1 +
 tools/binman/test/u_boot_binman_syms_size.c | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/binman_sym.h b/include/binman_sym.h
index 72e6765fe52..548d8f5654c 100644
--- a/include/binman_sym.h
+++ b/include/binman_sym.h
@@ -13,7 +13,7 @@
 
 #define BINMAN_SYM_MISSING	(-1UL)
 
-#ifdef CONFIG_BINMAN
+#ifdef CONFIG_SPL_BINMAN_SYMBOLS
 
 /**
  * binman_symname() - Internal function to get a binman symbol name
diff --git a/tools/binman/test/u_boot_binman_syms.c b/tools/binman/test/u_boot_binman_syms.c
index 37fc339ce84..f4a4d1f6846 100644
--- a/tools/binman/test/u_boot_binman_syms.c
+++ b/tools/binman/test/u_boot_binman_syms.c
@@ -6,6 +6,7 @@
  */
 
 #define CONFIG_BINMAN
+#define CONFIG_SPL_BINMAN_SYMBOLS
 #include <binman_sym.h>
 
 binman_sym_declare(unsigned long, u_boot_spl_any, offset);
diff --git a/tools/binman/test/u_boot_binman_syms_size.c b/tools/binman/test/u_boot_binman_syms_size.c
index 7224bc1863c..3a01d8ca4be 100644
--- a/tools/binman/test/u_boot_binman_syms_size.c
+++ b/tools/binman/test/u_boot_binman_syms_size.c
@@ -6,6 +6,7 @@
  */
 
 #define CONFIG_BINMAN
+#define CONFIG_SPL_BINMAN_SYMBOLS
 #include <binman_sym.h>
 
 binman_sym_declare(char, u_boot_spl, pos);
-- 
2.36.0


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

* [PATCH V5 9/9] imx: imx8mm-icore: migrate to use BINMAN
  2022-05-24  8:00 [PATCH V5 0/9] arm64: binman: use binman symbols for imx Peng Fan (OSS)
                   ` (7 preceding siblings ...)
  2022-05-24  8:00 ` [PATCH V5 8/9] binman_sym: guard with CONFIG_SPL_BINMAN_SYMBOLS Peng Fan (OSS)
@ 2022-05-24  8:00 ` Peng Fan (OSS)
  8 siblings, 0 replies; 14+ messages in thread
From: Peng Fan (OSS) @ 2022-05-24  8:00 UTC (permalink / raw)
  To: sbabic, festevam, trini, NXP i.MX U-Boot Team, Jagan Teki, Matteo Lisi
  Cc: u-boot, alpernebiyasak, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Use BINMAN instead of imx specific packing method.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/mach-imx/imx8m/Kconfig                 |  1 +
 arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg | 10 +---------
 configs/imx8mm-icore-mx8mm-ctouch2_defconfig    |  2 +-
 configs/imx8mm-icore-mx8mm-edimm2.2_defconfig   |  2 +-
 4 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/arch/arm/mach-imx/imx8m/Kconfig b/arch/arm/mach-imx/imx8m/Kconfig
index 61397bf88d1..ba26975544c 100644
--- a/arch/arm/mach-imx/imx8m/Kconfig
+++ b/arch/arm/mach-imx/imx8m/Kconfig
@@ -68,6 +68,7 @@ config TARGET_IMX8MM_EVK
 
 config TARGET_IMX8MM_ICORE_MX8MM
 	bool "Engicam i.Core MX8M Mini SOM"
+	select BINMAN
 	select IMX8MM
 	select SUPPORT_SPL
 	select IMX8M_LPDDR4
diff --git a/arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg b/arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg
index e06d53ef417..5dcb8ae72f0 100644
--- a/arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg
+++ b/arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg
@@ -3,13 +3,5 @@
  * Copyright 2019 NXP
  */
 
-
-FIT
 BOOT_FROM	sd
-LOADER		spl/u-boot-spl-ddr.bin	0x7E1000
-SECOND_LOADER	u-boot.itb		0x40200000 0x60000
-
-DDR_FW lpddr4_pmu_train_1d_imem.bin
-DDR_FW lpddr4_pmu_train_1d_dmem.bin
-DDR_FW lpddr4_pmu_train_2d_imem.bin
-DDR_FW lpddr4_pmu_train_2d_dmem.bin
+LOADER		u-boot-spl-ddr.bin	0x7E1000
diff --git a/configs/imx8mm-icore-mx8mm-ctouch2_defconfig b/configs/imx8mm-icore-mx8mm-ctouch2_defconfig
index d95a74a7237..dcb12e5d026 100644
--- a/configs/imx8mm-icore-mx8mm-ctouch2_defconfig
+++ b/configs/imx8mm-icore-mx8mm-ctouch2_defconfig
@@ -20,7 +20,7 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh"
+# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DEFAULT_FDT_FILE="imx8mm-icore-mx8mm-ctouch2.dtb"
 CONFIG_SPL_BOARD_INIT=y
diff --git a/configs/imx8mm-icore-mx8mm-edimm2.2_defconfig b/configs/imx8mm-icore-mx8mm-edimm2.2_defconfig
index 43c697a39d8..22acf7317b4 100644
--- a/configs/imx8mm-icore-mx8mm-edimm2.2_defconfig
+++ b/configs/imx8mm-icore-mx8mm-edimm2.2_defconfig
@@ -20,7 +20,7 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh"
+# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DEFAULT_FDT_FILE="imx8mm-icore-mx8mm-edimm2.2.dtb"
 CONFIG_SPL_BOARD_INIT=y
-- 
2.36.0


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

* Re: [PATCH V5 1/9] arm: dts: imx8m: update binman ddr firmware node name
  2022-05-24  8:00 ` [PATCH V5 1/9] arm: dts: imx8m: update binman ddr firmware node name Peng Fan (OSS)
@ 2022-05-27 16:53   ` Alper Nebi Yasak
  0 siblings, 0 replies; 14+ messages in thread
From: Alper Nebi Yasak @ 2022-05-27 16:53 UTC (permalink / raw)
  To: Peng Fan (OSS)
  Cc: u-boot, Peng Fan, sbabic, festevam, trini, NXP i.MX U-Boot Team,
	Ariel D'Alessandro, Michael Trimarchi, Tim Harvey

On 24/05/2022 11:00, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> We are migrating to use BINMAN SYMBOLS, the current name is not
> a valid binman type, so update to unify them.

'not a valid binman type, so' here is misleading. Names do not need to
be binman types if you have the 'type' property. 'the current names are
inconsistent across different boards, so' would be better.

> Also add `type = "blob-ext";` for generating a valid binman symbol

The 'type' doesn't matter for symbol generation. '... since the new
names are not valid binman types' is the real reason.

> Tested-by: Tim Harvey <tharvey@gateworks.com> #imx8m[m,n,p]-venice
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  arch/arm/dts/imx8mm-u-boot.dtsi                   |  8 ++++----
>  arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi        | 12 ++++++++----
>  arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi |  4 ++--
>  arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi          | 12 ++++++++----
>  arch/arm/dts/imx8mn-evk-u-boot.dtsi               | 12 ++++++++----
>  arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi  |  8 ++++----
>  arch/arm/dts/imx8mn-venice-u-boot.dtsi            |  8 ++++----
>  arch/arm/dts/imx8mp-u-boot.dtsi                   | 12 ++++++++----
>  arch/arm/dts/imx8mq-cm-u-boot.dtsi                | 12 ++++++++----
>  arch/arm/dts/imx8mq-u-boot.dtsi                   |  8 ++++----
>  10 files changed, 58 insertions(+), 38 deletions(-)
> 
> diff --git a/arch/arm/dts/imx8mm-u-boot.dtsi b/arch/arm/dts/imx8mm-u-boot.dtsi
> index 9f66cdb65a9..dc036894d82 100644
> --- a/arch/arm/dts/imx8mm-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mm-u-boot.dtsi
> @@ -39,25 +39,25 @@
>  			filename = "u-boot-spl.bin";
>  		};
>  
> -		1d-imem {
> +		imem-1d {

I suggested 'ddr-1d-imem-fw' in the diff I sent. Saying again in case
you didn't notice. But these names are fine too.

>  			filename = "lpddr4_pmu_train_1d_imem.bin";
>  			size = <0x8000>;
>  			type = "blob-ext";
>  		};
>  
> [...]

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

* Re: [PATCH V5 3/9] tools: binman: section: replace @ with -
  2022-05-24  8:00 ` [PATCH V5 3/9] tools: binman: section: replace @ with - Peng Fan (OSS)
@ 2022-05-27 16:53   ` Alper Nebi Yasak
  0 siblings, 0 replies; 14+ messages in thread
From: Alper Nebi Yasak @ 2022-05-27 16:53 UTC (permalink / raw)
  To: Peng Fan (OSS)
  Cc: u-boot, Peng Fan, Tim Harvey, sbabic, festevam, trini, Simon Glass

On 24/05/2022 11:00, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> In arch/arm/dts/imx8mp-u-boot.dtsi, there are blob-ext@1, blob-ext@2 and
> etc which is for packing ddr phy firmware. However we could not declare
> symbol name such as 'binman_sym_declare(ulong, blob_ext@1, image_pos)',
> because '@' is not allowed, so we choose to declare the symbol
> 'binman_sym_declare(ulong, blob_ext_1, image_pos);' with '@' replaced with
> '_'. It does not impact if there is no '@' in section name.

You don't need this patch after the entry name changes.

Either drop this patch, or handle this in the LookupSymbol() function.

> Tested-by: Tim Harvey <tharvey@gateworks.com> #imx8m[m,n,p]-venice
> Reviewed-by: Tom Rini <trini@konsulko.com>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  tools/binman/etype/section.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py
> index bd67238b919..e3f362b442b 100644
> --- a/tools/binman/etype/section.py
> +++ b/tools/binman/etype/section.py
> @@ -875,7 +875,7 @@ class Entry_section(Entry):
>                  entries[entry.GetPath()] = entry
>              for entry in to_add.values():
>                  self._CollectEntries(entries, entries_by_name, entry)
> -        entries_by_name[add_entry.name] = add_entry
> +        entries_by_name[add_entry.name.replace('@', '-')] = add_entry
>  
>      def MissingArgs(self, entry, missing):
>          """Report a missing argument, if enabled

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

* Re: [PATCH V5 4/9] binman: introduce no-u-boot-any property
  2022-05-24  8:00 ` [PATCH V5 4/9] binman: introduce no-u-boot-any property Peng Fan (OSS)
@ 2022-05-27 16:54   ` Alper Nebi Yasak
  0 siblings, 0 replies; 14+ messages in thread
From: Alper Nebi Yasak @ 2022-05-27 16:54 UTC (permalink / raw)
  To: Peng Fan (OSS); +Cc: u-boot, Peng Fan, sbabic, festevam, trini, Simon Glass

On 24/05/2022 11:00, Peng Fan (OSS) wrote:
> By default when BINMAN_SYMBOLS is enabled, common/spl/spl.c has a code
> piece `binman_sym_declare(ulong, u_boot_any, image_pos);` which requires
> u-boot* node in device tree binman node section. But some
> platforms(i.MX8M) not need it. To avoid build break with BINMAN_SYMBOLS,
> introduce a no-u-boot-any property.

This is just a hacky workaround, I don't think it's OK.

Anyway, turns out you don't need this patch (and 5/9) either. I tried a
few things and found CONFIG_SPL_RAW_IMAGE_SUPPORT (enabled on most
imx8m) and CONFIG_SPL_RAM_DEVICE (enabled on imx8mm_data_modul_edm_sbc)
are using the 'u_boot_any' symbols. Disable them and the symbols get
optimized away and the error disappears.

I also found some relevant discussions from a while back, see [1], [2].


[1] using binman fails boot
https://lore.kernel.org/u-boot/CAJ+vNU0BZDr2q0ZPQkoQBP1eBhbYmQfJMYraSgOvWXwZ=yFReQ@mail.gmail.com/T/#u

[2] imx8: ls1028a: Drop raw image support
https://lore.kernel.org/u-boot/20210801205951.2202789-1-sjg@chromium.org/T/#u

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

* Re: [PATCH V5 8/9] binman_sym: guard with CONFIG_SPL_BINMAN_SYMBOLS
  2022-05-24  8:00 ` [PATCH V5 8/9] binman_sym: guard with CONFIG_SPL_BINMAN_SYMBOLS Peng Fan (OSS)
@ 2022-05-27 16:54   ` Alper Nebi Yasak
  0 siblings, 0 replies; 14+ messages in thread
From: Alper Nebi Yasak @ 2022-05-27 16:54 UTC (permalink / raw)
  To: Peng Fan (OSS)
  Cc: u-boot, Peng Fan, Tim Harvey, sbabic, festevam, trini, Simon Glass

On 24/05/2022 11:00, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> There is case that CONFIG_BINMAN is defined, but
> CONFIG_SPL_BINMAN_SYMBOLS is not defined. In that case, there will be
> build failure. So use CONFIG_SPL_BINMAN_SYMBOLS to guard the macros, and
> define CONFIG_SPL_BINMAN_SYMBOLS in binman syms test.
> 
> Tested-by: Tim Harvey <tharvey@gateworks.com> #imx8m[m,n,p]-venice
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  include/binman_sym.h                        | 2 +-
>  tools/binman/test/u_boot_binman_syms.c      | 1 +
>  tools/binman/test/u_boot_binman_syms_size.c | 1 +
>  3 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/include/binman_sym.h b/include/binman_sym.h
> index 72e6765fe52..548d8f5654c 100644
> --- a/include/binman_sym.h
> +++ b/include/binman_sym.h
> @@ -13,7 +13,7 @@
>  
>  #define BINMAN_SYM_MISSING	(-1UL)
>  
> -#ifdef CONFIG_BINMAN
> +#ifdef CONFIG_SPL_BINMAN_SYMBOLS

This must handle all of CONFIG_{TPL,VPL,SPL}_BINMAN_SYMBOLS.

You can use CONFIG_IS_ENABLED(BINMAN_SYMBOLS) if you:

- Create a binman/test/generated/autoconf.h with binman CONFIGs
- Add `-I $(SRC)` to CFLAGS in binman/test/Makefile
- Add `#include <linux/kconfig.h>` to test .c files
- Maybe add `#define CONFIG_SPL_BUILD` to test .c files

>  
>  /**
>   * binman_symname() - Internal function to get a binman symbol name
> diff --git a/tools/binman/test/u_boot_binman_syms.c b/tools/binman/test/u_boot_binman_syms.c
> index 37fc339ce84..f4a4d1f6846 100644
> --- a/tools/binman/test/u_boot_binman_syms.c
> +++ b/tools/binman/test/u_boot_binman_syms.c
> @@ -6,6 +6,7 @@
>   */
>  
>  #define CONFIG_BINMAN
> +#define CONFIG_SPL_BINMAN_SYMBOLS
>  #include <binman_sym.h>
>  
>  binman_sym_declare(unsigned long, u_boot_spl_any, offset);
> diff --git a/tools/binman/test/u_boot_binman_syms_size.c b/tools/binman/test/u_boot_binman_syms_size.c
> index 7224bc1863c..3a01d8ca4be 100644
> --- a/tools/binman/test/u_boot_binman_syms_size.c
> +++ b/tools/binman/test/u_boot_binman_syms_size.c
> @@ -6,6 +6,7 @@
>   */
>  
>  #define CONFIG_BINMAN
> +#define CONFIG_SPL_BINMAN_SYMBOLS
>  #include <binman_sym.h>
>  
>  binman_sym_declare(char, u_boot_spl, pos);

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

end of thread, other threads:[~2022-05-27 16:56 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-24  8:00 [PATCH V5 0/9] arm64: binman: use binman symbols for imx Peng Fan (OSS)
2022-05-24  8:00 ` [PATCH V5 1/9] arm: dts: imx8m: update binman ddr firmware node name Peng Fan (OSS)
2022-05-27 16:53   ` Alper Nebi Yasak
2022-05-24  8:00 ` [PATCH V5 2/9] armv8: u-boot-spl.lds: mark __image_copy_start as symbol Peng Fan (OSS)
2022-05-24  8:00 ` [PATCH V5 3/9] tools: binman: section: replace @ with - Peng Fan (OSS)
2022-05-27 16:53   ` Alper Nebi Yasak
2022-05-24  8:00 ` [PATCH V5 4/9] binman: introduce no-u-boot-any property Peng Fan (OSS)
2022-05-27 16:54   ` Alper Nebi Yasak
2022-05-24  8:00 ` [PATCH V5 5/9] arm: dts: imx8m: add " Peng Fan (OSS)
2022-05-24  8:00 ` [PATCH V5 6/9] ddr: imx8m: helper: load ddr firmware according to binman symbols Peng Fan (OSS)
2022-05-24  8:00 ` [PATCH V5 7/9] arm: dts: imx8m: shrink ddr firmware size to actual file size Peng Fan (OSS)
2022-05-24  8:00 ` [PATCH V5 8/9] binman_sym: guard with CONFIG_SPL_BINMAN_SYMBOLS Peng Fan (OSS)
2022-05-27 16:54   ` Alper Nebi Yasak
2022-05-24  8:00 ` [PATCH V5 9/9] imx: imx8mm-icore: migrate to use BINMAN Peng Fan (OSS)

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.