diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/buildman/kconfiglib.py | 42 | ||||
-rw-r--r-- | tools/env/fw_env.h | 3 | ||||
-rw-r--r-- | tools/ifdtool.c | 2 | ||||
-rw-r--r-- | tools/kwbimage.c | 22 | ||||
-rw-r--r-- | tools/kwboot.c | 14 |
5 files changed, 62 insertions, 21 deletions
diff --git a/tools/buildman/kconfiglib.py b/tools/buildman/kconfiglib.py index 655cf4470ff..c662b64dada 100644 --- a/tools/buildman/kconfiglib.py +++ b/tools/buildman/kconfiglib.py @@ -429,7 +429,15 @@ class Config(): If the environment variable 'srctree' was set when the Config was created, get_defconfig_filename() will first look relative to that directory before looking in the current directory; see - Config.__init__().""" + Config.__init__(). + + WARNING: A wart here is that scripts/kconfig/Makefile sometimes uses the + --defconfig=<defconfig> option when calling the C implementation of e.g. + 'make defconfig'. This option overrides the 'option defconfig_list' + symbol, meaning the result from get_defconfig_filename() might not + match what 'make defconfig' would use. That probably ought to be worked + around somehow, so that this function always gives the "expected" + result.""" if self.defconfig_sym is None: return None @@ -506,7 +514,7 @@ class Config(): For example, if FOO and BAR are tristate symbols at least one of which has the value "y", then config.eval("y && (FOO || BAR)") => "y" - This functions always yields a tristate value. To get the value of + This function always yields a tristate value. To get the value of non-bool, non-tristate symbols, use Symbol.get_value(). The result of this function is consistent with how evaluation works for @@ -1066,7 +1074,7 @@ class Config(): choice.block = self._parse_block(line_feeder, T_ENDCHOICE, choice, - None, + deps, visible_if_deps) choice._determine_actual_symbols() @@ -1326,10 +1334,21 @@ error, and you should e-mail kconfiglib@gmail.com. elif tokens.check(T_MODULES): self._warn("the 'modules' option is not supported. " "Let me know if this is a problem for you; " - "it shouldn't be that hard to implement.", + "it shouldn't be that hard to implement. " + "(Note that modules are still supported -- " + "Kconfiglib just assumes the symbol name " + "MODULES.)", filename, linenr) + elif tokens.check(T_ALLNOCONFIG_Y): + if not isinstance(stmt, Symbol): + _parse_error(line, + "the 'allnoconfig_y' option is only valid for symbols.", + filename, + linenr) + stmt.allnoconfig_y = True + else: _parse_error(line, "unrecognized option.", filename, linenr) @@ -2023,8 +2042,8 @@ def _make_and(e1, e2): T_OPTIONAL, T_PROMPT, T_DEFAULT, T_BOOL, T_TRISTATE, T_HEX, T_INT, T_STRING, T_DEF_BOOL, T_DEF_TRISTATE, - T_SELECT, T_RANGE, T_OPTION, T_ENV, - T_DEFCONFIG_LIST, T_MODULES, T_VISIBLE) = range(0, 38) + T_SELECT, T_RANGE, T_OPTION, T_ALLNOCONFIG_Y, T_ENV, + T_DEFCONFIG_LIST, T_MODULES, T_VISIBLE) = range(0, 39) # Keyword to token map keywords = { @@ -2056,6 +2075,7 @@ keywords = { "select" : T_SELECT, "range" : T_RANGE, "option" : T_OPTION, + "allnoconfig_y" : T_ALLNOCONFIG_Y, "env" : T_ENV, "defconfig_list" : T_DEFCONFIG_LIST, "modules" : T_MODULES, @@ -2080,7 +2100,7 @@ set_re = re.compile(r"CONFIG_(\w+)=(.*)") unset_re = re.compile(r"# CONFIG_(\w+) is not set") # Regular expression for finding $-references to symbols in strings -sym_ref_re = re.compile(r"\$[A-Za-z_]+") +sym_ref_re = re.compile(r"\$[A-Za-z0-9_]+") # Integers representing symbol types UNKNOWN, BOOL, TRISTATE, STRING, HEX, INT = range(0, 6) @@ -2765,6 +2785,11 @@ class Symbol(Item, _HasVisibility): and sym.get_parent().get_selection() is sym'.""" return self.is_choice_symbol_ and self.parent.get_selection() is self + def is_allnoconfig_y(self): + """Returns True if the symbol has the 'allnoconfig_y' option set; + otherwise, returns False.""" + return self.allnoconfig_y + def __str__(self): """Returns a string containing various information about the symbol.""" return self.config._get_sym_or_choice_str(self) @@ -2862,6 +2887,9 @@ class Symbol(Item, _HasVisibility): # Does the symbol get its value from the environment? self.is_from_env = False + # Does the symbol have the 'allnoconfig_y' option set? + self.allnoconfig_y = False + def _invalidate(self): if self.is_special_: return diff --git a/tools/env/fw_env.h b/tools/env/fw_env.h index d6faf349125..60c05177ffd 100644 --- a/tools/env/fw_env.h +++ b/tools/env/fw_env.h @@ -6,6 +6,8 @@ */ /* Pull in the current config to define the default environment */ +#include <linux/kconfig.h> + #ifndef __ASSEMBLY__ #define __ASSEMBLY__ /* get only #defines from config.h */ #include <config.h> @@ -13,7 +15,6 @@ #else #include <config.h> #endif -#include <generated/autoconf.h> /* * To build the utility with the static configuration diff --git a/tools/ifdtool.c b/tools/ifdtool.c index 590ccc914b0..1d61df19f23 100644 --- a/tools/ifdtool.c +++ b/tools/ifdtool.c @@ -462,7 +462,7 @@ static int write_regions(char *image, int size) if (ret) return ret; dump_region(i, frba); - if (region.size == 0) + if (region.size <= 0) continue; region_fd = open(region_filename(i), O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | diff --git a/tools/kwbimage.c b/tools/kwbimage.c index 9540e7eb84f..1ff17cab269 100644 --- a/tools/kwbimage.c +++ b/tools/kwbimage.c @@ -420,6 +420,18 @@ static size_t image_headersz_v1(struct image_tool_params *params, *hasext = 1; } +#if defined(CONFIG_SYS_SPI_U_BOOT_OFFS) + if (headersz > CONFIG_SYS_SPI_U_BOOT_OFFS) { + fprintf(stderr, "Error: Image header (incl. SPL image) too big!\n"); + fprintf(stderr, "header=0x%x CONFIG_SYS_SPI_U_BOOT_OFFS=0x%x!\n", + (int)headersz, CONFIG_SYS_SPI_U_BOOT_OFFS); + fprintf(stderr, "Increase CONFIG_SYS_SPI_U_BOOT_OFFS!\n"); + return 0; + } else { + headersz = CONFIG_SYS_SPI_U_BOOT_OFFS; + } +#endif + /* * The payload should be aligned on some reasonable * boundary @@ -869,16 +881,6 @@ static int kwbimage_generate(struct image_tool_params *params, sizeof(struct ext_hdr_v0); } else { alloc_len = image_headersz_v1(params, NULL); -#if defined(CONFIG_SYS_SPI_U_BOOT_OFFS) - if (alloc_len > CONFIG_SYS_SPI_U_BOOT_OFFS) { - fprintf(stderr, "Error: Image header (incl. SPL image) too big!\n"); - fprintf(stderr, "header=0x%x CONFIG_SYS_SPI_U_BOOT_OFFS=0x%x!\n", - alloc_len, CONFIG_SYS_SPI_U_BOOT_OFFS); - fprintf(stderr, "Increase CONFIG_SYS_SPI_U_BOOT_OFFS!\n"); - } else { - alloc_len = CONFIG_SYS_SPI_U_BOOT_OFFS; - } -#endif } hdr = malloc(alloc_len); diff --git a/tools/kwboot.c b/tools/kwboot.c index 1368b4c948a..af7a6ee3f6a 100644 --- a/tools/kwboot.c +++ b/tools/kwboot.c @@ -657,7 +657,7 @@ static void kwboot_usage(FILE *stream, char *progname) { fprintf(stream, - "Usage: %s [-d | -a | -b <image> | -D <image> ] [ -t ] [-B <baud> ] <TTY>\n", + "Usage: %s [-d | -a | -q <req-delay> | -s <resp-timeo> | -b <image> | -D <image> ] [ -t ] [-B <baud> ] <TTY>\n", progname); fprintf(stream, "\n"); fprintf(stream, @@ -667,6 +667,8 @@ kwboot_usage(FILE *stream, char *progname) " -D <image>: boot <image> without preamble (Dove)\n"); fprintf(stream, " -d: enter debug mode\n"); fprintf(stream, " -a: use timings for Armada XP\n"); + fprintf(stream, " -q <req-delay>: use specific request-delay\n"); + fprintf(stream, " -s <resp-timeo>: use specific response-timeout\n"); fprintf(stream, "\n"); fprintf(stream, " -t: mini terminal\n"); fprintf(stream, "\n"); @@ -699,7 +701,7 @@ main(int argc, char **argv) kwboot_verbose = isatty(STDOUT_FILENO); do { - int c = getopt(argc, argv, "hb:ptaB:dD:"); + int c = getopt(argc, argv, "hb:ptaB:dD:q:s:"); if (c < 0) break; @@ -731,6 +733,14 @@ main(int argc, char **argv) msg_rsp_timeo = KWBOOT_MSG_RSP_TIMEO_AXP; break; + case 'q': + msg_req_delay = atoi(optarg); + break; + + case 's': + msg_rsp_timeo = atoi(optarg); + break; + case 'B': speed = kwboot_tty_speed(atoi(optarg)); if (speed == -1) |