Skip to contentSkip to conversation

am335x_hs_evm: Trim options in SPL to reduce binary size

PATCH New Tom Rini 3 participants 6 messages Dec 17, 2017 – Dec 21, 2017

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 am335x_hs_evm: Trim options in SPL to reduce binary size

The am335x_hs_evm runs into size constraint problems at times with various toolchains as changes come in due to the config have a large number of options in SPL (to showcase what is possible) while also having rather constrained binary limits. Gain some of this room back by lowering the loglevel, disabling HW partition support and switching over to the tiny FIT image support.

Cc Andrew F. Davis <[email protected]>

---
I'd really appreciate a run-time test of this patch if at all possible as I'm a little worried about TINY_FIT being incompatible with all of the security options. Thanks!

---
 configs/am335x_hs_evm_defconfig | 4 ++++
 1 file changed, 4 insertions(+)
configs/am335x_hs_evm_defconfig +4 -0
index 48b0e8583997..8eb304686dc7 100644
@@ -13,10 +13,12 @@ CONFIG_ANDROID_BOOT_IMAGE=y
 CONFIG_FIT_IMAGE_POST_PROCESS=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
+CONFIG_LOGLEVEL=3
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_ARCH_MISC_INIT=y
 CONFIG_SPL=y
+CONFIG_SPL_FIT_IMAGE_TINY=y
 # CONFIG_SPL_ENV_SUPPORT is not set
 # CONFIG_SPL_EXT_SUPPORT is not set
 CONFIG_SPL_MTD_SUPPORT=y
@@ -37,6 +39,7 @@ CONFIG_DFU_RAM=y
 CONFIG_DM_I2C=y
 CONFIG_MISC=y
 CONFIG_DM_MMC=y
+# CONFIG_MMC_HW_PARTITIONING is not set
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
 CONFIG_NAND_OMAP_GPMC_PREFETCH=y
@@ -61,5 +64,6 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0451
 CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_ETHER=y
+CONFIG_SPL_TINY_MEMSET=y
 CONFIG_RSA=y
 CONFIG_LZO=y
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 1/1 am335x_hs_evm: Trim options in SPL to reduce binary size

Quoted 9 lines · Tom Rini

The am335x_hs_evm runs into size constraint problems at times with various toolchains as changes come in due to the config have a large number of options in SPL (to showcase what is possible) while also having rather constrained binary limits. Gain some of this room back by lowering the loglevel, disabling HW partition support and switching over to the tiny FIT image support.

Cc Andrew F. Davis <[email protected]>

Applied to u-boot/next (so if there's problems, we'll re-work it), thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171218/f872e518/attachment.sig>
#2 lore raw

PATCH 1/1 am335x_hs_evm: Trim options in SPL to reduce binary size

In reply to Tom Rini
Quoted 35 lines · Tom Rini

The am335x_hs_evm runs into size constraint problems at times with various toolchains as changes come in due to the config have a large number of options in SPL (to showcase what is possible) while also having rather constrained binary limits. Gain some of this room back by lowering the loglevel, disabling HW partition support and switching over to the tiny FIT image support.

Cc Andrew F. Davis <[email protected]>

---
I'd really appreciate a run-time test of this patch if at all possible as I'm a little worried about TINY_FIT being incompatible with all of the security options. Thanks!

---
 configs/am335x_hs_evm_defconfig | 4 ++++
 1 file changed, 4 insertions(+)
configs/am335x_hs_evm_defconfig +2 -0
index 48b0e8583997..8eb304686dc7 100644
@@ -13,10 +13,12 @@ CONFIG_ANDROID_BOOT_IMAGE=y
 CONFIG_FIT_IMAGE_POST_PROCESS=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
+CONFIG_LOGLEVEL=3
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_ARCH_MISC_INIT=y
 CONFIG_SPL=y
+CONFIG_SPL_FIT_IMAGE_TINY=y
 # CONFIG_SPL_ENV_SUPPORT is not set
 # CONFIG_SPL_EXT_SUPPORT is not set
 CONFIG_SPL_MTD_SUPPORT=y

configs/am335x_hs_evm_defconfig CONFIG_DFU_RAM=y · line 42

Quoted 4 lines
configs/am335x_hs_evm_defconfig +1 -0
@@ -37,6 +39,7 @@ CONFIG_DFU_RAM=y
 CONFIG_DM_I2C=y
 CONFIG_MISC=y
 CONFIG_DM_MMC=y
+# CONFIG_MMC_HW_PARTITIONING is not set

I haven't gotten around to testing the FIT_IMAGE_TINY stuff yet, but conceptually I have a much bigger problem with this part.

