Skip to contentSkip to conversation

Add DYNAMIC_CRC_TABLE to am335x_evm

PATCH New Faiz Abbas 2 participants 5 messages Feb 6, 2018 – Feb 15, 2018 Library code

lore
Share & tools
lore

Faiz Abbas

author
#0 lore raw

cover Add DYNAMIC_CRC_TABLE to am335x_evm

The spl image when built for am335x_evm_defconfig exceeds the maximum sram size when new functionality is added. The following patches are part of an effort to reduce the size.

Faiz Abbas (2):
lib: Kconfig: Move DYNAMIC_CRC_TABLE to Kconfig
configs: am335x_evm: Add DYNAMIC_CRC_TABLE

 configs/am335x_evm_defconfig | 1 +
 include/configs/am335x_evm.h | 2 --
 lib/Kconfig                  | 6 ++++++
 lib/crc32.c                  | 6 +++---
 4 files changed, 10 insertions(+), 5 deletions(-)
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 1/2 lib: Kconfig: Move DYNAMIC_CRC_TABLE to Kconfig

Add CONFIG prefix to DYNAMIC_CRC_TABLE and implement it in Kconfig.

---
 lib/Kconfig | 6 ++++++
 lib/crc32.c | 6 +++---
 2 files changed, 9 insertions(+), 3 deletions(-)
lib/Kconfig +6 -0
index 710deb7..f76656b 100644
@@ -15,6 +15,12 @@ config CC_OPTIMIZE_LIBS_FOR_SPEED
 
 	  If unsure, say N.
 
+config DYNAMIC_CRC_TABLE
+	bool "Enable Dynamic tables for CRC"
+	help
+	  Enable this option to calculate entries for CRC tables at runtime.
+	  This can be helpful when reducing the size of the build image
+
 config HAVE_PRIVATE_LIBGCC
 	bool
 
lib/crc32.c +3 -3
index 9759212..7f545fd 100644
@@ -26,7 +26,7 @@
 
 #define tole(x) cpu_to_le32(x)
 
-#ifdef DYNAMIC_CRC_TABLE
+#ifdef CONFIG_DYNAMIC_CRC_TABLE
 
 local int crc_table_empty = 1;
 local uint32_t crc_table[256];
@@ -157,7 +157,7 @@ tole(0xb40bbe37L), tole(0xc30c8ea1L), tole(0x5a05df1bL), tole(0x2d02ef8dL)
  */
 const uint32_t * ZEXPORT get_crc_table()
 {
-#ifdef DYNAMIC_CRC_TABLE
+#ifdef CONFIG_DYNAMIC_CRC_TABLE
   if (crc_table_empty) make_crc_table();
 #endif
   return (const uint32_t *)crc_table;
@@ -181,7 +181,7 @@ uint32_t ZEXPORT crc32_no_comp(uint32_t crc, const Bytef *buf, uInt len)
     const uint32_t *tab = crc_table;
     const uint32_t *b =(const uint32_t *)buf;
     size_t rem_len;
-#ifdef DYNAMIC_CRC_TABLE
+#ifdef CONFIG_DYNAMIC_CRC_TABLE
     if (crc_table_empty)
       make_crc_table();
 #endif
Signature · 1 line
2.7.4
#2 lore raw

PATCH 1/2 lib: Kconfig: Move DYNAMIC_CRC_TABLE to Kconfig

Quoted 4 lines · Faiz Abbas

Add CONFIG prefix to DYNAMIC_CRC_TABLE and implement it in Kconfig.

Applied to u-boot/master, 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/20180215/ec73460e/attachment.sig>
author
#3 lore raw

PATCH 2/2 configs: am335x_evm: Add DYNAMIC_CRC_TABLE

In reply to Faiz Abbas

Add CONFIG_DYNAMIC_CRC_TABLE to am335x_evm_defconfig to reduce the size of the image.

---
 configs/am335x_evm_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/am335x_evm_defconfig +1 -0
index 8f33c8e..10b66e9 100644
@@ -56,6 +56,7 @@ CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0451
 CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
 CONFIG_USB_ETHER=y
+CONFIG_DYNAMIC_CRC_TABLE=y
 CONFIG_RSA=y
 CONFIG_LZO=y
 CONFIG_OF_LIBFDT_OVERLAY=y
Signature · 1 line
2.7.4
#4 lore raw

PATCH 2/2 configs: am335x_evm: Add DYNAMIC_CRC_TABLE

Quoted 4 lines · Faiz Abbas

Add CONFIG_DYNAMIC_CRC_TABLE to am335x_evm_defconfig to reduce the size of the image.

Applied to u-boot/master, 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/20180215/e4a11038/attachment.sig>