diff options
Diffstat (limited to 'arch')
154 files changed, 590 insertions, 787 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 95fd8ecfe7..ea6d459dfe 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -4,6 +4,8 @@ config ARM select HAS_CACHE select HAVE_CONFIGURABLE_TEXT_BASE if !RELOCATABLE select HAVE_IMAGE_COMPRESSION + select HAVE_ARCH_KASAN + select ARM_OPTIMZED_STRING_FUNCTIONS if KASAN default y config ARM_LINUX diff --git a/arch/arm/boards/edb93xx/flash_cfg.c b/arch/arm/boards/edb93xx/flash_cfg.c index 6b742f967c..8400db69de 100644 --- a/arch/arm/boards/edb93xx/flash_cfg.c +++ b/arch/arm/boards/edb93xx/flash_cfg.c @@ -11,6 +11,9 @@ SMC_BCR_BLE | 2 << SMC_BCR_WST2_SHIFT | \ 1 << SMC_BCR_MW_SHIFT) +/* Called from assembly */ +void flash_cfg(void); + void flash_cfg(void) { struct smc_regs *smc = (struct smc_regs *)SMC_BASE; diff --git a/arch/arm/boards/edb93xx/pll_cfg.c b/arch/arm/boards/edb93xx/pll_cfg.c index 1f03acf915..1a1c01aba2 100644 --- a/arch/arm/boards/edb93xx/pll_cfg.c +++ b/arch/arm/boards/edb93xx/pll_cfg.c @@ -9,6 +9,9 @@ #include "pll_cfg.h" #include "early_udelay.h" +/* Called from assembly */ +void pll_cfg(void); + void pll_cfg(void) { struct syscon_regs *syscon = (struct syscon_regs *)SYSCON_BASE; diff --git a/arch/arm/boards/edb93xx/sdram_cfg.c b/arch/arm/boards/edb93xx/sdram_cfg.c index a9f591f197..3cee834910 100644 --- a/arch/arm/boards/edb93xx/sdram_cfg.c +++ b/arch/arm/boards/edb93xx/sdram_cfg.c @@ -17,6 +17,9 @@ static void precharge_all_banks(void); static void setup_refresh_timer(void); static void program_mode_registers(void); +/* Called from assembly */ +void sdram_cfg(void); + void sdram_cfg(void) { struct sdram_regs *sdram = (struct sdram_regs *)SDRAM_BASE; diff --git a/arch/arm/boards/karo-tx28/tx28-stk5.c b/arch/arm/boards/karo-tx28/tx28-stk5.c index c9b947953b..56211d7a3a 100644 --- a/arch/arm/boards/karo-tx28/tx28-stk5.c +++ b/arch/arm/boards/karo-tx28/tx28-stk5.c @@ -22,6 +22,8 @@ #include <mach/iomux.h> #include <generated/mach-types.h> +#include "tx28.h" + static struct mxs_mci_platform_data mci_pdata = { .caps = MMC_CAP_4_BIT_DATA, .voltages = MMC_VDD_32_33 | MMC_VDD_33_34, /* fixed to 3.3 V */ diff --git a/arch/arm/boards/karo-tx28/tx28.c b/arch/arm/boards/karo-tx28/tx28.c index 52f74b5f36..8bd2252410 100644 --- a/arch/arm/boards/karo-tx28/tx28.c +++ b/arch/arm/boards/karo-tx28/tx28.c @@ -15,6 +15,8 @@ #include <mach/iomux.h> #include <asm/mmu.h> +#include "tx28.h" + /* setup the CPU card internal signals */ static const uint32_t tx28_pad_setup[] = { /* NAND interface */ @@ -61,8 +63,6 @@ static const uint32_t tx28_pad_setup[] = { }; -extern void base_board_init(void); - static int tx28_devices_init(void) { int i; diff --git a/arch/arm/boards/karo-tx28/tx28.h b/arch/arm/boards/karo-tx28/tx28.h new file mode 100644 index 0000000000..5fb1e13412 --- /dev/null +++ b/arch/arm/boards/karo-tx28/tx28.h @@ -0,0 +1,3 @@ + +void base_board_init(void); + diff --git a/arch/arm/boards/phytec-som-imx6/flash-header-phytec-pcl063-512mb.imxcfg b/arch/arm/boards/phytec-som-imx6/flash-header-phytec-pcl063-512mb.h index 26998c3fd8..c4122d245d 100644 --- a/arch/arm/boards/phytec-som-imx6/flash-header-phytec-pcl063-512mb.imxcfg +++ b/arch/arm/boards/phytec-som-imx6/flash-header-phytec-pcl063-512mb.h @@ -7,4 +7,3 @@ wm 32 0x021B0000 0x84180000 #include "flash-header-phytec-pcl063.h" -#include <mach/habv4-imx6-gencsf.h> diff --git a/arch/arm/boards/phytec-som-imx6/flash-header-phytec-pcl063ul-512mb.imxcfg b/arch/arm/boards/phytec-som-imx6/flash-header-phytec-pcl063ul-512mb.imxcfg new file mode 100644 index 0000000000..f629a8e7b2 --- /dev/null +++ b/arch/arm/boards/phytec-som-imx6/flash-header-phytec-pcl063ul-512mb.imxcfg @@ -0,0 +1,3 @@ + +#include "flash-header-phytec-pcl063-512mb.h" +#include <mach/habv4-imx6-gencsf.h> diff --git a/arch/arm/boards/phytec-som-imx6/flash-header-phytec-pcl063-256mb.imxcfg b/arch/arm/boards/phytec-som-imx6/flash-header-phytec-pcl063ull-256mb.imxcfg index b93e81fb4e..e6871d8534 100644 --- a/arch/arm/boards/phytec-som-imx6/flash-header-phytec-pcl063-256mb.imxcfg +++ b/arch/arm/boards/phytec-som-imx6/flash-header-phytec-pcl063ull-256mb.imxcfg @@ -7,4 +7,4 @@ wm 32 0x021B0000 0x83180000 #include "flash-header-phytec-pcl063.h" -#include <mach/habv4-imx6-gencsf.h> +#include <mach/habv4-imx6ull-gencsf.h> diff --git a/arch/arm/boards/phytec-som-imx6/flash-header-phytec-pcl063ull-512mb.imxcfg b/arch/arm/boards/phytec-som-imx6/flash-header-phytec-pcl063ull-512mb.imxcfg new file mode 100644 index 0000000000..d2d7183843 --- /dev/null +++ b/arch/arm/boards/phytec-som-imx6/flash-header-phytec-pcl063ull-512mb.imxcfg @@ -0,0 +1,3 @@ + +#include "flash-header-phytec-pcl063-512mb.h" +#include <mach/habv4-imx6ull-gencsf.h> diff --git a/arch/arm/configs/at91sam9263ek_defconfig b/arch/arm/configs/at91sam9263ek_defconfig index 45c6f79de4..0cde5396af 100644 --- a/arch/arm/configs/at91sam9263ek_defconfig +++ b/arch/arm/configs/at91sam9263ek_defconfig @@ -1,4 +1,3 @@ -CONFIG_ARCH_AT91SAM9263=y CONFIG_AT91_MULTI_BOARDS=y CONFIG_MACH_AT91SAM9263EK=y CONFIG_BAREBOX_MAX_IMAGE_SIZE=0x40000 diff --git a/arch/arm/configs/at91sam9x5ek_defconfig b/arch/arm/configs/at91sam9x5ek_defconfig index 11d1e4511e..7b743abfaa 100644 --- a/arch/arm/configs/at91sam9x5ek_defconfig +++ b/arch/arm/configs/at91sam9x5ek_defconfig @@ -1,4 +1,3 @@ -CONFIG_ARCH_AT91SAM9X5=y CONFIG_AT91_MULTI_BOARDS=y CONFIG_MACH_AT91SAM9X5EK=y CONFIG_BAREBOX_MAX_IMAGE_SIZE=0x40000 diff --git a/arch/arm/configs/freescale-mx21-ads_defconfig b/arch/arm/configs/freescale-mx21-ads_defconfig index e1843db3e2..b1d37f76a8 100644 --- a/arch/arm/configs/freescale-mx21-ads_defconfig +++ b/arch/arm/configs/freescale-mx21-ads_defconfig @@ -1,6 +1,5 @@ CONFIG_TEXT_BASE=0xc3000000 CONFIG_ARCH_IMX=y -CONFIG_MACH_IMX21ADS=y CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y CONFIG_MALLOC_SIZE=0x2000000 CONFIG_CMDLINE_EDITING=y diff --git a/arch/arm/configs/imx_defconfig b/arch/arm/configs/imx_defconfig index 02e33e122e..e6333220b6 100644 --- a/arch/arm/configs/imx_defconfig +++ b/arch/arm/configs/imx_defconfig @@ -13,7 +13,6 @@ CONFIG_MMU=y CONFIG_MALLOC_SIZE=0x0 CONFIG_MALLOC_TLSF=y CONFIG_KALLSYMS=y -CONFIG_RELOCATABLE=y CONFIG_PANIC_HANG=y CONFIG_HUSH_FANCY_PROMPT=y CONFIG_CMDLINE_EDITING=y diff --git a/arch/arm/configs/imx_v8_defconfig b/arch/arm/configs/imx_v8_defconfig index 7e3bfadd9e..06d79f594d 100644 --- a/arch/arm/configs/imx_v8_defconfig +++ b/arch/arm/configs/imx_v8_defconfig @@ -10,7 +10,6 @@ CONFIG_MMU=y CONFIG_MALLOC_SIZE=0x0 CONFIG_MALLOC_TLSF=y CONFIG_KALLSYMS=y -CONFIG_RELOCATABLE=y CONFIG_HUSH_FANCY_PROMPT=y CONFIG_AUTO_COMPLETE=y CONFIG_MENU=y @@ -89,6 +88,7 @@ CONFIG_SERIAL_DEV_BUS=y CONFIG_DRIVER_NET_FEC_IMX=y CONFIG_DP83867_PHY=y CONFIG_MICREL_PHY=y +CONFIG_REALTEK_PHY=y CONFIG_NET_DSA_MV88E6XXX=y CONFIG_MDIO_BITBANG=y CONFIG_MDIO_GPIO=y @@ -129,7 +129,6 @@ CONFIG_RTC_CLASS=y CONFIG_RTC_DRV_DS1307=y CONFIG_GENERIC_PHY=y CONFIG_USB_NOP_XCEIV=y -CONFIG_PHY_FSL_IMX8MQ_USB=y CONFIG_FS_EXT4=y CONFIG_FS_TFTP=y CONFIG_FS_NFS=y diff --git a/arch/arm/configs/kindle-mx50_defconfig b/arch/arm/configs/kindle-mx50_defconfig index 552b2d6d33..95fafd56e6 100644 --- a/arch/arm/configs/kindle-mx50_defconfig +++ b/arch/arm/configs/kindle-mx50_defconfig @@ -9,7 +9,6 @@ CONFIG_MMU=y CONFIG_MALLOC_SIZE=0x0 CONFIG_MALLOC_TLSF=y CONFIG_KALLSYMS=y -CONFIG_RELOCATABLE=y CONFIG_HUSH_FANCY_PROMPT=y CONFIG_CMDLINE_EDITING=y CONFIG_AUTO_COMPLETE=y diff --git a/arch/arm/configs/layerscape_defconfig b/arch/arm/configs/layerscape_defconfig index b36f1944ec..394cd95c98 100644 --- a/arch/arm/configs/layerscape_defconfig +++ b/arch/arm/configs/layerscape_defconfig @@ -78,7 +78,6 @@ CONFIG_CMD_OFTREE=y CONFIG_CMD_TIME=y CONFIG_NET=y CONFIG_NET_NETCONSOLE=y -CONFIG_OFDEVICE=y CONFIG_OF_BAREBOX_DRIVERS=y CONFIG_DRIVER_SERIAL_NS16550=y CONFIG_DRIVER_NET_FSL_FMAN=y @@ -105,7 +104,6 @@ CONFIG_EEPROM_AT24=y CONFIG_WATCHDOG=y CONFIG_WATCHDOG_IMX=y CONFIG_GPIO_PCA953X=y -CONFIG_NVMEM=y CONFIG_REGULATOR=y CONFIG_REGULATOR_FIXED=y CONFIG_FS_EXT4=y diff --git a/arch/arm/configs/microchip_ksz9477_evb_defconfig b/arch/arm/configs/microchip_ksz9477_evb_defconfig index 4189b2c039..7130499490 100644 --- a/arch/arm/configs/microchip_ksz9477_evb_defconfig +++ b/arch/arm/configs/microchip_ksz9477_evb_defconfig @@ -1,4 +1,3 @@ -CONFIG_ARCH_SAMA5D3=y CONFIG_AT91_MULTI_BOARDS=y CONFIG_MACH_MICROCHIP_KSZ9477_EVB=y CONFIG_AEABI=y diff --git a/arch/arm/configs/socfpga-arria10_defconfig b/arch/arm/configs/socfpga-arria10_defconfig index e47a0ab183..a37bae6217 100644 --- a/arch/arm/configs/socfpga-arria10_defconfig +++ b/arch/arm/configs/socfpga-arria10_defconfig @@ -18,7 +18,6 @@ CONFIG_BOOTM_INITRD=y CONFIG_BOOTM_OFTREE=y CONFIG_DEFAULT_COMPRESSION_LZO=y CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y -CONFIG_POLLER=y CONFIG_STATE=y CONFIG_LONGHELP=y CONFIG_CMD_IOMEM=y diff --git a/arch/arm/configs/stm32mp_defconfig b/arch/arm/configs/stm32mp_defconfig index c98908debc..92bdf5b040 100644 --- a/arch/arm/configs/stm32mp_defconfig +++ b/arch/arm/configs/stm32mp_defconfig @@ -37,6 +37,7 @@ CONFIG_CMD_MEMINFO=y CONFIG_CMD_ARM_MMUINFO=y CONFIG_CMD_REGULATOR=y CONFIG_CMD_MMC=y +CONFIG_CMD_MMC_EXTCSD=y # CONFIG_CMD_BOOTU is not set CONFIG_CMD_GO=y CONFIG_CMD_RESET=y diff --git a/arch/arm/configs/virt2real_defconfig b/arch/arm/configs/virt2real_defconfig index 814fe69e42..62315b8cb3 100644 --- a/arch/arm/configs/virt2real_defconfig +++ b/arch/arm/configs/virt2real_defconfig @@ -36,7 +36,6 @@ CONFIG_CMD_LED=y CONFIG_CMD_OF_NODE=y CONFIG_CMD_OF_PROPERTY=y CONFIG_CMD_OFTREE=y -CONFIG_OFDEVICE=y CONFIG_OF_BAREBOX_DRIVERS=y CONFIG_DRIVER_SERIAL_NS16550=y # CONFIG_SPI is not set diff --git a/arch/arm/configs/zii_vf610_dev_defconfig b/arch/arm/configs/zii_vf610_dev_defconfig index 45c24d6df4..3ed5d37458 100644 --- a/arch/arm/configs/zii_vf610_dev_defconfig +++ b/arch/arm/configs/zii_vf610_dev_defconfig @@ -8,7 +8,6 @@ CONFIG_MMU=y CONFIG_MALLOC_SIZE=0x0 CONFIG_MALLOC_TLSF=y CONFIG_KALLSYMS=y -CONFIG_RELOCATABLE=y CONFIG_HUSH_FANCY_PROMPT=y CONFIG_AUTO_COMPLETE=y CONFIG_MENU=y diff --git a/arch/arm/cpu/Makefile b/arch/arm/cpu/Makefile index f7f9c30415..e7a6e3e6fb 100644 --- a/arch/arm/cpu/Makefile +++ b/arch/arm/cpu/Makefile @@ -9,6 +9,7 @@ AFLAGS_hyp.o :=-Wa,-march=armv7-a -Wa,-mcpu=all AFLAGS_hyp.pbl.o :=-Wa,-march=armv7-a -Wa,-mcpu=all obj-y += start.o entry.o entry_ll$(S64).o +KASAN_SANITIZE_start.o := n pbl-$(CONFIG_BOARD_ARM_GENERIC_DT) += board-dt-2nd.o pbl-$(CONFIG_BOARD_ARM_GENERIC_DT_AARCH64) += board-dt-2nd-aarch64.o @@ -51,3 +52,4 @@ pbl-y += entry.o entry_ll$(S64).o pbl-y += uncompress.o obj-pbl-y += common.o sections.o +KASAN_SANITIZE_common.o := n diff --git a/arch/arm/cpu/common.c b/arch/arm/cpu/common.c index 33f148fc0e..8cfcc8f6ce 100644 --- a/arch/arm/cpu/common.c +++ b/arch/arm/cpu/common.c @@ -120,7 +120,7 @@ void relocate_to_current_adr(void) dstart += sizeof(*rel); } - memset(dynsym, 0, (unsigned long)dynend - (unsigned long)dynsym); + __memset(dynsym, 0, (unsigned long)dynend - (unsigned long)dynsym); #else #error "Architecture not specified" #endif diff --git a/arch/arm/cpu/setupc.S b/arch/arm/cpu/setupc.S index 8ae7c89a2c..55aa105b21 100644 --- a/arch/arm/cpu/setupc.S +++ b/arch/arm/cpu/setupc.S @@ -21,12 +21,12 @@ ENTRY(setup_c) ldr r2,=__bss_start sub r2, r2, r0 add r1, r0, r4 - bl memcpy /* memcpy(_text, _text + offset, __bss_start - _text) */ + bl __memcpy /* memcpy(_text, _text + offset, __bss_start - _text) */ 1: ldr r0, =__bss_start mov r1, #0 ldr r2, =__bss_stop sub r2, r2, r0 - bl memset /* clear bss */ + bl __memset /* clear bss */ bl sync_caches_for_execution sub lr, r5, r4 /* adjust return address to new location */ pop {r4, r5} @@ -67,7 +67,7 @@ ENTRY(relocate_to_adr) sub r7, r7, r1 /* sub address where we are actually running */ add r7, r7, r0 /* add address where we are going to run */ - bl memcpy /* copy binary */ + bl __memcpy /* copy binary */ bl sync_caches_for_execution diff --git a/arch/arm/cpu/smccc-call.S b/arch/arm/cpu/smccc-call.S index b6bdc8b3b5..9875e1f947 100644 --- a/arch/arm/cpu/smccc-call.S +++ b/arch/arm/cpu/smccc-call.S @@ -1,16 +1,6 @@ -/* - * Copyright (c) 2015, Linaro Limited - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * 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: 2015 Linaro Limited */ + #include <linux/linkage.h> #include <asm/unwind.h> diff --git a/arch/arm/cpu/smccc-call_64.S b/arch/arm/cpu/smccc-call_64.S index 44888fb594..c2959050d2 100644 --- a/arch/arm/cpu/smccc-call_64.S +++ b/arch/arm/cpu/smccc-call_64.S @@ -1,16 +1,6 @@ -/* - * Copyright (c) 2015, Linaro Limited - * - * 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: 2015 Linaro Limited */ + #include <linux/linkage.h> #include <linux/arm-smccc.h> #include <asm/asm-offsets.h> diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c index aeca459cb1..f48f5beea8 100644 --- a/arch/arm/cpu/start.c +++ b/arch/arm/cpu/start.c @@ -15,6 +15,7 @@ #include <asm/unaligned.h> #include <asm/cache.h> #include <asm/mmu.h> +#include <linux/kasan.h> #include <memory.h> #include <uncompress.h> #include <malloc.h> @@ -135,7 +136,7 @@ static int barebox_memory_areas_init(void) } device_initcall(barebox_memory_areas_init); -__noreturn void barebox_non_pbl_start(unsigned long membase, +__noreturn __no_sanitize_address void barebox_non_pbl_start(unsigned long membase, unsigned long memsize, void *boarddata) { unsigned long endmem = membase + memsize; @@ -233,6 +234,8 @@ __noreturn void barebox_non_pbl_start(unsigned long membase, pr_debug("initializing malloc pool at 0x%08lx (size 0x%08lx)\n", malloc_start, malloc_end - malloc_start); + kasan_init(membase, memsize, malloc_start - (memsize >> KASAN_SHADOW_SCALE_SHIFT)); + mem_malloc_init((void *)malloc_start, (void *)malloc_end - 1); if (IS_ENABLED(CONFIG_BOOTM_OPTEE)) @@ -259,7 +262,7 @@ void start(unsigned long membase, unsigned long memsize, void *boarddata); * First function in the uncompressed image. We get here from * the pbl. The stack already has been set up by the pbl. */ -void NAKED __section(.text_entry) start(unsigned long membase, +void NAKED __no_sanitize_address __section(.text_entry) start(unsigned long membase, unsigned long memsize, void *boarddata) { barebox_non_pbl_start(membase, memsize, boarddata); diff --git a/arch/arm/dts/imx51-genesi-efika-sb.dts b/arch/arm/dts/imx51-genesi-efika-sb.dts index fb62fe2c72..7e3017f981 100644 --- a/arch/arm/dts/imx51-genesi-efika-sb.dts +++ b/arch/arm/dts/imx51-genesi-efika-sb.dts @@ -94,7 +94,7 @@ backlight: backlight { compatible = "pwm-backlight"; enable-gpios = <&gpio4 12 GPIO_ACTIVE_LOW>; - pwms = <&pwm1 0 78770>; + pwms = <&pwm1 0 78770 0>; brightness-levels = <0 1 2 4 8 16 32 64 128 255>; default-brightness-level = <9>; pinctrl-names = "default"; diff --git a/arch/arm/dts/imx53-guf-vincell-lt.dts b/arch/arm/dts/imx53-guf-vincell-lt.dts index 0cc6ffc288..d14c0dbf9c 100644 --- a/arch/arm/dts/imx53-guf-vincell-lt.dts +++ b/arch/arm/dts/imx53-guf-vincell-lt.dts @@ -67,7 +67,7 @@ backlight: backlight { compatible = "pwm-backlight"; - pwms = <&pwm1 0 50000>; + pwms = <&pwm1 0 50000 0>; brightness-levels = <0 4 8 16 32 64 128 255>; default-brightness-level = <6>; power-supply = <&ldo3>; diff --git a/arch/arm/dts/imx53-guf-vincell.dts b/arch/arm/dts/imx53-guf-vincell.dts index 9686a2cb57..a5f86ccf7e 100644 --- a/arch/arm/dts/imx53-guf-vincell.dts +++ b/arch/arm/dts/imx53-guf-vincell.dts @@ -49,7 +49,7 @@ backlight: backlight { compatible = "pwm-backlight"; - pwms = <&pwm2 0 50000>; + pwms = <&pwm2 0 50000 0>; brightness-levels = <0 4 8 16 32 64 128 255>; default-brightness-level = <6>; enable-gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>; diff --git a/arch/arm/dts/imx6dl-lanmcu.dts b/arch/arm/dts/imx6dl-lanmcu.dts index b05ed9c3ba..9f69d67a05 100644 --- a/arch/arm/dts/imx6dl-lanmcu.dts +++ b/arch/arm/dts/imx6dl-lanmcu.dts @@ -74,7 +74,7 @@ backlight_lcd: backlight_lcd { compatible = "pwm-backlight"; - pwms = <&pwm1 0 5000000>; + pwms = <&pwm1 0 5000000 0>; brightness-levels = <0 5 7 9 12 15 20 27 35 47 62 81 107 142 188 248 328 433 573 757 1000>; default-brightness-level = <20>; diff --git a/arch/arm/dts/imx6dl-prtvt7.dts b/arch/arm/dts/imx6dl-prtvt7.dts index c202e6786d..27daa3e15f 100644 --- a/arch/arm/dts/imx6dl-prtvt7.dts +++ b/arch/arm/dts/imx6dl-prtvt7.dts @@ -21,7 +21,7 @@ backlight_lcd: backlight-lcd { compatible = "pwm-backlight"; - pwms = <&pwm1 0 500000>; + pwms = <&pwm1 0 500000 0>; brightness-levels = <0 20 81 248 1000>; default-brightness-level = <20>; num-interpolated-steps = <21>; diff --git a/arch/arm/dts/imx6q-guf-santaro.dts b/arch/arm/dts/imx6q-guf-santaro.dts index a915348171..e72aacc59b 100644 --- a/arch/arm/dts/imx6q-guf-santaro.dts +++ b/arch/arm/dts/imx6q-guf-santaro.dts @@ -47,7 +47,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_backlight>; compatible = "pwm-backlight"; - pwms = <&pwm1 0 5000000>; + pwms = <&pwm1 0 5000000 0>; brightness-levels = <0 4 8 16 32 64 128 255>; default-brightness-level = <7>; power-supply = <®_backlight>; diff --git a/arch/arm/dts/imx6q-prti6q.dts b/arch/arm/dts/imx6q-prti6q.dts index 76bb4d53d3..89a23ef0c6 100644 --- a/arch/arm/dts/imx6q-prti6q.dts +++ b/arch/arm/dts/imx6q-prti6q.dts @@ -29,7 +29,7 @@ compatible = "pwm-backlight"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_backlight>; - pwms = <&pwm1 0 5000000>; + pwms = <&pwm1 0 5000000 0>; brightness-levels = <0 16 64 255>; num-interpolated-steps = <16>; default-brightness-level = <16>; diff --git a/arch/arm/dts/imx6qdl-mba6x.dtsi b/arch/arm/dts/imx6qdl-mba6x.dtsi index 216c3be7e8..9cc31491cc 100644 --- a/arch/arm/dts/imx6qdl-mba6x.dtsi +++ b/arch/arm/dts/imx6qdl-mba6x.dtsi @@ -38,7 +38,7 @@ beeper: beeper@0 { compatible = "pwm-beeper"; - pwms = <&pwm1 2 5000000>; + pwms = <&pwm1 2 5000000 0>; }; disp0: display@0 { diff --git a/arch/arm/dts/imx6qp-prtwd3.dts b/arch/arm/dts/imx6qp-prtwd3.dts index 0ef0bae036..97b25ee26a 100644 --- a/arch/arm/dts/imx6qp-prtwd3.dts +++ b/arch/arm/dts/imx6qp-prtwd3.dts @@ -97,7 +97,7 @@ backlight_lcd: backlight_lcd { compatible = "pwm-backlight"; - pwms = <&pwm1 0 5000000>; + pwms = <&pwm1 0 5000000 0>; brightness-levels = <0 1 2 4 6 8 12 16 24 32 48 64 96 128 192 255>; default-brightness-level = <15>; power-supply = <®_3v3>; @@ -105,7 +105,7 @@ backlight_panel1: backlight_panel1 { compatible = "pwm-backlight"; - pwms = <&pwm2 0 5000000>; + pwms = <&pwm2 0 5000000 0>; brightness-levels = <0 1 2 4 6 8 12 16 24 32 48 64 96 128 192 255>; default-brightness-level = <0>; power-supply = <®_3v3>; diff --git a/arch/arm/dts/imx7d-pba-c-09.dtsi b/arch/arm/dts/imx7d-pba-c-09.dtsi index 0b2a987fd4..ffe1239801 100644 --- a/arch/arm/dts/imx7d-pba-c-09.dtsi +++ b/arch/arm/dts/imx7d-pba-c-09.dtsi @@ -265,7 +265,7 @@ }; &backlight { - pwms = <&pwm3 0 5000000>; + pwms = <&pwm3 0 5000000 0>; enable-gpios = <&gpio1 1 0>; status = "disabled"; }; diff --git a/arch/arm/dts/imx8mq-ddrc.dtsi b/arch/arm/dts/imx8mq-ddrc.dtsi index 64826b0373..1df39151a1 100644 --- a/arch/arm/dts/imx8mq-ddrc.dtsi +++ b/arch/arm/dts/imx8mq-ddrc.dtsi @@ -6,12 +6,5 @@ / { /delete-node/ memory@40000000; - - soc@0 { - ddrc@3d400000 { - compatible = "fsl,imx8mq-ddrc"; - reg = <0x3d400000 0x400000>; - }; - }; }; diff --git a/arch/arm/dts/imx8mq.dtsi b/arch/arm/dts/imx8mq.dtsi index 44a86c715a..5f2df35bc9 100644 --- a/arch/arm/dts/imx8mq.dtsi +++ b/arch/arm/dts/imx8mq.dtsi @@ -4,13 +4,6 @@ * Copyright (C) 2017 Pengutronix, Lucas Stach <kernel@pengutronix.de> */ -/ { - aliases { - mmc0 = &usdhc1; - mmc1 = &usdhc2; - }; -}; - &clk { assigned-clocks = <&clk IMX8MQ_CLK_USDHC1>, <&clk IMX8MQ_CLK_USDHC2>, diff --git a/arch/arm/dts/stm32mp151.dtsi b/arch/arm/dts/stm32mp151.dtsi index 5ff3b96fae..cc25400475 100644 --- a/arch/arm/dts/stm32mp151.dtsi +++ b/arch/arm/dts/stm32mp151.dtsi @@ -37,10 +37,6 @@ compatible = "simple-bus"; }; -&{/psci} { - compatible = "arm,psci-0.2"; -}; - &{/soc} { memory-controller@5a003000 { compatible = "st,stm32mp1-ddr"; diff --git a/arch/arm/dts/tegra20-colibri-iris.dts b/arch/arm/dts/tegra20-colibri-iris.dts index 9c615816ca..da5ef7a7e7 100644 --- a/arch/arm/dts/tegra20-colibri-iris.dts +++ b/arch/arm/dts/tegra20-colibri-iris.dts @@ -75,26 +75,22 @@ vqmmc-supply = <&vcc_sd_reg>; }; - regulators { - regulator@0 { - compatible = "regulator-fixed"; - reg = <0>; - regulator-name = "usb_host_vbus"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - regulator-boot-on; - regulator-always-on; - gpio = <&gpio TEGRA_GPIO(W, 2) GPIO_ACTIVE_HIGH>; - }; + regulator_usb_host_vbus { + compatible = "regulator-fixed"; + regulator-name = "usb_host_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-boot-on; + regulator-always-on; + gpio = <&gpio TEGRA_GPIO(W, 2) GPIO_ACTIVE_HIGH>; + }; - vcc_sd_reg: regulator@1 { - compatible = "regulator-fixed"; - reg = <1>; - regulator-name = "vcc_sd"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - regulator-boot-on; - regulator-always-on; - }; + vcc_sd_reg: regulator_vcc_sd { + compatible = "regulator-fixed"; + regulator-name = "vcc_sd"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; }; }; diff --git a/arch/arm/dts/tps65217.dtsi b/arch/arm/dts/tps65217.dtsi deleted file mode 100644 index a63272422d..0000000000 --- a/arch/arm/dts/tps65217.dtsi +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2012 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 as - * published by the Free Software Foundation. - */ - -/* - * Integrated Power Management Chip - * http://www.ti.com/lit/ds/symlink/tps65217.pdf - */ - -&tps { - compatible = "ti,tps65217"; - - regulators { - #address-cells = <1>; - #size-cells = <0>; - - dcdc1_reg: regulator@0 { - reg = <0>; - regulator-compatible = "dcdc1"; - }; - - dcdc2_reg: regulator@1 { - reg = <1>; - regulator-compatible = "dcdc2"; - }; - - dcdc3_reg: regulator@2 { - reg = <2>; - regulator-compatible = "dcdc3"; - }; - - ldo1_reg: regulator@3 { - reg = <3>; - regulator-compatible = "ldo1"; - }; - - ldo2_reg: regulator@4 { - reg = <4>; - regulator-compatible = "ldo2"; - }; - - ldo3_reg: regulator@5 { - reg = <5>; - regulator-compatible = "ldo3"; - }; - - ldo4_reg: regulator@6 { - reg = <6>; - regulator-compatible = "ldo4"; - }; - }; -}; diff --git a/arch/arm/include/asm/string.h b/arch/arm/include/asm/string.h index 435647abda..cd79f63402 100644 --- a/arch/arm/include/asm/string.h +++ b/arch/arm/include/asm/string.h @@ -10,4 +10,7 @@ extern void *memset(void *, int, __kernel_size_t); #endif +extern void *__memcpy(void *, const void *, __kernel_size_t); +extern void *__memset(void *, int, __kernel_size_t); + #endif diff --git a/arch/arm/lib32/barebox.lds.S b/arch/arm/lib32/barebox.lds.S index ed279279a2..54d9b3e381 100644 --- a/arch/arm/lib32/barebox.lds.S +++ b/arch/arm/lib32/barebox.lds.S @@ -77,7 +77,9 @@ SECTIONS _sdata = .; . = ALIGN(4); - .data : { *(.data*) } + .data : { *(.data*) + CONSTRUCTORS + } .barebox_imd : { BAREBOX_IMD } diff --git a/arch/arm/lib32/bootm.c b/arch/arm/lib32/bootm.c index 971ebee8ac..c33ecc2ad8 100644 --- a/arch/arm/lib32/bootm.c +++ b/arch/arm/lib32/bootm.c @@ -20,7 +20,7 @@ #include <restart.h> #include <globalvar.h> #include <tee/optee.h> - +#include <image-fit.h> #include <asm/byteorder.h> #include <asm/setup.h> #include <asm/barebox-arm.h> @@ -166,6 +166,34 @@ static int optee_verify_header_request_region(struct image_data *data, struct op return ret; } +static int bootm_load_tee_from_fit(struct image_data *data) +{ + int ret = 0; + struct optee_header hdr; + + if (data->os_fit && + fit_has_image(data->os_fit, data->fit_config, "tee")) { + const void *tee; + unsigned long tee_size; + + ret = fit_open_image(data->os_fit, data->fit_config, "tee", + &tee, &tee_size); + if (ret) { + pr_err("Error opening tee fit image: %s\n", strerror(-ret)); + return ret; + } + memcpy(&hdr, tee, sizeof(hdr)); + if (optee_verify_header_request_region(data, &hdr) < 0) { + pr_err("%s", strerror(errno)); + ret = -errno; + goto out; + } + memcpy((void *)data->tee_res->start, tee + sizeof(hdr), hdr.init_size); + printf("Read optee image to %pa, size 0x%08x\n", (void *)data->tee_res->start, hdr.init_size); + } +out: + return ret; +} static int bootm_load_tee_from_file(struct image_data *data) { int fd, ret; @@ -262,10 +290,16 @@ static int __do_bootm_linux(struct image_data *data, unsigned long free_mem, return ret; } - if (IS_ENABLED(CONFIG_BOOTM_OPTEE) && data->tee_file) { - ret = bootm_load_tee_from_file(data); - if (ret) - return ret; + if (IS_ENABLED(CONFIG_BOOTM_OPTEE)) { + if (data->tee_file && !IS_ENABLED(CONFIG_BOOTM_FORCE_SIGNED_IMAGES)) { + ret = bootm_load_tee_from_file(data); + if (ret) + return ret; + } else if (IS_ENABLED(CONFIG_FITIMAGE)) { + ret = bootm_load_tee_from_fit(data); + if (ret) + return ret; + } } diff --git a/arch/arm/lib32/memcpy.S b/arch/arm/lib32/memcpy.S index 5123691ca9..0fcdaa88e6 100644 --- a/arch/arm/lib32/memcpy.S +++ b/arch/arm/lib32/memcpy.S @@ -56,9 +56,12 @@ /* Prototype: void *memcpy(void *dest, const void *src, size_t n); */ +.weak memcpy ENTRY(memcpy) +ENTRY(__memcpy) #include "copy_template.S" +ENDPROC(__memcpy) ENDPROC(memcpy) diff --git a/arch/arm/lib32/memset.S b/arch/arm/lib32/memset.S index c4d2672038..6079dd89f6 100644 --- a/arch/arm/lib32/memset.S +++ b/arch/arm/lib32/memset.S @@ -15,6 +15,8 @@ .text .align 5 +.weak memset +ENTRY(__memset) ENTRY(memset) ands r3, r0, #3 @ 1 unaligned? mov ip, r0 @ preserve r0 as return value @@ -121,4 +123,4 @@ ENTRY(memset) add r2, r2, r3 @ 1 (r2 = r2 - (4 - r3)) b 1b ENDPROC(memset) - +ENDPROC(__memset) diff --git a/arch/arm/lib64/string.c b/arch/arm/lib64/string.c index cb26331527..a2cf09e58e 100644 --- a/arch/arm/lib64/string.c +++ b/arch/arm/lib64/string.c @@ -5,18 +5,34 @@ void *__arch_memset(void *dst, int c, __kernel_size_t size); void *__arch_memcpy(void * dest, const void *src, size_t count); -void *memset(void *dst, int c, __kernel_size_t size) +static void *_memset(void *dst, int c, __kernel_size_t size) { if (likely(get_cr() & CR_M)) return __arch_memset(dst, c, size); - return __default_memset(dst, c, size); + return __nokasan_default_memset(dst, c, size); } -void *memcpy(void * dest, const void *src, size_t count) +void __weak *memset(void *dst, int c, __kernel_size_t size) +{ + return _memset(dst, c, size); +} + +void *__memset(void *dst, int c, __kernel_size_t size) + __alias(_memset); + +static void *_memcpy(void * dest, const void *src, size_t count) { if (likely(get_cr() & CR_M)) return __arch_memcpy(dest, src, count); - return __default_memcpy(dest, src, count); -}
\ No newline at end of file + return __nokasan_default_memcpy(dest, src, count); +} + +void __weak *memcpy(void * dest, const void *src, size_t count) +{ + return _memcpy(dest, src, count); +} + +void *__memcpy(void * dest, const void *src, size_t count) + __alias(_memcpy); diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c index 975cd956c9..f89983fe63 100644 --- a/arch/arm/mach-at91/at91rm9200_time.c +++ b/arch/arm/mach-at91/at91rm9200_time.c @@ -88,7 +88,7 @@ static void __noreturn at91rm9200_restart_soc(struct restart_handler *rst) static int restart_register_feature(void) { - restart_handler_register_fn(at91rm9200_restart_soc); + restart_handler_register_fn("soc-wdt", at91rm9200_restart_soc); return 0; } diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c index 56327a2c47..fdd8ea014e 100644 --- a/arch/arm/mach-at91/at91sam9260.c +++ b/arch/arm/mach-at91/at91sam9260.c @@ -243,7 +243,7 @@ static void at91sam9260_initialize(void) at91_add_pit(AT91SAM9260_BASE_PIT); at91_add_sam9_smc(DEVICE_ID_SINGLE, AT91SAM9260_BASE_SMC, 0x200); - restart_handler_register_fn(at91sam9260_restart); + restart_handler_register_fn("soc", at91sam9260_restart); } static int at91sam9260_setup(void) diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c index 4abc556354..0465ed9524 100644 --- a/arch/arm/mach-at91/at91sam9261.c +++ b/arch/arm/mach-at91/at91sam9261.c @@ -235,7 +235,7 @@ static void at91sam9261_initialize(void) at91_add_pit(AT91SAM9261_BASE_PIT); at91_add_sam9_smc(DEVICE_ID_SINGLE, AT91SAM9261_BASE_SMC, 0x200); - restart_handler_register_fn(at91sam9261_restart); + restart_handler_register_fn("soc", at91sam9261_restart); } static int at91sam9261_setup(void) diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c index 690f8e06bb..dc5dddfb64 100644 --- a/arch/arm/mach-at91/at91sam9263.c +++ b/arch/arm/mach-at91/at91sam9263.c @@ -256,7 +256,7 @@ static void at91sam9263_initialize(void) at91_add_sam9_smc(0, AT91SAM9263_BASE_SMC0, 0x200); at91_add_sam9_smc(1, AT91SAM9263_BASE_SMC1, 0x200); - restart_handler_register_fn(at91sam9263_restart); + restart_handler_register_fn("soc", at91sam9263_restart); } static int at91sam9263_setup(void) diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c index 569aa274fc..affc624b1d 100644 --- a/arch/arm/mach-at91/at91sam9g45.c +++ b/arch/arm/mach-at91/at91sam9g45.c @@ -270,7 +270,7 @@ static void at91sam9g45_initialize(void) at91_add_pit(AT91SAM9G45_BASE_PIT); at91_add_sam9_smc(DEVICE_ID_SINGLE, AT91SAM9G45_BASE_SMC, 0x200); - restart_handler_register_fn(at91sam9g45_restart); + restart_handler_register_fn("soc", at91sam9g45_restart); } static int at91sam9g45_setup(void) diff --git a/arch/arm/mach-at91/at91sam9n12.c b/arch/arm/mach-at91/at91sam9n12.c index 365bded56e..850d34604a 100644 --- a/arch/arm/mach-at91/at91sam9n12.c +++ b/arch/arm/mach-at91/at91sam9n12.c @@ -226,7 +226,7 @@ static void at91sam9n12_initialize(void) at91_add_pit(AT91SAM9N12_BASE_PIT); at91_add_sam9_smc(DEVICE_ID_SINGLE, AT91SAM9N12_BASE_SMC, 0x200); - restart_handler_register_fn(at91sam9n12_restart); + restart_handler_register_fn("soc", at91sam9n12_restart); } static int at91sam9n12_setup(void) diff --git a/arch/arm/mach-at91/at91sam9x5.c b/arch/arm/mach-at91/at91sam9x5.c index 40ba9ed56e..086e27a79f 100644 --- a/arch/arm/mach-at91/at91sam9x5.c +++ b/arch/arm/mach-at91/at91sam9x5.c @@ -13,7 +13,7 @@ static void at91sam9x5_restart(struct restart_handler *rst) static int at91sam9x5_initialize(void) { - restart_handler_register_fn(at91sam9x5_restart); + restart_handler_register_fn("soc", at91sam9x5_restart); return 0; } diff --git a/arch/arm/mach-at91/sama5d3.c b/arch/arm/mach-at91/sama5d3.c index a5d464eca0..b1e7b2c565 100644 --- a/arch/arm/mach-at91/sama5d3.c +++ b/arch/arm/mach-at91/sama5d3.c @@ -397,7 +397,7 @@ static void sama5d3_initialize(void) at91_add_pit(SAMA5D3_BASE_PIT); at91_add_sam9_smc(DEVICE_ID_SINGLE, SAMA5D3_BASE_HSMC + 0x600, 0xa0); - restart_handler_register_fn(sama5d3_restart); + restart_handler_register_fn("soc", sama5d3_restart); } static int sama5d3_setup(void) diff --git a/arch/arm/mach-at91/sama5d4.c b/arch/arm/mach-at91/sama5d4.c index ca09dfe425..62e466fe51 100644 --- a/arch/arm/mach-at91/sama5d4.c +++ b/arch/arm/mach-at91/sama5d4.c @@ -305,7 +305,7 @@ static void sama5d4_initialize(void) at91_add_pit(SAMA5D4_BASE_PIT); at91_add_sam9_smc(DEVICE_ID_SINGLE, SAMA5D4_BASE_HSMC + 0x600, 0xa0); - restart_handler_register_fn(sama5d4_restart); + restart_handler_register_fn("soc", sama5d4_restart); } static int sama5d4_setup(void) diff --git a/arch/arm/mach-clps711x/reset.c b/arch/arm/mach-clps711x/reset.c index 03f40b73fa..90ddb8f5d2 100644 --- a/arch/arm/mach-clps711x/reset.c +++ b/arch/arm/mach-clps711x/reset.c @@ -22,7 +22,7 @@ static void __noreturn clps711x_restart_soc(struct restart_handler *rst) static int restart_register_feature(void) { - restart_handler_register_fn(clps711x_restart_soc); + restart_handler_register_fn("vector", clps711x_restart_soc); return 0; } diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c index 4d1b570aa0..5b57fe6192 100644 --- a/arch/arm/mach-davinci/time.c +++ b/arch/arm/mach-davinci/time.c @@ -210,7 +210,7 @@ static void __noreturn davinci_restart_soc(struct restart_handler *rst) static int restart_register_feature(void) { - restart_handler_register_fn(davinci_restart_soc); + restart_handler_register_fn("soc-wdt", davinci_restart_soc); return 0; } diff --git a/arch/arm/mach-ep93xx/clocksource.c b/arch/arm/mach-ep93xx/clocksource.c index 4fdcc36b1c..1f3ff7f8f2 100644 --- a/arch/arm/mach-ep93xx/clocksource.c +++ b/arch/arm/mach-ep93xx/clocksource.c @@ -85,7 +85,7 @@ static void __noreturn ep92xx_restart_soc(struct restart_handler *rst) static int restart_register_feature(void) { - restart_handler_register_fn(ep92xx_restart_soc); + restart_handler_register_fn("soc", ep92xx_restart_soc); return 0; } diff --git a/arch/arm/mach-ep93xx/header.c b/arch/arm/mach-ep93xx/header.c index 4e6a2e57c8..a9dde2d8b0 100644 --- a/arch/arm/mach-ep93xx/header.c +++ b/arch/arm/mach-ep93xx/header.c @@ -2,6 +2,8 @@ #include <linux/compiler.h> #include <asm/barebox-arm-head.h> +void go(void); + void __naked __section(.flash_header_start) go(void) { barebox_arm_head(); diff --git a/arch/arm/mach-highbank/reset.c b/arch/arm/mach-highbank/reset.c index d73a0a76a5..ea3908ec2b 100644 --- a/arch/arm/mach-highbank/reset.c +++ b/arch/arm/mach-highbank/reset.c @@ -33,7 +33,7 @@ static void __noreturn highbank_poweroff(struct poweroff_handler *handler) static int highbank_init(void) { - restart_handler_register_fn(highbank_restart_soc); + restart_handler_register_fn("soc", highbank_restart_soc); poweroff_handler_register_fn(highbank_poweroff); return 0; diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index 2e8d2bd56c..0fffde46eb 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig @@ -215,6 +215,7 @@ config ARCH_VF610 config IMX_MULTI_BOARDS bool "Allow multiple boards to be selected" select HAVE_PBL_MULTI_IMAGES + select RELOCATABLE if IMX_MULTI_BOARDS diff --git a/arch/arm/mach-imx/include/mach/habv4-imx6-gencsf-template.h b/arch/arm/mach-imx/include/mach/habv4-imx6-gencsf-template.h new file mode 100644 index 0000000000..668fb0646f --- /dev/null +++ b/arch/arm/mach-imx/include/mach/habv4-imx6-gencsf-template.h @@ -0,0 +1,64 @@ +/* + * This snippet can be included from a i.MX flash header configuration + * file for generating signed images. The necessary keys/certificates + * are expected in these config variables: + * + * CONFIG_HABV4_TABLE_BIN + * CONFIG_HABV4_CSF_CRT_PEM + * CONFIG_HABV4_IMG_CRT_PEM + */ + +#ifndef SETUP_HABV4_ENGINE +#error "SETUP_HABV4_ENGINE undefined" +#endif + +hab [Header] +hab Version = 4.1 +hab Hash Algorithm = sha256 +hab Engine Configuration = 0 +hab Certificate Format = X509 +hab Signature Format = CMS +hab Engine = SETUP_HABV4_ENGINE + +hab [Install SRK] +hab File = CONFIG_HABV4_TABLE_BIN +hab # SRK index within SRK-Table 0..3 +hab Source index = CONFIG_HABV4_SRK_INDEX + +hab [Install CSFK] +/* target key index in keystore 1 */ +hab File = CONFIG_HABV4_CSF_CRT_PEM + +hab [Authenticate CSF] + +hab [Unlock] +hab Engine = SETUP_HABV4_ENGINE +#ifdef SETUP_HABV4_FEATURES +hab Features = SETUP_HABV4_FEATURES +#endif + +hab [Install Key] +/* verification key index in key store (0, 2...4) */ +hab Verification index = 0 +/* target key index in key store (2...4) */ +hab Target index = 2 +hab File = CONFIG_HABV4_IMG_CRT_PEM + +hab [Authenticate Data] +/* verification key index in key store (2...4) */ +hab Verification index = 2 + +hab_blocks + +hab_encrypt [Install Secret Key] +hab_encrypt Verification index = 0 +hab_encrypt Target index = 0 +hab_encrypt_key +hab_encrypt_key_length 256 +hab_encrypt_blob_address + +hab_encrypt [Decrypt Data] +hab_encrypt Verification index = 0 +hab_encrypt Mac Bytes = 16 + +hab_encrypt_blocks diff --git a/arch/arm/mach-imx/include/mach/habv4-imx6-gencsf.h b/arch/arm/mach-imx/include/mach/habv4-imx6-gencsf.h index 17c4d79567..ca741b2736 100644 --- a/arch/arm/mach-imx/include/mach/habv4-imx6-gencsf.h +++ b/arch/arm/mach-imx/include/mach/habv4-imx6-gencsf.h @@ -1,58 +1,5 @@ -/* - * This snippet can be included from a i.MX flash header configuration - * file for generating signed images. The necessary keys/certificates - * are expected in these config variables: - * - * CONFIG_HABV4_TABLE_BIN - * CONFIG_HABV4_CSF_CRT_PEM - * CONFIG_HABV4_IMG_CRT_PEM - */ -hab [Header] -hab Version = 4.1 -hab Hash Algorithm = sha256 -hab Engine Configuration = 0 -hab Certificate Format = X509 -hab Signature Format = CMS -hab Engine = CAAM +#define SETUP_HABV4_ENGINE CAAM +#define SETUP_HABV4_FEATURES RNG, MID -hab [Install SRK] -hab File = CONFIG_HABV4_TABLE_BIN -hab # SRK index within SRK-Table 0..3 -hab Source index = CONFIG_HABV4_SRK_INDEX - -hab [Install CSFK] -/* target key index in keystore 1 */ -hab File = CONFIG_HABV4_CSF_CRT_PEM - -hab [Authenticate CSF] - -hab [Unlock] -hab Engine = CAAM -hab Features = RNG, MID - -hab [Install Key] -/* verification key index in key store (0, 2...4) */ -hab Verification index = 0 -/* target key index in key store (2...4) */ -hab Target index = 2 -hab File = CONFIG_HABV4_IMG_CRT_PEM - -hab [Authenticate Data] -/* verification key index in key store (2...4) */ -hab Verification index = 2 - -hab_blocks - -hab_encrypt [Install Secret Key] -hab_encrypt Verification index = 0 -hab_encrypt Target index = 0 -hab_encrypt_key -hab_encrypt_key_length 256 -hab_encrypt_blob_address - -hab_encrypt [Decrypt Data] -hab_encrypt Verification index = 0 -hab_encrypt Mac Bytes = 16 - -hab_encrypt_blocks +#include <mach/habv4-imx6-gencsf-template.h> diff --git a/arch/arm/mach-imx/include/mach/habv4-imx6ull-gencsf.h b/arch/arm/mach-imx/include/mach/habv4-imx6ull-gencsf.h new file mode 100644 index 0000000000..6a558b880b --- /dev/null +++ b/arch/arm/mach-imx/include/mach/habv4-imx6ull-gencsf.h @@ -0,0 +1,4 @@ + +#define SETUP_HABV4_ENGINE SW + +#include <mach/habv4-imx6-gencsf-template.h> diff --git a/arch/arm/mach-mvebu/armada-370-xp.c b/arch/arm/mach-mvebu/armada-370-xp.c index 2589f4fe72..9a35c51985 100644 --- a/arch/arm/mach-mvebu/armada-370-xp.c +++ b/arch/arm/mach-mvebu/armada-370-xp.c @@ -132,7 +132,7 @@ static int armada_370_xp_init_soc(void) if (!of_machine_is_compatible("marvell,armada-370-xp")) return 0; - restart_handler_register_fn(armada_370_xp_restart_soc); + restart_handler_register_fn("soc", armada_370_xp_restart_soc); barebox_set_model("Marvell Armada 370/XP"); barebox_set_hostname("armada"); diff --git a/arch/arm/mach-mvebu/dove.c b/arch/arm/mach-mvebu/dove.c index 37fde63f18..3c6302dd2d 100644 --- a/arch/arm/mach-mvebu/dove.c +++ b/arch/arm/mach-mvebu/dove.c @@ -36,7 +36,7 @@ static int dove_init_soc(void) if (!of_machine_is_compatible("marvell,dove")) return 0; - restart_handler_register_fn(dove_restart_soc); + restart_handler_register_fn("soc", dove_restart_soc); barebox_set_model("Marvell Dove"); barebox_set_hostname("dove"); diff --git a/arch/arm/mach-mvebu/kirkwood.c b/arch/arm/mach-mvebu/kirkwood.c index 59fb95ff4a..e50d7501c8 100644 --- a/arch/arm/mach-mvebu/kirkwood.c +++ b/arch/arm/mach-mvebu/kirkwood.c @@ -34,7 +34,7 @@ static int kirkwood_init_soc(void) if (!of_machine_is_compatible("marvell,kirkwood")) return 0; - restart_handler_register_fn(kirkwood_restart_soc); + restart_handler_register_fn("soc", kirkwood_restart_soc); barebox_set_model("Marvell Kirkwood"); barebox_set_hostname("kirkwood"); diff --git a/arch/arm/mach-mxs/soc-imx23.c b/arch/arm/mach-mxs/soc-imx23.c index f25fff18c3..8c47c766cc 100644 --- a/arch/arm/mach-mxs/soc-imx23.c +++ b/arch/arm/mach-mxs/soc-imx23.c @@ -49,7 +49,7 @@ static int imx23_devices_init(void) add_generic_device("imx23-gpio", 0, NULL, IMX_IOMUXC_BASE, 0x2000, IORESOURCE_MEM, NULL); add_generic_device("imx23-gpio", 1, NULL, IMX_IOMUXC_BASE, 0x2000, IORESOURCE_MEM, NULL); add_generic_device("imx23-gpio", 2, NULL, IMX_IOMUXC_BASE, 0x2000, IORESOURCE_MEM, NULL); - restart_handler_register_fn(imx23_restart_soc); + restart_handler_register_fn("soc", imx23_restart_soc); return 0; } diff --git a/arch/arm/mach-mxs/soc-imx28.c b/arch/arm/mach-mxs/soc-imx28.c index 49f870b5bf..a214e2b7a6 100644 --- a/arch/arm/mach-mxs/soc-imx28.c +++ b/arch/arm/mach-mxs/soc-imx28.c @@ -51,7 +51,7 @@ static int imx28_init(void) HW_CLKCTRL_WDOG_POR_DISABLE; writel(reg, IMX_CCM_BASE + HW_CLKCTRL_RESET); - restart_handler_register_fn(imx28_restart_soc); + restart_handler_register_fn("soc", imx28_restart_soc); arm_add_mem_device("ram0", IMX_MEMORY_BASE, imx28_get_memsize()); diff --git a/arch/arm/mach-nomadik/reset.c b/arch/arm/mach-nomadik/reset.c index 8bdaada8a1..d5266068e2 100644 --- a/arch/arm/mach-nomadik/reset.c +++ b/arch/arm/mach-nomadik/reset.c @@ -35,7 +35,7 @@ static void __noreturn nomadik_restart_soc(struct restart_handler *rst) static int restart_register_feature(void) { - restart_handler_register_fn(nomadik_restart_soc); + restart_handler_register_fn("soc", nomadik_restart_soc); return 0; } diff --git a/arch/arm/mach-omap/am33xx_generic.c b/arch/arm/mach-omap/am33xx_generic.c index 7577df761c..3c5cdf065c 100644 --- a/arch/arm/mach-omap/am33xx_generic.c +++ b/arch/arm/mach-omap/am33xx_generic.c @@ -244,7 +244,7 @@ int am33xx_init(void) { omap_gpmc_base = (void *)AM33XX_GPMC_BASE; - restart_handler_register_fn(am33xx_restart_soc); + restart_handler_register_fn("soc", am33xx_restart_soc); am33xx_enable_per_clocks(); diff --git a/arch/arm/mach-omap/omap3_generic.c b/arch/arm/mach-omap/omap3_generic.c index cff4a4fb11..3f6a346277 100644 --- a/arch/arm/mach-omap/omap3_generic.c +++ b/arch/arm/mach-omap/omap3_generic.c @@ -540,7 +540,7 @@ int omap3_init(void) { omap_gpmc_base = (void *)OMAP3_GPMC_BASE; - restart_handler_register_fn(omap3_restart_soc); + restart_handler_register_fn("soc", omap3_restart_soc); if (IS_ENABLED(CONFIG_RESET_SOURCE)) omap3_detect_reset_reason(); diff --git a/arch/arm/mach-omap/omap4_generic.c b/arch/arm/mach-omap/omap4_generic.c index 1f71153848..848a664064 100644 --- a/arch/arm/mach-omap/omap4_generic.c +++ b/arch/arm/mach-omap/omap4_generic.c @@ -535,7 +535,7 @@ int omap4_init(void) { omap_gpmc_base = (void *)OMAP44XX_GPMC_BASE; - restart_handler_register_fn(omap4_restart_soc); + restart_handler_register_fn("soc", omap4_restart_soc); return omap4_bootsource(); } diff --git a/arch/arm/mach-pxa/common.c b/arch/arm/mach-pxa/common.c index 106ca3020e..5b980cb81b 100644 --- a/arch/arm/mach-pxa/common.c +++ b/arch/arm/mach-pxa/common.c @@ -41,7 +41,7 @@ static void __noreturn pxa_restart_soc(struct restart_handler *rst) static int restart_register_feature(void) { - restart_handler_register_fn(pxa_restart_soc); + restart_handler_register_fn("soc-wdt", pxa_restart_soc); return 0; } diff --git a/arch/arm/mach-rockchip/rk3188.c b/arch/arm/mach-rockchip/rk3188.c index e7cbf36457..572e9dc58f 100644 --- a/arch/arm/mach-rockchip/rk3188.c +++ b/arch/arm/mach-rockchip/rk3188.c @@ -29,7 +29,7 @@ static void __noreturn rockchip_restart_soc(struct restart_handler *rst) static int restart_register_feature(void) { - restart_handler_register_fn(rockchip_restart_soc); + restart_handler_register_fn("soc", rockchip_restart_soc); return 0; } diff --git a/arch/arm/mach-rockchip/rk3288.c b/arch/arm/mach-rockchip/rk3288.c index 4e8fb4a123..9076fd9227 100644 --- a/arch/arm/mach-rockchip/rk3288.c +++ b/arch/arm/mach-rockchip/rk3288.c @@ -60,7 +60,7 @@ static void rk3288_detect_reset_reason(void) static int rk3288_init(void) { - restart_handler_register_fn(rockchip_restart_soc); + restart_handler_register_fn("soc", rockchip_restart_soc); if (IS_ENABLED(CONFIG_RESET_SOURCE)) rk3288_detect_reset_reason(); diff --git a/arch/arm/mach-samsung/generic.c b/arch/arm/mach-samsung/generic.c index de38d47e21..ed3d30d995 100644 --- a/arch/arm/mach-samsung/generic.c +++ b/arch/arm/mach-samsung/generic.c @@ -44,7 +44,7 @@ static void __noreturn samsung_restart_soc(struct restart_handler *rst) static int restart_register_feature(void) { - restart_handler_register_fn(samsung_restart_soc); + restart_handler_register_fn("soc-wdt", samsung_restart_soc); return 0; } diff --git a/arch/arm/mach-socfpga/arria10-generic.c b/arch/arm/mach-socfpga/arria10-generic.c index 53ec278739..38558309f8 100644 --- a/arch/arm/mach-socfpga/arria10-generic.c +++ b/arch/arm/mach-socfpga/arria10-generic.c @@ -70,7 +70,7 @@ static int arria10_generic_init(void) arria10_init_emac(); pr_debug("Register restart handler\n"); - restart_handler_register_fn(arria10_restart_soc); + restart_handler_register_fn("soc", arria10_restart_soc); return 0; } diff --git a/arch/arm/mach-socfpga/cyclone5-reset-manager.c b/arch/arm/mach-socfpga/cyclone5-reset-manager.c index 8635806846..4ee90b1bb0 100644 --- a/arch/arm/mach-socfpga/cyclone5-reset-manager.c +++ b/arch/arm/mach-socfpga/cyclone5-reset-manager.c @@ -37,7 +37,7 @@ static void __noreturn socfpga_restart_soc(struct restart_handler *rst) static int restart_register_feature(void) { - restart_handler_register_fn(socfpga_restart_soc); + restart_handler_register_fn("soc", socfpga_restart_soc); return 0; } diff --git a/arch/arm/mach-tegra/tegra20-pmc.c b/arch/arm/mach-tegra/tegra20-pmc.c index f7c7ac918f..a252c995ea 100644 --- a/arch/arm/mach-tegra/tegra20-pmc.c +++ b/arch/arm/mach-tegra/tegra20-pmc.c @@ -246,7 +246,7 @@ static struct driver_d tegra20_pmc_driver = { static int tegra20_pmc_init(void) { - restart_handler_register_fn(tegra20_restart_soc); + restart_handler_register_fn("soc", tegra20_restart_soc); return platform_driver_register(&tegra20_pmc_driver); } coredevice_initcall(tegra20_pmc_init); diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c index 7c6e9523a2..eb94a07dc9 100644 --- a/arch/arm/mach-versatile/core.c +++ b/arch/arm/mach-versatile/core.c @@ -75,19 +75,6 @@ void clk_disable(struct clk *clk) } EXPORT_SYMBOL(clk_disable); -/* Create a clock structure with the given name */ -int vpb_clk_create(struct clk *clk, const char *dev_id) -{ - struct clk_lookup *clkdev; - - clkdev = clkdev_alloc(clk, NULL, dev_id); - if (!clkdev) - return -ENOMEM; - - clkdev_add(clkdev); - return 0; -} - /* 1Mhz / 256 */ #define TIMER_FREQ (1000000/256) @@ -205,7 +192,7 @@ static int versatile_init(void) amba_apb_device_add(NULL, "pl061_gpio", 1, 0x101e5000, 4096, NULL, 0); amba_apb_device_add(NULL, "pl061_gpio", 2, 0x101e6000, 4096, NULL, 0); amba_apb_device_add(NULL, "pl061_gpio", 3, 0x101e7000, 4096, NULL, 0); - restart_handler_register_fn(versatile_reset_soc); + restart_handler_register_fn("soc", versatile_reset_soc); return 0; } coredevice_initcall(versatile_init); diff --git a/arch/arm/mach-vexpress/reset.c b/arch/arm/mach-vexpress/reset.c index 3164ae3079..78e452936d 100644 --- a/arch/arm/mach-vexpress/reset.c +++ b/arch/arm/mach-vexpress/reset.c @@ -24,7 +24,7 @@ static void vexpress_reset_soc(struct restart_handler *rst) static int restart_register_feature(void) { - restart_handler_register_fn(vexpress_reset_soc); + restart_handler_register_fn("soc-wdt", vexpress_reset_soc); return 0; } diff --git a/arch/arm/mach-zynq/zynq.c b/arch/arm/mach-zynq/zynq.c index 79a6b908e0..806aeb9130 100644 --- a/arch/arm/mach-zynq/zynq.c +++ b/arch/arm/mach-zynq/zynq.c @@ -69,7 +69,7 @@ static int zynq_init(void) writel(val, 0xf8f00000); dmb(); - restart_handler_register_fn(zynq_restart_soc); + restart_handler_register_fn("soc", zynq_restart_soc); bootsource_set(zynq_bootsource_get()); diff --git a/arch/kvx/configs/generic_defconfig b/arch/kvx/configs/generic_defconfig index 8162171741..0d971ff3d5 100644 --- a/arch/kvx/configs/generic_defconfig +++ b/arch/kvx/configs/generic_defconfig @@ -1,15 +1,13 @@ CONFIG_AUTO_COMPLETE=y -CONFIG_BAUDRATE=115200 -CONFIG_CLOCKSOURCE_KVX=y +CONFIG_CONSOLE_RATP=y CONFIG_CMD_BOOT=y -CONFIG_CMD_BOOTM=y +CONFIG_CMD_RESET=y CONFIG_CMD_CMP=y -CONFIG_CMD_OF_DUMP=y CONFIG_CMD_POWEROFF=y -CONFIG_CMD_RESET=y CONFIG_CMD_WD=y -CONFIG_CONSOLE_RATP=y +CONFIG_CMD_OF_DUMP=y CONFIG_DRIVER_SERIAL_NS16550=y -CONFIG_PINCTRL_SINGLE=y +CONFIG_CLOCKSOURCE_KVX=y CONFIG_WATCHDOG=y CONFIG_WATCHDOG_KVX=y +CONFIG_PINCTRL_SINGLE=y diff --git a/arch/kvx/cpu/reset.c b/arch/kvx/cpu/reset.c index c7f2018e00..df36764cb6 100644 --- a/arch/kvx/cpu/reset.c +++ b/arch/kvx/cpu/reset.c @@ -60,7 +60,7 @@ static int kvx_reset_init(void) break; } - restart_handler_register_fn(kvx_restart_soc); + restart_handler_register_fn("soc", kvx_restart_soc); return 0; } diff --git a/arch/kvx/dts/Makefile b/arch/kvx/dts/Makefile index 391783c1ea..d4221d2c1b 100644 --- a/arch/kvx/dts/Makefile +++ b/arch/kvx/dts/Makefile @@ -9,5 +9,4 @@ endif obj-$(CONFIG_BOARD_K200) += k200.dtb.o -always := $(dtb-y) clean-files := *.dtb *.dtb.S .*.dtc .*.pre .*.dts diff --git a/arch/mips/configs/bcm47xx_defconfig b/arch/mips/configs/bcm47xx_defconfig index 0cd0e9e650..9cf172a70e 100644 --- a/arch/mips/configs/bcm47xx_defconfig +++ b/arch/mips/configs/bcm47xx_defconfig @@ -9,7 +9,6 @@ CONFIG_MENU=y CONFIG_BOOTM_SHOW_TYPE=y CONFIG_PARTITION=y # CONFIG_DEFAULT_ENVIRONMENT is not set -CONFIG_POLLER=y CONFIG_LONGHELP=y CONFIG_CMD_IOMEM=y CONFIG_CMD_MEMINFO=y diff --git a/arch/mips/configs/qemu-malta_defconfig b/arch/mips/configs/qemu-malta_defconfig index 2465c0260d..ac0577c217 100644 --- a/arch/mips/configs/qemu-malta_defconfig +++ b/arch/mips/configs/qemu-malta_defconfig @@ -12,7 +12,6 @@ CONFIG_BOOTM_SHOW_TYPE=y CONFIG_CONSOLE_ALLOW_COLOR=y CONFIG_PARTITION=y CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y -CONFIG_POLLER=y CONFIG_CMD_DMESG=y CONFIG_LONGHELP=y CONFIG_CMD_IOMEM=y diff --git a/arch/mips/mach-ar231x/ar231x_reset.c b/arch/mips/mach-ar231x/ar231x_reset.c index f88167ba4c..91414edd26 100644 --- a/arch/mips/mach-ar231x/ar231x_reset.c +++ b/arch/mips/mach-ar231x/ar231x_reset.c @@ -68,7 +68,7 @@ static struct driver_d ar231x_reset_driver = { static int ar231x_reset_init(void) { - restart_handler_register_fn(ar2312x_restart_soc); + restart_handler_register_fn("soc-wdt", ar2312x_restart_soc); return platform_driver_register(&ar231x_reset_driver); } coredevice_initcall(ar231x_reset_init); diff --git a/arch/mips/mach-ath79/reset.c b/arch/mips/mach-ath79/reset.c index b756c859d8..393ca00b08 100644 --- a/arch/mips/mach-ath79/reset.c +++ b/arch/mips/mach-ath79/reset.c @@ -22,7 +22,7 @@ static void __noreturn ath79_restart_soc(struct restart_handler *rst) static int restart_register_feature(void) { - restart_handler_register_fn(ath79_restart_soc); + restart_handler_register_fn("soc", ath79_restart_soc); return 0; } diff --git a/arch/mips/mach-bcm47xx/reset.c b/arch/mips/mach-bcm47xx/reset.c index 33dfb7b3b5..3ab9b0ce4b 100644 --- a/arch/mips/mach-bcm47xx/reset.c +++ b/arch/mips/mach-bcm47xx/reset.c @@ -19,7 +19,7 @@ static void __noreturn bcm47xx_restart_soc(struct restart_handler *rst) static int restart_register_feature(void) { - restart_handler_register_fn(bcm47xx_restart_soc); + restart_handler_register_fn("soc", bcm47xx_restart_soc); return 0; } diff --git a/arch/mips/mach-loongson/loongson1_reset.c b/arch/mips/mach-loongson/loongson1_reset.c index a6c05905de..85752f4ab8 100644 --- a/arch/mips/mach-loongson/loongson1_reset.c +++ b/arch/mips/mach-loongson/loongson1_reset.c @@ -20,7 +20,7 @@ static void __noreturn longhorn_restart_soc(struct restart_handler *rst) static int restart_register_feature(void) { - restart_handler_register_fn(longhorn_restart_soc); + restart_handler_register_fn("soc-wdt", longhorn_restart_soc); return 0; } diff --git a/arch/mips/mach-malta/reset.c b/arch/mips/mach-malta/reset.c index df7be0ae55..ad0de2741b 100644 --- a/arch/mips/mach-malta/reset.c +++ b/arch/mips/mach-malta/reset.c @@ -24,7 +24,7 @@ static void __noreturn malta_restart_soc(struct restart_handler *rst) static int restart_register_feature(void) { - restart_handler_register_fn(malta_restart_soc); + restart_handler_register_fn("soc", malta_restart_soc); return 0; } diff --git a/arch/nios2/cpu/cpu.c b/arch/nios2/cpu/cpu.c index 62bcf40f63..9f86c911cc 100644 --- a/arch/nios2/cpu/cpu.c +++ b/arch/nios2/cpu/cpu.c @@ -30,7 +30,7 @@ static void __noreturn nios2_restart_soc(struct restart_handler *rst) static int restart_register_feature(void) { - return restart_handler_register_fn(nios2_restart_soc); + return restart_handler_register_fn("vector", nios2_restart_soc); } coredevice_initcall(restart_register_feature); diff --git a/arch/openrisc/cpu/cache.c b/arch/openrisc/cpu/cache.c index 1da2380c03..a124d6612c 100644 --- a/arch/openrisc/cpu/cache.c +++ b/arch/openrisc/cpu/cache.c @@ -17,6 +17,7 @@ #include <common.h> #include <init.h> #include <asm/system.h> +#include <asm/cache.h> void flush_dcache_range(unsigned long addr, unsigned long stop) { @@ -130,7 +131,7 @@ void icache_disable(void) mtspr(SPR_SR, mfspr(SPR_SR) & ~SPR_SR_ICE); } -int cache_init(void) +static int cache_init(void) { if (mfspr(SPR_UPR) & SPR_UPR_ICP) { icache_disable(); diff --git a/arch/openrisc/cpu/cpu.c b/arch/openrisc/cpu/cpu.c index 8afd22bdea..47d8ab4288 100644 --- a/arch/openrisc/cpu/cpu.c +++ b/arch/openrisc/cpu/cpu.c @@ -33,6 +33,6 @@ static void __noreturn openrisc_restart_cpu(struct restart_handler *rst) static int restart_register_feature(void) { - return restart_handler_register_fn(openrisc_restart_cpu); + return restart_handler_register_fn("vector", openrisc_restart_cpu); } coredevice_initcall(restart_register_feature); diff --git a/arch/openrisc/cpu/exceptions.c b/arch/openrisc/cpu/exceptions.c index d01fbfbb1c..c69ceafe80 100644 --- a/arch/openrisc/cpu/exceptions.c +++ b/arch/openrisc/cpu/exceptions.c @@ -16,6 +16,7 @@ #include <common.h> #include <asm/system.h> +#include <asm/openrisc_exc.h> static const char * const excp_table[] = { "Unknown exception", @@ -69,6 +70,9 @@ static void exception_hang(int vect) hang(); } +/* Called from assembly */ +void exception_handler(int vect); + void exception_handler(int vect) { int exception = vect >> 8; diff --git a/arch/openrisc/lib/board.c b/arch/openrisc/lib/board.c index 67ea96fc02..9591120fee 100644 --- a/arch/openrisc/lib/board.c +++ b/arch/openrisc/lib/board.c @@ -19,6 +19,9 @@ #include <memory.h> #include <asm-generic/memory_layout.h> +/* Called from assembly */ +void openrisc_start_barebox(void); + void __noreturn openrisc_start_barebox(void) { mem_malloc_init((void *)(OPENRISC_SOPC_TEXT_BASE - MALLOC_SIZE), diff --git a/arch/openrisc/lib/cpuinfo.c b/arch/openrisc/lib/cpuinfo.c index 4c52a65421..d94178ea59 100644 --- a/arch/openrisc/lib/cpuinfo.c +++ b/arch/openrisc/lib/cpuinfo.c @@ -95,7 +95,7 @@ static void cpu_implementation(ulong vr2, char *string) } } -int checkcpu(void) +static int checkcpu(void) { ulong upr = mfspr(SPR_UPR); ulong vr = mfspr(SPR_VR); diff --git a/arch/powerpc/mach-mpc5xxx/cpu.c b/arch/powerpc/mach-mpc5xxx/cpu.c index d8d4dfb2ce..9c99bdd26f 100644 --- a/arch/powerpc/mach-mpc5xxx/cpu.c +++ b/arch/powerpc/mach-mpc5xxx/cpu.c @@ -68,7 +68,7 @@ static void __noreturn mpc5xxx_restart_soc(struct restart_handler *rst) static int restart_register_feature(void) { - return restart_handler_register_fn(mpc5xxx_restart_soc); + return restart_handler_register_fn("soc-wdt", mpc5xxx_restart_soc); } coredevice_initcall(restart_register_feature); diff --git a/arch/powerpc/mach-mpc85xx/cpu.c b/arch/powerpc/mach-mpc85xx/cpu.c index a5241b82a7..2119352f84 100644 --- a/arch/powerpc/mach-mpc85xx/cpu.c +++ b/arch/powerpc/mach-mpc85xx/cpu.c @@ -43,7 +43,7 @@ static void __noreturn mpc85xx_restart_soc(struct restart_handler *rst) static int restart_register_feature(void) { - restart_handler_register_fn(mpc85xx_restart_soc); + restart_handler_register_fn("soc", mpc85xx_restart_soc); return 0; } diff --git a/arch/riscv/dts/Makefile b/arch/riscv/dts/Makefile index 509f236cc0..6bd4e5a925 100644 --- a/arch/riscv/dts/Makefile +++ b/arch/riscv/dts/Makefile @@ -9,5 +9,4 @@ obj-$(CONFIG_BOARD_ERIZO_GENERIC) += erizo-generic.dtb.o # created. obj- += dummy.o -always := $(dtb-y) clean-files := *.dtb *.dtb.S .*.dtc .*.pre .*.dts diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig index 40e04919d2..bced81f25e 100644 --- a/arch/sandbox/Kconfig +++ b/arch/sandbox/Kconfig @@ -5,8 +5,11 @@ config SANDBOX select OFTREE select GPIOLIB select ARCH_HAS_UBSAN_SANITIZE_ALL - select HAVE_ARCH_KASAN + select HAVE_ARCH_ASAN select HAS_DMA + select BLOCK + select BLOCK_WRITE + select PARTITION_DISK default y config ARCH_TEXT_BASE @@ -22,7 +25,14 @@ config SANDBOX_UNWIND bool default y select ARCH_HAS_STACK_DUMP - depends on UBSAN || KASAN + depends on UBSAN || ASAN + +config SANDBOX_REEXEC + prompt "exec(2) reset handler" + def_bool y + help + The normal reset handler hangs barebox. On Linux, barebox + instead can exec itself to simulate a reset. config PHYS_ADDR_T_64BIT bool diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile index 27021222dc..09112c3ba8 100644 --- a/arch/sandbox/Makefile +++ b/arch/sandbox/Makefile @@ -25,7 +25,7 @@ KBUILD_CFLAGS += -Dmalloc=barebox_malloc -Dcalloc=barebox_calloc \ -Dglob=barebox_glob -Dglobfree=barebox_globfree \ -Dioctl=barebox_ioctl -Dfstat=barebox_fstat \ -Dopendir=barebox_opendir -Dreaddir=barebox_readdir \ - -Dclosedir=barebox_closedir \ + -Dclosedir=barebox_closedir -Dreadlink=barebox_readlink \ -Doptarg=barebox_optarg -Doptind=barebox_optind machdirs := $(patsubst %,arch/sandbox/mach-%/,$(machine-y)) @@ -44,7 +44,7 @@ ifeq ($(CONFIG_GPIO_LIBFTDI1),y) FTDI1_LIBS := $(shell pkg-config libftdi1 --libs) endif -ifeq ($(CONFIG_KASAN),y) +ifeq ($(CONFIG_ASAN),y) KBUILD_CPPFLAGS += -fsanitize=address SANITIZER_LIBS += -fsanitize=address endif diff --git a/arch/sandbox/board/dtb.c b/arch/sandbox/board/dtb.c index 74ecbadf42..d11bde0249 100644 --- a/arch/sandbox/board/dtb.c +++ b/arch/sandbox/board/dtb.c @@ -46,7 +46,7 @@ static int of_sandbox_init(void) if (ret) return ret; - ret = of_property_write_u32(root, "#size-cells", 1); + ret = of_property_write_u32(root, "#size-cells", 2); if (ret) return ret; } diff --git a/arch/sandbox/board/hostfile.c b/arch/sandbox/board/hostfile.c index 5f0d7e0a4b..63530bd25e 100644 --- a/arch/sandbox/board/hostfile.c +++ b/arch/sandbox/board/hostfile.c @@ -16,6 +16,8 @@ #include <common.h> #include <driver.h> +#include <block.h> +#include <disks.h> #include <malloc.h> #include <mach/linux.h> #include <init.h> @@ -27,14 +29,16 @@ #include <linux/err.h> struct hf_priv { - struct cdev cdev; + union { + struct block_device blk; + struct cdev cdev; + }; const char *filename; int fd; }; -static ssize_t hf_read(struct cdev *cdev, void *buf, size_t count, loff_t offset, ulong flags) +static ssize_t hf_read(struct hf_priv *priv, void *buf, size_t count, loff_t offset, ulong flags) { - struct hf_priv *priv= cdev->priv; int fd = priv->fd; if (linux_lseek(fd, offset) != offset) @@ -43,9 +47,8 @@ static ssize_t hf_read(struct cdev *cdev, void *buf, size_t count, loff_t offset return linux_read(fd, buf, count); } -static ssize_t hf_write(struct cdev *cdev, const void *buf, size_t count, loff_t offset, ulong flags) +static ssize_t hf_write(struct hf_priv *priv, const void *buf, size_t count, loff_t offset, ulong flags) { - struct hf_priv *priv = cdev->priv; int fd = priv->fd; if (linux_lseek(fd, offset) != offset) @@ -54,6 +57,40 @@ static ssize_t hf_write(struct cdev *cdev, const void *buf, size_t count, loff_t return linux_write(fd, buf, count); } +static ssize_t hf_cdev_read(struct cdev *cdev, void *buf, size_t count, loff_t offset, ulong flags) +{ + return hf_read(cdev->priv, buf, count, offset, flags); +} + +static ssize_t hf_cdev_write(struct cdev *cdev, const void *buf, size_t count, loff_t offset, ulong flags) +{ + return hf_write(cdev->priv, buf, count, offset, flags); +} + +static struct cdev_operations hf_cdev_ops = { + .read = hf_cdev_read, + .write = hf_cdev_write, +}; + +static int hf_blk_read(struct block_device *blk, void *buf, int block, int num_blocks) +{ + ssize_t ret = hf_read(container_of(blk, struct hf_priv, blk), buf, + num_blocks << SECTOR_SHIFT, block << SECTOR_SHIFT, 0); + return ret > 0 ? 0 : ret; +} + +static int hf_blk_write(struct block_device *blk, const void *buf, int block, int num_blocks) +{ + ssize_t ret = hf_write(container_of(blk, struct hf_priv, blk), buf, + num_blocks << SECTOR_SHIFT, block << SECTOR_SHIFT, 0); + return ret > 0 ? 0 : ret; +} + +static struct block_device_ops hf_blk_ops = { + .read = hf_blk_read, + .write = hf_blk_write, +}; + static void hf_info(struct device_d *dev) { struct hf_priv *priv = dev->priv; @@ -61,29 +98,28 @@ static void hf_info(struct device_d *dev) printf("file: %s\n", priv->filename); } -static struct cdev_operations hf_fops = { - .read = hf_read, - .write = hf_write, -}; - 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; int err; res = dev_get_resource(dev, IORESOURCE_MEM, 0); if (IS_ERR(res)) return PTR_ERR(res); - priv->cdev.size = resource_size(res); + size = resource_size(res); - if (!dev->device_node) + if (!np) return -ENODEV; - of_property_read_u32(dev->device_node, "barebox,fd", &priv->fd); + of_property_read_u32(np, "barebox,fd", &priv->fd); - err = of_property_read_string(dev->device_node, "barebox,filename", + err = of_property_read_string(np, "barebox,filename", &priv->filename); if (err) return err; @@ -91,20 +127,50 @@ static int hf_probe(struct device_d *dev) if (!priv->fd) priv->fd = linux_open(priv->filename, true); - priv->cdev.name = dev->device_node->name; - priv->cdev.dev = dev; - priv->cdev.ops = &hf_fops; - priv->cdev.priv = priv; + if (priv->fd < 0) + return priv->fd; dev->info = hf_info; dev->priv = priv; - err = devfs_create(&priv->cdev); - if (err) - return err; + is_blockdev = of_property_read_bool(np, "barebox,blockdev"); + + cdev = is_blockdev ? &priv->blk.cdev : &priv->cdev; + + cdev->device_node = np; + + if (is_blockdev) { + cdev->name = np->name; + priv->blk.dev = dev; + priv->blk.ops = &hf_blk_ops; + priv->blk.blockbits = SECTOR_SHIFT; + priv->blk.num_blocks = size / SECTOR_SIZE; - of_parse_partitions(&priv->cdev, dev->device_node); - of_partitions_register_fixup(&priv->cdev); + err = blockdevice_register(&priv->blk); + if (err) + return err; + + err = parse_partition_table(&priv->blk); + if (err) + dev_warn(dev, "No partition table found\n"); + + dev_info(dev, "registered as block device\n"); + } else { + cdev->name = np->name; + cdev->dev = dev; + cdev->ops = &hf_cdev_ops; + cdev->size = size; + cdev->priv = priv; + + err = devfs_create(cdev); + if (err) + return err; + + dev_info(dev, "registered as character device\n"); + } + + of_parse_partitions(cdev, np); + of_partitions_register_fixup(cdev); return 0; } @@ -122,7 +188,7 @@ static struct driver_d hf_drv = { .of_compatible = DRV_OF_COMPAT(hostfile_dt_ids), .probe = hf_probe, }; -coredevice_platform_driver(hf_drv); +device_platform_driver(hf_drv); static int of_hostfile_fixup(struct device_node *root, void *ctx) { @@ -131,6 +197,7 @@ static int of_hostfile_fixup(struct device_node *root, void *ctx) uint32_t reg[] = { hf->base >> 32, hf->base, + hf->size >> 32, hf->size }; int ret; @@ -151,6 +218,9 @@ static int of_hostfile_fixup(struct device_node *root, void *ctx) ret = of_property_write_string(node, "barebox,filename", hf->filename); + if (hf->is_blockdev) + ret = of_property_write_bool(node, "barebox,blockdev", true); + return ret; } diff --git a/arch/sandbox/board/poweroff.c b/arch/sandbox/board/poweroff.c index 6b5a6dff15..8ce739af72 100644 --- a/arch/sandbox/board/poweroff.c +++ b/arch/sandbox/board/poweroff.c @@ -1,6 +1,7 @@ #include <common.h> #include <init.h> #include <poweroff.h> +#include <restart.h> #include <mach/linux.h> static void sandbox_poweroff(struct poweroff_handler *poweroff) @@ -8,9 +9,33 @@ static void sandbox_poweroff(struct poweroff_handler *poweroff) linux_exit(); } +static void sandbox_rst_hang(struct restart_handler *rst) +{ + linux_hang(); +} + +static struct restart_handler rst_hang = { + .name = "hang", + .restart = sandbox_rst_hang +}; + +static void sandbox_rst_reexec(struct restart_handler *rst) +{ + linux_reexec(); +} + +static struct restart_handler rst_reexec = { + .name = "reexec", .priority = 200, + .restart = sandbox_rst_reexec, +}; + static int poweroff_register_feature(void) { poweroff_handler_register_fn(sandbox_poweroff); + restart_handler_register(&rst_hang); + + if (IS_ENABLED(CONFIG_SANDBOX_REEXEC)) + restart_handler_register(&rst_reexec); return 0; } diff --git a/arch/sandbox/configs/hosttools_defconfig b/arch/sandbox/configs/hosttools_defconfig new file mode 100644 index 0000000000..72ec0fc462 --- /dev/null +++ b/arch/sandbox/configs/hosttools_defconfig @@ -0,0 +1,7 @@ +CONFIG_IMD=y +CONFIG_COMPILE_HOST_TOOLS=y +CONFIG_ARCH_IMX_USBLOADER=y +CONFIG_MVEBU_HOSTTOOLS=y +CONFIG_MXS_HOSTTOOLS=y +CONFIG_OMAP3_USB_LOADER=y +CONFIG_OMAP4_HOSTTOOL_USBBOOT=y diff --git a/arch/sandbox/dts/Makefile b/arch/sandbox/dts/Makefile index 6f68388578..6f4344da68 100644 --- a/arch/sandbox/dts/Makefile +++ b/arch/sandbox/dts/Makefile @@ -1,11 +1,8 @@ -ifeq ($(CONFIG_OFTREE),y) -dtb-y += \ +always-$(CONFIG_OFTREE) += \ sandbox.dtb -endif # just to build a built-in.o. Otherwise compilation fails when no devicetree is # created. obj- += dummy.o -always := $(dtb-y) clean-files := *.dtb *.dtb.S .*.dtc .*.pre .*.dts diff --git a/arch/sandbox/dts/sandbox-state-example.dtsi b/arch/sandbox/dts/sandbox-state-example.dtsi index fc17bd0788..98640f6677 100644 --- a/arch/sandbox/dts/sandbox-state-example.dtsi +++ b/arch/sandbox/dts/sandbox-state-example.dtsi @@ -6,7 +6,7 @@ disk { compatible = "barebox,hostfile"; barebox,filename = "disk"; - reg = <0x0 0x0 0x100000>; + reg = <0x0 0x0 0x0 0x100000>; partitions { compatible = "fixed-partitions"; diff --git a/arch/sandbox/dts/skeleton.dtsi b/arch/sandbox/dts/skeleton.dtsi index 38ead821bb..8ba7663eb5 100644 --- a/arch/sandbox/dts/skeleton.dtsi +++ b/arch/sandbox/dts/skeleton.dtsi @@ -6,8 +6,8 @@ / { #address-cells = <2>; - #size-cells = <1>; + #size-cells = <2>; chosen { }; aliases { }; - memory { device_type = "memory"; reg = <0 0 0>; }; + memory { device_type = "memory"; reg = <0 0 0 0>; }; }; diff --git a/arch/sandbox/lib/unwind.c b/arch/sandbox/lib/unwind.c index 15a2798cc4..f46365ac2b 100644 --- a/arch/sandbox/lib/unwind.c +++ b/arch/sandbox/lib/unwind.c @@ -7,5 +7,5 @@ void __sanitizer_print_stack_trace(void); void dump_stack(void) { - __sanitizer_print_stack_trace(); + __sanitizer_print_stack_trace(); } diff --git a/arch/sandbox/mach-sandbox/include/mach/hostfile.h b/arch/sandbox/mach-sandbox/include/mach/hostfile.h index 54f690be5f..c3f9af97c4 100644 --- a/arch/sandbox/mach-sandbox/include/mach/hostfile.h +++ b/arch/sandbox/mach-sandbox/include/mach/hostfile.h @@ -4,9 +4,10 @@ struct hf_info { int fd; unsigned long long base; - size_t size; + unsigned long long size; const char *devname; const char *filename; + unsigned int is_blockdev:1; }; int barebox_register_filedev(struct hf_info *hf); diff --git a/arch/sandbox/mach-sandbox/include/mach/linux.h b/arch/sandbox/mach-sandbox/include/mach/linux.h index 9759a376ec..1ab48e52a0 100644 --- a/arch/sandbox/mach-sandbox/include/mach/linux.h +++ b/arch/sandbox/mach-sandbox/include/mach/linux.h @@ -17,6 +17,8 @@ ssize_t linux_write(int fd, const void *buf, size_t count); off_t linux_lseek(int fildes, off_t offset); int linux_tstc(int fd); void __attribute__((noreturn)) linux_exit(void); +void linux_hang(void); +void linux_reexec(void); int linux_execve(const char * filename, char *const argv[], char *const envp[]); diff --git a/arch/sandbox/os/Makefile b/arch/sandbox/os/Makefile index b2bd768bcb..15d688bfdd 100644 --- a/arch/sandbox/os/Makefile +++ b/arch/sandbox/os/Makefile @@ -8,10 +8,6 @@ KBUILD_CPPFLAGS += -DCONFIG_MALLOC_SIZE=$(CONFIG_MALLOC_SIZE) KBUILD_CFLAGS := -Wall -ifeq ($(CONFIG_KASAN),y) -KBUILD_CPPFLAGS += -DCONFIG_KASAN=1 -endif - NOSTDINC_FLAGS := ifeq ($(CONFIG_SANDBOX_LINUX_I386),y) diff --git a/arch/sandbox/os/common.c b/arch/sandbox/os/common.c index 69fadb3b47..43ee95edb6 100644 --- a/arch/sandbox/os/common.c +++ b/arch/sandbox/os/common.c @@ -44,6 +44,8 @@ #include <mach/linux.h> #include <mach/hostfile.h> +#define DELETED_OFFSET (sizeof(" (deleted)") - 1) + void __sanitizer_set_death_callback(void (*callback)(void)); int sdl_xres; @@ -122,9 +124,40 @@ void __attribute__((noreturn)) linux_exit(void) exit(0); } +static char **saved_argv; + +void linux_reexec(void) +{ + char buf[4097]; + ssize_t ret; + + cookmode(); + + /* we must follow the symlink, so we can exec an updated executable */ + ret = readlink("/proc/self/exe", buf, sizeof(buf) - 1); + if (0 < ret && ret < sizeof(buf) - 1) { + buf[ret] = '\0'; + execv(buf, saved_argv); + if (!strcmp(&buf[ret - DELETED_OFFSET], " (deleted)")) { + printf("barebox image on disk changed. Loading new.\n"); + buf[ret - DELETED_OFFSET] = '\0'; + execv(buf, saved_argv); + } + } + + printf("exec(%s) failed: %d\n", buf, errno); + /* falls through to generic hang() */ +} + +void linux_hang(void) +{ + cookmode(); + /* falls through to generic hang() */ +} + int linux_open(const char *filename, int readwrite) { - return open(filename, readwrite ? O_RDWR : O_RDONLY); + return open(filename, (readwrite ? O_RDWR : O_RDONLY) | O_CLOEXEC); } int linux_read(int fd, void *buf, size_t count) @@ -212,12 +245,14 @@ int linux_execve(const char * filename, char *const argv[], char *const envp[]) extern void start_barebox(void); extern void mem_malloc_init(void *start, void *end); -static int add_image(char *str, char *devname_template, int *devname_number) +extern char * strsep_unescaped(char **s, const char *ct); + +static int add_image(const char *_str, char *devname_template, int *devname_number) { struct hf_info *hf = malloc(sizeof(struct hf_info)); - char *filename, *devname; + char *str, *filename, *devname; char tmp[16]; - int readonly = 0; + int readonly = 0, cdev = 0, blkdev = 0; struct stat s; char *opt; int fd, ret; @@ -225,15 +260,21 @@ static int add_image(char *str, char *devname_template, int *devname_number) if (!hf) return -1; - filename = strtok(str, ","); - while ((opt = strtok(NULL, ","))) { + str = strdup(_str); + + filename = strsep_unescaped(&str, ","); + while ((opt = strsep_unescaped(&str, ","))) { if (!strcmp(opt, "ro")) readonly = 1; + if (!strcmp(opt, "cdev")) + cdev = 1; + if (!strcmp(opt, "blkdev")) + blkdev = 1; } /* parses: "devname=filename" */ - devname = strtok(filename, "="); - filename = strtok(NULL, "="); + devname = strsep_unescaped(&filename, "="); + filename = strsep_unescaped(&filename, "="); if (!filename) { filename = devname; snprintf(tmp, sizeof(tmp), @@ -244,9 +285,10 @@ static int add_image(char *str, char *devname_template, int *devname_number) printf("add %s backed by file %s%s\n", devname, filename, readonly ? "(ro)" : ""); - fd = open(filename, readonly ? O_RDONLY : O_RDWR); + fd = open(filename, (readonly ? O_RDONLY : O_RDWR) | O_CLOEXEC); hf->fd = fd; hf->filename = filename; + hf->is_blockdev = blkdev; if (fd < 0) { perror("open"); @@ -266,13 +308,25 @@ static int add_image(char *str, char *devname_template, int *devname_number) perror("ioctl"); goto err_out; } + if (!cdev) + hf->is_blockdev = 1; } - hf->base = (unsigned long)mmap(NULL, hf->size, - PROT_READ | (readonly ? 0 : PROT_WRITE), - MAP_SHARED, fd, 0); + if (hf->size <= SIZE_MAX) + hf->base = (unsigned long)mmap(NULL, hf->size, + PROT_READ | (readonly ? 0 : PROT_WRITE), + MAP_SHARED, fd, 0); + else + printf("warning: %s: contiguous map failed\n", filename); + if (hf->base == (unsigned long)MAP_FAILED) printf("warning: mmapping %s failed: %s\n", filename, strerror(errno)); + if (blkdev && hf->size % 512 != 0) { + printf("warning: registering %s as block device failed: invalid block size\n", + filename); + return -EINVAL; + } + ret = barebox_register_filedev(hf); if (ret) goto err_out; @@ -291,7 +345,7 @@ static int add_dtb(const char *file) void *dtb = NULL; int fd; - fd = open(file, O_RDONLY); + fd = open(file, O_RDONLY | O_CLOEXEC); if (fd < 0) { perror("open"); goto err_out; @@ -347,10 +401,12 @@ int main(int argc, char *argv[]) int fdno = 0, envno = 0, option_index = 0; char *aux; -#ifdef CONFIG_KASAN +#ifdef CONFIG_ASAN __sanitizer_set_death_callback(cookmode); #endif + saved_argv = argv; + while (1) { option_index = 0; opt = getopt_long(argc, argv, optstring, @@ -422,7 +478,7 @@ int main(int argc, char *argv[]) exit(1); break; case 'O': - fd = open(optarg, O_WRONLY); + fd = open(optarg, O_WRONLY | O_CLOEXEC); if (fd < 0) { perror("open"); exit(1); @@ -431,7 +487,7 @@ int main(int argc, char *argv[]) barebox_register_console(-1, fd); break; case 'I': - fd = open(optarg, O_RDWR); + fd = open(optarg, O_RDWR | O_CLOEXEC); if (fd < 0) { perror("open"); exit(1); @@ -447,7 +503,7 @@ int main(int argc, char *argv[]) } /* open stdout file */ - fd = open(aux + 1, O_WRONLY); + fd = open(aux + 1, O_WRONLY | O_CLOEXEC); if (fd < 0) { perror("open stdout"); exit(1); @@ -455,7 +511,7 @@ int main(int argc, char *argv[]) /* open stdin file */ aux = strndup(optarg, aux - optarg); - fd2 = open(aux, O_RDWR); + fd2 = open(aux, O_RDWR | O_CLOEXEC); if (fd2 < 0) { perror("open stdin"); exit(1); diff --git a/arch/sandbox/os/tap.c b/arch/sandbox/os/tap.c index 72b7fbb5ac..83b97ffd49 100644 --- a/arch/sandbox/os/tap.c +++ b/arch/sandbox/os/tap.c @@ -30,7 +30,7 @@ int tap_alloc(const char *dev) struct ifreq ifr; int fd, err; - if ((fd = open("/dev/net/tun", O_RDWR)) < 0) { + if ((fd = open("/dev/net/tun", O_RDWR | O_CLOEXEC)) < 0) { perror("could not open /dev/net/tun"); return -1; } diff --git a/arch/x86/bios/bios_disk.S b/arch/x86/bios/bios_disk.S index cce33e67af..c2a824ed6e 100644 --- a/arch/x86/bios/bios_disk.S +++ b/arch/x86/bios/bios_disk.S @@ -1,21 +1,8 @@ -/* - * Copyright (C) 2009 Juergen Beisert, Pengutronix - * - * Mostly stolen from the GRUB2 project - * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. - * - * 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 */ +/* SPDX-FileCopyrightText: 1999-2008 Free Software Foundation, Inc. */ + +/* Mostly stolen from the GRUB2 project */ /** * @file diff --git a/arch/x86/bios/memory16.S b/arch/x86/bios/memory16.S index 76ee72b56c..e4aef2f256 100644 --- a/arch/x86/bios/memory16.S +++ b/arch/x86/bios/memory16.S @@ -1,20 +1,7 @@ -/* - * Copyright (C) 2009 Juergen Beisert, Pengutronix - * - * This code was inspired by the GRUB2 project. - * - * 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 */ + +/* This code was inspired by the GRUB2 project. */ /** * @file diff --git a/arch/x86/bios/traveler.S b/arch/x86/bios/traveler.S index 113b19802e..1c11c9dc74 100644 --- a/arch/x86/bios/traveler.S +++ b/arch/x86/bios/traveler.S @@ -1,20 +1,7 @@ -/* - * Copyright (C) 2009 Juergen Beisert, Pengutronix - * - * Mostly stolen from the GRUB2 project - * - * 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 */ + +/* Mostly stolen from the GRUB2 project */ /** * @file diff --git a/arch/x86/boards/x86_generic/disk_bios_drive.c b/arch/x86/boards/x86_generic/disk_bios_drive.c index f33f48c3fb..c8e9ae8523 100644 --- a/arch/x86/boards/x86_generic/disk_bios_drive.c +++ b/arch/x86/boards/x86_generic/disk_bios_drive.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/arch/x86/boards/x86_generic/envsector.h b/arch/x86/boards/x86_generic/envsector.h index 86511c8af7..57a6d2a21f 100644 --- a/arch/x86/boards/x86_generic/envsector.h +++ b/arch/x86/boards/x86_generic/envsector.h @@ -1,16 +1,4 @@ -/* - * 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 */ /** * @file diff --git a/arch/x86/boards/x86_generic/generic_pc.c b/arch/x86/boards/x86_generic/generic_pc.c index 482889f2d9..2f1db7aca1 100644 --- a/arch/x86/boards/x86_generic/generic_pc.c +++ b/arch/x86/boards/x86_generic/generic_pc.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 #include <common.h> #include <types.h> diff --git a/arch/x86/boards/x86_generic/intf_platform_ide.c b/arch/x86/boards/x86_generic/intf_platform_ide.c index 528e721d56..0db031484f 100644 --- a/arch/x86/boards/x86_generic/intf_platform_ide.c +++ b/arch/x86/boards/x86_generic/intf_platform_ide.c @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2014 Juergen Beisert, Pengutronix, Michel Stam, - * Fugro Intersite - * - * 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 Juergen Beisert, Pengutronix +// SPDX-FileCopyrightText: 2014 Michel Stam, Fugro Intersite /** * @file diff --git a/arch/x86/boards/x86_generic/serial_ns16550.c b/arch/x86/boards/x86_generic/serial_ns16550.c index abc1047a50..4159bc39fb 100644 --- a/arch/x86/boards/x86_generic/serial_ns16550.c +++ b/arch/x86/boards/x86_generic/serial_ns16550.c @@ -1,19 +1,6 @@ -/* - * Copyright (C) 2009 Juergen Beisert, Pengutronix, Michel Stam, - * Fugro Intersite - * - * 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 +// SPDX-FileCopyrightText: 2009 Michel Stam, Fugro Intersite /** * @file diff --git a/arch/x86/boot/a20.c b/arch/x86/boot/a20.c index ddb40ee5c2..f501feeedd 100644 --- a/arch/x86/boot/a20.c +++ b/arch/x86/boot/a20.c @@ -1,13 +1,9 @@ -/* -*- linux-c -*- ------------------------------------------------------- * - * - * Copyright (C) 1991, 1992 Linus Torvalds - * Copyright 2007-2008 rPath, Inc. - All Rights Reserved - * Copyright 2009 Intel Corporation; author H. Peter Anvin - * - * This file is part of the Linux kernel, and is made available under - * the terms of the GNU General Public License version 2. - * - * ----------------------------------------------------------------------- */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: 1991,1992 Linus Torvalds +// SPDX-FileCopyrightText: 2007-2008 rPath, Inc. +// SPDX-FileCopyrightText: 2009 Intel Corporation + +/* Author: H. Peter Anvin and others */ /* * Enable A20 gate (return -1 on failure) diff --git a/arch/x86/boot/bioscall.S b/arch/x86/boot/bioscall.S index e60072992b..6cda1eb40a 100644 --- a/arch/x86/boot/bioscall.S +++ b/arch/x86/boot/bioscall.S @@ -1,12 +1,7 @@ -/* ----------------------------------------------------------------------- - * - * Copyright 2009 Intel Corporation; author H. Peter Anvin - * - * This file is part of the Linux kernel, and is made available under - * the terms of the GNU General Public License version 2 or (at your - * option) any later version; incorporated herein by reference. - * - * ----------------------------------------------------------------------- */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* SPDX-FileCopyrightText: 2009 Intel Corporation */ + +/* Author: H. Peter Anvin */ /* * "Glove box" for BIOS calls. Avoids the constant problems with BIOSes diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h index d98b0661cd..54483c46c6 100644 --- a/arch/x86/boot/boot.h +++ b/arch/x86/boot/boot.h @@ -1,13 +1,9 @@ -/* -*- linux-c -*- ------------------------------------------------------- * - * - * Copyright (C) 1991, 1992 Linus Torvalds - * Copyright 2007 rPath, Inc. - All Rights Reserved - * Copyright 2009 Intel Corporation; author H. Peter Anvin - * - * This file is part of the Linux kernel, and is made available under - * the terms of the GNU General Public License version 2. - * - * ----------------------------------------------------------------------- */ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* SPDX-FileCopyrightText: 1991,1992 Linus Torvalds */ +/* SPDX-FileCopyrightText: 2007 rPath, Inc. */ +/* SPDX-FileCopyrightText: 2009 Intel Corporation */ + +/* Author: H. Peter Anvin and others */ /** * @file diff --git a/arch/x86/boot/boot_main.S b/arch/x86/boot/boot_main.S index a952c8d279..632b3f4ffa 100644 --- a/arch/x86/boot/boot_main.S +++ b/arch/x86/boot/boot_main.S @@ -1,20 +1,7 @@ -/* - * Copyright (C) 2009 Juergen Beisert, Pengutronix - * - * This code was inspired by the GRUB2 project. - * - * 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: Juergen Beisert, Pengutronix */ + +/* This code was inspired by the GRUB2 project. */ /** * @file diff --git a/arch/x86/boot/main_entry.c b/arch/x86/boot/main_entry.c index afb7e32dfc..b37aa38fca 100644 --- a/arch/x86/boot/main_entry.c +++ b/arch/x86/boot/main_entry.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/arch/x86/boot/pmjump.S b/arch/x86/boot/pmjump.S index 09bfc6ea86..4dd1881e65 100644 --- a/arch/x86/boot/pmjump.S +++ b/arch/x86/boot/pmjump.S @@ -1,12 +1,6 @@ -/* ----------------------------------------------------------------------- * - * - * Copyright (C) 1991, 1992 Linus Torvalds - * Copyright 2007 rPath, Inc. - All Rights Reserved - * - * This file is part of the Linux kernel, and is made available under - * the terms of the GNU General Public License version 2. - * - * ----------------------------------------------------------------------- */ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* SPDX-FileCopyrightText: 1991,1992 Linus Torvalds */ +/* SPDX-FileCopyrightText: 2007 rPath, Inc. */ /** * @file diff --git a/arch/x86/boot/prepare_uboot.c b/arch/x86/boot/prepare_uboot.c index 79e6fb0cbe..9cac594a46 100644 --- a/arch/x86/boot/prepare_uboot.c +++ b/arch/x86/boot/prepare_uboot.c @@ -1,12 +1,6 @@ -/* -*- linux-c -*- ------------------------------------------------------- * - * - * Copyright (C) 1991, 1992 Linus Torvalds - * Copyright 2007 rPath, Inc. - All Rights Reserved - * - * This file is part of the Linux kernel, and is made available under - * the terms of the GNU General Public License version 2. - * - * ----------------------------------------------------------------------- */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: 1991,1992 Linus Torvalds +// SPDX-FileCopyrightText: 2007 rPath, Inc. /* * Prepare the machine for transition to protected mode. diff --git a/arch/x86/boot/regs.c b/arch/x86/boot/regs.c index ddc515518c..318b662175 100644 --- a/arch/x86/boot/regs.c +++ b/arch/x86/boot/regs.c @@ -1,12 +1,7 @@ -/* ----------------------------------------------------------------------- - * - * Copyright 2009 Intel Corporation; author H. Peter Anvin - * - * This file is part of the Linux kernel, and is made available under - * the terms of the GNU General Public License version 2 or (at your - * option) any later version; incorporated herein by reference. - * - * ----------------------------------------------------------------------- */ +// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-FileCopyrightText: 2009 Intel Corporation + +/* Author: H. Peter Anvin */ /** * @file diff --git a/arch/x86/boot/tty.c b/arch/x86/boot/tty.c index a81671be3b..620197c677 100644 --- a/arch/x86/boot/tty.c +++ b/arch/x86/boot/tty.c @@ -1,13 +1,9 @@ -/* -*- linux-c -*- ------------------------------------------------------- * - * - * Copyright (C) 1991, 1992 Linus Torvalds - * Copyright 2007 rPath, Inc. - All Rights Reserved - * Copyright 2009 Intel Corporation; author H. Peter Anvin - * - * This file is part of the Linux kernel, and is made available under - * the terms of the GNU General Public License version 2. - * - * ----------------------------------------------------------------------- */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: 1991,1992 Linus Torvalds +// SPDX-FileCopyrightText: 2007 rPath, Inc. +// SPDX-FileCopyrightText: 2009 Intel Corporation + +/* Author: H. Peter Anvin and others */ /** * @file diff --git a/arch/x86/configs/efi_defconfig b/arch/x86/configs/efi_defconfig index 47842d10af..83794d7a07 100644 --- a/arch/x86/configs/efi_defconfig +++ b/arch/x86/configs/efi_defconfig @@ -14,7 +14,6 @@ CONFIG_BLSPEC=y CONFIG_CONSOLE_ACTIVATE_ALL=y CONFIG_PARTITION_DISK_EFI=y CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y -CONFIG_POLLER=y CONFIG_STATE=y CONFIG_DEBUG_LL=y CONFIG_LONGHELP=y @@ -66,7 +65,6 @@ CONFIG_NET=y CONFIG_NET_NFS=y CONFIG_NET_NETCONSOLE=y CONFIG_DRIVER_SERIAL_EFI_STDIO=y -CONFIG_DRIVER_SERIAL_NS16550=y CONFIG_DRIVER_NET_EFI_SNP=y # CONFIG_SPI is not set CONFIG_DISK=y diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h index e77ab83202..e2bdf98e95 100644 --- a/arch/x86/include/asm/bitops.h +++ b/arch/x86/include/asm/bitops.h @@ -1,16 +1,4 @@ -/* - * 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 */ #ifndef _ASM_BITOPS_H_ #define _ASM_BITOPS_H_ diff --git a/arch/x86/include/asm/byteorder.h b/arch/x86/include/asm/byteorder.h index 3cfd850568..878b7eaa3c 100644 --- a/arch/x86/include/asm/byteorder.h +++ b/arch/x86/include/asm/byteorder.h @@ -1,16 +1,4 @@ -/* - * 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 */ /** * @file diff --git a/arch/x86/include/asm/common.h b/arch/x86/include/asm/common.h index 174363b58b..1376b76ffe 100644 --- a/arch/x86/include/asm/common.h +++ b/arch/x86/include/asm/common.h @@ -1,16 +1,4 @@ -/* - * 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 */ /** * @file diff --git a/arch/x86/include/asm/dma.h b/arch/x86/include/asm/dma.h index 27d269f491..3dab2b688d 100644 --- a/arch/x86/include/asm/dma.h +++ b/arch/x86/include/asm/dma.h @@ -1,9 +1,5 @@ -/* - * Copyright (C) 2012 by Marc Kleine-Budde <mkl@pengutronix.de> - * - * This file is released under the GPLv2 - * - */ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* SPDX-FileCopyrightText: 2012 Marc Kleine-Budde <mkl@pengutronix.de> */ #ifndef __ASM_DMA_H #define __ASM_DMA_H diff --git a/arch/x86/include/asm/modes.h b/arch/x86/include/asm/modes.h index bd454c7c95..b33df85892 100644 --- a/arch/x86/include/asm/modes.h +++ b/arch/x86/include/asm/modes.h @@ -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/arch/x86/include/asm/module.h b/arch/x86/include/asm/module.h index 05fbb81d2b..3fd2ce27f4 100644 --- a/arch/x86/include/asm/module.h +++ b/arch/x86/include/asm/module.h @@ -1,16 +1,4 @@ -/* - * 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 */ /** * @file diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h index 88d908a2fc..9e1d897b03 100644 --- a/arch/x86/include/asm/segment.h +++ b/arch/x86/include/asm/segment.h @@ -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 */ #ifndef _ASM_X86_SEGMENT_H #define _ASM_X86_SEGMENT_H diff --git a/arch/x86/include/asm/string.h b/arch/x86/include/asm/string.h index 5994b51d70..f72d8a3d1d 100644 --- a/arch/x86/include/asm/string.h +++ b/arch/x86/include/asm/string.h @@ -1,16 +1,4 @@ -/* - * 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 */ /** * @file diff --git a/arch/x86/include/asm/syslib.h b/arch/x86/include/asm/syslib.h index 14e373a5af..7e08cfd44e 100644 --- a/arch/x86/include/asm/syslib.h +++ b/arch/x86/include/asm/syslib.h @@ -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 */ #ifdef CONFIG_X86_BIOS_BRINGUP diff --git a/arch/x86/lib/barebox.lds.S b/arch/x86/lib/barebox.lds.S index bf52ba9a18..b24c4807b5 100644 --- a/arch/x86/lib/barebox.lds.S +++ b/arch/x86/lib/barebox.lds.S @@ -1,16 +1,4 @@ -/* - * 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 */ #undef i386 #include <asm-generic/barebox.lds.h> diff --git a/arch/x86/lib/gdt.c b/arch/x86/lib/gdt.c index 447e81942e..4cd1622b6b 100644 --- a/arch/x86/lib/gdt.c +++ b/arch/x86/lib/gdt.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/arch/x86/lib/linux_start.S b/arch/x86/lib/linux_start.S index b9489b8e50..07be37fed4 100644 --- a/arch/x86/lib/linux_start.S +++ b/arch/x86/lib/linux_start.S @@ -1,21 +1,8 @@ -/* - * Copyright (C) 2009 Juergen Beisert, Pengutronix - * - * Mostly stolen from the GRUB2 project - * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. - * - * 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 */ +/* SPDX-FileCopyrightText: 1999-2008 Free Software Foundation, Inc. */ + +/* Mostly stolen from the GRUB2 project */ /** * @file diff --git a/arch/x86/lib/memory.c b/arch/x86/lib/memory.c index de0e5d907f..64fbbb9300 100644 --- a/arch/x86/lib/memory.c +++ b/arch/x86/lib/memory.c @@ -1,20 +1,7 @@ -/* - * Copyright (C) 2009 Juergen Beisert, Pengutronix - * - * This code was inspired by the GRUB2 project. - * - * 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 + +/* This code was inspired by the GRUB2 project. */ /** * @file diff --git a/arch/x86/mach-i386/include/mach/barebox.lds.h b/arch/x86/mach-i386/include/mach/barebox.lds.h index f6f6346398..50f17340e4 100644 --- a/arch/x86/mach-i386/include/mach/barebox.lds.h +++ b/arch/x86/mach-i386/include/mach/barebox.lds.h @@ -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/arch/x86/mach-i386/pit_timer.c b/arch/x86/mach-i386/pit_timer.c index 857ba3136c..d2da3b60d4 100644 --- a/arch/x86/mach-i386/pit_timer.c +++ b/arch/x86/mach-i386/pit_timer.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 |