diff --git a/arch/arm/boards/archosg9/lowlevel.c b/arch/arm/boards/archosg9/lowlevel.c index 2a93428..b1045a4 100644 --- a/arch/arm/boards/archosg9/lowlevel.c +++ b/arch/arm/boards/archosg9/lowlevel.c @@ -48,7 +48,7 @@ struct dpll_param abe = OMAP4_ABE_DPLL_PARAM_19M2; struct dpll_param usb = OMAP4_USB_DPLL_PARAM_19M2; - set_muxconf_regs(); + archosg9_set_muxconf_regs(); omap4460_scale_vcores(TPS62361_VSEL0_GPIO, 1380); diff --git a/arch/arm/boards/archosg9/mux.c b/arch/arm/boards/archosg9/mux.c index e9cb3c4..ce3cae3 100644 --- a/arch/arm/boards/archosg9/mux.c +++ b/arch/arm/boards/archosg9/mux.c @@ -257,7 +257,8 @@ { JTAG_TDO , IEN | PTU | M0 }, }; -void set_muxconf_regs(void){ +void archosg9_set_muxconf_regs(void) +{ omap4_do_set_mux(OMAP44XX_CONTROL_PADCONF_CORE, core_padconf_array, ARRAY_SIZE(core_padconf_array)); omap4_do_set_mux(OMAP44XX_CONTROL_PADCONF_WKUP, diff --git a/arch/arm/boards/archosg9/mux.h b/arch/arm/boards/archosg9/mux.h index 97297b6..4ee5415 100644 --- a/arch/arm/boards/archosg9/mux.h +++ b/arch/arm/boards/archosg9/mux.h @@ -1,6 +1,6 @@ #ifndef _MUX_H #define _MUX_H -void set_muxconf_regs(void); +void archosg9_set_muxconf_regs(void); #endif /* _MUX_H */ diff --git a/arch/arm/boards/panda/lowlevel.c b/arch/arm/boards/panda/lowlevel.c index 006fb62..1ed2b89 100644 --- a/arch/arm/boards/panda/lowlevel.c +++ b/arch/arm/boards/panda/lowlevel.c @@ -29,9 +29,9 @@ #include #include -#define TPS62361_VSEL0_GPIO 7 +#include "mux.h" -void set_muxconf_regs(void); +#define TPS62361_VSEL0_GPIO 7 static const struct ddr_regs ddr_regs_400_mhz_2cs = { /* tRRD changed from 10ns to 12.5ns because of the tFAW requirement*/ @@ -69,7 +69,7 @@ /* Enable all clocks */ omap4_enable_all_clocks(); - set_muxconf_regs(); + panda_set_muxconf_regs(); omap4_ddr_init(&ddr_regs_400_mhz_2cs, &core); diff --git a/arch/arm/boards/panda/mux.c b/arch/arm/boards/panda/mux.c index 8225aa6..76d1c51 100644 --- a/arch/arm/boards/panda/mux.c +++ b/arch/arm/boards/panda/mux.c @@ -5,6 +5,8 @@ #include #include +#include "mux.h" + static const struct pad_conf_entry core_padconf_array[] = { { GPMC_AD0, PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1 /* sdmmc2_dat0 */ }, { GPMC_AD1, PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1 /* sdmmc2_dat1 */ }, @@ -239,7 +241,7 @@ { FREF_CLK4_OUT, M3 /* gpio_wk8 */ }, }; -void set_muxconf_regs(void) +void panda_set_muxconf_regs(void) { omap4_do_set_mux(OMAP44XX_CONTROL_PADCONF_CORE, core_padconf_array, ARRAY_SIZE(core_padconf_array)); diff --git a/arch/arm/boards/panda/mux.h b/arch/arm/boards/panda/mux.h new file mode 100644 index 0000000..11f2848 --- /dev/null +++ b/arch/arm/boards/panda/mux.h @@ -0,0 +1,6 @@ +#ifndef __BOARD_MUX_H +#define __BOARD_MUX_H + +void panda_set_muxconf_regs(void); + +#endif /* __BOARD_MUX_H */ diff --git a/arch/arm/boards/phytec-phycard-omap4/lowlevel.c b/arch/arm/boards/phytec-phycard-omap4/lowlevel.c index c49c4ca..3035cca 100644 --- a/arch/arm/boards/phytec-phycard-omap4/lowlevel.c +++ b/arch/arm/boards/phytec-phycard-omap4/lowlevel.c @@ -29,9 +29,9 @@ #include #include -#define TPS62361_VSEL0_GPIO 7 +#include "mux.h" -void set_muxconf_regs(void); +#define TPS62361_VSEL0_GPIO 7 static const struct ddr_regs ddr_regs_mt42L64M64_25_400_mhz = { .tim1 = 0x0EEB0662, @@ -57,7 +57,7 @@ struct dpll_param usb = OMAP4_USB_DPLL_PARAM_19M2; unsigned int rev = omap4_revision(); - set_muxconf_regs(); + phycard_omap4_set_muxconf_regs(); omap4_ddr_init(&ddr_regs_mt42L64M64_25_400_mhz, &core); diff --git a/arch/arm/boards/phytec-phycard-omap4/mux.c b/arch/arm/boards/phytec-phycard-omap4/mux.c index a31d995..564944d 100644 --- a/arch/arm/boards/phytec-phycard-omap4/mux.c +++ b/arch/arm/boards/phytec-phycard-omap4/mux.c @@ -5,6 +5,8 @@ #include #include +#include "mux.h" + static const struct pad_conf_entry core_padconf_array[] = { {GPMC_AD0, (IEN | PTD | DIS | M0)}, /* gpmc_ad0 */ {GPMC_AD1, (IEN | PTD | DIS | M0)}, /* gpmc_ad1 */ @@ -236,7 +238,7 @@ {SYS_BOOT7, (M0)}, /* sys_boot7 */ }; -void set_muxconf_regs(void) +void phycard_omap4_set_muxconf_regs(void) { omap4_do_set_mux(OMAP44XX_CONTROL_PADCONF_CORE, core_padconf_array, ARRAY_SIZE(core_padconf_array)); diff --git a/arch/arm/boards/phytec-phycard-omap4/mux.h b/arch/arm/boards/phytec-phycard-omap4/mux.h new file mode 100644 index 0000000..8b1a3d3 --- /dev/null +++ b/arch/arm/boards/phytec-phycard-omap4/mux.h @@ -0,0 +1,6 @@ +#ifndef __BOARD_MUX_H +#define __BOARD_MUX_H + +void phycard_omap4_set_muxconf_regs(void); + +#endif /* __BOARD_MUX_H */ diff --git a/arch/arm/boards/phytec-phycore-omap4460/lowlevel.c b/arch/arm/boards/phytec-phycore-omap4460/lowlevel.c index 6511dae..8c25eab 100644 --- a/arch/arm/boards/phytec-phycore-omap4460/lowlevel.c +++ b/arch/arm/boards/phytec-phycore-omap4460/lowlevel.c @@ -29,6 +29,8 @@ #include #include +#include "mux.h" + #define TPS62361_VSEL0_GPIO 182 #define LPDDR2_2G 0x5 #define LPDDR2_4G 0x6 @@ -38,8 +40,6 @@ #define EMIF_LPDDR2_MODE_REG_CONFIG 0x0050 #define EMIF_LPDDR2_MODE_REG_DATA 0x0040 -void set_muxconf_regs(void); - /* 512MB */ static const struct ddr_regs ddr_regs_mt42L64M64_25_400_mhz = { .tim1 = 0x0EEB0662, @@ -94,7 +94,7 @@ struct dpll_param usb = OMAP4_USB_DPLL_PARAM_19M2; unsigned int rev = omap4_revision(); - set_muxconf_regs(); + phycore_omap4460_set_muxconf_regs(); if (IS_ENABLED(CONFIG_1024MB_DDR2RAM)) { omap4_ddr_init(&ddr_regs_mt42L64M64_25_400_mhz, &core); diff --git a/arch/arm/boards/phytec-phycore-omap4460/mux.c b/arch/arm/boards/phytec-phycore-omap4460/mux.c index fda4c51..ca4ccf3 100644 --- a/arch/arm/boards/phytec-phycore-omap4460/mux.c +++ b/arch/arm/boards/phytec-phycore-omap4460/mux.c @@ -5,6 +5,8 @@ #include #include +#include "mux.h" + static const struct pad_conf_entry core_padconf_array[] = { {GPMC_AD0, (IEN | PTD | DIS | M0)}, /* gpmc_ad0 */ {GPMC_AD1, (IEN | PTD | DIS | M0)}, /* gpmc_ad1 */ @@ -236,7 +238,7 @@ {SYS_BOOT7, (M0)}, /* sys_boot7 */ }; -void set_muxconf_regs(void) +void phycore_omap4460_set_muxconf_regs(void) { omap4_do_set_mux(OMAP44XX_CONTROL_PADCONF_CORE, core_padconf_array, ARRAY_SIZE(core_padconf_array)); diff --git a/arch/arm/boards/phytec-phycore-omap4460/mux.h b/arch/arm/boards/phytec-phycore-omap4460/mux.h new file mode 100644 index 0000000..64d4478 --- /dev/null +++ b/arch/arm/boards/phytec-phycore-omap4460/mux.h @@ -0,0 +1,6 @@ +#ifndef __BOARD_MUX_H +#define __BOARD_MUX_H + +void phycore_omap4460_set_muxconf_regs(void); + +#endif /* __BOARD_MUX_H */ diff --git a/arch/arm/dts/rk3288-phycore-som.dts b/arch/arm/dts/rk3288-phycore-som.dts index dd74bcf..65c5389 100644 --- a/arch/arm/dts/rk3288-phycore-som.dts +++ b/arch/arm/dts/rk3288-phycore-som.dts @@ -21,7 +21,7 @@ compatible = "phytec,rk3288-phycore-som", "rockchip,rk3288"; memory { - reg = <0 0x40000000>; + reg = <0x0 0x0 0x0 0x40000000>; }; vcc33: fixedregulator@0 { diff --git a/arch/ppc/Makefile b/arch/ppc/Makefile index 2fb9b14..ebf60ed 100644 --- a/arch/ppc/Makefile +++ b/arch/ppc/Makefile @@ -1,3 +1,4 @@ +KBUILD_DEFCONFIG := p2020rdb_defconfig CPPFLAGS += -ffixed-r14 -m32 \ -meabi -D __PPC__ -D CONFIG_PPC \ diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index 643c0bc..fa8a173 100644 --- a/arch/riscv/Makefile +++ b/arch/riscv/Makefile @@ -1,3 +1,5 @@ +KBUILD_DEFCONFIG := erizo_generic_defconfig + CPPFLAGS += -fno-strict-aliasing ifeq ($(CONFIG_ARCH_RV32I),y) diff --git a/commands/of_property.c b/commands/of_property.c index 31e9b71..1d7ba18 100644 --- a/commands/of_property.c +++ b/commands/of_property.c @@ -315,7 +315,7 @@ int delete = 0; int set = 0; int fixup = 0; - char *path = NULL, *propname = NULL; + char *path, *propname; while ((opt = getopt(argc, argv, "dsf")) > 0) { switch (opt) { @@ -333,14 +333,11 @@ } } - if (optind == argc) + if (argc - optind < 2) return COMMAND_ERROR_USAGE; - if (optind < argc) - path = argv[optind]; - - if (optind + 1 < argc) - propname = argv[optind + 1]; + path = argv[optind]; + propname = argv[optind + 1]; debug("path: %s propname: %s\n", path, propname); diff --git a/common/Kconfig b/common/Kconfig index 02ef363..400c055 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -892,7 +892,7 @@ help Space separated list of paths the default environment will be taken from. Relative paths will be relative to the barebox Toplevel dir, but absolute - paths are fine aswell. + paths are fine as well. config BAREBOXENV_TARGET bool @@ -958,7 +958,7 @@ bool "detect Reset cause" depends on GLOBALVAR help - Provide a global variable at runtine which reflects the possible cause + Provide a global variable at runtime which reflects the possible cause of the reset and why the bootloader is currently running. It can be useful for any kind of system recovery or repair. diff --git a/common/bbu.c b/common/bbu.c index b976b99..1755615 100644 --- a/common/bbu.c +++ b/common/bbu.c @@ -361,7 +361,7 @@ * * This update handler us suitable for a standard file-to-device copy operation. * The handler checks for a filetype and unprotects/erases the device if - * necessary. If devicefile belongs to a device then the device is checkd for + * necessary. If devicefile belongs to a device then the device is checked for * enough space before touching it. * * Return: 0 if successful, negative error code otherwise diff --git a/common/block.c b/common/block.c index 02be80d..39275dc 100644 --- a/common/block.c +++ b/common/block.c @@ -27,7 +27,7 @@ LIST_HEAD(block_device_list); -/* a chunk of contigous data */ +/* a chunk of contiguous data */ struct chunk { void *data; /* data buffer */ int block_start; /* first block in this chunk */ diff --git a/common/blspec.c b/common/blspec.c index 7fb62d3..1a6d581 100644 --- a/common/blspec.c +++ b/common/blspec.c @@ -120,7 +120,7 @@ * * This boots an entry. On success this function does not return. * In case of an error the error code is returned. This function may - * return 0 in case of a succesful dry run. + * return 0 in case of a successful dry run. */ static int blspec_boot(struct bootentry *be, int verbose, int dryrun) { @@ -456,7 +456,7 @@ const char *compat; char *filename; - /* If the entry doesn't specifiy a devicetree we are compatible */ + /* If the entry doesn't specify a devicetree we are compatible */ devicetree = blspec_entry_var_get(entry, "devicetree"); if (!devicetree) return true; @@ -528,7 +528,7 @@ if (env_machineid) { const char *machineid = blspec_entry_var_get(entry, "machine-id"); if (!machineid || strcmp(machineid, env_machineid)) { - pr_debug("ignoring entry with missmatched machine-id " \ + pr_debug("ignoring entry with mismatched machine-id " \ "\"%s\" != \"%s\"\n", env_machineid, machineid); ret = false; } @@ -666,7 +666,7 @@ * entries found in the UBI volumes * * returns the number of entries found or a negative error code if some unexpected - * error occured. + * error occurred. */ static int blspec_scan_ubi(struct bootentries *bootentries, struct cdev *cdev) { @@ -695,7 +695,7 @@ * entries found under /bootentries/entries/. * * returns the number of entries found or a negative error code if some unexpected - * error occured. + * error occurred. */ static int blspec_scan_cdev(struct bootentries *bootentries, struct cdev *cdev) { @@ -740,7 +740,7 @@ * * Iterate over all devices and collect child their cdevs. * Returns the number of entries found or a negative error code if some unexpected - * error occured. + * error occurred. */ int blspec_scan_devices(struct bootentries *bootentries) { @@ -770,7 +770,7 @@ * Given a device this functions scans over all child cdevs looking * for bootentries entries. * Returns the number of entries found or a negative error code if some unexpected - * error occured. + * error occurred. */ int blspec_scan_device(struct bootentries *bootentries, struct device_d *dev) { @@ -832,7 +832,7 @@ * Given a name of a hardware device this functions scans over all child * cdevs looking for bootentries entries. * Returns the number of entries found or a negative error code if some unexpected - * error occured. + * error occurred. */ int blspec_scan_devicename(struct bootentries *bootentries, const char *devname) { diff --git a/common/boot.c b/common/boot.c index dcbe5cc..f546fce 100644 --- a/common/boot.c +++ b/common/boot.c @@ -205,7 +205,7 @@ /* * bootscript_scan_path - create boot entries from a path * - * path can either be a full path to a bootscript or a full path to a diretory + * path can either be a full path to a bootscript or a full path to a directory * containing bootscripts. */ static int bootscript_scan_path(struct bootentries *bootentries, const char *path) diff --git a/common/bootsource.c b/common/bootsource.c index 1f2bf87..fdbc4cd 100644 --- a/common/bootsource.c +++ b/common/bootsource.c @@ -98,8 +98,8 @@ } /* - * We expect SoC specific bootsource detction code to properly - * initalize bootsource_instance, so we bail out if it didn't + * We expect SoC specific bootsource detection code to properly + * initialize bootsource_instance, so we bail out if it didn't */ if (bootsource_instance == BOOTSOURCE_INSTANCE_UNKNOWN) return NULL; diff --git a/common/clock.c b/common/clock.c index 2b218fb..1a4931c 100644 --- a/common/clock.c +++ b/common/clock.c @@ -109,7 +109,7 @@ * calculated mult and shift factors. This guarantees that no 64bit * overflow happens when the input value of the conversion is * multiplied with the calculated mult factor. Larger ranges may - * reduce the conversion accuracy by chosing smaller mult and shift + * reduce the conversion accuracy by choosing smaller mult and shift * factors. */ diff --git a/common/console_common.c b/common/console_common.c index 6916f65..6d01753 100644 --- a/common/console_common.c +++ b/common/console_common.c @@ -63,7 +63,7 @@ * @limit: The maximum messages left in the buffer after * calling this function. * - * This function deletes all messages in the logbuf exeeding + * This function deletes all messages in the logbuf exceeding * the limit. */ void log_clean(unsigned int limit) diff --git a/common/dlmalloc.c b/common/dlmalloc.c index 9c33cc2..ae10c9a 100644 --- a/common/dlmalloc.c +++ b/common/dlmalloc.c @@ -331,7 +331,7 @@ helps keep the system level memory demands of a long-lived program low. Mapped memory can never become `locked' between other chunks, as can happen with normally allocated chunks, which - menas that even trimming via malloc_trim would not release them. + means that even trimming via malloc_trim would not release them. However, it has the disadvantages that: @@ -529,7 +529,7 @@ the malloc code, but "mem" is the pointer that is returned to the user. "Nextchunk" is the beginning of the next contiguous chunk. - Chunks always begin on even word boundries, so the mem portion + Chunks always begin on even word boundaries, so the mem portion (which is returned to the user) is also on an even word boundary, and thus double-word aligned. @@ -1085,7 +1085,7 @@ /* Main public routines */ /* - Malloc Algorthim: + Malloc Algorithm: The requested size is first converted into a usable form, `nb'. This currently means to add 4 bytes overhead plus possibly more to @@ -1641,7 +1641,7 @@ char *brk; /* alignment point within p */ mchunkptr newp; /* chunk to return */ INTERNAL_SIZE_T newsize; /* its size */ - INTERNAL_SIZE_T leadsize; /* leading space befor alignment point */ + INTERNAL_SIZE_T leadsize; /* leading space before alignment point */ mchunkptr remainder; /* spare room at end to split off */ long remainder_size; /* its size */ @@ -1858,10 +1858,10 @@ Wolfram Gloger (Gloger@lrz.uni-muenchen.de). * Use last_remainder in more cases. * Pack bins using idea from colin@nyx10.cs.du.edu - * Use ordered bins instead of best-fit threshhold + * Use ordered bins instead of best-fit threshold * Eliminate block-local decls to simplify tracing and debugging. * Support another case of realloc via move into top - * Fix error occuring when initial sbrk_base not word-aligned. + * Fix error occurring when initial sbrk_base not word-aligned. * Rely on page size for units instead of SBRK_UNIT to avoid surprises about sbrk alignment conventions. * Add mallinfo, mallopt. Thanks to Raymond Nijssen diff --git a/common/efi-devicepath.c b/common/efi-devicepath.c index 3db2cea..f17b929 100644 --- a/common/efi-devicepath.c +++ b/common/efi-devicepath.c @@ -473,7 +473,7 @@ struct efi_device_path *Src, *Dest, *new_path; unsigned long Size; - /* Walk device path and round sizes to valid boundries */ + /* Walk device path and round sizes to valid boundaries */ Src = dev_path; Size = 0; diff --git a/common/hush.c b/common/hush.c index 68c3ecc..c24b2c7 100644 --- a/common/hush.c +++ b/common/hush.c @@ -761,7 +761,7 @@ /* * We do not support pipes in barebox, so pi->num_progs can't - * be bigger than 1. pi->num_progs == 0 is already catched in + * be bigger than 1. pi->num_progs == 0 is already caught in * the caller, so everything else than 1 is a bug. */ BUG_ON(pi->num_progs != 1); @@ -1689,7 +1689,7 @@ return res; } -/* most recursion does not come through here, the exeception is +/* most recursion does not come through here, the exception is * from builtin_source() */ static int parse_stream_outer(struct p_context *ctx, struct in_str *inp, int flag) { diff --git a/common/imx-bbu-nand-fcb.c b/common/imx-bbu-nand-fcb.c index aa3f733..0629ae5 100644 --- a/common/imx-bbu-nand-fcb.c +++ b/common/imx-bbu-nand-fcb.c @@ -323,7 +323,7 @@ * correcting bitflips. This means we cannot allow bitflips in the * fingerprint and version. We bail out with an error if it's not correct. * This is currently done in the i.MX6qdl path. It needs to be checked if - * the same happens in the BCH encoded variants (i.MX6ul(l)) aswell. + * the same happens in the BCH encoded variants (i.MX6ul(l)) as well. */ if (((struct fcb_block *)fcb)->FingerPrint != 0x20424346 || ((struct fcb_block *)fcb)->Version != 0x01000000) @@ -1285,7 +1285,7 @@ * ---------------------- * * We want a robust update in which a power failure may occur - * everytime without bricking the board, so here's the strategy: + * every time without bricking the board, so here's the strategy: * * The FCBs contain pointers to the firmware slots in the * Firmware1_startingPage and Firmware2_startingPage fields. Note that diff --git a/common/memtest.c b/common/memtest.c index 44ddedd..7b7a9ee 100644 --- a/common/memtest.c +++ b/common/memtest.c @@ -208,7 +208,7 @@ * Data line test: write a pattern to the first * location, write the 1's complement to a 'parking' * address (changes the state of the data bus so a - * floating bus doen't give a false OK), and then + * floating bus doesn't give a false OK), and then * read the value back. Note that we read it back * into a variable because the next time we read it, * it might be right (been there, tough to explain to diff --git a/common/oftree.c b/common/oftree.c index 09cb660..36906e8 100644 --- a/common/oftree.c +++ b/common/oftree.c @@ -151,6 +151,10 @@ if (!str) return 0; + str = skip_spaces(str); + if (strlen(str) == 0) + return 0; + node = of_create_node(root, "/chosen"); if (!node) return -ENOMEM; diff --git a/common/resource.c b/common/resource.c index abc0814..16430b7 100644 --- a/common/resource.c +++ b/common/resource.c @@ -34,7 +34,7 @@ /* * request a region. - * This will succedd when the requested region is completely inside + * This will succeed when the requested region is completely inside * the parent resource and does not conflict with any of the child * resources. */ diff --git a/common/serdev.c b/common/serdev.c index 3e0da08..c87b8a8 100644 --- a/common/serdev.c +++ b/common/serdev.c @@ -141,8 +141,8 @@ memcpy(r->buf + r->len, buf, room); r->len += room; /* - * It's important we return 'size' even if we didn't trully - * consume all of the data, since otherwise serdev will keep + * It's important we return 'size' even if we didn't truly + * consume all of the data, since otherwise, serdev will keep * re-executing us until we do. Given the logic above that * would mean infinite loop. */ @@ -155,7 +155,7 @@ * @serdev: Underlying serdev device * @capacity: Storage capacity of the reader * - * This function is inteded for creating of reader serdev devices that + * This function is intended for creating of reader serdev devices that * can be used in conjunction with serdev_device_read() to perform * trivial fixed length reads from a serdev device. */ diff --git a/common/state/state.c b/common/state/state.c index 1822f37..d429209 100644 --- a/common/state/state.c +++ b/common/state/state.c @@ -699,7 +699,7 @@ /* * state_by_node - find a state instance by of node * - * @node The of node of the state intance + * @node The of node of the state instance */ struct state *state_by_node(const struct device_node *node) { diff --git a/common/ubiformat.c b/common/ubiformat.c index 72b9b6f..cfaa68f 100644 --- a/common/ubiformat.c +++ b/common/ubiformat.c @@ -20,7 +20,7 @@ */ /* - * Maximum amount of consequtive eraseblocks which are considered as normal by + * Maximum amount of consecutive eraseblocks which are considered as normal by * this utility. Otherwise it is assume that something is wrong with the flash * or the driver, and eraseblocks are stopped being marked as bad. */ diff --git a/common/uimage.c b/common/uimage.c index 35bfb10..3470d9b 100644 --- a/common/uimage.c +++ b/common/uimage.c @@ -136,7 +136,7 @@ goto err_out; } - /* convert header to cpu native endianess */ + /* convert header to cpu native endianness */ header->ih_magic = uimage_to_cpu(header->ih_magic); header->ih_hcrc = uimage_to_cpu(header->ih_hcrc); header->ih_time = uimage_to_cpu(header->ih_time); diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c index 34aaee5..f371832 100644 --- a/drivers/mci/mci-core.c +++ b/drivers/mci/mci-core.c @@ -156,7 +156,7 @@ mmccmd = MMC_CMD_WRITE_SINGLE_BLOCK; if ((unsigned long)src & 0x3) { - memcpy(sector_buf, src, 512); + memcpy(sector_buf, src, SECTOR_SIZE); buf = sector_buf; } else { buf = src; @@ -1360,9 +1360,9 @@ dev_dbg(&mci->dev, "%s: Read %d block(s), starting at %d\n", __func__, num_blocks, block); - if (mci->read_bl_len != 512) { - dev_dbg(&mci->dev, "MMC/SD block size is not 512 bytes (its %u bytes instead)\n", - mci->read_bl_len); + if (mci->read_bl_len != SECTOR_SIZE) { + dev_dbg(&mci->dev, "MMC/SD block size is not %d bytes (its %u bytes instead)\n", + SECTOR_SIZE, mci->read_bl_len); return -EINVAL; } @@ -1789,7 +1789,7 @@ static int mci_init(void) { - sector_buf = xmemalign(32, 512); + sector_buf = xmemalign(32, SECTOR_SIZE); return 0; } diff --git a/drivers/of/base.c b/drivers/of/base.c index cf3bdbf..72a3df4 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -2044,6 +2044,8 @@ return 0; } +static int mem_bank_num; + int of_add_memory(struct device_node *node, bool dump) { const char *device_type; @@ -2055,14 +2057,13 @@ return -ENXIO; while (!of_address_to_resource(node, n, &res)) { - if (!resource_size(&res)) { - n++; - continue; - } - - of_add_memory_bank(node, dump, n, - res.start, resource_size(&res)); n++; + if (!resource_size(&res)) + continue; + + of_add_memory_bank(node, dump, mem_bank_num, + res.start, resource_size(&res)); + mem_bank_num++; } return 0; @@ -2086,9 +2087,23 @@ } }; +static void of_probe_memory(void) +{ + struct device_node *memory = root_node; + + /* Parse all available node with "memory" device_type */ + while (1) { + memory = of_find_node_by_type(memory, "memory"); + if (!memory) + break; + + of_add_memory(memory, false); + } +} + int of_probe(void) { - struct device_node *memory, *firmware; + struct device_node *firmware; if(!root_node) return -ENODEV; @@ -2099,11 +2114,7 @@ if (of_model) barebox_set_model(of_model); - memory = of_find_node_by_path("/memory"); - if (!memory) - memory = of_find_node_by_type(root_node, "memory"); - if (memory) - of_add_memory(memory, false); + of_probe_memory(); firmware = of_find_node_by_path("/firmware"); if (firmware) diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index a35eddf..b79dbff 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c @@ -162,7 +162,7 @@ { struct device_node *resolved; struct device_node *fragment; - int err; + int err = 0; resolved = of_resolve_phandles(root, overlay); if (!resolved) diff --git a/drivers/of/resolver.c b/drivers/of/resolver.c index 9107c1f..4f720cf 100644 --- a/drivers/of/resolver.c +++ b/drivers/of/resolver.c @@ -160,9 +160,7 @@ } for_each_child_of_node(local_fixups, child) { - for_each_child_of_node(overlay, overlay_child) - if (!of_node_cmp(child->name, overlay_child->name)) - break; + overlay_child = of_get_child_by_name(overlay, child->name); if (!overlay_child) return -EINVAL; diff --git a/drivers/serial/serial_ns16550_pci.c b/drivers/serial/serial_ns16550_pci.c index 392a281..c29cfc5 100644 --- a/drivers/serial/serial_ns16550_pci.c +++ b/drivers/serial/serial_ns16550_pci.c @@ -3670,9 +3670,9 @@ res = &uart.resource; - dev_dbg(&dev->dev, "setup PCI %s console @ 0x%llx-0x%llx\n", + dev_dbg(&dev->dev, "setup PCI %s console @ 0x%pa-0x%pa\n", res->flags & IORESOURCE_MEM ? "MMIO" : "IO port", - res->start, res->end); + &res->start, &res->end); ns16550_dev = device_alloc("ns16550_serial", DEVICE_ID_DYNAMIC); ns16550_dev->platform_data = uart.pdata; @@ -3683,9 +3683,9 @@ rc = platform_device_register(ns16550_dev); if (rc < 0) { - dev_err(&dev->dev, "couldn't register PCI %s console @0x%llx: %s\n", + dev_err(&dev->dev, "couldn't register PCI %s console @0x%pa: %s\n", res->flags & IORESOURCE_MEM ? "MMIO" : "IO port", - res->start, strerror(-rc)); + &res->start, strerror(-rc)); break; } diff --git a/include/linux/libfdt.h b/include/linux/libfdt.h index ef24672..90ed4eb 100644 --- a/include/linux/libfdt.h +++ b/include/linux/libfdt.h @@ -3,6 +3,6 @@ #define _INCLUDE_LIBFDT_H_ #include -#include "../scripts/dtc/libfdt/libfdt.h" +#include "../../scripts/dtc/libfdt/libfdt.h" #endif /* _INCLUDE_LIBFDT_H_ */ diff --git a/include/linux/libfdt_env.h b/include/linux/libfdt_env.h index bac4670..cea8574 100644 --- a/include/linux/libfdt_env.h +++ b/include/linux/libfdt_env.h @@ -2,11 +2,14 @@ #ifndef LIBFDT_ENV_H #define LIBFDT_ENV_H -#include /* For INT_MAX */ +#include /* For INT_MAX */ #include #include +#define INT32_MAX S32_MAX +#define UINT32_MAX U32_MAX + typedef __be16 fdt16_t; typedef __be32 fdt32_t; typedef __be64 fdt64_t; @@ -16,6 +19,4 @@ #define fdt64_to_cpu(x) be64_to_cpu(x) #define cpu_to_fdt64(x) cpu_to_be64(x) -#define INT32_MAX 2147483647 - #endif /* LIBFDT_ENV_H */ diff --git a/scripts/Makefile.build b/scripts/Makefile.build index db687d5..a6ed83e 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -16,6 +16,8 @@ lib-m := pbl-y := always := +always-y := +always-m := targets := subdir-y := subdir-m := @@ -43,7 +45,7 @@ include scripts/Makefile.lib # Do not include host rules unless needed -ifneq ($(hostprogs-y)$(hostprogs-m),) +ifneq ($(hostprogs)$(hostprogs-y)$(hostprogs-m),) include scripts/Makefile.host endif @@ -80,7 +82,7 @@ __build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(pbl-target) $(extra-y)) \ $(if $(KBUILD_MODULES),$(obj-m)) \ - $(subdir-ym) $(always) + $(subdir-ym) $(always-y) @: # Linus' kernel sanity checking tool diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean index 41712f8..6e6c9ef 100644 --- a/scripts/Makefile.clean +++ b/scripts/Makefile.clean @@ -36,8 +36,8 @@ # directory __clean-files := $(extra-y) $(extra-m) $(extra-) \ - $(always) $(targets) $(clean-files) \ - $(hostprogs-y) $(hostprogs-m) $(hostprogs-) + $(always) $(always-y) $(always-m) $(always-) $(targets) $(clean-files) \ + $(hostprogs) $(hostprogs-y) $(hostprogs-m) $(hostprogs-) # as clean-files is given relative to the current directory, this adds # a $(obj) prefix, except for absolute paths @@ -46,28 +46,15 @@ $(addprefix $(obj)/, $(filter-out /%, $(__clean-files))) \ $(filter /%, $(__clean-files))) -# as clean-dirs is given relative to the current directory, this adds -# a $(obj) prefix, except for absolute paths - -__clean-dirs := $(wildcard \ - $(addprefix $(obj)/, $(filter-out /%, $(clean-dirs))) \ - $(filter /%, $(clean-dirs))) - # ========================================================================== quiet_cmd_clean = CLEAN $(obj) - cmd_clean = rm -f $(__clean-files) -quiet_cmd_cleandir = CLEAN $(__clean-dirs) - cmd_cleandir = rm -rf $(__clean-dirs) - + cmd_clean = rm -rf $(__clean-files) __clean: $(subdir-ymn) ifneq ($(strip $(__clean-files)),) +$(call cmd,clean) endif -ifneq ($(strip $(__clean-dirs)),) - +$(call cmd,cleandir) -endif @: diff --git a/scripts/Makefile.host b/scripts/Makefile.host index 8a88cbc..8f4d62f 100644 --- a/scripts/Makefile.host +++ b/scripts/Makefile.host @@ -1,3 +1,21 @@ +# SPDX-License-Identifier: GPL-2.0 + +# LEX +# --------------------------------------------------------------------------- +quiet_cmd_flex = LEX $@ + cmd_flex = $(LEX) -o$@ -L $< + +$(obj)/%.lex.c: $(src)/%.l FORCE + $(call if_changed,flex) + +# YACC +# --------------------------------------------------------------------------- +quiet_cmd_bison = YACC $(basename $@).[ch] + cmd_bison = $(YACC) -o $(basename $@).c --defines=$(basename $@).h -t -l $< + +$(obj)/%.tab.c $(obj)/%.tab.h: $(src)/%.y FORCE + $(call if_changed,bison) + # ========================================================================== # Building binaries on the host system # Binaries are used during the compilation of the kernel, for example @@ -5,22 +23,22 @@ # # Both C and C++ are supported, but preferred language is C for such utilities. # -# Sample syntax (see Documentation/kbuild/makefiles.txt for reference) -# hostprogs-y := bin2hex +# Sample syntax (see Documentation/kbuild/makefiles.rst for reference) +# hostprogs := bin2hex # Will compile bin2hex.c and create an executable named bin2hex # -# hostprogs-y := lxdialog +# hostprogs := lxdialog # lxdialog-objs := checklist.o lxdialog.o # Will compile lxdialog.c and checklist.c, and then link the executable # lxdialog, based on checklist.o and lxdialog.o # -# hostprogs-y := qconf +# hostprogs := qconf # qconf-cxxobjs := qconf.o # qconf-objs := menu.o # Will compile qconf as a C++ program, and menu as a C program. # They are linked as C++ code to the executable qconf -__hostprogs := $(sort $(hostprogs-y) $(hostprogs-m)) +__hostprogs := $(sort $(hostprogs)) # C code # Executables compiled from a single .c file @@ -64,9 +82,9 @@ # Handle options to gcc. Support building with separate output directory _hostc_flags = $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) \ - $(HOSTCFLAGS_$(basetarget).o) + $(HOSTCFLAGS_$(target-stem).o) _hostcxx_flags = $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \ - $(HOSTCXXFLAGS_$(basetarget).o) + $(HOSTCXXFLAGS_$(target-stem).o) ifeq ($(KBUILD_SRC),) __hostc_flags = $(_hostc_flags) @@ -86,7 +104,7 @@ # host-csingle -> Executable quiet_cmd_host-csingle = HOSTCC $@ cmd_host-csingle = $(HOSTCC) $(hostc_flags) $(HOSTLDFLAGS) -o $@ $< \ - $(HOST_LOADLIBES) $(HOSTLDLIBS_$(@F)) + $(HOST_LOADLIBES) $(HOSTLDLIBS_$(target-stem)) $(host-csingle): $(obj)/%: $(src)/%.c FORCE $(call if_changed_dep,host-csingle) @@ -94,8 +112,8 @@ # host-cmulti -> executable quiet_cmd_host-cmulti = HOSTLD $@ cmd_host-cmulti = $(HOSTCC) $(HOSTLDFLAGS) -o $@ \ - $(addprefix $(obj)/,$($(@F)-objs)) \ - $(HOST_LOADLIBES) $(HOSTLDLIBS_$(@F)) + $(addprefix $(obj)/, $($(target-stem)-objs)) \ + $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(target-stem)) $(host-cmulti): FORCE $(call if_changed,host-cmulti) $(call multi_depend, $(host-cmulti), , -objs) @@ -112,8 +130,8 @@ quiet_cmd_host-cxxmulti = HOSTLD $@ cmd_host-cxxmulti = $(HOSTCXX) $(HOSTLDFLAGS) -o $@ \ $(foreach o,objs cxxobjs,\ - $(addprefix $(obj)/,$($(@F)-$(o)))) \ - $(HOST_LOADLIBES) $(HOSTLDLIBS_$(@F)) + $(addprefix $(obj)/, $($(target-stem)-$(o)))) \ + $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(target-stem)) $(host-cxxmulti): FORCE $(call if_changed,host-cxxmulti) $(call multi_depend, $(host-cxxmulti), , -objs -cxxobjs) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 9aa8be5..d4c2ed1 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -1,3 +1,8 @@ +# SPDX-License-Identifier: GPL-2.0 +# Backward compatibility +always-y += $(always) +hostprogs += $(hostprogs-y) $(hostprogs-m) + # Figure out what we need to build from the various variables # =========================================================================== @@ -85,10 +90,12 @@ real-objs-y := $(foreach m, $(filter-out $(subdir-obj-y), $(obj-y)), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) $(extra-y) real-objs-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) +always-y += $(always-m) + # Add subdir path extra-y := $(addprefix $(obj)/,$(extra-y)) -always := $(addprefix $(obj)/,$(always)) +always-y := $(addprefix $(obj)/,$(always-y)) targets := $(addprefix $(obj)/,$(targets)) obj-y := $(addprefix $(obj)/,$(obj-y)) obj-m := $(addprefix $(obj)/,$(obj-m)) @@ -106,6 +113,9 @@ obj-dirs := $(addprefix $(obj)/,$(obj-dirs)) bbenv-y := $(addprefix $(obj)/,$(bbenv-y)) +# target with $(obj)/ and its suffix stripped +target-stem = $(basename $(patsubst $(obj)/%,%,$@)) + # These flags are needed for modversions and compiling, so we define them here # already # $(modname_flags) #defines KBUILD_MODNAME as the name of the module it will @@ -118,9 +128,9 @@ modname_flags = $(if $(filter 1,$(words $(modname))),\ -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))") -_c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(basetarget).o) -_a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o) -_cpp_flags = $(CPPFLAGS) $(EXTRA_CPPFLAGS) $(CPPFLAGS_$(@F)) +_c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(target-stem).o) +_a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(target-stem).o) +_cpp_flags = $(CPPFLAGS) $(EXTRA_CPPFLAGS) $(CPPFLAGS_$(target-stem).lds) ifeq ($(CONFIG_UBSAN),y) _CFLAGS_UBSAN = $(eval _CFLAGS_UBSAN := $(CFLAGS_UBSAN))$(_CFLAGS_UBSAN) @@ -185,28 +195,6 @@ $(addprefix $(obj)/, $(foreach s, $3, $($(m:%$(strip $2)=%$(s))))))) endef -# LEX -# --------------------------------------------------------------------------- -quiet_cmd_flex = LEX $@ - cmd_flex = $(LEX) -o$@ -L $< - -$(obj)/%.lex.c: $(src)/%.l FORCE - $(call if_changed,flex) - -# YACC -# --------------------------------------------------------------------------- -quiet_cmd_bison = YACC $@ - cmd_bison = $(YACC) -o$@ -t -l $< - -$(obj)/%.tab.c: $(src)/%.y FORCE - $(call if_changed,bison) - -quiet_cmd_bison_h = YACC $@ - cmd_bison_h = $(YACC) -o/dev/null --defines=$@ -t -l $< - -$(obj)/%.tab.h: $(src)/%.y FORCE - $(call if_changed,bison_h) - # Shipped files # =========================================================================== diff --git a/scripts/basic/.gitignore b/scripts/basic/.gitignore index dc24f5f..98ae1f5 100644 --- a/scripts/basic/.gitignore +++ b/scripts/basic/.gitignore @@ -1,2 +1,2 @@ -docproc +# SPDX-License-Identifier: GPL-2.0-only fixdep diff --git a/scripts/basic/Makefile b/scripts/basic/Makefile index 9e92d89..290dd27 100644 --- a/scripts/basic/Makefile +++ b/scripts/basic/Makefile @@ -1,15 +1,6 @@ -### -# Makefile.basic list the most basic programs used during the build process. -# The programs listed herein is what is needed to do the basic stuff, -# such as fix dependency file. -# This initial step is needed to avoid files to be recompiled -# when barebox configuration changes (which is what happens when -# .config is included by main Makefile. -# --------------------------------------------------------------------------- -# fixdep: Used to generate dependency information during build process +# SPDX-License-Identifier: GPL-2.0-only +# +# fixdep: used to generate dependency information during build process -hostprogs-y := fixdep -always := $(hostprogs-y) - -# fixdep is needed to compile other host programs -$(addprefix $(obj)/,$(filter-out fixdep,$(always))): $(obj)/fixdep +hostprogs := fixdep +always-y := $(hostprogs) diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index facbd60..877ca2c 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c @@ -77,11 +77,6 @@ * dependencies on include/config/my/option.h for every * CONFIG_MY_OPTION encountered in any of the prerequisites. * - * It will also filter out all the dependencies on *.ver. We need - * to make sure that the generated version checksum are globally up - * to date before even starting the recursive build, so it's too late - * at this point anyway. - * * We don't even try to really parse the header files, but * merely grep, i.e. if CONFIG_FOO is mentioned in a comment, it will * be picked up as well. It's not a problem with respect to @@ -99,6 +94,7 @@ #include #include #include +#include #include #include #include @@ -110,13 +106,43 @@ } /* + * In the intended usage of this program, the stdout is redirected to .*.cmd + * files. The return value of printf() and putchar() must be checked to catch + * any error, e.g. "No space left on device". + */ +static void xprintf(const char *format, ...) +{ + va_list ap; + int ret; + + va_start(ap, format); + ret = vprintf(format, ap); + if (ret < 0) { + perror("fixdep"); + exit(1); + } + va_end(ap); +} + +static void xputchar(int c) +{ + int ret; + + ret = putchar(c); + if (ret == EOF) { + perror("fixdep"); + exit(1); + } +} + +/* * Print out a dependency path from a symbol name */ static void print_dep(const char *m, int slen, const char *dir) { int c, prev_c = '/', i; - printf(" $(wildcard %s/", dir); + xprintf(" $(wildcard %s/", dir); for (i = 0; i < slen; i++) { c = m[i]; if (c == '_') @@ -124,10 +150,10 @@ else c = tolower(c); if (c != '/' || prev_c != '/') - putchar(c); + xputchar(c); prev_c = c; } - printf(".h) \\\n"); + xprintf(".h) \\\n"); } struct item { @@ -220,7 +246,7 @@ } p += 7; q = p; - while (*q && (isalnum(*q) || *q == '_')) + while (isalnum(*q) || *q == '_') q++; if (str_ends_with(p, q - p, "_MODULE")) r = q - 7; @@ -268,8 +294,7 @@ static int is_ignored_file(const char *s, int len) { return str_ends_with(s, len, "include/generated/autoconf.h") || - str_ends_with(s, len, "include/generated/autoksyms.h") || - str_ends_with(s, len, ".ver"); + str_ends_with(s, len, "include/generated/autoksyms.h"); } /* @@ -324,13 +349,13 @@ */ if (!saw_any_target) { saw_any_target = 1; - printf("source_%s := %s\n\n", - target, m); - printf("deps_%s := \\\n", target); + xprintf("source_%s := %s\n\n", + target, m); + xprintf("deps_%s := \\\n", target); } is_first_dep = 0; } else { - printf(" %s \\\n", m); + xprintf(" %s \\\n", m); } buf = read_file(m); @@ -353,8 +378,8 @@ exit(1); } - printf("\n%s: $(deps_%s)\n\n", target, target); - printf("$(deps_%s):\n", target); + xprintf("\n%s: $(deps_%s)\n\n", target, target); + xprintf("$(deps_%s):\n", target); } int main(int argc, char *argv[]) @@ -369,7 +394,7 @@ target = argv[2]; cmdline = argv[3]; - printf("cmd_%s := %s\n\n", target, cmdline); + xprintf("cmd_%s := %s\n\n", target, cmdline); buf = read_file(depfile); parse_dep_file(buf, target); diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 65c2cfa..b8bd4e1 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3010,7 +3010,7 @@ # linux device tree files my $dt_path = $root . "/dts/Bindings/"; - my $vp_file = $dt_path . "vendor-prefixes.txt"; ++ my $vp_file = $dt_path . "vendor-prefixes.yaml"; # barebox-specific bindings $dt_path = $dt_path . " " . $root . "/Documentation/devicetree/bindings/"; @@ -3028,7 +3028,7 @@ next if $compat !~ /^([a-zA-Z0-9\-]+)\,/; my $vendor = $1; - `grep -Eq "^$vendor\\b" $vp_file`; ++ `grep -Eq "\\"\\^\Q$vendor\E,\\.\\*\\":" $vp_file`; if ( $? >> 8 ) { WARN("UNDOCUMENTED_DT_STRING", "DT compatible string vendor \"$vendor\" appears un-documented -- check $vp_file\n" . $herecurr); diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 7656e11..2f1a59f 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -66,7 +66,9 @@ # syncconfig has become an internal implementation detail and is now # deprecated for external use simple-targets := oldconfig allnoconfig allyesconfig allmodconfig \ - alldefconfig randconfig listnewconfig olddefconfig syncconfig + alldefconfig randconfig listnewconfig olddefconfig syncconfig \ + helpnewconfig + PHONY += $(simple-targets) $(simple-targets): $(obj)/conf @@ -114,7 +116,7 @@ $(PYTHON3) -B -m pytest $(srctree)/$(src)/tests \ -o cache_dir=$(abspath $(obj)/tests/.cache) \ $(if $(findstring 1,$(KBUILD_VERBOSE)),--capture=no) -clean-dirs += tests/.cache +clean-files += tests/.cache # Help text used by make help help: @@ -134,17 +136,19 @@ @echo ' alldefconfig - New config with all symbols set to default' @echo ' randconfig - New config with random answer to all options' @echo ' listnewconfig - List new options' + @echo ' helpnewconfig - List new options and help text' @echo ' olddefconfig - Same as oldconfig but sets new symbols to their' @echo ' default value without prompting' @echo ' kvmconfig - Enable additional options for kvm guest kernel support' - @echo ' xenconfig - Enable additional options for xen dom0 and guest kernel support' + @echo ' xenconfig - Enable additional options for xen dom0 and guest kernel' + @echo ' support' @echo ' tinyconfig - Configure the tiniest possible kernel' @echo ' testconfig - Run Kconfig unit tests (requires python3 and pytest)' # =========================================================================== # object files used by all kconfig flavours common-objs := confdata.o expr.o lexer.lex.o parser.tab.o preprocess.o \ - symbol.o + symbol.o util.o $(obj)/lexer.lex.o: $(obj)/parser.tab.h HOSTCFLAGS_lexer.lex.o := -I $(srctree)/$(src) @@ -166,15 +170,15 @@ # mconf: Used for the menuconfig target based on lxdialog hostprogs-y += mconf -lxdialog := checklist.o inputbox.o menubox.o textbox.o util.o yesno.o -mconf-objs := mconf.o $(addprefix lxdialog/, $(lxdialog)) $(common-objs) +lxdialog := $(addprefix lxdialog/, \ + checklist.o inputbox.o menubox.o textbox.o util.o yesno.o) +mconf-objs := mconf.o $(lxdialog) $(common-objs) HOSTLDLIBS_mconf = $(shell . $(obj)/mconf-cfg && echo $$libs) $(foreach f, mconf.o $(lxdialog), \ $(eval HOSTCFLAGS_$f = $$(shell . $(obj)/mconf-cfg && echo $$$$cflags))) -$(obj)/mconf.o: $(obj)/mconf-cfg -$(addprefix $(obj)/lxdialog/, $(lxdialog)): $(obj)/mconf-cfg +$(addprefix $(obj)/, mconf.o $(lxdialog)): $(obj)/mconf-cfg # qconf: Used for the xconfig target based on Qt hostprogs-y += qconf diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 40e16e8..1f89bf1 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -32,6 +32,7 @@ defconfig, savedefconfig, listnewconfig, + helpnewconfig, olddefconfig, }; static enum input_mode input_mode = oldaskconfig; @@ -434,6 +435,11 @@ printf("%s%s=%s\n", CONFIG_, sym->name, str); } } + } else if (input_mode == helpnewconfig) { + printf("-----\n"); + print_help(menu); + printf("-----\n"); + } else { if (!conf_cnt++) printf("*\n* Restart config...\n*\n"); @@ -459,6 +465,7 @@ {"alldefconfig", no_argument, NULL, alldefconfig}, {"randconfig", no_argument, NULL, randconfig}, {"listnewconfig", no_argument, NULL, listnewconfig}, + {"helpnewconfig", no_argument, NULL, helpnewconfig}, {"olddefconfig", no_argument, NULL, olddefconfig}, {NULL, 0, NULL, 0} }; @@ -469,6 +476,7 @@ printf("Usage: %s [-s] [option] \n", progname); printf("[option] is _one_ of the following:\n"); printf(" --listnewconfig List new options\n"); + printf(" --helpnewconfig List new options and help text\n"); printf(" --oldaskconfig Start a new configuration using a line-oriented program\n"); printf(" --oldconfig Update a configuration using a provided .config as base\n"); printf(" --syncconfig Similar to oldconfig but generates configuration in\n" @@ -543,6 +551,7 @@ case allmodconfig: case alldefconfig: case listnewconfig: + case helpnewconfig: case olddefconfig: break; case '?': @@ -576,6 +585,7 @@ case oldaskconfig: case oldconfig: case listnewconfig: + case helpnewconfig: case olddefconfig: conf_read(NULL); break; @@ -657,6 +667,7 @@ /* fall through */ case oldconfig: case listnewconfig: + case helpnewconfig: case syncconfig: /* Update until a loop caused no more changes */ do { @@ -675,7 +686,7 @@ defconfig_file); return 1; } - } else if (input_mode != listnewconfig) { + } else if (input_mode != listnewconfig && input_mode != helpnewconfig) { if (!no_conf_write && conf_write(NULL)) { fprintf(stderr, "\n*** Error during writing of the configuration.\n\n"); exit(1); diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c index 77ffff3..9f1de58 100644 --- a/scripts/kconfig/expr.c +++ b/scripts/kconfig/expr.c @@ -254,6 +254,13 @@ { int res, old_count; + /* + * A NULL expr is taken to be yes, but there's also a different way to + * represent yes. expr_is_yes() checks for either representation. + */ + if (!e1 || !e2) + return expr_is_yes(e1) && expr_is_yes(e2); + if (e1->type != e2->type) return 0; switch (e1->type) { diff --git a/scripts/kconfig/mconf-cfg.sh b/scripts/kconfig/mconf-cfg.sh index c812872..aa68ec9 100755 --- a/scripts/kconfig/mconf-cfg.sh +++ b/scripts/kconfig/mconf-cfg.sh @@ -44,4 +44,7 @@ echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev" echo >&2 "* depending on your distribution)." echo >&2 "*" +echo >&2 "* You may also need to install pkg-config to find the" +echo >&2 "* ncurses installed in a non-default location." +echo >&2 "*" exit 1 diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh index d924c51..63c8565 100755 --- a/scripts/kconfig/merge_config.sh +++ b/scripts/kconfig/merge_config.sh @@ -13,12 +13,12 @@ # Copyright (c) 2009-2010 Wind River Systems, Inc. # Copyright 2011 Linaro +set -e + clean_up() { rm -f $TMP_FILE rm -f $MERGE_FILE - exit } -trap clean_up HUP INT TERM usage() { echo "Usage: $0 [OPTIONS] [CONFIG [...]]" @@ -110,6 +110,9 @@ MERGE_FILE=$(mktemp ./.merge_tmp.config.XXXXXXXXXX) echo "Using $INITFILE as base" + +trap clean_up EXIT + cat $INITFILE > $TMP_FILE # Merge files, printing warnings on overridden values @@ -155,7 +158,6 @@ echo "#" echo "# merged configuration written to $KCONFIG_CONFIG (needs make)" echo "#" - clean_up exit fi @@ -177,7 +179,7 @@ for CFG in $(sed -n -e "$SED_CONFIG_EXP1" -e "$SED_CONFIG_EXP2" $TMP_FILE); do REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE) - ACTUAL_VAL=$(grep -w -e "$CFG" "$KCONFIG_CONFIG") + ACTUAL_VAL=$(grep -w -e "$CFG" "$KCONFIG_CONFIG" || true) if [ "x$REQUESTED_VAL" != "x$ACTUAL_VAL" ] ; then echo "Value requested for $CFG not in final .config" echo "Requested value: $REQUESTED_VAL" @@ -185,5 +187,3 @@ echo "" fi done - -clean_up diff --git a/scripts/kconfig/nconf-cfg.sh b/scripts/kconfig/nconf-cfg.sh index 001559e..c212255 100755 --- a/scripts/kconfig/nconf-cfg.sh +++ b/scripts/kconfig/nconf-cfg.sh @@ -44,4 +44,7 @@ echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev" echo >&2 "* depending on your distribution)." echo >&2 "*" +echo >&2 "* You may also need to install pkg-config to find the" +echo >&2 "* ncurses installed in a non-default location." +echo >&2 "*" exit 1 diff --git a/scripts/kconfig/parser.y b/scripts/kconfig/parser.y index 60936c7..b3eff96 100644 --- a/scripts/kconfig/parser.y +++ b/scripts/kconfig/parser.y @@ -727,5 +727,4 @@ } } -#include "util.c" #include "menu.c"