summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-04-16 18:40:42 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-04-16 18:40:42 +0200
commit049a1415c609a1134a15c5f8c4b0a4fe09514f10 (patch)
treedb5de9a483a2a421d3604e1e8b183b05252cfd24
parenta142fa62b8d3c82f8da95dfb136ca986e7d31dd4 (diff)
parent46312a239f193d41b2862a0b9e57e7bae3ec2f03 (diff)
downloadbarebox-049a1415c609a1134a15c5f8c4b0a4fe09514f10.tar.gz
barebox-049a1415c609a1134a15c5f8c4b0a4fe09514f10.tar.xz
Merge branch 'for-next/misc'
-rw-r--r--arch/arm/boards/archosg9/lowlevel.c2
-rw-r--r--arch/arm/boards/archosg9/mux.c3
-rw-r--r--arch/arm/boards/archosg9/mux.h2
-rw-r--r--arch/arm/boards/panda/lowlevel.c6
-rw-r--r--arch/arm/boards/panda/mux.c4
-rw-r--r--arch/arm/boards/panda/mux.h6
-rw-r--r--arch/arm/boards/phytec-phycard-omap4/lowlevel.c6
-rw-r--r--arch/arm/boards/phytec-phycard-omap4/mux.c4
-rw-r--r--arch/arm/boards/phytec-phycard-omap4/mux.h6
-rw-r--r--arch/arm/boards/phytec-phycore-omap4460/lowlevel.c6
-rw-r--r--arch/arm/boards/phytec-phycore-omap4460/mux.c4
-rw-r--r--arch/arm/boards/phytec-phycore-omap4460/mux.h6
-rw-r--r--arch/arm/dts/rk3288-phycore-som.dts2
-rw-r--r--arch/ppc/Makefile1
-rw-r--r--arch/riscv/Makefile2
-rw-r--r--commands/of_property.c11
-rw-r--r--common/Kconfig4
-rw-r--r--common/bbu.c2
-rw-r--r--common/block.c2
-rw-r--r--common/blspec.c16
-rw-r--r--common/boot.c2
-rw-r--r--common/bootsource.c4
-rw-r--r--common/clock.c2
-rw-r--r--common/console_common.c2
-rw-r--r--common/dlmalloc.c12
-rw-r--r--common/efi-devicepath.c2
-rw-r--r--common/hush.c4
-rw-r--r--common/imx-bbu-nand-fcb.c4
-rw-r--r--common/memtest.c2
-rw-r--r--common/oftree.c4
-rw-r--r--common/resource.c2
-rw-r--r--common/serdev.c6
-rw-r--r--common/state/state.c2
-rw-r--r--common/ubiformat.c2
-rw-r--r--common/uimage.c2
-rw-r--r--drivers/mci/mci-core.c10
-rw-r--r--drivers/of/base.c33
-rw-r--r--drivers/of/overlay.c2
-rw-r--r--drivers/of/resolver.c4
-rw-r--r--drivers/serial/serial_ns16550_pci.c8
-rw-r--r--include/linux/libfdt.h2
-rw-r--r--include/linux/libfdt_env.h7
-rw-r--r--scripts/Makefile.build6
-rw-r--r--scripts/Makefile.clean19
-rw-r--r--scripts/Makefile.host42
-rw-r--r--scripts/Makefile.lib40
-rw-r--r--scripts/basic/.gitignore2
-rw-r--r--scripts/basic/Makefile19
-rw-r--r--scripts/basic/fixdep.c61
-rwxr-xr-xscripts/checkpatch.pl4
-rw-r--r--scripts/kconfig/Makefile20
-rw-r--r--scripts/kconfig/conf.c13
-rw-r--r--scripts/kconfig/expr.c7
-rwxr-xr-xscripts/kconfig/mconf-cfg.sh3
-rwxr-xr-xscripts/kconfig/merge_config.sh12
-rwxr-xr-xscripts/kconfig/nconf-cfg.sh3
-rw-r--r--scripts/kconfig/parser.y1
57 files changed, 271 insertions, 194 deletions
diff --git a/arch/arm/boards/archosg9/lowlevel.c b/arch/arm/boards/archosg9/lowlevel.c
index 2a93428462..b1045a44ed 100644
--- a/arch/arm/boards/archosg9/lowlevel.c
+++ b/arch/arm/boards/archosg9/lowlevel.c
@@ -48,7 +48,7 @@ static noinline void archosg9_init_lowlevel(void)
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 e9cb3c43b0..ce3cae38cb 100644
--- a/arch/arm/boards/archosg9/mux.c
+++ b/arch/arm/boards/archosg9/mux.c
@@ -257,7 +257,8 @@ static const struct pad_conf_entry wkup_padconf_array[] = {
{ 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 97297b64bb..4ee5415871 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 006fb627dd..1ed2b89f2f 100644
--- a/arch/arm/boards/panda/lowlevel.c
+++ b/arch/arm/boards/panda/lowlevel.c
@@ -29,9 +29,9 @@
#include <asm/barebox-arm.h>
#include <asm/barebox-arm-head.h>
-#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 @@ static void noinline panda_init_lowlevel(void)
/* 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 8225aa615d..76d1c51005 100644
--- a/arch/arm/boards/panda/mux.c
+++ b/arch/arm/boards/panda/mux.c
@@ -5,6 +5,8 @@
#include <mach/omap4-mux.h>
#include <mach/omap4-clock.h>
+#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 @@ static const struct pad_conf_entry wkup_padconf_array[] = {
{ 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 0000000000..11f2848a27
--- /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 c49c4ca841..3035cca7fa 100644
--- a/arch/arm/boards/phytec-phycard-omap4/lowlevel.c
+++ b/arch/arm/boards/phytec-phycard-omap4/lowlevel.c
@@ -29,9 +29,9 @@
#include <asm/barebox-arm.h>
#include <asm/barebox-arm-head.h>
-#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 @@ static noinline void pcaaxl2_init_lowlevel(void)
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 a31d995767..564944d1ba 100644
--- a/arch/arm/boards/phytec-phycard-omap4/mux.c
+++ b/arch/arm/boards/phytec-phycard-omap4/mux.c
@@ -5,6 +5,8 @@
#include <mach/omap4-mux.h>
#include <mach/omap4-clock.h>
+#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 @@ static const struct pad_conf_entry wkup_padconf_array[] = {
{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 0000000000..8b1a3d37e9
--- /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 6511dae9d4..8c25eab7ce 100644
--- a/arch/arm/boards/phytec-phycore-omap4460/lowlevel.c
+++ b/arch/arm/boards/phytec-phycore-omap4460/lowlevel.c
@@ -29,6 +29,8 @@
#include <asm/barebox-arm.h>
#include <asm/barebox-arm-head.h>
+#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 @@ static void noinline pcm049_init_lowlevel(void)
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 fda4c519b8..ca4ccf39f0 100644
--- a/arch/arm/boards/phytec-phycore-omap4460/mux.c
+++ b/arch/arm/boards/phytec-phycore-omap4460/mux.c
@@ -5,6 +5,8 @@
#include <mach/omap4-mux.h>
#include <mach/omap4-clock.h>
+#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 @@ static const struct pad_conf_entry wkup_padconf_array[] = {
{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 0000000000..64d4478b2c
--- /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 dd74bcfb11..65c53895c4 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 2fb9b14422..ebf60edede 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 643c0bc8eb..fa8a173d8a 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 31e9b71dd7..1d7ba181d5 100644
--- a/commands/of_property.c
+++ b/commands/of_property.c
@@ -315,7 +315,7 @@ static int do_of_property(int argc, char *argv[])
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 @@ static int do_of_property(int argc, char *argv[])
}
}
- 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 02ef3631e0..400c0553cf 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -892,7 +892,7 @@ config DEFAULT_ENVIRONMENT_PATH
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 @@ config RESET_SOURCE
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 b976b99d7c..1755615cb5 100644
--- a/common/bbu.c
+++ b/common/bbu.c
@@ -361,7 +361,7 @@ err_close:
*
* 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 02be80d7cc..39275dc418 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 7fb62d310f..1a6d581f5a 100644
--- a/common/blspec.c
+++ b/common/blspec.c
@@ -120,7 +120,7 @@ static void blspec_apply_oftree_overlays(const char *overlays,
*
* 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 @@ static bool entry_is_of_compatible(struct blspec_entry *entry)
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 @@ static bool entry_is_match_machine_id(struct blspec_entry *entry)
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 @@ err_out:
* 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 @@ static int blspec_scan_ubi(struct bootentries *bootentries, struct cdev *cdev)
* 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 @@ static int blspec_scan_cdev(struct bootentries *bootentries, struct cdev *cdev)
*
* 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 @@ int blspec_scan_devices(struct bootentries *bootentries)
* 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 @@ int blspec_scan_device(struct bootentries *bootentries, struct device_d *dev)
* 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 dcbe5cc2ec..f546fce62c 100644
--- a/common/boot.c
+++ b/common/boot.c
@@ -205,7 +205,7 @@ static int bootscript_create_entry(struct bootentries *bootentries, const char *
/*
* 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 1f2bf87e99..fdbc4cd638 100644
--- a/common/bootsource.c
+++ b/common/bootsource.c
@@ -98,8 +98,8 @@ char *bootsource_get_alias_name(void)
}
/*
- * 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 2b218fb6af..1a4931ca83 100644
--- a/common/clock.c
+++ b/common/clock.c
@@ -109,7 +109,7 @@ EXPORT_SYMBOL(get_time_ns);
* 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 6916f651e5..6d017538bc 100644
--- a/common/console_common.c
+++ b/common/console_common.c
@@ -63,7 +63,7 @@ static void log_del(struct log_entry *log)
* @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 9c33cc2c95..ae10c9ae30 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 @@ nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
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 @@ static void malloc_extend_top(INTERNAL_SIZE_T nb)
/* 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 @@ void *memalign(size_t alignment, size_t bytes)
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 @@ History:
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 3db2cea061..f17b9294cc 100644
--- a/common/efi-devicepath.c
+++ b/common/efi-devicepath.c
@@ -473,7 +473,7 @@ unpack_device_path(struct efi_device_path *dev_path)
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 68c3eccdfc..c24b2c7cd2 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -761,7 +761,7 @@ static int run_pipe_real(struct p_context *ctx, struct pipe *pi)
/*
* 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 @@ char *shell_expand(char *str)
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 aa3f733912..0629ae5b73 100644
--- a/common/imx-bbu-nand-fcb.c
+++ b/common/imx-bbu-nand-fcb.c
@@ -323,7 +323,7 @@ static struct fcb_block *read_fcb_hamming_13_8(void *rawpage)
* 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 @@ static int imx_bbu_nand_update(struct bbu_handler *handler, struct bbu_data *dat
* ----------------------
*
* 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 44ddedd3d4..7b7a9eef5a 100644
--- a/common/memtest.c
+++ b/common/memtest.c
@@ -208,7 +208,7 @@ int mem_test_bus_integrity(resource_size_t _start,
* 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 09cb660212..36906e86fc 100644
--- a/common/oftree.c
+++ b/common/oftree.c
@@ -151,6 +151,10 @@ static int of_fixup_bootargs(struct device_node *root, void *unused)
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 abc0814d23..16430b78eb 100644
--- a/common/resource.c
+++ b/common/resource.c
@@ -34,7 +34,7 @@ static int init_resource(struct resource *res, const char *name)
/*
* 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 3e0da0846e..c87b8a8c17 100644
--- a/common/serdev.c
+++ b/common/serdev.c
@@ -141,8 +141,8 @@ static int serdev_device_reader_receive_buf(struct serdev_device *serdev,
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 @@ static int serdev_device_reader_receive_buf(struct serdev_device *serdev,
* @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 1822f37f3e..d42920985d 100644
--- a/common/state/state.c
+++ b/common/state/state.c
@@ -699,7 +699,7 @@ struct state *state_by_name(const char *name)
/*
* 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 72b9b6f2eb..cfaa68f164 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 35bfb10b06..3470d9bc72 100644
--- a/common/uimage.c
+++ b/common/uimage.c
@@ -136,7 +136,7 @@ struct uimage_handle *uimage_open(const char *filename)
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 34aaee54f9..f3718327f1 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -156,7 +156,7 @@ static int mci_block_write(struct mci *mci, const void *src, int blocknum,
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 @@ static int mci_sd_read(struct block_device *blk, void *buffer, int block,
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_set_probe(struct param_d *param, void *priv)
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 cf3bdbfe8c..72a3df4e6f 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -2044,6 +2044,8 @@ int of_set_property(struct device_node *np, const char *name, const void *val, i
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 @@ int of_add_memory(struct device_node *node, bool dump)
return -ENXIO;
while (!of_address_to_resource(node, n, &res)) {
- if (!resource_size(&res)) {
- n++;
+ n++;
+ if (!resource_size(&res))
continue;
- }
- of_add_memory_bank(node, dump, n,
+ of_add_memory_bank(node, dump, mem_bank_num,
res.start, resource_size(&res));
- n++;
+ mem_bank_num++;
}
return 0;
@@ -2086,9 +2087,23 @@ const struct of_device_id of_default_bus_match_table[] = {
}
};
+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 @@ int of_probe(void)
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 a35eddfa08..b79dbff94d 100644
--- a/drivers/of/overlay.c
+++ b/drivers/of/overlay.c
@@ -162,7 +162,7 @@ int of_overlay_apply_tree(struct device_node *root,
{
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 9107c1fbb6..4f720cf860 100644
--- a/drivers/of/resolver.c
+++ b/drivers/of/resolver.c
@@ -160,9 +160,7 @@ static int adjust_local_phandle_references(struct device_node *local_fixups,
}
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 392a2810d8..c29cfc5a75 100644
--- a/drivers/serial/serial_ns16550_pci.c
+++ b/drivers/serial/serial_ns16550_pci.c
@@ -3670,9 +3670,9 @@ pciserial_init_ports(struct pci_dev *dev, const struct pciserial_board *board)
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 @@ pciserial_init_ports(struct pci_dev *dev, const struct pciserial_board *board)
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 ef2467213b..90ed4ebfa6 100644
--- a/include/linux/libfdt.h
+++ b/include/linux/libfdt.h
@@ -3,6 +3,6 @@
#define _INCLUDE_LIBFDT_H_
#include <linux/libfdt_env.h>
-#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 bac4670d6d..cea8574a29 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 <linux/kernel.h> /* For INT_MAX */
+#include <linux/limits.h> /* For INT_MAX */
#include <linux/string.h>
#include <asm/byteorder.h>
+#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 @@ typedef __be64 fdt64_t;
#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 db687d5f9e..a6ed83e6d2 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -16,6 +16,8 @@ lib-y :=
lib-m :=
pbl-y :=
always :=
+always-y :=
+always-m :=
targets :=
subdir-y :=
subdir-m :=
@@ -43,7 +45,7 @@ include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-di
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 @@ endif
__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 41712f8975..6e6c9ef7c6 100644
--- a/scripts/Makefile.clean
+++ b/scripts/Makefile.clean
@@ -36,8 +36,8 @@ subdir-ymn := $(addprefix $(obj)/,$(subdir-ymn))
# 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 @@ __clean-files := $(wildcard \
$(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 8a88cbc9ae..8f4d62f22e 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 @@ obj-dirs += $(host-objdirs)
# 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 @@ hostcxx_flags = -Wp,-MD,$(depfile) $(__hostcxx_flags)
# 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-csingle): $(obj)/%: $(src)/%.c FORCE
# 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 @@ $(host-cobjs): $(obj)/%.o: $(src)/%.c FORCE
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 9aa8be535f..d4c2ed15b6 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 @@ obj-dirs := $(dir $(multi-objs) $(obj-y) $(pbl-y))
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 @@ subdir-ym := $(addprefix $(obj)/,$(subdir-ym))
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 @@ basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
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 @@ $(foreach m, $(notdir $1), \
$(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 dc24f5f4c7..98ae1f5095 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 9e92d899a5..290dd27d28 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 facbd603ad..877ca2c882 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 <unistd.h>
#include <fcntl.h>
#include <string.h>
+#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
@@ -110,13 +106,43 @@ static void usage(void)
}
/*
+ * 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 @@ static void print_dep(const char *m, int slen, const char *dir)
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 @@ static void parse_config_file(const char *p)
}
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 void *read_file(const char *filename)
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 @@ static void parse_dep_file(char *m, const char *target)
*/
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 @@ static void parse_dep_file(char *m, const char *target)
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 @@ int main(int argc, char *argv[])
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 65c2cfad45..b8bd4e1a59 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3010,7 +3010,7 @@ sub process {
# 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 @@ sub process {
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 7656e1137b..2f1a59fa51 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -66,7 +66,9 @@ localyesconfig localmodconfig: $(obj)/conf
# 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 @@ testconfig: $(obj)/conf
$(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 @@ help:
@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 @@ $(obj)/nconf.o $(obj)/nconf.gui.o: $(obj)/nconf-cfg
# 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 40e16e871a..1f89bf1558 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -32,6 +32,7 @@ enum input_mode {
defconfig,
savedefconfig,
listnewconfig,
+ helpnewconfig,
olddefconfig,
};
static enum input_mode input_mode = oldaskconfig;
@@ -434,6 +435,11 @@ static void check_conf(struct menu *menu)
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 @@ static struct option long_opts[] = {
{"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 @@ static void conf_usage(const char *progname)
printf("Usage: %s [-s] [option] <kconfig-file>\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 @@ int main(int ac, char **av)
case allmodconfig:
case alldefconfig:
case listnewconfig:
+ case helpnewconfig:
case olddefconfig:
break;
case '?':
@@ -576,6 +585,7 @@ int main(int ac, char **av)
case oldaskconfig:
case oldconfig:
case listnewconfig:
+ case helpnewconfig:
case olddefconfig:
conf_read(NULL);
break;
@@ -657,6 +667,7 @@ int main(int ac, char **av)
/* fall through */
case oldconfig:
case listnewconfig:
+ case helpnewconfig:
case syncconfig:
/* Update until a loop caused no more changes */
do {
@@ -675,7 +686,7 @@ int main(int ac, char **av)
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 77ffff3a05..9f1de58e9f 100644
--- a/scripts/kconfig/expr.c
+++ b/scripts/kconfig/expr.c
@@ -254,6 +254,13 @@ static int expr_eq(struct expr *e1, struct expr *e2)
{
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 c812872d7f..aa68ec9562 100755
--- a/scripts/kconfig/mconf-cfg.sh
+++ b/scripts/kconfig/mconf-cfg.sh
@@ -44,4 +44,7 @@ echo >&2 "* Unable to find the ncurses package."
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 d924c51d28..63c8565206 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 @@ TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
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 @@ if [ "$RUNMAKE" = "false" ]; then
echo "#"
echo "# merged configuration written to $KCONFIG_CONFIG (needs make)"
echo "#"
- clean_up
exit
fi
@@ -177,7 +179,7 @@ make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET
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 @@ for CFG in $(sed -n -e "$SED_CONFIG_EXP1" -e "$SED_CONFIG_EXP2" $TMP_FILE); do
echo ""
fi
done
-
-clean_up
diff --git a/scripts/kconfig/nconf-cfg.sh b/scripts/kconfig/nconf-cfg.sh
index 001559ef0a..c212255070 100755
--- a/scripts/kconfig/nconf-cfg.sh
+++ b/scripts/kconfig/nconf-cfg.sh
@@ -44,4 +44,7 @@ echo >&2 "* Unable to find the ncurses package."
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 60936c7686..b3eff9613c 100644
--- a/scripts/kconfig/parser.y
+++ b/scripts/kconfig/parser.y
@@ -727,5 +727,4 @@ void zconfdump(FILE *out)
}
}
-#include "util.c"
#include "menu.c"