Skip to contentSkip to conversation

arm64: binman: use binman symbols for imx

PATCH Superseded Peng Fan (OSS) 5 participants 34 messages May 20, 2022 – May 24, 2022

Subsystems (3)

v4 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v4 cover arm64: binman: use binman symbols for imx

From: Peng Fan <[email protected]>

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 (8):
spl: guard u_boot_any with X86
arm: dts: imx8m: update binman ddr firmware node name
imx: imx8mm-icore: migrate to use BINMAN
armv8: u-boot-spl.lds: mark __image_copy_start as symbol
tools: binman: section: replace @ with -
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

 arch/arm/cpu/armv8/u-boot-spl.lds             |  2 +-
 arch/arm/dts/imx8mm-u-boot.dtsi               | 16 +++---
 arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi    |  8 +--
 .../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 +--
 .../dts/imx8mn-var-som-symphony-u-boot.dtsi   | 16 +++---
 arch/arm/dts/imx8mn-venice-u-boot.dtsi        | 16 +++---
 arch/arm/dts/imx8mp-u-boot.dtsi               |  8 +--
 arch/arm/dts/imx8mq-cm-u-boot.dtsi            |  8 +--
 arch/arm/dts/imx8mq-u-boot.dtsi               | 16 +++---
 arch/arm/mach-imx/imx8m/Kconfig               |  1 +
 .../mach-imx/imx8m/imximage-8mm-lpddr4.cfg    | 10 +---
 common/spl/spl.c                              |  8 ++-
 common/spl/spl_ram.c                          |  4 ++
 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/etype/section.py                 |  2 +-
 tools/binman/test/u_boot_binman_syms.c        |  1 +
 tools/binman/test/u_boot_binman_syms_size.c   |  1 +
 22 files changed, 116 insertions(+), 78 deletions(-)
Signature · 1 line
2.36.0
#1 lore raw

PATCH v4 1/8 spl: guard u_boot_any with X86

From: Peng Fan <[email protected]>

set the symbol as weak not work if LTO is enabled. Since u_boot_any is only used on X86 for now, so guard it with X86, otherwise build break if we use BINMAN_SYMBOLS on i.MX.

---
 common/spl/spl.c     | 8 ++++++--
 common/spl/spl_ram.c | 4 ++++
 2 files changed, 10 insertions(+), 2 deletions(-)
common/spl/spl.c +6 -2
index c8c463f80bd..4b28180467a 100644
@@ -50,7 +50,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 u32 *boot_params_ptr = NULL;
 
-#if CONFIG_IS_ENABLED(BINMAN_SYMBOLS)
+#if CONFIG_IS_ENABLED(BINMAN_SYMBOLS) && CONFIG_IS_ENABLED(X86)
 /* See spl.h for information about this */
 binman_sym_declare(ulong, u_boot_any, image_pos);
 binman_sym_declare(ulong, u_boot_any, size);
@@ -148,7 +148,7 @@ void spl_fixup_fdt(void *fdt_blob)
 #endif
 }
 
