Skip to contentSkip to conversation

spl: dfu: compilation fixes for spl-dfu

PATCH New Lukasz Majewski 2 participants 3 messages Apr 19, 2017 – Apr 20, 2017 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 spl: dfu: compilation fixes for spl-dfu

Hi Ravi,

Please add u-boot mailing list to CC, when sending patches.

Quoted 30 lines

This patch fixes the compilation error common/cli_hush.c:3349: undefined reference to 'realloc_simple'

The dfu does not depend on HUSH_PARSER. The dfu, fastboot uses run_command(), it is part of cli.c and use cli_simple_run_command().

---
 common/Makefile | 1 -
 common/cli.c    | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
common/Makefile +0 -1
index bcd2486..dc5cb1d 100644
@@ -90,7 +90,6 @@ endif # !CONFIG_SPL_BUILD
 
 ifdef CONFIG_SPL_BUILD
 obj-$(CONFIG_SPL_DFU_SUPPORT) += dfu.o
-obj-$(CONFIG_SPL_DFU_SUPPORT) += cli_hush.o
 obj-$(CONFIG_SPL_HASH_SUPPORT) += hash.o
 obj-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
 obj-$(CONFIG_SPL_YMODEM_SUPPORT) += xyzModem.o
common/cli.c +0 -0
index a433ef2..3dd4c2b 100644

common/cli.c DECLARE_GLOBAL_DATA_PTR; · line 34

Quoted 8 lines
common/cli.c +1 -1
@@ -28,7 +28,7 @@ DECLARE_GLOBAL_DATA_PTR;
  */
 int run_command(const char *cmd, int flag)
 {
-#ifndef CONFIG_HUSH_PARSER
+#if defined(CONFIG_SPL_BUILD) || !defined(CONFIG_HUSH_PARSER)
 	/*
 	 * cli_run_command can return 0 or 1 for success, so clean up
 	 * its result.

So for the initial support of the DFU in SPL you did not needed the HUSH parser.

What is the motivation to enable it now? Enabling the HUSH in SPL should make the binary even bigger - hence it is counterintuitive.

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de

#2 lore raw

PATCH 1/1 spl: dfu: compilation fixes for spl-dfu

Hi Lukasz

Quoted 27 lines
Quoted 20 lines
common/Makefile index bcd2486..dc5cb1d renamed from common/Makefile +0 -0

100644

common/Makefile +0 -1
@@ -90,7 +90,6 @@ endif # !CONFIG_SPL_BUILD
 
 ifdef CONFIG_SPL_BUILD
 obj-$(CONFIG_SPL_DFU_SUPPORT) += dfu.o
-obj-$(CONFIG_SPL_DFU_SUPPORT) += cli_hush.o
 obj-$(CONFIG_SPL_HASH_SUPPORT) += hash.o
 obj-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
 obj-$(CONFIG_SPL_YMODEM_SUPPORT) += xyzModem.o diff --git 

a/common/cli.c b/common/cli.c index a433ef2..3dd4c2b 100644

common/cli.c +0 -0
@@ -28,7 +28,7 @@ DECLARE_GLOBAL_DATA_PTR;
  */
 int run_command(const char *cmd, int flag)  { -#ifndef 

CONFIG_HUSH_PARSER

common/cli.c

Quoted 4 lines
common/cli.c +1 -0
+#if defined(CONFIG_SPL_BUILD) || !defined(CONFIG_HUSH_PARSER)
 	/*
 	 * cli_run_command can return 0 or 1 for success, so clean up
 	 * its result.

So for the initial support of the DFU in SPL you did not needed the HUSH parser.

Quoted 1 line

What is the motivation to enable it now? Enabling the HUSH in SPL should make the binary even bigger - hence it is counterintuitive.

The CONFIG_HUSH_PARSER is enabled in dra7xx_evm_defconfig by commit: adad96e: configs: Re-sync HUSH options Hence CONFIG_HUSH_PARSER included for both SPL and u-boot as well.
The cli.c is common for both SPL & u-boot.

Regards
Ravi

#3 lore raw

PATCH 1/1 spl: dfu: compilation fixes for spl-dfu

In reply to Lukasz Majewski

Hi Lukasz

Quoted 14 lines
Quoted 13 lines

common/cli.c

Quoted 11 lines

a/common/cli.c b/common/cli.c index a433ef2..3dd4c2b 100644

common/cli.c +0 -0
@@ -28,7 +28,7 @@ DECLARE_GLOBAL_DATA_PTR;
  */
 int run_command(const char *cmd, int flag)  { -#ifndef 

CONFIG_HUSH_PARSER

common/cli.c +1 -0
+#if defined(CONFIG_SPL_BUILD) || !defined(CONFIG_HUSH_PARSER)
 	/*
 	 * cli_run_command can return 0 or 1 for success, so clean up
 	 * its result.

So for the initial support of the DFU in SPL you did not needed the HUSH parser.

Quoted 4 lines
Quoted 1 line

What is the motivation to enable it now? Enabling the HUSH in SPL should make the binary even bigger - hence it is counterintuitive.

The CONFIG_HUSH_PARSER is enabled in dra7xx_evm_defconfig by commit: adad96e: configs: Re-sync HUSH options Hence CONFIG_HUSH_PARSER included for both SPL and u-boot as well. The cli.c is common for both SPL & u-boot.

Since by default HUSH_PARSER is defined for all *_evm_defconfigs, which affect for both SPL/U-Boot. There is no way to select simple_cli() in run_command(). I feel this would be simple solution to use CONFIG_SPL_BUILD. Even any Kconfig tweaks also would endup in similar way.

Let me know any alternate option.

Another point:
The SPL_DFU_SUPPORT is depends on SPL_RAM_SUPPORT. I will send separate patch to add the dependency in Kconfig selection that SPL_DFU_SUPPORT is selected only if SPL_RAM_SUPPORT is selected.

Thanks & Regards
Ravi