Sacrificing functionality to allow continued SPL bloat is just wrong.

Whatever caused SPL to grow should be re-worked or the author should have also made some optimization elsewhere to offset this. Now I'll have to go hunt for more optimizations somewhere so I can get all my features back here :(

Quoted 11 lines
configs/am335x_hs_evm_defconfig +1 -0
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
 CONFIG_NAND_OMAP_GPMC_PREFETCH=y
@@ -61,5 +64,6 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0451
 CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_ETHER=y
+CONFIG_SPL_TINY_MEMSET=y
 CONFIG_RSA=y
 CONFIG_LZO=y
author
#3 lore raw

PATCH 1/1 am335x_hs_evm: Trim options in SPL to reduce binary size

Quoted 44 lines · Andrew F. Davis
Quoted 35 lines · Tom Rini

The am335x_hs_evm runs into size constraint problems at times with various toolchains as changes come in due to the config have a large number of options in SPL (to showcase what is possible) while also having rather constrained binary limits. Gain some of this room back by lowering the loglevel, disabling HW partition support and switching over to the tiny FIT image support.

Cc Andrew F. Davis <[email protected]>

---
I'd really appreciate a run-time test of this patch if at all possible as I'm a little worried about TINY_FIT being incompatible with all of the security options. Thanks!

---
 configs/am335x_hs_evm_defconfig | 4 ++++
 1 file changed, 4 insertions(+)
configs/am335x_hs_evm_defconfig +2 -0
index 48b0e8583997..8eb304686dc7 100644
@@ -13,10 +13,12 @@ CONFIG_ANDROID_BOOT_IMAGE=y
 CONFIG_FIT_IMAGE_POST_PROCESS=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
+CONFIG_LOGLEVEL=3
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_ARCH_MISC_INIT=y
 CONFIG_SPL=y
+CONFIG_SPL_FIT_IMAGE_TINY=y
 # CONFIG_SPL_ENV_SUPPORT is not set
 # CONFIG_SPL_EXT_SUPPORT is not set
 CONFIG_SPL_MTD_SUPPORT=y

configs/am335x_hs_evm_defconfig CONFIG_DFU_RAM=y · line 42

Quoted 4 lines
configs/am335x_hs_evm_defconfig +1 -0
@@ -37,6 +39,7 @@ CONFIG_DFU_RAM=y
 CONFIG_DM_I2C=y
 CONFIG_MISC=y
 CONFIG_DM_MMC=y
+# CONFIG_MMC_HW_PARTITIONING is not set

I haven't gotten around to testing the FIT_IMAGE_TINY stuff yet, but conceptually I have a much bigger problem with this part.

Quoted 6 lines

Sacrificing functionality to allow continued SPL bloat is just wrong.

Whatever caused SPL to grow should be re-worked or the author should have also made some optimization elsewhere to offset this. Now I'll have to go hunt for more optimizations somewhere so I can get all my features back here :(

FWIW, I don't think there was any functionality (aside from switching to FIT_IMAGE_TINY, but if that supports everything needed in this use-case...) that was removed exactly. But I see your point too. Jean-Jacques, was there anything else that could have been made configurable in your MMC work, that wasn't? Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171219/ccc7b23b/attachment.sig>
#4 lore raw

PATCH 1/1 am335x_hs_evm: Trim options in SPL to reduce binary size

Quoted 50 lines · Tom Rini
Quoted 43 lines · Andrew F. Davis
Quoted 35 lines · Tom Rini

The am335x_hs_evm runs into size constraint problems at times with various toolchains as changes come in due to the config have a large number of options in SPL (to showcase what is possible) while also having rather constrained binary limits. Gain some of this room back by lowering the loglevel, disabling HW partition support and switching over to the tiny FIT image support.

Cc Andrew F. Davis <[email protected]>

---
I'd really appreciate a run-time test of this patch if at all possible as I'm a little worried about TINY_FIT being incompatible with all of the security options. Thanks!

---
  configs/am335x_hs_evm_defconfig | 4 ++++
  1 file changed, 4 insertions(+)
configs/am335x_hs_evm_defconfig +2 -0
index 48b0e8583997..8eb304686dc7 100644
@@ -13,10 +13,12 @@ CONFIG_ANDROID_BOOT_IMAGE=y
  CONFIG_FIT_IMAGE_POST_PROCESS=y
  CONFIG_SPL_LOAD_FIT=y
  CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
