summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2021-02-22 10:39:39 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2021-02-22 10:39:39 +0100
commite59a93e1d5689ae174051f4179f3a8a283492f46 (patch)
treed9938ce3c87eab8b88e27e1c72f3b790bc18eb97
parent9eff9ce48c2e2398a52f0d9d572c0a15f1a50de9 (diff)
parent87d6abb654b993948a9eea2169ffe7d5fc631154 (diff)
downloadbarebox-e59a93e1d5689ae174051f4179f3a8a283492f46.tar.gz
barebox-e59a93e1d5689ae174051f4179f3a8a283492f46.tar.xz
Merge branch 'for-next/misc'
-rw-r--r--.gitignore1
-rw-r--r--Documentation/user/state.rst3
-rw-r--r--Makefile16
-rw-r--r--arch/arm/Makefile2
-rw-r--r--arch/arm/cpu/board-dt-2nd.c72
-rw-r--r--arch/sandbox/board/hostfile.c17
-rw-r--r--arch/sandbox/configs/sandbox_defconfig1
-rw-r--r--arch/sandbox/mach-sandbox/include/mach/linux.h2
-rw-r--r--arch/sandbox/os/Makefile2
-rw-r--r--arch/sandbox/os/common.c2
-rw-r--r--commands/readline.c10
-rw-r--r--drivers/of/overlay.c11
-rw-r--r--drivers/usb/otg/otgdev.c63
-rw-r--r--drivers/watchdog/wd_core.c29
-rw-r--r--fs/fs.c42
-rw-r--r--include/efi.h3
-rw-r--r--include/pbl.h2
-rw-r--r--include/watchdog.h3
-rw-r--r--pbl/Makefile1
-rw-r--r--pbl/fdt.c70
-rw-r--r--scripts/bareboxcrc32.c19
-rw-r--r--scripts/bareboxenv.c19
-rw-r--r--scripts/bareboximd.c16
-rwxr-xr-xscripts/clang-tools/gen_compile_commands.py237
-rw-r--r--scripts/imx/imx.c16
-rw-r--r--scripts/include/asm-generic/barrier.h11
-rw-r--r--scripts/include/linux/log2.h14
-rw-r--r--scripts/kwbimage.c16
-rw-r--r--scripts/mk-omap-image.c24
-rw-r--r--scripts/mkimage.c22
-rw-r--r--scripts/mkublheader.c23
-rw-r--r--scripts/mod/sumversion.c16
-rw-r--r--scripts/omap3-usb-loader.c20
-rw-r--r--scripts/omap4_usbboot.c16
-rw-r--r--scripts/omap_signGP.c14
-rw-r--r--scripts/s5p_cksum.c15
-rw-r--r--scripts/setupmbr/setupmbr.c17
-rw-r--r--scripts/tegra/bct_dump.c17
-rw-r--r--scripts/tegra/cbootimage.c17
-rw-r--r--scripts/tegra/cbootimage.h17
-rw-r--r--scripts/tegra/context.c17
-rw-r--r--scripts/tegra/context.h17
-rw-r--r--scripts/tegra/crypto.c17
-rw-r--r--scripts/tegra/crypto.h17
-rw-r--r--scripts/tegra/data_layout.c17
-rw-r--r--scripts/tegra/data_layout.h17
-rw-r--r--scripts/tegra/nvaes_ref.h17
-rw-r--r--scripts/tegra/parse.c17
-rw-r--r--scripts/tegra/parse.h17
-rw-r--r--scripts/tegra/set.c17
-rw-r--r--scripts/tegra/set.h17
-rw-r--r--scripts/tegra/t114/nvbctlib_t114.c17
-rw-r--r--scripts/tegra/t114/nvboot_bct_t114.h17
-rw-r--r--scripts/tegra/t114/nvboot_sdram_param_t114.h17
-rw-r--r--scripts/tegra/t114/parse_t114.c17
-rw-r--r--scripts/tegra/t124/nvbctlib_t124.c17
-rw-r--r--scripts/tegra/t124/nvboot_bct_t124.h17
-rw-r--r--scripts/tegra/t124/nvboot_sdram_param_t124.h17
-rw-r--r--scripts/tegra/t124/parse_t124.c17
-rw-r--r--scripts/tegra/t20/nvbctlib_t20.c17
-rw-r--r--scripts/tegra/t20/nvboot_bct_t20.h17
-rw-r--r--scripts/tegra/t20/nvboot_sdram_param_t20.h17
-rw-r--r--scripts/tegra/t20/parse_t20.c17
-rw-r--r--scripts/tegra/t30/nvbctlib_t30.c17
-rw-r--r--scripts/tegra/t30/nvboot_bct_t30.h17
-rw-r--r--scripts/tegra/t30/nvboot_sdram_param_t30.h17
-rw-r--r--scripts/tegra/t30/parse_t30.c17
-rw-r--r--scripts/zynq_mkimage.c15
68 files changed, 589 insertions, 803 deletions
diff --git a/.gitignore b/.gitignore
index 7fa2948bf4..d7a37b3c9b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -87,3 +87,4 @@ GTAGS
/allno.config
/allrandom.config
/allyes.config
+/compile_commands.json
diff --git a/Documentation/user/state.rst b/Documentation/user/state.rst
index 54aa396257..a0e27d4fe8 100644
--- a/Documentation/user/state.rst
+++ b/Documentation/user/state.rst
@@ -579,6 +579,9 @@ content, its backend-type and *state* variable layout.
};
};
+If the *state* variable set is set to be located in a GPT partition, use
+``4778ed65-bf42-45fa-9c5b-287a1dc4aab1`` as the partition type GUID.
+
SRAM
####
diff --git a/Makefile b/Makefile
index de33204366..32d911ba78 100644
--- a/Makefile
+++ b/Makefile
@@ -541,7 +541,7 @@ endif
# in addition to whatever we do anyway.
# Just "make" or "make all" shall build modules as well
-ifneq ($(filter all _all modules,$(MAKECMDGOALS)),)
+ifneq ($(filter all _all modules %compile_commands.json,$(MAKECMDGOALS)),)
KBUILD_MODULES := 1
endif
@@ -1104,7 +1104,7 @@ endif # CONFIG_MODULES
CLEAN_DIRS += $(MODVERDIR)
CLEAN_FILES += barebox System.map include/generated/barebox_default_env.h \
.tmp_version .tmp_barebox* barebox.bin barebox.map barebox.S \
- .tmp_kallsyms* barebox.ldr \
+ .tmp_kallsyms* barebox.ldr compile_commands.json \
scripts/bareboxenv-target barebox-flash-image \
barebox.srec barebox.s5p barebox.ubl barebox.zynq \
barebox.uimage barebox.spi barebox.kwb barebox.kwbuart \
@@ -1162,6 +1162,18 @@ distclean: mrproper
-o -name 'core' \) \
-type f -print | xargs rm -f
+# Clang Tooling
+# ---------------------------------------------------------------------------
+
+quiet_cmd_gen_compile_commands = GEN $@
+ cmd_gen_compile_commands = $(PYTHON3) $< -a $(AR) -o $@ $(filter-out $<, $(real-prereqs))
+
+compile_commands.json: scripts/clang-tools/gen_compile_commands.py \
+ $(BAREBOX_OBJS) $(if $(CONFIG_PBL_IMAGE),$(BAREBOX_PBL_OBJS),) FORCE
+ $(call if_changed,gen_compile_commands)
+
+PHONY += compile_commands.json
+
# Brief documentation of the typical targets used
# ---------------------------------------------------------------------------
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 96613cc5ba..9dc0897e58 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -54,7 +54,7 @@ ifeq ($(CONFIG_CPU_V8), y)
CFLAGS_ABI :=-mabi=lp64
else
ifeq ($(CONFIG_AEABI),y)
-CFLAGS_ABI :=-mabi=aapcs-linux -mno-thumb-interwork
+CFLAGS_ABI :=-mabi=aapcs-linux
else
CFLAGS_ABI :=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) $(call cc-option,-mno-thumb-interwork,)
endif
diff --git a/arch/arm/cpu/board-dt-2nd.c b/arch/arm/cpu/board-dt-2nd.c
index 4e7d575e8a..bb13180785 100644
--- a/arch/arm/cpu/board-dt-2nd.c
+++ b/arch/arm/cpu/board-dt-2nd.c
@@ -8,73 +8,7 @@
#include <debug_ll.h>
#include <asm/cache.h>
#include <asm/sections.h>
-#include <linux/libfdt.h>
-
-static void of_find_mem(void *fdt, unsigned long *membase, unsigned long *memsize)
-{
- const __be32 *nap, *nsp, *reg;
- uint32_t na, ns;
- uint64_t memsize64, membase64;
- int node, size, i;
-
- /* Make sure FDT blob is sane */
- if (fdt_check_header(fdt) != 0) {
- pr_err("Invalid device tree blob\n");
- goto err;
- }
-
- /* Find the #address-cells and #size-cells properties */
- node = fdt_path_offset(fdt, "/");
- if (node < 0) {
- pr_err("Cannot find root node\n");
- goto err;
- }
-
- nap = fdt_getprop(fdt, node, "#address-cells", &size);
- if (!nap || (size != 4)) {
- pr_err("Cannot find #address-cells property");
- goto err;
- }
- na = fdt32_to_cpu(*nap);
-
- nsp = fdt_getprop(fdt, node, "#size-cells", &size);
- if (!nsp || (size != 4)) {
- pr_err("Cannot find #size-cells property");
- goto err;
- }
- ns = fdt32_to_cpu(*nap);
-
- /* Find the memory range */
- node = fdt_node_offset_by_prop_value(fdt, -1, "device_type",
- "memory", sizeof("memory"));
- if (node < 0) {
- pr_err("Cannot find memory node\n");
- goto err;
- }
-
- reg = fdt_getprop(fdt, node, "reg", &size);
- if (size < (na + ns) * sizeof(u32)) {
- pr_err("cannot get memory range\n");
- goto err;
- }
-
- membase64 = 0;
- for (i = 0; i < na; i++)
- membase64 = (membase64 << 32) | fdt32_to_cpu(*reg++);
-
- /* get the memsize and truncate it to under 4G on 32 bit machines */
- memsize64 = 0;
- for (i = 0; i < ns; i++)
- memsize64 = (memsize64 << 32) | fdt32_to_cpu(*reg++);
-
- *membase = membase64;
- *memsize = memsize64;
-
- return;
-err:
- pr_err("No memory, cannot continue\n");
- while (1);
-}
+#include <pbl.h>
#ifdef CONFIG_CPU_V8
@@ -85,7 +19,7 @@ static noinline void dt_2nd_continue_aarch64(void *fdt)
if (!fdt)
hang();
- of_find_mem(fdt, &membase, &memsize);
+ fdt_find_mem(fdt, &membase, &memsize);
barebox_arm_entry(membase, memsize, fdt);
}
@@ -114,7 +48,7 @@ static noinline void dt_2nd_continue(void *fdt)
if (!fdt)
hang();
- of_find_mem(fdt, &membase, &memsize);
+ fdt_find_mem(fdt, &membase, &memsize);
barebox_arm_entry(membase, memsize, fdt);
}
diff --git a/arch/sandbox/board/hostfile.c b/arch/sandbox/board/hostfile.c
index d63f51eb23..4fdf2b317d 100644
--- a/arch/sandbox/board/hostfile.c
+++ b/arch/sandbox/board/hostfile.c
@@ -102,21 +102,18 @@ static int hf_probe(struct device_d *dev)
{
struct device_node *np = dev->device_node;
struct hf_priv *priv = xzalloc(sizeof(*priv));
- struct resource *res;
struct cdev *cdev;
bool is_blockdev;
- resource_size_t size;
+ u64 reg[2];
int err;
- res = dev_get_resource(dev, IORESOURCE_MEM, 0);
- if (IS_ERR(res))
- return PTR_ERR(res);
-
- size = resource_size(res);
-
if (!np)
return -ENODEV;
+ err = of_property_read_u64_array(np, "reg", reg, ARRAY_SIZE(reg));
+ if (err)
+ return err;
+
of_property_read_u32(np, "barebox,fd", &priv->fd);
err = of_property_read_string(np, "barebox,filename",
@@ -141,7 +138,7 @@ static int hf_probe(struct device_d *dev)
priv->blk.dev = dev;
priv->blk.ops = &hf_blk_ops;
priv->blk.blockbits = SECTOR_SHIFT;
- priv->blk.num_blocks = size / SECTOR_SIZE;
+ priv->blk.num_blocks = reg[1] / SECTOR_SIZE;
err = blockdevice_register(&priv->blk);
if (err)
@@ -156,7 +153,7 @@ static int hf_probe(struct device_d *dev)
cdev->name = np->name;
cdev->dev = dev;
cdev->ops = &hf_cdev_ops;
- cdev->size = size;
+ cdev->size = reg[1];
cdev->priv = priv;
err = devfs_create(cdev);
diff --git a/arch/sandbox/configs/sandbox_defconfig b/arch/sandbox/configs/sandbox_defconfig
index ca24d81aca..dcd0557326 100644
--- a/arch/sandbox/configs/sandbox_defconfig
+++ b/arch/sandbox/configs/sandbox_defconfig
@@ -1,3 +1,4 @@
+CONFIG_MALLOC_SIZE=0x1000000
CONFIG_HUSH_FANCY_PROMPT=y
CONFIG_CMDLINE_EDITING=y
CONFIG_AUTO_COMPLETE=y
diff --git a/arch/sandbox/mach-sandbox/include/mach/linux.h b/arch/sandbox/mach-sandbox/include/mach/linux.h
index b26bfc24a2..f047c83e17 100644
--- a/arch/sandbox/mach-sandbox/include/mach/linux.h
+++ b/arch/sandbox/mach-sandbox/include/mach/linux.h
@@ -17,7 +17,7 @@ int linux_open_hostfile(struct hf_info *hf);
int linux_read(int fd, void *buf, size_t count);
int linux_read_nonblock(int fd, void *buf, size_t count);
ssize_t linux_write(int fd, const void *buf, size_t count);
-off_t linux_lseek(int fildes, off_t offset);
+loff_t linux_lseek(int fildes, loff_t offset);
int linux_tstc(int fd);
void __attribute__((noreturn)) linux_exit(void);
void linux_hang(void);
diff --git a/arch/sandbox/os/Makefile b/arch/sandbox/os/Makefile
index 15d688bfdd..9a264ca314 100644
--- a/arch/sandbox/os/Makefile
+++ b/arch/sandbox/os/Makefile
@@ -4,7 +4,7 @@ machdirs := $(patsubst %,arch/sandbox/mach-%/,$(machine-y))
KBUILD_CPPFLAGS = $(patsubst %,-I$(srctree)/%include,$(machdirs))
-KBUILD_CPPFLAGS += -DCONFIG_MALLOC_SIZE=$(CONFIG_MALLOC_SIZE)
+KBUILD_CPPFLAGS += -DCONFIG_MALLOC_SIZE=$(CONFIG_MALLOC_SIZE) -D_FILE_OFFSET_BITS=64
KBUILD_CFLAGS := -Wall
diff --git a/arch/sandbox/os/common.c b/arch/sandbox/os/common.c
index 56c2d05193..f6b352f2d6 100644
--- a/arch/sandbox/os/common.c
+++ b/arch/sandbox/os/common.c
@@ -220,7 +220,7 @@ ssize_t linux_write(int fd, const void *buf, size_t count)
return write(fd, buf, count);
}
-off_t linux_lseek(int fd, off_t offset)
+loff_t linux_lseek(int fd, loff_t offset)
{
return lseek(fd, offset, SEEK_SET);
}
diff --git a/commands/readline.c b/commands/readline.c
index ef54b5e92f..403ac8563a 100644
--- a/commands/readline.c
+++ b/commands/readline.c
@@ -4,6 +4,7 @@
#include <common.h>
#include <command.h>
#include <malloc.h>
+#include <slice.h>
#include <xfuncs.h>
#include <environment.h>
@@ -14,15 +15,20 @@ static int do_readline(int argc, char *argv[])
if (argc < 3)
return COMMAND_ERROR_USAGE;
+ command_slice_release();
+
if (readline(argv[1], buf, CONFIG_CBSIZE) < 0) {
+ command_slice_acquire();
free(buf);
- return 1;
+ return COMMAND_ERROR;
}
+ command_slice_acquire();
+
setenv(argv[2], buf);
free(buf);
- return 0;
+ return COMMAND_SUCCESS;
}
BAREBOX_CMD_HELP_START(readline)
diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
index 8bf632c1e7..8f4ee3f0a2 100644
--- a/drivers/of/overlay.c
+++ b/drivers/of/overlay.c
@@ -109,7 +109,7 @@ static char *of_overlay_fix_path(struct device_node *root,
}
static void of_overlay_apply_symbols(struct device_node *root,
- struct device_node *overlay)
+ struct device_node *overlay)
{
const char *old_path;
char *new_path;
@@ -120,8 +120,13 @@ static void of_overlay_apply_symbols(struct device_node *root,
root_symbols = of_get_child_by_name(root, "__symbols__");
overlay_symbols = of_get_child_by_name(overlay, "__symbols__");
- if (!overlay_symbols || !root_symbols) {
- pr_info("overlay/root doesn't have a __symbols__ node\n");
+ if (!overlay_symbols) {
+ pr_debug("overlay doesn't have a __symbols__ node\n");
+ return;
+ }
+
+ if (!root_symbols) {
+ pr_info("root doesn't have a __symbols__ node\n");
return;
}
diff --git a/drivers/usb/otg/otgdev.c b/drivers/usb/otg/otgdev.c
index 52f43b75d2..c233315d91 100644
--- a/drivers/usb/otg/otgdev.c
+++ b/drivers/usb/otg/otgdev.c
@@ -4,28 +4,33 @@
#include <driver.h>
#include <usb/usb.h>
-static int (*set_mode_callback)(void *ctx, enum usb_dr_mode mode);
-static unsigned int otg_mode;
+struct otg_mode {
+ struct device_d dev;
+ unsigned int var_mode;
+ unsigned int cur_mode;
+ int (*set_mode_callback)(void *ctx, enum usb_dr_mode mode);
+ void *ctx;
+};
static int otg_set_mode(struct param_d *param, void *ctx)
{
- static int cur_mode = USB_DR_MODE_OTG;
+ struct otg_mode *otg = ctx;
int ret;
- if (otg_mode == USB_DR_MODE_UNKNOWN)
+ if (otg->var_mode == USB_DR_MODE_UNKNOWN)
return -EINVAL;
- if (otg_mode == cur_mode)
+ if (otg->var_mode == otg->cur_mode)
return 0;
- if (cur_mode != USB_DR_MODE_OTG)
+ if (otg->cur_mode != USB_DR_MODE_OTG)
return -EBUSY;
- ret = set_mode_callback(ctx, otg_mode);
+ ret = otg->set_mode_callback(otg->ctx, otg->var_mode);
if (ret)
return ret;
- cur_mode = otg_mode;
+ otg->cur_mode = otg->var_mode;
return 0;
}
@@ -47,20 +52,38 @@ int usb_register_otg_device(struct device_d *parent,
{
int ret;
struct param_d *param_mode;
-
- if (otg_device.parent)
- return -EBUSY;
-
- otg_device.parent = parent;
- set_mode_callback = set_mode;
- otg_mode = USB_DR_MODE_OTG;
-
- ret = register_device(&otg_device);
+ struct otg_mode *otg;
+
+ otg = xzalloc(sizeof(*otg));
+ otg->dev.priv = otg;
+ otg->dev.parent = parent;
+ otg->dev.id = DEVICE_ID_DYNAMIC;
+ dev_set_name(&otg->dev, "otg");
+
+ otg->var_mode = USB_DR_MODE_OTG;
+ otg->cur_mode = USB_DR_MODE_OTG;
+ otg->set_mode_callback = set_mode;
+ otg->ctx = ctx;
+
+ /* register otg.mode as an alias of otg0.mode */
+ if (otg_device.parent == NULL) {
+ otg_device.parent = parent;
+ ret = register_device(&otg_device);
+ if (ret)
+ return ret;
+
+ param_mode = dev_add_param_enum(&otg_device, "mode",
+ otg_set_mode, NULL, &otg->var_mode,
+ otg_mode_names, ARRAY_SIZE(otg_mode_names), otg);
+ }
+
+ ret = register_device(&otg->dev);
if (ret)
return ret;
- param_mode = dev_add_param_enum(&otg_device, "mode",
- otg_set_mode, NULL, &otg_mode,
- otg_mode_names, ARRAY_SIZE(otg_mode_names), ctx);
+ param_mode = dev_add_param_enum(&otg->dev, "mode",
+ otg_set_mode, NULL, &otg->var_mode,
+ otg_mode_names, ARRAY_SIZE(otg_mode_names), otg);
+
return PTR_ERR_OR_ZERO(param_mode);
}
diff --git a/drivers/watchdog/wd_core.c b/drivers/watchdog/wd_core.c
index 643c53268f..4b0ee31d5b 100644
--- a/drivers/watchdog/wd_core.c
+++ b/drivers/watchdog/wd_core.c
@@ -54,6 +54,9 @@ int watchdog_set_timeout(struct watchdog *wd, unsigned timeout)
if (ret)
return ret;
+ wd->last_ping = get_time_ns();
+ wd->timeout_cur = timeout;
+
wd->running = timeout ? WDOG_HW_RUNNING : WDOG_HW_NOT_RUNNING;
return 0;
@@ -155,6 +158,25 @@ static unsigned int dev_get_watchdog_priority(struct device_d *dev)
return priority;
}
+static int seconds_to_expire_get(struct param_d *p, void *priv)
+{
+ struct watchdog *wd = priv;
+ uint64_t diff;
+
+ if (!wd->timeout_cur) {
+ wd->seconds_to_expire = -1;
+ return 0;
+ }
+
+ diff = get_time_ns() - wd->last_ping;
+
+ do_div(diff, 1000000000);
+
+ wd->seconds_to_expire = wd->timeout_cur - diff;
+
+ return 0;
+}
+
int watchdog_register(struct watchdog *wd)
{
struct param_d *p;
@@ -218,6 +240,13 @@ int watchdog_register(struct watchdog *wd)
goto error_unregister;
}
+ p = dev_add_param_uint32(&wd->dev, "seconds_to_expire", param_set_readonly,
+ seconds_to_expire_get, &wd->seconds_to_expire, "%d", wd);
+ if (IS_ERR(p)) {
+ ret = PTR_ERR(p);
+ goto error_unregister;
+ }
+
list_add_tail(&wd->list, &watchdog_list);
pr_debug("registering watchdog %s with priority %d\n", watchdog_name(wd),
diff --git a/fs/fs.c b/fs/fs.c
index 00b8645fb0..3db24b7b68 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -89,7 +89,13 @@ static int init_fs(void)
postcore_initcall(init_fs);
+struct filename;
+
static struct fs_device_d *get_fsdevice_by_path(const char *path);
+static int filename_lookup(int dfd, struct filename *name, unsigned flags,
+ struct path *path);;
+static struct filename *getname(const char *filename);
+static void path_put(const struct path *path);
LIST_HEAD(fs_device_list);
@@ -683,6 +689,8 @@ static void fs_remove(struct device_d *dev)
struct fs_device_d *fsdev = dev_to_fs_device(dev);
struct super_block *sb = &fsdev->sb;
struct inode *inode, *tmp;
+ struct path path;
+ int ret;
if (fsdev->dev.driver) {
dev->driver->remove(dev);
@@ -695,9 +703,17 @@ static void fs_remove(struct device_d *dev)
if (fsdev->cdev)
cdev_close(fsdev->cdev);
- if (fsdev->loop && fsdev->cdev)
+ if (fsdev->loop && fsdev->cdev) {
cdev_remove_loop(fsdev->cdev);
+ ret = filename_lookup(AT_FDCWD, getname(fsdev->backingstore),
+ LOOKUP_FOLLOW, &path);
+ if (!ret) {
+ mntput(path.mnt);
+ path_put(&path);
+ }
+ }
+
if (fsdev->vfsmount.mountpoint)
fsdev->vfsmount.mountpoint->d_flags &= ~DCACHE_MOUNTED;
@@ -767,16 +783,30 @@ static const char *detect_fs(const char *filename, const char *fsoptions)
int fsdev_open_cdev(struct fs_device_d *fsdev)
{
unsigned long long offset = 0;
+ struct path path = {};
+ int ret;
parseopt_b(fsdev->options, "loop", &fsdev->loop);
parseopt_llu_suffix(fsdev->options, "offset", &offset);
- if (fsdev->loop)
- fsdev->cdev = cdev_create_loop(fsdev->backingstore, O_RDWR,
- offset);
- else
+ if (fsdev->loop) {
+ ret = filename_lookup(AT_FDCWD, getname(fsdev->backingstore),
+ LOOKUP_FOLLOW, &path);
+ if (ret)
+ return ret;
+
+ fsdev->cdev = cdev_create_loop(fsdev->backingstore, O_RDWR, offset);
+ } else {
fsdev->cdev = cdev_open(fsdev->backingstore, O_RDWR);
- if (!fsdev->cdev)
+ }
+ if (!fsdev->cdev) {
+ path_put(&path);
return -EINVAL;
+ }
+
+ if (path.mnt) {
+ mntget(path.mnt);
+ path_put(&path);
+ }
fsdev->dev.parent = fsdev->cdev->dev;
fsdev->parent_device = fsdev->cdev->dev;
diff --git a/include/efi.h b/include/efi.h
index 5698a84145..b9f3428dc5 100644
--- a/include/efi.h
+++ b/include/efi.h
@@ -257,7 +257,8 @@ typedef struct {
efi_status_t (EFIAPI *open_protocol)(efi_handle_t handle, efi_guid_t *protocol,
void ** interface, efi_handle_t agent_handle,
efi_handle_t controller_handle, u32 attributes);
- void *close_protocol;
+ efi_status_t (EFIAPI *close_protocol)(efi_handle_t handle, efi_guid_t *protocol,
+ efi_handle_t agent, efi_handle_t controller);
efi_status_t(EFIAPI *open_protocol_information)(efi_handle_t handle, efi_guid_t *Protocol,
struct efi_open_protocol_information_entry **entry_buffer,
unsigned long *entry_count);
diff --git a/include/pbl.h b/include/pbl.h
index 5e971f8656..194d5e7508 100644
--- a/include/pbl.h
+++ b/include/pbl.h
@@ -32,4 +32,6 @@ ssize_t pbl_fat_load(struct pbl_bio *, const char *filename, void *dest, size_t
#define IN_PBL 0
#endif
+void fdt_find_mem(const void *fdt, unsigned long *membase, unsigned long *memsize);
+
#endif /* __PBL_H__ */
diff --git a/include/watchdog.h b/include/watchdog.h
index 4d755a5a79..281885686e 100644
--- a/include/watchdog.h
+++ b/include/watchdog.h
@@ -22,8 +22,11 @@ struct watchdog {
struct device_d dev;
unsigned int priority;
unsigned int timeout_max;
+ unsigned int timeout_cur;
unsigned int poller_timeout_cur;
unsigned int poller_enable;
+ uint64_t last_ping;
+ int seconds_to_expire;
struct poller_async poller;
struct list_head list;
int running; /* enum wdog_hw_running */
diff --git a/pbl/Makefile b/pbl/Makefile
index c5a08c1354..9faa56ac91 100644
--- a/pbl/Makefile
+++ b/pbl/Makefile
@@ -4,4 +4,5 @@
pbl-y += misc.o
pbl-y += string.o
pbl-y += decomp.o
+pbl-$(CONFIG_LIBFDT) += fdt.o
pbl-$(CONFIG_PBL_CONSOLE) += console.o
diff --git a/pbl/fdt.c b/pbl/fdt.c
new file mode 100644
index 0000000000..b4a40a514b
--- /dev/null
+++ b/pbl/fdt.c
@@ -0,0 +1,70 @@
+// SPDX-License-Identifier: GPL-2.0
+#include <linux/libfdt.h>
+#include <pbl.h>
+#include <printk.h>
+
+void fdt_find_mem(const void *fdt, unsigned long *membase, unsigned long *memsize)
+{
+ const __be32 *nap, *nsp, *reg;
+ uint32_t na, ns;
+ uint64_t memsize64, membase64;
+ int node, size, i;
+
+ /* Make sure FDT blob is sane */
+ if (fdt_check_header(fdt) != 0) {
+ pr_err("Invalid device tree blob\n");
+ goto err;
+ }
+
+ /* Find the #address-cells and #size-cells properties */
+ node = fdt_path_offset(fdt, "/");
+ if (node < 0) {
+ pr_err("Cannot find root node\n");
+ goto err;
+ }
+
+ nap = fdt_getprop(fdt, node, "#address-cells", &size);
+ if (!nap || (size != 4)) {
+ pr_err("Cannot find #address-cells property");
+ goto err;
+ }
+ na = fdt32_to_cpu(*nap);
+
+ nsp = fdt_getprop(fdt, node, "#size-cells", &size);
+ if (!nsp || (size != 4)) {
+ pr_err("Cannot find #size-cells property");
+ goto err;
+ }
+ ns = fdt32_to_cpu(*nap);
+
+ /* Find the memory range */
+ node = fdt_node_offset_by_prop_value(fdt, -1, "device_type",
+ "memory", sizeof("memory"));
+ if (node < 0) {
+ pr_err("Cannot find memory node\n");
+ goto err;
+ }
+
+ reg = fdt_getprop(fdt, node, "reg", &size);
+ if (size < (na + ns) * sizeof(u32)) {
+ pr_err("cannot get memory range\n");
+ goto err;
+ }
+
+ membase64 = 0;
+ for (i = 0; i < na; i++)
+ membase64 = (membase64 << 32) | fdt32_to_cpu(*reg++);
+
+ /* get the memsize and truncate it to under 4G on 32 bit machines */
+ memsize64 = 0;
+ for (i = 0; i < ns; i++)
+ memsize64 = (memsize64 << 32) | fdt32_to_cpu(*reg++);
+
+ *membase = membase64;
+ *memsize = memsize64;
+
+ return;
+err:
+ pr_err("No memory, cannot continue\n");
+ while (1);
+}
diff --git a/scripts/bareboxcrc32.c b/scripts/bareboxcrc32.c
index 409e1cbba3..6d39fa047d 100644
--- a/scripts/bareboxcrc32.c
+++ b/scripts/bareboxcrc32.c
@@ -1,18 +1,7 @@
-/*
- * bareboxcrc32.c - generate crc32 checksum in little endian
- *
- * Copyright (c) 2013 Michael Grzeschik <mgr@pengutronix.de>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: 2013 Michael Grzeschik <mgr@pengutronix.de>
+
+/* bareboxcrc32.c - generate crc32 checksum in little endian */
#include <stdio.h>
#include <sys/types.h>
diff --git a/scripts/bareboxenv.c b/scripts/bareboxenv.c
index 3c743435fe..bdff644335 100644
--- a/scripts/bareboxenv.c
+++ b/scripts/bareboxenv.c
@@ -1,18 +1,7 @@
-/*
- * bareboxenv.c - generate or read a barebox environment archive
- *
- * Copyright (c) 2007 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: 2007 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
+
+/* bareboxenv.c - generate or read a barebox environment archive */
#include <stdio.h>
#include <sys/types.h>
diff --git a/scripts/bareboximd.c b/scripts/bareboximd.c
index 0500e01cc2..9558c77d1a 100644
--- a/scripts/bareboximd.c
+++ b/scripts/bareboximd.c
@@ -1,17 +1,5 @@
-/*
- * (C) Copyright 2014 Sascha Hauer, Pengutronix
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
+// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-FileCopyrightText: 2014 Sascha Hauer, Pengutronix
#include <stdio.h>
#include <sys/types.h>
diff --git a/scripts/clang-tools/gen_compile_commands.py b/scripts/clang-tools/gen_compile_commands.py
new file mode 100755
index 0000000000..7ed3919f45
--- /dev/null
+++ b/scripts/clang-tools/gen_compile_commands.py
@@ -0,0 +1,237 @@
+#!/usr/bin/env python
+# SPDX-License-Identifier: GPL-2.0
+#
+# Copyright (C) Google LLC, 2018
+#
+# Author: Tom Roeder <tmroeder@google.com>
+#
+"""A tool for generating compile_commands.json in the Linux kernel."""
+
+import argparse
+import json
+import logging
+import os
+import sys
+import re
+import subprocess
+
+_DEFAULT_OUTPUT = 'compile_commands.json'
+_DEFAULT_LOG_LEVEL = 'WARNING'
+
+_FILENAME_PATTERN = r'^\..*\.cmd$'
+_LINE_PATTERN = r'^cmd_[^ ]*\.o := (.* )([^ ]*\.c)$'
+_VALID_LOG_LEVELS = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']
+
+
+def parse_arguments():
+ """Sets up and parses command-line arguments.
+
+ Returns:
+ log_level: A logging level to filter log output.
+ directory: The work directory where the objects were built.
+ ar: Command used for parsing .a archives.
+ output: Where to write the compile-commands JSON file.
+ paths: The list of files/directories to handle to find .cmd files.
+ """
+ usage = 'Creates a compile_commands.json database from kernel .cmd files'
+ parser = argparse.ArgumentParser(description=usage)
+
+ directory_help = ('specify the output directory used for the kernel build '
+ '(defaults to the working directory)')
+ parser.add_argument('-d', '--directory', type=str, default='.',
+ help=directory_help)
+
+ output_help = ('path to the output command database (defaults to ' +
+ _DEFAULT_OUTPUT + ')')
+ parser.add_argument('-o', '--output', type=str, default=_DEFAULT_OUTPUT,
+ help=output_help)
+
+ log_level_help = ('the level of log messages to produce (defaults to ' +
+ _DEFAULT_LOG_LEVEL + ')')
+ parser.add_argument('--log_level', choices=_VALID_LOG_LEVELS,
+ default=_DEFAULT_LOG_LEVEL, help=log_level_help)
+
+ ar_help = 'command used for parsing .a archives'
+ parser.add_argument('-a', '--ar', type=str, default='llvm-ar', help=ar_help)
+
+ paths_help = ('directories to search or files to parse '
+ '(files should be *.o, *.a, or modules.order). '
+ 'If nothing is specified, the current directory is searched')
+ parser.add_argument('paths', type=str, nargs='*', help=paths_help)
+
+ args = parser.parse_args()
+
+ return (args.log_level,
+ os.path.abspath(args.directory),
+ args.output,
+ args.ar,
+ args.paths if len(args.paths) > 0 else [args.directory])
+
+
+def cmdfiles_in_dir(directory):
+ """Generate the iterator of .cmd files found under the directory.
+
+ Walk under the given directory, and yield every .cmd file found.
+
+ Args:
+ directory: The directory to search for .cmd files.
+
+ Yields:
+ The path to a .cmd file.
+ """
+
+ filename_matcher = re.compile(_FILENAME_PATTERN)
+
+ for dirpath, _, filenames in os.walk(directory):
+ for filename in filenames:
+ if filename_matcher.match(filename):
+ yield os.path.join(dirpath, filename)
+
+
+def to_cmdfile(path):
+ """Return the path of .cmd file used for the given build artifact
+
+ Args:
+ Path: file path
+
+ Returns:
+ The path to .cmd file
+ """
+ dir, base = os.path.split(path)
+ return os.path.join(dir, '.' + base + '.cmd')
+
+
+def cmdfiles_for_o(obj):
+ """Generate the iterator of .cmd files associated with the object
+
+ Yield the .cmd file used to build the given object
+
+ Args:
+ obj: The object path
+
+ Yields:
+ The path to .cmd file
+ """
+ yield to_cmdfile(obj)
+
+
+def cmdfiles_for_a(archive, ar):
+ """Generate the iterator of .cmd files associated with the archive.
+
+ Parse the given archive, and yield every .cmd file used to build it.
+
+ Args:
+ archive: The archive to parse
+
+ Yields:
+ The path to every .cmd file found
+ """
+ for obj in subprocess.check_output([ar, '-t', archive]).decode().split():
+ yield to_cmdfile(obj)
+
+
+def cmdfiles_for_modorder(modorder):
+ """Generate the iterator of .cmd files associated with the modules.order.
+
+ Parse the given modules.order, and yield every .cmd file used to build the
+ contained modules.
+
+ Args:
+ modorder: The modules.order file to parse
+
+ Yields:
+ The path to every .cmd file found
+ """
+ with open(modorder) as f:
+ for line in f:
+ ko = line.rstrip()
+ base, ext = os.path.splitext(ko)
+ if ext != '.ko':
+ sys.exit('{}: module path must end with .ko'.format(ko))
+ mod = base + '.mod'
+ # The first line of *.mod lists the objects that compose the module.
+ with open(mod) as m:
+ for obj in m.readline().split():
+ yield to_cmdfile(obj)
+
+
+def process_line(root_directory, command_prefix, file_path):
+ """Extracts information from a .cmd line and creates an entry from it.
+
+ Args:
+ root_directory: The directory that was searched for .cmd files. Usually
+ used directly in the "directory" entry in compile_commands.json.
+ command_prefix: The extracted command line, up to the last element.
+ file_path: The .c file from the end of the extracted command.
+ Usually relative to root_directory, but sometimes absolute.
+
+ Returns:
+ An entry to append to compile_commands.
+
+ Raises:
+ ValueError: Could not find the extracted file based on file_path and
+ root_directory or file_directory.
+ """
+ # The .cmd files are intended to be included directly by Make, so they
+ # escape the pound sign '#', either as '\#' or '$(pound)' (depending on the
+ # kernel version). The compile_commands.json file is not interepreted
+ # by Make, so this code replaces the escaped version with '#'.
+ prefix = command_prefix.replace('\#', '#').replace('$(pound)', '#')
+
+ # Use os.path.abspath() to normalize the path resolving '.' and '..' .
+ abs_path = os.path.abspath(os.path.join(root_directory, file_path))
+ if not os.path.exists(abs_path):
+ raise ValueError('File %s not found' % abs_path)
+ return {
+ 'directory': root_directory,
+ 'file': abs_path,
+ 'command': prefix + file_path,
+ }
+
+
+def main():
+ """Walks through the directory and finds and parses .cmd files."""
+ log_level, directory, output, ar, paths = parse_arguments()
+
+ level = getattr(logging, log_level)
+ logging.basicConfig(format='%(levelname)s: %(message)s', level=level)
+
+ line_matcher = re.compile(_LINE_PATTERN)
+
+ compile_commands = []
+
+ for path in paths:
+ # If 'path' is a directory, handle all .cmd files under it.
+ # Otherwise, handle .cmd files associated with the file.
+ # Most of built-in objects are linked via archives (built-in.a or lib.a)
+ # but some objects are linked to vmlinux directly.
+ # Modules are listed in modules.order.
+ if os.path.isdir(path):
+ cmdfiles = cmdfiles_in_dir(path)
+ elif path.endswith('.o'):
+ cmdfiles = cmdfiles_for_o(path)
+ elif path.endswith('.a'):
+ cmdfiles = cmdfiles_for_a(path, ar)
+ elif path.endswith('modules.order'):
+ cmdfiles = cmdfiles_for_modorder(path)
+ else:
+ sys.exit('{}: unknown file type'.format(path))
+
+ for cmdfile in cmdfiles:
+ with open(cmdfile, 'rt') as f:
+ result = line_matcher.match(f.readline())
+ if result:
+ try:
+ entry = process_line(directory, result.group(1),
+ result.group(2))
+ compile_commands.append(entry)
+ except ValueError as err:
+ logging.info('Could not add line from %s: %s',
+ cmdfile, err)
+
+ with open(output, 'wt') as f:
+ json.dump(compile_commands, f, indent=2, sort_keys=True)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/scripts/imx/imx.c b/scripts/imx/imx.c
index e9f05b83a3..6b8dabd047 100644
--- a/scripts/imx/imx.c
+++ b/scripts/imx/imx.c
@@ -1,17 +1,5 @@
-/*
- * (C) Copyright 2016 Sascha Hauer, Pengutronix
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
+// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-FileCopyrightText: 2016 Sascha Hauer, Pengutronix
#define _GNU_SOURCE
#include <stdio.h>
diff --git a/scripts/include/asm-generic/barrier.h b/scripts/include/asm-generic/barrier.h
index 47b933903e..2e78c3f328 100644
--- a/scripts/include/asm-generic/barrier.h
+++ b/scripts/include/asm-generic/barrier.h
@@ -1,3 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* SPDX-FileCopyrightText: 2007 Red Hat (David Howells <dhowells@redhat.com>) */
+
/*
* Copied from the kernel sources to tools/perf/:
*
@@ -5,14 +8,6 @@
*
* It should be possible to use these on really simple architectures,
* but it serves more as a starting point for new ports.
- *
- * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
- * Written by David Howells (dhowells@redhat.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public Licence
- * as published by the Free Software Foundation; either version
- * 2 of the Licence, or (at your option) any later version.
*/
#ifndef __TOOLS_LINUX_ASM_GENERIC_BARRIER_H
#define __TOOLS_LINUX_ASM_GENERIC_BARRIER_H
diff --git a/scripts/include/linux/log2.h b/scripts/include/linux/log2.h
index 41446668cc..abc38f4c63 100644
--- a/scripts/include/linux/log2.h
+++ b/scripts/include/linux/log2.h
@@ -1,13 +1,7 @@
-/* Integer base 2 logarithm calculation
- *
- * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
- * Written by David Howells (dhowells@redhat.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* SPDX-FileCopyrightText: 2006 Red Hat (David Howells <dhowells@redhat.com>) */
+
+/* Integer base 2 logarithm calculation */
#ifndef _TOOLS_LINUX_LOG2_H
#define _TOOLS_LINUX_LOG2_H
diff --git a/scripts/kwbimage.c b/scripts/kwbimage.c
index 75c9e9cda9..28c9a68e18 100644
--- a/scripts/kwbimage.c
+++ b/scripts/kwbimage.c
@@ -1,20 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-FileCopyrightText: 2013 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
/*
* Image manipulator for Marvell SoCs
* supports Kirkwood, Dove, Armada 370, and Armada XP
*
- * (C) Copyright 2013 Thomas Petazzoni
- * <thomas.petazzoni@free-electrons.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
* This tool allows to extract and create bootable images for Marvell
* Kirkwood, Dove, Armada 370, and Armada XP SoCs. It supports two
* versions of the bootable image format: version 0 (used on Marvell
diff --git a/scripts/mk-omap-image.c b/scripts/mk-omap-image.c
index 234b7e37c2..5741b0afbc 100644
--- a/scripts/mk-omap-image.c
+++ b/scripts/mk-omap-image.c
@@ -1,22 +1,8 @@
-/*
- * mk-am35xx-spi-image.c - convert a barebox image for SPI loading on AM35xx
- *
- * Copyright (C) 2012 Jan Luebbe <j.luebbe@pengutronix.de>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
+// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-FileCopyrightText: 2012 Jan Luebbe <j.luebbe@pengutronix.de>
+
+/* mk-am35xx-spi-image.c - convert a barebox image for SPI loading on AM35xx */
+
/**
* @file
* @brief convert a barebox image for SPI loading on AM35xx
diff --git a/scripts/mkimage.c b/scripts/mkimage.c
index 7d283c5509..a76c061aee 100644
--- a/scripts/mkimage.c
+++ b/scripts/mkimage.c
@@ -1,22 +1,6 @@
-/*
- * (C) Copyright 2008 Semihalf
- *
- * (C) Copyright 2000-2004
- * DENX Software Engineering
- * Wolfgang Denk, wd@denx.de
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
+// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-FileCopyrightText: 2008 Semihalf
+// SPDX-FileCopyrightText: 2000-2004 DENX Software Engineering (Wolfgang Denk <wd@denx.de>)
#include <sys/stat.h>
#include <time.h>
diff --git a/scripts/mkublheader.c b/scripts/mkublheader.c
index 496ba0b500..db3e284a8a 100644
--- a/scripts/mkublheader.c
+++ b/scripts/mkublheader.c
@@ -1,22 +1,7 @@
-/*
- * mkublheader.c - produce the header needed to load barebox on OMAP-L138
- *
- * Copyright (C) 2012 Jan Luebbe <j.luebbe@pengutronix.de>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
+// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-FileCopyrightText: 2012 Jan Luebbe <j.luebbe@pengutronix.de>
+
+/* mkublheader.c - produce the header needed to load barebox on OMAP-L138 */
#define _BSD_SOURCE
#define _DEFAULT_SOURCE
diff --git a/scripts/mod/sumversion.c b/scripts/mod/sumversion.c
index d9cc6901d6..b5f1824a69 100644
--- a/scripts/mod/sumversion.c
+++ b/scripts/mod/sumversion.c
@@ -1,3 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-FileCopyrightText: 1997-1998 Andrew Tridgell
+// SPDX-FileCopyrightText: Cryptoapi developers.
+// SPDX-FileCopyrightText: 2002 David S. Miller <davem@redhat.com>
+// SPDX-FileCopyrightText: 2002 James Morris <jmorris@intercode.com.au>
+
#include <netinet/in.h>
#ifdef __sun__
#include <inttypes.h>
@@ -20,17 +26,7 @@
* originally based on the public domain implementation written
* by Colin Plumb in 1993.
*
- * Copyright (c) Andrew Tridgell 1997-1998.
* Modified by Steve French (sfrench@us.ibm.com) 2002
- * Copyright (c) Cryptoapi developers.
- * Copyright (c) 2002 David S. Miller (davem@redhat.com)
- * Copyright (c) 2002 James Morris <jmorris@intercode.com.au>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
*/
#define MD4_DIGEST_SIZE 16
#define MD4_HMAC_BLOCK_SIZE 64
diff --git a/scripts/omap3-usb-loader.c b/scripts/omap3-usb-loader.c
index ae6f1258df..599a93856a 100644
--- a/scripts/omap3-usb-loader.c
+++ b/scripts/omap3-usb-loader.c
@@ -1,18 +1,8 @@
-/*
- * OMAP Loader, a USB uploader application targeted at OMAP3 processors
- * Copyright (C) 2008 Martin Mueller <martinmm@pfump.org>
- * Copyright (C) 2014 Grant Hernandez <grant.h.hernandez@gmail.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
+// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-FileCopyrightText: 2008 Martin Mueller <martinmm@pfump.org>
+// SPDX-FileCopyrightText: 2014 Grant Hernandez <grant.h.hernandez@gmail.com>
+
+/* OMAP Loader, a USB uploader application targeted at OMAP3 processors */
#include <stdio.h>
#include <stdlib.h>
diff --git a/scripts/omap4_usbboot.c b/scripts/omap4_usbboot.c
index 44236259dc..342efd0c9a 100644
--- a/scripts/omap4_usbboot.c
+++ b/scripts/omap4_usbboot.c
@@ -1,16 +1,6 @@
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * Inspired by: https://github.com/simu/usbboot-omap4.git
- */
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+/* Inspired by: https://github.com/simu/usbboot-omap4.git */
#include <stdio.h>
#include <stdlib.h>
diff --git a/scripts/omap_signGP.c b/scripts/omap_signGP.c
index ac47fdf089..b89414931e 100644
--- a/scripts/omap_signGP.c
+++ b/scripts/omap_signGP.c
@@ -1,3 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: 2010 Texas Instruments Incorporated (http://www.ti.com/)
+
/**
* signGP.c - Read the x-load.bin file and write out the x-load.bin.ift file
*
@@ -5,17 +8,6 @@
* and the load address. If not entered on command line, file name is
* assumed to be x-load.bin in current directory and load address is
* 0x40200800.
- *
- * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 of
- * the License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
*/
#include <stdio.h>
diff --git a/scripts/s5p_cksum.c b/scripts/s5p_cksum.c
index 29cf539a28..0f53ee1dd2 100644
--- a/scripts/s5p_cksum.c
+++ b/scripts/s5p_cksum.c
@@ -1,16 +1,5 @@
-/*
- * Copyright (C) 2012 Alexey Galakhov
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: 2012 Alexey Galakhov
#include <stdio.h>
#include <stdint.h>
diff --git a/scripts/setupmbr/setupmbr.c b/scripts/setupmbr/setupmbr.c
index 1487498f1f..38af550809 100644
--- a/scripts/setupmbr/setupmbr.c
+++ b/scripts/setupmbr/setupmbr.c
@@ -1,18 +1,5 @@
-/*
- * Copyright (C) 2009 Juergen Beisert, Pengutronix
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- *
- */
+// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-FileCopyrightText: 2009 Juergen Beisert, Pengutronix
/**
* @file
diff --git a/scripts/tegra/bct_dump.c b/scripts/tegra/bct_dump.c
index 74f4d595e0..bf4c146bac 100644
--- a/scripts/tegra/bct_dump.c
+++ b/scripts/tegra/bct_dump.c
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION
#include "cbootimage.h"
#include "data_layout.h"
diff --git a/scripts/tegra/cbootimage.c b/scripts/tegra/cbootimage.c
index d64f322f11..7714893d28 100644
--- a/scripts/tegra/cbootimage.c
+++ b/scripts/tegra/cbootimage.c
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION
/*
* cbootimage.c - Implementation of the cbootimage tool.
diff --git a/scripts/tegra/cbootimage.h b/scripts/tegra/cbootimage.h
index 04d1a8b274..99b37d1563 100644
--- a/scripts/tegra/cbootimage.h
+++ b/scripts/tegra/cbootimage.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION */
/*
* cbootimage.h - Definitions for the cbootimage code.
diff --git a/scripts/tegra/context.c b/scripts/tegra/context.c
index 47e65d570b..93a5e33ce1 100644
--- a/scripts/tegra/context.c
+++ b/scripts/tegra/context.c
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION
#include "cbootimage.h"
#include "data_layout.h"
diff --git a/scripts/tegra/context.h b/scripts/tegra/context.h
index bdfa25b451..f0f5d0587a 100644
--- a/scripts/tegra/context.h
+++ b/scripts/tegra/context.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION */
#ifndef INCLUDED_CONTEXT_H
#define INCLUDED_CONTEXT_H
diff --git a/scripts/tegra/crypto.c b/scripts/tegra/crypto.c
index e40f56e474..17d422990b 100644
--- a/scripts/tegra/crypto.c
+++ b/scripts/tegra/crypto.c
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION
/*
* crypto.c - Cryptography support
diff --git a/scripts/tegra/crypto.h b/scripts/tegra/crypto.h
index 2220ac8367..db687d0371 100644
--- a/scripts/tegra/crypto.h
+++ b/scripts/tegra/crypto.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION */
/*
* crypto.h - Definitions for the crypto support.
diff --git a/scripts/tegra/data_layout.c b/scripts/tegra/data_layout.c
index 99ae8d92c8..abfbf6efae 100644
--- a/scripts/tegra/data_layout.c
+++ b/scripts/tegra/data_layout.c
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION
/*
* data_layout.c - Code to manage the layout of data in the boot device.
diff --git a/scripts/tegra/data_layout.h b/scripts/tegra/data_layout.h
index c708da4a15..002a1ab43e 100644
--- a/scripts/tegra/data_layout.h
+++ b/scripts/tegra/data_layout.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION */
/*
* data_layout.h - Definitions for the cbootimage data layout code.
diff --git a/scripts/tegra/nvaes_ref.h b/scripts/tegra/nvaes_ref.h
index 1d06e71903..7a7e5ec3bf 100644
--- a/scripts/tegra/nvaes_ref.h
+++ b/scripts/tegra/nvaes_ref.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION */
#include "cbootimage.h"
#include "string.h"
diff --git a/scripts/tegra/parse.c b/scripts/tegra/parse.c
index 9180adfda3..d861deed17 100644
--- a/scripts/tegra/parse.c
+++ b/scripts/tegra/parse.c
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION
/*
* parse.c - Parsing support for the cbootimage tool
diff --git a/scripts/tegra/parse.h b/scripts/tegra/parse.h
index 7402a1dd98..2d953bb858 100644
--- a/scripts/tegra/parse.h
+++ b/scripts/tegra/parse.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION */
/*
* parse.h - Definitions for the cbootimage parsing code.
diff --git a/scripts/tegra/set.c b/scripts/tegra/set.c
index 1c5e8dda8c..9de879f22e 100644
--- a/scripts/tegra/set.c
+++ b/scripts/tegra/set.c
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION
/*
* set.c - State setting support for the cbootimage tool
diff --git a/scripts/tegra/set.h b/scripts/tegra/set.h
index 7e7245aaf4..0b905fd050 100644
--- a/scripts/tegra/set.h
+++ b/scripts/tegra/set.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION */
/*
* set.h - Definitions for the cbootimage state setting code.
diff --git a/scripts/tegra/t114/nvbctlib_t114.c b/scripts/tegra/t114/nvbctlib_t114.c
index 3bda785f57..1085146ee0 100644
--- a/scripts/tegra/t114/nvbctlib_t114.c
+++ b/scripts/tegra/t114/nvbctlib_t114.c
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION
#include "../cbootimage.h"
#include "../parse.h"
diff --git a/scripts/tegra/t114/nvboot_bct_t114.h b/scripts/tegra/t114/nvboot_bct_t114.h
index a2a6b865f6..9b8e20ae4a 100644
--- a/scripts/tegra/t114/nvboot_bct_t114.h
+++ b/scripts/tegra/t114/nvboot_bct_t114.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION */
#ifndef INCLUDED_NVBOOT_BCT_T114_H
#define INCLUDED_NVBOOT_BCT_T114_H
diff --git a/scripts/tegra/t114/nvboot_sdram_param_t114.h b/scripts/tegra/t114/nvboot_sdram_param_t114.h
index 78151dcfb8..2f8f0407f1 100644
--- a/scripts/tegra/t114/nvboot_sdram_param_t114.h
+++ b/scripts/tegra/t114/nvboot_sdram_param_t114.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION */
/**
* Defines the SDRAM parameter structure.
diff --git a/scripts/tegra/t114/parse_t114.c b/scripts/tegra/t114/parse_t114.c
index 79c2ed8f53..0f6d4dbcdd 100644
--- a/scripts/tegra/t114/parse_t114.c
+++ b/scripts/tegra/t114/parse_t114.c
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION
/*
* parse_t114.h - Definitions for the dev/sdram parameters
diff --git a/scripts/tegra/t124/nvbctlib_t124.c b/scripts/tegra/t124/nvbctlib_t124.c
index 55b840926e..9cc312b2e4 100644
--- a/scripts/tegra/t124/nvbctlib_t124.c
+++ b/scripts/tegra/t124/nvbctlib_t124.c
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: 2013 NVIDIA CORPORATION
#include "../cbootimage.h"
#include "../parse.h"
diff --git a/scripts/tegra/t124/nvboot_bct_t124.h b/scripts/tegra/t124/nvboot_bct_t124.h
index bc07add3db..479ce97654 100644
--- a/scripts/tegra/t124/nvboot_bct_t124.h
+++ b/scripts/tegra/t124/nvboot_bct_t124.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* SPDX-FileCopyrightText: 2013 NVIDIA CORPORATION */
#ifndef INCLUDED_NVBOOT_BCT_T124_H
#define INCLUDED_NVBOOT_BCT_T124_H
diff --git a/scripts/tegra/t124/nvboot_sdram_param_t124.h b/scripts/tegra/t124/nvboot_sdram_param_t124.h
index bae40b1353..46adba519b 100644
--- a/scripts/tegra/t124/nvboot_sdram_param_t124.h
+++ b/scripts/tegra/t124/nvboot_sdram_param_t124.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* SPDX-FileCopyrightText: 2013 NVIDIA CORPORATION */
/**
* Defines the SDRAM parameter structure.
diff --git a/scripts/tegra/t124/parse_t124.c b/scripts/tegra/t124/parse_t124.c
index 8468209b61..8a63dd2377 100644
--- a/scripts/tegra/t124/parse_t124.c
+++ b/scripts/tegra/t124/parse_t124.c
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: 2013 NVIDIA CORPORATION
/*
* parse_t124.c - The implementation for parsing dev/sdram parameters
diff --git a/scripts/tegra/t20/nvbctlib_t20.c b/scripts/tegra/t20/nvbctlib_t20.c
index 42ad146755..972c37befe 100644
--- a/scripts/tegra/t20/nvbctlib_t20.c
+++ b/scripts/tegra/t20/nvbctlib_t20.c
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION
#include "../cbootimage.h"
#include "../parse.h"
diff --git a/scripts/tegra/t20/nvboot_bct_t20.h b/scripts/tegra/t20/nvboot_bct_t20.h
index bf94d50b40..97ceeed659 100644
--- a/scripts/tegra/t20/nvboot_bct_t20.h
+++ b/scripts/tegra/t20/nvboot_bct_t20.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION */
#ifndef INCLUDED_NVBOOT_BCT_T20_H
#define INCLUDED_NVBOOT_BCT_T20_H
diff --git a/scripts/tegra/t20/nvboot_sdram_param_t20.h b/scripts/tegra/t20/nvboot_sdram_param_t20.h
index de002f0c38..397397a0cd 100644
--- a/scripts/tegra/t20/nvboot_sdram_param_t20.h
+++ b/scripts/tegra/t20/nvboot_sdram_param_t20.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION */
/**
* Defines the SDRAM parameter structure.
diff --git a/scripts/tegra/t20/parse_t20.c b/scripts/tegra/t20/parse_t20.c
index 5db74d5597..c613ecf85e 100644
--- a/scripts/tegra/t20/parse_t20.c
+++ b/scripts/tegra/t20/parse_t20.c
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION
/*
* parse_t20.c - Parsing code for t20
diff --git a/scripts/tegra/t30/nvbctlib_t30.c b/scripts/tegra/t30/nvbctlib_t30.c
index 04e8974fbf..77c4aceb0a 100644
--- a/scripts/tegra/t30/nvbctlib_t30.c
+++ b/scripts/tegra/t30/nvbctlib_t30.c
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION
#include "../cbootimage.h"
#include "../parse.h"
diff --git a/scripts/tegra/t30/nvboot_bct_t30.h b/scripts/tegra/t30/nvboot_bct_t30.h
index c5fee4c0a2..5f4997ed8e 100644
--- a/scripts/tegra/t30/nvboot_bct_t30.h
+++ b/scripts/tegra/t30/nvboot_bct_t30.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION */
#ifndef INCLUDED_NVBOOT_BCT_T30_H
#define INCLUDED_NVBOOT_BCT_T30_H
diff --git a/scripts/tegra/t30/nvboot_sdram_param_t30.h b/scripts/tegra/t30/nvboot_sdram_param_t30.h
index 24c176858f..fb0dffa0a0 100644
--- a/scripts/tegra/t30/nvboot_sdram_param_t30.h
+++ b/scripts/tegra/t30/nvboot_sdram_param_t30.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION */
/**
* Defines the SDRAM parameter structure.
diff --git a/scripts/tegra/t30/parse_t30.c b/scripts/tegra/t30/parse_t30.c
index e5f4e93b28..bd85a96d12 100644
--- a/scripts/tegra/t30/parse_t30.c
+++ b/scripts/tegra/t30/parse_t30.c
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: 2012 NVIDIA CORPORATION
/*
* parse_t30.h - Definitions for the dev/sdram parameters
diff --git a/scripts/zynq_mkimage.c b/scripts/zynq_mkimage.c
index a211b79c28..8b95b41960 100644
--- a/scripts/zynq_mkimage.c
+++ b/scripts/zynq_mkimage.c
@@ -1,16 +1,5 @@
-/*
- * Copyright (C) 2013 Steffen Trumtrar <s.trumtrar@pengutronix.de>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
+// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-FileCopyrightText: 2013 Steffen Trumtrar <s.trumtrar@pengutronix.de>
#include <endian.h>
#include <errno.h>