-#if CONFIG_IS_ENABLED(BINMAN_SYMBOLS)
+#if CONFIG_IS_ENABLED(BINMAN_SYMBOLS) && CONFIG_IS_ENABLED(X86)
 ulong spl_get_image_pos(void)
 {
 #ifdef CONFIG_VPL
@@ -221,7 +221,11 @@ __weak struct image_header *spl_get_load_buffer(ssize_t offset, size_t size)
 
 void spl_set_header_raw_uboot(struct spl_image_info *spl_image)
 {
+#if CONFIG_IS_ENABLED(X86)
 	ulong u_boot_pos = binman_sym(ulong, u_boot_any, image_pos);
+#else
+	ulong u_boot_pos = BINMAN_SYM_MISSING;
+#endif
 
 	spl_image->size = CONFIG_SYS_MONITOR_LEN;
 
common/spl/spl_ram.c +4 -0
index 82964592571..083b14102ee 100644
@@ -70,7 +70,11 @@ static int spl_ram_load_image(struct spl_image_info *spl_image,
 		load.read = spl_ram_load_read;
 		spl_load_simple_fit(spl_image, &load, 0, header);
 	} else {
+#if CONFIG_IS_ENABLED(X86)
 		ulong u_boot_pos = binman_sym(ulong, u_boot_any, image_pos);
+#else
+		ulong u_boot_pos = BINMAN_SYM_MISSING;
+#endif
 
 		debug("Legacy image\n");
 		/*
Signature · 1 line
2.36.0
#2 lore raw

Re: [PATCH V4 1/8] spl: guard u_boot_any with X86

Quoted 6 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

set the symbol as weak not work if LTO is enabled. Since u_boot_any is only used on X86 for now, so guard it with X86, otherwise build break if we use BINMAN_SYMBOLS on i.MX.

Quoted 6 lines
---
 common/spl/spl.c     | 8 ++++++--
 common/spl/spl_ram.c | 4 ++++
 2 files changed, 10 insertions(+), 2 deletions(-)

I think we long term need to figure this out and address it so LTO works. But for now can you please guard this with a test on LTO instead, so it's clear where the problem is?

Signature · 1 line
Tom
#3 lore raw

RE: [PATCH V4 1/8] spl: guard u_boot_any with X86

Quoted 17 lines

Subject: Re: [PATCH V4 1/8] spl: guard u_boot_any with X86

Quoted 6 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

set the symbol as weak not work if LTO is enabled. Since u_boot_any is only used on X86 for now, so guard it with X86, otherwise build break if we use BINMAN_SYMBOLS on i.MX.

Quoted 6 lines
---
 common/spl/spl.c     | 8 ++++++--
 common/spl/spl_ram.c | 4 ++++
 2 files changed, 10 insertions(+), 2 deletions(-)
Quoted 3 lines

I think we long term need to figure this out and address it so LTO works. But for now can you please guard this with a test on LTO instead, so it's clear where the problem is?

Sorry, I could not get your point about guard with a test on LTO.

Actually binman weak symbol will report a warning log if there is no u_boot_any binman symbol. Since only X86 use it, I guard with X86.

Thanks,
Peng.

Quoted 3 lines

--
Tom

#4 lore raw

Re: [PATCH V4 1/8] spl: guard u_boot_any with X86

Quoted 17 lines · Peng Fan
Quoted 17 lines

Subject: Re: [PATCH V4 1/8] spl: guard u_boot_any with X86

Quoted 12 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

set the symbol as weak not work if LTO is enabled. Since u_boot_any is only used on X86 for now, so guard it with X86, otherwise build break if we use BINMAN_SYMBOLS on i.MX.

---
 common/spl/spl.c     | 8 ++++++--
 common/spl/spl_ram.c | 4 ++++
 2 files changed, 10 insertions(+), 2 deletions(-)
Quoted 8 lines
Quoted 3 lines

I think we long term need to figure this out and address it so LTO works. But for now can you please guard this with a test on LTO instead, so it's clear where the problem is?

Sorry, I could not get your point about guard with a test on LTO.

Actually binman weak symbol will report a warning log if there is no u_boot_any binman symbol. Since only X86 use it, I guard with X86.

Why are you mentioning LTO in the commit message? When I read the commit message it sounds like you're saying the problem is that LTO doesn't like how this symbol is handled, but if LTO was disabled, everything would be fine. If it's not LTO-related, please re-word the message instead.

Signature · 1 line
Tom
#5 lore raw

Re: [PATCH V4 1/8] spl: guard u_boot_any with X86

Quoted 24 lines · Tom Rini
Quoted 23 lines · Peng Fan
Quoted 17 lines

Subject: Re: [PATCH V4 1/8] spl: guard u_boot_any with X86

Quoted 6 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

set the symbol as weak not work if LTO is enabled. Since u_boot_any is only used on X86 for now, so guard it with X86, otherwise build break if we use BINMAN_SYMBOLS on i.MX.

Quoted 6 lines
---
 common/spl/spl.c     | 8 ++++++--
 common/spl/spl_ram.c | 4 ++++
 2 files changed, 10 insertions(+), 2 deletions(-)
Quoted 3 lines

I think we long term need to figure this out and address it so LTO works. But for now can you please guard this with a test on LTO instead, so it's clear where the problem is?

Sorry, I could not get your point about guard with a test on LTO.

Quoted 8 lines
Quoted 2 lines

Actually binman weak symbol will report a warning log if there is no u_boot_any binman symbol. Since only X86 use it, I guard with X86.

Why are you mentioning LTO in the commit message? When I read the commit message it sounds like you're saying the problem is that LTO doesn't like how this symbol is handled, but if LTO was disabled, everything would be fine. If it's not LTO-related, please re-word the message instead.

It looks like we should be able to change things in common/spl/spl.c to:

    #if CONFIG_IS_ENABLED(BINMAN_SYMBOLS)
    /* See spl.h for information about this */
    binman_sym_declare_optional(ulong, u_boot_any, image_pos);
    binman_sym_declare_optional(ulong, u_boot_any, size);
    #endif

which would mark the symbol as 'weak' and turn the error into a warning on the binman side. But that is somehow being undone by LTO.

I'm trying to build for imx8mm-beacon with that change instead of this patch. With CONFIG_LTO=y, build fails and spl/u-boot-spl.sym has:

Quoted 1 line

00000000007fbe28 l O .binman_sym 0000000000000008 _binman_u_boot_any_prop_image_pos

Looks like the size symbol is optimized out. With CONFIG_LTO unset, the build succeeds and the same file has:

Quoted 2 lines
00000000007fe90c  w    O .binman_sym	0000000000000008 _binman_u_boot_any_prop_image_pos
00000000007fe904  w    O .binman_sym	0000000000000008 _binman_u_boot_any_prop_size

I don't know much about linking stuff, so this is as deep as I could dig...

#6 lore raw

Re: [PATCH V4 1/8] spl: guard u_boot_any with X86

Quoted 36 lines · Alper Nebi Yasak
Quoted 24 lines · Tom Rini
Quoted 23 lines · Peng Fan
Quoted 17 lines

Subject: Re: [PATCH V4 1/8] spl: guard u_boot_any with X86

Quoted 6 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

set the symbol as weak not work if LTO is enabled. Since u_boot_any is only used on X86 for now, so guard it with X86, otherwise build break if we use BINMAN_SYMBOLS on i.MX.

Quoted 6 lines
---
 common/spl/spl.c     | 8 ++++++--
 common/spl/spl_ram.c | 4 ++++
 2 files changed, 10 insertions(+), 2 deletions(-)
Quoted 3 lines

I think we long term need to figure this out and address it so LTO works. But for now can you please guard this with a test on LTO instead, so it's clear where the problem is?

Sorry, I could not get your point about guard with a test on LTO.

Quoted 8 lines
Quoted 2 lines

Actually binman weak symbol will report a warning log if there is no u_boot_any binman symbol. Since only X86 use it, I guard with X86.

Why are you mentioning LTO in the commit message? When I read the commit message it sounds like you're saying the problem is that LTO doesn't like how this symbol is handled, but if LTO was disabled, everything would be fine. If it's not LTO-related, please re-word the message instead.

It looks like we should be able to change things in common/spl/spl.c to:

Quoted 8 lines
    #if CONFIG_IS_ENABLED(BINMAN_SYMBOLS)
    /* See spl.h for information about this */
    binman_sym_declare_optional(ulong, u_boot_any, image_pos);
    binman_sym_declare_optional(ulong, u_boot_any, size);
    #endif

which would mark the symbol as 'weak' and turn the error into a warning on the binman side. But that is somehow being undone by LTO.

So, looking at binman_sym_declare_optional we tell the linker that it's weak and might even be unused. LTO gets very aggressive about finding things that aren't used in the resulting binary and discarding them. Typically we have the problem of a function that is used but it's hard for LTO to see it, so we give it the "used" attribute. But for something we're already saying is "unused" this would be wrong. So why do we mark things as unused here? I assume it's marked weak as it could be overridden at link time by a definition elsewhere.

Signature · 1 line
Tom
#7 lore raw

Re: [PATCH V4 1/8] spl: guard u_boot_any with X86

Quoted 12 lines · Tom Rini
Quoted 10 lines · Alper Nebi Yasak

It looks like we should be able to change things in common/spl/spl.c to:

    #if CONFIG_IS_ENABLED(BINMAN_SYMBOLS)
    /* See spl.h for information about this */
    binman_sym_declare_optional(ulong, u_boot_any, image_pos);
    binman_sym_declare_optional(ulong, u_boot_any, size);
    #endif

which would mark the symbol as 'weak' and turn the error into a warning on the binman side. But that is somehow being undone by LTO.

Quoted 8 lines

So, looking at binman_sym_declare_optional we tell the linker that it's weak and might even be unused. LTO gets very aggressive about finding things that aren't used in the resulting binary and discarding them. Typically we have the problem of a function that is used but it's hard for LTO to see it, so we give it the "used" attribute. But for something we're already saying is "unused" this would be wrong. So why do we mark things as unused here? I assume it's marked weak as it could be overridden at link time by a definition elsewhere.

I don't know, but the GCC manual says marking things 'unused' will suppress a warning if the variable is actually unused. I guess binman symbols may become unused due to some other config options being unset, and it's done for those cases?

I think the optional symbols are marked weak just to signal the python side that they are optional. If I understand it right, binman:

1. Packs an image using the finalized 'spl/u-boot-spl.bin'
2. Figures out the image-pos and size values of every entry
3. Inspects the 'spl/u-boot-spl' ELF file for declared binman symbols
4. Raises an error if any non-'weak' symbol's value is undetermined
5. Updates the u-boot-spl.bin (in memory) with the calculated values
6. Recreates the final image based on that updated bin file.

#8 lore raw

RE: [PATCH V4 1/8] spl: guard u_boot_any with X86

In reply to Alper Nebi Yasak
Quoted 56 lines

Subject: Re: [PATCH V4 1/8] spl: guard u_boot_any with X86

Quoted 24 lines · Tom Rini
Quoted 23 lines · Peng Fan
Quoted 17 lines

Subject: Re: [PATCH V4 1/8] spl: guard u_boot_any with X86

Quoted 6 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

set the symbol as weak not work if LTO is enabled. Since u_boot_any is only used on X86 for now, so guard it with X86, otherwise build break if we use BINMAN_SYMBOLS on i.MX.

Quoted 6 lines
---
 common/spl/spl.c     | 8 ++++++--
 common/spl/spl_ram.c | 4 ++++
 2 files changed, 10 insertions(+), 2 deletions(-)
Quoted 3 lines

I think we long term need to figure this out and address it so LTO works. But for now can you please guard this with a test on LTO instead, so it's clear where the problem is?

Sorry, I could not get your point about guard with a test on LTO.

Quoted 8 lines
Quoted 2 lines

Actually binman weak symbol will report a warning log if there is no u_boot_any binman symbol. Since only X86 use it, I guard with X86.

Why are you mentioning LTO in the commit message? When I read the commit message it sounds like you're saying the problem is that LTO doesn't like how this symbol is handled, but if LTO was disabled, everything would be fine. If it's not LTO-related, please re-word the message instead.

It looks like we should be able to change things in common/spl/spl.c to:

    #if CONFIG_IS_ENABLED(BINMAN_SYMBOLS)
    /* See spl.h for information about this */
    binman_sym_declare_optional(ulong, u_boot_any, image_pos);
    binman_sym_declare_optional(ulong, u_boot_any, size);
    #endif

which would mark the symbol as 'weak' and turn the error into a warning on the binman side. But that is somehow being undone by LTO.

I'm trying to build for imx8mm-beacon with that change instead of this patch. With CONFIG_LTO=y, build fails and spl/u-boot-spl.sym has:

Quoted 1 line

00000000007fbe28 l O .binman_sym 0000000000000008

_binman_u_boot_any_prop_image_pos

Looks like the size symbol is optimized out. With CONFIG_LTO unset, the build succeeds and the same file has:

Quoted 6 lines
Quoted 1 line

00000000007fe90c w O .binman_sym 0000000000000008

_binman_u_boot_any_prop_image_pos

Quoted 1 line

00000000007fe904 w O .binman_sym 0000000000000008

_binman_u_boot_any_prop_size

I don't know much about linking stuff, so this is as deep as I could dig...

Thanks for the detailed sharing. Yes, this is the issue I try to work around. Some i.MX boards has LTO set, this leads me to use X86 as an extra guard.

Thanks,
Peng.

#9 lore raw

RE: [PATCH V4 1/8] spl: guard u_boot_any with X86

In reply to Tom Rini
Quoted 26 lines

Subject: Re: [PATCH V4 1/8] spl: guard u_boot_any with X86

Quoted 23 lines · Peng Fan
Quoted 17 lines

Subject: Re: [PATCH V4 1/8] spl: guard u_boot_any with X86

Quoted 6 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

set the symbol as weak not work if LTO is enabled. Since u_boot_any is only used on X86 for now, so guard it with X86, otherwise build break if we use BINMAN_SYMBOLS on i.MX.

Quoted 6 lines
---
 common/spl/spl.c     | 8 ++++++--
 common/spl/spl_ram.c | 4 ++++
 2 files changed, 10 insertions(+), 2 deletions(-)
Quoted 3 lines

I think we long term need to figure this out and address it so LTO works. But for now can you please guard this with a test on LTO instead, so it's clear where the problem is?

Sorry, I could not get your point about guard with a test on LTO.

Quoted 7 lines
Quoted 2 lines

Actually binman weak symbol will report a warning log if there is no u_boot_any binman symbol. Since only X86 use it, I guard with X86.

Why are you mentioning LTO in the commit message? When I read the commit message it sounds like you're saying the problem is that LTO doesn't like how this symbol is handled, but if LTO was disabled, everything would be fine. If it's not LTO-related, please re-word the message instead.

Sorry, I could reword the commit message, but currently I have no better idea to address the issue unless use X86 as a guard in the code as this patch does. If you agree the code in this patch, I could reword commit msg and send v5.

Thanks,
Peng.

Quoted 3 lines

--
Tom

#10 lore raw

Re: [PATCH V4 1/8] spl: guard u_boot_any with X86

Quoted 34 lines · Peng Fan (OSS)
Quoted 26 lines

Subject: Re: [PATCH V4 1/8] spl: guard u_boot_any with X86

Quoted 23 lines · Peng Fan
Quoted 17 lines

Subject: Re: [PATCH V4 1/8] spl: guard u_boot_any with X86

Quoted 6 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

set the symbol as weak not work if LTO is enabled. Since u_boot_any is only used on X86 for now, so guard it with X86, otherwise build break if we use BINMAN_SYMBOLS on i.MX.

Quoted 6 lines
---
 common/spl/spl.c     | 8 ++++++--
 common/spl/spl_ram.c | 4 ++++
 2 files changed, 10 insertions(+), 2 deletions(-)
Quoted 3 lines

I think we long term need to figure this out and address it so LTO works. But for now can you please guard this with a test on LTO instead, so it's clear where the problem is?

Sorry, I could not get your point about guard with a test on LTO.

Quoted 7 lines
Quoted 2 lines

Actually binman weak symbol will report a warning log if there is no u_boot_any binman symbol. Since only X86 use it, I guard with X86.

Why are you mentioning LTO in the commit message? When I read the commit message it sounds like you're saying the problem is that LTO doesn't like how this symbol is handled, but if LTO was disabled, everything would be fine. If it's not LTO-related, please re-word the message instead.

Quoted 4 lines

Sorry, I could reword the commit message, but currently I have no better idea to address the issue unless use X86 as a guard in the code as this patch does. If you agree the code in this patch, I could reword commit msg and send v5.

Well, lets see what Alper says in the other part of the thread. I'd really like to solve this not work around this. But I'll take documenting the problem for the person that has X86 && LTO as good enough for the moment.

Signature · 1 line
Tom
#11 lore raw

Re: [PATCH V4 1/8] spl: guard u_boot_any with X86

Quoted 13 lines · Tom Rini
Quoted 11 lines · Peng Fan (OSS)
Quoted 6 lines

Subject: Re: [PATCH V4 1/8] spl: guard u_boot_any with X86

Why are you mentioning LTO in the commit message? When I read the commit message it sounds like you're saying the problem is that LTO doesn't like how this symbol is handled, but if LTO was disabled, everything would be fine. If it's not LTO-related, please re-word the message instead.

Sorry, I could reword the commit message, but currently I have no better idea to address the issue unless use X86 as a guard in the code as this patch does. If you agree the code in this patch, I could reword commit msg and send v5.

Quoted 4 lines

Well, lets see what Alper says in the other part of the thread. I'd really like to solve this not work around this. But I'll take documenting the problem for the person that has X86 && LTO as good enough for the moment.

Alternatively, I think we can decide that all binman symbols are optional, and not raise an error when we can't find a value for them. They are de-facto optional anyway: people can use the non-binman-image build artifacts (which binman doesn't update wrt. symbols), thus the code that uses binman symbols should assume their values can be missing.

#12 lore raw

Re: [PATCH V4 1/8] spl: guard u_boot_any with X86

In reply to Peng Fan (OSS)
Quoted 6 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

set the symbol as weak not work if LTO is enabled. Since u_boot_any is only used on X86 for now, so guard it with X86, otherwise build break if we use BINMAN_SYMBOLS on i.MX.

Quoted 8 lines
---
 common/spl/spl.c     | 8 ++++++--
 common/spl/spl_ram.c | 4 ++++
 2 files changed, 10 insertions(+), 2 deletions(-)

[...]

If I apply the series without this patch and try to build imx8mm-beacon, I get the following error, and I'm assuming that's what you're trying to solve here:

    binman: Section '/binman/u-boot-spl-ddr': \
      Symbol '_binman_u_boot_any_prop_image_pos' in entry \
      '/binman/u-boot-spl-ddr/u-boot-spl/u-boot-spl-nodtb': \
      Entry 'u-boot-any' not found in list (...)

The immediate cause for this is that your 'u-boot-spl-ddr' image has no 'u-boot'-like entry, meaning there's no reasonable value to write into the non-optional 'u_boot_any' symbol.

(I think it might be OK to make this symbol optional, but LTO breaks that as you found out. The rest of this email is about my thoughts before I realized the LTO problem, but they're still relevant.)

It looks like binman images were designed to be monolithic instead of modular, and it's assumed you'd have one fully-specified image for your 'flash.bin' where 'u-boot-spl' would know about (for example) a 'u-boot' in a FIT entry. (I would like things to be modular eventually, though).

I tried to merge things into a single binman image, but mkimage is trying to read 'u-boot-spl-ddr.bin' which would no longer exist. I see this is because it's specified in 'spl/u-boot-spl.cfgout' as a LOADER file in a later patch.

Maybe 'imx8mimage.c' can be changed to use mkimage's -d argument as the LOADER instead? That's how binman passes the input data to mkimage, but that seems to be ignored in this case. Then we can merge things into a single image which will be able to set the 'u_boot_any' symbols without error.

Otherwise, the mkimage file reading error can be solved by creating a new binman 'imx8m-image' entry type that creates the 'cfgout' and calls mkimage with it. (Binman images would still need to be merged).

#13 lore raw

PATCH v4 2/8 arm: dts: imx8m: update binman ddr firmware node name

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

We are migrating to use BINMAN SYMBOLS, the current name is not a valid binman type, so update to use blob-ext@[1,2,3,4].

---
 arch/arm/dts/imx8mm-u-boot.dtsi                   | 8 ++++----
 arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi | 4 ++--
 arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi  | 8 ++++----
 arch/arm/dts/imx8mn-venice-u-boot.dtsi            | 8 ++++----
 arch/arm/dts/imx8mq-u-boot.dtsi                   | 8 ++++----
 5 files changed, 18 insertions(+), 18 deletions(-)
arch/arm/dts/imx8mm-u-boot.dtsi +4 -4
index 9f66cdb65a9..5de55a2d80b 100644
@@ -39,25 +39,25 @@
 			filename = "u-boot-spl.bin";
 		};
 
-		1d-imem {
+		imem_1d: blob-ext@1 {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		1d-dmem {
+		dmem_1d: blob-ext@2 {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
 			size = <0x4000>;
 			type = "blob-ext";
 		};
 
-		2d-imem {
+		imem_2d: blob-ext@3 {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		2d-dmem {
+		dmem_2d: blob-ext@4 {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
 			size = <0x4000>;
 			type = "blob-ext";
arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi +2 -2
index 46a9d7fd78b..5a52b73d7e9 100644
@@ -111,13 +111,13 @@
 			filename = "u-boot-spl.bin";
 		};
 
-		1d-imem {
+		imem_1d: blob-ext@1 {
 			filename = "ddr3_imem_1d.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		1d_dmem {
+		dmem_1d: blob-ext@2 {
 			filename = "ddr3_dmem_1d.bin";
 			size = <0x4000>;
 			type = "blob-ext";
arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi +4 -4
index 6e37622cca7..001e725f568 100644
@@ -130,25 +130,25 @@
 			filename = "u-boot-spl.bin";
 		};
 
-		1d-imem {
+		blob_1: blob-ext@1 {
 			filename = "ddr4_imem_1d.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		1d_dmem {
+		blob_2: blob-ext@2 {
 			filename = "ddr4_dmem_1d.bin";
 			size = <0x4000>;
 			type = "blob-ext";
 		};
 
-		2d_imem {
+		blob_3: blob-ext@3 {
 			filename = "ddr4_imem_2d.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		2d_dmem {
+		blob_4: blob-ext@4 {
 			filename = "ddr4_dmem_2d.bin";
 			size = <0x4000>;
 			type = "blob-ext";
arch/arm/dts/imx8mn-venice-u-boot.dtsi +4 -4
index 35819553879..67922146963 100644
@@ -126,25 +126,25 @@
 			filename = "u-boot-spl.bin";
 		};
 
-		1d-imem {
+		imem_1d: blob-ext@1 {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		1d_dmem {
+		dmem_1d: blob-ext@2 {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
 			size = <0x4000>;
 			type = "blob-ext";
 		};
 
-		2d_imem {
+		imem_2d: blob-ext@3 {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		2d_dmem {
+		dmem_2d: blob-ext@4 {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
 			size = <0x4000>;
 			type = "blob-ext";
arch/arm/dts/imx8mq-u-boot.dtsi +4 -4
index 912a3d4a356..389414ad26f 100644
@@ -46,25 +46,25 @@
 			filename = "u-boot-spl.bin";
 		};
 
-		1d-imem {
+		imem_1d: blob-ext@1 {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		1d-dmem {
+		dmem_1d: blob-ext@2 {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
 			size = <0x4000>;
 			type = "blob-ext";
 		};
 
-		2d-imem {
+		imem_2d: blob-ext@3 {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		2d-dmem {
+		dmem_2d: blob-ext@4 {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
 			size = <0x4000>;
 			type = "blob-ext";
Signature · 1 line
2.36.0
#14 lore raw

Re: [PATCH V4 2/8] arm: dts: imx8m: update binman ddr firmware node name

Quoted 7 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

We are migrating to use BINMAN SYMBOLS, the current name is not a valid binman type, so update to use blob-ext@[1,2,3,4].

Quoted 7 lines
---
 arch/arm/dts/imx8mm-u-boot.dtsi                   | 8 ++++----
 arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi | 4 ++--
 arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi  | 8 ++++----
 arch/arm/dts/imx8mn-venice-u-boot.dtsi            | 8 ++++----
 arch/arm/dts/imx8mq-u-boot.dtsi                   | 8 ++++----
 5 files changed, 18 insertions(+), 18 deletions(-)

I think descriptive entry names are better in general, so I prefer the old names to a bunch of 'blob-ext's. Symbol resolution is done using the entry names anyway, I don't see why this change would be necessary.

In any case, the names and labels should be consistent across the different dts files, assuming the blobs have the same purpose / meaning. I see that labels starting with digits cause a dtc parse error, so the entries could be imem_1d: imem-1d { ... }; and so on.

Also, the blobs essentially look the same to me aside from their filenames, just duplicated over different imx8m* variants and boards. Maybe binman parts could be unified into a single dtsi file later on? (Filename differences can be handled by new 'blob_named_by_arg's btw.)

Quoted 156 lines
arch/arm/dts/imx8mm-u-boot.dtsi +4 -4
index 9f66cdb65a9..5de55a2d80b 100644
@@ -39,25 +39,25 @@
 			filename = "u-boot-spl.bin";
 		};
 
-		1d-imem {
+		imem_1d: blob-ext@1 {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		1d-dmem {
+		dmem_1d: blob-ext@2 {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
 			size = <0x4000>;
 			type = "blob-ext";
 		};
 
-		2d-imem {
+		imem_2d: blob-ext@3 {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		2d-dmem {
+		dmem_2d: blob-ext@4 {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
 			size = <0x4000>;
 			type = "blob-ext";
arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi +2 -2
index 46a9d7fd78b..5a52b73d7e9 100644
@@ -111,13 +111,13 @@
 			filename = "u-boot-spl.bin";
 		};
 
-		1d-imem {
+		imem_1d: blob-ext@1 {
 			filename = "ddr3_imem_1d.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		1d_dmem {
+		dmem_1d: blob-ext@2 {
 			filename = "ddr3_dmem_1d.bin";
 			size = <0x4000>;
 			type = "blob-ext";
arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi +4 -4
index 6e37622cca7..001e725f568 100644
@@ -130,25 +130,25 @@
 			filename = "u-boot-spl.bin";
 		};
 
-		1d-imem {
+		blob_1: blob-ext@1 {
 			filename = "ddr4_imem_1d.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		1d_dmem {
+		blob_2: blob-ext@2 {
 			filename = "ddr4_dmem_1d.bin";
 			size = <0x4000>;
 			type = "blob-ext";
 		};
 
-		2d_imem {
+		blob_3: blob-ext@3 {
 			filename = "ddr4_imem_2d.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		2d_dmem {
+		blob_4: blob-ext@4 {
 			filename = "ddr4_dmem_2d.bin";
 			size = <0x4000>;
 			type = "blob-ext";
arch/arm/dts/imx8mn-venice-u-boot.dtsi +4 -4
index 35819553879..67922146963 100644
@@ -126,25 +126,25 @@
 			filename = "u-boot-spl.bin";
 		};
 
-		1d-imem {
+		imem_1d: blob-ext@1 {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		1d_dmem {
+		dmem_1d: blob-ext@2 {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
 			size = <0x4000>;
 			type = "blob-ext";
 		};
 
-		2d_imem {
+		imem_2d: blob-ext@3 {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		2d_dmem {
+		dmem_2d: blob-ext@4 {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
 			size = <0x4000>;
 			type = "blob-ext";
arch/arm/dts/imx8mq-u-boot.dtsi +4 -4
index 912a3d4a356..389414ad26f 100644
@@ -46,25 +46,25 @@
 			filename = "u-boot-spl.bin";
 		};
 
-		1d-imem {
+		imem_1d: blob-ext@1 {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		1d-dmem {
+		dmem_1d: blob-ext@2 {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
 			size = <0x4000>;
 			type = "blob-ext";
 		};
 
-		2d-imem {
+		imem_2d: blob-ext@3 {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		2d-dmem {
+		dmem_2d: blob-ext@4 {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
 			size = <0x4000>;
 			type = "blob-ext";
#15 lore raw

RE: [PATCH V4 2/8] arm: dts: imx8m: update binman ddr firmware node name

Quoted 19 lines

Subject: Re: [PATCH V4 2/8] arm: dts: imx8m: update binman ddr firmware node name

Quoted 7 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

We are migrating to use BINMAN SYMBOLS, the current name is not a valid binman type, so update to use blob-ext@[1,2,3,4].

Quoted 7 lines
---
 arch/arm/dts/imx8mm-u-boot.dtsi                   | 8 ++++----
 arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi | 4 ++--
arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi  | 8 ++++----
 arch/arm/dts/imx8mn-venice-u-boot.dtsi            | 8 ++++----
 arch/arm/dts/imx8mq-u-boot.dtsi                   | 8 ++++----
 5 files changed, 18 insertions(+), 18 deletions(-)
Quoted 3 lines

I think descriptive entry names are better in general, so I prefer the old names to a bunch of 'blob-ext's. Symbol resolution is done using the entry names anyway, I don't see why this change would be necessary.

Binman understand blob-ext, it not understand 1d-imem. If keep id-imem, or else, need to add several new binman types which I would not prefer.

Thanks,
Peng.

Quoted 172 lines

In any case, the names and labels should be consistent across the different dts files, assuming the blobs have the same purpose / meaning.
I see that labels starting with digits cause a dtc parse error, so the entries could be imem_1d: imem-1d { ... }; and so on.

Also, the blobs essentially look the same to me aside from their filenames, just duplicated over different imx8m* variants and boards.
Maybe binman parts could be unified into a single dtsi file later on? (Filename differences can be handled by new 'blob_named_by_arg's btw.)

Quoted 161 lines
(quoted diff) +0 -0

b/arch/arm/dts/imx8mm-u-boot.dtsi index 9f66cdb65a9..5de55a2d80b 100644

arch/arm/dts/imx8mm-u-boot.dtsi +4 -4
@@ -39,25 +39,25 @@
 			filename = "u-boot-spl.bin";
 		};
 
-		1d-imem {
+		imem_1d: blob-ext@1 {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		1d-dmem {
+		dmem_1d: blob-ext@2 {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
 			size = <0x4000>;
 			type = "blob-ext";
 		};
 
-		2d-imem {
+		imem_2d: blob-ext@3 {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		2d-dmem {
+		dmem_2d: blob-ext@4 {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
 			size = <0x4000>;
 			type = "blob-ext";
arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi +2 -2
index 46a9d7fd78b..5a52b73d7e9 100644
@@ -111,13 +111,13 @@
 			filename = "u-boot-spl.bin";
 		};
 
-		1d-imem {
+		imem_1d: blob-ext@1 {
 			filename = "ddr3_imem_1d.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		1d_dmem {
+		dmem_1d: blob-ext@2 {
 			filename = "ddr3_dmem_1d.bin";
 			size = <0x4000>;
 			type = "blob-ext";
arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi +4 -4
index 6e37622cca7..001e725f568 100644
@@ -130,25 +130,25 @@
 			filename = "u-boot-spl.bin";
 		};
 
-		1d-imem {
+		blob_1: blob-ext@1 {
 			filename = "ddr4_imem_1d.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		1d_dmem {
+		blob_2: blob-ext@2 {
 			filename = "ddr4_dmem_1d.bin";
 			size = <0x4000>;
 			type = "blob-ext";
 		};
 
-		2d_imem {
+		blob_3: blob-ext@3 {
 			filename = "ddr4_imem_2d.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		2d_dmem {
+		blob_4: blob-ext@4 {
 			filename = "ddr4_dmem_2d.bin";
 			size = <0x4000>;
 			type = "blob-ext";
arch/arm/dts/imx8mn-venice-u-boot.dtsi +4 -4
index 35819553879..67922146963 100644
@@ -126,25 +126,25 @@
 			filename = "u-boot-spl.bin";
 		};
 
-		1d-imem {
+		imem_1d: blob-ext@1 {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		1d_dmem {
+		dmem_1d: blob-ext@2 {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
 			size = <0x4000>;
 			type = "blob-ext";
 		};
 
-		2d_imem {
+		imem_2d: blob-ext@3 {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		2d_dmem {
+		dmem_2d: blob-ext@4 {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
 			size = <0x4000>;
 			type = "blob-ext";
(quoted diff) +0 -0

b/arch/arm/dts/imx8mq-u-boot.dtsi index 912a3d4a356..389414ad26f 100644

arch/arm/dts/imx8mq-u-boot.dtsi +4 -4
@@ -46,25 +46,25 @@
 			filename = "u-boot-spl.bin";
 		};
 
-		1d-imem {
+		imem_1d: blob-ext@1 {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		1d-dmem {
+		dmem_1d: blob-ext@2 {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
 			size = <0x4000>;
 			type = "blob-ext";
 		};
 
-		2d-imem {
+		imem_2d: blob-ext@3 {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		2d-dmem {
+		dmem_2d: blob-ext@4 {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
 			size = <0x4000>;
 			type = "blob-ext";
#16 lore raw

Re: [PATCH V4 2/8] arm: dts: imx8m: update binman ddr firmware node name

Quoted 19 lines · Peng Fan (OSS)
Quoted 19 lines

Subject: Re: [PATCH V4 2/8] arm: dts: imx8m: update binman ddr firmware node name

Quoted 14 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

We are migrating to use BINMAN SYMBOLS, the current name is not a valid binman type, so update to use blob-ext@[1,2,3,4].

---
 arch/arm/dts/imx8mm-u-boot.dtsi                   | 8 ++++----
 arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi | 4 ++--
arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi  | 8 ++++----
 arch/arm/dts/imx8mn-venice-u-boot.dtsi            | 8 ++++----
 arch/arm/dts/imx8mq-u-boot.dtsi                   | 8 ++++----
 5 files changed, 18 insertions(+), 18 deletions(-)
Quoted 6 lines
Quoted 3 lines

I think descriptive entry names are better in general, so I prefer the old names to a bunch of 'blob-ext's. Symbol resolution is done using the entry names anyway, I don't see why this change would be necessary.

Binman understand blob-ext, it not understand 1d-imem. If keep id-imem, or else, need to add several new binman types which I would not prefer.

It would work as long as you set type = "blob-ext"; in the entry block.

Please test this diff on top of your series:

arch/arm/dts/imx8mm-u-boot.dtsi +4 -4
index 19a2da30f512..8c48678625d9 100644
@@ -39,25 +39,25 @@
 			filename = "u-boot-spl.bin";
 		};
 
-		imem_1d: blob-ext@1 {
+		ddr-1d-imem-fw {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
 			align-end = <4>;
 			type = "blob-ext";
 		};
 
-		dmem_1d: blob-ext@2 {
+		ddr-1d-dmem-fw {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
 			align-end = <4>;
 			type = "blob-ext";
 		};
 
-		imem_2d: blob-ext@3 {
+		ddr-2d-imem-fw {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
 			align-end = <4>;
 			type = "blob-ext";
 		};
 
-		dmem_2d: blob-ext@4 {
+		ddr-2d-dmem-fw {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
 			align-end = <4>;
 			type = "blob-ext";
arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi +8 -4
index 0f89c8f677fa..dc7afc05e8f9 100644
@@ -143,24 +143,28 @@
 			align-end = <4>;
 		};
 
-		blob_1: blob-ext@1 {
+		ddr-1d-imem-fw {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
 			align-end = <4>;
+			type = "blob-ext";
 		};
 
-		blob_2: blob-ext@2 {
+		ddr-1d-dmem-fw {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
 			align-end = <4>;
+			type = "blob-ext";
 		};
 
-		blob_3: blob-ext@3 {
+		ddr-2d-imem-fw {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
 			align-end = <4>;
+			type = "blob-ext";
 		};
 
-		blob_4: blob-ext@4 {
+		ddr-2d-dmem-fw {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
 			align-end = <4>;
+			type = "blob-ext";
 		};
 	};
 
arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi +2 -2
index 5a52b73d7e9c..dc4cec250efa 100644
@@ -111,13 +111,13 @@
 			filename = "u-boot-spl.bin";
 		};
 
-		imem_1d: blob-ext@1 {
+		ddr-1d-imem-fw {
 			filename = "ddr3_imem_1d.bin";
 			size = <0x8000>;
 			type = "blob-ext";
 		};
 
-		dmem_1d: blob-ext@2 {
+		ddr-1d-dmem-fw {
 			filename = "ddr3_dmem_1d.bin";
 			size = <0x4000>;
 			type = "blob-ext";
arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi +8 -4
index 6f3d5cfe3c18..3f02b4aac135 100644
@@ -151,24 +151,28 @@
 			align-end = <4>;
 		};
 
-		blob_1: blob-ext@1 {
+		ddr-1d-imem-fw {
 			filename = "ddr4_imem_1d_201810.bin";
 			align-end = <4>;
+			type = "blob-ext";
 		};
 
-		blob_2: blob-ext@2 {
+		ddr-1d-dmem-fw {
 			filename = "ddr4_dmem_1d_201810.bin";
 			align-end = <4>;
+			type = "blob-ext";
 		};
 
-		blob_3: blob-ext@3 {
+		ddr-2d-imem-fw {
 			filename = "ddr4_imem_2d_201810.bin";
 			align-end = <4>;
+			type = "blob-ext";
 		};
 
-		blob_4: blob-ext@4 {
+		ddr-2d-dmem-fw {
 			filename = "ddr4_dmem_2d_201810.bin";
 			align-end = <4>;
+			type = "blob-ext";
 		};
 	};
 
arch/arm/dts/imx8mn-evk-u-boot.dtsi +8 -4
index 4f6dcf307b28..4d55905736d0 100644
@@ -36,24 +36,28 @@
 			align-end = <4>;
 		};
 
-		blob_1: blob-ext@1 {
+		ddr-1d-imem-fw {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
 			align-end = <4>;
+			type = "blob-ext";
 		};
 
-		blob_2: blob-ext@2 {
+		ddr-1d-dmem-fw {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
 			align-end = <4>;
+			type = "blob-ext";
 		};
 
-		blob_3: blob-ext@3 {
+		ddr-2d-imem-fw {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
 			align-end = <4>;
+			type = "blob-ext";
 		};
 
-		blob_4: blob-ext@4 {
+		ddr-2d-dmem-fw {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
 			align-end = <4>;
+			type = "blob-ext";
 		};
 	};
 
arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi +4 -4
index 32ef79292886..ed1ab10ded37 100644
@@ -130,25 +130,25 @@
 			filename = "u-boot-spl.bin";
 		};
 
-		blob_1: blob-ext@1 {
+		ddr-1d-imem-fw {
 			filename = "ddr4_imem_1d.bin";
 			align-end = <4>;
 			type = "blob-ext";
 		};
 
-		blob_2: blob-ext@2 {
+		ddr-1d-dmem-fw {
 			filename = "ddr4_dmem_1d.bin";
 			align-end = <4>;
 			type = "blob-ext";
 		};
 
-		blob_3: blob-ext@3 {
+		ddr-2d-imem-fw {
 			filename = "ddr4_imem_2d.bin";
 			align-end = <4>;
 			type = "blob-ext";
 		};
 
-		blob_4: blob-ext@4 {
+		ddr-2d-dmem-fw {
 			filename = "ddr4_dmem_2d.bin";
 			align-end = <4>;
 			type = "blob-ext";
arch/arm/dts/imx8mn-venice-u-boot.dtsi +4 -4
index 03a9eb8516f9..6d6535fdbfeb 100644
@@ -122,25 +122,25 @@
 			filename = "u-boot-spl.bin";
 		};
 
-		imem_1d: blob-ext@1 {
+		ddr-1d-imem-fw {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
 			align-end = <4>;
 			type = "blob-ext";
 		};
 
-		dmem_1d: blob-ext@2 {
+		ddr-1d-dmem-fw {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
 			align-end = <4>;
 			type = "blob-ext";
 		};
 
-		imem_2d: blob-ext@3 {
+		ddr-2d-imem-fw {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
 			align-end = <4>;
 			type = "blob-ext";
 		};
 
-		dmem_2d: blob-ext@4 {
+		ddr-2d-dmem-fw {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
 			align-end = <4>;
 			type = "blob-ext";
arch/arm/dts/imx8mp-u-boot.dtsi +8 -4
index 274515a010ee..6fd4de2c9615 100644
@@ -61,24 +61,28 @@
 			align-end = <4>;
 		};
 
-		blob_1: blob-ext@1 {
+		ddr-1d-imem-fw {
 			filename = "lpddr4_pmu_train_1d_imem_202006.bin";
 			align-end = <4>;
+			type = "blob-ext";
 		};
 
-		blob_2: blob-ext@2 {
+		ddr-1d-dmem-fw {
 			filename = "lpddr4_pmu_train_1d_dmem_202006.bin";
 			align-end = <4>;
+			type = "blob-ext";
 		};
 
-		blob_3: blob-ext@3 {
+		ddr-2d-imem-fw {
 			filename = "lpddr4_pmu_train_2d_imem_202006.bin";
 			align-end = <4>;
+			type = "blob-ext";
 		};
 
-		blob_4: blob-ext@4 {
+		ddr-2d-dmem-fw {
 			filename = "lpddr4_pmu_train_2d_dmem_202006.bin";
 			align-end = <4>;
+			type = "blob-ext";
 		};
 	};
 
arch/arm/dts/imx8mq-cm-u-boot.dtsi +8 -4
index 1b66e76ee1dc..81063083bd40 100644
@@ -20,24 +20,28 @@
 			align-end = <4>;
 		};
 
-		blob_1: blob-ext@1 {
+		ddr-1d-imem-fw {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
 			align-end = <4>;
+			type = "blob-ext";
 		};
 
-		blob_2: blob-ext@2 {
+		ddr-1d-dmem-fw {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
 			align-end = <4>;
+			type = "blob-ext";
 		};
 
-		blob_3: blob-ext@3 {
+		ddr-2d-imem-fw {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
 			align-end = <4>;
+			type = "blob-ext";
 		};
 
-		blob_4: blob-ext@4 {
+		ddr-2d-dmem-fw {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
 			align-end = <4>;
+			type = "blob-ext";
 		};
 	};
 
arch/arm/dts/imx8mq-u-boot.dtsi +4 -4
index e683e9184725..000ee545ee7f 100644
@@ -22,25 +22,25 @@
 			filename = "u-boot-spl.bin";
 		};
 
-		imem_1d: blob-ext@1 {
+		ddr-1d-imem-fw {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
 			align-end = <4>;
 			type = "blob-ext";
 		};
 
-		dmem_1d: blob-ext@2 {
+		ddr-1d-dmem-fw {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
 			align-end = <4>;
 			type = "blob-ext";
 		};
 
-		imem_2d: blob-ext@3 {
+		ddr-2d-imem-fw {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
 			align-end = <4>;
 			type = "blob-ext";
 		};
 
-		dmem_2d: blob-ext@4 {
+		ddr-2d-dmem-fw {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
 			align-end = <4>;
 			type = "blob-ext";
drivers/ddr/imx/imx8m/helper.c +18 -18
index b3bd57531b76..3764cffabc90 100644
@@ -26,18 +26,18 @@ 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, blob_ext_1, image_pos);
-binman_sym_declare(ulong, blob_ext_1, size);
+binman_sym_declare(ulong, ddr_1d_imem_fw, image_pos);
+binman_sym_declare(ulong, ddr_1d_imem_fw, size);
 
-binman_sym_declare(ulong, blob_ext_2, image_pos);
-binman_sym_declare(ulong, blob_ext_2, size);
+binman_sym_declare(ulong, ddr_1d_dmem_fw, image_pos);
+binman_sym_declare(ulong, ddr_1d_dmem_fw, size);
 
 #if !IS_ENABLED(CONFIG_IMX8M_DDR3L)
-binman_sym_declare(ulong, blob_ext_3, image_pos);
-binman_sym_declare(ulong, blob_ext_3, size);
+binman_sym_declare(ulong, ddr_2d_imem_fw, image_pos);
+binman_sym_declare(ulong, ddr_2d_imem_fw, size);
 
-binman_sym_declare(ulong, blob_ext_4, image_pos);
-binman_sym_declare(ulong, blob_ext_4, size);
+binman_sym_declare(ulong, ddr_2d_dmem_fw, image_pos);
+binman_sym_declare(ulong, ddr_2d_dmem_fw, size);
 #endif
 
 /* We need PHY iMEM PHY is 32KB padded */
@@ -59,27 +59,27 @@ void ddr_load_train_firmware(enum fw_type type)
 	}
 #endif
 
+	dmem_start = imem_start + imem_len;
+
 	if (CONFIG_IS_ENABLED(BINMAN_SYMBOLS)) {
 		switch (type) {
 		case FW_1D_IMAGE:
-			imem_start = binman_sym(ulong, blob_ext_1, image_pos);
-			imem_len = binman_sym(ulong, blob_ext_1, size);
-			dmem_start = binman_sym(ulong, blob_ext_2, image_pos);
-			dmem_len = binman_sym(ulong, blob_ext_2, size);
+			imem_start = binman_sym(ulong, ddr_1d_imem_fw, image_pos);
+			imem_len = binman_sym(ulong, ddr_1d_imem_fw, size);
+			dmem_start = binman_sym(ulong, ddr_1d_dmem_fw, image_pos);
+			dmem_len = binman_sym(ulong, ddr_1d_dmem_fw, size);
 			break;
 		case FW_2D_IMAGE:
 #if !IS_ENABLED(CONFIG_IMX8M_DDR3L)
-			imem_start = binman_sym(ulong, blob_ext_3, image_pos);
-			imem_len = binman_sym(ulong, blob_ext_3, size);
-			dmem_start = binman_sym(ulong, blob_ext_4, image_pos);
-			dmem_len = binman_sym(ulong, blob_ext_4, size);
+			imem_start = binman_sym(ulong, ddr_1d_dmem_fw, image_pos);
+			imem_len = binman_sym(ulong, ddr_1d_dmem_fw, size);
+			dmem_start = binman_sym(ulong, ddr_2d_dmem_fw, image_pos);
+			dmem_len = binman_sym(ulong, ddr_2d_dmem_fw, size);
 #endif
 			break;
 		}
 	}
 
-	dmem_start = imem_start + imem_len;
-
 	pr_from32 = imem_start;
 	pr_to32 = DDR_TRAIN_CODE_BASE_ADDR + 4 * IMEM_OFFSET_ADDR;
 	for (i = 0x0; i < imem_len; ) {
tools/binman/etype/section.py +1 -1
index e3f362b442b8..bd67238b9199 100644
@@ -875,7 +875,7 @@ def _CollectEntries(self, entries, entries_by_name, add_entry):
                 entries[entry.GetPath()] = entry
             for entry in to_add.values():
                 self._CollectEntries(entries, entries_by_name, entry)
-        entries_by_name[add_entry.name.replace('@', '-')] = add_entry
+        entries_by_name[add_entry.name] = add_entry
 
     def MissingArgs(self, entry, missing):
         """Report a missing argument, if enabled
#17 lore raw

PATCH v4 3/8 imx: imx8mm-icore: migrate to use BINMAN

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Use BINMAN instead of imx specific packing method.

---
 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(-)
arch/arm/mach-imx/imx8m/Kconfig +1 -0
index 24299ae037f..75ad7aab081 100644
@@ -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
arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg +1 -9
index e06d53ef417..5dcb8ae72f0 100644
@@ -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
configs/imx8mm-icore-mx8mm-ctouch2_defconfig +1 -1
index d95a74a7237..dcb12e5d026 100644
@@ -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
configs/imx8mm-icore-mx8mm-edimm2.2_defconfig +1 -1
index 43c697a39d8..22acf7317b4 100644
@@ -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
Signature · 1 line
2.36.0
#18 lore raw

Re: [PATCH V4 3/8] imx: imx8mm-icore: migrate to use BINMAN

Quoted 8 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

Use BINMAN instead of imx specific packing method.

---
 arch/arm/mach-imx/imx8m/Kconfig                 |  1 +
 arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg | 10 +---------

Maybe this could be done for other imximage*.cfg files as well?

Quoted 61 lines
 configs/imx8mm-icore-mx8mm-ctouch2_defconfig    |  2 +-
 configs/imx8mm-icore-mx8mm-edimm2.2_defconfig   |  2 +-
 4 files changed, 4 insertions(+), 11 deletions(-)
arch/arm/mach-imx/imx8m/Kconfig +1 -0
index 24299ae037f..75ad7aab081 100644
@@ -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
arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg +1 -9
index e06d53ef417..5dcb8ae72f0 100644
@@ -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
configs/imx8mm-icore-mx8mm-ctouch2_defconfig +1 -1
index d95a74a7237..dcb12e5d026 100644
@@ -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
configs/imx8mm-icore-mx8mm-edimm2.2_defconfig +1 -1
index 43c697a39d8..22acf7317b4 100644
@@ -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
#19 lore raw

RE: [PATCH V4 3/8] imx: imx8mm-icore: migrate to use BINMAN

Quoted 5 lines

Subject: Re: [PATCH V4 3/8] imx: imx8mm-icore: migrate to use BINMAN

Quoted 2 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

Quoted 8 lines
Quoted 6 lines

Use BINMAN instead of imx specific packing method.

---
 arch/arm/mach-imx/imx8m/Kconfig                 |  1 +
 arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg | 10 +---------

Maybe this could be done for other imximage*.cfg files as well?

Yes, there are follow up patches to clean up the cfg files, this patch is for binman and avoid build break for these two boards.

Thanks,
Peng.

Quoted 64 lines
Quoted 64 lines
 configs/imx8mm-icore-mx8mm-ctouch2_defconfig    |  2 +-
 configs/imx8mm-icore-mx8mm-edimm2.2_defconfig   |  2 +-
 4 files changed, 4 insertions(+), 11 deletions(-)
(quoted diff) +0 -0

b/arch/arm/mach-imx/imx8m/Kconfig index 24299ae037f..75ad7aab081 100644

arch/arm/mach-imx/imx8m/Kconfig +1 -0
@@ -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
arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg +1 -9
index e06d53ef417..5dcb8ae72f0 100644
@@ -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
configs/imx8mm-icore-mx8mm-ctouch2_defconfig +1 -1
index d95a74a7237..dcb12e5d026 100644
@@ -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
configs/imx8mm-icore-mx8mm-edimm2.2_defconfig +1 -1
index 43c697a39d8..22acf7317b4 100644
@@ -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
#20 lore raw

PATCH v4 4/8 armv8: u-boot-spl.lds: mark __image_copy_start as symbol

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

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

---
 arch/arm/cpu/armv8/u-boot-spl.lds | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/cpu/armv8/u-boot-spl.lds +1 -1
index 730eb93dbc3..9b1e7d46287 100644
@@ -23,7 +23,7 @@ SECTIONS
 {
 	.text : {
 		. = ALIGN(8);
-		*(.__image_copy_start)
+		__image_copy_start = .;
 		CPUDIR/start.o (.text*)
 		*(.text*)
 	} >.sram
Signature · 1 line
2.36.0
Reviewed-by on v4 4/8
#21 lore raw

Re: [PATCH V4 4/8] armv8: u-boot-spl.lds: mark __image_copy_start as symbol

Quoted 11 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

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

Signature · 1 line
Tom
#22 lore raw

PATCH v4 5/8 tools: binman: section: replace @ with -

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

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.

---
 tools/binman/etype/section.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/binman/etype/section.py +1 -1
index bd67238b919..e3f362b442b 100644
@@ -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
Signature · 1 line
2.36.0
#23 lore raw

Re: [PATCH V4 5/8] tools: binman: section: replace @ with -

Quoted 9 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

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.

Quoted 6 lines
---
 tools/binman/etype/section.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

This shouldn't be necessary if you keep the old names for the binman entries and use binman_sym_declare(ulong, imem_1d, image_pos); etc. for the symbols.

tools/binman/etype/section.py class Entry_section(Entry): · line 878

Quoted 10 lines
tools/binman/etype/section.py +1 -1
index bd67238b919..e3f362b442b 100644
@@ -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

The correct place to do this would be LookupSymbol() in binman/etype/section.py, but I'm not convinced this should be done at all. I'd say if an entry is important enough to have a symbol for it, it should have a unique, descriptive, non-@ name.

Quoted 3 lines
tools/binman/etype/section.py +0 -0
     def MissingArgs(self, entry, missing):
         """Report a missing argument, if enabled
#24 lore raw

RE: [PATCH V4 5/8] tools: binman: section: replace @ with -

Quoted 19 lines

Subject: Re: [PATCH V4 5/8] tools: binman: section: replace @ with -

Quoted 9 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

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.

Quoted 6 lines
---
 tools/binman/etype/section.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 3 lines

This shouldn't be necessary if you keep the old names for the binman entries and use binman_sym_declare(ulong, imem_1d, image_pos); etc. for the symbols.

No, as I replied in the other mail, imem_1d is not a binman type.

Quoted 16 lines

tools/binman/etype/section.py class Entry_section(Entry): · line 878

Quoted 11 lines
(quoted diff) +0 -0

b/tools/binman/etype/section.py index bd67238b919..e3f362b442b 100644

tools/binman/etype/section.py +1 -1
@@ -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

The correct place to do this would be LookupSymbol() in binman/etype/section.py, but I'm not convinced this should be done at all. I'd say if an entry is important enough to have a symbol for it, it should have a unique, descriptive, non-@ name.

Since blob_ext@[1,2,3] is used, this is to replace and generate symbols as blob_ext_[1,2,3]

Thanks,
Peng.

Quoted 4 lines
Quoted 4 lines
tools/binman/etype/section.py +0 -0
     def MissingArgs(self, entry, missing):
         """Report a missing argument, if enabled
#25 lore raw

PATCH v4 6/8 ddr: imx8m: helper: load ddr firmware according to binman symbols

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

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.

---
 drivers/ddr/imx/imx8m/helper.c | 51 ++++++++++++++++++++++++++++------
 1 file changed, 43 insertions(+), 8 deletions(-)
drivers/ddr/imx/imx8m/helper.c +43 -8
index f23904bf712..b3bd57531b7 100644
@@ -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, blob_ext_1, image_pos);
+binman_sym_declare(ulong, blob_ext_1, size);
+
+binman_sym_declare(ulong, blob_ext_2, image_pos);
+binman_sym_declare(ulong, blob_ext_2, size);
+
+#if !IS_ENABLED(CONFIG_IMX8M_DDR3L)
+binman_sym_declare(ulong, blob_ext_3, image_pos);
+binman_sym_declare(ulong, blob_ext_3, size);
+
+binman_sym_declare(ulong, blob_ext_4, image_pos);
+binman_sym_declare(ulong, blob_ext_4, 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;
+	if (CONFIG_IS_ENABLED(BINMAN_SYMBOLS)) {
+		switch (type) {
+		case FW_1D_IMAGE:
+			imem_start = binman_sym(ulong, blob_ext_1, image_pos);
+			imem_len = binman_sym(ulong, blob_ext_1, size);
+			dmem_start = binman_sym(ulong, blob_ext_2, image_pos);
+			dmem_len = binman_sym(ulong, blob_ext_2, size);
+			break;
+		case FW_2D_IMAGE:
+#if !IS_ENABLED(CONFIG_IMX8M_DDR3L)
+			imem_start = binman_sym(ulong, blob_ext_3, image_pos);
+			imem_len = binman_sym(ulong, blob_ext_3, size);
+			dmem_start = binman_sym(ulong, blob_ext_4, image_pos);
+			dmem_len = binman_sym(ulong, blob_ext_4, size);
+#endif
+			break;
+		}
+	}
+
+	dmem_start = imem_start + imem_len;
 
 	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);
Signature · 1 line
2.36.0
#26 lore raw

Re: [PATCH V4 6/8] ddr: imx8m: helper: load ddr firmware according to binman symbols

Quoted 33 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

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.

---
 drivers/ddr/imx/imx8m/helper.c | 51 ++++++++++++++++++++++++++++------
 1 file changed, 43 insertions(+), 8 deletions(-)
drivers/ddr/imx/imx8m/helper.c +5 -0
index f23904bf712..b3bd57531b7 100644
@@ -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, blob_ext_1, image_pos);
+binman_sym_declare(ulong, blob_ext_1, size);
+
+binman_sym_declare(ulong, blob_ext_2, image_pos);

drivers/ddr/imx/imx8m/helper.c DECLARE_GLOBAL_DATA_PTR; · line 42

Quoted 10 lines
drivers/ddr/imx/imx8m/helper.c +10 -0
+binman_sym_declare(ulong, blob_ext_2, size);
+
+#if !IS_ENABLED(CONFIG_IMX8M_DDR3L)
+binman_sym_declare(ulong, blob_ext_3, image_pos);
+binman_sym_declare(ulong, blob_ext_3, size);
+
+binman_sym_declare(ulong, blob_ext_4, image_pos);
+binman_sym_declare(ulong, blob_ext_4, size);
+#endif
+

(Descriptive entry names would make these more meaningful.)

Quoted 31 lines
drivers/ddr/imx/imx8m/helper.c +14 -4
 /* 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;
+	if (CONFIG_IS_ENABLED(BINMAN_SYMBOLS)) {
+		switch (type) {
+		case FW_1D_IMAGE:
+			imem_start = binman_sym(ulong, blob_ext_1, image_pos);
+			imem_len = binman_sym(ulong, blob_ext_1, size);
+			dmem_start = binman_sym(ulong, blob_ext_2, image_pos);
+			dmem_len = binman_sym(ulong, blob_ext_2, size);
+			break;
+		case FW_2D_IMAGE:
+#if !IS_ENABLED(CONFIG_IMX8M_DDR3L)

drivers/ddr/imx/imx8m/helper.c void ddr_load_train_firmware(enum fw_type type) · line 81

Quoted 10 lines
drivers/ddr/imx/imx8m/helper.c +10 -0
+			imem_start = binman_sym(ulong, blob_ext_3, image_pos);
+			imem_len = binman_sym(ulong, blob_ext_3, size);
+			dmem_start = binman_sym(ulong, blob_ext_4, image_pos);
+			dmem_len = binman_sym(ulong, blob_ext_4, size);
+#endif
+			break;
+		}
+	}
+
+	dmem_start = imem_start + imem_len;

This overwrites the values from binman symbols, which looks wrong to me. I think this line should appear before the if block.

Quoted 35 lines
drivers/ddr/imx/imx8m/helper.c +4 -4
 	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);
#27 lore raw

RE: [PATCH V4 6/8] ddr: imx8m: helper: load ddr firmware according to binman symbols

Quoted 87 lines

Subject: Re: [PATCH V4 6/8] ddr: imx8m: helper: load ddr firmware according to binman symbols

Quoted 4 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

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.

Quoted 5 lines

And that could save binary size for many KBs.

Quoted 7 lines
---
 drivers/ddr/imx/imx8m/helper.c | 51
++++++++++++++++++++++++++++------
 1 file changed, 43 insertions(+), 8 deletions(-)
(quoted diff) +0 -0

b/drivers/ddr/imx/imx8m/helper.c index f23904bf712..b3bd57531b7

100644

drivers/ddr/imx/imx8m/helper.c DECLARE_GLOBAL_DATA_PTR; #define

Quoted 11 lines
drivers/ddr/imx/imx8m/helper.c +1 -0
@@ -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

Quoted 6 lines

0x00054000 #define DDR_TRAIN_CODE_BASE_ADDR
IP2APB_DDRPHY_IPS_BASE_ADDR(0)

drivers/ddr/imx/imx8m/helper.c +3 -0
+binman_sym_declare(ulong, blob_ext_1, image_pos);
+binman_sym_declare(ulong, blob_ext_1, size);
+

drivers/ddr/imx/imx8m/helper.c DECLARE_GLOBAL_DATA_PTR; · line 42

Quoted 10 lines
drivers/ddr/imx/imx8m/helper.c +10 -0
+binman_sym_declare(ulong, blob_ext_2, image_pos);
+binman_sym_declare(ulong, blob_ext_2, size);
+
+#if !IS_ENABLED(CONFIG_IMX8M_DDR3L)
+binman_sym_declare(ulong, blob_ext_3, image_pos);
+binman_sym_declare(ulong, blob_ext_3, size);
+
+binman_sym_declare(ulong, blob_ext_4, image_pos);
+binman_sym_declare(ulong, blob_ext_4, size); #endif
+

(Descriptive entry names would make these more meaningful.)

Quoted 34 lines

/* We need PHY iMEM PHY is 32KB padded */ void
ddr_load_train_firmware(enum fw_type type) {

drivers/ddr/imx/imx8m/helper.c +19 -4
 	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;
+	if (CONFIG_IS_ENABLED(BINMAN_SYMBOLS)) {
+		switch (type) {
+		case FW_1D_IMAGE:
+			imem_start = binman_sym(ulong, blob_ext_1, image_pos);
+			imem_len = binman_sym(ulong, blob_ext_1, size);
+			dmem_start = binman_sym(ulong, blob_ext_2, image_pos);
+			dmem_len = binman_sym(ulong, blob_ext_2, size);
+			break;
+		case FW_2D_IMAGE:
+#if !IS_ENABLED(CONFIG_IMX8M_DDR3L)
+			imem_start = binman_sym(ulong, blob_ext_3, image_pos);
+			imem_len = binman_sym(ulong, blob_ext_3, size);
+			dmem_start = binman_sym(ulong, blob_ext_4, image_pos);
+			dmem_len = binman_sym(ulong, blob_ext_4, size); #endif
Quoted 8 lines

drivers/ddr/imx/imx8m/helper.c void ddr_load_train_firmware(enum fw_type type) · line 81

Quoted 5 lines
drivers/ddr/imx/imx8m/helper.c +5 -0
+			break;
+		}
+	}
+
+	dmem_start = imem_start + imem_len;

This overwrites the values from binman symbols, which looks wrong to me. I think this line should appear before the if block.

It does not matter actually. Put it before if block is ok.

Regards,
Peng.

Quoted 37 lines
Quoted 19 lines
drivers/ddr/imx/imx8m/helper.c +2 -2
 	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;

drivers/ddr/imx/imx8m/helper.c void ddr_load_train_firmware(enum fw_type type) · line 113

Quoted 8 lines
drivers/ddr/imx/imx8m/helper.c +1 -1
@@ -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

@@

Quoted 9 lines

void ddr_load_train_firmware(enum fw_type type)

drivers/ddr/imx/imx8m/helper.c +1 -1
 	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);
#28 lore raw

PATCH v4 7/8 arm: dts: imx8m: shrink ddr firmware size to actual file size

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

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.

---
 arch/arm/dts/imx8mm-u-boot.dtsi                  | 8 ++++----
 arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi       | 8 ++++----
 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 ++++----
 9 files changed, 36 insertions(+), 36 deletions(-)
arch/arm/dts/imx8mm-u-boot.dtsi +4 -4
index 5de55a2d80b..19a2da30f51 100644
@@ -41,25 +41,25 @@
 
 		imem_1d: blob-ext@1 {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		dmem_1d: blob-ext@2 {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		imem_2d: blob-ext@3 {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		dmem_2d: blob-ext@4 {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 	};
arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi +4 -4
index eb1dd8debba..e1740fa31a6 100644
@@ -149,22 +149,22 @@
 
 		blob_1: blob-ext@1 {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 		};
 
 		blob_2: blob-ext@2 {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 		};
 
 		blob_3: blob-ext@3 {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 		};
 
 		blob_4: blob-ext@4 {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 		};
 	};
 
arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi +4 -4
index 4d0ecb07d4f..1fe2d0fd507 100644
@@ -157,22 +157,22 @@
 
 		blob_1: blob-ext@1 {
 			filename = "ddr4_imem_1d_201810.bin";
-			size = <0x8000>;
+			align-end = <4>;
 		};
 
 		blob_2: blob-ext@2 {
 			filename = "ddr4_dmem_1d_201810.bin";
-			size = <0x4000>;
+			align-end = <4>;
 		};
 
 		blob_3: blob-ext@3 {
 			filename = "ddr4_imem_2d_201810.bin";
-			size = <0x8000>;
+			align-end = <4>;
 		};
 
 		blob_4: blob-ext@4 {
 			filename = "ddr4_dmem_2d_201810.bin";
-			size = <0x4000>;
+			align-end = <4>;
 		};
 	};
 
arch/arm/dts/imx8mn-evk-u-boot.dtsi +4 -4
index 3db46d4cbcb..4f6dcf307b2 100644
@@ -38,22 +38,22 @@
 
 		blob_1: blob-ext@1 {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 		};
 
 		blob_2: blob-ext@2 {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 		};
 
 		blob_3: blob-ext@3 {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 		};
 
 		blob_4: blob-ext@4 {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 		};
 	};
 
arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi +4 -4
index 001e725f568..32ef7929288 100644
@@ -132,25 +132,25 @@
 
 		blob_1: blob-ext@1 {
 			filename = "ddr4_imem_1d.bin";
-			size = <0x8000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		blob_2: blob-ext@2 {
 			filename = "ddr4_dmem_1d.bin";
-			size = <0x4000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		blob_3: blob-ext@3 {
 			filename = "ddr4_imem_2d.bin";
-			size = <0x8000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		blob_4: blob-ext@4 {
 			filename = "ddr4_dmem_2d.bin";
-			size = <0x4000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 	};
arch/arm/dts/imx8mn-venice-u-boot.dtsi +4 -4
index 67922146963..e3a0b170347 100644
@@ -128,25 +128,25 @@
 
 		imem_1d: blob-ext@1 {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		dmem_1d: blob-ext@2 {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		imem_2d: blob-ext@3 {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		dmem_2d: blob-ext@4 {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 	};
arch/arm/dts/imx8mp-u-boot.dtsi +4 -4
index 20edd90cfad..274515a010e 100644
@@ -63,22 +63,22 @@
 
 		blob_1: blob-ext@1 {
 			filename = "lpddr4_pmu_train_1d_imem_202006.bin";
-			size = <0x8000>;
+			align-end = <4>;
 		};
 
 		blob_2: blob-ext@2 {
 			filename = "lpddr4_pmu_train_1d_dmem_202006.bin";
-			size = <0x4000>;
+			align-end = <4>;
 		};
 
 		blob_3: blob-ext@3 {
 			filename = "lpddr4_pmu_train_2d_imem_202006.bin";
-			size = <0x8000>;
+			align-end = <4>;
 		};
 
 		blob_4: blob-ext@4 {
 			filename = "lpddr4_pmu_train_2d_dmem_202006.bin";
-			size = <0x4000>;
+			align-end = <4>;
 		};
 	};
 
arch/arm/dts/imx8mq-cm-u-boot.dtsi +4 -4
index e2f4b0e740d..9538a04ed97 100644
@@ -30,22 +30,22 @@
 
 		blob_1: blob-ext@1 {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 		};
 
 		blob_2: blob-ext@2 {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 		};
 
 		blob_3: blob-ext@3 {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 		};
 
 		blob_4: blob-ext@4 {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 		};
 	};
 
arch/arm/dts/imx8mq-u-boot.dtsi +4 -4
index 389414ad26f..1495869fcd2 100644
@@ -48,25 +48,25 @@
 
 		imem_1d: blob-ext@1 {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		dmem_1d: blob-ext@2 {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		imem_2d: blob-ext@3 {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		dmem_2d: blob-ext@4 {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 	};
Signature · 1 line
2.36.0
#29 lore raw

Re: [PATCH V4 7/8] arm: dts: imx8m: shrink ddr firmware size to actual file size

Quoted 8 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

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.

Quoted 10 lines
---
 arch/arm/dts/imx8mm-u-boot.dtsi                  | 8 ++++----
 arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi       | 8 ++++----
 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 ++++----

Probably can be done for 'imx8mn-bsh-smm-s2-u-boot-common.dtsi' as well.

Quoted 293 lines
 9 files changed, 36 insertions(+), 36 deletions(-)
arch/arm/dts/imx8mm-u-boot.dtsi +4 -4
index 5de55a2d80b..19a2da30f51 100644
@@ -41,25 +41,25 @@
 
 		imem_1d: blob-ext@1 {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		dmem_1d: blob-ext@2 {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		imem_2d: blob-ext@3 {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		dmem_2d: blob-ext@4 {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 	};
arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi +4 -4
index eb1dd8debba..e1740fa31a6 100644
@@ -149,22 +149,22 @@
 
 		blob_1: blob-ext@1 {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 		};
 
 		blob_2: blob-ext@2 {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 		};
 
 		blob_3: blob-ext@3 {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 		};
 
 		blob_4: blob-ext@4 {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 		};
 	};
 
arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi +4 -4
index 4d0ecb07d4f..1fe2d0fd507 100644
@@ -157,22 +157,22 @@
 
 		blob_1: blob-ext@1 {
 			filename = "ddr4_imem_1d_201810.bin";
-			size = <0x8000>;
+			align-end = <4>;
 		};
 
 		blob_2: blob-ext@2 {
 			filename = "ddr4_dmem_1d_201810.bin";
-			size = <0x4000>;
+			align-end = <4>;
 		};
 
 		blob_3: blob-ext@3 {
 			filename = "ddr4_imem_2d_201810.bin";
-			size = <0x8000>;
+			align-end = <4>;
 		};
 
 		blob_4: blob-ext@4 {
 			filename = "ddr4_dmem_2d_201810.bin";
-			size = <0x4000>;
+			align-end = <4>;
 		};
 	};
 
arch/arm/dts/imx8mn-evk-u-boot.dtsi +4 -4
index 3db46d4cbcb..4f6dcf307b2 100644
@@ -38,22 +38,22 @@
 
 		blob_1: blob-ext@1 {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 		};
 
 		blob_2: blob-ext@2 {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 		};
 
 		blob_3: blob-ext@3 {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 		};
 
 		blob_4: blob-ext@4 {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 		};
 	};
 
arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi +4 -4
index 001e725f568..32ef7929288 100644
@@ -132,25 +132,25 @@
 
 		blob_1: blob-ext@1 {
 			filename = "ddr4_imem_1d.bin";
-			size = <0x8000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		blob_2: blob-ext@2 {
 			filename = "ddr4_dmem_1d.bin";
-			size = <0x4000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		blob_3: blob-ext@3 {
 			filename = "ddr4_imem_2d.bin";
-			size = <0x8000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		blob_4: blob-ext@4 {
 			filename = "ddr4_dmem_2d.bin";
-			size = <0x4000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 	};
arch/arm/dts/imx8mn-venice-u-boot.dtsi +4 -4
index 67922146963..e3a0b170347 100644
@@ -128,25 +128,25 @@
 
 		imem_1d: blob-ext@1 {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		dmem_1d: blob-ext@2 {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		imem_2d: blob-ext@3 {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		dmem_2d: blob-ext@4 {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 	};
arch/arm/dts/imx8mp-u-boot.dtsi +4 -4
index 20edd90cfad..274515a010e 100644
@@ -63,22 +63,22 @@
 
 		blob_1: blob-ext@1 {
 			filename = "lpddr4_pmu_train_1d_imem_202006.bin";
-			size = <0x8000>;
+			align-end = <4>;
 		};
 
 		blob_2: blob-ext@2 {
 			filename = "lpddr4_pmu_train_1d_dmem_202006.bin";
-			size = <0x4000>;
+			align-end = <4>;
 		};
 
 		blob_3: blob-ext@3 {
 			filename = "lpddr4_pmu_train_2d_imem_202006.bin";
-			size = <0x8000>;
+			align-end = <4>;
 		};
 
 		blob_4: blob-ext@4 {
 			filename = "lpddr4_pmu_train_2d_dmem_202006.bin";
-			size = <0x4000>;
+			align-end = <4>;
 		};
 	};
 
arch/arm/dts/imx8mq-cm-u-boot.dtsi +4 -4
index e2f4b0e740d..9538a04ed97 100644
@@ -30,22 +30,22 @@
 
 		blob_1: blob-ext@1 {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 		};
 
 		blob_2: blob-ext@2 {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 		};
 
 		blob_3: blob-ext@3 {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 		};
 
 		blob_4: blob-ext@4 {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 		};
 	};
 
arch/arm/dts/imx8mq-u-boot.dtsi +4 -4
index 389414ad26f..1495869fcd2 100644
@@ -48,25 +48,25 @@
 
 		imem_1d: blob-ext@1 {
 			filename = "lpddr4_pmu_train_1d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		dmem_1d: blob-ext@2 {
 			filename = "lpddr4_pmu_train_1d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		imem_2d: blob-ext@3 {
 			filename = "lpddr4_pmu_train_2d_imem.bin";
-			size = <0x8000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 
 		dmem_2d: blob-ext@4 {
 			filename = "lpddr4_pmu_train_2d_dmem.bin";
-			size = <0x4000>;
+			align-end = <4>;
 			type = "blob-ext";
 		};
 	};
#30 lore raw

Re: [PATCH V4 7/8] arm: dts: imx8m: shrink ddr firmware size to actual file size

Hi

Il lun 23 mag 2022, 23:13 Alper Nebi Yasak <[email protected]> ha scritto:

Quoted 20 lines · Peng Fan (OSS)
Quoted 8 lines

From: Peng Fan <[email protected]>

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.

Quoted 10 lines
---
 arch/arm/dts/imx8mm-u-boot.dtsi                  | 8 ++++----
 arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi       | 8 ++++----
 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 ++++----
Quoted 2 lines

Probably can be done for 'imx8mn-bsh-smm-s2-u-boot-common.dtsi' as well.

Let us test.

I did not find time

Michael

Quoted 304 lines

Review

Quoted 4 lines
 9 files changed, 36 insertions(+), 36 deletions(-)
(quoted diff) +0 -0

b/arch/arm/dts/imx8mm-u-boot.dtsi

Review

Quoted 34 lines

index 5de55a2d80b..19a2da30f51 100644

arch/arm/dts/imx8mm-u-boot.dtsi +4 -4
@@ -41,25 +41,25 @@
 
              imem_1d: blob-ext@1 {
                      filename = "lpddr4_pmu_train_1d_imem.bin";
-                     size = <0x8000>;
+                     align-end = <4>;
                      type = "blob-ext";
              };
 
              dmem_1d: blob-ext@2 {
                      filename = "lpddr4_pmu_train_1d_dmem.bin";
-                     size = <0x4000>;
+                     align-end = <4>;
                      type = "blob-ext";
              };
 
              imem_2d: blob-ext@3 {
                      filename = "lpddr4_pmu_train_2d_imem.bin";
-                     size = <0x8000>;
+                     align-end = <4>;
                      type = "blob-ext";
              };
 
              dmem_2d: blob-ext@4 {
                      filename = "lpddr4_pmu_train_2d_dmem.bin";
-                     size = <0x4000>;
+                     align-end = <4>;
                      type = "blob-ext";
              };
      };
(quoted diff) +0 -0

b/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi

Review

Quoted 31 lines

index eb1dd8debba..e1740fa31a6 100644

arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi +4 -4
@@ -149,22 +149,22 @@
 
              blob_1: blob-ext@1 {
                      filename = "lpddr4_pmu_train_1d_imem.bin";
-                     size = <0x8000>;
+                     align-end = <4>;
              };
 
              blob_2: blob-ext@2 {
                      filename = "lpddr4_pmu_train_1d_dmem.bin";
-                     size = <0x4000>;
+                     align-end = <4>;
              };
 
              blob_3: blob-ext@3 {
                      filename = "lpddr4_pmu_train_2d_imem.bin";
-                     size = <0x8000>;
+                     align-end = <4>;
              };
 
              blob_4: blob-ext@4 {
                      filename = "lpddr4_pmu_train_2d_dmem.bin";
-                     size = <0x4000>;
+                     align-end = <4>;
              };
      };
 
(quoted diff) +0 -0

b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi

Review

Quoted 31 lines

index 4d0ecb07d4f..1fe2d0fd507 100644

arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi +4 -4
@@ -157,22 +157,22 @@
 
              blob_1: blob-ext@1 {
                      filename = "ddr4_imem_1d_201810.bin";
-                     size = <0x8000>;
+                     align-end = <4>;
              };
 
              blob_2: blob-ext@2 {
                      filename = "ddr4_dmem_1d_201810.bin";
-                     size = <0x4000>;
+                     align-end = <4>;
              };
 
              blob_3: blob-ext@3 {
                      filename = "ddr4_imem_2d_201810.bin";
-                     size = <0x8000>;
+                     align-end = <4>;
              };
 
              blob_4: blob-ext@4 {
                      filename = "ddr4_dmem_2d_201810.bin";
-                     size = <0x4000>;
+                     align-end = <4>;
              };
      };
 
(quoted diff) +0 -0

b/arch/arm/dts/imx8mn-evk-u-boot.dtsi

Review

Quoted 31 lines

index 3db46d4cbcb..4f6dcf307b2 100644

arch/arm/dts/imx8mn-evk-u-boot.dtsi +4 -4
@@ -38,22 +38,22 @@
 
              blob_1: blob-ext@1 {
                      filename = "lpddr4_pmu_train_1d_imem.bin";
-                     size = <0x8000>;
+                     align-end = <4>;
              };
 
              blob_2: blob-ext@2 {
                      filename = "lpddr4_pmu_train_1d_dmem.bin";
-                     size = <0x4000>;
+                     align-end = <4>;
              };
 
              blob_3: blob-ext@3 {
                      filename = "lpddr4_pmu_train_2d_imem.bin";
-                     size = <0x8000>;
+                     align-end = <4>;
              };
 
              blob_4: blob-ext@4 {
                      filename = "lpddr4_pmu_train_2d_dmem.bin";
-                     size = <0x4000>;
+                     align-end = <4>;
              };
      };
 
(quoted diff) +0 -0

b/arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi

Review

Quoted 34 lines

index 001e725f568..32ef7929288 100644

arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi +4 -4
@@ -132,25 +132,25 @@
 
              blob_1: blob-ext@1 {
                      filename = "ddr4_imem_1d.bin";
-                     size = <0x8000>;
+                     align-end = <4>;
                      type = "blob-ext";
              };
 
              blob_2: blob-ext@2 {
                      filename = "ddr4_dmem_1d.bin";
-                     size = <0x4000>;
+                     align-end = <4>;
                      type = "blob-ext";
              };
 
              blob_3: blob-ext@3 {
                      filename = "ddr4_imem_2d.bin";
-                     size = <0x8000>;
+                     align-end = <4>;
                      type = "blob-ext";
              };
 
              blob_4: blob-ext@4 {
                      filename = "ddr4_dmem_2d.bin";
-                     size = <0x4000>;
+                     align-end = <4>;
                      type = "blob-ext";
              };
      };
(quoted diff) +0 -0

b/arch/arm/dts/imx8mn-venice-u-boot.dtsi

Review

Quoted 34 lines

index 67922146963..e3a0b170347 100644

arch/arm/dts/imx8mn-venice-u-boot.dtsi +4 -4
@@ -128,25 +128,25 @@
 
              imem_1d: blob-ext@1 {
                      filename = "lpddr4_pmu_train_1d_imem.bin";
-                     size = <0x8000>;
+                     align-end = <4>;
                      type = "blob-ext";
              };
 
              dmem_1d: blob-ext@2 {
                      filename = "lpddr4_pmu_train_1d_dmem.bin";
-                     size = <0x4000>;
+                     align-end = <4>;
                      type = "blob-ext";
              };
 
              imem_2d: blob-ext@3 {
                      filename = "lpddr4_pmu_train_2d_imem.bin";
-                     size = <0x8000>;
+                     align-end = <4>;
                      type = "blob-ext";
              };
 
              dmem_2d: blob-ext@4 {
                      filename = "lpddr4_pmu_train_2d_dmem.bin";
-                     size = <0x4000>;
+                     align-end = <4>;
                      type = "blob-ext";
              };
      };
(quoted diff) +0 -0

b/arch/arm/dts/imx8mp-u-boot.dtsi

Review

Quoted 31 lines

index 20edd90cfad..274515a010e 100644

arch/arm/dts/imx8mp-u-boot.dtsi +4 -4
@@ -63,22 +63,22 @@
 
              blob_1: blob-ext@1 {
                      filename = "lpddr4_pmu_train_1d_imem_202006.bin";
-                     size = <0x8000>;
+                     align-end = <4>;
              };
 
              blob_2: blob-ext@2 {
                      filename = "lpddr4_pmu_train_1d_dmem_202006.bin";
-                     size = <0x4000>;
+                     align-end = <4>;
              };
 
              blob_3: blob-ext@3 {
                      filename = "lpddr4_pmu_train_2d_imem_202006.bin";
-                     size = <0x8000>;
+                     align-end = <4>;
              };
 
              blob_4: blob-ext@4 {
                      filename = "lpddr4_pmu_train_2d_dmem_202006.bin";
-                     size = <0x4000>;
+                     align-end = <4>;
              };
      };
 
(quoted diff) +0 -0

b/arch/arm/dts/imx8mq-cm-u-boot.dtsi

Review

Quoted 31 lines

index e2f4b0e740d..9538a04ed97 100644

arch/arm/dts/imx8mq-cm-u-boot.dtsi +4 -4
@@ -30,22 +30,22 @@
 
              blob_1: blob-ext@1 {
                      filename = "lpddr4_pmu_train_1d_imem.bin";
-                     size = <0x8000>;
+                     align-end = <4>;
              };
 
              blob_2: blob-ext@2 {
                      filename = "lpddr4_pmu_train_1d_dmem.bin";
-                     size = <0x4000>;
+                     align-end = <4>;
              };
 
              blob_3: blob-ext@3 {
                      filename = "lpddr4_pmu_train_2d_imem.bin";
-                     size = <0x8000>;
+                     align-end = <4>;
              };
 
              blob_4: blob-ext@4 {
                      filename = "lpddr4_pmu_train_2d_dmem.bin";
-                     size = <0x4000>;
+                     align-end = <4>;
              };
      };
 
(quoted diff) +0 -0

b/arch/arm/dts/imx8mq-u-boot.dtsi

Quoted 33 lines

index 389414ad26f..1495869fcd2 100644

arch/arm/dts/imx8mq-u-boot.dtsi +4 -4
@@ -48,25 +48,25 @@
 
              imem_1d: blob-ext@1 {
                      filename = "lpddr4_pmu_train_1d_imem.bin";
-                     size = <0x8000>;
+                     align-end = <4>;
                      type = "blob-ext";
              };
 
              dmem_1d: blob-ext@2 {
                      filename = "lpddr4_pmu_train_1d_dmem.bin";
-                     size = <0x4000>;
+                     align-end = <4>;
                      type = "blob-ext";
              };
 
              imem_2d: blob-ext@3 {
                      filename = "lpddr4_pmu_train_2d_imem.bin";
-                     size = <0x8000>;
+                     align-end = <4>;
                      type = "blob-ext";
              };
 
              dmem_2d: blob-ext@4 {
                      filename = "lpddr4_pmu_train_2d_dmem.bin";
-                     size = <0x4000>;
+                     align-end = <4>;
                      type = "blob-ext";
              };
      };
#31 lore raw

PATCH v4 8/8 binman_sym: guard with CONFIG_SPL_BINMAN_SYMBOLS

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

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.

---
 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(-)
include/binman_sym.h +1 -1
index 72e6765fe52..548d8f5654c 100644
@@ -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
tools/binman/test/u_boot_binman_syms.c +1 -0
index 37fc339ce84..f4a4d1f6846 100644
@@ -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);
tools/binman/test/u_boot_binman_syms_size.c +1 -0
index 7224bc1863c..3a01d8ca4be 100644
@@ -6,6 +6,7 @@
  */
 
 #define CONFIG_BINMAN
+#define CONFIG_SPL_BINMAN_SYMBOLS
 #include <binman_sym.h>
 
 binman_sym_declare(char, u_boot_spl, pos);
Signature · 1 line
2.36.0
#32 lore raw

Re: [PATCH V4 8/8] binman_sym: guard with CONFIG_SPL_BINMAN_SYMBOLS

Quoted 6 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

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.

I guess they should be CONFIG_IS_ENABLED(BINMAN_SYMBOLS) instead, as there's also a CONFIG_TPL_BINMAN_SYMBOLS.

Quoted 46 lines
---
 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(-)
include/binman_sym.h +1 -1
index 72e6765fe52..548d8f5654c 100644
@@ -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
tools/binman/test/u_boot_binman_syms.c +1 -0
index 37fc339ce84..f4a4d1f6846 100644
@@ -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);
tools/binman/test/u_boot_binman_syms_size.c +1 -0
index 7224bc1863c..3a01d8ca4be 100644
@@ -6,6 +6,7 @@
  */
 
 #define CONFIG_BINMAN
+#define CONFIG_SPL_BINMAN_SYMBOLS
 #include <binman_sym.h>
 
 binman_sym_declare(char, u_boot_spl, pos);
#33 lore raw

RE: [PATCH V4 8/8] binman_sym: guard with CONFIG_SPL_BINMAN_SYMBOLS

Quoted 6 lines

Subject: Re: [PATCH V4 8/8] binman_sym: guard with CONFIG_SPL_BINMAN_SYMBOLS

Quoted 2 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

Quoted 7 lines
Quoted 4 lines

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.

I guess they should be CONFIG_IS_ENABLED(BINMAN_SYMBOLS) instead, as there's also a CONFIG_TPL_BINMAN_SYMBOLS.

No. CONFIG_IS_ENABLED not work, because there is no defconfig generated.

Regards,
Peng.

Quoted 49 lines
Quoted 49 lines
---
 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(-)
include/binman_sym.h index renamed from include/binman_sym.h +0 -0

72e6765fe52..548d8f5654c 100644

include/binman_sym.h +1 -1
@@ -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
tools/binman/test/u_boot_binman_syms.c +1 -0
index 37fc339ce84..f4a4d1f6846 100644
@@ -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

tools/binman/test/u_boot_binman_syms_size.c +1 -0
@@ -6,6 +6,7 @@
  */
 
 #define CONFIG_BINMAN
+#define CONFIG_SPL_BINMAN_SYMBOLS
 #include <binman_sym.h>
 
 binman_sym_declare(char, u_boot_spl, pos);