Commit e3c52f2b8779469c843eb79282396f1a5ca3fef5

Authored by Tom Rini
1 parent 46dc5bcade
Exists in master and in 55 other branches 8qm-imx_v2020.04_5.4.70_2.3.0, emb_lf_v2022.04, emb_lf_v2023.04, imx_v2015.04_4.1.15_1.0.0_ga, pitx_8mp_lf_v2020.04, smarc-8m-android-10.0.0_2.6.0, smarc-8m-android-11.0.0_2.0.0, smarc-8mp-android-11.0.0_2.0.0, smarc-emmc-imx_v2014.04_3.10.53_1.1.0_ga, smarc-emmc-imx_v2014.04_3.14.28_1.0.0_ga, smarc-imx-l5.0.0_1.0.0-ga, smarc-imx6_v2018.03_4.14.98_2.0.0_ga, smarc-imx7_v2017.03_4.9.11_1.0.0_ga, smarc-imx7_v2018.03_4.14.98_2.0.0_ga, smarc-imx_v2014.04_3.14.28_1.0.0_ga, smarc-imx_v2015.04_4.1.15_1.0.0_ga, smarc-imx_v2017.03_4.9.11_1.0.0_ga, smarc-imx_v2017.03_4.9.88_2.0.0_ga, smarc-imx_v2017.03_o8.1.0_1.3.0_8m, smarc-imx_v2018.03_4.14.78_1.0.0_ga, smarc-m6.0.1_2.1.0-ga, smarc-n7.1.2_2.0.0-ga, smarc-rel_imx_4.1.15_2.0.0_ga, smarc_8m-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8m-imx_v2019.04_4.19.35_1.1.0, smarc_8m_00d0-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8mm-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8mm-imx_v2019.04_4.19.35_1.1.0, smarc_8mm-imx_v2020.04_5.4.24_2.1.0, smarc_8mp_lf_v2020.04, smarc_8mq-imx_v2020.04_5.4.24_2.1.0, smarc_8mq_lf_v2020.04, ti-u-boot-2015.07, u-boot-2013.01.y, v2013.10, v2013.10-smarct33, v2013.10-smartmen, v2014.01, v2014.04, v2014.04-smarct33, v2014.04-smarct33-emmc, v2014.04-smartmen, v2014.07, v2014.07-smarct33, v2014.07-smartmen, v2015.07-smarct33, v2015.07-smarct33-emmc, v2015.07-smarct4x, v2016.05-dlt, v2016.05-smarct3x, v2016.05-smarct3x-emmc, v2016.05-smarct4x, v2017.01-smarct3x, v2017.01-smarct3x-emmc, v2017.01-smarct4x

Revert "fw_env: fix building w/out a config.h"

I had missed Joe's NAK on this patch, so...

This reverts commit 92ace272d06cec1d7f1533bb9edf914fb5845fba.

Signed-off-by: Tom Rini <trini@ti.com>

Showing 2 changed files with 26 additions and 10 deletions Side-by-side Diff

... ... @@ -26,7 +26,7 @@
26 26 HOSTSRCS := $(SRCTREE)/lib/crc32.c fw_env.c fw_env_main.c
27 27 HOSTSRCS += $(SRCTREE)/lib/ctype.c $(SRCTREE)/lib/linux_string.c
28 28 HOSTSRCS += $(SRCTREE)/common/env_attr.c $(SRCTREE)/common/env_flags.c
29   -HEADERS := fw_env.h
  29 +HEADERS := fw_env.h $(OBJTREE)/include/config.h
30 30  
31 31 # Compile for a hosted environment on the target
32 32 HOSTCPPFLAGS = -idirafter $(SRCTREE)/include \
... ... @@ -35,15 +35,6 @@
35 35 -idirafter $(SRCTREE)/tools/env \
36 36 -DUSE_HOSTCC \
37 37 -DTEXT_BASE=$(TEXT_BASE)
38   -
39   -# Pass CONFIG_xxx settings via the command line so that we can build w/out
40   -# a config.h file existing in the first place. Useful for generic builds.
41   -CONFIG_VARS_TO_PASS = \
42   - ENV_OVERWRITE \
43   - OVERWRITE_ETHADDR_ONCE \
44   - ETHADDR
45   -HOSTCPPFLAGS += \
46   - $(foreach x,$(CONFIG_VARS_TO_PASS),$(if $(CONFIG_$(x)),-DCONFIG_$(x)=$(CONFIG_$(x))))
47 38  
48 39 ifeq ($(MTD_VERSION),old)
49 40 HOSTCPPFLAGS += -DMTD_OLD
... ... @@ -21,6 +21,15 @@
21 21 * MA 02111-1307 USA
22 22 */
23 23  
  24 +/* Pull in the current config to define the default environment */
  25 +#ifndef __ASSEMBLY__
  26 +#define __ASSEMBLY__ /* get only #defines from config.h */
  27 +#include <config.h>
  28 +#undef __ASSEMBLY__
  29 +#else
  30 +#include <config.h>
  31 +#endif
  32 +
24 33 /*
25 34 * To build the utility with the static configuration
26 35 * comment out the next line.
... ... @@ -41,6 +50,22 @@
41 50 #define ENV2_SIZE 0x4000
42 51 #define DEVICE2_ESIZE 0x4000
43 52 #define DEVICE2_ENVSECTORS 2
  53 +#endif
  54 +
  55 +#ifndef CONFIG_BAUDRATE
  56 +#define CONFIG_BAUDRATE 115200
  57 +#endif
  58 +
  59 +#ifndef CONFIG_BOOTDELAY
  60 +#define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
  61 +#endif
  62 +
  63 +#ifndef CONFIG_BOOTCOMMAND
  64 +#define CONFIG_BOOTCOMMAND \
  65 + "bootp; " \
  66 + "setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} " \
  67 + "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; " \
  68 + "bootm"
44 69 #endif
45 70  
46 71 extern int fw_printenv(int argc, char *argv[]);