mbox series

[0/7] arm64: binman: use binman symbols for imx

Message ID 20220507092143.17279-1-peng.fan@oss.nxp.com
Headers show
Series arm64: binman: use binman symbols for imx | expand

Message

Peng Fan (OSS) May 7, 2022, 9:21 a.m. UTC
From: Peng Fan <peng.fan@nxp.com>

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

Note: with this patchset, nxp downstream imx-mkimage will not work.
Later patches will follow up to address.

Peng Fan (7):
  spl: guard u_boot_any with X86
  arm: dts: imx8m: update binman ddr firmware node name
  armv8: u-boot-spl.lds: mark __image_copy_start as symbol
  binman_sym: update symbol alignment to 8 bytes
  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

 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   |  8 ++--
 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 +++----
 common/spl/spl.c                              |  8 +++-
 drivers/ddr/imx/imx8m/helper.c                | 45 ++++++++++++++++---
 include/binman_sym.h                          |  6 +--
 tools/binman/etype/section.py                 |  2 +-
 15 files changed, 101 insertions(+), 62 deletions(-)

Comments

Michael Nazzareno Trimarchi May 7, 2022, 9:32 a.m. UTC | #1
Hi Peng

On Sat, May 7, 2022 at 10:39 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>
> From: Peng Fan <peng.fan@nxp.com>
>
> 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
>
> Note: with this patchset, nxp downstream imx-mkimage will not work.
> Later patches will follow up to address.
>

First of all, thank you very much for this series. I will test on our
boards and let you know.

Michael

> Peng Fan (7):
>   spl: guard u_boot_any with X86
>   arm: dts: imx8m: update binman ddr firmware node name
>   armv8: u-boot-spl.lds: mark __image_copy_start as symbol
>   binman_sym: update symbol alignment to 8 bytes
>   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
>
>  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   |  8 ++--
>  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 +++----
>  common/spl/spl.c                              |  8 +++-
>  drivers/ddr/imx/imx8m/helper.c                | 45 ++++++++++++++++---
>  include/binman_sym.h                          |  6 +--
>  tools/binman/etype/section.py                 |  2 +-
>  15 files changed, 101 insertions(+), 62 deletions(-)
>
> --
> 2.36.0
>
Tom Rini May 7, 2022, 12:58 p.m. UTC | #2
On Sat, May 07, 2022 at 05:21:35PM +0800, Peng Fan (OSS) wrote:

> From: Peng Fan <peng.fan@nxp.com>
> 
> 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
> 
> Note: with this patchset, nxp downstream imx-mkimage will not work.
> Later patches will follow up to address.

I just want to say I am very happy to see this work happening.
Tim Harvey May 9, 2022, 5:27 p.m. UTC | #3
On Sat, May 7, 2022 at 1:39 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>
> From: Peng Fan <peng.fan@nxp.com>
>
> 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
>
> Note: with this patchset, nxp downstream imx-mkimage will not work.
> Later patches will follow up to address.
>
> Peng Fan (7):
>   spl: guard u_boot_any with X86
>   arm: dts: imx8m: update binman ddr firmware node name
>   armv8: u-boot-spl.lds: mark __image_copy_start as symbol
>   binman_sym: update symbol alignment to 8 bytes
>   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
>
>  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   |  8 ++--
>  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 +++----
>  common/spl/spl.c                              |  8 +++-
>  drivers/ddr/imx/imx8m/helper.c                | 45 ++++++++++++++++---
>  include/binman_sym.h                          |  6 +--
>  tools/binman/etype/section.py                 |  2 +-
>  15 files changed, 101 insertions(+), 62 deletions(-)
>

Peng,

Thank you for doing this, its something I've wanted to get in for a
long time now.

I can confirm this saves 39K in the IMX8M SPL.

Tested-by: Tim Harvey <tharvey@gateworks.com> #imx8mm-venice
#imx8mn-venice #imx8mp-venice

Best Regards,

Tim