+CONFIG_LOGLEVEL=3
  CONFIG_SYS_CONSOLE_INFO_QUIET=y
  CONFIG_VERSION_VARIABLE=y
  CONFIG_ARCH_MISC_INIT=y
  CONFIG_SPL=y
+CONFIG_SPL_FIT_IMAGE_TINY=y
  # CONFIG_SPL_ENV_SUPPORT is not set
  # CONFIG_SPL_EXT_SUPPORT is not set
  CONFIG_SPL_MTD_SUPPORT=y

configs/am335x_hs_evm_defconfig CONFIG_DFU_RAM=y · line 42

Quoted 4 lines
configs/am335x_hs_evm_defconfig +1 -0
@@ -37,6 +39,7 @@ CONFIG_DFU_RAM=y
  CONFIG_DM_I2C=y
  CONFIG_MISC=y
  CONFIG_DM_MMC=y
+# CONFIG_MMC_HW_PARTITIONING is not set

I haven't gotten around to testing the FIT_IMAGE_TINY stuff yet, but conceptually I have a much bigger problem with this part.

Quoted 6 lines

Sacrificing functionality to allow continued SPL bloat is just wrong.

Whatever caused SPL to grow should be re-worked or the author should have also made some optimization elsewhere to offset this. Now I'll have to go hunt for more optimizations somewhere so I can get all my features back here :(

Quoted 5 lines

FWIW, I don't think there was any functionality (aside from switching to FIT_IMAGE_TINY, but if that supports everything needed in this use-case...) that was removed exactly. But I see your point too. Jean-Jacques, was there anything else that could have been made configurable in your MMC work, that wasn't? Thanks!

I tried to make most of the new features optional. I'll try to scrap more bytes and will let you know

#5 lore raw

PATCH 1/1 am335x_hs_evm: Trim options in SPL to reduce binary size

Quoted 58 lines · Jean-Jacques Hiblot
Quoted 55 lines · Tom Rini
Quoted 54 lines · Andrew F. Davis
Quoted 38 lines · Tom Rini

The am335x_hs_evm runs into size constraint problems at times with various toolchains as changes come in due to the config have a large number of options in SPL (to showcase what is possible) while also having rather constrained binary limits.  Gain some of this room back by
lowering the loglevel, disabling HW partition support and switching over
to the tiny FIT image support.

Cc Andrew F. Davis <[email protected]>

---
I'd really appreciate a run-time test of this patch if at all possible as I'm a little worried about TINY_FIT being incompatible with all of the security options.  Thanks!
---
  configs/am335x_hs_evm_defconfig | 4 ++++

  1 file changed, 4 insertions(+)
configs/am335x_hs_evm_defconfig +0 -0
index 48b0e8583997..8eb304686dc7 100644
@@ -13,10 +13,12 @@ CONFIG_ANDROID_BOOT_IMAGE=y

  CONFIG_FIT_IMAGE_POST_PROCESS=y
  CONFIG_SPL_LOAD_FIT=y
  CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
+CONFIG_LOGLEVEL=3
  CONFIG_SYS_CONSOLE_INFO_QUIET=y
  CONFIG_VERSION_VARIABLE=y
  CONFIG_ARCH_MISC_INIT=y
  CONFIG_SPL=y
+CONFIG_SPL_FIT_IMAGE_TINY=y
  # CONFIG_SPL_ENV_SUPPORT is not set
  # CONFIG_SPL_EXT_SUPPORT is not set
  CONFIG_SPL_MTD_SUPPORT=y

configs/am335x_hs_evm_defconfig +0 -0
@@ -37,6 +39,7 @@ CONFIG_DFU_RAM=y
Quoted 4 lines

  CONFIG_DM_I2C=y
  CONFIG_MISC=y
  CONFIG_DM_MMC=y
+# CONFIG_MMC_HW_PARTITIONING is not set

I haven't gotten around to testing the FIT_IMAGE_TINY stuff yet, but conceptually I have a much bigger problem with this part.

Sacrificing functionality to allow continued SPL bloat is just wrong.

Whatever caused SPL to grow should be re-worked or the author should have also made some optimization elsewhere to offset this. Now I'll have
to go hunt for more optimizations somewhere so I can get all my features
back here :(

Quoted 7 lines
Quoted 5 lines

FWIW, I don't think there was any functionality (aside from switching to FIT_IMAGE_TINY, but if that supports everything needed in this use-case...) that was removed exactly.  But I see your point too. Jean-Jacques, was there anything else that could have been made configurable in your MMC work, that wasn't?  Thanks!

I tried to make most of the new features optional. I'll try to scrap more bytes and will let you know

FYI I've just sent a new series that trims the mmc core further.