Commit e3c52f2b8779469c843eb79282396f1a5ca3fef5
1 parent
46dc5bcade
Exists in
master
and in
55 other branches
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
tools/env/Makefile
... | ... | @@ -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 |
tools/env/fw_env.h
... | ... | @@ -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[]); |