diff options
83 files changed, 361 insertions, 165 deletions
@@ -308,6 +308,8 @@ config ARCH_FIXUP_FDT_MEMORY endmenu # Boot images +source "api/Kconfig" + source "common/Kconfig" source "cmd/Kconfig" @@ -325,3 +327,5 @@ source "fs/Kconfig" source "lib/Kconfig" source "test/Kconfig" + +source "scripts/Kconfig" @@ -482,6 +482,13 @@ else # Build targets only - this includes vmlinux, arch specific targets, clean # targets and others. In general all targets except *config targets. +# Additional helpers built in scripts/ +# Carefully list dependencies so we do not try to build scripts twice +# in parallel +PHONY += scripts +scripts: scripts_basic include/config/auto.conf + $(Q)$(MAKE) $(build)=$(@) + ifeq ($(dot-config),1) # Read in config -include include/config/auto.conf @@ -829,6 +836,10 @@ cmd_pad_cat = $(cmd_objcopy) && $(append) || rm -f $@ cfg: u-boot.cfg +quiet_cmd_cfgcheck = CFGCHK $2 +cmd_cfgcheck = $(srctree)/scripts/check-config.sh $2 \ + $(srctree)/scripts/config_whitelist.txt $(srctree) + all: $(ALL-y) ifeq ($(CONFIG_DM_I2C_COMPAT)$(CONFIG_SANDBOX),y) @echo "===================== WARNING ======================" @@ -840,8 +851,7 @@ endif @# Check that this build does not use CONFIG options that we do not @# know about unless they are in Kconfig. All the existing CONFIG @# options are whitelisted, so new ones should not be added. - $(srctree)/scripts/check-config.sh u-boot.cfg \ - $(srctree)/scripts/config_whitelist.txt ${srctree} 1>&2 + $(call cmd,cfgcheck,u-boot.cfg) PHONY += dtbs dtbs: dts/dt.dtb @@ -1418,7 +1428,7 @@ CLEAN_DIRS += $(MODVERDIR) \ $(foreach d, spl tpl, $(patsubst %,$d/%, \ $(filter-out include, $(shell ls -1 $d 2>/dev/null)))) -CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h include/license.h \ +CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h \ boot* u-boot* MLO* SPL System.map # Directories & files removed with 'make mrproper' @@ -1539,11 +1549,6 @@ tests: $(Q)$(MAKE) $(build)=scripts build_docproc $(Q)$(MAKE) $(build)=doc/DocBook $@ -# Dummies... -PHONY += prepare scripts -prepare: ; -scripts: ; - endif #ifeq ($(config-targets),1) endif #ifeq ($(mixed-targets),1) @@ -1771,12 +1771,6 @@ The following options need to be configured: can be displayed via the splashscreen support or the bmp command. -- Do compressing for memory range: - CONFIG_CMD_ZIP - - If this option is set, it would use zlib deflate method - to compress the specified memory at its best effort. - - Compression support: CONFIG_GZIP diff --git a/api/Kconfig b/api/Kconfig new file mode 100644 index 0000000000..16731d3b4b --- /dev/null +++ b/api/Kconfig @@ -0,0 +1,9 @@ +menu "API" + +config API + bool "Enable U-Boot API" + default n + help + This option enables the U-Boot API. See api/README for more information. + +endmenu diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 397a0aec0b..2d75f64269 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -320,10 +320,10 @@ dtb-$(CONFIG_MX6) += imx6ull-14x14-evk.dtb \ dtb-$(CONFIG_MX7) += imx7-colibri.dtb -dtb-$(CONFIG_SOC_KEYSTONE) += k2hk-evm.dtb \ - k2l-evm.dtb \ - k2e-evm.dtb \ - k2g-evm.dtb +dtb-$(CONFIG_SOC_KEYSTONE) += keystone-k2hk-evm.dtb \ + keystone-k2l-evm.dtb \ + keystone-k2e-evm.dtb \ + keystone-k2g-evm.dtb dtb-$(CONFIG_TARGET_SAMA5D2_XPLAINED) += \ at91-sama5d2_xplained.dtb diff --git a/arch/arm/dts/k2e-clocks.dtsi b/arch/arm/dts/keystone-k2e-clocks.dtsi index d56d68fe7f..d56d68fe7f 100644 --- a/arch/arm/dts/k2e-clocks.dtsi +++ b/arch/arm/dts/keystone-k2e-clocks.dtsi diff --git a/arch/arm/dts/k2e-evm.dts b/arch/arm/dts/keystone-k2e-evm.dts index e2c3fb4910..3be8b53252 100644 --- a/arch/arm/dts/k2e-evm.dts +++ b/arch/arm/dts/keystone-k2e-evm.dts @@ -10,7 +10,7 @@ /dts-v1/; #include "keystone.dtsi" -#include "k2e.dtsi" +#include "keystone-k2e.dtsi" / { compatible = "ti,k2e-evm","ti,keystone"; diff --git a/arch/arm/dts/k2e-netcp.dtsi b/arch/arm/dts/keystone-k2e-netcp.dtsi index b13b3c94e7..b13b3c94e7 100644 --- a/arch/arm/dts/k2e-netcp.dtsi +++ b/arch/arm/dts/keystone-k2e-netcp.dtsi diff --git a/arch/arm/dts/k2e.dtsi b/arch/arm/dts/keystone-k2e.dtsi index 675fb8e492..b5d906184c 100644 --- a/arch/arm/dts/k2e.dtsi +++ b/arch/arm/dts/keystone-k2e.dtsi @@ -41,7 +41,7 @@ }; soc { - /include/ "k2e-clocks.dtsi" + /include/ "keystone-k2e-clocks.dtsi" usb: usb@2680000 { interrupts = <GIC_SPI 152 IRQ_TYPE_EDGE_RISING>; @@ -142,6 +142,6 @@ clock-names = "fck"; bus_freq = <2500000>; }; - /include/ "k2e-netcp.dtsi" + /include/ "keystone-k2e-netcp.dtsi" }; }; diff --git a/arch/arm/dts/k2g-evm.dts b/arch/arm/dts/keystone-k2g-evm.dts index 61d0d55433..696a0d7459 100644 --- a/arch/arm/dts/k2g-evm.dts +++ b/arch/arm/dts/keystone-k2g-evm.dts @@ -1,7 +1,7 @@ /* * Copyright 2014 Texas Instruments, Inc. * - * Keystone 2 Galileo EVM device tree + * Device Tree Source for K2G EVM * * 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 @@ -9,11 +9,11 @@ */ /dts-v1/; -#include "k2g.dtsi" +#include "keystone-k2g.dtsi" / { compatible = "ti,k2g-evm","ti,keystone"; - model = "Texas Instruments Keystone 2 Galileo EVM"; + model = "Texas Instruments K2G General Purpose EVM"; chosen { stdout-path = &uart0; diff --git a/arch/arm/dts/k2g-netcp.dtsi b/arch/arm/dts/keystone-k2g-netcp.dtsi index 6f0ff863af..a9b26c3b3a 100644 --- a/arch/arm/dts/k2g-netcp.dtsi +++ b/arch/arm/dts/keystone-k2g-netcp.dtsi @@ -1,5 +1,5 @@ /* - * Device Tree Source for Keystone 2 Galileo Netcp driver + * Device Tree Source for K2G Netcp driver * * Copyright 2015 Texas Instruments, Inc. * diff --git a/arch/arm/dts/k2g.dtsi b/arch/arm/dts/keystone-k2g.dtsi index add03b74da..2193f9fa21 100644 --- a/arch/arm/dts/k2g.dtsi +++ b/arch/arm/dts/keystone-k2g.dtsi @@ -1,7 +1,7 @@ /* * Copyright 2014 Texas Instruments, Inc. * - * Keystone 2 Galileo soc device tree + * Device Tree Source for K2G SOC * * 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 @@ -12,7 +12,7 @@ #include "skeleton.dtsi" / { - model = "Texas Instruments Keystone 2 SoC"; + model = "Texas Instruments K2G SoC"; #address-cells = <1>; #size-cells = <1>; interrupt-parent = <&gic>; @@ -98,7 +98,7 @@ status = "disabled"; }; - #include "k2g-netcp.dtsi" + #include "keystone-k2g-netcp.dtsi" pmmc: pmmc@2900000 { compatible = "ti,power-processor"; diff --git a/arch/arm/dts/k2hk-clocks.dtsi b/arch/arm/dts/keystone-k2hk-clocks.dtsi index af9b719053..af9b719053 100644 --- a/arch/arm/dts/k2hk-clocks.dtsi +++ b/arch/arm/dts/keystone-k2hk-clocks.dtsi diff --git a/arch/arm/dts/k2hk-evm.dts b/arch/arm/dts/keystone-k2hk-evm.dts index c5cad2c9da..76a675f1e4 100644 --- a/arch/arm/dts/k2hk-evm.dts +++ b/arch/arm/dts/keystone-k2hk-evm.dts @@ -10,7 +10,7 @@ /dts-v1/; #include "keystone.dtsi" -#include "k2hk.dtsi" +#include "keystone-k2hk.dtsi" / { compatible = "ti,k2hk-evm","ti,keystone"; diff --git a/arch/arm/dts/k2hk-netcp.dtsi b/arch/arm/dts/keystone-k2hk-netcp.dtsi index 77a32c3c17..77a32c3c17 100644 --- a/arch/arm/dts/k2hk-netcp.dtsi +++ b/arch/arm/dts/keystone-k2hk-netcp.dtsi diff --git a/arch/arm/dts/k2hk.dtsi b/arch/arm/dts/keystone-k2hk.dtsi index d0810a5f29..fc78696837 100644 --- a/arch/arm/dts/k2hk.dtsi +++ b/arch/arm/dts/keystone-k2hk.dtsi @@ -41,7 +41,7 @@ }; soc { - /include/ "k2hk-clocks.dtsi" + /include/ "keystone-k2hk-clocks.dtsi" dspgpio0: keystone_dsp_gpio@02620240 { compatible = "ti,keystone-dsp-gpio"; @@ -109,6 +109,6 @@ clock-names = "fck"; bus_freq = <2500000>; }; - /include/ "k2hk-netcp.dtsi" + /include/ "keystone-k2hk-netcp.dtsi" }; }; diff --git a/arch/arm/dts/k2l-clocks.dtsi b/arch/arm/dts/keystone-k2l-clocks.dtsi index ef8464bb11..ef8464bb11 100644 --- a/arch/arm/dts/k2l-clocks.dtsi +++ b/arch/arm/dts/keystone-k2l-clocks.dtsi diff --git a/arch/arm/dts/k2l-evm.dts b/arch/arm/dts/keystone-k2l-evm.dts index da0661ba3e..b5c56176bf 100644 --- a/arch/arm/dts/k2l-evm.dts +++ b/arch/arm/dts/keystone-k2l-evm.dts @@ -10,7 +10,7 @@ /dts-v1/; #include "keystone.dtsi" -#include "k2l.dtsi" +#include "keystone-k2l.dtsi" / { compatible = "ti,k2l-evm","ti,keystone"; diff --git a/arch/arm/dts/k2l-netcp.dtsi b/arch/arm/dts/keystone-k2l-netcp.dtsi index 6b95284d11..6b95284d11 100644 --- a/arch/arm/dts/k2l-netcp.dtsi +++ b/arch/arm/dts/keystone-k2l-netcp.dtsi diff --git a/arch/arm/dts/k2l.dtsi b/arch/arm/dts/keystone-k2l.dtsi index 49fd414f68..d681cab259 100644 --- a/arch/arm/dts/k2l.dtsi +++ b/arch/arm/dts/keystone-k2l.dtsi @@ -29,7 +29,7 @@ }; soc { - /include/ "k2l-clocks.dtsi" + /include/ "keystone-k2l-clocks.dtsi" uart2: serial@02348400 { compatible = "ns16550a"; @@ -89,7 +89,7 @@ clock-names = "fck"; bus_freq = <2500000>; }; - /include/ "k2l-netcp.dtsi" + /include/ "keystone-k2l-netcp.dtsi" }; }; diff --git a/arch/arm/lib/crt0_64.S b/arch/arm/lib/crt0_64.S index 91b19e00da..19c6a985cd 100644 --- a/arch/arm/lib/crt0_64.S +++ b/arch/arm/lib/crt0_64.S @@ -117,10 +117,8 @@ relocation_return: */ ldr x0, =__bss_start /* this is auto-relocated! */ ldr x1, =__bss_end /* this is auto-relocated! */ - mov x2, #0 clear_loop: - str x2, [x0] - add x0, x0, #8 + str xzr, [x0], #8 cmp x0, x1 b.lo clear_loop diff --git a/arch/arm/lib/relocate_64.S b/arch/arm/lib/relocate_64.S index 242e56e960..c760053706 100644 --- a/arch/arm/lib/relocate_64.S +++ b/arch/arm/lib/relocate_64.S @@ -68,7 +68,7 @@ relocate_done: b 0f 1: mrs x0, sctlr_el1 0: tbz w0, #2, 5f /* skip flushing cache if disabled */ - tbz w0, #12, 4f /* invalide i-cache is enabled */ + tbz w0, #12, 4f /* skip invalidating i-cache if disabled */ ic iallu /* i-cache invalidate all */ isb sy 4: ldp x0, x1, [sp, #16] diff --git a/arch/arm/mach-uniphier/Kconfig b/arch/arm/mach-uniphier/Kconfig index cd9ba6ba9e..5739325da7 100644 --- a/arch/arm/mach-uniphier/Kconfig +++ b/arch/arm/mach-uniphier/Kconfig @@ -13,6 +13,7 @@ config ARCH_UNIPHIER_32BIT config ARCH_UNIPHIER_64BIT bool select ARM64 + select CMD_UNZIP select SPL_SEPARATE_BSS if SPL select ARMV8_MULTIENTRY if SPL select ARMV8_SPIN_TABLE if SPL diff --git a/board/phytec/pcm052/pcm052.c b/board/phytec/pcm052/pcm052.c index e75ff4fc3a..54a4e4f9c3 100644 --- a/board/phytec/pcm052/pcm052.c +++ b/board/phytec/pcm052/pcm052.c @@ -258,8 +258,7 @@ int dram_init(void) .wldqsen = 25, }; - ddrmc_ctrl_init_ddr3(&pcm052_ddr_timings, pcm052_cr_settings, - pcm052_phy_settings, 1, 2); + const int row_diff = 2; #elif defined(CONFIG_TARGET_BK4R1) @@ -314,8 +313,7 @@ int dram_init(void) .wldqsen = 25, }; - ddrmc_ctrl_init_ddr3(&pcm052_ddr_timings, pcm052_cr_settings, - pcm052_phy_settings, 1, 1); + const int row_diff = 1; #else /* Unknown PCM052 variant */ @@ -325,6 +323,9 @@ int dram_init(void) imx_iomux_v3_setup_multiple_pads(pcm052_pads, ARRAY_SIZE(pcm052_pads)); + ddrmc_ctrl_init_ddr3(&pcm052_ddr_timings, pcm052_cr_settings, + pcm052_phy_settings, 1, row_diff); + gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE); return 0; diff --git a/cmd/.gitignore b/cmd/.gitignore new file mode 100644 index 0000000000..bab889fd3d --- /dev/null +++ b/cmd/.gitignore @@ -0,0 +1,6 @@ +config_data.gz +config_data_gz.h +config_data_size.h +license_data.gz +license_data_gz.h +license_data_size.h diff --git a/cmd/Kconfig b/cmd/Kconfig index 4a0d489696..ef53156314 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -126,6 +126,18 @@ config CMD_BDI help Print board info +config CMD_CONFIG + bool "config" + select BUILD_BIN2C + default SANDBOX + help + Print ".config" contents. + + If this option is enabled, the ".config" file contents are embedded + in the U-Boot image and can be printed on the console by the "config" + command. This provides information of which options are enabled on + the running U-Boot. + config CMD_CONSOLE bool "coninfo" default y @@ -142,6 +154,7 @@ config CMD_CPU config CMD_LICENSE bool "license" + select BUILD_BIN2C help Print GPL license text @@ -346,6 +359,16 @@ config CMD_MEMINFO help Display memory information. +config CMD_UNZIP + bool "unzip" + help + Uncompress a zip-compressed memory region. + +config CMD_ZIP + bool "zip" + help + Compress a memory region with zlib deflate method. + endmenu menu "Device access commands" diff --git a/cmd/Makefile b/cmd/Makefile index 566fed9f7b..f13bb8c11e 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -31,6 +31,7 @@ obj-$(CONFIG_CMD_BOOTI) += booti.o obj-$(CONFIG_CMD_CACHE) += cache.o obj-$(CONFIG_CMD_CBFS) += cbfs.o obj-$(CONFIG_CMD_CLK) += clk.o +obj-$(CONFIG_CMD_CONFIG) += config.o obj-$(CONFIG_CMD_CONSOLE) += console.o obj-$(CONFIG_CMD_CPLBINFO) += cplbinfo.o obj-$(CONFIG_CMD_CPU) += cpu.o @@ -165,3 +166,39 @@ obj-$(CONFIG_CMD_BLOB) += blob.o obj-y += nvedit.o obj-$(CONFIG_ARCH_MVEBU) += mvebu/ + +filechk_data_gz = (echo "static const char data_gz[] ="; cat $< | scripts/bin2c; echo ";") + +filechk_data_size = \ + (echo "static const size_t data_size = "; \ + cat $< | wc -c; echo ";") + +# "config" command +$(obj)/config.o: $(obj)/config_data_gz.h $(obj)/config_data_size.h + +targets += config_data.gz +$(obj)/config_data.gz: $(KCONFIG_CONFIG) FORCE + $(call if_changed,gzip) + +targets += config_data_gz.h +$(obj)/config_data_gz.h: $(obj)/config_data.gz FORCE + $(call filechk,data_gz) + +targets += config_data_size.h +$(obj)/config_data_size.h: $(KCONFIG_CONFIG) FORCE + $(call filechk,data_size) + +# "license" command +$(obj)/license.o: $(obj)/license_data_gz.h $(obj)/license_data_size.h + +targets += license_data.gz +$(obj)/license_data.gz: $(srctree)/Licenses/gpl-2.0.txt FORCE + $(call if_changed,gzip) + +targets += license_data_gz.h +$(obj)/license_data_gz.h: $(obj)/license_data.gz FORCE + $(call filechk,data_gz) + +targets += license_data_size.h +$(obj)/license_data_size.h: $(srctree)/Licenses/gpl-2.0.txt FORCE + $(call filechk,data_size) diff --git a/cmd/bootm.c b/cmd/bootm.c index a7e181d22c..953a57de33 100644 --- a/cmd/bootm.c +++ b/cmd/bootm.c @@ -390,7 +390,7 @@ static int nand_imls_legacyimage(struct mtd_info *mtd, int nand_dev, return -ENOMEM; } - ret = nand_read_skip_bad(mtd, off, &len, imgdata); + ret = nand_read_skip_bad(mtd, off, &len, NULL, mtd->size, imgdata); if (ret < 0 && ret != -EUCLEAN) { free(imgdata); return ret; @@ -430,7 +430,7 @@ static int nand_imls_fitimage(struct mtd_info *mtd, int nand_dev, loff_t off, return -ENOMEM; } - ret = nand_read_skip_bad(mtd, off, &len, imgdata); + ret = nand_read_skip_bad(mtd, off, &len, NULL, mtd->size, imgdata); if (ret < 0 && ret != -EUCLEAN) { free(imgdata); return ret; diff --git a/cmd/config.c b/cmd/config.c new file mode 100644 index 0000000000..0c7f4e06cd --- /dev/null +++ b/cmd/config.c @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2017 Masahiro Yamada <yamada.masahiro@socionext.com> + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <command.h> +#include <malloc.h> + +#include "config_data_gz.h" +#include "config_data_size.h" + +static int do_config(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + char *dst; + unsigned long len = data_size; + int ret = CMD_RET_SUCCESS; + + dst = malloc(data_size + 1); + if (!dst) + return CMD_RET_FAILURE; + + ret = gunzip(dst, data_size, (unsigned char *)data_gz, &len); + if (ret) { + printf("failed to uncompress .config data\n"); + ret = CMD_RET_FAILURE; + goto free; + } + + dst[data_size] = 0; + puts(dst); + +free: + free(dst); + + return ret; +} + +U_BOOT_CMD( + config, 1, 1, do_config, + "print .config", + "" +); diff --git a/cmd/license.c b/cmd/license.c index 5ee57f8ca3..29fc8aa9a4 100644 --- a/cmd/license.c +++ b/cmd/license.c @@ -6,31 +6,36 @@ */ #include <common.h> - -/* Licenses/gpl-2.0.txt is currently 18092 bytes in size */ -#define LICENSE_MAX 20480 - #include <command.h> #include <malloc.h> -#include <license.h> -int do_license(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +#include "license_data_gz.h" +#include "license_data_size.h" + +static int do_license(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { - char *dst = malloc(LICENSE_MAX); - unsigned long len = LICENSE_MAX; + char *dst; + unsigned long len = data_size; + int ret = CMD_RET_SUCCESS; + dst = malloc(data_size + 1); if (!dst) - return -1; + return CMD_RET_FAILURE; - if (gunzip(dst, LICENSE_MAX, license_gzip, &len) != 0) { + ret = gunzip(dst, data_size, (unsigned char *)data_gz, &len); + if (ret) { printf("Error uncompressing license text\n"); - free(dst); - return -1; + ret = CMD_RET_FAILURE; + goto free; } + + dst[data_size] = 0; puts(dst); + +free: free(dst); - return 0; + return ret; } U_BOOT_CMD( diff --git a/common/env_sf.c b/common/env_sf.c index c53200f5c6..27b4d1226a 100644 --- a/common/env_sf.c +++ b/common/env_sf.c @@ -19,16 +19,16 @@ #include <dm/device-internal.h> #ifndef CONFIG_ENV_SPI_BUS -# define CONFIG_ENV_SPI_BUS 0 +# define CONFIG_ENV_SPI_BUS CONFIG_SF_DEFAULT_BUS #endif #ifndef CONFIG_ENV_SPI_CS -# define CONFIG_ENV_SPI_CS 0 +# define CONFIG_ENV_SPI_CS CONFIG_SF_DEFAULT_CS #endif #ifndef CONFIG_ENV_SPI_MAX_HZ -# define CONFIG_ENV_SPI_MAX_HZ 1000000 +# define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED #endif #ifndef CONFIG_ENV_SPI_MODE -# define CONFIG_ENV_SPI_MODE SPI_MODE_3 +# define CONFIG_ENV_SPI_MODE CONFIG_SF_DEFAULT_MODE #endif #ifdef CONFIG_ENV_OFFSET_REDUND diff --git a/configs/PMC440_defconfig b/configs/PMC440_defconfig index 0bcc5866af..7380ba7b21 100644 --- a/configs/PMC440_defconfig +++ b/configs/PMC440_defconfig @@ -24,3 +24,4 @@ CONFIG_SYS_NS16550=y CONFIG_USB=y CONFIG_USB_STORAGE=y CONFIG_OF_LIBFDT=y +CONFIG_API=y diff --git a/configs/brxre1_defconfig b/configs/brxre1_defconfig index 0b7b082644..dfa8712c2c 100644 --- a/configs/brxre1_defconfig +++ b/configs/brxre1_defconfig @@ -31,6 +31,7 @@ CONFIG_CMD_BOOTZ=y # CONFIG_CMD_XIMG is not set # CONFIG_CMD_EDITENV is not set # CONFIG_CMD_CRC32 is not set +CONFIG_CMD_UNZIP=y # CONFIG_CMD_LOADB is not set # CONFIG_CMD_LOADS is not set # CONFIG_CMD_FLASH is not set diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig index 8f206e2384..e94f7b39da 100644 --- a/configs/dragonboard410c_defconfig +++ b/configs/dragonboard410c_defconfig @@ -9,6 +9,7 @@ CONFIG_SYS_PROMPT="dragonboard410c => " # CONFIG_CMD_IMI is not set # CONFIG_CMD_IMLS is not set CONFIG_CMD_MEMINFO=y +CONFIG_CMD_UNZIP=y CONFIG_CMD_GPT=y CONFIG_CMD_MMC=y CONFIG_CMD_USB=y diff --git a/configs/ethernut5_defconfig b/configs/ethernut5_defconfig index c831aab2a9..4d1b4b0d15 100644 --- a/configs/ethernut5_defconfig +++ b/configs/ethernut5_defconfig @@ -8,6 +8,7 @@ CONFIG_HUSH_PARSER=y CONFIG_SYS_PROMPT="U-Boot> " # CONFIG_CMD_BDI is not set CONFIG_CMD_ASKENV=y +CONFIG_CMD_UNZIP=y # CONFIG_CMD_LOADS is not set CONFIG_CMD_MMC=y CONFIG_CMD_SF=y diff --git a/configs/hikey_defconfig b/configs/hikey_defconfig index 8dd330ad75..b112be2ef5 100644 --- a/configs/hikey_defconfig +++ b/configs/hikey_defconfig @@ -7,6 +7,7 @@ CONFIG_DISTRO_DEFAULTS=y # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_BOARD_EARLY_INIT_F=y # CONFIG_CMD_IMLS is not set +CONFIG_CMD_UNZIP=y CONFIG_CMD_MMC=y CONFIG_CMD_USB=y CONFIG_CMD_GPIO=y diff --git a/configs/icnova-a20-swac_defconfig b/configs/icnova-a20-swac_defconfig index 567eb9b592..5ef0e47b4e 100644 --- a/configs/icnova-a20-swac_defconfig +++ b/configs/icnova-a20-swac_defconfig @@ -13,9 +13,10 @@ CONFIG_VIDEO_LCD_POWER="PH22" CONFIG_VIDEO_LCD_PANEL_LVDS=y CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-icnova-swac" # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set -CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER,SUNXI_GMAC,CMD_BMP,CMD_UNZIP" +CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER,SUNXI_GMAC,CMD_BMP" CONFIG_SPL=y # CONFIG_CMD_IMLS is not set +CONFIG_CMD_UNZIP=y # CONFIG_CMD_FLASH is not set # CONFIG_CMD_FPGA is not set # CONFIG_SPL_DOS_PARTITION is not set diff --git a/configs/k2e_evm_defconfig b/configs/k2e_evm_defconfig index 8f0d3fa22b..a42a485e2b 100644 --- a/configs/k2e_evm_defconfig +++ b/configs/k2e_evm_defconfig @@ -8,7 +8,7 @@ CONFIG_SPL_POWER_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI_SUPPORT=y -CONFIG_DEFAULT_DEVICE_TREE="k2e-evm" +CONFIG_DEFAULT_DEVICE_TREE="keystone-k2e-evm" CONFIG_OF_BOARD_SETUP=y CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_VERSION_VARIABLE=y diff --git a/configs/k2g_evm_defconfig b/configs/k2g_evm_defconfig index 17a5e67045..f3ee01afb1 100644 --- a/configs/k2g_evm_defconfig +++ b/configs/k2g_evm_defconfig @@ -8,7 +8,7 @@ CONFIG_SPL_POWER_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI_SUPPORT=y -CONFIG_DEFAULT_DEVICE_TREE="k2g-evm" +CONFIG_DEFAULT_DEVICE_TREE="keystone-k2g-evm" CONFIG_OF_BOARD_SETUP=y CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_VERSION_VARIABLE=y diff --git a/configs/k2hk_evm_defconfig b/configs/k2hk_evm_defconfig index 6791d56335..d924796627 100644 --- a/configs/k2hk_evm_defconfig +++ b/configs/k2hk_evm_defconfig @@ -8,7 +8,7 @@ CONFIG_SPL_POWER_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI_SUPPORT=y -CONFIG_DEFAULT_DEVICE_TREE="k2hk-evm" +CONFIG_DEFAULT_DEVICE_TREE="keystone-k2hk-evm" CONFIG_OF_BOARD_SETUP=y CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_VERSION_VARIABLE=y diff --git a/configs/k2l_evm_defconfig b/configs/k2l_evm_defconfig index 4a70e1ad39..c81758571c 100644 --- a/configs/k2l_evm_defconfig +++ b/configs/k2l_evm_defconfig @@ -8,7 +8,7 @@ CONFIG_SPL_POWER_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI_SUPPORT=y -CONFIG_DEFAULT_DEVICE_TREE="k2l-evm" +CONFIG_DEFAULT_DEVICE_TREE="keystone-k2l-evm" CONFIG_OF_BOARD_SETUP=y CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_VERSION_VARIABLE=y diff --git a/configs/lsxhl_defconfig b/configs/lsxhl_defconfig index 75bd46da2f..4d974f1e16 100644 --- a/configs/lsxhl_defconfig +++ b/configs/lsxhl_defconfig @@ -23,3 +23,4 @@ CONFIG_SYS_NS16550=y CONFIG_USB=y CONFIG_USB_STORAGE=y CONFIG_OF_LIBFDT=y +CONFIG_API=y diff --git a/configs/vexpress_aemv8a_dram_defconfig b/configs/vexpress_aemv8a_dram_defconfig index c899be0635..db492af140 100644 --- a/configs/vexpress_aemv8a_dram_defconfig +++ b/configs/vexpress_aemv8a_dram_defconfig @@ -14,6 +14,7 @@ CONFIG_SYS_PROMPT="VExpress64# " # CONFIG_CMD_EDITENV is not set # CONFIG_CMD_ENV_EXISTS is not set CONFIG_CMD_MEMTEST=y +CONFIG_CMD_UNZIP=y # CONFIG_CMD_LOADS is not set CONFIG_CMD_ARMFLASH=y # CONFIG_CMD_FPGA is not set diff --git a/configs/vexpress_aemv8a_juno_defconfig b/configs/vexpress_aemv8a_juno_defconfig index 22673624cc..537301c1c4 100644 --- a/configs/vexpress_aemv8a_juno_defconfig +++ b/configs/vexpress_aemv8a_juno_defconfig @@ -14,6 +14,7 @@ CONFIG_SYS_PROMPT="VExpress64# " # CONFIG_CMD_EDITENV is not set # CONFIG_CMD_ENV_EXISTS is not set CONFIG_CMD_MEMTEST=y +CONFIG_CMD_UNZIP=y # CONFIG_CMD_LOADS is not set CONFIG_CMD_ARMFLASH=y # CONFIG_CMD_FPGA is not set diff --git a/configs/vexpress_aemv8a_semi_defconfig b/configs/vexpress_aemv8a_semi_defconfig index 02740a4441..2720a71b70 100644 --- a/configs/vexpress_aemv8a_semi_defconfig +++ b/configs/vexpress_aemv8a_semi_defconfig @@ -14,6 +14,7 @@ CONFIG_SYS_PROMPT="VExpress64# " # CONFIG_CMD_EDITENV is not set # CONFIG_CMD_ENV_EXISTS is not set CONFIG_CMD_MEMTEST=y +CONFIG_CMD_UNZIP=y # CONFIG_CMD_LOADS is not set CONFIG_CMD_ARMFLASH=y # CONFIG_CMD_FPGA is not set diff --git a/configs/xilinx_zynqmp_ep_defconfig b/configs/xilinx_zynqmp_ep_defconfig index 49c0786d95..6b568b451f 100644 --- a/configs/xilinx_zynqmp_ep_defconfig +++ b/configs/xilinx_zynqmp_ep_defconfig @@ -21,6 +21,7 @@ CONFIG_SYS_PROMPT="ZynqMP> " # CONFIG_CMD_XIMG is not set # CONFIG_CMD_EDITENV is not set # CONFIG_CMD_ENV_EXISTS is not set +CONFIG_CMD_UNZIP=y # CONFIG_CMD_LOADB is not set # CONFIG_CMD_LOADS is not set CONFIG_CMD_GPT=y diff --git a/configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig b/configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig index a3585d0711..4d7bcf3bd5 100644 --- a/configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig +++ b/configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig @@ -19,6 +19,7 @@ CONFIG_SPL_OS_BOOT=y CONFIG_SYS_PROMPT="ZynqMP> " # CONFIG_CMD_IMLS is not set CONFIG_CMD_MEMTEST=y +CONFIG_CMD_UNZIP=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_GPT=y CONFIG_CMD_MMC=y diff --git a/configs/xilinx_zynqmp_zc1751_xm016_dc2_defconfig b/configs/xilinx_zynqmp_zc1751_xm016_dc2_defconfig index 3693d9b2a4..822b25d553 100644 --- a/configs/xilinx_zynqmp_zc1751_xm016_dc2_defconfig +++ b/configs/xilinx_zynqmp_zc1751_xm016_dc2_defconfig @@ -21,6 +21,7 @@ CONFIG_SPL_OS_BOOT=y CONFIG_SYS_PROMPT="ZynqMP> " # CONFIG_CMD_IMLS is not set CONFIG_CMD_MEMTEST=y +CONFIG_CMD_UNZIP=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_GPT=y CONFIG_CMD_NAND=y diff --git a/configs/xilinx_zynqmp_zc1751_xm018_dc4_defconfig b/configs/xilinx_zynqmp_zc1751_xm018_dc4_defconfig index a4c73f8355..89813df4a0 100644 --- a/configs/xilinx_zynqmp_zc1751_xm018_dc4_defconfig +++ b/configs/xilinx_zynqmp_zc1751_xm018_dc4_defconfig @@ -16,6 +16,7 @@ CONFIG_SPL_OS_BOOT=y CONFIG_SYS_PROMPT="ZynqMP> " # CONFIG_CMD_IMLS is not set CONFIG_CMD_MEMTEST=y +CONFIG_CMD_UNZIP=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_MMC=y CONFIG_CMD_I2C=y diff --git a/configs/xilinx_zynqmp_zc1751_xm019_dc5_defconfig b/configs/xilinx_zynqmp_zc1751_xm019_dc5_defconfig index f981b21678..b8fe33e479 100644 --- a/configs/xilinx_zynqmp_zc1751_xm019_dc5_defconfig +++ b/configs/xilinx_zynqmp_zc1751_xm019_dc5_defconfig @@ -17,6 +17,7 @@ CONFIG_SPL_OS_BOOT=y CONFIG_SYS_PROMPT="ZynqMP> " # CONFIG_CMD_IMLS is not set CONFIG_CMD_MEMTEST=y +CONFIG_CMD_UNZIP=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_MMC=y CONFIG_CMD_I2C=y diff --git a/configs/xilinx_zynqmp_zcu102_defconfig b/configs/xilinx_zynqmp_zcu102_defconfig index 7b65fe0917..b13bf5b845 100644 --- a/configs/xilinx_zynqmp_zcu102_defconfig +++ b/configs/xilinx_zynqmp_zcu102_defconfig @@ -19,6 +19,7 @@ CONFIG_SPL_OS_BOOT=y CONFIG_SYS_PROMPT="ZynqMP> " # CONFIG_CMD_IMLS is not set CONFIG_CMD_MEMTEST=y +CONFIG_CMD_UNZIP=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_GPT=y CONFIG_CMD_MMC=y diff --git a/configs/xilinx_zynqmp_zcu102_revB_defconfig b/configs/xilinx_zynqmp_zcu102_revB_defconfig index 4bed5890f1..2489d8966b 100644 --- a/configs/xilinx_zynqmp_zcu102_revB_defconfig +++ b/configs/xilinx_zynqmp_zcu102_revB_defconfig @@ -19,6 +19,7 @@ CONFIG_SPL_OS_BOOT=y CONFIG_SYS_PROMPT="ZynqMP> " # CONFIG_CMD_IMLS is not set CONFIG_CMD_MEMTEST=y +CONFIG_CMD_UNZIP=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_GPT=y CONFIG_CMD_MMC=y diff --git a/disk/part_efi.c b/disk/part_efi.c index b5928e5abe..893cbbdbda 100644 --- a/disk/part_efi.c +++ b/disk/part_efi.c @@ -324,6 +324,13 @@ static int set_protective_mbr(struct blk_desc *dev_desc) printf("%s: calloc failed!\n", __func__); return -1; } + + /* Read MBR to backup boot code if it exists */ + if (blk_dread(dev_desc, 0, 1, p_mbr) != 1) { + error("** Can't read from device %d **\n", dev_desc->devnum); + return -1; + } + /* Append signature */ p_mbr->signature = MSDOS_MBR_SIGNATURE; p_mbr->partition_record[0].sys_ind = EFI_PMBR_OSTYPE_EFI_GPT; diff --git a/drivers/clk/aspeed/clk_ast2500.c b/drivers/clk/aspeed/clk_ast2500.c index af369cc4c8..26a5e58221 100644 --- a/drivers/clk/aspeed/clk_ast2500.c +++ b/drivers/clk/aspeed/clk_ast2500.c @@ -35,7 +35,7 @@ static ulong ast2500_get_mpll_rate(ulong clkin, u32 mpll_reg) const ulong post_div = (mpll_reg >> SCU_MPLL_POST_SHIFT) & SCU_MPLL_POST_MASK; - return (clkin * ((num + 1) / (denum + 1))) / post_div; + return (clkin * ((num + 1) / (denum + 1))) / (post_div + 1); } /* @@ -50,7 +50,7 @@ static ulong ast2500_get_hpll_rate(ulong clkin, u32 hpll_reg) const ulong post_div = (hpll_reg >> SCU_HPLL_POST_SHIFT) & SCU_HPLL_POST_MASK; - return (clkin * ((num + 1) / (denum + 1))) / post_div; + return (clkin * ((num + 1) / (denum + 1))) / (post_div + 1); } static ulong ast2500_get_clkin(struct ast2500_scu *scu) diff --git a/drivers/gpio/db8500_gpio.c b/drivers/gpio/db8500_gpio.c index db32db6845..eefb56d83f 100644 --- a/drivers/gpio/db8500_gpio.c +++ b/drivers/gpio/db8500_gpio.c @@ -174,7 +174,7 @@ void db8500_gpio_set_output(unsigned gpio, int val) /** * config_pin - configure a pin's mux attributes - * @cfg: pin confguration + * @cfg: pin configuration * * Configures a pin's mode (alternate function or GPIO), its pull up status, * and its sleep mode based on the specified configuration. The @cfg is diff --git a/drivers/net/cpsw-common.c b/drivers/net/cpsw-common.c index aa52503986..55f56d9555 100644 --- a/drivers/net/cpsw-common.c +++ b/drivers/net/cpsw-common.c @@ -110,7 +110,7 @@ int ti_cm_get_macid(struct udevice *dev, int slave, u8 *mac_addr) if (of_device_is_compatible(dev, "ti,dm816-emac")) return cpsw_am33xx_cm_get_macid(dev, 0x30, slave, mac_addr); - if (of_machine_is_compatible("ti,am4372")) + if (of_machine_is_compatible("ti,am43")) return cpsw_am33xx_cm_get_macid(dev, 0x630, slave, mac_addr); if (of_machine_is_compatible("ti,dra7")) diff --git a/drivers/power/regulator/palmas_regulator.c b/drivers/power/regulator/palmas_regulator.c index cce7cd2fc2..399f7a5f55 100644 --- a/drivers/power/regulator/palmas_regulator.c +++ b/drivers/power/regulator/palmas_regulator.c @@ -356,7 +356,7 @@ static int palmas_smps_probe(struct udevice *dev) case 8: case 9: case 10: - idx = dev->driver_data - 4; + idx = dev->driver_data - 3; uc_pdata->ctrl_reg = palmas_smps_ctrl[type][idx]; uc_pdata->volt_reg = palmas_smps_volt[type][idx]; break; diff --git a/drivers/pwm/Makefile b/drivers/pwm/Makefile index af39347aac..b037130385 100644 --- a/drivers/pwm/Makefile +++ b/drivers/pwm/Makefile @@ -10,10 +10,9 @@ #ccflags-y += -DDEBUG -obj-$(CONFIG_DM_PWM) += pwm-uclass.o -obj-$(CONFIG_PWM_ROCKCHIP) += rk_pwm.o -obj-$(CONFIG_PWM_IMX) += pwm-imx.o pwm-imx-util.o -ifdef CONFIG_DM_PWM -obj-$(CONFIG_PWM_TEGRA) += tegra_pwm.o -obj-$(CONFIG_PWM_EXYNOS) += exynos_pwm.o -endif +obj-$(CONFIG_DM_PWM) += pwm-uclass.o + +obj-$(CONFIG_PWM_EXYNOS) += exynos_pwm.o +obj-$(CONFIG_PWM_IMX) += pwm-imx.o pwm-imx-util.o +obj-$(CONFIG_PWM_ROCKCHIP) += rk_pwm.o +obj-$(CONFIG_PWM_TEGRA) += tegra_pwm.o diff --git a/include/.gitignore b/include/.gitignore index 75be5270b1..8e41a9511d 100644 --- a/include/.gitignore +++ b/include/.gitignore @@ -2,4 +2,3 @@ /bmp_logo.h /bmp_logo_data.h /config.h -/license.h diff --git a/include/config_cmd_all.h b/include/config_cmd_all.h index a0d4e94a04..a8befe38e8 100644 --- a/include/config_cmd_all.h +++ b/include/config_cmd_all.h @@ -49,7 +49,6 @@ #define CONFIG_CMD_TERMINAL /* built-in Serial Terminal */ #define CONFIG_CMD_UBIFS /* UBIFS Support */ #define CONFIG_CMD_UNIVERSE /* Tundra Universe Support */ -#define CONFIG_CMD_UNZIP /* unzip from memory to memory */ #define CONFIG_CMD_ZFS /* ZFS Support */ #endif /* _CONFIG_CMD_ALL_H */ diff --git a/include/configs/PMC440.h b/include/configs/PMC440.h index 5ea82f8e4d..59ba79e43b 100644 --- a/include/configs/PMC440.h +++ b/include/configs/PMC440.h @@ -385,6 +385,4 @@ #define CONFIG_KGDB_BAUDRATE 230400 /* speed to run kgdb serial port */ #endif -#define CONFIG_API 1 - #endif /* __CONFIG_H */ diff --git a/include/configs/am3517_crane.h b/include/configs/am3517_crane.h index 5d568604a6..f1b82df456 100644 --- a/include/configs/am3517_crane.h +++ b/include/configs/am3517_crane.h @@ -88,8 +88,6 @@ #ifdef CONFIG_USB_MUSB_HCD -#define CONGIG_CMD_STORAGE - #ifdef CONFIG_USB_KEYBOARD #define CONFIG_SYS_USB_EVENT_POLL #define CONFIG_PREBOOT "usb start" diff --git a/include/configs/am3517_evm.h b/include/configs/am3517_evm.h index 13de819245..1062e20f6d 100644 --- a/include/configs/am3517_evm.h +++ b/include/configs/am3517_evm.h @@ -88,8 +88,6 @@ #ifdef CONFIG_USB_MUSB_HOST -#define CONGIG_CMD_STORAGE - #ifdef CONFIG_USB_KEYBOARD #define CONFIG_SYS_USB_EVENT_POLL #define CONFIG_PREBOOT "usb start" diff --git a/include/configs/brxre1.h b/include/configs/brxre1.h index 02094b58af..82ee7c62e0 100644 --- a/include/configs/brxre1.h +++ b/include/configs/brxre1.h @@ -22,7 +22,6 @@ #define CONFIG_VIDEO_BMP_GZIP #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (1366*767*4) -#define CONFIG_CMD_UNZIP #define CONFIG_CMD_BMP #define CONFIG_BMP_24BMP #define CONFIG_BMP_32BPP diff --git a/include/configs/dragonboard410c.h b/include/configs/dragonboard410c.h index da1c58983a..9b7f43f134 100644 --- a/include/configs/dragonboard410c.h +++ b/include/configs/dragonboard410c.h @@ -57,7 +57,6 @@ /*#define CONFIG_SUPPORT_EMMC_BOOT */ #define CONFIG_CMD_REGINFO /* Register dump */ #define CONFIG_CMD_TFTP -#define CONFIG_CMD_UNZIP /* Partition table support */ #define HAVE_BLOCK_DEVICE /* Needed for partition commands */ diff --git a/include/configs/ethernut5.h b/include/configs/ethernut5.h index a3c40d68aa..55d65ef7e8 100644 --- a/include/configs/ethernut5.h +++ b/include/configs/ethernut5.h @@ -95,7 +95,6 @@ #define CONFIG_CMD_REISER #define CONFIG_CMD_SAVES #define CONFIG_CMD_UBIFS -#define CONFIG_CMD_UNZIP #endif /* NAND flash */ diff --git a/include/configs/hikey.h b/include/configs/hikey.h index 9ec81402b4..899d62de26 100644 --- a/include/configs/hikey.h +++ b/include/configs/hikey.h @@ -74,7 +74,6 @@ #define CONFIG_FS_EXT4 /* Command line configuration */ -#define CONFIG_CMD_UNZIP #define CONFIG_CMD_ENV #define CONFIG_MTD_PARTITIONS diff --git a/include/configs/lsxl.h b/include/configs/lsxl.h index 7ec82cd4bb..ad1adcec8c 100644 --- a/include/configs/lsxl.h +++ b/include/configs/lsxl.h @@ -38,11 +38,6 @@ #define CONFIG_SYS_NO_FLASH /* - * Enable u-boot API for standalone programs. - */ -#define CONFIG_API - -/* * Commands configuration */ #define CONFIG_CMD_ENV diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h index 8846aa6607..8ed5602bc9 100644 --- a/include/configs/omap3_evm.h +++ b/include/configs/omap3_evm.h @@ -217,8 +217,6 @@ #ifdef CONFIG_USB_MUSB_HCD -#define CONGIG_CMD_STORAGE - #ifdef CONFIG_USB_KEYBOARD #define CONFIG_SYS_USB_EVENT_POLL #define CONFIG_PREBOOT "usb start" diff --git a/include/configs/tao3530.h b/include/configs/tao3530.h index dafb05fa07..32a4b27870 100644 --- a/include/configs/tao3530.h +++ b/include/configs/tao3530.h @@ -263,7 +263,6 @@ #define CONFIG_USB_ETHER #define CONFIG_USB_ETHER_RNDIS -#define CONGIG_CMD_STORAGE /* Defines for SPL */ #define CONFIG_SPL_FRAMEWORK diff --git a/include/configs/ti_armv7_keystone2.h b/include/configs/ti_armv7_keystone2.h index d120c691e0..5d4ef58e5f 100644 --- a/include/configs/ti_armv7_keystone2.h +++ b/include/configs/ti_armv7_keystone2.h @@ -47,11 +47,11 @@ #define CONFIG_SYS_SPL_MALLOC_START (CONFIG_SPL_BSS_START_ADDR + \ CONFIG_SPL_BSS_MAX_SIZE) #define CONFIG_SYS_SPL_MALLOC_SIZE (32 * 1024) -#define CONFIG_SPL_STACK_SIZE (8 * 1024) +#define KEYSTONE_SPL_STACK_SIZE (8 * 1024) #define CONFIG_SPL_STACK (CONFIG_SYS_SPL_MALLOC_START + \ CONFIG_SYS_SPL_MALLOC_SIZE + \ SPL_MALLOC_F_SIZE + \ - CONFIG_SPL_STACK_SIZE - 4) + KEYSTONE_SPL_STACK_SIZE - 4) #define CONFIG_SPL_SPI_LOAD #define CONFIG_SYS_SPI_U_BOOT_OFFS CONFIG_SPL_PAD_TO diff --git a/include/configs/uniphier.h b/include/configs/uniphier.h index 22962392e2..b453d8fba8 100644 --- a/include/configs/uniphier.h +++ b/include/configs/uniphier.h @@ -15,10 +15,6 @@ #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10 -#ifdef CONFIG_ARM64 -#define CONFIG_CMD_UNZIP -#endif - /*----------------------------------------------------------------------- * MMU and Cache Setting *----------------------------------------------------------------------*/ diff --git a/include/configs/vexpress_aemv8a.h b/include/configs/vexpress_aemv8a.h index 3a4bfe8133..35ac60ac26 100644 --- a/include/configs/vexpress_aemv8a.h +++ b/include/configs/vexpress_aemv8a.h @@ -126,7 +126,6 @@ #endif /*#define CONFIG_MENU_SHOW*/ -#define CONFIG_CMD_UNZIP #define CONFIG_CMD_ENV /* BOOTP options */ diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index 4759373e51..73830b212b 100644 --- a/include/configs/xilinx_zynqmp.h +++ b/include/configs/xilinx_zynqmp.h @@ -207,8 +207,6 @@ #define CONFIG_SYS_BOOTM_LEN (60 * 1024 * 1024) -#define CONFIG_CMD_UNZIP - #define CONFIG_BOARD_EARLY_INIT_R #define CONFIG_CLOCKS diff --git a/scripts/.gitignore b/scripts/.gitignore index 82bc06ef98..17b903b0f5 100644 --- a/scripts/.gitignore +++ b/scripts/.gitignore @@ -1,4 +1,5 @@ # # Generated files # +bin2c docproc diff --git a/scripts/Kconfig b/scripts/Kconfig new file mode 100644 index 0000000000..2a2c18e96e --- /dev/null +++ b/scripts/Kconfig @@ -0,0 +1,2 @@ +config BUILD_BIN2C + bool diff --git a/scripts/Makefile b/scripts/Makefile index 2f081f7104..3e10c16d59 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -7,6 +7,10 @@ # SPDX-License-Identifier: GPL-2.0 # +hostprogs-$(CONFIG_BUILD_BIN2C) += bin2c + +always := $(hostprogs-y) + # The following hostprogs-y programs are only build on demand hostprogs-y += docproc diff --git a/scripts/bin2c.c b/scripts/bin2c.c new file mode 100644 index 0000000000..c3d7eef3ad --- /dev/null +++ b/scripts/bin2c.c @@ -0,0 +1,36 @@ +/* + * Unloved program to convert a binary on stdin to a C include on stdout + * + * Jan 1999 Matt Mackall <mpm@selenic.com> + * + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. + */ + +#include <stdio.h> + +int main(int argc, char *argv[]) +{ + int ch, total = 0; + + if (argc > 1) + printf("const char %s[] %s=\n", + argv[1], argc > 2 ? argv[2] : ""); + + do { + printf("\t\""); + while ((ch = getchar()) != EOF) { + total++; + printf("\\x%02x", ch); + if (total % 16 == 0) + break; + } + printf("\"\n"); + } while (ch != EOF); + + if (argc > 1) + printf("\t;\n\n#include <linux/types.h>\n\nconst size_t %s_size = %d;\n", + argv[1], total); + + return 0; +} diff --git a/scripts/check-config.sh b/scripts/check-config.sh index 6618dfb679..97e52dce83 100755 --- a/scripts/check-config.sh +++ b/scripts/check-config.sh @@ -37,12 +37,12 @@ cat `find ${srctree} -name "Kconfig*"` |sed -n \ -e 's/^menuconfig \([A-Za-z0-9_]*\).*$/CONFIG_\1/p' |sort |uniq > ${ok} comm -23 ${suspects} ${ok} >${new_adhoc} if [ -s ${new_adhoc} ]; then - echo "Error: You must add new CONFIG options using Kconfig" - echo "The following new ad-hoc CONFIG options were detected:" - cat ${new_adhoc} - echo - echo "Please add these via Kconfig instead. Find a suitable Kconfig" - echo "file and add a 'config' or 'menuconfig' option." + echo >&2 "Error: You must add new CONFIG options using Kconfig" + echo >&2 "The following new ad-hoc CONFIG options were detected:" + cat >&2 ${new_adhoc} + echo >&2 + echo >&2 "Please add these via Kconfig instead. Find a suitable Kconfig" + echo >&2 "file and add a 'config' or 'menuconfig' option." # Don't delete the temporary files in case they are useful exit 1 else diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 84f57566fd..3afc870f0f 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -7,9 +7,12 @@ use strict; use POSIX; +use File::Basename; +use Cwd 'abs_path'; my $P = $0; $P =~ s@.*/@@g; +my $D = dirname(abs_path($P)); my $V = '0.32'; @@ -42,6 +45,9 @@ my $configuration_file = ".checkpatch.conf"; my $max_line_length = 80; my $ignore_perl_version = 0; my $minimum_perl_version = 5.10.0; +my $spelling_file = "$D/spelling.txt"; +my $codespell = 0; +my $codespellfile = "/usr/share/codespell/dictionary.txt"; sub help { my ($exitcode) = @_; @@ -82,6 +88,9 @@ Options: file. It's your fault if there's no backup or git --ignore-perl-version override checking of perl version. expect runtime errors. + --codespell Use the codespell dictionary for spelling/typos + (default:/usr/local/share/codespell/dictionary.txt) + --codespellfile Use this codespell dictionary -h, --help, --version display this help and exit When FILE is - read standard input. @@ -139,6 +148,8 @@ GetOptions( 'ignore-perl-version!' => \$ignore_perl_version, 'debug=s' => \%debug, 'test-only=s' => \$tst_only, + 'codespell!' => \$codespell, + 'codespellfile=s' => \$codespellfile, 'h|help' => \$help, 'version' => \$help ) or help(1); @@ -387,6 +398,56 @@ our $allowed_asm_includes = qr{(?x: )}; # memory.h: ARM has a custom one +# Load common spelling mistakes and build regular expression list. +my $misspellings; +my %spelling_fix; + +if (open(my $spelling, '<', $spelling_file)) { + while (<$spelling>) { + my $line = $_; + + $line =~ s/\s*\n?$//g; + $line =~ s/^\s*//g; + + next if ($line =~ m/^\s*#/); + next if ($line =~ m/^\s*$/); + + my ($suspect, $fix) = split(/\|\|/, $line); + + $spelling_fix{$suspect} = $fix; + } + close($spelling); +} else { + warn "No typos will be found - file '$spelling_file': $!\n"; +} + +if ($codespell) { + if (open(my $spelling, '<', $codespellfile)) { + while (<$spelling>) { + my $line = $_; + + $line =~ s/\s*\n?$//g; + $line =~ s/^\s*//g; + + next if ($line =~ m/^\s*#/); + next if ($line =~ m/^\s*$/); + next if ($line =~ m/, disabled/i); + + $line =~ s/,.*$//; + + my ($suspect, $fix) = split(/->/, $line); + + $spelling_fix{$suspect} = $fix; + } + close($spelling); + } else { + warn "No codespell typos will be found - file '$codespellfile': $!\n"; + } +} + +$misspellings = join("|", sort keys %spelling_fix) if keys %spelling_fix; + + sub build_types { my $mods = "(?x: \n" . join("|\n ", @modifierList) . "\n)"; my $all = "(?x: \n" . join("|\n ", @typeList) . "\n)"; @@ -528,6 +589,8 @@ my @rawlines = (); my @lines = (); my @fixed = (); my $vname; +my $fixlinenr = -1; + for my $filename (@ARGV) { my $FILE; if ($file) { @@ -1950,6 +2013,24 @@ sub process { "8-bit UTF-8 used in possible commit log\n" . $herecurr); } +# Check for various typo / spelling mistakes + if (defined($misspellings) && + ($in_commit_log || $line =~ /^(?:\+|Subject:)/i)) { + while ($rawline =~ /(?:^|[^a-z@])($misspellings)(?:\b|$|[^a-z@])/gi) { + my $typo = $1; + my $typo_fix = $spelling_fix{lc($typo)}; + $typo_fix = ucfirst($typo_fix) if ($typo =~ /^[A-Z]/); + $typo_fix = uc($typo_fix) if ($typo =~ /^[A-Z]+$/); + my $msg_type = \&WARN; + $msg_type = \&CHK if ($file); + if (&{$msg_type}("TYPO_SPELLING", + "'$typo' may be misspelled - perhaps '$typo_fix'?\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/(^|[^A-Za-z@])($typo)($|[^A-Za-z@])/$1$typo_fix$3/; + } + } + } + # ignore non-hunk lines and lines being removed next if (!$hunk_line || $line =~ /^-/); diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index d21589bc2b..826d031852 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -102,7 +102,6 @@ CONFIG_APBH_DMA_BURST8 CONFIG_APER_0_BASE CONFIG_APER_1_BASE CONFIG_APER_SIZE -CONFIG_API CONFIG_APUS_FAST_EXCEPT CONFIG_AP_SH4A_4A CONFIG_ARCH_ADPAG101P diff --git a/tools/Makefile b/tools/Makefile index f5ac6313e1..cbccd4ab91 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -32,7 +32,6 @@ CONFIG_BUILD_ENVCRC ?= $(ENVCRC-y) hostprogs-$(CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER) += atmel_pmecc_params -hostprogs-$(CONFIG_CMD_LICENSE) += bin2header hostprogs-$(CONFIG_LCD_LOGO) += bmp_logo hostprogs-$(CONFIG_VIDEO_LOGO) += bmp_logo HOSTCFLAGS_bmp_logo.o := -pedantic @@ -233,10 +232,6 @@ endif endif # !LOGO_BMP -# Generated gziped GPL-2.0 license text -LICENSE_H = $(objtree)/include/license.h -LICENSE-$(CONFIG_CMD_LICENSE) += $(LICENSE_H) - # # Use native tools and options # Define __KERNEL_STRICT_NAMES to prevent typedef overlaps @@ -251,7 +246,7 @@ HOST_EXTRACFLAGS += -include $(srctree)/include/libfdt_env.h \ -D__KERNEL_STRICT_NAMES \ -D_GNU_SOURCE -__build: $(LOGO-y) $(LICENSE-y) +__build: $(LOGO-y) $(LOGO_H): $(obj)/bmp_logo $(LOGO_BMP) $(obj)/bmp_logo --gen-info $(LOGO_BMP) > $@ @@ -259,10 +254,6 @@ $(LOGO_H): $(obj)/bmp_logo $(LOGO_BMP) $(LOGO_DATA_H): $(obj)/bmp_logo $(LOGO_BMP) $(obj)/bmp_logo --gen-data $(LOGO_BMP) > $@ -$(LICENSE_H): $(obj)/bin2header $(srctree)/Licenses/gpl-2.0.txt - cat $(srctree)/Licenses/gpl-2.0.txt | gzip -9 -c | \ - $(obj)/bin2header license_gzip > $(LICENSE_H) - # Let clean descend into subdirs subdir- += env diff --git a/tools/bin2header.c b/tools/bin2header.c deleted file mode 100644 index 6c2c23f624..0000000000 --- a/tools/bin2header.c +++ /dev/null @@ -1,41 +0,0 @@ -/* bin2header.c - program to convert binary file into a C structure - * definition to be included in a header file. - * - * (C) Copyright 2008 by Harald Welte <laforge@openmoko.org> - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include <stdlib.h> -#include <stdio.h> -#include <unistd.h> - -int main(int argc, char **argv) -{ - if (argc < 2) { - fprintf(stderr, "%s needs one argument: the structure name\n", - argv[0]); - exit(1); - } - - printf("/* bin2header output - automatically generated */\n"); - printf("unsigned char %s[] = {\n", argv[1]); - - while (1) { - int i, nread; - unsigned char buf[10]; - nread = read(0, buf, sizeof(buf)); - if (nread <= 0) - break; - - printf("\t"); - for (i = 0; i < nread - 1; i++) - printf("0x%02x, ", buf[i]); - - printf("0x%02x,\n", buf[nread-1]); - } - - printf("};\n"); - - exit(0); -} |