diff options
562 files changed, 2174 insertions, 1554 deletions
diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 3b7744ce3c3..916ab84ea0c 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -1,7 +1,7 @@ variables: windows_vm: vs2015-win2012r2 ubuntu_vm: ubuntu-18.04 - ci_runner_image: trini/u-boot-gitlab-ci-runner:bionic-20191202-10Jan2020 + ci_runner_image: trini/u-boot-gitlab-ci-runner:bionic-20200112-17Jan2020 # Add '-u 0' options for Azure pipelines, otherwise we get "permission # denied" error when it tries to "useradd -m -u 1001 vsts_azpcontainer", # since our $(ci_runner_image) user is not root. diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d799cc30a8b..c7ca5967dd4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,7 @@ # Grab our configured image. The source for this is found at: # https://gitlab.denx.de/u-boot/gitlab-ci-runner -image: trini/u-boot-gitlab-ci-runner:bionic-20191202-10Jan2020 +image: trini/u-boot-gitlab-ci-runner:bionic-20200112-17Jan2020 # We run some tests in different order, to catch some failures quicker. stages: @@ -383,6 +383,14 @@ config FIT_ENABLE_RSASSA_PSS_SUPPORT Enable this to support the pss padding algorithm as described in the rfc8017 (https://tools.ietf.org/html/rfc8017). +config FIT_CIPHER + bool "Enable ciphering data in a FIT uImages" + depends on DM + select AES + help + Enable the feature of data ciphering/unciphering in the tool mkimage + and in the u-boot support of the FIT image. + config FIT_VERBOSE bool "Show verbose messages when FIT images fail" help @@ -763,7 +763,9 @@ libs-y += cmd/ libs-y += common/ libs-y += env/ libs-$(CONFIG_API) += api/ -libs-$(CONFIG_HAS_POST) += post/ +ifdef CONFIG_POST +libs-y += post/ +endif libs-$(CONFIG_UNIT_TEST) += test/ test/dm/ libs-$(CONFIG_UT_ENV) += test/env/ libs-$(CONFIG_UT_OPTEE) += test/optee/ @@ -2460,7 +2460,7 @@ typically in board_init_f() and board_init_r(). Configuration Settings: ----------------------- -- CONFIG_SYS_SUPPORT_64BIT_DATA: Defined automatically if compiled as 64-bit. +- MEM_SUPPORT_64BIT_DATA: Defined automatically if compiled as 64-bit. Optionally it can be defined to support 64-bit memory commands. - CONFIG_SYS_LONGHELP: Defined when you want long help messages included; @@ -2870,32 +2870,6 @@ Low Level (hardware related) configuration options: If this macro is defined, then CONFIG_SYS_CCSRBAR_PHYS will be forced to a value that ensures that CCSR is not relocated. -- Floppy Disk Support: - CONFIG_SYS_FDC_DRIVE_NUMBER - - the default drive number (default value 0) - - CONFIG_SYS_ISA_IO_STRIDE - - defines the spacing between FDC chipset registers - (default value 1) - - CONFIG_SYS_ISA_IO_OFFSET - - defines the offset of register from address. It - depends on which part of the data bus is connected to - the FDC chipset. (default value 0) - - If CONFIG_SYS_ISA_IO_STRIDE CONFIG_SYS_ISA_IO_OFFSET and - CONFIG_SYS_FDC_DRIVE_NUMBER are undefined, they take their - default value. - - if CONFIG_SYS_FDC_HW_INIT is defined, then the function - fdc_hw_init() is called at the beginning of the FDC - setup. fdc_hw_init() must be provided by the board - source code. It is used to make hardware-dependent - initializations. - - CONFIG_IDE_AHB: Most IDE controllers were designed to be connected with PCI interface. Only few of them were designed for AHB interface. diff --git a/arch/arc/lib/reset.c b/arch/arc/lib/reset.c index 02e08df48de..30dd4b5238b 100644 --- a/arch/arc/lib/reset.c +++ b/arch/arc/lib/reset.c @@ -5,6 +5,7 @@ #include <command.h> #include <common.h> +#include <cpu_func.h> __weak void reset_cpu(ulong addr) { diff --git a/arch/arm/cpu/arm1136/mx35/generic.c b/arch/arm/cpu/arm1136/mx35/generic.c index a651b8c3414..45bf49b5ac7 100644 --- a/arch/arm/cpu/arm1136/mx35/generic.c +++ b/arch/arm/cpu/arm1136/mx35/generic.c @@ -7,6 +7,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <div64.h> #include <asm/io.h> #include <linux/errno.h> diff --git a/arch/arm/cpu/arm920t/ep93xx/cpu.c b/arch/arm/cpu/arm920t/ep93xx/cpu.c index 3aae12f8ad3..c9ea4e46a87 100644 --- a/arch/arm/cpu/arm920t/ep93xx/cpu.c +++ b/arch/arm/cpu/arm920t/ep93xx/cpu.c @@ -9,6 +9,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <asm/arch/ep93xx.h> #include <asm/io.h> diff --git a/arch/arm/cpu/arm920t/imx/timer.c b/arch/arm/cpu/arm920t/imx/timer.c index 17081ddb6d8..21129a7901c 100644 --- a/arch/arm/cpu/arm920t/imx/timer.c +++ b/arch/arm/cpu/arm920t/imx/timer.c @@ -13,6 +13,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <time.h> #if defined (CONFIG_IMX) @@ -71,7 +72,7 @@ unsigned long long get_ticks(void) * This function is derived from PowerPC code (timebase clock frequency). * On ARM it returns the number of timer ticks per second. */ -ulong get_tbclk (void) +ulong get_tbclk(void) { return CONFIG_SYS_HZ; } @@ -79,7 +80,7 @@ ulong get_tbclk (void) /* * Reset the cpu by setting up the watchdog timer and let him time out */ -void reset_cpu (ulong ignored) +void reset_cpu(ulong ignored) { /* Disable watchdog and set Time-Out field to 0 */ WCR = 0x00000000; diff --git a/arch/arm/cpu/arm926ejs/armada100/timer.c b/arch/arm/cpu/arm926ejs/armada100/timer.c index 6c6948a8ef4..f4962ec45f9 100644 --- a/arch/arm/cpu/arm926ejs/armada100/timer.c +++ b/arch/arm/cpu/arm926ejs/armada100/timer.c @@ -7,6 +7,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <time.h> #include <asm/arch/cpu.h> #include <asm/arch/armada100.h> @@ -138,7 +139,7 @@ int timer_init(void) * 2. Write key value to TMP_WSAR reg. * 3. Perform write operation. */ -void reset_cpu (unsigned long ignored) +void reset_cpu(unsigned long ignored) { struct armd1mpmu_registers *mpmu = (struct armd1mpmu_registers *) ARMD1_MPMU_BASE; @@ -188,7 +189,7 @@ unsigned long long get_ticks(void) * This function is derived from PowerPC code (timebase clock frequency). * On ARM it returns the number of timer ticks per second. */ -ulong get_tbclk (void) +ulong get_tbclk(void) { return (ulong)CONFIG_SYS_HZ; } diff --git a/arch/arm/cpu/arm926ejs/lpc32xx/clk.c b/arch/arm/cpu/arm926ejs/lpc32xx/clk.c index 5eb630dabe9..cb2344d79fe 100644 --- a/arch/arm/cpu/arm926ejs/lpc32xx/clk.c +++ b/arch/arm/cpu/arm926ejs/lpc32xx/clk.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <div64.h> #include <asm/arch/cpu.h> #include <asm/arch/clk.h> diff --git a/arch/arm/cpu/arm926ejs/mx25/generic.c b/arch/arm/cpu/arm926ejs/mx25/generic.c index eeb61d0d102..09bda0e3398 100644 --- a/arch/arm/cpu/arm926ejs/mx25/generic.c +++ b/arch/arm/cpu/arm926ejs/mx25/generic.c @@ -9,6 +9,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <div64.h> #include <netdev.h> #include <vsprintf.h> diff --git a/arch/arm/cpu/arm926ejs/mx25/reset.c b/arch/arm/cpu/arm926ejs/mx25/reset.c index 576f7fac6fa..38df1c94022 100644 --- a/arch/arm/cpu/arm926ejs/mx25/reset.c +++ b/arch/arm/cpu/arm926ejs/mx25/reset.c @@ -16,6 +16,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <asm/io.h> #include <asm/arch/imx-regs.h> diff --git a/arch/arm/cpu/arm926ejs/mx27/reset.c b/arch/arm/cpu/arm926ejs/mx27/reset.c index e2437d13c84..320b0a65e70 100644 --- a/arch/arm/cpu/arm926ejs/mx27/reset.c +++ b/arch/arm/cpu/arm926ejs/mx27/reset.c @@ -16,6 +16,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <asm/io.h> #include <asm/arch/imx-regs.h> diff --git a/arch/arm/cpu/arm926ejs/mxs/mxs.c b/arch/arm/cpu/arm926ejs/mxs/mxs.c index 183aa40b6d1..16c080a1e15 100644 --- a/arch/arm/cpu/arm926ejs/mxs/mxs.c +++ b/arch/arm/cpu/arm926ejs/mxs/mxs.c @@ -10,6 +10,8 @@ */ #include <common.h> +#include <cpu_func.h> +#include <hang.h> #include <linux/errno.h> #include <asm/io.h> #include <asm/arch/clock.h> diff --git a/arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c b/arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c index 7818d729086..542543cc285 100644 --- a/arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c +++ b/arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c @@ -8,6 +8,7 @@ #include <common.h> #include <config.h> +#include <init.h> #include <asm/io.h> #include <asm/arch/imx-regs.h> #include <asm/arch/sys_proto.h> diff --git a/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c b/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c index 7a1b39844e3..7c57cab0b13 100644 --- a/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c +++ b/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c @@ -8,6 +8,7 @@ #include <common.h> #include <config.h> +#include <hang.h> #include <asm/io.h> #include <asm/arch/imx-regs.h> diff --git a/arch/arm/cpu/arm926ejs/spear/reset.c b/arch/arm/cpu/arm926ejs/spear/reset.c index 05c7ecdb491..3b884cd0d3c 100644 --- a/arch/arm/cpu/arm926ejs/spear/reset.c +++ b/arch/arm/cpu/arm926ejs/spear/reset.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <asm/io.h> #include <asm/arch/hardware.h> #include <asm/arch/spr_syscntl.h> diff --git a/arch/arm/cpu/arm926ejs/spear/spr_misc.c b/arch/arm/cpu/arm926ejs/spear/spr_misc.c index ccf944f8140..d5be646555e 100644 --- a/arch/arm/cpu/arm926ejs/spear/spr_misc.c +++ b/arch/arm/cpu/arm926ejs/spear/spr_misc.c @@ -9,6 +9,7 @@ #include <cpu_func.h> #include <env.h> #include <i2c.h> +#include <init.h> #include <net.h> #include <linux/mtd/st_smi.h> #include <asm/io.h> diff --git a/arch/arm/cpu/armv7/bcm281xx/reset.c b/arch/arm/cpu/armv7/bcm281xx/reset.c index fbdeea4de3c..fda5a9527ec 100644 --- a/arch/arm/cpu/armv7/bcm281xx/reset.c +++ b/arch/arm/cpu/armv7/bcm281xx/reset.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <asm/io.h> #include <asm/arch/sysmap.h> diff --git a/arch/arm/cpu/armv7/bcmcygnus/reset.c b/arch/arm/cpu/armv7/bcmcygnus/reset.c index 7f3f4055e42..3bfed34533b 100644 --- a/arch/arm/cpu/armv7/bcmcygnus/reset.c +++ b/arch/arm/cpu/armv7/bcmcygnus/reset.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <asm/io.h> #define CRMU_MAIL_BOX1 0x03024028 diff --git a/arch/arm/cpu/armv7/bcmnsp/reset.c b/arch/arm/cpu/armv7/bcmnsp/reset.c index 674166daabe..675f99fe998 100644 --- a/arch/arm/cpu/armv7/bcmnsp/reset.c +++ b/arch/arm/cpu/armv7/bcmnsp/reset.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <asm/io.h> #define CRU_RESET_OFFSET 0x1803F184 diff --git a/arch/arm/cpu/armv7/ls102xa/clock.c b/arch/arm/cpu/armv7/ls102xa/clock.c index 7a1053cebb4..f3bdb14c072 100644 --- a/arch/arm/cpu/armv7/ls102xa/clock.c +++ b/arch/arm/cpu/armv7/ls102xa/clock.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <asm/io.h> #include <asm/arch/immap_ls102xa.h> #include <asm/arch/clock.h> diff --git a/arch/arm/cpu/armv7/ls102xa/fdt.c b/arch/arm/cpu/armv7/ls102xa/fdt.c index 1aadffff599..16ab8676fe4 100644 --- a/arch/arm/cpu/armv7/ls102xa/fdt.c +++ b/arch/arm/cpu/armv7/ls102xa/fdt.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <linux/libfdt.h> #include <fdt_support.h> #include <asm/io.h> diff --git a/arch/arm/cpu/armv7/stv0991/reset.c b/arch/arm/cpu/armv7/stv0991/reset.c index d4b3ab7fd80..008e271dccf 100644 --- a/arch/arm/cpu/armv7/stv0991/reset.c +++ b/arch/arm/cpu/armv7/stv0991/reset.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <asm/io.h> #include <asm/arch/stv0991_wdru.h> void reset_cpu(ulong ignored) diff --git a/arch/arm/cpu/armv7/vf610/generic.c b/arch/arm/cpu/armv7/vf610/generic.c index 806c6adf387..6698b821d0e 100644 --- a/arch/arm/cpu/armv7/vf610/generic.c +++ b/arch/arm/cpu/armv7/vf610/generic.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <cpu_func.h> #include <asm/io.h> #include <asm/arch/imx-regs.h> diff --git a/arch/arm/cpu/armv8/cache_v8.c b/arch/arm/cpu/armv8/cache_v8.c index c1a08fb4ace..6a5518f9de8 100644 --- a/arch/arm/cpu/armv8/cache_v8.c +++ b/arch/arm/cpu/armv8/cache_v8.c @@ -9,6 +9,7 @@ #include <common.h> #include <cpu_func.h> +#include <hang.h> #include <asm/system.h> #include <asm/armv8/mmu.h> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c index 639f5316498..dce915a2ea1 100644 --- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c +++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c @@ -8,6 +8,8 @@ #include <cpu_func.h> #include <env.h> #include <fsl_ddr_sdram.h> +#include <init.h> +#include <hang.h> #include <vsprintf.h> #include <asm/io.h> #include <linux/errno.h> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c index 1e7e46e88a0..87c3e05f458 100644 --- a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c +++ b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <efi_loader.h> #include <linux/libfdt.h> #include <fdt_support.h> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c b/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c index fec231857bf..c56689086de 100644 --- a/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c +++ b/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <cpu_func.h> #include <linux/compiler.h> #include <asm/io.h> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch3_speed.c b/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch3_speed.c index bd8b9cbdadd..7f8178f72eb 100644 --- a/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch3_speed.c +++ b/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch3_speed.c @@ -7,6 +7,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <cpu_func.h> #include <linux/compiler.h> #include <fsl_ifc.h> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/soc.c b/arch/arm/cpu/armv8/fsl-layerscape/soc.c index 578f8d12de6..2175266a30d 100644 --- a/arch/arm/cpu/armv8/fsl-layerscape/soc.c +++ b/arch/arm/cpu/armv8/fsl-layerscape/soc.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <env.h> #include <fsl_immap.h> #include <fsl_ifc.h> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/spl.c b/arch/arm/cpu/armv8/fsl-layerscape/spl.c index ed3a6056637..8a6eecab22e 100644 --- a/arch/arm/cpu/armv8/fsl-layerscape/spl.c +++ b/arch/arm/cpu/armv8/fsl-layerscape/spl.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <cpu_func.h> #include <env.h> #include <spl.h> diff --git a/arch/arm/cpu/armv8/s32v234/generic.c b/arch/arm/cpu/armv8/s32v234/generic.c index 2c4ea36e07e..ec4641dcdbe 100644 --- a/arch/arm/cpu/armv8/s32v234/generic.c +++ b/arch/arm/cpu/armv8/s32v234/generic.c @@ -4,6 +4,8 @@ */ #include <common.h> +#include <clock_legacy.h> +#include <cpu_func.h> #include <asm/io.h> #include <asm/arch/imx-regs.h> #include <asm/arch/clock.h> diff --git a/arch/arm/cpu/sa1100/timer.c b/arch/arm/cpu/sa1100/timer.c index c6b1b2c1775..8e20c96bcda 100644 --- a/arch/arm/cpu/sa1100/timer.c +++ b/arch/arm/cpu/sa1100/timer.c @@ -59,7 +59,7 @@ unsigned long long get_ticks(void) * This function is derived from PowerPC code (timebase clock frequency). * On ARM it returns the number of timer ticks per second. */ -ulong get_tbclk (void) +ulong get_tbclk(void) { return CONFIG_SYS_HZ; } diff --git a/arch/arm/include/asm/armv8/mmu.h b/arch/arm/include/asm/armv8/mmu.h index 4a573208dfd..fc97c551146 100644 --- a/arch/arm/include/asm/armv8/mmu.h +++ b/arch/arm/include/asm/armv8/mmu.h @@ -7,6 +7,7 @@ #ifndef _ASM_ARMV8_MMU_H_ #define _ASM_ARMV8_MMU_H_ +#include <hang.h> #include <linux/const.h> /* diff --git a/arch/arm/include/asm/u-boot-arm.h b/arch/arm/include/asm/u-boot-arm.h index 2e8c8e53d79..0b93cc48c50 100644 --- a/arch/arm/include/asm/u-boot-arm.h +++ b/arch/arm/include/asm/u-boot-arm.h @@ -23,6 +23,8 @@ extern ulong _datarellocal_start_ofs; extern ulong _datarelro_start_ofs; extern ulong IRQ_STACK_START_IN; /* 8 bytes in IRQ stack */ +void s_init(void); + /* cpu/.../cpu.c */ int cleanup_before_linux(void); @@ -52,6 +54,8 @@ void do_fiq(struct pt_regs *pt_regs); void do_irq(struct pt_regs *pt_regswq); #endif +void reset_misc(void); + #endif /* __ASSEMBLY__ */ #endif /* _U_BOOT_ARM_H_ */ diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index 769a64257fc..a135bcfc7b5 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -15,6 +15,7 @@ #include <command.h> #include <cpu_func.h> #include <dm.h> +#include <hang.h> #include <dm/root.h> #include <env.h> #include <image.h> diff --git a/arch/arm/lib/div0.c b/arch/arm/lib/div0.c index e185bfe0c65..b91b408f64b 100644 --- a/arch/arm/lib/div0.c +++ b/arch/arm/lib/div0.c @@ -4,10 +4,10 @@ * Wolfgang Denk, DENX Software Engineering, wd@denx.de. */ +#include <hang.h> + /* Replacement (=dummy) for GNU/Linux division-by zero handler */ void __div0 (void) { - extern void hang (void); - hang(); } diff --git a/arch/arm/lib/interrupts.c b/arch/arm/lib/interrupts.c index 75b70d91253..6dbf03b00cd 100644 --- a/arch/arm/lib/interrupts.c +++ b/arch/arm/lib/interrupts.c @@ -19,6 +19,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <efi_loader.h> #include <irq_func.h> #include <asm/proc-armv/ptrace.h> @@ -48,7 +49,7 @@ int disable_interrupts(void) void bad_mode (void) { panic ("Resetting CPU ...\n"); - reset_cpu (0); + reset_cpu(0); } static void show_efi_loaded_images(struct pt_regs *regs) diff --git a/arch/arm/lib/interrupts_m.c b/arch/arm/lib/interrupts_m.c index e4373f37810..1f6fdf2995d 100644 --- a/arch/arm/lib/interrupts_m.c +++ b/arch/arm/lib/interrupts_m.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <irq_func.h> /* diff --git a/arch/arm/lib/relocate_64.S b/arch/arm/lib/relocate_64.S index 26d29c5324a..72e91f2704b 100644 --- a/arch/arm/lib/relocate_64.S +++ b/arch/arm/lib/relocate_64.S @@ -14,7 +14,7 @@ #include <asm/macro.h> /* - * void relocate_code (addr_moni) + * void relocate_code(addr_moni) * * This function relocates the monitor code. * x0 holds the destination address. diff --git a/arch/arm/lib/reset.c b/arch/arm/lib/reset.c index 3c4512d495a..835a40e59d9 100644 --- a/arch/arm/lib/reset.c +++ b/arch/arm/lib/reset.c @@ -21,6 +21,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <irq_func.h> __weak void reset_misc(void) diff --git a/arch/arm/mach-at91/arm920t/reset.c b/arch/arm/mach-at91/arm920t/reset.c index 3164182b697..d92bc57d669 100644 --- a/arch/arm/mach-at91/arm920t/reset.c +++ b/arch/arm/mach-at91/arm920t/reset.c @@ -14,6 +14,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <asm/io.h> #include <asm/arch/hardware.h> #include <asm/arch/at91_st.h> diff --git a/arch/arm/mach-at91/arm926ejs/reset.c b/arch/arm/mach-at91/arm926ejs/reset.c index 06b25db5222..56fbbd991e5 100644 --- a/arch/arm/mach-at91/arm926ejs/reset.c +++ b/arch/arm/mach-at91/arm926ejs/reset.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <asm/io.h> #include <asm/arch/hardware.h> #include <asm/arch/at91_rstc.h> diff --git a/arch/arm/mach-at91/arm926ejs/timer.c b/arch/arm/mach-at91/arm926ejs/timer.c index f81e8455937..31ad0bf7026 100644 --- a/arch/arm/mach-at91/arm926ejs/timer.c +++ b/arch/arm/mach-at91/arm926ejs/timer.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <time.h> #include <asm/io.h> #include <asm/arch/hardware.h> #include <asm/arch/at91_pit.h> diff --git a/arch/arm/mach-at91/armv7/reset.c b/arch/arm/mach-at91/armv7/reset.c index c114dafac5d..8f4c81d1afd 100644 --- a/arch/arm/mach-at91/armv7/reset.c +++ b/arch/arm/mach-at91/armv7/reset.c @@ -9,6 +9,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <asm/io.h> #include <asm/arch/hardware.h> #include <asm/arch/at91_rstc.h> diff --git a/arch/arm/mach-at91/armv7/timer.c b/arch/arm/mach-at91/armv7/timer.c index 9f08806fb12..15c036cc27e 100644 --- a/arch/arm/mach-at91/armv7/timer.c +++ b/arch/arm/mach-at91/armv7/timer.c @@ -9,6 +9,7 @@ */ #include <common.h> +#include <time.h> #include <asm/io.h> #include <asm/arch/hardware.h> #include <asm/arch/at91_pit.h> diff --git a/arch/arm/mach-at91/spl.c b/arch/arm/mach-at91/spl.c index 6da6d41be2e..156150c89c8 100644 --- a/arch/arm/mach-at91/spl.c +++ b/arch/arm/mach-at91/spl.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <hang.h> #include <asm/io.h> #include <asm/arch/at91_common.h> #include <asm/arch/at91_wdt.h> diff --git a/arch/arm/mach-at91/spl_at91.c b/arch/arm/mach-at91/spl_at91.c index 1065f090e01..822f877de71 100644 --- a/arch/arm/mach-at91/spl_at91.c +++ b/arch/arm/mach-at91/spl_at91.c @@ -9,6 +9,7 @@ */ #include <common.h> +#include <hang.h> #include <asm/io.h> #include <asm/arch/at91_common.h> #include <asm/arch/at91sam9_matrix.h> diff --git a/arch/arm/mach-at91/spl_atmel.c b/arch/arm/mach-at91/spl_atmel.c index 85290be3696..6ee0e1c24cf 100644 --- a/arch/arm/mach-at91/spl_atmel.c +++ b/arch/arm/mach-at91/spl_atmel.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <hang.h> #include <asm/io.h> #include <asm/arch/at91_common.h> #include <asm/arch/at91_pit.h> diff --git a/arch/arm/mach-bcm283x/reset.c b/arch/arm/mach-bcm283x/reset.c index cd8138d7022..2b4ccd47279 100644 --- a/arch/arm/mach-bcm283x/reset.c +++ b/arch/arm/mach-bcm283x/reset.c @@ -7,6 +7,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <asm/io.h> #include <asm/arch/base.h> #include <asm/arch/wdog.h> diff --git a/arch/arm/mach-davinci/misc.c b/arch/arm/mach-davinci/misc.c index 80e964274e1..3e5185261c7 100644 --- a/arch/arm/mach-davinci/misc.c +++ b/arch/arm/mach-davinci/misc.c @@ -11,6 +11,7 @@ #include <common.h> #include <env.h> #include <i2c.h> +#include <init.h> #include <net.h> #include <asm/arch/hardware.h> #include <asm/io.h> diff --git a/arch/arm/mach-davinci/reset.c b/arch/arm/mach-davinci/reset.c index 9fbd09c77b7..4e6031a593b 100644 --- a/arch/arm/mach-davinci/reset.c +++ b/arch/arm/mach-davinci/reset.c @@ -7,6 +7,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <asm/io.h> #include <asm/arch/timer_defs.h> #include <asm/arch/hardware.h> diff --git a/arch/arm/mach-davinci/spl.c b/arch/arm/mach-davinci/spl.c index be3daa9bc02..d44e840aa0e 100644 --- a/arch/arm/mach-davinci/spl.c +++ b/arch/arm/mach-davinci/spl.c @@ -5,6 +5,7 @@ */ #include <common.h> #include <config.h> +#include <hang.h> #include <spl.h> #include <asm/u-boot.h> #include <asm/utils.h> diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c index d31af47c31d..21103809577 100644 --- a/arch/arm/mach-imx/imx8/cpu.c +++ b/arch/arm/mach-imx/imx8/cpu.c @@ -8,6 +8,7 @@ #include <cpu.h> #include <cpu_func.h> #include <dm.h> +#include <init.h> #include <dm/device-internal.h> #include <dm/lists.h> #include <dm/uclass.h> diff --git a/arch/arm/mach-imx/mx5/mx53_dram.c b/arch/arm/mach-imx/mx5/mx53_dram.c index 39ac287fb42..a7f033f3f44 100644 --- a/arch/arm/mach-imx/mx5/mx53_dram.c +++ b/arch/arm/mach-imx/mx5/mx53_dram.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <init.h> DECLARE_GLOBAL_DATA_PTR; diff --git a/arch/arm/mach-imx/mx6/ddr.c b/arch/arm/mach-imx/mx6/ddr.c index 8ed8b79c8b7..4396880b748 100644 --- a/arch/arm/mach-imx/mx6/ddr.c +++ b/arch/arm/mach-imx/mx6/ddr.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <hang.h> #include <linux/types.h> #include <asm/arch/clock.h> #include <asm/arch/mx6-ddr.h> diff --git a/arch/arm/mach-imx/mx6/litesom.c b/arch/arm/mach-imx/mx6/litesom.c index 4f4df7433be..b0a6bd589c0 100644 --- a/arch/arm/mach-imx/mx6/litesom.c +++ b/arch/arm/mach-imx/mx6/litesom.c @@ -4,6 +4,7 @@ * Copyright (C) 2016 Grinn */ +#include <init.h> #include <asm/arch/clock.h> #include <asm/arch/iomux.h> #include <asm/arch/imx-regs.h> diff --git a/arch/arm/mach-imx/mx7/clock.c b/arch/arm/mach-imx/mx7/clock.c index 0e08cabb7ad..75be4f8ad79 100644 --- a/arch/arm/mach-imx/mx7/clock.c +++ b/arch/arm/mach-imx/mx7/clock.c @@ -7,6 +7,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <div64.h> #include <asm/io.h> #include <linux/errno.h> diff --git a/arch/arm/mach-imx/mx7ulp/clock.c b/arch/arm/mach-imx/mx7ulp/clock.c index d3365dd411d..3c0bcccd0dc 100644 --- a/arch/arm/mach-imx/mx7ulp/clock.c +++ b/arch/arm/mach-imx/mx7ulp/clock.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <div64.h> #include <asm/io.h> #include <errno.h> diff --git a/arch/arm/mach-imx/mx7ulp/soc.c b/arch/arm/mach-imx/mx7ulp/soc.c index 8345b01398b..7f8fdc7005e 100644 --- a/arch/arm/mach-imx/mx7ulp/soc.c +++ b/arch/arm/mach-imx/mx7ulp/soc.c @@ -2,6 +2,7 @@ /* * Copyright (C) 2016 Freescale Semiconductor, Inc. */ +#include <cpu_func.h> #include <init.h> #include <asm/io.h> #include <asm/arch/clock.h> diff --git a/arch/arm/mach-imx/speed.c b/arch/arm/mach-imx/speed.c index f9e486c7df2..e78b1fd71b6 100644 --- a/arch/arm/mach-imx/speed.c +++ b/arch/arm/mach-imx/speed.c @@ -8,6 +8,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <asm/arch/imx-regs.h> #include <asm/arch/clock.h> diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c index 5a6493a6250..87dbdf3011e 100644 --- a/arch/arm/mach-imx/spl.c +++ b/arch/arm/mach-imx/spl.c @@ -7,6 +7,7 @@ */ #include <common.h> +#include <hang.h> #include <asm/io.h> #include <asm/arch/imx-regs.h> #include <asm/arch/sys_proto.h> diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c index 50f5b81dfe5..4e35a13156b 100644 --- a/arch/arm/mach-k3/common.c +++ b/arch/arm/mach-k3/common.c @@ -7,6 +7,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <spl.h> #include "common.h" #include <dm.h> diff --git a/arch/arm/mach-k3/security.c b/arch/arm/mach-k3/security.c index 4e011ee10ef..6934e88a965 100644 --- a/arch/arm/mach-k3/security.c +++ b/arch/arm/mach-k3/security.c @@ -8,6 +8,7 @@ #include <common.h> #include <dm.h> +#include <hang.h> #include <linux/soc/ti/ti_sci_protocol.h> #include <mach/spl.h> #include <spl.h> diff --git a/arch/arm/mach-keystone/ddr3.c b/arch/arm/mach-keystone/ddr3.c index 863ae6321ba..23ff06466dd 100644 --- a/arch/arm/mach-keystone/ddr3.c +++ b/arch/arm/mach-keystone/ddr3.c @@ -6,6 +6,7 @@ * Texas Instruments Incorporated, <www.ti.com> */ +#include <cpu_func.h> #include <asm/io.h> #include <common.h> #include <asm/arch/msmc.h> diff --git a/arch/arm/mach-keystone/mon.c b/arch/arm/mach-keystone/mon.c index cc2ec885056..b7de9ba099d 100644 --- a/arch/arm/mach-keystone/mon.c +++ b/arch/arm/mach-keystone/mon.c @@ -5,6 +5,7 @@ * Copyright (C) 2012-2019 Texas Instruments Incorporated - http://www.ti.com/ */ +#include <hang.h> #include <asm/unaligned.h> #include <common.h> #include <command.h> diff --git a/arch/arm/mach-kirkwood/cpu.c b/arch/arm/mach-kirkwood/cpu.c index 29c0e592e42..5e964af8eab 100644 --- a/arch/arm/mach-kirkwood/cpu.c +++ b/arch/arm/mach-kirkwood/cpu.c @@ -7,6 +7,7 @@ #include <common.h> #include <command.h> +#include <cpu_func.h> #include <env.h> #include <netdev.h> #include <asm/cache.h> diff --git a/arch/arm/mach-mediatek/mt7623/init.c b/arch/arm/mach-mediatek/mt7623/init.c index 0ee8c6664c6..2778e260e02 100644 --- a/arch/arm/mach-mediatek/mt7623/init.c +++ b/arch/arm/mach-mediatek/mt7623/init.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <init.h> #include <linux/io.h> #include <linux/sizes.h> #include <asm/arch/misc.h> diff --git a/arch/arm/mach-mediatek/mt8516/init.c b/arch/arm/mach-mediatek/mt8516/init.c index 186f6c048ac..360d94abb00 100644 --- a/arch/arm/mach-mediatek/mt8516/init.c +++ b/arch/arm/mach-mediatek/mt8516/init.c @@ -7,6 +7,7 @@ #include <clk.h> #include <common.h> +#include <cpu_func.h> #include <dm.h> #include <fdtdec.h> #include <ram.h> diff --git a/arch/arm/mach-mediatek/mt8518/init.c b/arch/arm/mach-mediatek/mt8518/init.c index 5a97c8cb264..c2b1b769824 100644 --- a/arch/arm/mach-mediatek/mt8518/init.c +++ b/arch/arm/mach-mediatek/mt8518/init.c @@ -8,6 +8,7 @@ #include <clk.h> #include <common.h> +#include <cpu_func.h> #include <dm.h> #include <fdtdec.h> #include <ram.h> diff --git a/arch/arm/mach-mediatek/spl.c b/arch/arm/mach-mediatek/spl.c index 9b3590ff3d2..37f1f219b2d 100644 --- a/arch/arm/mach-mediatek/spl.c +++ b/arch/arm/mach-mediatek/spl.c @@ -6,6 +6,7 @@ #include <clk.h> #include <common.h> +#include <hang.h> #include <spl.h> #include "init.h" diff --git a/arch/arm/mach-meson/board-axg.c b/arch/arm/mach-meson/board-axg.c index 173905e762d..6874458e36a 100644 --- a/arch/arm/mach-meson/board-axg.c +++ b/arch/arm/mach-meson/board-axg.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <init.h> #include <asm/arch/boot.h> #include <asm/arch/eth.h> #include <asm/arch/axg.h> diff --git a/arch/arm/mach-meson/board-common.c b/arch/arm/mach-meson/board-common.c index d33e7f17415..bc4c92074cb 100644 --- a/arch/arm/mach-meson/board-common.c +++ b/arch/arm/mach-meson/board-common.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <init.h> #include <asm/arch/boot.h> #include <env.h> diff --git a/arch/arm/mach-meson/board-g12a.c b/arch/arm/mach-meson/board-g12a.c index 24786df6cdd..26d6b907906 100644 --- a/arch/arm/mach-meson/board-g12a.c +++ b/arch/arm/mach-meson/board-g12a.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <init.h> #include <asm/arch/boot.h> #include <asm/arch/eth.h> #include <asm/arch/g12a.h> diff --git a/arch/arm/mach-meson/board-gx.c b/arch/arm/mach-meson/board-gx.c index ab8f1a81f83..191fd490058 100644 --- a/arch/arm/mach-meson/board-gx.c +++ b/arch/arm/mach-meson/board-gx.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <init.h> #include <asm/arch/boot.h> #include <asm/arch/eth.h> #include <asm/arch/gx.h> diff --git a/arch/arm/mach-mvebu/armada3700/cpu.c b/arch/arm/mach-mvebu/armada3700/cpu.c index 7c8e4cade1e..c83268181b9 100644 --- a/arch/arm/mach-mvebu/armada3700/cpu.c +++ b/arch/arm/mach-mvebu/armada3700/cpu.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <dm.h> #include <fdtdec.h> #include <linux/libfdt.h> diff --git a/arch/arm/mach-mvebu/dram.c b/arch/arm/mach-mvebu/dram.c index ba8ebc62887..6c6f8d8c5c5 100644 --- a/arch/arm/mach-mvebu/dram.c +++ b/arch/arm/mach-mvebu/dram.c @@ -7,6 +7,7 @@ #include <config.h> #include <common.h> +#include <init.h> #include <asm/io.h> #include <asm/arch/cpu.h> #include <asm/arch/soc.h> diff --git a/arch/arm/mach-mvebu/spl.c b/arch/arm/mach-mvebu/spl.c index 3cb27b7f4b2..a99bf166fd8 100644 --- a/arch/arm/mach-mvebu/spl.c +++ b/arch/arm/mach-mvebu/spl.c @@ -7,6 +7,7 @@ #include <dm.h> #include <debug_uart.h> #include <fdtdec.h> +#include <hang.h> #include <spl.h> #include <asm/io.h> #include <asm/arch/cpu.h> diff --git a/arch/arm/mach-omap2/am33xx/board.c b/arch/arm/mach-omap2/am33xx/board.c index e64942b7167..283f73522d6 100644 --- a/arch/arm/mach-omap2/am33xx/board.c +++ b/arch/arm/mach-omap2/am33xx/board.c @@ -11,6 +11,7 @@ #include <dm.h> #include <debug_uart.h> #include <errno.h> +#include <init.h> #include <ns16550.h> #include <spl.h> #include <asm/arch/cpu.h> diff --git a/arch/arm/mach-omap2/am33xx/clock.c b/arch/arm/mach-omap2/am33xx/clock.c index 7c666be758a..8c61547ee9c 100644 --- a/arch/arm/mach-omap2/am33xx/clock.c +++ b/arch/arm/mach-omap2/am33xx/clock.c @@ -8,6 +8,7 @@ * Copyright (C) 2013, Texas Instruments, Incorporated - http://www.ti.com/ */ #include <common.h> +#include <hang.h> #include <asm/arch/cpu.h> #include <asm/arch/clock.h> #include <asm/arch/hardware.h> diff --git a/arch/arm/mach-omap2/am33xx/fdt.c b/arch/arm/mach-omap2/am33xx/fdt.c index 1005a5be96d..c81dc808e5d 100644 --- a/arch/arm/mach-omap2/am33xx/fdt.c +++ b/arch/arm/mach-omap2/am33xx/fdt.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <hang.h> #include <linux/libfdt.h> #include <fdt_support.h> #include <malloc.h> diff --git a/arch/arm/mach-omap2/clocks-common.c b/arch/arm/mach-omap2/clocks-common.c index 5932d694d30..9aff83e9dfd 100644 --- a/arch/arm/mach-omap2/clocks-common.c +++ b/arch/arm/mach-omap2/clocks-common.c @@ -13,6 +13,7 @@ * Rajendra Nayak <rnayak@ti.com> */ #include <common.h> +#include <hang.h> #include <i2c.h> #include <asm/omap_common.h> #include <asm/gpio.h> diff --git a/arch/arm/mach-omap2/emif-common.c b/arch/arm/mach-omap2/emif-common.c index 290f9dcdb02..4658f67e84d 100644 --- a/arch/arm/mach-omap2/emif-common.c +++ b/arch/arm/mach-omap2/emif-common.c @@ -9,6 +9,9 @@ */ #include <common.h> +#include <hang.h> +#include <init.h> +#include <net.h> #include <asm/emif.h> #include <asm/arch/clock.h> #include <asm/arch/sys_proto.h> diff --git a/arch/arm/mach-omap2/omap5/dra7xx_iodelay.c b/arch/arm/mach-omap2/omap5/dra7xx_iodelay.c index 9eda57c450d..598074ba21a 100644 --- a/arch/arm/mach-omap2/omap5/dra7xx_iodelay.c +++ b/arch/arm/mach-omap2/omap5/dra7xx_iodelay.c @@ -7,6 +7,7 @@ */ #include <common.h> +#include <hang.h> #include <asm/utils.h> #include <asm/arch/dra7xx_iodelay.h> #include <asm/arch/omap.h> diff --git a/arch/arm/mach-omap2/omap5/fdt.c b/arch/arm/mach-omap2/omap5/fdt.c index 5ba8806dd74..c4adba31e68 100644 --- a/arch/arm/mach-omap2/omap5/fdt.c +++ b/arch/arm/mach-omap2/omap5/fdt.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <hang.h> #include <linux/libfdt.h> #include <fdt_support.h> #include <malloc.h> diff --git a/arch/arm/mach-omap2/omap5/hwinit.c b/arch/arm/mach-omap2/omap5/hwinit.c index 56458ce4957..3b1733099fd 100644 --- a/arch/arm/mach-omap2/omap5/hwinit.c +++ b/arch/arm/mach-omap2/omap5/hwinit.c @@ -12,6 +12,7 @@ * Sricharan <r.sricharan@ti.com> */ #include <common.h> +#include <cpu_func.h> #include <palmas.h> #include <asm/armv7.h> #include <asm/arch/cpu.h> diff --git a/arch/arm/mach-omap2/reset.c b/arch/arm/mach-omap2/reset.c index ea27248e853..2bbd5fcb9b8 100644 --- a/arch/arm/mach-omap2/reset.c +++ b/arch/arm/mach-omap2/reset.c @@ -9,6 +9,7 @@ * Sricharan R <r.sricharan@ti.com> */ #include <config.h> +#include <cpu_func.h> #include <asm/io.h> #include <asm/arch/cpu.h> #include <linux/compiler.h> diff --git a/arch/arm/mach-omap2/sec-common.c b/arch/arm/mach-omap2/sec-common.c index e9b3e746fea..28b929f84f3 100644 --- a/arch/arm/mach-omap2/sec-common.c +++ b/arch/arm/mach-omap2/sec-common.c @@ -14,6 +14,8 @@ #include <common.h> #include <cpu_func.h> +#include <hang.h> +#include <init.h> #include <stdarg.h> #include <asm/arch/sys_proto.h> diff --git a/arch/arm/mach-orion5x/dram.c b/arch/arm/mach-orion5x/dram.c index b52c417e309..33f65db48ea 100644 --- a/arch/arm/mach-orion5x/dram.c +++ b/arch/arm/mach-orion5x/dram.c @@ -10,6 +10,7 @@ #include <common.h> #include <config.h> +#include <init.h> #include <asm/arch/cpu.h> DECLARE_GLOBAL_DATA_PTR; diff --git a/arch/arm/mach-orion5x/timer.c b/arch/arm/mach-orion5x/timer.c index 9da97838220..077eb63e74e 100644 --- a/arch/arm/mach-orion5x/timer.c +++ b/arch/arm/mach-orion5x/timer.c @@ -165,7 +165,7 @@ unsigned long long get_ticks(void) * This function is derived from PowerPC code (timebase clock frequency). * On ARM it returns the number of timer ticks per second. */ -ulong get_tbclk (void) +ulong get_tbclk(void) { return (ulong)CONFIG_SYS_HZ; } diff --git a/arch/arm/mach-rockchip/bootrom.c b/arch/arm/mach-rockchip/bootrom.c index 10614c99d9c..1524eca2729 100644 --- a/arch/arm/mach-rockchip/bootrom.c +++ b/arch/arm/mach-rockchip/bootrom.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <hang.h> #include <asm/arch-rockchip/bootrom.h> #include <asm/arch-rockchip/boot_mode.h> #include <asm/io.h> diff --git a/arch/arm/mach-rockchip/rk3188/rk3188.c b/arch/arm/mach-rockchip/rk3188/rk3188.c index 1b012f7f67a..61d410d780e 100644 --- a/arch/arm/mach-rockchip/rk3188/rk3188.c +++ b/arch/arm/mach-rockchip/rk3188/rk3188.c @@ -4,6 +4,7 @@ */ #include <common.h> #include <dm.h> +#include <hang.h> #include <syscon.h> #include <asm/io.h> #include <asm/arch-rockchip/bootrom.h> diff --git a/arch/arm/mach-rockchip/spl.c b/arch/arm/mach-rockchip/spl.c index 514032a44aa..7d0e6fa1aff 100644 --- a/arch/arm/mach-rockchip/spl.c +++ b/arch/arm/mach-rockchip/spl.c @@ -6,6 +6,7 @@ #include <common.h> #include <debug_uart.h> #include <dm.h> +#include <hang.h> #include <ram.h> #include <spl.h> #include <asm/arch-rockchip/bootrom.h> diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c index c3734cb0708..31a3eb4c285 100644 --- a/arch/arm/mach-rockchip/tpl.c +++ b/arch/arm/mach-rockchip/tpl.c @@ -6,6 +6,7 @@ #include <common.h> #include <debug_uart.h> #include <dm.h> +#include <hang.h> #include <ram.h> #include <spl.h> #include <version.h> diff --git a/arch/arm/mach-socfpga/mailbox_s10.c b/arch/arm/mach-socfpga/mailbox_s10.c index 3254bc1805a..f30e7f80a29 100644 --- a/arch/arm/mach-socfpga/mailbox_s10.c +++ b/arch/arm/mach-socfpga/mailbox_s10.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <hang.h> #include <wait_bit.h> #include <asm/io.h> #include <asm/arch/mailbox_s10.h> diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c index db71105af34..2901b7db680 100644 --- a/arch/arm/mach-socfpga/misc.c +++ b/arch/arm/mach-socfpga/misc.c @@ -5,6 +5,7 @@ #include <common.h> #include <cpu_func.h> +#include <hang.h> #include <asm/io.h> #include <errno.h> #include <fdtdec.h> diff --git a/arch/arm/mach-socfpga/misc_gen5.c b/arch/arm/mach-socfpga/misc_gen5.c index 35938b2dfc0..21eb934e565 100644 --- a/arch/arm/mach-socfpga/misc_gen5.c +++ b/arch/arm/mach-socfpga/misc_gen5.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <asm/io.h> #include <env.h> #include <errno.h> diff --git a/arch/arm/mach-socfpga/spl_a10.c b/arch/arm/mach-socfpga/spl_a10.c index 7c38c509816..d9ef851054d 100644 --- a/arch/arm/mach-socfpga/spl_a10.c +++ b/arch/arm/mach-socfpga/spl_a10.c @@ -5,6 +5,7 @@ #include <common.h> #include <cpu_func.h> +#include <hang.h> #include <asm/io.h> #include <asm/pl310.h> #include <asm/u-boot.h> diff --git a/arch/arm/mach-socfpga/spl_agilex.c b/arch/arm/mach-socfpga/spl_agilex.c index c745d64114c..ecc1a35c497 100644 --- a/arch/arm/mach-socfpga/spl_agilex.c +++ b/arch/arm/mach-socfpga/spl_agilex.c @@ -8,6 +8,7 @@ #include <asm/u-boot.h> #include <asm/utils.h> #include <common.h> +#include <hang.h> #include <image.h> #include <spl.h> #include <asm/arch/clock_manager.h> diff --git a/arch/arm/mach-socfpga/spl_gen5.c b/arch/arm/mach-socfpga/spl_gen5.c index e19f55aa9b5..70f8455ddca 100644 --- a/arch/arm/mach-socfpga/spl_gen5.c +++ b/arch/arm/mach-socfpga/spl_gen5.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <hang.h> #include <asm/io.h> #include <asm/u-boot.h> #include <asm/utils.h> diff --git a/arch/arm/mach-socfpga/spl_s10.c b/arch/arm/mach-socfpga/spl_s10.c index 8d96918cb45..d89151d9024 100644 --- a/arch/arm/mach-socfpga/spl_s10.c +++ b/arch/arm/mach-socfpga/spl_s10.c @@ -4,6 +4,7 @@ * */ +#include <hang.h> #include <asm/io.h> #include <asm/u-boot.h> #include <asm/utils.h> diff --git a/arch/arm/mach-stm32mp/spl.c b/arch/arm/mach-stm32mp/spl.c index a3b0d6f3825..ca4231cd0df 100644 --- a/arch/arm/mach-stm32mp/spl.c +++ b/arch/arm/mach-stm32mp/spl.c @@ -5,6 +5,7 @@ #include <common.h> #include <dm.h> +#include <hang.h> #include <spl.h> #include <asm/io.h> #include <asm/arch/sys_proto.h> diff --git a/arch/arm/mach-sunxi/dram_sun4i.c b/arch/arm/mach-sunxi/dram_sun4i.c index 396c0424ea9..72de807a472 100644 --- a/arch/arm/mach-sunxi/dram_sun4i.c +++ b/arch/arm/mach-sunxi/dram_sun4i.c @@ -21,6 +21,7 @@ */ #include <common.h> +#include <init.h> #include <asm/io.h> #include <asm/arch/clock.h> #include <asm/arch/dram.h> diff --git a/arch/arm/mach-tegra/board.c b/arch/arm/mach-tegra/board.c index 61eaba711a0..31c49a7c849 100644 --- a/arch/arm/mach-tegra/board.c +++ b/arch/arm/mach-tegra/board.c @@ -7,6 +7,7 @@ #include <common.h> #include <cpu_func.h> #include <dm.h> +#include <init.h> #include <ns16550.h> #include <spl.h> #include <asm/io.h> diff --git a/arch/arm/mach-tegra/cboot.c b/arch/arm/mach-tegra/cboot.c index 0762144ecf4..c5361ca73d4 100644 --- a/arch/arm/mach-tegra/cboot.c +++ b/arch/arm/mach-tegra/cboot.c @@ -7,6 +7,7 @@ #include <env.h> #include <fdt_support.h> #include <fdtdec.h> +#include <hang.h> #include <stdlib.h> #include <string.h> diff --git a/arch/arm/mach-tegra/cmd_enterrcm.c b/arch/arm/mach-tegra/cmd_enterrcm.c index 5247e52a5aa..b2252f36219 100644 --- a/arch/arm/mach-tegra/cmd_enterrcm.c +++ b/arch/arm/mach-tegra/cmd_enterrcm.c @@ -25,6 +25,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <irq_func.h> #include <asm/arch/tegra.h> #include <asm/arch-tegra/pmc.h> diff --git a/arch/arm/mach-tegra/pmc.c b/arch/arm/mach-tegra/pmc.c index afd3c54179c..68a211286f9 100644 --- a/arch/arm/mach-tegra/pmc.c +++ b/arch/arm/mach-tegra/pmc.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <linux/arm-smccc.h> diff --git a/arch/arm/mach-tegra/tegra20/crypto.c b/arch/arm/mach-tegra/tegra20/crypto.c index 66fbc3b458c..b91191eba37 100644 --- a/arch/arm/mach-tegra/tegra20/crypto.c +++ b/arch/arm/mach-tegra/tegra20/crypto.c @@ -39,34 +39,35 @@ static void left_shift_vector(u8 *in, u8 *out, int size) /** * Sign a block of data, putting the result into dst. * - * \param key Input AES key, length AES_KEY_LENGTH + * \param key Input AES key, length AES128_KEY_LENGTH * \param key_schedule Expanded key to use * \param src Source data of length 'num_aes_blocks' blocks - * \param dst Destination buffer, length AES_KEY_LENGTH + * \param dst Destination buffer, length AES128_KEY_LENGTH * \param num_aes_blocks Number of AES blocks to encrypt */ static void sign_object(u8 *key, u8 *key_schedule, u8 *src, u8 *dst, u32 num_aes_blocks) { - u8 tmp_data[AES_KEY_LENGTH]; - u8 iv[AES_KEY_LENGTH] = {0}; - u8 left[AES_KEY_LENGTH]; - u8 k1[AES_KEY_LENGTH]; + u8 tmp_data[AES128_KEY_LENGTH]; + u8 iv[AES128_KEY_LENGTH] = {0}; + u8 left[AES128_KEY_LENGTH]; + u8 k1[AES128_KEY_LENGTH]; u8 *cbc_chain_data; unsigned i; cbc_chain_data = zero_key; /* Convenient array of 0's for IV */ /* compute K1 constant needed by AES-CMAC calculation */ - for (i = 0; i < AES_KEY_LENGTH; i++) + for (i = 0; i < AES128_KEY_LENGTH; i++) tmp_data[i] = 0; - aes_cbc_encrypt_blocks(key_schedule, iv, tmp_data, left, 1); + aes_cbc_encrypt_blocks(AES128_KEY_LENGTH, key_schedule, iv, + tmp_data, left, 1); left_shift_vector(left, k1, sizeof(left)); if ((left[0] >> 7) != 0) /* get MSB of L */ - k1[AES_KEY_LENGTH-1] ^= AES_CMAC_CONST_RB; + k1[AES128_KEY_LENGTH - 1] ^= AES_CMAC_CONST_RB; /* compute the AES-CMAC value */ for (i = 0; i < num_aes_blocks; i++) { @@ -78,31 +79,32 @@ static void sign_object(u8 *key, u8 *key_schedule, u8 *src, u8 *dst, aes_apply_cbc_chain_data(tmp_data, k1, tmp_data); /* encrypt the AES block */ - aes_encrypt(tmp_data, key_schedule, dst); + aes_encrypt(AES128_KEY_LENGTH, tmp_data, + key_schedule, dst); debug("sign_obj: block %d of %d\n", i, num_aes_blocks); /* Update pointers for next loop. */ cbc_chain_data = dst; - src += AES_KEY_LENGTH; + src += AES128_KEY_LENGTH; } } /** * Encrypt and sign a block of data (depending on security mode). * - * \param key Input AES key, length AES_KEY_LENGTH + * \param key Input AES key, length AES128_KEY_LENGTH * \param oper Security operations mask to perform (enum security_op) * \param src Source data * \param length Size of source data - * \param sig_dst Destination address for signature, AES_KEY_LENGTH bytes + * \param sig_dst Destination address for signature, AES128_KEY_LENGTH bytes */ static int encrypt_and_sign(u8 *key, enum security_op oper, u8 *src, u32 length, u8 *sig_dst) { u32 num_aes_blocks; - u8 key_schedule[AES_EXPAND_KEY_LENGTH]; - u8 iv[AES_KEY_LENGTH] = {0}; + u8 key_schedule[AES128_EXPAND_KEY_LENGTH]; + u8 iv[AES128_KEY_LENGTH] = {0}; debug("encrypt_and_sign: length = %d\n", length); @@ -110,15 +112,16 @@ static int encrypt_and_sign(u8 *key, enum security_op oper, u8 *src, * The only need for a key is for signing/checksum purposes, so * if not encrypting, expand a key of 0s. */ - aes_expand_key(oper & SECURITY_ENCRYPT ? key : zero_key, key_schedule); + aes_expand_key(oper & SECURITY_ENCRYPT ? key : zero_key, + AES128_KEY_LENGTH, key_schedule); - num_aes_blocks = (length + AES_KEY_LENGTH - 1) / AES_KEY_LENGTH; + num_aes_blocks = (length + AES128_KEY_LENGTH - 1) / AES128_KEY_LENGTH; if (oper & SECURITY_ENCRYPT) { /* Perform this in place, resulting in src being encrypted. */ debug("encrypt_and_sign: begin encryption\n"); - aes_cbc_encrypt_blocks(key_schedule, iv, src, src, - num_aes_blocks); + aes_cbc_encrypt_blocks(AES128_KEY_LENGTH, key_schedule, iv, src, + src, num_aes_blocks); debug("encrypt_and_sign: end encryption\n"); } diff --git a/arch/arm/mach-uniphier/reset.c b/arch/arm/mach-uniphier/reset.c index 31685d00094..92a8b925474 100644 --- a/arch/arm/mach-uniphier/reset.c +++ b/arch/arm/mach-uniphier/reset.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <linux/io.h> #include <asm/secure.h> diff --git a/arch/arm/mach-uniphier/spl_board_init.c b/arch/arm/mach-uniphier/spl_board_init.c index d09c91ab42c..c7262d70a5d 100644 --- a/arch/arm/mach-uniphier/spl_board_init.c +++ b/arch/arm/mach-uniphier/spl_board_init.c @@ -6,6 +6,7 @@ #include <common.h> #include <debug_uart.h> +#include <hang.h> #include <spl.h> #include "init.h" diff --git a/arch/arm/mach-versal/clk.c b/arch/arm/mach-versal/clk.c index b82cea4ccb6..9184714e475 100644 --- a/arch/arm/mach-versal/clk.c +++ b/arch/arm/mach-versal/clk.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <time.h> DECLARE_GLOBAL_DATA_PTR; diff --git a/arch/arm/mach-zynq/spl.c b/arch/arm/mach-zynq/spl.c index 9b7c0be951b..96ba90fb7a7 100644 --- a/arch/arm/mach-zynq/spl.c +++ b/arch/arm/mach-zynq/spl.c @@ -4,6 +4,7 @@ */ #include <common.h> #include <debug_uart.h> +#include <hang.h> #include <spl.h> #include <asm/io.h> diff --git a/arch/arm/mach-zynq/timer.c b/arch/arm/mach-zynq/timer.c index 8658abb4575..211ea15884c 100644 --- a/arch/arm/mach-zynq/timer.c +++ b/arch/arm/mach-zynq/timer.c @@ -31,6 +31,7 @@ #include <common.h> #include <div64.h> #include <dm.h> +#include <time.h> #include <asm/io.h> #include <asm/arch/hardware.h> #include <asm/arch/clk.h> diff --git a/arch/arm/mach-zynqmp-r5/cpu.c b/arch/arm/mach-zynqmp-r5/cpu.c index 98f63e3427e..aa5de863eb6 100644 --- a/arch/arm/mach-zynqmp-r5/cpu.c +++ b/arch/arm/mach-zynqmp-r5/cpu.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <asm/armv7_mpu.h> DECLARE_GLOBAL_DATA_PTR; diff --git a/arch/arm/mach-zynqmp/clk.c b/arch/arm/mach-zynqmp/clk.c index 0593b6310fd..db2b4a8be2e 100644 --- a/arch/arm/mach-zynqmp/clk.c +++ b/arch/arm/mach-zynqmp/clk.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <time.h> #include <asm/arch/clk.h> #include <asm/arch/hardware.h> #include <asm/arch/sys_proto.h> diff --git a/arch/arm/mach-zynqmp/cpu.c b/arch/arm/mach-zynqmp/cpu.c index b90d08bbdd4..442427bc110 100644 --- a/arch/arm/mach-zynqmp/cpu.c +++ b/arch/arm/mach-zynqmp/cpu.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <time.h> #include <asm/arch/hardware.h> #include <asm/arch/sys_proto.h> #include <asm/armv8/mmu.h> diff --git a/arch/m68k/cpu/mcf5227x/speed.c b/arch/m68k/cpu/mcf5227x/speed.c index f4e53bc82bb..207f4534807 100644 --- a/arch/m68k/cpu/mcf5227x/speed.c +++ b/arch/m68k/cpu/mcf5227x/speed.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <asm/processor.h> #include <asm/immap.h> diff --git a/arch/m68k/cpu/mcf5227x/start.S b/arch/m68k/cpu/mcf5227x/start.S index 61f9c6859c5..86c93ba3faf 100644 --- a/arch/m68k/cpu/mcf5227x/start.S +++ b/arch/m68k/cpu/mcf5227x/start.S @@ -386,7 +386,7 @@ _start: /******************************************************************************/ /* - * void relocate_code (addr_sp, gd, addr_moni) + * void relocate_code(addr_sp, gd, addr_moni) * * This "function" does not return, instead it continues in RAM * after relocating the monitor code. diff --git a/arch/m68k/cpu/mcf523x/speed.c b/arch/m68k/cpu/mcf523x/speed.c index a0c1d53e41d..2f65ac23182 100644 --- a/arch/m68k/cpu/mcf523x/speed.c +++ b/arch/m68k/cpu/mcf523x/speed.c @@ -9,6 +9,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <asm/processor.h> #include <asm/immap.h> diff --git a/arch/m68k/cpu/mcf523x/start.S b/arch/m68k/cpu/mcf523x/start.S index f57baa58f5b..8c5a1649552 100644 --- a/arch/m68k/cpu/mcf523x/start.S +++ b/arch/m68k/cpu/mcf523x/start.S @@ -150,7 +150,7 @@ _start: /******************************************************************************/ /* - * void relocate_code (addr_sp, gd, addr_moni) + * void relocate_code(addr_sp, gd, addr_moni) * * This "function" does not return, instead it continues in RAM * after relocating the monitor code. diff --git a/arch/m68k/cpu/mcf52x2/speed.c b/arch/m68k/cpu/mcf52x2/speed.c index 0f274adf451..02ef5d87aa7 100644 --- a/arch/m68k/cpu/mcf52x2/speed.c +++ b/arch/m68k/cpu/mcf52x2/speed.c @@ -8,6 +8,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <asm/processor.h> #include <asm/immap.h> #include <asm/io.h> @@ -15,7 +16,7 @@ DECLARE_GLOBAL_DATA_PTR; /* get_clocks() fills in gd->cpu_clock and gd->bus_clk */ -int get_clocks (void) +int get_clocks(void) { #if defined(CONFIG_M5208) pll_t *pll = (pll_t *) MMAP_PLL; diff --git a/arch/m68k/cpu/mcf52x2/start.S b/arch/m68k/cpu/mcf52x2/start.S index f7f124dd2fc..747a518f6cd 100644 --- a/arch/m68k/cpu/mcf52x2/start.S +++ b/arch/m68k/cpu/mcf52x2/start.S @@ -229,7 +229,7 @@ _after_flashbar_copy: /******************************************************************************/ /* - * void relocate_code (addr_sp, gd, addr_moni) + * void relocate_code(addr_sp, gd, addr_moni) * * This "function" does not return, instead it continues in RAM * after relocating the monitor code. diff --git a/arch/m68k/cpu/mcf530x/speed.c b/arch/m68k/cpu/mcf530x/speed.c index ae260477807..cf53dfeb150 100644 --- a/arch/m68k/cpu/mcf530x/speed.c +++ b/arch/m68k/cpu/mcf530x/speed.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <asm/processor.h> #include <asm/immap.h> diff --git a/arch/m68k/cpu/mcf530x/start.S b/arch/m68k/cpu/mcf530x/start.S index eb4b33899f6..32356d875ec 100644 --- a/arch/m68k/cpu/mcf530x/start.S +++ b/arch/m68k/cpu/mcf530x/start.S @@ -155,7 +155,7 @@ _start: /******************************************************************************/ /* - * void relocate_code (addr_sp, gd, addr_moni) + * void relocate_code(addr_sp, gd, addr_moni) * * This "function" does not return, instead it continues in RAM * after relocating the monitor code. diff --git a/arch/m68k/cpu/mcf532x/speed.c b/arch/m68k/cpu/mcf532x/speed.c index 661abfa8877..0f54ea4b6a8 100644 --- a/arch/m68k/cpu/mcf532x/speed.c +++ b/arch/m68k/cpu/mcf532x/speed.c @@ -9,6 +9,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <asm/processor.h> #include <asm/immap.h> diff --git a/arch/m68k/cpu/mcf532x/start.S b/arch/m68k/cpu/mcf532x/start.S index 4411e5fe28c..e2d7c72ceec 100644 --- a/arch/m68k/cpu/mcf532x/start.S +++ b/arch/m68k/cpu/mcf532x/start.S @@ -165,7 +165,7 @@ _start: /******************************************************************************/ /* - * void relocate_code (addr_sp, gd, addr_moni) + * void relocate_code(addr_sp, gd, addr_moni) * * This "function" does not return, instead it continues in RAM * after relocating the monitor code. diff --git a/arch/m68k/cpu/mcf5445x/speed.c b/arch/m68k/cpu/mcf5445x/speed.c index e15e32ebde6..eaa3b39bec6 100644 --- a/arch/m68k/cpu/mcf5445x/speed.c +++ b/arch/m68k/cpu/mcf5445x/speed.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <asm/processor.h> #include <asm/immap.h> diff --git a/arch/m68k/cpu/mcf5445x/start.S b/arch/m68k/cpu/mcf5445x/start.S index db30b26c348..80eb287151e 100644 --- a/arch/m68k/cpu/mcf5445x/start.S +++ b/arch/m68k/cpu/mcf5445x/start.S @@ -514,7 +514,7 @@ _start: /******************************************************************************/ /* - * void relocate_code (addr_sp, gd, addr_moni) + * void relocate_code(addr_sp, gd, addr_moni) * * This "function" does not return, instead it continues in RAM * after relocating the monitor code. diff --git a/arch/m68k/cpu/mcf547x_8x/speed.c b/arch/m68k/cpu/mcf547x_8x/speed.c index 5ba6426c454..bc22560ed2c 100644 --- a/arch/m68k/cpu/mcf547x_8x/speed.c +++ b/arch/m68k/cpu/mcf547x_8x/speed.c @@ -9,6 +9,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <asm/processor.h> #include <asm/immap.h> diff --git a/arch/m68k/cpu/mcf547x_8x/start.S b/arch/m68k/cpu/mcf547x_8x/start.S index 4dd57bf39c4..b70842b2b83 100644 --- a/arch/m68k/cpu/mcf547x_8x/start.S +++ b/arch/m68k/cpu/mcf547x_8x/start.S @@ -155,7 +155,7 @@ _start: /******************************************************************************/ /* - * void relocate_code (addr_sp, gd, addr_moni) + * void relocate_code(addr_sp, gd, addr_moni) * * This "function" does not return, instead it continues in RAM * after relocating the monitor code. diff --git a/arch/microblaze/cpu/exception.c b/arch/microblaze/cpu/exception.c index bdcbe086859..b8dedc4e195 100644 --- a/arch/microblaze/cpu/exception.c +++ b/arch/microblaze/cpu/exception.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <hang.h> #include <asm/asm.h> void _hw_exception_handler (void) diff --git a/arch/microblaze/lib/bootm.c b/arch/microblaze/lib/bootm.c index efd5acf3592..2d6a41be2fd 100644 --- a/arch/microblaze/lib/bootm.c +++ b/arch/microblaze/lib/bootm.c @@ -12,6 +12,7 @@ #include <cpu_func.h> #include <env.h> #include <fdt_support.h> +#include <hang.h> #include <image.h> #include <u-boot/zlib.h> #include <asm/byteorder.h> diff --git a/arch/mips/cpu/time.c b/arch/mips/cpu/time.c index af324f77cef..a1508e3b886 100644 --- a/arch/mips/cpu/time.c +++ b/arch/mips/cpu/time.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <time.h> #include <asm/mipsregs.h> unsigned long notrace timer_read_counter(void) diff --git a/arch/mips/lib/reloc.c b/arch/mips/lib/reloc.c index e68f49467c9..1e3cfadd2d7 100644 --- a/arch/mips/lib/reloc.c +++ b/arch/mips/lib/reloc.c @@ -28,6 +28,7 @@ #include <common.h> #include <cpu_func.h> +#include <init.h> #include <asm/relocs.h> #include <asm/sections.h> diff --git a/arch/mips/lib/traps.c b/arch/mips/lib/traps.c index 6fe8ebd16ba..b8568c00fed 100644 --- a/arch/mips/lib/traps.c +++ b/arch/mips/lib/traps.c @@ -12,6 +12,7 @@ #include <common.h> #include <cpu_func.h> +#include <hang.h> #include <init.h> #include <asm/mipsregs.h> #include <asm/addrspace.h> diff --git a/arch/mips/mach-ath79/ar933x/clk.c b/arch/mips/mach-ath79/ar933x/clk.c index 7c15c215329..3feb25ce71d 100644 --- a/arch/mips/mach-ath79/ar933x/clk.c +++ b/arch/mips/mach-ath79/ar933x/clk.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <asm/io.h> #include <asm/addrspace.h> #include <asm/types.h> diff --git a/arch/mips/mach-ath79/ar934x/clk.c b/arch/mips/mach-ath79/ar934x/clk.c index a5dace7a99b..09bdc253ae2 100644 --- a/arch/mips/mach-ath79/ar934x/clk.c +++ b/arch/mips/mach-ath79/ar934x/clk.c @@ -4,6 +4,8 @@ */ #include <common.h> +#include <clock_legacy.h> +#include <hang.h> #include <asm/io.h> #include <asm/addrspace.h> #include <asm/types.h> diff --git a/arch/mips/mach-ath79/dram.c b/arch/mips/mach-ath79/dram.c index 138a7f84832..1abe2a49e66 100644 --- a/arch/mips/mach-ath79/dram.c +++ b/arch/mips/mach-ath79/dram.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <init.h> #include <linux/sizes.h> #include <asm/addrspace.h> #include <mach/ddr.h> diff --git a/arch/mips/mach-ath79/qca953x/clk.c b/arch/mips/mach-ath79/qca953x/clk.c index 7447adef47e..d450ad86523 100644 --- a/arch/mips/mach-ath79/qca953x/clk.c +++ b/arch/mips/mach-ath79/qca953x/clk.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <asm/io.h> #include <asm/addrspace.h> #include <asm/types.h> diff --git a/arch/mips/mach-ath79/qca956x/clk.c b/arch/mips/mach-ath79/qca956x/clk.c index 33a44cfff48..d71c94e1718 100644 --- a/arch/mips/mach-ath79/qca956x/clk.c +++ b/arch/mips/mach-ath79/qca956x/clk.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <asm/io.h> #include <asm/addrspace.h> #include <asm/types.h> diff --git a/arch/mips/mach-jz47xx/jz4780/jz4780.c b/arch/mips/mach-jz47xx/jz4780/jz4780.c index 0ae5e09e019..015840de256 100644 --- a/arch/mips/mach-jz47xx/jz4780/jz4780.c +++ b/arch/mips/mach-jz47xx/jz4780/jz4780.c @@ -9,6 +9,7 @@ #include <config.h> #include <common.h> #include <cpu_func.h> +#include <hang.h> #include <init.h> #include <asm/io.h> #include <asm/sections.h> diff --git a/arch/mips/mach-jz47xx/jz4780/sdram.c b/arch/mips/mach-jz47xx/jz4780/sdram.c index 5b25c8d0021..65afefe53e1 100644 --- a/arch/mips/mach-jz47xx/jz4780/sdram.c +++ b/arch/mips/mach-jz47xx/jz4780/sdram.c @@ -10,6 +10,7 @@ */ #include <common.h> +#include <hang.h> #include <asm/io.h> #include <mach/jz4780.h> #include <mach/jz4780_dram.h> diff --git a/arch/mips/mach-mtmips/cpu.c b/arch/mips/mach-mtmips/cpu.c index 7afc2c5940d..cee3c0cb0a6 100644 --- a/arch/mips/mach-mtmips/cpu.c +++ b/arch/mips/mach-mtmips/cpu.c @@ -5,6 +5,7 @@ #include <common.h> #include <dm.h> +#include <init.h> #include <ram.h> #include <wdt.h> #include <asm/io.h> diff --git a/arch/nds32/cpu/n1213/start.S b/arch/nds32/cpu/n1213/start.S index 691888157fb..386c1998dce 100644 --- a/arch/nds32/cpu/n1213/start.S +++ b/arch/nds32/cpu/n1213/start.S @@ -223,7 +223,7 @@ call_board_init_f: j board_init_f ! jump to board_init_f() in lib/board.c /* - * void relocate_code (addr_sp, gd, addr_moni) + * void relocate_code(addr_sp, gd, addr_moni) * * This "function" does not return, instead it continues in RAM * after relocating the monitor code. diff --git a/arch/nds32/lib/bootm.c b/arch/nds32/lib/bootm.c index a472f6a1873..1003bc87b9d 100644 --- a/arch/nds32/lib/bootm.c +++ b/arch/nds32/lib/bootm.c @@ -8,6 +8,7 @@ #include <common.h> #include <command.h> #include <env.h> +#include <hang.h> #include <image.h> #include <u-boot/zlib.h> #include <asm/byteorder.h> diff --git a/arch/nds32/lib/interrupts.c b/arch/nds32/lib/interrupts.c index 88cc7b98d85..1481e055007 100644 --- a/arch/nds32/lib/interrupts.c +++ b/arch/nds32/lib/interrupts.c @@ -10,6 +10,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <irq_func.h> #include <asm/ptrace.h> #include <asm/system.h> diff --git a/arch/nios2/cpu/start.S b/arch/nios2/cpu/start.S index 2900200dbb9..f5ad184e8d0 100644 --- a/arch/nios2/cpu/start.S +++ b/arch/nios2/cpu/start.S @@ -147,7 +147,7 @@ _reloc: * We'll call the board_init_r from here since this isn't * supposed to return. * - * void relocate_code (ulong sp, gd_t *global_data, + * void relocate_code(ulong sp, gd_t *global_data, * ulong reloc_addr) * __attribute__ ((noreturn)); */ diff --git a/arch/nios2/cpu/traps.c b/arch/nios2/cpu/traps.c index 1c3cc03178c..087a05097d9 100644 --- a/arch/nios2/cpu/traps.c +++ b/arch/nios2/cpu/traps.c @@ -4,8 +4,9 @@ * Scott McNutt <smcnutt@psyent.com> */ -#include <asm/ptrace.h> #include <common.h> +#include <hang.h> +#include <asm/ptrace.h> void trap_handler (struct pt_regs *regs) { @@ -21,5 +22,5 @@ void soft_emulation (struct pt_regs *regs) */ printf ("\n\n*** ERROR: unimplemented instruction @ %08x\n", regs->reg[29] - 4); - hang (); + hang(); } diff --git a/arch/powerpc/cpu/mpc83xx/cpu.c b/arch/powerpc/cpu/mpc83xx/cpu.c index c3e25978a80..f4e25f1f59c 100644 --- a/arch/powerpc/cpu/mpc83xx/cpu.c +++ b/arch/powerpc/cpu/mpc83xx/cpu.c @@ -12,6 +12,7 @@ #include <common.h> #include <cpu_func.h> #include <irq_func.h> +#include <time.h> #include <vsprintf.h> #include <watchdog.h> #include <command.h> diff --git a/arch/powerpc/cpu/mpc83xx/fdt.c b/arch/powerpc/cpu/mpc83xx/fdt.c index b487e31cc0f..5c685353e16 100644 --- a/arch/powerpc/cpu/mpc83xx/fdt.c +++ b/arch/powerpc/cpu/mpc83xx/fdt.c @@ -7,6 +7,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <linux/libfdt.h> #include <fdt_support.h> #include <asm/processor.h> diff --git a/arch/powerpc/cpu/mpc83xx/spd_sdram.c b/arch/powerpc/cpu/mpc83xx/spd_sdram.c index a14a438b02d..22506a5be50 100644 --- a/arch/powerpc/cpu/mpc83xx/spd_sdram.c +++ b/arch/powerpc/cpu/mpc83xx/spd_sdram.c @@ -14,6 +14,7 @@ #include <common.h> #include <cpu_func.h> +#include <time.h> #include <vsprintf.h> #include <asm/processor.h> #include <asm/io.h> diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c index 93af7f495fd..e2fc0b1e8a2 100644 --- a/arch/powerpc/cpu/mpc83xx/speed.c +++ b/arch/powerpc/cpu/mpc83xx/speed.c @@ -9,6 +9,7 @@ #ifndef CONFIG_CLK_MPC83XX #include <common.h> +#include <clock_legacy.h> #include <mpc83xx.h> #include <command.h> #include <vsprintf.h> diff --git a/arch/powerpc/cpu/mpc83xx/spl_minimal.c b/arch/powerpc/cpu/mpc83xx/spl_minimal.c index 133f7abc31a..34c81872591 100644 --- a/arch/powerpc/cpu/mpc83xx/spl_minimal.c +++ b/arch/powerpc/cpu/mpc83xx/spl_minimal.c @@ -4,7 +4,9 @@ */ #include <common.h> +#include <clock_legacy.h> #include <mpc83xx.h> +#include <time.h> #include "lblaw/lblaw.h" #include "elbc/elbc.h" diff --git a/arch/powerpc/cpu/mpc83xx/start.S b/arch/powerpc/cpu/mpc83xx/start.S index f4a8a766c33..9da22ce486a 100644 --- a/arch/powerpc/cpu/mpc83xx/start.S +++ b/arch/powerpc/cpu/mpc83xx/start.S @@ -804,7 +804,7 @@ flush_dcache: /*-------------------------------------------------------------------*/ /* - * void relocate_code (addr_sp, gd, addr_moni) + * void relocate_code(addr_sp, gd, addr_moni) * * This "function" does not return, instead it continues in RAM * after relocating the monitor code. diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c b/arch/powerpc/cpu/mpc85xx/cpu.c index 18556629c3d..9f9eed165bc 100644 --- a/arch/powerpc/cpu/mpc85xx/cpu.c +++ b/arch/powerpc/cpu/mpc85xx/cpu.c @@ -12,6 +12,7 @@ #include <common.h> #include <cpu_func.h> #include <irq_func.h> +#include <time.h> #include <vsprintf.h> #include <watchdog.h> #include <command.h> @@ -332,7 +333,7 @@ int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) #ifndef CONFIG_SYS_FSL_TBCLK_DIV #define CONFIG_SYS_FSL_TBCLK_DIV 8 #endif -__weak unsigned long get_tbclk (void) +__weak unsigned long get_tbclk(void) { unsigned long tbclk_div = CONFIG_SYS_FSL_TBCLK_DIV; diff --git a/arch/powerpc/cpu/mpc85xx/fdt.c b/arch/powerpc/cpu/mpc85xx/fdt.c index db12aefb290..65f909fd1e5 100644 --- a/arch/powerpc/cpu/mpc85xx/fdt.c +++ b/arch/powerpc/cpu/mpc85xx/fdt.c @@ -7,7 +7,9 @@ */ #include <common.h> +#include <clock_legacy.h> #include <env.h> +#include <time.h> #include <linux/libfdt.h> #include <fdt_support.h> #include <asm/processor.h> diff --git a/arch/powerpc/cpu/mpc85xx/interrupts.c b/arch/powerpc/cpu/mpc85xx/interrupts.c index e767573193f..6f539d26776 100644 --- a/arch/powerpc/cpu/mpc85xx/interrupts.c +++ b/arch/powerpc/cpu/mpc85xx/interrupts.c @@ -12,6 +12,7 @@ #include <common.h> #include <irq_func.h> +#include <time.h> #include <watchdog.h> #include <command.h> #include <asm/processor.h> diff --git a/arch/powerpc/cpu/mpc85xx/speed.c b/arch/powerpc/cpu/mpc85xx/speed.c index 0c5252edc27..773ae08dd3b 100644 --- a/arch/powerpc/cpu/mpc85xx/speed.c +++ b/arch/powerpc/cpu/mpc85xx/speed.c @@ -574,8 +574,7 @@ void get_sys_info(sys_info_t *sys_info) #endif } - -int get_clocks (void) +int get_clocks(void) { sys_info_t sys_info; #ifdef CONFIG_ARCH_MPC8544 @@ -653,7 +652,7 @@ int get_clocks (void) * get_bus_freq * return system bus freq in Hz *********************************************/ -ulong get_bus_freq (ulong dummy) +ulong get_bus_freq(ulong dummy) { return gd->bus_clk; } diff --git a/arch/powerpc/cpu/mpc85xx/start.S b/arch/powerpc/cpu/mpc85xx/start.S index 38e907f5ad5..dd784e7e30b 100644 --- a/arch/powerpc/cpu/mpc85xx/start.S +++ b/arch/powerpc/cpu/mpc85xx/start.S @@ -1549,7 +1549,7 @@ write_tlb: blr /* - * void relocate_code (addr_sp, gd, addr_moni) + * void relocate_code(addr_sp, gd, addr_moni) * * This "function" does not return, instead it continues in RAM * after relocating the monitor code. diff --git a/arch/powerpc/cpu/mpc85xx/traps.c b/arch/powerpc/cpu/mpc85xx/traps.c index 804788d0507..bc2fc93e110 100644 --- a/arch/powerpc/cpu/mpc85xx/traps.c +++ b/arch/powerpc/cpu/mpc85xx/traps.c @@ -21,6 +21,7 @@ #include <common.h> #include <command.h> +#include <init.h> #include <irq_func.h> #include <kgdb.h> #include <asm/processor.h> diff --git a/arch/powerpc/cpu/mpc86xx/cpu.c b/arch/powerpc/cpu/mpc86xx/cpu.c index bb14444a2e7..97b93f02131 100644 --- a/arch/powerpc/cpu/mpc86xx/cpu.c +++ b/arch/powerpc/cpu/mpc86xx/cpu.c @@ -7,6 +7,7 @@ #include <common.h> #include <cpu_func.h> +#include <time.h> #include <vsprintf.h> #include <watchdog.h> #include <command.h> diff --git a/arch/powerpc/cpu/mpc86xx/interrupts.c b/arch/powerpc/cpu/mpc86xx/interrupts.c index 0f930fcd9e1..eb8e73e41c6 100644 --- a/arch/powerpc/cpu/mpc86xx/interrupts.c +++ b/arch/powerpc/cpu/mpc86xx/interrupts.c @@ -18,6 +18,7 @@ #include <irq_func.h> #include <mpc86xx.h> #include <command.h> +#include <time.h> #include <asm/processor.h> #ifdef CONFIG_POST #include <post.h> diff --git a/arch/powerpc/cpu/mpc86xx/speed.c b/arch/powerpc/cpu/mpc86xx/speed.c index 434c4f3f43b..50014458622 100644 --- a/arch/powerpc/cpu/mpc86xx/speed.c +++ b/arch/powerpc/cpu/mpc86xx/speed.c @@ -9,6 +9,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <mpc86xx.h> #include <asm/processor.h> #include <asm/io.h> diff --git a/arch/powerpc/cpu/mpc86xx/start.S b/arch/powerpc/cpu/mpc86xx/start.S index 59213c2dfe3..f4651ce8d46 100644 --- a/arch/powerpc/cpu/mpc86xx/start.S +++ b/arch/powerpc/cpu/mpc86xx/start.S @@ -636,7 +636,7 @@ in32r: blr /* - * void relocate_code (addr_sp, gd, addr_moni) + * void relocate_code(addr_sp, gd, addr_moni) * * This "function" does not return, instead it continues in RAM * after relocating the monitor code. diff --git a/arch/powerpc/cpu/mpc86xx/traps.c b/arch/powerpc/cpu/mpc86xx/traps.c index 1820187d1d0..79bab913676 100644 --- a/arch/powerpc/cpu/mpc86xx/traps.c +++ b/arch/powerpc/cpu/mpc86xx/traps.c @@ -15,6 +15,7 @@ #include <common.h> #include <command.h> +#include <init.h> #include <kgdb.h> #include <asm/processor.h> diff --git a/arch/powerpc/cpu/mpc8xx/cpu.c b/arch/powerpc/cpu/mpc8xx/cpu.c index 0604433e726..4a1698d3bca 100644 --- a/arch/powerpc/cpu/mpc8xx/cpu.c +++ b/arch/powerpc/cpu/mpc8xx/cpu.c @@ -18,6 +18,7 @@ #include <common.h> #include <cpu_func.h> +#include <time.h> #include <vsprintf.h> #include <watchdog.h> #include <command.h> diff --git a/arch/powerpc/cpu/mpc8xx/fdt.c b/arch/powerpc/cpu/mpc8xx/fdt.c index 55c6588249c..4719de4d72c 100644 --- a/arch/powerpc/cpu/mpc8xx/fdt.c +++ b/arch/powerpc/cpu/mpc8xx/fdt.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <time.h> #include <linux/libfdt.h> #include <fdt_support.h> diff --git a/arch/powerpc/cpu/mpc8xx/interrupts.c b/arch/powerpc/cpu/mpc8xx/interrupts.c index 6ee6088fa8a..3efe8956ec5 100644 --- a/arch/powerpc/cpu/mpc8xx/interrupts.c +++ b/arch/powerpc/cpu/mpc8xx/interrupts.c @@ -8,6 +8,7 @@ #include <irq_func.h> #include <mpc8xx.h> #include <mpc8xx_irq.h> +#include <time.h> #include <asm/cpm_8xx.h> #include <asm/processor.h> #include <asm/io.h> diff --git a/arch/powerpc/cpu/mpc8xx/speed.c b/arch/powerpc/cpu/mpc8xx/speed.c index 5a8fc1f200d..77d4f8e47f7 100644 --- a/arch/powerpc/cpu/mpc8xx/speed.c +++ b/arch/powerpc/cpu/mpc8xx/speed.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <mpc8xx.h> #include <asm/processor.h> #include <asm/io.h> diff --git a/arch/powerpc/cpu/mpc8xx/start.S b/arch/powerpc/cpu/mpc8xx/start.S index b8bdaaec2fa..ed735cdee00 100644 --- a/arch/powerpc/cpu/mpc8xx/start.S +++ b/arch/powerpc/cpu/mpc8xx/start.S @@ -322,7 +322,7 @@ int_return: /*------------------------------------------------------------------------------*/ /* - * void relocate_code (addr_sp, gd, addr_moni) + * void relocate_code(addr_sp, gd, addr_moni) * * This "function" does not return, instead it continues in RAM * after relocating the monitor code. diff --git a/arch/powerpc/cpu/mpc8xxx/fsl_lbc.c b/arch/powerpc/cpu/mpc8xxx/fsl_lbc.c index c43732f7c5c..afcb75ba17a 100644 --- a/arch/powerpc/cpu/mpc8xxx/fsl_lbc.c +++ b/arch/powerpc/cpu/mpc8xxx/fsl_lbc.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <hang.h> #include <asm/fsl_lbc.h> #ifdef CONFIG_MPC83xx diff --git a/arch/powerpc/include/asm/ppc.h b/arch/powerpc/include/asm/ppc.h index 5765f6b5223..055364c58fd 100644 --- a/arch/powerpc/include/asm/ppc.h +++ b/arch/powerpc/include/asm/ppc.h @@ -121,6 +121,7 @@ void print_reginfo(void); void interrupt_init_cpu(unsigned *); void timer_interrupt_cpu(struct pt_regs *); unsigned long search_exception_table(unsigned long addr); +void upmconfig(uint upm, uint *table, uint size); #endif /* !__ASSEMBLY__ */ diff --git a/arch/powerpc/lib/bootm.c b/arch/powerpc/lib/bootm.c index f2e670eb6bf..390e8c0673c 100644 --- a/arch/powerpc/lib/bootm.c +++ b/arch/powerpc/lib/bootm.c @@ -10,6 +10,7 @@ #include <common.h> #include <cpu_func.h> #include <env.h> +#include <init.h> #include <watchdog.h> #include <command.h> #include <image.h> diff --git a/arch/riscv/cpu/start.S b/arch/riscv/cpu/start.S index 1a55b7d5709..f3dccdbe4c5 100644 --- a/arch/riscv/cpu/start.S +++ b/arch/riscv/cpu/start.S @@ -217,7 +217,7 @@ spl_call_board_init_r: #endif /* - * void relocate_code (addr_sp, gd, addr_moni) + * void relocate_code(addr_sp, gd, addr_moni) * * This "function" does not return, instead it continues in RAM * after relocating the monitor code. diff --git a/arch/riscv/lib/bootm.c b/arch/riscv/lib/bootm.c index e96137a50cb..fad16901c5f 100644 --- a/arch/riscv/lib/bootm.c +++ b/arch/riscv/lib/bootm.c @@ -9,6 +9,8 @@ #include <common.h> #include <command.h> #include <dm.h> +#include <fdt_support.h> +#include <hang.h> #include <dm/root.h> #include <image.h> #include <asm/byteorder.h> diff --git a/arch/riscv/lib/interrupts.c b/arch/riscv/lib/interrupts.c index 3b25c5b7a75..512dce06196 100644 --- a/arch/riscv/lib/interrupts.c +++ b/arch/riscv/lib/interrupts.c @@ -8,6 +8,7 @@ */ #include <common.h> +#include <hang.h> #include <irq_func.h> #include <asm/ptrace.h> #include <asm/system.h> diff --git a/arch/riscv/lib/reset.c b/arch/riscv/lib/reset.c index b8cecb309dc..ce3c1cf872b 100644 --- a/arch/riscv/lib/reset.c +++ b/arch/riscv/lib/reset.c @@ -5,6 +5,7 @@ #include <common.h> #include <command.h> +#include <hang.h> int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { diff --git a/arch/riscv/lib/spl.c b/arch/riscv/lib/spl.c index dc7577f7516..ae07bbe40a7 100644 --- a/arch/riscv/lib/spl.c +++ b/arch/riscv/lib/spl.c @@ -5,6 +5,7 @@ */ #include <common.h> #include <cpu_func.h> +#include <hang.h> #include <spl.h> #include <asm/smp.h> diff --git a/arch/sandbox/cpu/spl.c b/arch/sandbox/cpu/spl.c index 44c68a39bc6..d5f683bbaae 100644 --- a/arch/sandbox/cpu/spl.c +++ b/arch/sandbox/cpu/spl.c @@ -5,6 +5,7 @@ #include <common.h> #include <dm.h> +#include <hang.h> #include <os.h> #include <spl.h> #include <asm/spl.h> diff --git a/arch/sh/cpu/sh4/cpu.c b/arch/sh/cpu/sh4/cpu.c index f1b8df9b0b2..a8d0590d51e 100644 --- a/arch/sh/cpu/sh4/cpu.c +++ b/arch/sh/cpu/sh4/cpu.c @@ -31,7 +31,7 @@ int cleanup_before_linux (void) int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { disable_interrupts(); - reset_cpu (0); + reset_cpu(0); return 0; } diff --git a/arch/sh/cpu/sh4/watchdog.c b/arch/sh/cpu/sh4/watchdog.c index 7c157bc035d..1de32cd419f 100644 --- a/arch/sh/cpu/sh4/watchdog.c +++ b/arch/sh/cpu/sh4/watchdog.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0+ #include <common.h> +#include <cpu_func.h> #include <asm/processor.h> #include <asm/system.h> #include <asm/io.h> diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c index 533fcf8906e..a6a8f07e6f2 100644 --- a/arch/sh/lib/board.c +++ b/arch/sh/lib/board.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <init.h> DECLARE_GLOBAL_DATA_PTR; diff --git a/arch/x86/cpu/baytrail/cpu.c b/arch/x86/cpu/baytrail/cpu.c index 9394eab956b..a9cfcedd81c 100644 --- a/arch/x86/cpu/baytrail/cpu.c +++ b/arch/x86/cpu/baytrail/cpu.c @@ -8,6 +8,7 @@ #include <common.h> #include <cpu.h> #include <dm.h> +#include <init.h> #include <pci.h> #include <asm/cpu.h> #include <asm/cpu_x86.h> diff --git a/arch/x86/cpu/baytrail/valleyview.c b/arch/x86/cpu/baytrail/valleyview.c index 8882a76eae5..f2e48f401fe 100644 --- a/arch/x86/cpu/baytrail/valleyview.c +++ b/arch/x86/cpu/baytrail/valleyview.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <init.h> #include <mmc.h> #include <pci_ids.h> #include <asm/irq.h> diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c index d626e38fd18..dae06949cc6 100644 --- a/arch/x86/cpu/cpu.c +++ b/arch/x86/cpu/cpu.c @@ -24,6 +24,7 @@ #include <cpu_func.h> #include <dm.h> #include <errno.h> +#include <init.h> #include <malloc.h> #include <syscon.h> #include <asm/acpi.h> diff --git a/arch/x86/cpu/i386/cpu.c b/arch/x86/cpu/i386/cpu.c index 2b27617ca3a..1592b2c9d3b 100644 --- a/arch/x86/cpu/i386/cpu.c +++ b/arch/x86/cpu/i386/cpu.c @@ -20,6 +20,7 @@ #include <common.h> #include <cpu_func.h> +#include <init.h> #include <malloc.h> #include <spl.h> #include <asm/control_regs.h> diff --git a/arch/x86/cpu/i386/interrupt.c b/arch/x86/cpu/i386/interrupt.c index 78aa51a3ea6..70edbe06e4c 100644 --- a/arch/x86/cpu/i386/interrupt.c +++ b/arch/x86/cpu/i386/interrupt.c @@ -13,6 +13,8 @@ #include <common.h> #include <dm.h> #include <efi_loader.h> +#include <hang.h> +#include <init.h> #include <irq_func.h> #include <asm/control_regs.h> #include <asm/i8259.h> diff --git a/arch/x86/cpu/quark/mrc_util.c b/arch/x86/cpu/quark/mrc_util.c index 8a68ddba973..b0bc59b71ef 100644 --- a/arch/x86/cpu/quark/mrc_util.c +++ b/arch/x86/cpu/quark/mrc_util.c @@ -8,6 +8,7 @@ */ #include <common.h> +#include <hang.h> #include <asm/arch/device.h> #include <asm/arch/mrc.h> #include <asm/arch/msg_port.h> diff --git a/arch/x86/cpu/tangier/sdram.c b/arch/x86/cpu/tangier/sdram.c index b47d896e202..8c7e1c10c2b 100644 --- a/arch/x86/cpu/tangier/sdram.c +++ b/arch/x86/cpu/tangier/sdram.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <init.h> #include <asm/e820.h> #include <asm/global_data.h> #include <asm/sfi.h> diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c index 5443a862ab5..07d8f1f279c 100644 --- a/arch/x86/lib/bootm.c +++ b/arch/x86/lib/bootm.c @@ -9,6 +9,7 @@ #include <common.h> #include <command.h> +#include <hang.h> #include <dm/device.h> #include <dm/root.h> #include <errno.h> diff --git a/arch/x86/lib/spl.c b/arch/x86/lib/spl.c index f0e2bf053d7..90baec2a175 100644 --- a/arch/x86/lib/spl.c +++ b/arch/x86/lib/spl.c @@ -7,6 +7,7 @@ #include <cpu_func.h> #include <debug_uart.h> #include <dm.h> +#include <hang.h> #include <irq_func.h> #include <malloc.h> #include <spl.h> diff --git a/arch/x86/lib/tpl.c b/arch/x86/lib/tpl.c index 784e3a02def..34804b53cca 100644 --- a/arch/x86/lib/tpl.c +++ b/arch/x86/lib/tpl.c @@ -6,6 +6,7 @@ #include <common.h> #include <debug_uart.h> #include <dm.h> +#include <hang.h> #include <spl.h> #include <asm/cpu.h> #include <asm/mtrr.h> diff --git a/arch/xtensa/cpu/start.S b/arch/xtensa/cpu/start.S index 38d2fa2fe13..580df65ea78 100644 --- a/arch/xtensa/cpu/start.S +++ b/arch/xtensa/cpu/start.S @@ -273,7 +273,7 @@ _start: ill /* - * void relocate_code (addr_sp, gd, addr_moni) + * void relocate_code(addr_sp, gd, addr_moni) * * This "function" does not return, instead it continues in RAM * after relocating the monitor code. diff --git a/board/AndesTech/adp-ae3xx/adp-ae3xx.c b/board/AndesTech/adp-ae3xx/adp-ae3xx.c index db08d86de50..a04415decaf 100644 --- a/board/AndesTech/adp-ae3xx/adp-ae3xx.c +++ b/board/AndesTech/adp-ae3xx/adp-ae3xx.c @@ -5,6 +5,7 @@ * Macpaul Lin, Andes Technology Corporation <macpaul@andestech.com> */ +#include <init.h> #include <asm/mach-types.h> #include <common.h> #if defined(CONFIG_FTMAC100) && !defined(CONFIG_DM_ETH) diff --git a/board/AndesTech/adp-ag101p/adp-ag101p.c b/board/AndesTech/adp-ag101p/adp-ag101p.c index 657921e7411..faf39b4ba6a 100644 --- a/board/AndesTech/adp-ag101p/adp-ag101p.c +++ b/board/AndesTech/adp-ag101p/adp-ag101p.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <init.h> #if defined(CONFIG_FTMAC100) && !defined(CONFIG_DM_ETH) #include <netdev.h> #endif diff --git a/board/AndesTech/ax25-ae350/ax25-ae350.c b/board/AndesTech/ax25-ae350/ax25-ae350.c index 47e69293650..f164073000c 100644 --- a/board/AndesTech/ax25-ae350/ax25-ae350.c +++ b/board/AndesTech/ax25-ae350/ax25-ae350.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <init.h> #if defined(CONFIG_FTMAC100) && !defined(CONFIG_DM_ETH) #include <netdev.h> #endif diff --git a/board/Arcturus/ucp1020/spl.c b/board/Arcturus/ucp1020/spl.c index 9314fabdf2d..6a17aeb78ec 100644 --- a/board/Arcturus/ucp1020/spl.c +++ b/board/Arcturus/ucp1020/spl.c @@ -8,9 +8,11 @@ */ #include <common.h> +#include <clock_legacy.h> #include <console.h> #include <env.h> #include <env_internal.h> +#include <init.h> #include <ns16550.h> #include <malloc.h> #include <mmc.h> diff --git a/board/Arcturus/ucp1020/spl_minimal.c b/board/Arcturus/ucp1020/spl_minimal.c index 1c4134d8275..cd0022a73e1 100644 --- a/board/Arcturus/ucp1020/spl_minimal.c +++ b/board/Arcturus/ucp1020/spl_minimal.c @@ -8,6 +8,7 @@ */ #include <common.h> +#include <init.h> #include <ns16550.h> #include <asm/io.h> #include <nand.h> diff --git a/board/BuR/brppt2/board.c b/board/BuR/brppt2/board.c index 3284ff09366..c91d2f9494d 100644 --- a/board/BuR/brppt2/board.c +++ b/board/BuR/brppt2/board.c @@ -7,6 +7,8 @@ * */ #include <common.h> +#include <cpu_func.h> +#include <hang.h> #include <spl.h> #include <dm.h> #include <miiphy.h> diff --git a/board/BuS/eb_cpu5282/eb_cpu5282.c b/board/BuS/eb_cpu5282/eb_cpu5282.c index 0b916d2482c..a667413bfc8 100644 --- a/board/BuS/eb_cpu5282/eb_cpu5282.c +++ b/board/BuS/eb_cpu5282/eb_cpu5282.c @@ -12,6 +12,7 @@ #include "asm/m5282.h" #include <bmp_layout.h> #include <env.h> +#include <init.h> #include <status_led.h> #include <bus_vcxk.h> @@ -98,7 +99,7 @@ int dram_init(void) } #if defined(CONFIG_SYS_DRAM_TEST) -int testdram (void) +int testdram(void) { uint *pstart = (uint *) CONFIG_SYS_MEMTEST_START; uint *pend = (uint *) CONFIG_SYS_MEMTEST_END; diff --git a/board/CarMediaLab/flea3/flea3.c b/board/CarMediaLab/flea3/flea3.c index be0bc228ec7..fb66c9ecc74 100644 --- a/board/CarMediaLab/flea3/flea3.c +++ b/board/CarMediaLab/flea3/flea3.c @@ -8,6 +8,7 @@ */ #include <common.h> +#include <init.h> #include <asm/io.h> #include <env.h> #include <linux/errno.h> diff --git a/board/LaCie/edminiv2/edminiv2.c b/board/LaCie/edminiv2/edminiv2.c index b68e18e0349..b5ffe8162f3 100644 --- a/board/LaCie/edminiv2/edminiv2.c +++ b/board/LaCie/edminiv2/edminiv2.c @@ -9,6 +9,7 @@ #include <common.h> #include <miiphy.h> +#include <net.h> #include <asm/arch/orion5x.h> #include "../common/common.h" #include <spl.h> diff --git a/board/LaCie/net2big_v2/net2big_v2.c b/board/LaCie/net2big_v2/net2big_v2.c index 686608d25a5..50305656e8e 100644 --- a/board/LaCie/net2big_v2/net2big_v2.c +++ b/board/LaCie/net2big_v2/net2big_v2.c @@ -12,6 +12,7 @@ #include <command.h> #include <env.h> #include <i2c.h> +#include <net.h> #include <asm/mach-types.h> #include <asm/arch/cpu.h> #include <asm/arch/soc.h> diff --git a/board/LaCie/netspace_v2/netspace_v2.c b/board/LaCie/netspace_v2/netspace_v2.c index bd7ab22948b..b7ae58c6454 100644 --- a/board/LaCie/netspace_v2/netspace_v2.c +++ b/board/LaCie/netspace_v2/netspace_v2.c @@ -11,6 +11,7 @@ #include <common.h> #include <command.h> #include <env.h> +#include <net.h> #include <asm/mach-types.h> #include <asm/arch/cpu.h> #include <asm/arch/soc.h> diff --git a/board/Marvell/db-88f6281-bp/db-88f6281-bp.c b/board/Marvell/db-88f6281-bp/db-88f6281-bp.c index b68f2f3c895..729516d9e1d 100644 --- a/board/Marvell/db-88f6281-bp/db-88f6281-bp.c +++ b/board/Marvell/db-88f6281-bp/db-88f6281-bp.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0+ #include <common.h> +#include <net.h> #include <linux/io.h> #include <miiphy.h> #include <netdev.h> diff --git a/board/Marvell/dreamplug/dreamplug.c b/board/Marvell/dreamplug/dreamplug.c index ede168c9ece..887dd1ed74d 100644 --- a/board/Marvell/dreamplug/dreamplug.c +++ b/board/Marvell/dreamplug/dreamplug.c @@ -10,6 +10,7 @@ #include <common.h> #include <miiphy.h> +#include <net.h> #include <asm/arch/cpu.h> #include <asm/arch/soc.h> #include <asm/arch/mpp.h> diff --git a/board/Marvell/guruplug/guruplug.c b/board/Marvell/guruplug/guruplug.c index 466f85eb081..71bee76bdce 100644 --- a/board/Marvell/guruplug/guruplug.c +++ b/board/Marvell/guruplug/guruplug.c @@ -7,6 +7,7 @@ #include <common.h> #include <miiphy.h> +#include <net.h> #include <asm/mach-types.h> #include <asm/arch/cpu.h> #include <asm/arch/soc.h> diff --git a/board/Marvell/openrd/openrd.c b/board/Marvell/openrd/openrd.c index a4923ce9718..ae9202895d5 100644 --- a/board/Marvell/openrd/openrd.c +++ b/board/Marvell/openrd/openrd.c @@ -12,6 +12,7 @@ #include <common.h> #include <miiphy.h> +#include <net.h> #include <asm/mach-types.h> #include <asm/arch/cpu.h> #include <asm/arch/soc.h> diff --git a/board/Marvell/sheevaplug/sheevaplug.c b/board/Marvell/sheevaplug/sheevaplug.c index 79999c7d304..6c6106c23c5 100644 --- a/board/Marvell/sheevaplug/sheevaplug.c +++ b/board/Marvell/sheevaplug/sheevaplug.c @@ -7,6 +7,7 @@ #include <common.h> #include <miiphy.h> +#include <net.h> #include <asm/mach-types.h> #include <asm/arch/cpu.h> #include <asm/arch/soc.h> diff --git a/board/Seagate/dockstar/dockstar.c b/board/Seagate/dockstar/dockstar.c index 40e5dc7034d..5a8c6e282bf 100644 --- a/board/Seagate/dockstar/dockstar.c +++ b/board/Seagate/dockstar/dockstar.c @@ -10,6 +10,7 @@ #include <common.h> #include <miiphy.h> +#include <net.h> #include <asm/arch/soc.h> #include <asm/arch/mpp.h> #include <asm/arch/cpu.h> diff --git a/board/Seagate/goflexhome/goflexhome.c b/board/Seagate/goflexhome/goflexhome.c index 42b51eb29a1..1e4477aa5ff 100644 --- a/board/Seagate/goflexhome/goflexhome.c +++ b/board/Seagate/goflexhome/goflexhome.c @@ -13,6 +13,7 @@ #include <common.h> #include <miiphy.h> +#include <net.h> #include <asm/mach-types.h> #include <asm/arch/soc.h> #include <asm/arch/mpp.h> diff --git a/board/Seagate/nas220/nas220.c b/board/Seagate/nas220/nas220.c index 1e6c43b1fab..99462052f04 100644 --- a/board/Seagate/nas220/nas220.c +++ b/board/Seagate/nas220/nas220.c @@ -10,6 +10,7 @@ #include <common.h> #include <miiphy.h> +#include <net.h> #include <asm/mach-types.h> #include <asm/arch/soc.h> #include <asm/arch/mpp.h> diff --git a/board/Synology/ds109/ds109.c b/board/Synology/ds109/ds109.c index 1f2fce989c9..f2031ef3bbb 100644 --- a/board/Synology/ds109/ds109.c +++ b/board/Synology/ds109/ds109.c @@ -7,6 +7,7 @@ #include <common.h> #include <miiphy.h> +#include <net.h> #include <asm/setup.h> #include <asm/arch/cpu.h> #include <asm/arch/soc.h> diff --git a/board/abilis/tb100/tb100.c b/board/abilis/tb100/tb100.c index 4f8006da005..e3fbbbaa8aa 100644 --- a/board/abilis/tb100/tb100.c +++ b/board/abilis/tb100/tb100.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <netdev.h> #include <asm/io.h> diff --git a/board/advantech/imx8qm_rom7720_a1/imx8qm_rom7720_a1.c b/board/advantech/imx8qm_rom7720_a1/imx8qm_rom7720_a1.c index 2f97d5ce96a..5017ab8d93e 100644 --- a/board/advantech/imx8qm_rom7720_a1/imx8qm_rom7720_a1.c +++ b/board/advantech/imx8qm_rom7720_a1/imx8qm_rom7720_a1.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <errno.h> #include <linux/libfdt.h> #include <asm/io.h> diff --git a/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c b/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c index 0eac10d9113..1f3f293bd91 100644 --- a/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c +++ b/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <net.h> #include <linux/io.h> #include <miiphy.h> #include <netdev.h> diff --git a/board/alliedtelesis/SBx81LIFXCAT/sbx81lifxcat.c b/board/alliedtelesis/SBx81LIFXCAT/sbx81lifxcat.c index c584fc0e982..889ce70d758 100644 --- a/board/alliedtelesis/SBx81LIFXCAT/sbx81lifxcat.c +++ b/board/alliedtelesis/SBx81LIFXCAT/sbx81lifxcat.c @@ -6,6 +6,7 @@ #include <common.h> #include <miiphy.h> +#include <net.h> #include <netdev.h> #include <led.h> #include <linux/io.h> diff --git a/board/armadeus/apf27/apf27.c b/board/armadeus/apf27/apf27.c index 75395d92cd1..29e0bf388d0 100644 --- a/board/armadeus/apf27/apf27.c +++ b/board/armadeus/apf27/apf27.c @@ -7,6 +7,7 @@ */ #include <common.h> +#include <hang.h> #include <init.h> #include <jffs2/jffs2.h> #include <nand.h> diff --git a/board/armltd/integrator/integrator.c b/board/armltd/integrator/integrator.c index 5cdf7905a90..1a472f50d3f 100644 --- a/board/armltd/integrator/integrator.c +++ b/board/armltd/integrator/integrator.c @@ -20,6 +20,7 @@ #include <cpu_func.h> #include <dm.h> #include <env.h> +#include <init.h> #include <netdev.h> #include <asm/io.h> #include <dm/platform_data/serial_pl01x.h> diff --git a/board/armltd/integrator/timer.c b/board/armltd/integrator/timer.c index e65ae997fd6..d701669be0c 100644 --- a/board/armltd/integrator/timer.c +++ b/board/armltd/integrator/timer.c @@ -153,7 +153,7 @@ unsigned long long get_ticks(void) * Return the timebase clock frequency * i.e. how often the timer decrements */ -ulong get_tbclk (void) +ulong get_tbclk(void) { unsigned long long tmp = CONFIG_SYS_HZ_CLOCK; diff --git a/board/armltd/vexpress/vexpress_common.c b/board/armltd/vexpress/vexpress_common.c index 416c18adec4..14626c1f553 100644 --- a/board/armltd/vexpress/vexpress_common.c +++ b/board/armltd/vexpress/vexpress_common.c @@ -17,6 +17,7 @@ */ #include <common.h> #include <cpu_func.h> +#include <init.h> #include <malloc.h> #include <errno.h> #include <netdev.h> diff --git a/board/armltd/vexpress64/vexpress64.c b/board/armltd/vexpress64/vexpress64.c index 7fe539e4d67..dd0ebdd3030 100644 --- a/board/armltd/vexpress64/vexpress64.c +++ b/board/armltd/vexpress64/vexpress64.c @@ -5,6 +5,7 @@ * Sharma Bhupesh <bhupesh.sharma@freescale.com> */ #include <common.h> +#include <cpu_func.h> #include <dm.h> #include <malloc.h> #include <errno.h> diff --git a/board/astro/mcf5373l/mcf5373l.c b/board/astro/mcf5373l/mcf5373l.c index db157a83c8f..9adf58eb8a3 100644 --- a/board/astro/mcf5373l/mcf5373l.c +++ b/board/astro/mcf5373l/mcf5373l.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <init.h> #include <serial.h> #include <watchdog.h> #include <command.h> diff --git a/board/atmark-techno/armadillo-800eva/armadillo-800eva.c b/board/atmark-techno/armadillo-800eva/armadillo-800eva.c index 867fa82c177..a18fb275d9f 100644 --- a/board/atmark-techno/armadillo-800eva/armadillo-800eva.c +++ b/board/atmark-techno/armadillo-800eva/armadillo-800eva.c @@ -21,6 +21,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <init.h> #include <malloc.h> #include <asm/processor.h> diff --git a/board/atmel/at91rm9200ek/at91rm9200ek.c b/board/atmel/at91rm9200ek/at91rm9200ek.c index 5d228fcc163..e75d5b182f6 100644 --- a/board/atmel/at91rm9200ek/at91rm9200ek.c +++ b/board/atmel/at91rm9200ek/at91rm9200ek.c @@ -10,6 +10,7 @@ */ #include <common.h> +#include <init.h> #include <netdev.h> #include <asm/mach-types.h> #include <asm/arch/hardware.h> diff --git a/board/atmel/at91sam9260ek/at91sam9260ek.c b/board/atmel/at91sam9260ek/at91sam9260ek.c index 9dcbfc450b2..42fa7627724 100644 --- a/board/atmel/at91sam9260ek/at91sam9260ek.c +++ b/board/atmel/at91sam9260ek/at91sam9260ek.c @@ -7,6 +7,8 @@ #include <common.h> #include <debug_uart.h> +#include <init.h> +#include <net.h> #include <asm/io.h> #include <asm/arch/at91sam9260_matrix.h> #include <asm/arch/at91sam9_smc.h> diff --git a/board/atmel/at91sam9261ek/at91sam9261ek.c b/board/atmel/at91sam9261ek/at91sam9261ek.c index 28765315f74..36f2149b618 100644 --- a/board/atmel/at91sam9261ek/at91sam9261ek.c +++ b/board/atmel/at91sam9261ek/at91sam9261ek.c @@ -7,6 +7,7 @@ #include <common.h> #include <debug_uart.h> +#include <init.h> #include <vsprintf.h> #include <asm/io.h> #include <asm/arch/at91sam9261.h> diff --git a/board/atmel/at91sam9263ek/at91sam9263ek.c b/board/atmel/at91sam9263ek/at91sam9263ek.c index 31bb72c0cdc..b811d931c44 100644 --- a/board/atmel/at91sam9263ek/at91sam9263ek.c +++ b/board/atmel/at91sam9263ek/at91sam9263ek.c @@ -7,6 +7,8 @@ #include <common.h> #include <debug_uart.h> +#include <init.h> +#include <net.h> #include <vsprintf.h> #include <linux/sizes.h> #include <asm/arch/at91sam9263.h> diff --git a/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c b/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c index 85004310b1f..8aabc559519 100644 --- a/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c +++ b/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c @@ -7,6 +7,8 @@ #include <common.h> #include <debug_uart.h> +#include <init.h> +#include <net.h> #include <vsprintf.h> #include <asm/io.h> #include <asm/arch/clk.h> diff --git a/board/atmel/at91sam9n12ek/at91sam9n12ek.c b/board/atmel/at91sam9n12ek/at91sam9n12ek.c index 51b24e1d592..90d32353e9b 100644 --- a/board/atmel/at91sam9n12ek/at91sam9n12ek.c +++ b/board/atmel/at91sam9n12ek/at91sam9n12ek.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <init.h> #include <vsprintf.h> #include <asm/io.h> #include <asm/arch/at91sam9x5_matrix.h> diff --git a/board/atmel/at91sam9rlek/at91sam9rlek.c b/board/atmel/at91sam9rlek/at91sam9rlek.c index 4e674d49b31..f81dccc9ccc 100644 --- a/board/atmel/at91sam9rlek/at91sam9rlek.c +++ b/board/atmel/at91sam9rlek/at91sam9rlek.c @@ -7,6 +7,7 @@ #include <common.h> #include <debug_uart.h> +#include <init.h> #include <vsprintf.h> #include <asm/io.h> #include <asm/mach-types.h> diff --git a/board/atmel/sam9x60ek/sam9x60ek.c b/board/atmel/sam9x60ek/sam9x60ek.c index 7be1dd54f46..fbd05c78a94 100644 --- a/board/atmel/sam9x60ek/sam9x60ek.c +++ b/board/atmel/sam9x60ek/sam9x60ek.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <init.h> #include <asm/io.h> #include <asm/arch/at91sam9_smc.h> #include <asm/arch/at91_common.h> diff --git a/board/atmel/sama5d27_wlsom1_ek/sama5d27_wlsom1_ek.c b/board/atmel/sama5d27_wlsom1_ek/sama5d27_wlsom1_ek.c index fc563ebb715..c8c2e958167 100644 --- a/board/atmel/sama5d27_wlsom1_ek/sama5d27_wlsom1_ek.c +++ b/board/atmel/sama5d27_wlsom1_ek/sama5d27_wlsom1_ek.c @@ -7,6 +7,7 @@ #include <common.h> #include <debug_uart.h> +#include <init.h> #include <asm/io.h> #include <asm/arch/at91_common.h> #include <asm/arch/atmel_pio4.h> diff --git a/board/barco/platinum/platinum.c b/board/barco/platinum/platinum.c index 1c6514af6e7..c2c7c095536 100644 --- a/board/barco/platinum/platinum.c +++ b/board/barco/platinum/platinum.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <init.h> #include <mmc.h> #include <fsl_esdhc_imx.h> #include <miiphy.h> diff --git a/board/barco/titanium/titanium.c b/board/barco/titanium/titanium.c index 407bfe95ed5..6348f123ad4 100644 --- a/board/barco/titanium/titanium.c +++ b/board/barco/titanium/titanium.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <init.h> #include <asm/io.h> #include <asm/arch/clock.h> #include <asm/arch/imx-regs.h> diff --git a/board/bluewater/snapper9260/snapper9260.c b/board/bluewater/snapper9260/snapper9260.c index d2a1b97d7b1..47ce3078808 100644 --- a/board/bluewater/snapper9260/snapper9260.c +++ b/board/bluewater/snapper9260/snapper9260.c @@ -9,6 +9,7 @@ #include <common.h> #include <dm.h> +#include <init.h> #include <asm/io.h> #include <asm/gpio.h> #include <asm/mach-types.h> diff --git a/board/bosch/shc/board.c b/board/bosch/shc/board.c index 440d02fdbc0..d34f3ba0077 100644 --- a/board/bosch/shc/board.c +++ b/board/bosch/shc/board.c @@ -12,6 +12,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <env.h> #include <errno.h> #include <init.h> diff --git a/board/bosch/shc/mux.c b/board/bosch/shc/mux.c index b04c5914f0d..0a97eafea6c 100644 --- a/board/bosch/shc/mux.c +++ b/board/bosch/shc/mux.c @@ -10,6 +10,7 @@ */ #include <common.h> +#include <hang.h> #include <asm/arch/sys_proto.h> #include <asm/arch/hardware.h> #include <asm/arch/mux.h> diff --git a/board/broadcom/bcm23550_w1d/bcm23550_w1d.c b/board/broadcom/bcm23550_w1d/bcm23550_w1d.c index ce9f0494ee5..d83eb9bd524 100644 --- a/board/broadcom/bcm23550_w1d/bcm23550_w1d.c +++ b/board/broadcom/bcm23550_w1d/bcm23550_w1d.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <init.h> #include <asm/io.h> #include <asm/mach-types.h> #include <env.h> diff --git a/board/broadcom/bcm28155_ap/bcm28155_ap.c b/board/broadcom/bcm28155_ap/bcm28155_ap.c index 87616386cb8..40ced1a87ce 100644 --- a/board/broadcom/bcm28155_ap/bcm28155_ap.c +++ b/board/broadcom/bcm28155_ap/bcm28155_ap.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <init.h> #include <asm/io.h> #include <asm/mach-types.h> #include <env.h> diff --git a/board/broadcom/bcm_ep/board.c b/board/broadcom/bcm_ep/board.c index 63fb98ba7c5..e4dbe426490 100644 --- a/board/broadcom/bcm_ep/board.c +++ b/board/broadcom/bcm_ep/board.c @@ -5,6 +5,7 @@ #include <common.h> #include <cpu_func.h> +#include <init.h> #include <asm/io.h> #include <config.h> #include <netdev.h> diff --git a/board/broadcom/bcmns2/northstar2.c b/board/broadcom/bcmns2/northstar2.c index 1068edca59c..6cbad9c1f0a 100644 --- a/board/broadcom/bcmns2/northstar2.c +++ b/board/broadcom/bcmns2/northstar2.c @@ -3,6 +3,8 @@ * (C) Copyright 2016 Broadcom Ltd. */ #include <common.h> +#include <cpu_func.h> +#include <init.h> #include <asm/system.h> #include <asm/armv8/mmu.h> diff --git a/board/calao/usb_a9263/usb_a9263.c b/board/calao/usb_a9263/usb_a9263.c index 9e8e1f36f7a..919e3ed27cd 100644 --- a/board/calao/usb_a9263/usb_a9263.c +++ b/board/calao/usb_a9263/usb_a9263.c @@ -8,6 +8,7 @@ */ #include <common.h> +#include <init.h> #include <asm/arch/at91sam9_smc.h> #include <asm/arch/at91_common.h> #include <asm/arch/at91_matrix.h> diff --git a/board/cavium/thunderx/thunderx.c b/board/cavium/thunderx/thunderx.c index 940455de5b2..687ade544ac 100644 --- a/board/cavium/thunderx/thunderx.c +++ b/board/cavium/thunderx/thunderx.c @@ -4,6 +4,7 @@ **/ #include <common.h> +#include <cpu_func.h> #include <dm.h> #include <init.h> #include <malloc.h> diff --git a/board/cloudengines/pogo_e02/pogo_e02.c b/board/cloudengines/pogo_e02/pogo_e02.c index ffbd099c4ee..835c3279be2 100644 --- a/board/cloudengines/pogo_e02/pogo_e02.c +++ b/board/cloudengines/pogo_e02/pogo_e02.c @@ -11,6 +11,7 @@ #include <common.h> #include <miiphy.h> +#include <net.h> #include <asm/arch/cpu.h> #include <asm/arch/soc.h> #include <asm/arch/mpp.h> diff --git a/board/cobra5272/cobra5272.c b/board/cobra5272/cobra5272.c index a0a416b50c1..a79884cb506 100644 --- a/board/cobra5272/cobra5272.c +++ b/board/cobra5272/cobra5272.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <init.h> #include <asm/immap.h> DECLARE_GLOBAL_DATA_PTR; @@ -31,7 +32,7 @@ int dram_init(void) return 0; }; -int testdram (void) +int testdram(void) { /* TODO: XXX XXX XXX */ printf ("DRAM test not implemented!\n"); diff --git a/board/compulab/cl-som-imx7/spl.c b/board/compulab/cl-som-imx7/spl.c index f9a19f08daa..360c4df17b3 100644 --- a/board/compulab/cl-som-imx7/spl.c +++ b/board/compulab/cl-som-imx7/spl.c @@ -8,6 +8,8 @@ */ #include <common.h> +#include <hang.h> +#include <init.h> #include <spl.h> #include <fsl_esdhc_imx.h> #include <asm/mach-imx/iomux-v3.h> diff --git a/board/compulab/cm_fx6/spl.c b/board/compulab/cm_fx6/spl.c index 66186ec853a..592d7410951 100644 --- a/board/compulab/cm_fx6/spl.c +++ b/board/compulab/cm_fx6/spl.c @@ -8,6 +8,9 @@ */ #include <common.h> +#include <clock_legacy.h> +#include <hang.h> +#include <init.h> #include <spl.h> #include <asm/io.h> #include <asm/gpio.h> diff --git a/board/compulab/cm_t335/spl.c b/board/compulab/cm_t335/spl.c index 93f834f5125..39ca535d11d 100644 --- a/board/compulab/cm_t335/spl.c +++ b/board/compulab/cm_t335/spl.c @@ -10,7 +10,9 @@ */ #include <common.h> +#include <cpu_func.h> #include <errno.h> +#include <init.h> #include <asm/arch/ddr_defs.h> #include <asm/arch/clock.h> diff --git a/board/compulab/cm_t43/spl.c b/board/compulab/cm_t43/spl.c index 7da9a9ad86b..016c63a509a 100644 --- a/board/compulab/cm_t43/spl.c +++ b/board/compulab/cm_t43/spl.c @@ -4,6 +4,8 @@ */ #include <common.h> +#include <hang.h> +#include <init.h> #include <spl.h> #include <i2c.h> #include <asm/arch/clock.h> diff --git a/board/d-link/dns325/dns325.c b/board/d-link/dns325/dns325.c index a1d987bedaa..dfdc683683d 100644 --- a/board/d-link/dns325/dns325.c +++ b/board/d-link/dns325/dns325.c @@ -11,6 +11,7 @@ #include <common.h> #include <miiphy.h> +#include <net.h> #include <netdev.h> #include <asm/arch/cpu.h> #include <asm/arch/soc.h> diff --git a/board/egnite/ethernut5/ethernut5.c b/board/egnite/ethernut5/ethernut5.c index 9dea2ba80e2..bfd5a4fe369 100644 --- a/board/egnite/ethernut5/ethernut5.c +++ b/board/egnite/ethernut5/ethernut5.c @@ -53,6 +53,7 @@ */ #include <common.h> +#include <init.h> #include <net.h> #include <netdev.h> #include <miiphy.h> diff --git a/board/engicam/common/board.c b/board/engicam/common/board.c index 6472d382c93..9483516ca0d 100644 --- a/board/engicam/common/board.c +++ b/board/engicam/common/board.c @@ -8,6 +8,7 @@ #include <common.h> #include <command.h> #include <env.h> +#include <hang.h> #include <init.h> #include <mmc.h> #include <asm/arch/clock.h> diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c index 4271b0db19c..6c5992733cc 100644 --- a/board/esd/meesc/meesc.c +++ b/board/esd/meesc/meesc.c @@ -11,6 +11,7 @@ #include <common.h> #include <env.h> +#include <init.h> #include <serial.h> #include <vsprintf.h> #include <asm/io.h> diff --git a/board/esd/vme8349/vme8349.c b/board/esd/vme8349/vme8349.c index 4c220fa8e13..ff811643a67 100644 --- a/board/esd/vme8349/vme8349.c +++ b/board/esd/vme8349/vme8349.c @@ -12,6 +12,8 @@ */ #include <common.h> +#include <fdt_support.h> +#include <init.h> #include <ioports.h> #include <mpc83xx.h> #include <asm/mpc8349_pci.h> diff --git a/board/firefly/firefly-rk3288/firefly-rk3288.c b/board/firefly/firefly-rk3288/firefly-rk3288.c index a3f784f0a3a..a2b0eb5a996 100644 --- a/board/firefly/firefly-rk3288/firefly-rk3288.c +++ b/board/firefly/firefly-rk3288/firefly-rk3288.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <hang.h> #ifdef CONFIG_SPL_BUILD static int setup_led(void) diff --git a/board/freescale/b4860qds/b4860qds.c b/board/freescale/b4860qds/b4860qds.c index 45650b4f088..e7f684bfb3a 100644 --- a/board/freescale/b4860qds/b4860qds.c +++ b/board/freescale/b4860qds/b4860qds.c @@ -6,6 +6,7 @@ #include <common.h> #include <command.h> #include <env.h> +#include <fdt_support.h> #include <i2c.h> #include <init.h> #include <irq_func.h> diff --git a/board/freescale/b4860qds/spl.c b/board/freescale/b4860qds/spl.c index 06ea8775044..fe5ce350131 100644 --- a/board/freescale/b4860qds/spl.c +++ b/board/freescale/b4860qds/spl.c @@ -3,9 +3,11 @@ */ #include <common.h> +#include <clock_legacy.h> #include <console.h> #include <env.h> #include <env_internal.h> +#include <init.h> #include <asm/spl.h> #include <malloc.h> #include <ns16550.h> diff --git a/board/freescale/bsc9131rdb/ddr.c b/board/freescale/bsc9131rdb/ddr.c index 4b6d91df219..0951d7758aa 100644 --- a/board/freescale/bsc9131rdb/ddr.c +++ b/board/freescale/bsc9131rdb/ddr.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <init.h> #include <vsprintf.h> #include <asm/mmu.h> #include <asm/immap_85xx.h> diff --git a/board/freescale/bsc9131rdb/spl_minimal.c b/board/freescale/bsc9131rdb/spl_minimal.c index e7ed0a90b8f..79df0f3cbd5 100644 --- a/board/freescale/bsc9131rdb/spl_minimal.c +++ b/board/freescale/bsc9131rdb/spl_minimal.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <init.h> #include <ns16550.h> #include <asm/io.h> #include <nand.h> diff --git a/board/freescale/bsc9132qds/spl_minimal.c b/board/freescale/bsc9132qds/spl_minimal.c index 5e1cc1f4a38..dc72b2e2f2e 100644 --- a/board/freescale/bsc9132qds/spl_minimal.c +++ b/board/freescale/bsc9132qds/spl_minimal.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <init.h> #include <ns16550.h> #include <asm/io.h> #include <nand.h> diff --git a/board/freescale/c29xpcie/spl.c b/board/freescale/c29xpcie/spl.c index 9a2385b978c..421c2d4b1fc 100644 --- a/board/freescale/c29xpcie/spl.c +++ b/board/freescale/c29xpcie/spl.c @@ -3,8 +3,10 @@ */ #include <common.h> +#include <clock_legacy.h> #include <console.h> #include <env_internal.h> +#include <init.h> #include <ns16550.h> #include <malloc.h> #include <mmc.h> diff --git a/board/freescale/c29xpcie/spl_minimal.c b/board/freescale/c29xpcie/spl_minimal.c index 7452cec8ff6..8193afdf6aa 100644 --- a/board/freescale/c29xpcie/spl_minimal.c +++ b/board/freescale/c29xpcie/spl_minimal.c @@ -3,6 +3,7 @@ */ #include <common.h> +#include <init.h> #include <mpc85xx.h> #include <asm/io.h> #include <ns16550.h> diff --git a/board/freescale/corenet_ds/corenet_ds.c b/board/freescale/corenet_ds/corenet_ds.c index c2fa60e321b..66eea32e077 100644 --- a/board/freescale/corenet_ds/corenet_ds.c +++ b/board/freescale/corenet_ds/corenet_ds.c @@ -6,6 +6,7 @@ #include <common.h> #include <command.h> #include <env.h> +#include <fdt_support.h> #include <init.h> #include <netdev.h> #include <linux/compiler.h> diff --git a/board/freescale/imx8mm_evk/spl.c b/board/freescale/imx8mm_evk/spl.c index 2d08f9a5633..a26fc96b91d 100644 --- a/board/freescale/imx8mm_evk/spl.c +++ b/board/freescale/imx8mm_evk/spl.c @@ -4,6 +4,8 @@ */ #include <common.h> +#include <cpu_func.h> +#include <hang.h> #include <spl.h> #include <asm/io.h> #include <asm/mach-imx/iomux-v3.h> diff --git a/board/freescale/imx8mn_evk/spl.c b/board/freescale/imx8mn_evk/spl.c index cbde9f6b3c6..7aed14c52b6 100644 --- a/board/freescale/imx8mn_evk/spl.c +++ b/board/freescale/imx8mn_evk/spl.c @@ -5,6 +5,8 @@ */ #include <common.h> +#include <cpu_func.h> +#include <hang.h> #include <spl.h> #include <asm/io.h> #include <asm/mach-imx/iomux-v3.h> diff --git a/board/freescale/imx8mp_evk/spl.c b/board/freescale/imx8mp_evk/spl.c index 3c689f2d316..0b20668e2b3 100644 --- a/board/freescale/imx8mp_evk/spl.c +++ b/board/freescale/imx8mp_evk/spl.c @@ -5,6 +5,8 @@ */ #include <common.h> +#include <cpu_func.h> +#include <hang.h> #include <spl.h> #include <asm/io.h> #include <errno.h> diff --git a/board/freescale/imx8mq_evk/spl.c b/board/freescale/imx8mq_evk/spl.c index 9164cfb9d87..e442510f44d 100644 --- a/board/freescale/imx8mq_evk/spl.c +++ b/board/freescale/imx8mq_evk/spl.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <hang.h> #include <asm/io.h> #include <errno.h> #include <asm/io.h> diff --git a/board/freescale/imx8qm_mek/imx8qm_mek.c b/board/freescale/imx8qm_mek/imx8qm_mek.c index 667a2743a62..bf296a6eb59 100644 --- a/board/freescale/imx8qm_mek/imx8qm_mek.c +++ b/board/freescale/imx8qm_mek/imx8qm_mek.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <env.h> #include <errno.h> #include <init.h> diff --git a/board/freescale/imx8qxp_mek/imx8qxp_mek.c b/board/freescale/imx8qxp_mek/imx8qxp_mek.c index 194eb60cd37..1577cd6ba76 100644 --- a/board/freescale/imx8qxp_mek/imx8qxp_mek.c +++ b/board/freescale/imx8qxp_mek/imx8qxp_mek.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <env.h> #include <errno.h> #include <init.h> diff --git a/board/freescale/ls1012afrdm/eth.c b/board/freescale/ls1012afrdm/eth.c index 421e2fe38c5..bd1df092f9b 100644 --- a/board/freescale/ls1012afrdm/eth.c +++ b/board/freescale/ls1012afrdm/eth.c @@ -6,6 +6,7 @@ #include <common.h> #include <dm.h> +#include <net.h> #include <asm/io.h> #include <netdev.h> #include <fm_eth.h> diff --git a/board/freescale/ls1012afrdm/ls1012afrdm.c b/board/freescale/ls1012afrdm/ls1012afrdm.c index 31e41ce1696..d138c9384eb 100644 --- a/board/freescale/ls1012afrdm/ls1012afrdm.c +++ b/board/freescale/ls1012afrdm/ls1012afrdm.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <fdt_support.h> #include <i2c.h> #include <asm/io.h> #include <asm/arch/clock.h> diff --git a/board/freescale/ls1012ardb/eth.c b/board/freescale/ls1012ardb/eth.c index b35d5343e4e..3cc0a65cb91 100644 --- a/board/freescale/ls1012ardb/eth.c +++ b/board/freescale/ls1012ardb/eth.c @@ -6,6 +6,7 @@ #include <common.h> #include <dm.h> +#include <net.h> #include <asm/io.h> #include <netdev.h> #include <fm_eth.h> diff --git a/board/freescale/ls1012ardb/ls1012ardb.c b/board/freescale/ls1012ardb/ls1012ardb.c index e4527c19b88..0f665c7bc68 100644 --- a/board/freescale/ls1012ardb/ls1012ardb.c +++ b/board/freescale/ls1012ardb/ls1012ardb.c @@ -4,6 +4,8 @@ */ #include <common.h> +#include <fdt_support.h> +#include <hang.h> #include <i2c.h> #include <asm/io.h> #include <asm/arch/clock.h> diff --git a/board/freescale/ls1021aiot/ls1021aiot.c b/board/freescale/ls1021aiot/ls1021aiot.c index eda5cc7a9ed..b4201e76d1c 100644 --- a/board/freescale/ls1021aiot/ls1021aiot.c +++ b/board/freescale/ls1021aiot/ls1021aiot.c @@ -4,6 +4,8 @@ */ #include <common.h> +#include <clock_legacy.h> +#include <fdt_support.h> #include <init.h> #include <asm/arch/immap_ls102xa.h> #include <asm/arch/clock.h> diff --git a/board/freescale/ls1021aqds/ls1021aqds.c b/board/freescale/ls1021aqds/ls1021aqds.c index 3efdbe9a690..b7f8f1d5786 100644 --- a/board/freescale/ls1021aqds/ls1021aqds.c +++ b/board/freescale/ls1021aqds/ls1021aqds.c @@ -4,6 +4,8 @@ */ #include <common.h> +#include <clock_legacy.h> +#include <fdt_support.h> #include <i2c.h> #include <init.h> #include <asm/io.h> diff --git a/board/freescale/ls1021atsn/ls1021atsn.c b/board/freescale/ls1021atsn/ls1021atsn.c index 8039fd55f47..3876910cbbe 100644 --- a/board/freescale/ls1021atsn/ls1021atsn.c +++ b/board/freescale/ls1021atsn/ls1021atsn.c @@ -2,6 +2,8 @@ /* Copyright 2016-2019 NXP Semiconductors */ #include <common.h> +#include <clock_legacy.h> +#include <fdt_support.h> #include <init.h> #include <asm/arch-ls102xa/ls102xa_soc.h> #include <asm/arch/ls102xa_devdis.h> diff --git a/board/freescale/ls1021atwr/ls1021atwr.c b/board/freescale/ls1021atwr/ls1021atwr.c index c4ff6775c3b..497dce5f0f3 100644 --- a/board/freescale/ls1021atwr/ls1021atwr.c +++ b/board/freescale/ls1021atwr/ls1021atwr.c @@ -4,6 +4,8 @@ */ #include <common.h> +#include <clock_legacy.h> +#include <fdt_support.h> #include <i2c.h> #include <init.h> #include <asm/io.h> diff --git a/board/freescale/ls1088a/eth_ls1088aqds.c b/board/freescale/ls1088a/eth_ls1088aqds.c index 237088a5371..54ef75347f6 100644 --- a/board/freescale/ls1088a/eth_ls1088aqds.c +++ b/board/freescale/ls1088a/eth_ls1088aqds.c @@ -6,6 +6,7 @@ #include <common.h> #include <command.h> #include <env.h> +#include <net.h> #include <netdev.h> #include <asm/io.h> #include <asm/arch/fsl_serdes.h> diff --git a/board/freescale/ls1088a/eth_ls1088ardb.c b/board/freescale/ls1088a/eth_ls1088ardb.c index a2b52a879b1..01f56db0a1b 100644 --- a/board/freescale/ls1088a/eth_ls1088ardb.c +++ b/board/freescale/ls1088a/eth_ls1088ardb.c @@ -5,6 +5,7 @@ #include <common.h> #include <command.h> +#include <net.h> #include <netdev.h> #include <malloc.h> #include <fsl_mdio.h> diff --git a/board/freescale/ls2080a/ls2080a.c b/board/freescale/ls2080a/ls2080a.c index 413a698511b..949b57c24e0 100644 --- a/board/freescale/ls2080a/ls2080a.c +++ b/board/freescale/ls2080a/ls2080a.c @@ -5,6 +5,7 @@ #include <common.h> #include <malloc.h> #include <errno.h> +#include <net.h> #include <netdev.h> #include <fsl_ifc.h> #include <fsl_ddr.h> diff --git a/board/freescale/ls2080aqds/eth.c b/board/freescale/ls2080aqds/eth.c index 6a8788c3125..bbb70a859a1 100644 --- a/board/freescale/ls2080aqds/eth.c +++ b/board/freescale/ls2080aqds/eth.c @@ -5,6 +5,7 @@ #include <common.h> #include <env.h> +#include <net.h> #include <netdev.h> #include <asm/io.h> #include <asm/arch/fsl_serdes.h> diff --git a/board/freescale/ls2080ardb/eth_ls2080rdb.c b/board/freescale/ls2080ardb/eth_ls2080rdb.c index 62c7a7a3155..b0f276e8397 100644 --- a/board/freescale/ls2080ardb/eth_ls2080rdb.c +++ b/board/freescale/ls2080ardb/eth_ls2080rdb.c @@ -6,6 +6,7 @@ #include <common.h> #include <command.h> +#include <net.h> #include <netdev.h> #include <malloc.h> #include <fsl_mdio.h> diff --git a/board/freescale/lx2160a/eth_lx2160aqds.c b/board/freescale/lx2160a/eth_lx2160aqds.c index 55e8a427e65..6500649d7b9 100644 --- a/board/freescale/lx2160a/eth_lx2160aqds.c +++ b/board/freescale/lx2160a/eth_lx2160aqds.c @@ -8,6 +8,7 @@ #include <env.h> #include <hwconfig.h> #include <command.h> +#include <net.h> #include <netdev.h> #include <malloc.h> #include <fsl_mdio.h> diff --git a/board/freescale/lx2160a/eth_lx2160ardb.c b/board/freescale/lx2160a/eth_lx2160ardb.c index 365ff73cef2..aeb989a638b 100644 --- a/board/freescale/lx2160a/eth_lx2160ardb.c +++ b/board/freescale/lx2160a/eth_lx2160ardb.c @@ -6,6 +6,7 @@ #include <common.h> #include <command.h> +#include <net.h> #include <netdev.h> #include <malloc.h> #include <fsl_mdio.h> diff --git a/board/freescale/lx2160a/lx2160a.c b/board/freescale/lx2160a/lx2160a.c index e5b7fec9a4f..75361534332 100644 --- a/board/freescale/lx2160a/lx2160a.c +++ b/board/freescale/lx2160a/lx2160a.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <dm.h> #include <dm/platform_data/serial_pl01x.h> #include <i2c.h> diff --git a/board/freescale/m5208evbe/m5208evbe.c b/board/freescale/m5208evbe/m5208evbe.c index 82cadb2c33d..e448a64abc6 100644 --- a/board/freescale/m5208evbe/m5208evbe.c +++ b/board/freescale/m5208evbe/m5208evbe.c @@ -9,6 +9,7 @@ #include <config.h> #include <common.h> +#include <init.h> #include <asm/immap.h> #include <asm/io.h> diff --git a/board/freescale/m52277evb/m52277evb.c b/board/freescale/m52277evb/m52277evb.c index 13ce4886e5d..a4b795fc39b 100644 --- a/board/freescale/m52277evb/m52277evb.c +++ b/board/freescale/m52277evb/m52277evb.c @@ -8,6 +8,7 @@ */ #include <common.h> +#include <init.h> #include <asm/immap.h> #include <asm/io.h> diff --git a/board/freescale/m5235evb/m5235evb.c b/board/freescale/m5235evb/m5235evb.c index fbd2e616045..5d403937553 100644 --- a/board/freescale/m5235evb/m5235evb.c +++ b/board/freescale/m5235evb/m5235evb.c @@ -9,6 +9,7 @@ #include <config.h> #include <common.h> +#include <init.h> #include <asm/immap.h> #include <asm/io.h> diff --git a/board/freescale/m5249evb/m5249evb.c b/board/freescale/m5249evb/m5249evb.c index 9969f71da19..da3adc59541 100644 --- a/board/freescale/m5249evb/m5249evb.c +++ b/board/freescale/m5249evb/m5249evb.c @@ -6,6 +6,7 @@ #include <common.h> #include <command.h> +#include <init.h> #include <malloc.h> #include <asm/immap.h> @@ -89,7 +90,8 @@ int dram_init(void) }; -int testdram (void) { +int testdram(void) +{ /* TODO: XXX XXX XXX */ printf ("DRAM test not implemented!\n"); diff --git a/board/freescale/m5253demo/m5253demo.c b/board/freescale/m5253demo/m5253demo.c index dcf6d7f1dbc..76c18b8504f 100644 --- a/board/freescale/m5253demo/m5253demo.c +++ b/board/freescale/m5253demo/m5253demo.c @@ -8,6 +8,7 @@ */ #include <common.h> +#include <init.h> #include <asm/immap.h> #include <netdev.h> #include <asm/io.h> diff --git a/board/freescale/m5272c3/m5272c3.c b/board/freescale/m5272c3/m5272c3.c index d4457abfbdb..1017ef0c2a5 100644 --- a/board/freescale/m5272c3/m5272c3.c +++ b/board/freescale/m5272c3/m5272c3.c @@ -7,6 +7,7 @@ */ #include <common.h> +#include <init.h> #include <asm/immap.h> #include <asm/io.h> @@ -33,7 +34,8 @@ int dram_init(void) return 0; }; -int testdram (void) { +int testdram(void) +{ /* TODO: XXX XXX XXX */ printf ("DRAM test not implemented!\n"); diff --git a/board/freescale/m5275evb/m5275evb.c b/board/freescale/m5275evb/m5275evb.c index a01133612c5..e65e6d0af58 100644 --- a/board/freescale/m5275evb/m5275evb.c +++ b/board/freescale/m5275evb/m5275evb.c @@ -9,6 +9,7 @@ */ #include <common.h> +#include <init.h> #include <asm/immap.h> #include <asm/io.h> diff --git a/board/freescale/m53017evb/m53017evb.c b/board/freescale/m53017evb/m53017evb.c index 01f51b7c953..8bdb4ad1276 100644 --- a/board/freescale/m53017evb/m53017evb.c +++ b/board/freescale/m53017evb/m53017evb.c @@ -9,6 +9,7 @@ #include <config.h> #include <common.h> +#include <init.h> #include <asm/immap.h> #include <asm/io.h> diff --git a/board/freescale/m5329evb/m5329evb.c b/board/freescale/m5329evb/m5329evb.c index 88cdba719c4..d93800b364b 100644 --- a/board/freescale/m5329evb/m5329evb.c +++ b/board/freescale/m5329evb/m5329evb.c @@ -9,6 +9,7 @@ #include <config.h> #include <common.h> +#include <init.h> #include <asm/immap.h> #include <asm/io.h> diff --git a/board/freescale/m5373evb/m5373evb.c b/board/freescale/m5373evb/m5373evb.c index 37011fb7308..1d52ce047fb 100644 --- a/board/freescale/m5373evb/m5373evb.c +++ b/board/freescale/m5373evb/m5373evb.c @@ -9,6 +9,7 @@ #include <config.h> #include <common.h> +#include <init.h> #include <asm/immap.h> #include <asm/io.h> diff --git a/board/freescale/m54418twr/m54418twr.c b/board/freescale/m54418twr/m54418twr.c index a4943e76ae4..8c90cfe537a 100644 --- a/board/freescale/m54418twr/m54418twr.c +++ b/board/freescale/m54418twr/m54418twr.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <init.h> #include <spi.h> #include <asm/io.h> #include <asm/immap.h> diff --git a/board/freescale/m54451evb/m54451evb.c b/board/freescale/m54451evb/m54451evb.c index 7cb840346c8..82a2b9093b6 100644 --- a/board/freescale/m54451evb/m54451evb.c +++ b/board/freescale/m54451evb/m54451evb.c @@ -8,6 +8,7 @@ */ #include <common.h> +#include <init.h> #include <spi.h> #include <asm/immap.h> #include <asm/io.h> diff --git a/board/freescale/mpc8308rdb/sdram.c b/board/freescale/mpc8308rdb/sdram.c index 317e63ea6a1..6e0922cd53c 100644 --- a/board/freescale/mpc8308rdb/sdram.c +++ b/board/freescale/mpc8308rdb/sdram.c @@ -12,6 +12,7 @@ */ #include <common.h> +#include <init.h> #include <mpc83xx.h> #include <asm/bitops.h> diff --git a/board/freescale/mpc8313erdb/mpc8313erdb.c b/board/freescale/mpc8313erdb/mpc8313erdb.c index 55a3529296d..e5cc824f487 100644 --- a/board/freescale/mpc8313erdb/mpc8313erdb.c +++ b/board/freescale/mpc8313erdb/mpc8313erdb.c @@ -6,6 +6,8 @@ */ #include <common.h> +#include <clock_legacy.h> +#include <fdt_support.h> #include <init.h> #if defined(CONFIG_OF_LIBFDT) #include <linux/libfdt.h> diff --git a/board/freescale/mpc8323erdb/mpc8323erdb.c b/board/freescale/mpc8323erdb/mpc8323erdb.c index 6c47cb2b383..e513d0bfd53 100644 --- a/board/freescale/mpc8323erdb/mpc8323erdb.c +++ b/board/freescale/mpc8323erdb/mpc8323erdb.c @@ -12,6 +12,7 @@ #include <common.h> #include <eeprom.h> #include <env.h> +#include <fdt_support.h> #include <init.h> #include <ioports.h> #include <mpc83xx.h> diff --git a/board/freescale/mpc832xemds/mpc832xemds.c b/board/freescale/mpc832xemds/mpc832xemds.c index c9f2ac44a62..d4922fe1e12 100644 --- a/board/freescale/mpc832xemds/mpc832xemds.c +++ b/board/freescale/mpc832xemds/mpc832xemds.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <fdt_support.h> #include <init.h> #include <ioports.h> #include <mpc83xx.h> diff --git a/board/freescale/mpc8349emds/mpc8349emds.c b/board/freescale/mpc8349emds/mpc8349emds.c index 913b5843e95..0996b87c0fc 100644 --- a/board/freescale/mpc8349emds/mpc8349emds.c +++ b/board/freescale/mpc8349emds/mpc8349emds.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <fdt_support.h> #include <ioports.h> #include <mpc83xx.h> #include <asm/mpc8349_pci.h> diff --git a/board/freescale/mpc8349itx/mpc8349itx.c b/board/freescale/mpc8349itx/mpc8349itx.c index 81b3f00b56e..a2e284f1a22 100644 --- a/board/freescale/mpc8349itx/mpc8349itx.c +++ b/board/freescale/mpc8349itx/mpc8349itx.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <fdt_support.h> #include <ioports.h> #include <mpc83xx.h> #include <i2c.h> diff --git a/board/freescale/mpc837xerdb/mpc837xerdb.c b/board/freescale/mpc837xerdb/mpc837xerdb.c index 4ad62bcf1d6..45038acf324 100644 --- a/board/freescale/mpc837xerdb/mpc837xerdb.c +++ b/board/freescale/mpc837xerdb/mpc837xerdb.c @@ -9,6 +9,7 @@ #include <env.h> #include <hwconfig.h> #include <i2c.h> +#include <init.h> #include <asm/io.h> #include <asm/fsl_mpc83xx_serdes.h> #include <fdt_support.h> diff --git a/board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c b/board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c index b4776c5e46c..42b8cab3627 100644 --- a/board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c +++ b/board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c @@ -8,6 +8,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <command.h> #include <asm/io.h> #include <fsl_diu_fb.h> diff --git a/board/freescale/mx53ard/mx53ard.c b/board/freescale/mx53ard/mx53ard.c index e8fccccafd2..33d056b47d4 100644 --- a/board/freescale/mx53ard/mx53ard.c +++ b/board/freescale/mx53ard/mx53ard.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <init.h> #include <asm/io.h> #include <asm/arch/imx-regs.h> #include <asm/arch/sys_proto.h> diff --git a/board/freescale/mx53smd/mx53smd.c b/board/freescale/mx53smd/mx53smd.c index cab0e79a6b1..2599272173a 100644 --- a/board/freescale/mx53smd/mx53smd.c +++ b/board/freescale/mx53smd/mx53smd.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <init.h> #include <asm/io.h> #include <asm/arch/imx-regs.h> #include <asm/arch/sys_proto.h> diff --git a/board/freescale/mx6memcal/spl.c b/board/freescale/mx6memcal/spl.c index 75375f12c43..be551bc3753 100644 --- a/board/freescale/mx6memcal/spl.c +++ b/board/freescale/mx6memcal/spl.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <asm/io.h> #include <asm/arch/iomux.h> #include <asm/arch/clock.h> diff --git a/board/freescale/p1010rdb/spl.c b/board/freescale/p1010rdb/spl.c index cb489140c03..159d14b024f 100644 --- a/board/freescale/p1010rdb/spl.c +++ b/board/freescale/p1010rdb/spl.c @@ -3,9 +3,11 @@ */ #include <common.h> +#include <clock_legacy.h> #include <console.h> #include <env.h> #include <env_internal.h> +#include <init.h> #include <ns16550.h> #include <malloc.h> #include <mmc.h> diff --git a/board/freescale/p1010rdb/spl_minimal.c b/board/freescale/p1010rdb/spl_minimal.c index b9eb4430f16..0bb2c838720 100644 --- a/board/freescale/p1010rdb/spl_minimal.c +++ b/board/freescale/p1010rdb/spl_minimal.c @@ -3,6 +3,7 @@ * Copyright 2011 Freescale Semiconductor, Inc. */ #include <common.h> +#include <init.h> #include <mpc85xx.h> #include <asm/io.h> #include <ns16550.h> diff --git a/board/freescale/p1022ds/diu.c b/board/freescale/p1022ds/diu.c index c6514cf45be..7f7251009c9 100644 --- a/board/freescale/p1022ds/diu.c +++ b/board/freescale/p1022ds/diu.c @@ -7,6 +7,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <command.h> #include <linux/ctype.h> #include <asm/io.h> diff --git a/board/freescale/p1022ds/spl.c b/board/freescale/p1022ds/spl.c index 8d2c1388ec3..39e1bee6f36 100644 --- a/board/freescale/p1022ds/spl.c +++ b/board/freescale/p1022ds/spl.c @@ -4,9 +4,11 @@ */ #include <common.h> +#include <clock_legacy.h> #include <console.h> #include <env.h> #include <env_internal.h> +#include <init.h> #include <ns16550.h> #include <malloc.h> #include <mmc.h> diff --git a/board/freescale/p1022ds/spl_minimal.c b/board/freescale/p1022ds/spl_minimal.c index 9ab4029836c..31de26318da 100644 --- a/board/freescale/p1022ds/spl_minimal.c +++ b/board/freescale/p1022ds/spl_minimal.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <init.h> #include <ns16550.h> #include <asm/io.h> #include <nand.h> diff --git a/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c b/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c index c85243f58ba..71fca8ca1e1 100644 --- a/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c +++ b/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c @@ -6,6 +6,7 @@ #include <common.h> #include <command.h> #include <env.h> +#include <hang.h> #include <hwconfig.h> #include <init.h> #include <pci.h> diff --git a/board/freescale/p1_p2_rdb_pc/spl.c b/board/freescale/p1_p2_rdb_pc/spl.c index 908f4bc96f5..6ed0a816d93 100644 --- a/board/freescale/p1_p2_rdb_pc/spl.c +++ b/board/freescale/p1_p2_rdb_pc/spl.c @@ -4,9 +4,11 @@ */ #include <common.h> +#include <clock_legacy.h> #include <console.h> #include <env.h> #include <env_internal.h> +#include <init.h> #include <ns16550.h> #include <malloc.h> #include <mmc.h> diff --git a/board/freescale/p1_p2_rdb_pc/spl_minimal.c b/board/freescale/p1_p2_rdb_pc/spl_minimal.c index d8ae1f835cf..ced5f3c3b5d 100644 --- a/board/freescale/p1_p2_rdb_pc/spl_minimal.c +++ b/board/freescale/p1_p2_rdb_pc/spl_minimal.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <init.h> #include <ns16550.h> #include <asm/io.h> #include <nand.h> diff --git a/board/freescale/p2041rdb/p2041rdb.c b/board/freescale/p2041rdb/p2041rdb.c index 78f89fc4cb7..95ed0ef429e 100644 --- a/board/freescale/p2041rdb/p2041rdb.c +++ b/board/freescale/p2041rdb/p2041rdb.c @@ -6,6 +6,7 @@ #include <common.h> #include <command.h> #include <env.h> +#include <fdt_support.h> #include <init.h> #include <netdev.h> #include <linux/compiler.h> diff --git a/board/freescale/qemu-ppce500/qemu-ppce500.c b/board/freescale/qemu-ppce500/qemu-ppce500.c index 381d40d67a0..e804cfe986b 100644 --- a/board/freescale/qemu-ppce500/qemu-ppce500.c +++ b/board/freescale/qemu-ppce500/qemu-ppce500.c @@ -9,6 +9,7 @@ #include <env.h> #include <init.h> #include <pci.h> +#include <time.h> #include <asm/processor.h> #include <asm/mmu.h> #include <asm/fsl_pci.h> @@ -323,7 +324,7 @@ void get_sys_info(sys_info_t *sys_info) sys_info->freq_processor[0] = freq; } -int get_clocks (void) +int get_clocks(void) { sys_info_t sys_info; @@ -337,7 +338,7 @@ int get_clocks (void) return 0; } -unsigned long get_tbclk (void) +unsigned long get_tbclk(void) { void *fdt = get_fdt_virt(); int cpus_node = fdt_path_offset(fdt, "/cpus"); @@ -350,7 +351,7 @@ unsigned long get_tbclk (void) * get_bus_freq * return system bus freq in Hz *********************************************/ -ulong get_bus_freq (ulong dummy) +ulong get_bus_freq(ulong dummy) { sys_info_t sys_info; get_sys_info(&sys_info); diff --git a/board/freescale/s32v234evb/s32v234evb.c b/board/freescale/s32v234evb/s32v234evb.c index 9bc9ddf6492..a7301e2a2e9 100644 --- a/board/freescale/s32v234evb/s32v234evb.c +++ b/board/freescale/s32v234evb/s32v234evb.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <init.h> #include <asm/io.h> #include <asm/arch/imx-regs.h> #include <asm/arch/siul.h> diff --git a/board/freescale/t102xqds/spl.c b/board/freescale/t102xqds/spl.c index 7a499a559fb..9f4a43ed560 100644 --- a/board/freescale/t102xqds/spl.c +++ b/board/freescale/t102xqds/spl.c @@ -3,8 +3,10 @@ */ #include <common.h> +#include <clock_legacy.h> #include <console.h> #include <env_internal.h> +#include <init.h> #include <malloc.h> #include <ns16550.h> #include <nand.h> diff --git a/board/freescale/t102xqds/t102xqds.c b/board/freescale/t102xqds/t102xqds.c index 85f8517d798..e42337e47a4 100644 --- a/board/freescale/t102xqds/t102xqds.c +++ b/board/freescale/t102xqds/t102xqds.c @@ -6,6 +6,7 @@ #include <common.h> #include <command.h> #include <env.h> +#include <fdt_support.h> #include <i2c.h> #include <init.h> #include <netdev.h> diff --git a/board/freescale/t102xrdb/spl.c b/board/freescale/t102xrdb/spl.c index c579be1cb25..aed0721c0da 100644 --- a/board/freescale/t102xrdb/spl.c +++ b/board/freescale/t102xrdb/spl.c @@ -3,8 +3,10 @@ */ #include <common.h> +#include <clock_legacy.h> #include <console.h> #include <env_internal.h> +#include <init.h> #include <malloc.h> #include <ns16550.h> #include <nand.h> diff --git a/board/freescale/t102xrdb/t102xrdb.c b/board/freescale/t102xrdb/t102xrdb.c index ab07c1f8ddb..eee09a57019 100644 --- a/board/freescale/t102xrdb/t102xrdb.c +++ b/board/freescale/t102xrdb/t102xrdb.c @@ -6,6 +6,7 @@ #include <common.h> #include <command.h> #include <env.h> +#include <fdt_support.h> #include <i2c.h> #include <init.h> #include <netdev.h> diff --git a/board/freescale/t1040qds/diu.c b/board/freescale/t1040qds/diu.c index 804966791c6..ab9e922a927 100644 --- a/board/freescale/t1040qds/diu.c +++ b/board/freescale/t1040qds/diu.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <command.h> #include <linux/ctype.h> #include <asm/io.h> diff --git a/board/freescale/t1040qds/t1040qds.c b/board/freescale/t1040qds/t1040qds.c index 61dedf4c06c..92dd9237ec7 100644 --- a/board/freescale/t1040qds/t1040qds.c +++ b/board/freescale/t1040qds/t1040qds.c @@ -6,6 +6,7 @@ #include <common.h> #include <command.h> #include <env.h> +#include <fdt_support.h> #include <i2c.h> #include <init.h> #include <netdev.h> diff --git a/board/freescale/t104xrdb/diu.c b/board/freescale/t104xrdb/diu.c index aa56b8ea24e..25c8597202a 100644 --- a/board/freescale/t104xrdb/diu.c +++ b/board/freescale/t104xrdb/diu.c @@ -4,6 +4,7 @@ * Author: Priyanka Jain <Priyanka.Jain@freescale.com> */ +#include <clock_legacy.h> #include <asm/io.h> #include <common.h> #include <command.h> diff --git a/board/freescale/t104xrdb/spl.c b/board/freescale/t104xrdb/spl.c index 2d1342fb99d..2306d0391ea 100644 --- a/board/freescale/t104xrdb/spl.c +++ b/board/freescale/t104xrdb/spl.c @@ -3,8 +3,10 @@ */ #include <common.h> +#include <clock_legacy.h> #include <console.h> #include <env_internal.h> +#include <init.h> #include <malloc.h> #include <ns16550.h> #include <nand.h> diff --git a/board/freescale/t104xrdb/t104xrdb.c b/board/freescale/t104xrdb/t104xrdb.c index 7dacd0c5f1f..dc3b59d26f9 100644 --- a/board/freescale/t104xrdb/t104xrdb.c +++ b/board/freescale/t104xrdb/t104xrdb.c @@ -6,6 +6,7 @@ #include <common.h> #include <command.h> #include <env.h> +#include <fdt_support.h> #include <hwconfig.h> #include <init.h> #include <netdev.h> diff --git a/board/freescale/t208xqds/spl.c b/board/freescale/t208xqds/spl.c index f0499ad7e54..40eb5d30a66 100644 --- a/board/freescale/t208xqds/spl.c +++ b/board/freescale/t208xqds/spl.c @@ -3,8 +3,10 @@ */ #include <common.h> +#include <clock_legacy.h> #include <console.h> #include <env_internal.h> +#include <init.h> #include <malloc.h> #include <ns16550.h> #include <nand.h> diff --git a/board/freescale/t208xqds/t208xqds.c b/board/freescale/t208xqds/t208xqds.c index 6c34db42199..79cc1543f95 100644 --- a/board/freescale/t208xqds/t208xqds.c +++ b/board/freescale/t208xqds/t208xqds.c @@ -6,6 +6,7 @@ #include <common.h> #include <command.h> #include <env.h> +#include <fdt_support.h> #include <i2c.h> #include <init.h> #include <netdev.h> diff --git a/board/freescale/t208xrdb/spl.c b/board/freescale/t208xrdb/spl.c index d7ca0dd6db2..27e87da4093 100644 --- a/board/freescale/t208xrdb/spl.c +++ b/board/freescale/t208xrdb/spl.c @@ -3,8 +3,10 @@ */ #include <common.h> +#include <clock_legacy.h> #include <console.h> #include <env_internal.h> +#include <init.h> #include <malloc.h> #include <ns16550.h> #include <nand.h> diff --git a/board/freescale/t208xrdb/t208xrdb.c b/board/freescale/t208xrdb/t208xrdb.c index 3ac61f009c9..b5c20112d0e 100644 --- a/board/freescale/t208xrdb/t208xrdb.c +++ b/board/freescale/t208xrdb/t208xrdb.c @@ -6,6 +6,7 @@ #include <common.h> #include <command.h> #include <env.h> +#include <fdt_support.h> #include <i2c.h> #include <init.h> #include <netdev.h> diff --git a/board/freescale/t4qds/spl.c b/board/freescale/t4qds/spl.c index df81205e88d..d72d207a760 100644 --- a/board/freescale/t4qds/spl.c +++ b/board/freescale/t4qds/spl.c @@ -3,8 +3,10 @@ */ #include <common.h> +#include <clock_legacy.h> #include <console.h> #include <env_internal.h> +#include <init.h> #include <asm/spl.h> #include <malloc.h> #include <ns16550.h> diff --git a/board/freescale/t4qds/t4240emu.c b/board/freescale/t4qds/t4240emu.c index da050bf800f..104b40a1109 100644 --- a/board/freescale/t4qds/t4240emu.c +++ b/board/freescale/t4qds/t4240emu.c @@ -6,6 +6,7 @@ #include <common.h> #include <command.h> #include <env.h> +#include <fdt_support.h> #include <i2c.h> #include <init.h> #include <netdev.h> diff --git a/board/freescale/t4qds/t4240qds.c b/board/freescale/t4qds/t4240qds.c index 11f7489fa21..5608774afd1 100644 --- a/board/freescale/t4qds/t4240qds.c +++ b/board/freescale/t4qds/t4240qds.c @@ -6,6 +6,7 @@ #include <common.h> #include <command.h> #include <env.h> +#include <fdt_support.h> #include <i2c.h> #include <init.h> #include <irq_func.h> diff --git a/board/freescale/t4rdb/spl.c b/board/freescale/t4rdb/spl.c index ec3978a70aa..5d018c316c6 100644 --- a/board/freescale/t4rdb/spl.c +++ b/board/freescale/t4rdb/spl.c @@ -6,8 +6,10 @@ */ #include <common.h> +#include <clock_legacy.h> #include <console.h> #include <env_internal.h> +#include <init.h> #include <asm/spl.h> #include <malloc.h> #include <ns16550.h> diff --git a/board/freescale/t4rdb/t4240rdb.c b/board/freescale/t4rdb/t4240rdb.c index 48aa6b6822e..8015666eccd 100644 --- a/board/freescale/t4rdb/t4240rdb.c +++ b/board/freescale/t4rdb/t4240rdb.c @@ -6,6 +6,7 @@ #include <common.h> #include <command.h> #include <env.h> +#include <fdt_support.h> #include <i2c.h> #include <init.h> #include <netdev.h> diff --git a/board/freescale/vf610twr/vf610twr.c b/board/freescale/vf610twr/vf610twr.c index f6cd7a4c8d3..17427f23d8b 100644 --- a/board/freescale/vf610twr/vf610twr.c +++ b/board/freescale/vf610twr/vf610twr.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <init.h> #include <asm/io.h> #include <asm/arch/imx-regs.h> #include <asm/arch/iomux-vf610.h> diff --git a/board/gateworks/gw_ventana/gw_ventana_spl.c b/board/gateworks/gw_ventana/gw_ventana_spl.c index b0891379a17..80fec5f9cf3 100644 --- a/board/gateworks/gw_ventana/gw_ventana_spl.c +++ b/board/gateworks/gw_ventana/gw_ventana_spl.c @@ -6,6 +6,7 @@ #include <common.h> #include <env.h> +#include <hang.h> #include <asm/io.h> #include <asm/arch/crm_regs.h> #include <asm/arch/mx6-ddr.h> diff --git a/board/gdsys/mpc8308/sdram.c b/board/gdsys/mpc8308/sdram.c index 2a77fed2702..9695fb0a10d 100644 --- a/board/gdsys/mpc8308/sdram.c +++ b/board/gdsys/mpc8308/sdram.c @@ -14,6 +14,7 @@ #ifndef CONFIG_MPC83XX_SDRAM #include <common.h> +#include <init.h> #include <mpc83xx.h> #include <spd_sdram.h> diff --git a/board/gdsys/p1022/controlcenterd-id.c b/board/gdsys/p1022/controlcenterd-id.c index 04d38095665..ad56dd7d019 100644 --- a/board/gdsys/p1022/controlcenterd-id.c +++ b/board/gdsys/p1022/controlcenterd-id.c @@ -14,6 +14,7 @@ #include <command.h> #include <dm.h> #include <env.h> +#include <hang.h> #include <malloc.h> #include <fs.h> #include <i2c.h> diff --git a/board/gdsys/p1022/diu.c b/board/gdsys/p1022/diu.c index dfccbed7637..7e1e6ce85c0 100644 --- a/board/gdsys/p1022/diu.c +++ b/board/gdsys/p1022/diu.c @@ -7,6 +7,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <command.h> #include <linux/ctype.h> #include <asm/io.h> diff --git a/board/hisilicon/hikey/hikey.c b/board/hisilicon/hikey/hikey.c index 940ae82c45b..84400090b30 100644 --- a/board/hisilicon/hikey/hikey.c +++ b/board/hisilicon/hikey/hikey.c @@ -4,7 +4,9 @@ * Peter Griffin <peter.griffin@linaro.org> */ #include <common.h> +#include <cpu_func.h> #include <dm.h> +#include <fdt_support.h> #include <dm/platform_data/serial_pl01x.h> #include <errno.h> #include <malloc.h> diff --git a/board/hisilicon/hikey960/hikey960.c b/board/hisilicon/hikey960/hikey960.c index eb9b99eaa92..84c26e0c14f 100644 --- a/board/hisilicon/hikey960/hikey960.c +++ b/board/hisilicon/hikey960/hikey960.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <dm.h> #include <errno.h> #include <asm/io.h> diff --git a/board/hisilicon/poplar/poplar.c b/board/hisilicon/poplar/poplar.c index 4926419a905..36999bdcea7 100644 --- a/board/hisilicon/poplar/poplar.c +++ b/board/hisilicon/poplar/poplar.c @@ -4,8 +4,10 @@ * Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org> */ +#include <cpu_func.h> #include <dm.h> #include <common.h> +#include <init.h> #include <asm/io.h> #include <dm/platform_data/serial_pl01x.h> #include <asm/arch/hi3798cv200.h> diff --git a/board/ids/ids8313/ids8313.c b/board/ids/ids8313/ids8313.c index caa36064f05..6e74e939c3c 100644 --- a/board/ids/ids8313/ids8313.c +++ b/board/ids/ids8313/ids8313.c @@ -12,6 +12,8 @@ */ #include <common.h> +#include <fdt_support.h> +#include <init.h> #include <mpc83xx.h> #include <spi.h> #include <linux/libfdt.h> diff --git a/board/inversepath/usbarmory/usbarmory.c b/board/inversepath/usbarmory/usbarmory.c index 19510184d8a..4fa34e1b51c 100644 --- a/board/inversepath/usbarmory/usbarmory.c +++ b/board/inversepath/usbarmory/usbarmory.c @@ -9,6 +9,8 @@ #include <common.h> #include <command.h> +#include <fs.h> +#include <init.h> #include <asm/io.h> #include <asm/arch/imx-regs.h> #include <asm/arch/sys_proto.h> diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c index feca7be3727..23bbdcccacf 100644 --- a/board/keymile/km83xx/km83xx.c +++ b/board/keymile/km83xx/km83xx.c @@ -15,6 +15,7 @@ #include <common.h> #include <env.h> +#include <fdt_support.h> #include <init.h> #include <ioports.h> #include <mpc83xx.h> diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c index 7aa9fa7fcad..473acfca68b 100644 --- a/board/keymile/km_arm/km_arm.c +++ b/board/keymile/km_arm/km_arm.c @@ -16,6 +16,7 @@ #include <i2c.h> #include <init.h> #include <nand.h> +#include <net.h> #include <netdev.h> #include <miiphy.h> #include <spi.h> diff --git a/board/keymile/kmp204x/kmp204x.c b/board/keymile/kmp204x/kmp204x.c index 9e1956c8b7f..cfb23a53f74 100644 --- a/board/keymile/kmp204x/kmp204x.c +++ b/board/keymile/kmp204x/kmp204x.c @@ -9,6 +9,7 @@ #include <common.h> #include <command.h> #include <env.h> +#include <fdt_support.h> #include <init.h> #include <netdev.h> #include <linux/compiler.h> diff --git a/board/kmc/kzm9g/kzm9g.c b/board/kmc/kzm9g/kzm9g.c index 8148ace2fe0..6ef960b06ba 100644 --- a/board/kmc/kzm9g/kzm9g.c +++ b/board/kmc/kzm9g/kzm9g.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <asm/io.h> #include <asm/arch/sys_proto.h> #include <asm/gpio.h> diff --git a/board/kosagi/novena/novena_spl.c b/board/kosagi/novena/novena_spl.c index 7521cacaf95..bc52b91b2f4 100644 --- a/board/kosagi/novena/novena_spl.c +++ b/board/kosagi/novena/novena_spl.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <init.h> #include <asm/io.h> #include <asm/arch/clock.h> diff --git a/board/l+g/vinco/vinco.c b/board/l+g/vinco/vinco.c index 029ab123918..5a998e37d8a 100644 --- a/board/l+g/vinco/vinco.c +++ b/board/l+g/vinco/vinco.c @@ -10,6 +10,7 @@ */ #include <common.h> +#include <init.h> #include <asm/io.h> #include <asm/arch/at91_common.h> #include <asm/arch/at91_pmc.h> diff --git a/board/laird/wb45n/wb45n.c b/board/laird/wb45n/wb45n.c index e7f31ec9e72..0d1be3f784e 100644 --- a/board/laird/wb45n/wb45n.c +++ b/board/laird/wb45n/wb45n.c @@ -3,6 +3,7 @@ */ #include <common.h> +#include <init.h> #include <asm/io.h> #include <asm/arch/at91sam9x5_matrix.h> #include <asm/arch/at91sam9_smc.h> diff --git a/board/liebherr/display5/spl.c b/board/liebherr/display5/spl.c index e845edf0683..765463e3707 100644 --- a/board/liebherr/display5/spl.c +++ b/board/liebherr/display5/spl.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <env.h> #include <serial.h> #include <spl.h> diff --git a/board/mini-box/picosam9g45/picosam9g45.c b/board/mini-box/picosam9g45/picosam9g45.c index 9a724040b07..5e55918fa65 100644 --- a/board/mini-box/picosam9g45/picosam9g45.c +++ b/board/mini-box/picosam9g45/picosam9g45.c @@ -11,6 +11,7 @@ */ #include <common.h> +#include <init.h> #include <vsprintf.h> #include <asm/io.h> #include <asm/arch/clk.h> diff --git a/board/mpc8308_p1m/sdram.c b/board/mpc8308_p1m/sdram.c index baf70d8807b..cbf8781746e 100644 --- a/board/mpc8308_p1m/sdram.c +++ b/board/mpc8308_p1m/sdram.c @@ -8,6 +8,7 @@ */ #include <common.h> +#include <init.h> #include <mpc83xx.h> #include <asm/bitops.h> diff --git a/board/phytec/pcl063/pcl063.c b/board/phytec/pcl063/pcl063.c index 96dd9e38f37..9e6940f9c76 100644 --- a/board/phytec/pcl063/pcl063.c +++ b/board/phytec/pcl063/pcl063.c @@ -6,6 +6,7 @@ * Copyright (C) 2015-2016 Stefan Roese <sr@denx.de> */ +#include <init.h> #include <asm/arch/clock.h> #include <asm/arch/crm_regs.h> #include <asm/arch/mx6-pins.h> diff --git a/board/phytec/phycore_am335x_r2/board.c b/board/phytec/phycore_am335x_r2/board.c index 02d6c27cec4..8964fb5ddac 100644 --- a/board/phytec/phycore_am335x_r2/board.c +++ b/board/phytec/phycore_am335x_r2/board.c @@ -11,6 +11,7 @@ */ #include <common.h> +#include <init.h> #include <spl.h> #include <asm/arch/cpu.h> #include <asm/arch/ddr_defs.h> diff --git a/board/phytium/durian/durian.c b/board/phytium/durian/durian.c index 59f307d3573..40dd27a7b0d 100644 --- a/board/phytium/durian/durian.c +++ b/board/phytium/durian/durian.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <asm/armv8/mmu.h> #include <asm/system.h> #include <asm/io.h> diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.c b/board/qualcomm/dragonboard410c/dragonboard410c.c index 254af7907ad..81bd8bd95b1 100644 --- a/board/qualcomm/dragonboard410c/dragonboard410c.c +++ b/board/qualcomm/dragonboard410c/dragonboard410c.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <dm.h> #include <env.h> #include <init.h> diff --git a/board/qualcomm/dragonboard820c/dragonboard820c.c b/board/qualcomm/dragonboard820c/dragonboard820c.c index 7a889646df8..6c096b49a1f 100644 --- a/board/qualcomm/dragonboard820c/dragonboard820c.c +++ b/board/qualcomm/dragonboard820c/dragonboard820c.c @@ -5,6 +5,7 @@ * (C) Copyright 2017 Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org> */ +#include <cpu_func.h> #include <asm/arch/sysmap-apq8096.h> #include <env.h> #include <linux/arm-smccc.h> diff --git a/board/renesas/alt/alt.c b/board/renesas/alt/alt.c index 10ef7f931b1..a6d7cb48a24 100644 --- a/board/renesas/alt/alt.c +++ b/board/renesas/alt/alt.c @@ -6,7 +6,9 @@ */ #include <common.h> +#include <cpu_func.h> #include <env.h> +#include <hang.h> #include <malloc.h> #include <dm.h> #include <dm/platform_data/serial_sh.h> diff --git a/board/renesas/alt/alt_spl.c b/board/renesas/alt/alt_spl.c index 4260dff1194..dbb210584d5 100644 --- a/board/renesas/alt/alt_spl.c +++ b/board/renesas/alt/alt_spl.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <malloc.h> #include <dm/platform_data/serial_sh.h> #include <asm/processor.h> diff --git a/board/renesas/blanche/blanche.c b/board/renesas/blanche/blanche.c index 08c54486095..7232370d6f4 100644 --- a/board/renesas/blanche/blanche.c +++ b/board/renesas/blanche/blanche.c @@ -7,6 +7,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <asm/arch/mmc.h> #include <asm/arch/rcar-mstp.h> #include <asm/arch/rmobile.h> diff --git a/board/renesas/condor/condor.c b/board/renesas/condor/condor.c index d1cbbc33399..6505beda812 100644 --- a/board/renesas/condor/condor.c +++ b/board/renesas/condor/condor.c @@ -7,6 +7,8 @@ */ #include <common.h> +#include <cpu_func.h> +#include <hang.h> #include <asm/processor.h> #include <asm/mach-types.h> #include <asm/io.h> diff --git a/board/renesas/draak/draak.c b/board/renesas/draak/draak.c index 46d9f74785c..2f9364c484e 100644 --- a/board/renesas/draak/draak.c +++ b/board/renesas/draak/draak.c @@ -7,6 +7,8 @@ */ #include <common.h> +#include <cpu_func.h> +#include <hang.h> #include <malloc.h> #include <netdev.h> #include <dm.h> diff --git a/board/renesas/eagle/eagle.c b/board/renesas/eagle/eagle.c index d6240b19efb..cf06a173e49 100644 --- a/board/renesas/eagle/eagle.c +++ b/board/renesas/eagle/eagle.c @@ -7,6 +7,8 @@ */ #include <common.h> +#include <cpu_func.h> +#include <hang.h> #include <malloc.h> #include <netdev.h> #include <dm.h> diff --git a/board/renesas/ebisu/ebisu.c b/board/renesas/ebisu/ebisu.c index cb7d432a15a..81d7f8eafab 100644 --- a/board/renesas/ebisu/ebisu.c +++ b/board/renesas/ebisu/ebisu.c @@ -7,6 +7,8 @@ */ #include <common.h> +#include <cpu_func.h> +#include <hang.h> #include <malloc.h> #include <netdev.h> #include <dm.h> diff --git a/board/renesas/gose/gose.c b/board/renesas/gose/gose.c index f86c9f1a635..eb6ee6f6a4c 100644 --- a/board/renesas/gose/gose.c +++ b/board/renesas/gose/gose.c @@ -6,7 +6,9 @@ */ #include <common.h> +#include <cpu_func.h> #include <env.h> +#include <hang.h> #include <malloc.h> #include <dm.h> #include <dm/platform_data/serial_sh.h> diff --git a/board/renesas/gose/gose_spl.c b/board/renesas/gose/gose_spl.c index 2f94d3e76c7..42a67581488 100644 --- a/board/renesas/gose/gose_spl.c +++ b/board/renesas/gose/gose_spl.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <malloc.h> #include <dm/platform_data/serial_sh.h> #include <asm/processor.h> diff --git a/board/renesas/grpeach/grpeach.c b/board/renesas/grpeach/grpeach.c index 4f901eea713..ba904609ae7 100644 --- a/board/renesas/grpeach/grpeach.c +++ b/board/renesas/grpeach/grpeach.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <asm/io.h> #include <asm/arch/sys_proto.h> diff --git a/board/renesas/koelsch/koelsch.c b/board/renesas/koelsch/koelsch.c index 841d337f4d3..e09d3d0a634 100644 --- a/board/renesas/koelsch/koelsch.c +++ b/board/renesas/koelsch/koelsch.c @@ -7,7 +7,9 @@ */ #include <common.h> +#include <cpu_func.h> #include <env.h> +#include <hang.h> #include <malloc.h> #include <dm.h> #include <dm/platform_data/serial_sh.h> diff --git a/board/renesas/koelsch/koelsch_spl.c b/board/renesas/koelsch/koelsch_spl.c index b7cdcb22162..b3530d7ce74 100644 --- a/board/renesas/koelsch/koelsch_spl.c +++ b/board/renesas/koelsch/koelsch_spl.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <malloc.h> #include <dm/platform_data/serial_sh.h> #include <asm/processor.h> diff --git a/board/renesas/lager/lager.c b/board/renesas/lager/lager.c index 3cb1a56142a..9ac95159258 100644 --- a/board/renesas/lager/lager.c +++ b/board/renesas/lager/lager.c @@ -8,8 +8,10 @@ */ #include <common.h> +#include <cpu_func.h> #include <env.h> #include <env_internal.h> +#include <hang.h> #include <malloc.h> #include <netdev.h> #include <dm.h> diff --git a/board/renesas/lager/lager_spl.c b/board/renesas/lager/lager_spl.c index ba9b494476e..d7db361b12f 100644 --- a/board/renesas/lager/lager_spl.c +++ b/board/renesas/lager/lager_spl.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <malloc.h> #include <dm/platform_data/serial_sh.h> #include <asm/processor.h> diff --git a/board/renesas/porter/porter.c b/board/renesas/porter/porter.c index 86f79da7fdb..097710b4791 100644 --- a/board/renesas/porter/porter.c +++ b/board/renesas/porter/porter.c @@ -7,7 +7,9 @@ */ #include <common.h> +#include <cpu_func.h> #include <env.h> +#include <hang.h> #include <malloc.h> #include <dm.h> #include <dm/platform_data/serial_sh.h> diff --git a/board/renesas/porter/porter_spl.c b/board/renesas/porter/porter_spl.c index 7bf6823e057..026220d9e24 100644 --- a/board/renesas/porter/porter_spl.c +++ b/board/renesas/porter/porter_spl.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <malloc.h> #include <dm/platform_data/serial_sh.h> #include <asm/processor.h> diff --git a/board/renesas/rcar-common/gen3-spl.c b/board/renesas/rcar-common/gen3-spl.c index 27140c5c35c..d9741c19398 100644 --- a/board/renesas/rcar-common/gen3-spl.c +++ b/board/renesas/rcar-common/gen3-spl.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <asm/io.h> #include <spl.h> diff --git a/board/renesas/salvator-x/salvator-x.c b/board/renesas/salvator-x/salvator-x.c index 22fe9619cfb..058fa6fbb61 100644 --- a/board/renesas/salvator-x/salvator-x.c +++ b/board/renesas/salvator-x/salvator-x.c @@ -8,6 +8,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <malloc.h> #include <netdev.h> #include <dm.h> diff --git a/board/renesas/silk/silk.c b/board/renesas/silk/silk.c index 25221e3c55c..e7cbd757764 100644 --- a/board/renesas/silk/silk.c +++ b/board/renesas/silk/silk.c @@ -7,7 +7,9 @@ */ #include <common.h> +#include <cpu_func.h> #include <env.h> +#include <hang.h> #include <malloc.h> #include <dm.h> #include <dm/platform_data/serial_sh.h> diff --git a/board/renesas/silk/silk_spl.c b/board/renesas/silk/silk_spl.c index 64ee75a63e1..a2c397f9358 100644 --- a/board/renesas/silk/silk_spl.c +++ b/board/renesas/silk/silk_spl.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <malloc.h> #include <dm/platform_data/serial_sh.h> #include <asm/processor.h> diff --git a/board/renesas/stout/cpld.c b/board/renesas/stout/cpld.c index cffdc3e9d21..e6c2051bd4b 100644 --- a/board/renesas/stout/cpld.c +++ b/board/renesas/stout/cpld.c @@ -8,6 +8,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <asm/io.h> #include <asm/gpio.h> #include "cpld.h" diff --git a/board/renesas/stout/stout_spl.c b/board/renesas/stout/stout_spl.c index 05a3ced97c5..8d01efce56c 100644 --- a/board/renesas/stout/stout_spl.c +++ b/board/renesas/stout/stout_spl.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <malloc.h> #include <dm/platform_data/serial_sh.h> #include <asm/processor.h> diff --git a/board/ronetix/pm9261/pm9261.c b/board/ronetix/pm9261/pm9261.c index bad673412a1..57f8a20ccb0 100644 --- a/board/ronetix/pm9261/pm9261.c +++ b/board/ronetix/pm9261/pm9261.c @@ -8,6 +8,7 @@ */ #include <common.h> +#include <init.h> #include <vsprintf.h> #include <linux/sizes.h> #include <asm/io.h> diff --git a/board/ronetix/pm9263/pm9263.c b/board/ronetix/pm9263/pm9263.c index 2da39c4acd5..3cd6384fc32 100644 --- a/board/ronetix/pm9263/pm9263.c +++ b/board/ronetix/pm9263/pm9263.c @@ -8,6 +8,7 @@ */ #include <common.h> +#include <init.h> #include <linux/sizes.h> #include <asm/io.h> #include <asm/gpio.h> diff --git a/board/ronetix/pm9g45/pm9g45.c b/board/ronetix/pm9g45/pm9g45.c index c5d28c61e2d..17dc7d6b4dd 100644 --- a/board/ronetix/pm9g45/pm9g45.c +++ b/board/ronetix/pm9g45/pm9g45.c @@ -11,6 +11,7 @@ */ #include <common.h> +#include <init.h> #include <linux/sizes.h> #include <asm/io.h> #include <asm/gpio.h> diff --git a/board/samsung/arndale/arndale.c b/board/samsung/arndale/arndale.c index 1d547b1c38d..9abad3f8249 100644 --- a/board/samsung/arndale/arndale.c +++ b/board/samsung/arndale/arndale.c @@ -5,6 +5,7 @@ #include <common.h> #include <cpu_func.h> +#include <init.h> #include <usb.h> #include <asm/gpio.h> #include <asm/arch/pinmux.h> diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c index ee2fc7971eb..5d4646d14c8 100644 --- a/board/samsung/common/board.c +++ b/board/samsung/common/board.c @@ -8,6 +8,7 @@ #include <cros_ec.h> #include <errno.h> #include <fdtdec.h> +#include <hang.h> #include <init.h> #include <spi.h> #include <tmu.h> diff --git a/board/samsung/smdkc100/smdkc100.c b/board/samsung/smdkc100/smdkc100.c index 13c057b426f..a80300b0c00 100644 --- a/board/samsung/smdkc100/smdkc100.c +++ b/board/samsung/smdkc100/smdkc100.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <init.h> #include <asm/gpio.h> #include <asm/io.h> #include <asm/arch/sromc.h> diff --git a/board/samsung/smdkv310/smdkv310.c b/board/samsung/smdkv310/smdkv310.c index 0eba7b66ee9..05369d22271 100644 --- a/board/samsung/smdkv310/smdkv310.c +++ b/board/samsung/smdkv310/smdkv310.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <init.h> #include <asm/gpio.h> #include <asm/io.h> #include <netdev.h> diff --git a/board/sbc8349/sbc8349.c b/board/sbc8349/sbc8349.c index a647de6b112..9051392cd09 100644 --- a/board/sbc8349/sbc8349.c +++ b/board/sbc8349/sbc8349.c @@ -8,6 +8,7 @@ */ #include <common.h> +#include <fdt_support.h> #include <ioports.h> #include <mpc83xx.h> #include <asm/mpc8349_pci.h> diff --git a/board/sbc8641d/sbc8641d.c b/board/sbc8641d/sbc8641d.c index 0a9dab89396..d053eaeec34 100644 --- a/board/sbc8641d/sbc8641d.c +++ b/board/sbc8641d/sbc8641d.c @@ -56,7 +56,7 @@ int dram_init(void) } #if defined(CONFIG_SYS_DRAM_TEST) -int testdram (void) +int testdram(void) { uint *pstart = (uint *) CONFIG_SYS_MEMTEST_START; uint *pend = (uint *) CONFIG_SYS_MEMTEST_END; diff --git a/board/seco/mx6quq7/mx6quq7.c b/board/seco/mx6quq7/mx6quq7.c index c0a93175fbd..fabc348440d 100644 --- a/board/seco/mx6quq7/mx6quq7.c +++ b/board/seco/mx6quq7/mx6quq7.c @@ -7,6 +7,7 @@ * Modified by: Boris Brezillon <boris.brezillon@free-electrons.com> */ +#include <init.h> #include <asm/arch/clock.h> #include <asm/arch/imx-regs.h> #include <asm/arch/iomux.h> diff --git a/board/siemens/corvus/board.c b/board/siemens/corvus/board.c index a569bd53afe..03768201c3a 100644 --- a/board/siemens/corvus/board.c +++ b/board/siemens/corvus/board.c @@ -12,6 +12,7 @@ #include <common.h> #include <dm.h> +#include <init.h> #include <asm/io.h> #include <asm/arch/at91sam9g45_matrix.h> #include <asm/arch/at91sam9_smc.h> diff --git a/board/siemens/smartweb/smartweb.c b/board/siemens/smartweb/smartweb.c index e1be384994b..cb7206a5616 100644 --- a/board/siemens/smartweb/smartweb.c +++ b/board/siemens/smartweb/smartweb.c @@ -17,6 +17,7 @@ #include <common.h> #include <dm.h> +#include <init.h> #include <asm/io.h> #include <asm/arch/at91sam9_sdramc.h> #include <asm/arch/at91sam9260_matrix.h> diff --git a/board/siemens/taurus/taurus.c b/board/siemens/taurus/taurus.c index 1cf1f9e1f7c..0979df563ae 100644 --- a/board/siemens/taurus/taurus.c +++ b/board/siemens/taurus/taurus.c @@ -15,6 +15,7 @@ #include <common.h> #include <dm.h> #include <env.h> +#include <init.h> #include <asm/io.h> #include <asm/arch/at91sam9260_matrix.h> #include <asm/arch/at91sam9_smc.h> diff --git a/board/socrates/sdram.c b/board/socrates/sdram.c index 4c76b4d0a80..8eb4f8fc950 100644 --- a/board/socrates/sdram.c +++ b/board/socrates/sdram.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <init.h> #include <asm/processor.h> #include <asm/immap_85xx.h> #include <fsl_ddr_sdram.h> @@ -61,7 +62,7 @@ phys_size_t fixed_sdram(void) #endif #if defined(CONFIG_SYS_DRAM_TEST) -int testdram (void) +int testdram(void) { uint *pstart = (uint *) CONFIG_SYS_MEMTEST_START; uint *pend = (uint *) CONFIG_SYS_MEMTEST_END; diff --git a/board/socrates/socrates.c b/board/socrates/socrates.c index 5f58b4c21bd..b0ddee7906a 100644 --- a/board/socrates/socrates.c +++ b/board/socrates/socrates.c @@ -11,6 +11,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <env.h> #include <pci.h> #include <asm/processor.h> @@ -165,11 +166,11 @@ void local_bus_init (void) /* Init UPMA for FPGA access */ out_be32 (&lbc->mamr, 0x44440); /* Use a customer-supplied value */ - upmconfig (UPMA, (uint *)UPMTableA, sizeof(UPMTableA)/sizeof(int)); + upmconfig(UPMA, (uint *)UPMTableA, sizeof(UPMTableA) / sizeof(int)); /* Init UPMB for Lime controller access */ out_be32 (&lbc->mbmr, 0x444440); /* Use a customer-supplied value */ - upmconfig (UPMB, (uint *)UPMTableB, sizeof(UPMTableB)/sizeof(int)); + upmconfig(UPMB, (uint *)UPMTableB, sizeof(UPMTableB) / sizeof(int)); } #ifdef CONFIG_BOARD_EARLY_INIT_R diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c index 4e298dabcbf..e82a43074fb 100644 --- a/board/st/stm32mp1/stm32mp1.c +++ b/board/st/stm32mp1/stm32mp1.c @@ -12,6 +12,7 @@ #include <env_internal.h> #include <g_dnl.h> #include <generic-phy.h> +#include <hang.h> #include <i2c.h> #include <init.h> #include <led.h> diff --git a/board/sunxi/board.c b/board/sunxi/board.c index b9450a0e36b..6afea6ef42e 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -13,6 +13,8 @@ #include <common.h> #include <dm.h> #include <env.h> +#include <hang.h> +#include <init.h> #include <mmc.h> #include <axp_pmic.h> #include <generic-phy.h> diff --git a/board/synopsys/emsdp/emsdp.c b/board/synopsys/emsdp/emsdp.c index 5ba9f862e14..c09ed8cff82 100644 --- a/board/synopsys/emsdp/emsdp.c +++ b/board/synopsys/emsdp/emsdp.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <dwmmc.h> #include <malloc.h> diff --git a/board/synopsys/iot_devkit/iot_devkit.c b/board/synopsys/iot_devkit/iot_devkit.c index 9dbdc128f8f..36aa8f6ae55 100644 --- a/board/synopsys/iot_devkit/iot_devkit.c +++ b/board/synopsys/iot_devkit/iot_devkit.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <malloc.h> #include <dwmmc.h> #include <linux/libfdt.h> diff --git a/board/sysam/amcore/amcore.c b/board/sysam/amcore/amcore.c index 0efea3d5cc3..4502005941f 100644 --- a/board/sysam/amcore/amcore.c +++ b/board/sysam/amcore/amcore.c @@ -8,6 +8,7 @@ */ #include <common.h> +#include <init.h> #include <asm/immap.h> #include <asm/io.h> #include <dm.h> diff --git a/board/sysam/stmark2/stmark2.c b/board/sysam/stmark2/stmark2.c index 790199a640d..ce8b541ccdf 100644 --- a/board/sysam/stmark2/stmark2.c +++ b/board/sysam/stmark2/stmark2.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <init.h> #include <spi.h> #include <asm/io.h> #include <asm/immap.h> diff --git a/board/technexion/pico-imx6ul/spl.c b/board/technexion/pico-imx6ul/spl.c index 7f520beeb08..41b053ab1c1 100644 --- a/board/technexion/pico-imx6ul/spl.c +++ b/board/technexion/pico-imx6ul/spl.c @@ -1,5 +1,9 @@ // SPDX-License-Identifier: GPL-2.0+ +#include <common.h> +#include <cpu_func.h> +#include <hang.h> +#include <init.h> #include <asm/arch/clock.h> #include <asm/arch/iomux.h> #include <asm/arch/imx-regs.h> diff --git a/board/technexion/pico-imx7d/spl.c b/board/technexion/pico-imx7d/spl.c index 8955622b815..6c432ca5a62 100644 --- a/board/technexion/pico-imx7d/spl.c +++ b/board/technexion/pico-imx7d/spl.c @@ -5,6 +5,7 @@ * Author: Richard Hu <richard.hu@technexion.com> */ +#include <cpu_func.h> #include <asm/arch/clock.h> #include <asm/arch/imx-regs.h> #include <asm/arch/crm_regs.h> diff --git a/board/technologic/ts4800/ts4800.c b/board/technologic/ts4800/ts4800.c index 82eb0c285cc..ff1a189c7e9 100644 --- a/board/technologic/ts4800/ts4800.c +++ b/board/technologic/ts4800/ts4800.c @@ -7,6 +7,7 @@ */ #include <common.h> +#include <init.h> #include <asm/io.h> #include <asm/gpio.h> #include <asm/arch/imx-regs.h> diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c index d12f1ebfdf9..36f86926bc3 100644 --- a/board/ti/am43xx/board.c +++ b/board/ti/am43xx/board.c @@ -10,6 +10,7 @@ #include <common.h> #include <eeprom.h> #include <env.h> +#include <fdt_support.h> #include <i2c.h> #include <init.h> #include <linux/errno.h> diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c index c755821b74f..c57473c8024 100644 --- a/board/ti/am57xx/board.c +++ b/board/ti/am57xx/board.c @@ -9,6 +9,7 @@ #include <common.h> #include <env.h> +#include <fdt_support.h> #include <init.h> #include <palmas.h> #include <sata.h> diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c index 79b8363b868..94001a4dc39 100644 --- a/board/ti/dra7xx/evm.c +++ b/board/ti/dra7xx/evm.c @@ -11,6 +11,7 @@ */ #include <common.h> #include <env.h> +#include <fdt_support.h> #include <init.h> #include <palmas.h> #include <sata.h> diff --git a/board/ti/ks2_evm/board.c b/board/ti/ks2_evm/board.c index e3305fbaf67..6554c0eb118 100644 --- a/board/ti/ks2_evm/board.c +++ b/board/ti/ks2_evm/board.c @@ -9,6 +9,8 @@ #include <common.h> #include "board.h" #include <env.h> +#include <hang.h> +#include <init.h> #include <spl.h> #include <exports.h> #include <fdt_support.h> diff --git a/board/ti/ks2_evm/board_k2g.c b/board/ti/ks2_evm/board_k2g.c index 920d0d3420f..c6a14a05546 100644 --- a/board/ti/ks2_evm/board_k2g.c +++ b/board/ti/ks2_evm/board_k2g.c @@ -8,6 +8,7 @@ #include <common.h> #include <eeprom.h> #include <env.h> +#include <hang.h> #include <init.h> #include <asm/arch/clock.h> #include <asm/ti-common/keystone_net.h> diff --git a/board/ti/ks2_evm/mux-k2g.h b/board/ti/ks2_evm/mux-k2g.h index 6aa785ea425..3ecf571c5c3 100644 --- a/board/ti/ks2_evm/mux-k2g.h +++ b/board/ti/ks2_evm/mux-k2g.h @@ -7,6 +7,7 @@ */ #include <common.h> +#include <hang.h> #include <asm/io.h> #include <asm/arch/mux-k2g.h> #include <asm/arch/hardware.h> diff --git a/board/timll/devkit3250/devkit3250.c b/board/timll/devkit3250/devkit3250.c index a4b963d463a..b455844c89d 100644 --- a/board/timll/devkit3250/devkit3250.c +++ b/board/timll/devkit3250/devkit3250.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <init.h> #include <asm/arch/sys_proto.h> #include <asm/arch/clk.h> #include <asm/arch/cpu.h> diff --git a/board/toradex/apalis-imx8/apalis-imx8.c b/board/toradex/apalis-imx8/apalis-imx8.c index 04830411872..fdfab8f3c91 100644 --- a/board/toradex/apalis-imx8/apalis-imx8.c +++ b/board/toradex/apalis-imx8/apalis-imx8.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <init.h> #include <asm/arch/clock.h> diff --git a/board/toradex/apalis_imx6/apalis_imx6.c b/board/toradex/apalis_imx6/apalis_imx6.c index d569782a192..3f85f1ac89b 100644 --- a/board/toradex/apalis_imx6/apalis_imx6.c +++ b/board/toradex/apalis_imx6/apalis_imx6.c @@ -7,6 +7,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <dm.h> #include <init.h> diff --git a/board/toradex/colibri-imx8x/colibri-imx8x.c b/board/toradex/colibri-imx8x/colibri-imx8x.c index adeee676434..857e9fe3454 100644 --- a/board/toradex/colibri-imx8x/colibri-imx8x.c +++ b/board/toradex/colibri-imx8x/colibri-imx8x.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <init.h> #include <asm/arch/clock.h> diff --git a/board/toradex/colibri_imx6/colibri_imx6.c b/board/toradex/colibri_imx6/colibri_imx6.c index 7db9d25544c..f04b7493119 100644 --- a/board/toradex/colibri_imx6/colibri_imx6.c +++ b/board/toradex/colibri_imx6/colibri_imx6.c @@ -7,6 +7,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <dm.h> #include <env.h> #include <init.h> diff --git a/board/toradex/colibri_imx7/colibri_imx7.c b/board/toradex/colibri_imx7/colibri_imx7.c index 77197e0fbb0..8727101aa38 100644 --- a/board/toradex/colibri_imx7/colibri_imx7.c +++ b/board/toradex/colibri_imx7/colibri_imx7.c @@ -3,6 +3,9 @@ * Copyright (C) 2016-2018 Toradex AG */ +#include <common.h> +#include <cpu_func.h> +#include <init.h> #include <asm/arch/clock.h> #include <asm/arch/crm_regs.h> #include <asm/arch/imx-regs.h> diff --git a/board/tqc/tqm834x/tqm834x.c b/board/tqc/tqm834x/tqm834x.c index 04941b26be4..02b3d2dea11 100644 --- a/board/tqc/tqm834x/tqm834x.c +++ b/board/tqc/tqm834x/tqm834x.c @@ -5,6 +5,8 @@ */ #include <common.h> +#include <fdt_support.h> +#include <init.h> #include <ioports.h> #include <mpc83xx.h> #include <asm/mpc8349_pci.h> diff --git a/board/ucRobotics/bubblegum_96/bubblegum_96.c b/board/ucRobotics/bubblegum_96/bubblegum_96.c index a4c202da193..c16f117bf8a 100644 --- a/board/ucRobotics/bubblegum_96/bubblegum_96.c +++ b/board/ucRobotics/bubblegum_96/bubblegum_96.c @@ -5,6 +5,7 @@ * Copyright (C) 2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> */ +#include <cpu_func.h> #include <linux/arm-smccc.h> #include <linux/psci.h> #include <common.h> diff --git a/board/varisys/cyrus/cyrus.c b/board/varisys/cyrus/cyrus.c index 0515ebbad24..13429072c79 100644 --- a/board/varisys/cyrus/cyrus.c +++ b/board/varisys/cyrus/cyrus.c @@ -6,6 +6,7 @@ #include <common.h> #include <command.h> #include <env.h> +#include <fdt_support.h> #include <init.h> #include <netdev.h> #include <linux/compiler.h> diff --git a/board/ve8313/ve8313.c b/board/ve8313/ve8313.c index 781a07f1d83..d1c9535f46e 100644 --- a/board/ve8313/ve8313.c +++ b/board/ve8313/ve8313.c @@ -9,6 +9,7 @@ */ #include <common.h> +#include <fdt_support.h> #include <init.h> #include <linux/libfdt.h> #include <pci.h> @@ -81,7 +82,7 @@ static long fixed_sdram(void) /* now check the real size */ disable_addr_trans (); - msize = get_ram_size (CONFIG_SYS_SDRAM_BASE, msize); + msize = get_ram_size(CONFIG_SYS_SDRAM_BASE, msize); enable_addr_trans (); #endif diff --git a/board/woodburn/woodburn.c b/board/woodburn/woodburn.c index 5cab3f44870..c69df6c7bfe 100644 --- a/board/woodburn/woodburn.c +++ b/board/woodburn/woodburn.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <init.h> #include <asm/io.h> #include <linux/errno.h> #include <asm/arch/imx-regs.h> diff --git a/board/xilinx/versal/board.c b/board/xilinx/versal/board.c index 9fa9e76e666..75aedb09292 100644 --- a/board/xilinx/versal/board.c +++ b/board/xilinx/versal/board.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <fdtdec.h> #include <init.h> #include <malloc.h> diff --git a/board/zyxel/nsa310s/nsa310s.c b/board/zyxel/nsa310s/nsa310s.c index e7cb6be616f..82a3feee69f 100644 --- a/board/zyxel/nsa310s/nsa310s.c +++ b/board/zyxel/nsa310s/nsa310s.c @@ -7,6 +7,7 @@ #include <common.h> #include <miiphy.h> +#include <net.h> #include <asm/arch/cpu.h> #include <asm/arch/soc.h> #include <asm/arch/mpp.h> diff --git a/cmd/Kconfig b/cmd/Kconfig index 298feae24d3..b1a1cbcab25 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -858,11 +858,6 @@ config CMD_FASTBOOT See doc/android/fastboot.txt for more information. -config CMD_FDC - bool "fdcboot - Boot from floppy device" - help - The 'fdtboot' command allows booting an image from a floppy disk. - config CMD_FLASH bool "flinfo, erase, protect" default y diff --git a/cmd/Makefile b/cmd/Makefile index ecf687d49f3..6afdf65507e 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -58,7 +58,6 @@ obj-$(CONFIG_HUSH_PARSER) += exit.o obj-$(CONFIG_CMD_EXT4) += ext4.o obj-$(CONFIG_CMD_EXT2) += ext2.o obj-$(CONFIG_CMD_FAT) += fat.o -obj-$(CONFIG_CMD_FDC) += fdc.o obj-$(CONFIG_CMD_FDT) += fdt.o obj-$(CONFIG_CMD_FITUPD) += fitupd.o obj-$(CONFIG_CMD_FLASH) += flash.o diff --git a/cmd/aes.c b/cmd/aes.c index 8c61cee8e89..8c5b42fd2c4 100644 --- a/cmd/aes.c +++ b/cmd/aes.c @@ -2,7 +2,7 @@ /* * Copyright (C) 2014 Marek Vasut <marex@denx.de> * - * Command for en/de-crypting block of memory with AES-128-CBC cipher. + * Command for en/de-crypting block of memory with AES-[128/192/256]-CBC cipher. */ #include <common.h> @@ -13,6 +13,18 @@ #include <linux/compiler.h> #include <mapmem.h> +u32 aes_get_key_len(char *command) +{ + u32 key_len = AES128_KEY_LENGTH; + + if (!strcmp(command, "aes.192")) + key_len = AES192_KEY_LENGTH; + else if (!strcmp(command, "aes.256")) + key_len = AES256_KEY_LENGTH; + + return key_len; +} + /** * do_aes() - Handle the "aes" command-line command * @cmdtp: Command data struct pointer @@ -27,13 +39,15 @@ static int do_aes(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) { uint32_t key_addr, iv_addr, src_addr, dst_addr, len; uint8_t *key_ptr, *iv_ptr, *src_ptr, *dst_ptr; - uint8_t key_exp[AES_EXPAND_KEY_LENGTH]; - uint32_t aes_blocks; + u8 key_exp[AES256_EXPAND_KEY_LENGTH]; + u32 aes_blocks, key_len; int enc; if (argc != 7) return CMD_RET_USAGE; + key_len = aes_get_key_len(argv[0]); + if (!strncmp(argv[1], "enc", 3)) enc = 1; else if (!strncmp(argv[1], "dec", 3)) @@ -47,23 +61,23 @@ static int do_aes(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) dst_addr = simple_strtoul(argv[5], NULL, 16); len = simple_strtoul(argv[6], NULL, 16); - key_ptr = (uint8_t *)map_sysmem(key_addr, 128 / 8); + key_ptr = (uint8_t *)map_sysmem(key_addr, key_len); iv_ptr = (uint8_t *)map_sysmem(iv_addr, 128 / 8); src_ptr = (uint8_t *)map_sysmem(src_addr, len); dst_ptr = (uint8_t *)map_sysmem(dst_addr, len); /* First we expand the key. */ - aes_expand_key(key_ptr, key_exp); + aes_expand_key(key_ptr, key_len, key_exp); /* Calculate the number of AES blocks to encrypt. */ - aes_blocks = DIV_ROUND_UP(len, AES_KEY_LENGTH); + aes_blocks = DIV_ROUND_UP(len, AES_BLOCK_LENGTH); if (enc) - aes_cbc_encrypt_blocks(key_exp, iv_ptr, src_ptr, dst_ptr, - aes_blocks); + aes_cbc_encrypt_blocks(key_len, key_exp, iv_ptr, src_ptr, + dst_ptr, aes_blocks); else - aes_cbc_decrypt_blocks(key_exp, iv_ptr, src_ptr, dst_ptr, - aes_blocks); + aes_cbc_decrypt_blocks(key_len, key_exp, iv_ptr, src_ptr, + dst_ptr, aes_blocks); unmap_sysmem(key_ptr); unmap_sysmem(iv_ptr); @@ -76,13 +90,13 @@ static int do_aes(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) /***************************************************/ #ifdef CONFIG_SYS_LONGHELP static char aes_help_text[] = - "enc key iv src dst len - Encrypt block of data $len bytes long\n" + "[.128,.192,.256] enc key iv src dst len - Encrypt block of data $len bytes long\n" " at address $src using a key at address\n" " $key with initialization vector at address\n" " $iv. Store the result at address $dst.\n" " The $len size must be multiple of 16 bytes.\n" " The $key and $iv must be 16 bytes long.\n" - "aes dec key iv src dst len - Decrypt block of data $len bytes long\n" + "aes [.128,.192,.256] dec key iv src dst len - Decrypt block of data $len bytes long\n" " at address $src using a key at address\n" " $key with initialization vector at address\n" " $iv. Store the result at address $dst.\n" @@ -92,6 +106,6 @@ static char aes_help_text[] = U_BOOT_CMD( aes, 7, 1, do_aes, - "AES 128 CBC encryption", + "AES 128/192/256 CBC encryption", aes_help_text ); diff --git a/cmd/bmp.c b/cmd/bmp.c index d2a39f677fd..edf4f564266 100644 --- a/cmd/bmp.c +++ b/cmd/bmp.c @@ -13,6 +13,7 @@ #include <command.h> #include <dm.h> #include <gzip.h> +#include <image.h> #include <lcd.h> #include <malloc.h> #include <mapmem.h> @@ -95,8 +96,8 @@ static int do_bmp_info(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[ ulong addr; switch (argc) { - case 1: /* use load_addr as default address */ - addr = load_addr; + case 1: /* use image_load_addr as default address */ + addr = image_load_addr; break; case 2: /* use argument */ addr = simple_strtoul(argv[1], NULL, 16); @@ -116,8 +117,8 @@ static int do_bmp_display(cmd_tbl_t * cmdtp, int flag, int argc, char * const ar splash_get_pos(&x, &y); switch (argc) { - case 1: /* use load_addr as default address */ - addr = load_addr; + case 1: /* use image_load_addr as default address */ + addr = image_load_addr; break; case 2: /* use argument */ addr = simple_strtoul(argv[1], NULL, 16); diff --git a/cmd/booti.c b/cmd/booti.c index d0671deb759..de5058236e0 100644 --- a/cmd/booti.c +++ b/cmd/booti.c @@ -30,9 +30,9 @@ static int booti_start(cmd_tbl_t *cmdtp, int flag, int argc, /* Setup Linux kernel Image entry point */ if (!argc) { - ld = load_addr; + ld = image_load_addr; debug("* kernel: default image load address = 0x%08lx\n", - load_addr); + image_load_addr); } else { ld = simple_strtoul(argv[0], NULL, 16); debug("* kernel: cmdline image address = 0x%08lx\n", ld); diff --git a/cmd/bootm.c b/cmd/bootm.c index 62ee7c4b8a1..931d53f0c72 100644 --- a/cmd/bootm.c +++ b/cmd/bootm.c @@ -144,7 +144,8 @@ int bootm_maybe_autostart(cmd_tbl_t *cmdtp, const char *cmd) char *local_args[2]; local_args[0] = (char *)cmd; local_args[1] = NULL; - printf("Automatic boot of image at addr 0x%08lX ...\n", load_addr); + printf("Automatic boot of image at addr 0x%08lX ...\n", + image_load_addr); return do_bootm(cmdtp, 0, 1, local_args); } @@ -232,7 +233,7 @@ static int do_iminfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) int rcode = 0; if (argc < 2) { - return image_info(load_addr); + return image_info(image_load_addr); } for (arg = 1; arg < argc; ++arg) { diff --git a/cmd/bootz.c b/cmd/bootz.c index 74be62c2c5e..f14a5fefbfc 100644 --- a/cmd/bootz.c +++ b/cmd/bootz.c @@ -7,6 +7,7 @@ #include <common.h> #include <bootm.h> #include <command.h> +#include <image.h> #include <irq_func.h> #include <lmb.h> #include <linux/compiler.h> @@ -33,9 +34,9 @@ static int bootz_start(cmd_tbl_t *cmdtp, int flag, int argc, /* Setup Linux kernel zImage entry point */ if (!argc) { - images->ep = load_addr; + images->ep = image_load_addr; debug("* kernel: default image load address = 0x%08lx\n", - load_addr); + image_load_addr); } else { images->ep = simple_strtoul(argv[0], NULL, 16); debug("* kernel: cmdline image address = 0x%08lx\n", diff --git a/cmd/cramfs.c b/cmd/cramfs.c index 2188910b2a7..ad232deae00 100644 --- a/cmd/cramfs.c +++ b/cmd/cramfs.c @@ -13,6 +13,7 @@ #include <common.h> #include <command.h> #include <env.h> +#include <image.h> #include <malloc.h> #include <mapmem.h> #include <linux/list.h> @@ -97,7 +98,7 @@ int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *filename; int size; - ulong offset = load_addr; + ulong offset = image_load_addr; char *offset_virt; struct part_info part; @@ -127,7 +128,7 @@ int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } if (argc == 3) { offset = simple_strtoul(argv[1], NULL, 0); - load_addr = offset; + image_load_addr = offset; filename = argv[2]; } diff --git a/cmd/disk.c b/cmd/disk.c index 437c1753740..15973b7d132 100644 --- a/cmd/disk.c +++ b/cmd/disk.c @@ -6,6 +6,7 @@ #include <common.h> #include <command.h> #include <cpu_func.h> +#include <image.h> #include <part.h> int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc, @@ -124,7 +125,7 @@ int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc, flush_cache(addr, (cnt+1)*info.blksz); /* Loading ok, update default load address */ - load_addr = addr; + image_load_addr = addr; return bootm_maybe_autostart(cmdtp, argv[0]); } diff --git a/cmd/elf.c b/cmd/elf.c index 32f12a72b9b..ba06df06cf3 100644 --- a/cmd/elf.c +++ b/cmd/elf.c @@ -18,6 +18,7 @@ #include <cpu_func.h> #include <elf.h> #include <env.h> +#include <image.h> #include <net.h> #include <vxworks.h> #ifdef CONFIG_X86 @@ -294,7 +295,7 @@ int do_bootelf(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) /* Consume address */ argc--; argv++; } else - addr = load_addr; + addr = image_load_addr; if (!valid_elf_image(addr)) return 1; @@ -348,7 +349,7 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) * If we don't know where the image is then we're done. */ if (argc < 2) - addr = load_addr; + addr = image_load_addr; else addr = simple_strtoul(argv[1], NULL, 16); diff --git a/cmd/fat.c b/cmd/fat.c index 4b9a7eaab05..50df127f6d2 100644 --- a/cmd/fat.c +++ b/cmd/fat.c @@ -31,7 +31,7 @@ U_BOOT_CMD( " and determine its size." ); -int do_fat_fsload (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +int do_fat_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { return do_load(cmdtp, flag, argc, argv, FS_TYPE_FAT); } diff --git a/cmd/fdc.c b/cmd/fdc.c deleted file mode 100644 index 7d4b8296374..00000000000 --- a/cmd/fdc.c +++ /dev/null @@ -1,752 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * (C) Copyright 2001 - * Denis Peter, MPL AG, d.peter@mpl.ch. - */ -/* - * Floppy Disk support - */ - -#include <common.h> -#include <config.h> -#include <command.h> -#include <image.h> -#include <irq_func.h> - - -#undef FDC_DEBUG - -#ifdef FDC_DEBUG -#define PRINTF(fmt,args...) printf (fmt ,##args) -#else -#define PRINTF(fmt,args...) -#endif - -/*#if defined(CONFIG_CMD_DATE) */ -/*#include <rtc.h> */ -/*#endif */ - -typedef struct { - int flags; /* connected drives ect */ - unsigned long blnr; /* Logical block nr */ - uchar drive; /* drive no */ - uchar cmdlen; /* cmd length */ - uchar cmd[16]; /* cmd desc */ - uchar dma; /* if > 0 dma enabled */ - uchar result[11]; /* status information */ - uchar resultlen; /* lenght of result */ -} FDC_COMMAND_STRUCT; - -/* flags: only the lower 8bit used: - * bit 0 if set drive 0 is present - * bit 1 if set drive 1 is present - * bit 2 if set drive 2 is present - * bit 3 if set drive 3 is present - * bit 4 if set disk in drive 0 is inserted - * bit 5 if set disk in drive 1 is inserted - * bit 6 if set disk in drive 2 is inserted - * bit 7 if set disk in drive 4 is inserted - */ - -/* cmd indexes */ -#define COMMAND 0 -#define DRIVE 1 -#define CONFIG0 1 -#define SPEC_HUTSRT 1 -#define TRACK 2 -#define CONFIG1 2 -#define SPEC_HLT 2 -#define HEAD 3 -#define CONFIG2 3 -#define SECTOR 4 -#define SECTOR_SIZE 5 -#define LAST_TRACK 6 -#define GAP 7 -#define DTL 8 -/* result indexes */ -#define STATUS_0 0 -#define STATUS_PCN 1 -#define STATUS_1 1 -#define STATUS_2 2 -#define STATUS_TRACK 3 -#define STATUS_HEAD 4 -#define STATUS_SECT 5 -#define STATUS_SECT_SIZE 6 - - -/* Register addresses */ -#define FDC_BASE 0x3F0 -#define FDC_SRA FDC_BASE + 0 /* Status Register A */ -#define FDC_SRB FDC_BASE + 1 /* Status Register B */ -#define FDC_DOR FDC_BASE + 2 /* Digital Output Register */ -#define FDC_TDR FDC_BASE + 3 /* Tape Drive Register */ -#define FDC_DSR FDC_BASE + 4 /* Data rate Register */ -#define FDC_MSR FDC_BASE + 4 /* Main Status Register */ -#define FDC_FIFO FDC_BASE + 5 /* FIFO */ -#define FDC_DIR FDC_BASE + 6 /* Digital Input Register */ -#define FDC_CCR FDC_BASE + 7 /* Configuration Control */ -/* Commands */ -#define FDC_CMD_SENSE_INT 0x08 -#define FDC_CMD_CONFIGURE 0x13 -#define FDC_CMD_SPECIFY 0x03 -#define FDC_CMD_RECALIBRATE 0x07 -#define FDC_CMD_READ 0x06 -#define FDC_CMD_READ_TRACK 0x02 -#define FDC_CMD_READ_ID 0x0A -#define FDC_CMD_DUMP_REG 0x0E -#define FDC_CMD_SEEK 0x0F - -#define FDC_CMD_SENSE_INT_LEN 0x01 -#define FDC_CMD_CONFIGURE_LEN 0x04 -#define FDC_CMD_SPECIFY_LEN 0x03 -#define FDC_CMD_RECALIBRATE_LEN 0x02 -#define FDC_CMD_READ_LEN 0x09 -#define FDC_CMD_READ_TRACK_LEN 0x09 -#define FDC_CMD_READ_ID_LEN 0x02 -#define FDC_CMD_DUMP_REG_LEN 0x01 -#define FDC_CMD_SEEK_LEN 0x03 - -#define FDC_FIFO_THR 0x0C -#define FDC_FIFO_DIS 0x00 -#define FDC_IMPLIED_SEEK 0x01 -#define FDC_POLL_DIS 0x00 -#define FDC_PRE_TRK 0x00 -#define FDC_CONFIGURE FDC_FIFO_THR | (FDC_POLL_DIS<<4) | (FDC_FIFO_DIS<<5) | (FDC_IMPLIED_SEEK << 6) -#define FDC_MFM_MODE 0x01 /* MFM enable */ -#define FDC_SKIP_MODE 0x00 /* skip enable */ - -#define FDC_TIME_OUT 100000 /* time out */ -#define FDC_RW_RETRIES 3 /* read write retries */ -#define FDC_CAL_RETRIES 3 /* calibration and seek retries */ - - -/* Disk structure */ -typedef struct { - unsigned int size; /* nr of sectors total */ - unsigned int sect; /* sectors per track */ - unsigned int head; /* nr of heads */ - unsigned int track; /* nr of tracks */ - unsigned int stretch; /* !=0 means double track steps */ - unsigned char gap; /* gap1 size */ - unsigned char rate; /* data rate. |= 0x40 for perpendicular */ - unsigned char spec1; /* stepping rate, head unload time */ - unsigned char fmt_gap;/* gap2 size */ - unsigned char hlt; /* head load time */ - unsigned char sect_code;/* Sector Size code */ - const char * name; /* used only for predefined formats */ -} FD_GEO_STRUCT; - - -/* supported Floppy types (currently only one) */ -const static FD_GEO_STRUCT floppy_type[2] = { - { 2880,18,2,80,0,0x1B,0x00,0xCF,0x6C,16,2,"H1440" }, /* 7 1.44MB 3.5" */ - { 0, 0,0, 0,0,0x00,0x00,0x00,0x00, 0,0,NULL }, /* end of table */ -}; - -static FDC_COMMAND_STRUCT cmd; /* global command struct */ - -/* If the boot drive number is undefined, we assume it's drive 0 */ -#ifndef CONFIG_SYS_FDC_DRIVE_NUMBER -#define CONFIG_SYS_FDC_DRIVE_NUMBER 0 -#endif - -/* Hardware access */ -#ifndef CONFIG_SYS_ISA_IO_STRIDE -#define CONFIG_SYS_ISA_IO_STRIDE 1 -#endif - -#ifndef CONFIG_SYS_ISA_IO_OFFSET -#define CONFIG_SYS_ISA_IO_OFFSET 0 -#endif - -/* Supporting Functions */ -/* reads a Register of the FDC */ -unsigned char read_fdc_reg(unsigned int addr) -{ - volatile unsigned char *val = - (volatile unsigned char *)(CONFIG_SYS_ISA_IO_BASE_ADDRESS + - (addr * CONFIG_SYS_ISA_IO_STRIDE) + - CONFIG_SYS_ISA_IO_OFFSET); - - return val [0]; -} - -/* writes a Register of the FDC */ -void write_fdc_reg(unsigned int addr, unsigned char val) -{ - volatile unsigned char *tmp = - (volatile unsigned char *)(CONFIG_SYS_ISA_IO_BASE_ADDRESS + - (addr * CONFIG_SYS_ISA_IO_STRIDE) + - CONFIG_SYS_ISA_IO_OFFSET); - tmp[0]=val; -} - -/* waits for an interrupt (polling) */ -int wait_for_fdc_int(void) -{ - unsigned long timeout; - timeout = FDC_TIME_OUT; - while((read_fdc_reg(FDC_SRA)&0x80)==0) { - timeout--; - udelay(10); - if(timeout==0) /* timeout occurred */ - return false; - } - return true; -} - -/* reads a byte from the FIFO of the FDC and checks direction and RQM bit - of the MSR. returns -1 if timeout, or byte if ok */ -int read_fdc_byte(void) -{ - unsigned long timeout; - timeout = FDC_TIME_OUT; - while((read_fdc_reg(FDC_MSR)&0xC0)!=0xC0) { - /* direction out and ready */ - udelay(10); - timeout--; - if(timeout==0) /* timeout occurred */ - return -1; - } - return read_fdc_reg(FDC_FIFO); -} - -/* if the direction of the FIFO is wrong, this routine is used to - empty the FIFO. Should _not_ be used */ -int fdc_need_more_output(void) -{ - unsigned char c; - while((read_fdc_reg(FDC_MSR)&0xC0)==0xC0) { - c=(unsigned char)read_fdc_byte(); - printf("Error: more output: %x\n",c); - } - return true; -} - - -/* writes a byte to the FIFO of the FDC and checks direction and RQM bit - of the MSR */ -int write_fdc_byte(unsigned char val) -{ - unsigned long timeout; - timeout = FDC_TIME_OUT; - while((read_fdc_reg(FDC_MSR)&0xC0)!=0x80) { - /* direction in and ready for byte */ - timeout--; - udelay(10); - fdc_need_more_output(); - if(timeout==0) /* timeout occurred */ - return false; - } - write_fdc_reg(FDC_FIFO,val); - return true; -} - -/* sets up all FDC commands and issues it to the FDC. If - the command causes direct results (no Execution Phase) - the result is be read as well. */ - -int fdc_issue_cmd(FDC_COMMAND_STRUCT *pCMD,FD_GEO_STRUCT *pFG) -{ - int i; - unsigned long head,track,sect,timeout; - track = pCMD->blnr / (pFG->sect * pFG->head); /* track nr */ - sect = pCMD->blnr % (pFG->sect * pFG->head); /* remaining blocks */ - head = sect / pFG->sect; /* head nr */ - sect = sect % pFG->sect; /* remaining blocks */ - sect++; /* sectors are 1 based */ - PRINTF("Cmd 0x%02x Track %ld, Head %ld, Sector %ld, Drive %d (blnr %ld)\n", - pCMD->cmd[0],track,head,sect,pCMD->drive,pCMD->blnr); - - if(head|=0) { /* max heads = 2 */ - pCMD->cmd[DRIVE]=pCMD->drive | 0x04; /* head 1 */ - pCMD->cmd[HEAD]=(unsigned char) head; /* head register */ - } - else { - pCMD->cmd[DRIVE]=pCMD->drive; /* head 0 */ - pCMD->cmd[HEAD]=(unsigned char) head; /* head register */ - } - pCMD->cmd[TRACK]=(unsigned char) track; /* track */ - switch (pCMD->cmd[COMMAND]) { - case FDC_CMD_READ: - pCMD->cmd[SECTOR]=(unsigned char) sect; /* sector */ - pCMD->cmd[SECTOR_SIZE]=pFG->sect_code; /* sector size code */ - pCMD->cmd[LAST_TRACK]=pFG->sect; /* End of track */ - pCMD->cmd[GAP]=pFG->gap; /* gap */ - pCMD->cmd[DTL]=0xFF; /* DTL */ - pCMD->cmdlen=FDC_CMD_READ_LEN; - pCMD->cmd[COMMAND]|=(FDC_MFM_MODE<<6); /* set MFM bit */ - pCMD->cmd[COMMAND]|=(FDC_SKIP_MODE<<5); /* set Skip bit */ - pCMD->resultlen=0; /* result only after execution */ - break; - case FDC_CMD_SEEK: - pCMD->cmdlen=FDC_CMD_SEEK_LEN; - pCMD->resultlen=0; /* no result */ - break; - case FDC_CMD_CONFIGURE: - pCMD->cmd[CONFIG0]=0; - pCMD->cmd[CONFIG1]=FDC_CONFIGURE; /* FIFO Threshold, Poll, Enable FIFO */ - pCMD->cmd[CONFIG2]=FDC_PRE_TRK; /* Precompensation Track */ - pCMD->cmdlen=FDC_CMD_CONFIGURE_LEN; - pCMD->resultlen=0; /* no result */ - break; - case FDC_CMD_SPECIFY: - pCMD->cmd[SPEC_HUTSRT]=pFG->spec1; - pCMD->cmd[SPEC_HLT]=(pFG->hlt)<<1; /* head load time */ - if(pCMD->dma==0) - pCMD->cmd[SPEC_HLT]|=0x1; /* no dma */ - pCMD->cmdlen=FDC_CMD_SPECIFY_LEN; - pCMD->resultlen=0; /* no result */ - break; - case FDC_CMD_DUMP_REG: - pCMD->cmdlen=FDC_CMD_DUMP_REG_LEN; - pCMD->resultlen=10; /* 10 byte result */ - break; - case FDC_CMD_READ_ID: - pCMD->cmd[COMMAND]|=(FDC_MFM_MODE<<6); /* set MFM bit */ - pCMD->cmdlen=FDC_CMD_READ_ID_LEN; - pCMD->resultlen=7; /* 7 byte result */ - break; - case FDC_CMD_RECALIBRATE: - pCMD->cmd[DRIVE]&=0x03; /* don't set the head bit */ - pCMD->cmdlen=FDC_CMD_RECALIBRATE_LEN; - pCMD->resultlen=0; /* no result */ - break; - break; - case FDC_CMD_SENSE_INT: - pCMD->cmdlen=FDC_CMD_SENSE_INT_LEN; - pCMD->resultlen=2; - break; - } - for(i=0;i<pCMD->cmdlen;i++) { - /* PRINTF("write cmd%d = 0x%02X\n",i,pCMD->cmd[i]); */ - if (write_fdc_byte(pCMD->cmd[i]) == false) { - PRINTF("Error: timeout while issue cmd%d\n",i); - return false; - } - } - timeout=FDC_TIME_OUT; - for(i=0;i<pCMD->resultlen;i++) { - while((read_fdc_reg(FDC_MSR)&0xC0)!=0xC0) { - timeout--; - if(timeout==0) { - PRINTF(" timeout while reading result%d MSR=0x%02X\n",i,read_fdc_reg(FDC_MSR)); - return false; - } - } - pCMD->result[i]=(unsigned char)read_fdc_byte(); - } - return true; -} - -/* selects the drive assigned in the cmd structur and - switches on the Motor */ -void select_fdc_drive(FDC_COMMAND_STRUCT *pCMD) -{ - unsigned char val; - - val=(1<<(4+pCMD->drive))|pCMD->drive|0xC; /* set reset, dma gate and motor bits */ - if((read_fdc_reg(FDC_DOR)&val)!=val) { - write_fdc_reg(FDC_DOR,val); - for(val=0;val<255;val++) - udelay(500); /* wait some time to start motor */ - } -} - -/* switches off the Motor of the specified drive */ -void stop_fdc_drive(FDC_COMMAND_STRUCT *pCMD) -{ - unsigned char val; - - val=(1<<(4+pCMD->drive))|pCMD->drive; /* sets motor bits */ - write_fdc_reg(FDC_DOR,(read_fdc_reg(FDC_DOR)&~val)); -} - -/* issues a recalibrate command, waits for interrupt and - * issues a sense_interrupt */ -int fdc_recalibrate(FDC_COMMAND_STRUCT *pCMD,FD_GEO_STRUCT *pFG) -{ - pCMD->cmd[COMMAND]=FDC_CMD_RECALIBRATE; - if (fdc_issue_cmd(pCMD, pFG) == false) - return false; - while (wait_for_fdc_int() != true); - - pCMD->cmd[COMMAND]=FDC_CMD_SENSE_INT; - return(fdc_issue_cmd(pCMD,pFG)); -} - -/* issues a recalibrate command, waits for interrupt and - * issues a sense_interrupt */ -int fdc_seek(FDC_COMMAND_STRUCT *pCMD,FD_GEO_STRUCT *pFG) -{ - pCMD->cmd[COMMAND]=FDC_CMD_SEEK; - if (fdc_issue_cmd(pCMD, pFG) == false) - return false; - while (wait_for_fdc_int() != true); - - pCMD->cmd[COMMAND]=FDC_CMD_SENSE_INT; - return(fdc_issue_cmd(pCMD,pFG)); -} - -/* terminates current command, by not servicing the FIFO - * waits for interrupt and fills in the result bytes */ -int fdc_terminate(FDC_COMMAND_STRUCT *pCMD) -{ - int i; - for(i=0;i<100;i++) - udelay(500); /* wait 500usec for fifo overrun */ - while((read_fdc_reg(FDC_SRA)&0x80)==0x00); /* wait as long as no int has occurred */ - for(i=0;i<7;i++) { - pCMD->result[i]=(unsigned char)read_fdc_byte(); - } - return true; -} - -/* reads data from FDC, seek commands are issued automatic */ -int fdc_read_data(unsigned char *buffer, unsigned long blocks,FDC_COMMAND_STRUCT *pCMD, FD_GEO_STRUCT *pFG) -{ - /* first seek to start address */ - unsigned long len,readblk,i,timeout,ii,offset; - unsigned char c,retriesrw,retriescal; - unsigned char *bufferw; /* working buffer */ - int sect_size; - int flags; - - flags=disable_interrupts(); /* switch off all Interrupts */ - select_fdc_drive(pCMD); /* switch on drive */ - sect_size=0x080<<pFG->sect_code; - retriesrw=0; - retriescal=0; - offset=0; - if (fdc_seek(pCMD, pFG) == false) { - stop_fdc_drive(pCMD); - if (flags) - enable_interrupts(); - return false; - } - if((pCMD->result[STATUS_0]&0x20)!=0x20) { - printf("Seek error Status: %02X\n",pCMD->result[STATUS_0]); - stop_fdc_drive(pCMD); - if (flags) - enable_interrupts(); - return false; - } - /* now determine the next seek point */ - /* lastblk=pCMD->blnr + blocks; */ - /* readblk=(pFG->head*pFG->sect)-(pCMD->blnr%(pFG->head*pFG->sect)); */ - readblk=pFG->sect-(pCMD->blnr%pFG->sect); - PRINTF("1st nr of block possible read %ld start %ld\n",readblk,pCMD->blnr); - if(readblk>blocks) /* is end within 1st track */ - readblk=blocks; /* yes, correct it */ - PRINTF("we read %ld blocks start %ld\n",readblk,pCMD->blnr); - bufferw = &buffer[0]; /* setup working buffer */ - do { -retryrw: - len=sect_size * readblk; - pCMD->cmd[COMMAND]=FDC_CMD_READ; - if (fdc_issue_cmd(pCMD, pFG) == false) { - stop_fdc_drive(pCMD); - if (flags) - enable_interrupts(); - return false; - } - for (i=0;i<len;i++) { - timeout=FDC_TIME_OUT; - do { - c=read_fdc_reg(FDC_MSR); - if((c&0xC0)==0xC0) { - bufferw[i]=read_fdc_reg(FDC_FIFO); - break; - } - if((c&0xC0)==0x80) { /* output */ - PRINTF("Transfer error transferred: at %ld, MSR=%02X\n",i,c); - if(i>6) { - for(ii=0;ii<7;ii++) { - pCMD->result[ii]=bufferw[(i-7+ii)]; - } /* for */ - } - if(retriesrw++>FDC_RW_RETRIES) { - if (retriescal++>FDC_CAL_RETRIES) { - stop_fdc_drive(pCMD); - if (flags) - enable_interrupts(); - return false; - } - else { - PRINTF(" trying to recalibrate Try %d\n",retriescal); - if (fdc_recalibrate(pCMD, pFG) == false) { - stop_fdc_drive(pCMD); - if (flags) - enable_interrupts(); - return false; - } - retriesrw=0; - goto retrycal; - } /* else >FDC_CAL_RETRIES */ - } - else { - PRINTF("Read retry %d\n",retriesrw); - goto retryrw; - } /* else >FDC_RW_RETRIES */ - }/* if output */ - timeout--; - } while (true); - } /* for len */ - /* the last sector of a track or all data has been read, - * we need to get the results */ - fdc_terminate(pCMD); - offset+=(sect_size*readblk); /* set up buffer pointer */ - bufferw = &buffer[offset]; - pCMD->blnr+=readblk; /* update current block nr */ - blocks-=readblk; /* update blocks */ - if(blocks==0) - break; /* we are finish */ - /* setup new read blocks */ - /* readblk=pFG->head*pFG->sect; */ - readblk=pFG->sect; - if(readblk>blocks) - readblk=blocks; -retrycal: - /* a seek is necessary */ - if (fdc_seek(pCMD, pFG) == false) { - stop_fdc_drive(pCMD); - if (flags) - enable_interrupts(); - return false; - } - if((pCMD->result[STATUS_0]&0x20)!=0x20) { - PRINTF("Seek error Status: %02X\n",pCMD->result[STATUS_0]); - stop_fdc_drive(pCMD); - return false; - } - } while (true); /* start over */ - stop_fdc_drive(pCMD); /* switch off drive */ - if (flags) - enable_interrupts(); - return true; -} - -/* Scan all drives and check if drive is present and disk is inserted */ -int fdc_check_drive(FDC_COMMAND_STRUCT *pCMD, FD_GEO_STRUCT *pFG) -{ - int i,drives,state; - /* OK procedure of data book is satisfied. - * trying to get some information over the drives */ - state=0; /* no drives, no disks */ - for(drives=0;drives<4;drives++) { - pCMD->drive=drives; - select_fdc_drive(pCMD); - pCMD->blnr=0; /* set to the 1st block */ - if (fdc_recalibrate(pCMD, pFG) == false) - continue; - if((pCMD->result[STATUS_0]&0x10)==0x10) - continue; - /* ok drive connected check for disk */ - state|=(1<<drives); - pCMD->blnr=pFG->size; /* set to the last block */ - if (fdc_seek(pCMD, pFG) == false) - continue; - pCMD->blnr=0; /* set to the 1st block */ - if (fdc_recalibrate(pCMD, pFG) == false) - continue; - pCMD->cmd[COMMAND]=FDC_CMD_READ_ID; - if (fdc_issue_cmd(pCMD, pFG) == false) - continue; - state|=(0x10<<drives); - } - stop_fdc_drive(pCMD); - for(i=0;i<4;i++) { - PRINTF("Floppy Drive %d %sconnected %sDisk inserted %s\n",i, - ((state&(1<<i))==(1<<i)) ? "":"not ", - ((state&(0x10<<i))==(0x10<<i)) ? "":"no ", - ((state&(0x10<<i))==(0x10<<i)) ? pFG->name : ""); - } - pCMD->flags=state; - return true; -} - - -/************************************************************************** -* int fdc_setup -* setup the fdc according the datasheet -* assuming in PS2 Mode -*/ -int fdc_setup(int drive, FDC_COMMAND_STRUCT *pCMD, FD_GEO_STRUCT *pFG) -{ - int i; - -#ifdef CONFIG_SYS_FDC_HW_INIT - fdc_hw_init (); -#endif - /* first, we reset the FDC via the DOR */ - write_fdc_reg(FDC_DOR,0x00); - for(i=0; i<255; i++) /* then we wait some time */ - udelay(500); - /* then, we clear the reset in the DOR */ - pCMD->drive=drive; - select_fdc_drive(pCMD); - /* initialize the CCR */ - write_fdc_reg(FDC_CCR,pFG->rate); - /* then initialize the DSR */ - write_fdc_reg(FDC_DSR,pFG->rate); - if (wait_for_fdc_int() == false) { - PRINTF("Time Out after writing CCR\n"); - return false; - } - /* now issue sense Interrupt and status command - * assuming only one drive present (drive 0) */ - pCMD->dma=0; /* we don't use any dma at all */ - for(i=0;i<4;i++) { - /* issue sense interrupt for all 4 possible drives */ - pCMD->cmd[COMMAND]=FDC_CMD_SENSE_INT; - if (fdc_issue_cmd(pCMD, pFG) == false) { - PRINTF("Sense Interrupt for drive %d failed\n",i); - } - } - /* issue the configure command */ - pCMD->drive=drive; - select_fdc_drive(pCMD); - pCMD->cmd[COMMAND]=FDC_CMD_CONFIGURE; - if (fdc_issue_cmd(pCMD, pFG) == false) { - PRINTF(" configure timeout\n"); - stop_fdc_drive(pCMD); - return false; - } - /* issue specify command */ - pCMD->cmd[COMMAND]=FDC_CMD_SPECIFY; - if (fdc_issue_cmd(pCMD, pFG) == false) { - PRINTF(" specify timeout\n"); - stop_fdc_drive(pCMD); - return false; - - } - /* then, we clear the reset in the DOR */ - /* fdc_check_drive(pCMD,pFG); */ - /* write_fdc_reg(FDC_DOR,0x04); */ - - return true; -} - -/**************************************************************************** - * main routine do_fdcboot - */ -int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) -{ - FD_GEO_STRUCT *pFG = (FD_GEO_STRUCT *)floppy_type; - FDC_COMMAND_STRUCT *pCMD = &cmd; - unsigned long addr,imsize; -#if defined(CONFIG_LEGACY_IMAGE_FORMAT) - image_header_t *hdr; /* used for fdc boot */ -#endif - unsigned char boot_drive; - int i,nrofblk; -#if defined(CONFIG_FIT) - const void *fit_hdr = NULL; -#endif - - switch (argc) { - case 1: - addr = CONFIG_SYS_LOAD_ADDR; - boot_drive=CONFIG_SYS_FDC_DRIVE_NUMBER; - break; - case 2: - addr = simple_strtoul(argv[1], NULL, 16); - boot_drive=CONFIG_SYS_FDC_DRIVE_NUMBER; - break; - case 3: - addr = simple_strtoul(argv[1], NULL, 16); - boot_drive=simple_strtoul(argv[2], NULL, 10); - break; - default: - return CMD_RET_USAGE; - } - /* setup FDC and scan for drives */ - if (fdc_setup(boot_drive, pCMD, pFG) == false) { - printf("\n** Error in setup FDC **\n"); - return 1; - } - if (fdc_check_drive(pCMD, pFG) == false) { - printf("\n** Error in check_drives **\n"); - return 1; - } - if((pCMD->flags&(1<<boot_drive))==0) { - /* drive not available */ - printf("\n** Drive %d not availabe **\n",boot_drive); - return 1; - } - if((pCMD->flags&(0x10<<boot_drive))==0) { - /* no disk inserted */ - printf("\n** No disk inserted in drive %d **\n",boot_drive); - return 1; - } - /* ok, we have a valid source */ - pCMD->drive=boot_drive; - /* read first block */ - pCMD->blnr=0; - if (fdc_read_data((unsigned char *)addr, 1, pCMD, pFG) == false) { - printf("\nRead error:"); - for(i=0;i<7;i++) - printf("result%d: 0x%02X\n",i,pCMD->result[i]); - return 1; - } - - switch (genimg_get_format ((void *)addr)) { -#if defined(CONFIG_LEGACY_IMAGE_FORMAT) - case IMAGE_FORMAT_LEGACY: - hdr = (image_header_t *)addr; - image_print_contents (hdr); - - imsize = image_get_image_size (hdr); - break; -#endif -#if defined(CONFIG_FIT) - case IMAGE_FORMAT_FIT: - fit_hdr = (const void *)addr; - puts ("Fit image detected...\n"); - - imsize = fit_get_size (fit_hdr); - break; -#endif - default: - puts ("** Unknown image type\n"); - return 1; - } - - nrofblk=imsize/512; - if((imsize%512)>0) - nrofblk++; - printf("Loading %ld Bytes (%d blocks) at 0x%08lx..\n",imsize,nrofblk,addr); - pCMD->blnr=0; - if (fdc_read_data((unsigned char *)addr, nrofblk, pCMD, pFG) == false) { - /* read image block */ - printf("\nRead error:"); - for(i=0;i<7;i++) - printf("result%d: 0x%02X\n",i,pCMD->result[i]); - return 1; - } - printf("OK %ld Bytes loaded.\n",imsize); - - flush_cache (addr, imsize); - -#if defined(CONFIG_FIT) - /* This cannot be done earlier, we need complete FIT image in RAM first */ - if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT) { - if (!fit_check_format (fit_hdr)) { - puts ("** Bad FIT image format\n"); - return 1; - } - fit_print_contents (fit_hdr); - } -#endif - - /* Loading ok, update default load address */ - load_addr = addr; - - return bootm_maybe_autostart(cmdtp, argv[0]); -} - -U_BOOT_CMD( - fdcboot, 3, 1, do_fdcboot, - "boot from floppy device", - "loadAddr drive" -); diff --git a/cmd/jffs2.c b/cmd/jffs2.c index b47cd3d9893..da2580d85d7 100644 --- a/cmd/jffs2.c +++ b/cmd/jffs2.c @@ -73,6 +73,7 @@ #include <common.h> #include <command.h> #include <env.h> +#include <image.h> #include <malloc.h> #include <jffs2/jffs2.h> #include <linux/list.h> @@ -476,7 +477,7 @@ int do_jffs2_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) char *filename; int size; struct part_info *part; - ulong offset = load_addr; + ulong offset = image_load_addr; /* pre-set Boot file name */ filename = env_get("bootfile"); @@ -488,7 +489,7 @@ int do_jffs2_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } if (argc == 3) { offset = simple_strtoul(argv[1], NULL, 16); - load_addr = offset; + image_load_addr = offset; filename = argv[2]; } diff --git a/cmd/load.c b/cmd/load.c index 3bfc1b41ece..fab30fe8943 100644 --- a/cmd/load.c +++ b/cmd/load.c @@ -12,6 +12,8 @@ #include <console.h> #include <cpu_func.h> #include <env.h> +#include <flash.h> +#include <image.h> #include <s_record.h> #include <net.h> #include <exports.h> @@ -108,7 +110,7 @@ static int do_load_serial(cmd_tbl_t *cmdtp, int flag, int argc, rcode = 1; } else { printf("## Start Addr = 0x%08lX\n", addr); - load_addr = addr; + image_load_addr = addr; } #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE @@ -484,12 +486,12 @@ static int do_load_serial_bin(cmd_tbl_t *cmdtp, int flag, int argc, addr = load_serial_bin(offset); if (addr == ~0) { - load_addr = 0; + image_load_addr = 0; printf("## Binary (kermit) download aborted\n"); rcode = 1; } else { printf("## Start Addr = 0x%08lX\n", addr); - load_addr = addr; + image_load_addr = addr; } } if (load_baudrate != current_baudrate) { @@ -980,7 +982,7 @@ static ulong load_serial_ymodem(ulong offset, int mode) rc = flash_write((char *) ymodemBuf, store_addr, res); if (rc != 0) { - flash_perror (rc); + flash_perror(rc); return (~0); } } else diff --git a/cmd/mem.c b/cmd/mem.c index 4ec450b0502..f32985ca7dd 100644 --- a/cmd/mem.c +++ b/cmd/mem.c @@ -16,6 +16,7 @@ #include <cli.h> #include <command.h> #include <console.h> +#include <flash.h> #include <hash.h> #include <mapmem.h> #include <watchdog.h> @@ -106,7 +107,7 @@ static int do_mem_nm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) static int do_mem_mw(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA u64 writeval; #else ulong writeval; @@ -131,7 +132,7 @@ static int do_mem_mw(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) /* Get the value to write. */ -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA writeval = simple_strtoull(argv[2], NULL, 16); #else writeval = simple_strtoul(argv[2], NULL, 16); @@ -150,7 +151,7 @@ static int do_mem_mw(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) while (count-- > 0) { if (size == 4) *((u32 *)buf) = (u32)writeval; -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA else if (size == 8) *((u64 *)buf) = (u64)writeval; #endif @@ -227,7 +228,7 @@ static int do_mem_cmp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) int rcode = 0; const char *type; const void *buf1, *buf2, *base; -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA u64 word1, word2; #else ulong word1, word2; @@ -259,7 +260,7 @@ static int do_mem_cmp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (size == 4) { word1 = *(u32 *)buf1; word2 = *(u32 *)buf2; -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA } else if (size == 8) { word1 = *(u64 *)buf1; word2 = *(u64 *)buf2; @@ -273,7 +274,7 @@ static int do_mem_cmp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } if (word1 != word2) { ulong offset = buf1 - base; -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA printf("%s at 0x%p (%#0*llx) != %s at 0x%p (%#0*llx)\n", type, (void *)(addr1 + offset), size, word1, type, (void *)(addr2 + offset), size, word2); @@ -339,7 +340,7 @@ static int do_mem_cp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) rc = flash_write((char *)src, (ulong)dst, count * size); if (rc != 0) { - flash_perror (rc); + flash_perror(rc); unmap_sysmem(src); unmap_sysmem(dst); return (1); @@ -377,7 +378,7 @@ static int do_mem_loop(cmd_tbl_t *cmdtp, int flag, int argc, { ulong addr, length, i, bytes; int size; -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA volatile u64 *llp; #endif volatile u32 *longp; @@ -410,7 +411,7 @@ static int do_mem_loop(cmd_tbl_t *cmdtp, int flag, int argc, * If we have only one object, just run infinite loops. */ if (length == 1) { -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA if (size == 8) { llp = (u64 *)buf; for (;;) @@ -432,7 +433,7 @@ static int do_mem_loop(cmd_tbl_t *cmdtp, int flag, int argc, i = *cp; } -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA if (size == 8) { for (;;) { llp = (u64 *)buf; @@ -475,7 +476,7 @@ static int do_mem_loopw(cmd_tbl_t *cmdtp, int flag, int argc, { ulong addr, length, i, bytes; int size; -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA volatile u64 *llp; u64 data; #else @@ -505,7 +506,7 @@ static int do_mem_loopw(cmd_tbl_t *cmdtp, int flag, int argc, length = simple_strtoul(argv[2], NULL, 16); /* data to write */ -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA data = simple_strtoull(argv[3], NULL, 16); #else data = simple_strtoul(argv[3], NULL, 16); @@ -518,7 +519,7 @@ static int do_mem_loopw(cmd_tbl_t *cmdtp, int flag, int argc, * If we have only one object, just run infinite loops. */ if (length == 1) { -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA if (size == 8) { llp = (u64 *)buf; for (;;) @@ -540,7 +541,7 @@ static int do_mem_loopw(cmd_tbl_t *cmdtp, int flag, int argc, *cp = data; } -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA if (size == 8) { for (;;) { llp = (u64 *)buf; @@ -967,7 +968,7 @@ static int mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[]) { ulong addr; -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA u64 i; #else ulong i; @@ -1006,7 +1007,7 @@ mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[]) printf("%08lx:", addr); if (size == 4) printf(" %08x", *((u32 *)ptr)); -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA else if (size == 8) printf(" %016llx", *((u64 *)ptr)); #endif @@ -1033,7 +1034,7 @@ mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[]) #endif else { char *endp; -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA i = simple_strtoull(console_buffer, &endp, 16); #else i = simple_strtoul(console_buffer, &endp, 16); @@ -1045,7 +1046,7 @@ mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[]) bootretry_reset_cmd_timeout(); if (size == 4) *((u32 *)ptr) = i; -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA else if (size == 8) *((u64 *)ptr) = i; #endif @@ -1139,7 +1140,7 @@ static int do_random(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) U_BOOT_CMD( md, 3, 1, do_mem_md, "memory display", -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA "[.b, .w, .l, .q] address [# of objects]" #else "[.b, .w, .l] address [# of objects]" @@ -1150,7 +1151,7 @@ U_BOOT_CMD( U_BOOT_CMD( mm, 2, 1, do_mem_mm, "memory modify (auto-incrementing address)", -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA "[.b, .w, .l, .q] address" #else "[.b, .w, .l] address" @@ -1161,7 +1162,7 @@ U_BOOT_CMD( U_BOOT_CMD( nm, 2, 1, do_mem_nm, "memory modify (constant address)", -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA "[.b, .w, .l, .q] address" #else "[.b, .w, .l] address" @@ -1171,7 +1172,7 @@ U_BOOT_CMD( U_BOOT_CMD( mw, 4, 1, do_mem_mw, "memory write (fill)", -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA "[.b, .w, .l, .q] address value [count]" #else "[.b, .w, .l] address value [count]" @@ -1181,7 +1182,7 @@ U_BOOT_CMD( U_BOOT_CMD( cp, 4, 1, do_mem_cp, "memory copy", -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA "[.b, .w, .l, .q] source target count" #else "[.b, .w, .l] source target count" @@ -1191,7 +1192,7 @@ U_BOOT_CMD( U_BOOT_CMD( cmp, 4, 1, do_mem_cmp, "memory compare", -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA "[.b, .w, .l, .q] addr1 addr2 count" #else "[.b, .w, .l] addr1 addr2 count" @@ -1242,7 +1243,7 @@ U_BOOT_CMD( U_BOOT_CMD( loop, 3, 1, do_mem_loop, "infinite loop on address range", -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA "[.b, .w, .l, .q] address number_of_objects" #else "[.b, .w, .l] address number_of_objects" @@ -1253,7 +1254,7 @@ U_BOOT_CMD( U_BOOT_CMD( loopw, 4, 1, do_mem_loopw, "infinite write loop on address range", -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA "[.b, .w, .l, .q] address number_of_objects data_to_write" #else "[.b, .w, .l] address number_of_objects data_to_write" @@ -1273,7 +1274,7 @@ U_BOOT_CMD( U_BOOT_CMD( mdc, 4, 1, do_mem_mdc, "memory display cyclic", -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA "[.b, .w, .l, .q] address count delay(ms)" #else "[.b, .w, .l] address count delay(ms)" @@ -1283,7 +1284,7 @@ U_BOOT_CMD( U_BOOT_CMD( mwc, 4, 1, do_mem_mwc, "memory write cyclic", -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA "[.b, .w, .l, .q] address value delay(ms)" #else "[.b, .w, .l] address value delay(ms)" diff --git a/cmd/mvebu/bubt.c b/cmd/mvebu/bubt.c index 84d2d531f0d..2041a7a29aa 100644 --- a/cmd/mvebu/bubt.c +++ b/cmd/mvebu/bubt.c @@ -8,6 +8,7 @@ #include <common.h> #include <command.h> #include <env.h> +#include <image.h> #include <vsprintf.h> #include <errno.h> #include <dm.h> @@ -423,8 +424,10 @@ static int is_usb_active(void) #ifdef CONFIG_CMD_NET static size_t tftp_read_file(const char *file_name) { - /* update global variable load_addr before tftp file from network */ - load_addr = get_load_addr(); + /* + * update global variable image_load_addr before tftp file from network + */ + image_load_addr = get_load_addr(); return net_loop(TFTPGET); } diff --git a/cmd/nand.c b/cmd/nand.c index 5bda69e819b..4de6892a01b 100644 --- a/cmd/nand.c +++ b/cmd/nand.c @@ -20,6 +20,7 @@ */ #include <common.h> +#include <image.h> #include <linux/mtd/mtd.h> #include <command.h> #include <console.h> @@ -925,7 +926,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp, struct mtd_info *mtd, /* Loading ok, update default load address */ - load_addr = addr; + image_load_addr = addr; return bootm_maybe_autostart(cmdtp, cmd); } diff --git a/cmd/net.c b/cmd/net.c index 237403977e8..1b724cc5709 100644 --- a/cmd/net.c +++ b/cmd/net.c @@ -10,6 +10,7 @@ #include <common.h> #include <command.h> #include <env.h> +#include <image.h> #include <net.h> static int netboot_common(enum proto_t, cmd_tbl_t *, int, char * const []); @@ -186,10 +187,10 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, net_boot_file_name_explicit = false; - /* pre-set load_addr */ + /* pre-set image_load_addr */ s = env_get("loadaddr"); if (s != NULL) - load_addr = simple_strtoul(s, NULL, 16); + image_load_addr = simple_strtoul(s, NULL, 16); switch (argc) { case 1: @@ -206,7 +207,7 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, */ addr = simple_strtoul(argv[1], &end, 16); if (end == (argv[1] + strlen(argv[1]))) { - load_addr = addr; + image_load_addr = addr; /* refresh bootfile name from env */ copy_filename(net_boot_file_name, env_get("bootfile"), sizeof(net_boot_file_name)); @@ -218,7 +219,7 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, break; case 3: - load_addr = simple_strtoul(argv[1], NULL, 16); + image_load_addr = simple_strtoul(argv[1], NULL, 16); net_boot_file_name_explicit = true; copy_filename(net_boot_file_name, argv[2], sizeof(net_boot_file_name)); @@ -227,8 +228,8 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, #ifdef CONFIG_CMD_TFTPPUT case 4: - if (strict_strtoul(argv[1], 16, &save_addr) < 0 || - strict_strtoul(argv[2], 16, &save_size) < 0) { + if (strict_strtoul(argv[1], 16, &image_save_addr) < 0 || + strict_strtoul(argv[2], 16, &image_save_size) < 0) { printf("Invalid address/size\n"); return CMD_RET_USAGE; } diff --git a/cmd/pxe.c b/cmd/pxe.c index 73f1b4fbd33..bce6728875a 100644 --- a/cmd/pxe.c +++ b/cmd/pxe.c @@ -6,6 +6,8 @@ #include <common.h> #include <command.h> +#include <fs.h> +#include <net.h> #include "pxe_utils.h" diff --git a/cmd/pxe_utils.c b/cmd/pxe_utils.c index a636346bb51..8b830212ce1 100644 --- a/cmd/pxe_utils.c +++ b/cmd/pxe_utils.c @@ -6,6 +6,7 @@ #include <common.h> #include <env.h> +#include <image.h> #include <malloc.h> #include <mapmem.h> #include <lcd.h> @@ -1310,9 +1311,9 @@ void handle_pxe_menu(cmd_tbl_t *cmdtp, struct pxe_menu *cfg) #ifdef CONFIG_CMD_BMP /* display BMP if available */ if (cfg->bmp) { - if (get_relfile(cmdtp, cfg->bmp, load_addr)) { + if (get_relfile(cmdtp, cfg->bmp, image_load_addr)) { run_command("cls", 0); - bmp_display(load_addr, + bmp_display(image_load_addr, BMP_ALIGN_CENTER, BMP_ALIGN_CENTER); } else { printf("Skipping background bmp %s for failure\n", diff --git a/cmd/reiser.c b/cmd/reiser.c index 7f51b927a47..598fab48b32 100644 --- a/cmd/reiser.c +++ b/cmd/reiser.c @@ -154,7 +154,7 @@ int do_reiserload (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } /* Loading ok, update default load address */ - load_addr = addr; + image_load_addr = addr; printf ("\n%ld bytes read\n", filelen); env_set_hex("filesize", filelen); diff --git a/cmd/source.c b/cmd/source.c index 3a51ebf0b66..92f8f77ee6f 100644 --- a/cmd/source.c +++ b/cmd/source.c @@ -41,8 +41,7 @@ static const char *get_default_image(const void *fit) } #endif -int -source (ulong addr, const char *fit_uname) +int image_source_script(ulong addr, const char *fit_uname) { ulong len; #if defined(CONFIG_LEGACY_IMAGE_FORMAT) @@ -172,7 +171,8 @@ static int do_source(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) addr = CONFIG_SYS_LOAD_ADDR; debug ("* source: default load address = 0x%08lx\n", addr); #if defined(CONFIG_FIT) - } else if (fit_parse_subimage (argv[1], load_addr, &addr, &fit_uname)) { + } else if (fit_parse_subimage(argv[1], image_load_addr, &addr, + &fit_uname)) { debug ("* source: subimage '%s' from FIT image at 0x%08lx\n", fit_uname, addr); #endif @@ -182,7 +182,7 @@ static int do_source(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } printf ("## Executing script at %08lx\n", addr); - rcode = source (addr, fit_uname); + rcode = image_source_script(addr, fit_uname); return rcode; } diff --git a/cmd/ti/ddr3.c b/cmd/ti/ddr3.c index 55130898c93..a452fe7876a 100644 --- a/cmd/ti/ddr3.c +++ b/cmd/ti/ddr3.c @@ -6,6 +6,7 @@ */ #include <cpu_func.h> +#include <init.h> #include <asm/arch/hardware.h> #include <asm/cache.h> #include <asm/emif.h> diff --git a/cmd/tpm_test.c b/cmd/tpm_test.c index c14dd75a260..2cde517d7a9 100644 --- a/cmd/tpm_test.c +++ b/cmd/tpm_test.c @@ -5,6 +5,7 @@ #include <common.h> #include <command.h> +#include <cpu_func.h> #include <tpm-v1.h> #include "tpm-user-utils.h" diff --git a/cmd/ximg.c b/cmd/ximg.c index 22b2037a33f..dccd1143a7a 100644 --- a/cmd/ximg.c +++ b/cmd/ximg.c @@ -33,7 +33,7 @@ static int do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { - ulong addr = load_addr; + ulong addr = image_load_addr; ulong dest = 0; ulong data, len; int verify; diff --git a/cmd/zfs.c b/cmd/zfs.c index ed5402bb139..15331306356 100644 --- a/cmd/zfs.c +++ b/cmd/zfs.c @@ -112,7 +112,7 @@ static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[] zfs_close(&zfile); /* Loading ok, update default load address */ - load_addr = addr; + image_load_addr = addr; printf("%llu bytes read\n", zfile.size); env_set_hex("filesize", zfile.size); diff --git a/common/Makefile b/common/Makefile index 029cc0f2ce6..5f62b8d0b13 100644 --- a/common/Makefile +++ b/common/Makefile @@ -113,6 +113,7 @@ obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += image-fdt.o obj-$(CONFIG_$(SPL_TPL_)FIT) += image-fit.o obj-$(CONFIG_$(SPL_)MULTI_DTB_FIT) += boot_fit.o common_fit.o obj-$(CONFIG_$(SPL_TPL_)FIT_SIGNATURE) += image-sig.o +obj-$(CONFIG_$(SPL_TPL_)FIT_CIPHER) += image-cipher.o obj-$(CONFIG_IO_TRACE) += iotrace.o obj-y += memsize.o obj-y += stdio.o diff --git a/common/board_f.c b/common/board_f.c index d66afb37ca2..3f0132a6e33 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -11,6 +11,7 @@ #include <common.h> #include <bloblist.h> +#include <clock_legacy.h> #include <console.h> #include <cpu.h> #include <cpu_func.h> @@ -19,6 +20,7 @@ #include <env_internal.h> #include <fdtdec.h> #include <fs.h> +#include <hang.h> #include <i2c.h> #include <init.h> #include <initcall.h> diff --git a/common/board_r.c b/common/board_r.c index e711de64b5b..8a0c1114e77 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -12,7 +12,11 @@ #include <common.h> #include <api.h> #include <cpu_func.h> +#include <exports.h> +#include <hang.h> +#include <image.h> #include <irq_func.h> +#include <net.h> #include <u-boot/crc.h> /* TODO: can we just include all these headers whether needed or not? */ #if defined(CONFIG_CMD_BEDBUG) @@ -26,6 +30,7 @@ #include <env_internal.h> #include <fdtdec.h> #include <ide.h> +#include <init.h> #include <initcall.h> #if defined(CONFIG_CMD_KGDB) #include <kgdb.h> @@ -481,7 +486,7 @@ static int initr_env(void) #endif /* Initialize from environment */ - load_addr = env_get_ulong("loadaddr", 16, load_addr); + image_load_addr = env_get_ulong("loadaddr", 16, image_load_addr); return 0; } diff --git a/common/bootstage.c b/common/bootstage.c index 79972e46f29..d2ed33663b7 100644 --- a/common/bootstage.c +++ b/common/bootstage.c @@ -10,6 +10,7 @@ */ #include <common.h> +#include <hang.h> #include <malloc.h> #include <sort.h> #include <spl.h> diff --git a/common/cli.c b/common/cli.c index 67ceb635a67..7ffe902b88d 100644 --- a/common/cli.c +++ b/common/cli.c @@ -15,6 +15,7 @@ #include <console.h> #include <env.h> #include <fdtdec.h> +#include <hang.h> #include <malloc.h> DECLARE_GLOBAL_DATA_PTR; diff --git a/common/command.c b/common/command.c index ceca9925107..0d8bf244be2 100644 --- a/common/command.c +++ b/common/command.c @@ -469,7 +469,7 @@ int cmd_get_data_size(char* arg, int default_size) return 2; case 'l': return 4; -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA case 'q': return 8; #endif diff --git a/common/flash.c b/common/flash.c index efe8f53de66..5f155aefd1d 100644 --- a/common/flash.c +++ b/common/flash.c @@ -179,7 +179,7 @@ flash_write (char *src, ulong addr, ulong cnt) /*----------------------------------------------------------------------- */ -void flash_perror (int err) +void flash_perror(int err) { switch (err) { case ERR_OK: diff --git a/common/image-cipher.c b/common/image-cipher.c new file mode 100644 index 00000000000..cee3b03ee50 --- /dev/null +++ b/common/image-cipher.c @@ -0,0 +1,167 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) 2019, Softathome + */ + +#ifdef USE_HOSTCC +#include "mkimage.h" +#include <time.h> +#else +#include <common.h> +#include <malloc.h> +DECLARE_GLOBAL_DATA_PTR; +#endif /* !USE_HOSTCC*/ +#include <image.h> +#include <uboot_aes.h> +#include <u-boot/aes.h> + +struct cipher_algo cipher_algos[] = { + { + .name = "aes128", + .key_len = AES128_KEY_LENGTH, + .iv_len = AES_BLOCK_LENGTH, +#if IMAGE_ENABLE_ENCRYPT + .calculate_type = EVP_aes_128_cbc, +#endif + .encrypt = image_aes_encrypt, + .decrypt = image_aes_decrypt, + .add_cipher_data = image_aes_add_cipher_data + }, + { + .name = "aes192", + .key_len = AES192_KEY_LENGTH, + .iv_len = AES_BLOCK_LENGTH, +#if IMAGE_ENABLE_ENCRYPT + .calculate_type = EVP_aes_192_cbc, +#endif + .encrypt = image_aes_encrypt, + .decrypt = image_aes_decrypt, + .add_cipher_data = image_aes_add_cipher_data + }, + { + .name = "aes256", + .key_len = AES256_KEY_LENGTH, + .iv_len = AES_BLOCK_LENGTH, +#if IMAGE_ENABLE_ENCRYPT + .calculate_type = EVP_aes_256_cbc, +#endif + .encrypt = image_aes_encrypt, + .decrypt = image_aes_decrypt, + .add_cipher_data = image_aes_add_cipher_data + } +}; + +struct cipher_algo *image_get_cipher_algo(const char *full_name) +{ + int i; + const char *name; + + for (i = 0; i < ARRAY_SIZE(cipher_algos); i++) { + name = cipher_algos[i].name; + if (!strncmp(name, full_name, strlen(name))) + return &cipher_algos[i]; + } + + return NULL; +} + +static int fit_image_setup_decrypt(struct image_cipher_info *info, + const void *fit, int image_noffset, + int cipher_noffset) +{ + const void *fdt = gd_fdt_blob(); + const char *node_name; + char node_path[128]; + int noffset; + char *algo_name; + int ret; + + node_name = fit_get_name(fit, image_noffset, NULL); + if (!node_name) { + printf("Can't get node name\n"); + return -1; + } + + if (fit_image_cipher_get_algo(fit, cipher_noffset, &algo_name)) { + printf("Can't get algo name for cipher '%s' in image '%s'\n", + node_name, node_name); + return -1; + } + + info->keyname = fdt_getprop(fit, cipher_noffset, "key-name-hint", NULL); + if (!info->keyname) { + printf("Can't get key name\n"); + return -1; + } + + info->ivname = fdt_getprop(fit, cipher_noffset, "iv-name-hint", NULL); + if (!info->ivname) { + printf("Can't get IV name\n"); + return -1; + } + + info->fit = fit; + info->node_noffset = image_noffset; + info->name = algo_name; + info->cipher = image_get_cipher_algo(algo_name); + if (!info->cipher) { + printf("Can't get cipher\n"); + return -1; + } + + ret = fit_image_get_data_size_unciphered(fit, image_noffset, + &info->size_unciphered); + if (ret) { + printf("Can't get size of unciphered data\n"); + return -1; + } + + /* + * Search the cipher node in the u-boot fdt + * the path should be: /cipher/key-<algo>-<key>-<iv> + */ + snprintf(node_path, sizeof(node_path), "/%s/key-%s-%s-%s", + FIT_CIPHER_NODENAME, algo_name, info->keyname, info->ivname); + + noffset = fdt_path_offset(fdt, node_path); + if (noffset < 0) { + printf("Can't found cipher node offset\n"); + return -1; + } + + /* read key */ + info->key = fdt_getprop(fdt, noffset, "key", NULL); + if (!info->key) { + printf("Can't get key in cipher node '%s'\n", node_path); + return -1; + } + + /* read iv */ + info->iv = fdt_getprop(fdt, noffset, "iv", NULL); + if (!info->iv) { + printf("Can't get IV in cipher node '%s'\n", node_path); + return -1; + } + + return 0; +} + +int fit_image_decrypt_data(const void *fit, + int image_noffset, int cipher_noffset, + const void *data_ciphered, size_t size_ciphered, + void **data_unciphered, size_t *size_unciphered) +{ + struct image_cipher_info info; + int ret; + + ret = fit_image_setup_decrypt(&info, fit, image_noffset, + cipher_noffset); + if (ret < 0) + goto out; + + ret = info.cipher->decrypt(&info, data_ciphered, size_ciphered, + data_unciphered, size_unciphered); + + out: + return ret; +} diff --git a/common/image-fdt.c b/common/image-fdt.c index 48388488d98..dbb1e6e131c 100644 --- a/common/image-fdt.c +++ b/common/image-fdt.c @@ -285,7 +285,8 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch, *of_flat_tree = NULL; *of_size = 0; - img_addr = (argc == 0) ? load_addr : simple_strtoul(argv[0], NULL, 16); + img_addr = (argc == 0) ? image_load_addr : + simple_strtoul(argv[0], NULL, 16); buf = map_sysmem(img_addr, 0); if (argc > 2) @@ -304,7 +305,7 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch, else if (images->fit_uname_os) default_addr = (ulong)images->fit_hdr_os; else - default_addr = load_addr; + default_addr = image_load_addr; if (fit_parse_conf(select, default_addr, &fdt_addr, &fit_uname_config)) { diff --git a/common/image-fit.c b/common/image-fit.c index 231612ff5f0..f3bb00c98a5 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -948,6 +948,31 @@ int fit_image_get_data_size(const void *fit, int noffset, int *data_size) } /** + * Get 'data-size-unciphered' property from a given image node. + * + * @fit: pointer to the FIT image header + * @noffset: component image node offset + * @data_size: holds the data-size property + * + * returns: + * 0, on success + * -ENOENT if the property could not be found + */ +int fit_image_get_data_size_unciphered(const void *fit, int noffset, + size_t *data_size) +{ + const fdt32_t *val; + + val = fdt_getprop(fit, noffset, "data-size-unciphered", NULL); + if (!val) + return -ENOENT; + + *data_size = (size_t)fdt32_to_cpu(*val); + + return 0; +} + +/** * fit_image_get_data_and_size - get data and its size including * both embedded and external data * @fit: pointer to the FIT format image header @@ -1080,6 +1105,33 @@ static int fit_image_hash_get_ignore(const void *fit, int noffset, int *ignore) return 0; } +/** + * fit_image_cipher_get_algo - get cipher algorithm name + * @fit: pointer to the FIT format image header + * @noffset: cipher node offset + * @algo: double pointer to char, will hold pointer to the algorithm name + * + * fit_image_cipher_get_algo() finds cipher algorithm property in a given + * cipher node. If the property is found its data start address is returned + * to the caller. + * + * returns: + * 0, on success + * -1, on failure + */ +int fit_image_cipher_get_algo(const void *fit, int noffset, char **algo) +{ + int len; + + *algo = (char *)fdt_getprop(fit, noffset, FIT_ALGO_PROP, &len); + if (!*algo) { + fit_get_debug(fit, noffset, FIT_ALGO_PROP, len); + return -1; + } + + return 0; +} + ulong fit_get_end(const void *fit) { return map_to_sysmem((void *)(fit + fdt_totalsize(fit))); @@ -1354,6 +1406,32 @@ int fit_all_image_verify(const void *fit) return 1; } +#ifdef CONFIG_FIT_CIPHER +static int fit_image_uncipher(const void *fit, int image_noffset, + void **data, size_t *size) +{ + int cipher_noffset, ret; + void *dst; + size_t size_dst; + + cipher_noffset = fdt_subnode_offset(fit, image_noffset, + FIT_CIPHER_NODENAME); + if (cipher_noffset < 0) + return 0; + + ret = fit_image_decrypt_data(fit, image_noffset, cipher_noffset, + *data, *size, &dst, &size_dst); + if (ret) + goto out; + + *data = dst; + *size = size_dst; + + out: + return ret; +} +#endif /* CONFIG_FIT_CIPHER */ + /** * fit_image_check_os - check whether image node is of a given os type * @fit: pointer to the FIT format image header @@ -1954,6 +2032,18 @@ int fit_image_load(bootm_headers_t *images, ulong addr, return -ENOENT; } +#ifdef CONFIG_FIT_CIPHER + /* Decrypt data before uncompress/move */ + if (IMAGE_ENABLE_DECRYPT) { + puts(" Decrypting Data ... "); + if (fit_image_uncipher(fit, noffset, &buf, &size)) { + puts("Error\n"); + return -EACCES; + } + puts("OK\n"); + } +#endif + #if !defined(USE_HOSTCC) && defined(CONFIG_FIT_IMAGE_POST_PROCESS) /* perform any post-processing on the image data */ board_fit_image_post_process(&buf, &size); diff --git a/common/image.c b/common/image.c index 75d5dd944ff..2288cff1266 100644 --- a/common/image.c +++ b/common/image.c @@ -557,9 +557,9 @@ static const image_header_t *image_get_ramdisk(ulong rd_addr, uint8_t arch, /* Shared dual-format routines */ /*****************************************************************************/ #ifndef USE_HOSTCC -ulong load_addr = CONFIG_SYS_LOAD_ADDR; /* Default Load Address */ -ulong save_addr; /* Default Save Address */ -ulong save_size; /* Default Save Size (in bytes) */ +ulong image_load_addr = CONFIG_SYS_LOAD_ADDR; /* Default Load Address */ +ulong image_save_addr; /* Default Save Address */ +ulong image_save_size; /* Default Save Size (in bytes) */ static int on_loadaddr(const char *name, const char *value, enum env_op op, int flags) @@ -567,7 +567,7 @@ static int on_loadaddr(const char *name, const char *value, enum env_op op, switch (op) { case env_op_create: case env_op_overwrite: - load_addr = simple_strtoul(value, NULL, 16); + image_load_addr = simple_strtoul(value, NULL, 16); break; default: break; @@ -936,15 +936,15 @@ ulong genimg_get_kernel_addr_fit(char * const img_addr, /* find out kernel image address */ if (!img_addr) { - kernel_addr = load_addr; + kernel_addr = image_load_addr; debug("* kernel: default image load address = 0x%08lx\n", - load_addr); + image_load_addr); #if CONFIG_IS_ENABLED(FIT) - } else if (fit_parse_conf(img_addr, load_addr, &kernel_addr, + } else if (fit_parse_conf(img_addr, image_load_addr, &kernel_addr, fit_uname_config)) { debug("* kernel: config '%s' from image at 0x%08lx\n", *fit_uname_config, kernel_addr); - } else if (fit_parse_subimage(img_addr, load_addr, &kernel_addr, + } else if (fit_parse_subimage(img_addr, image_load_addr, &kernel_addr, fit_uname_kernel)) { debug("* kernel: subimage '%s' from image at 0x%08lx\n", *fit_uname_kernel, kernel_addr); @@ -1102,7 +1102,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images, if (images->fit_uname_os) default_addr = (ulong)images->fit_hdr_os; else - default_addr = load_addr; + default_addr = image_load_addr; if (fit_parse_conf(select, default_addr, &rd_addr, &fit_uname_config)) { diff --git a/common/main.c b/common/main.c index a94df7ae042..ec8994ad457 100644 --- a/common/main.c +++ b/common/main.c @@ -12,6 +12,7 @@ #include <command.h> #include <console.h> #include <env.h> +#include <init.h> #include <version.h> /* diff --git a/common/memsize.c b/common/memsize.c index 13b00477866..e95c68265ab 100644 --- a/common/memsize.c +++ b/common/memsize.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <init.h> DECLARE_GLOBAL_DATA_PTR; diff --git a/common/spl/spl.c b/common/spl/spl.c index 19085ad2701..932e6ab98ac 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -11,6 +11,7 @@ #include <binman_sym.h> #include <dm.h> #include <handoff.h> +#include <hang.h> #include <irq_func.h> #include <serial.h> #include <spl.h> diff --git a/common/spl/spl_net.c b/common/spl/spl_net.c index 803303249c7..30c050c0b3e 100644 --- a/common/spl/spl_net.c +++ b/common/spl/spl_net.c @@ -19,14 +19,14 @@ static ulong spl_net_load_read(struct spl_load_info *load, ulong sector, { debug("%s: sector %lx, count %lx, buf %lx\n", __func__, sector, count, (ulong)buf); - memcpy(buf, (void *)(load_addr + sector), count); + memcpy(buf, (void *)(image_load_addr + sector), count); return count; } static int spl_net_load_image(struct spl_image_info *spl_image, struct spl_boot_device *bootdev) { - struct image_header *header = (struct image_header *)load_addr; + struct image_header *header = (struct image_header *)image_load_addr; int rv; env_init(); diff --git a/common/spl/spl_opensbi.c b/common/spl/spl_opensbi.c index 6404373ecad..a136073fdbb 100644 --- a/common/spl/spl_opensbi.c +++ b/common/spl/spl_opensbi.c @@ -8,6 +8,7 @@ #include <common.h> #include <cpu_func.h> #include <errno.h> +#include <hang.h> #include <spl.h> #include <asm/smp.h> #include <opensbi.h> diff --git a/common/update.c b/common/update.c index 13b09ab00f3..c8dd346a095 100644 --- a/common/update.c +++ b/common/update.c @@ -8,6 +8,7 @@ #include <common.h> #include <cpu_func.h> +#include <image.h> #if !(defined(CONFIG_FIT) && defined(CONFIG_OF_LIBFDT)) #error "CONFIG_FIT and CONFIG_OF_LIBFDT are required for auto-update feature" @@ -45,7 +46,6 @@ extern ulong tftp_timeout_ms; extern int tftp_timeout_count_max; -extern ulong load_addr; #ifdef CONFIG_MTD_NOR_FLASH extern flash_info_t flash_info[]; static uchar *saved_prot_info; @@ -72,7 +72,7 @@ static int update_load(char *filename, ulong msec_max, int cnt_max, ulong addr) env_set("netretry", "no"); /* download the update file */ - load_addr = addr; + image_load_addr = addr; copy_filename(net_boot_file_name, filename, sizeof(net_boot_file_name)); size = net_loop(TFTPGET); diff --git a/drivers/cache/cache-ncore.c b/drivers/cache/cache-ncore.c index e3aca360713..0aab7ee1914 100644 --- a/drivers/cache/cache-ncore.c +++ b/drivers/cache/cache-ncore.c @@ -4,6 +4,7 @@ * */ #include <dm.h> +#include <hang.h> #include <wait_bit.h> #include <asm/io.h> diff --git a/drivers/cache/cache-v5l2.c b/drivers/cache/cache-v5l2.c index d367171b365..1373e7c387d 100644 --- a/drivers/cache/cache-v5l2.c +++ b/drivers/cache/cache-v5l2.c @@ -8,6 +8,7 @@ #include <command.h> #include <cache.h> #include <dm.h> +#include <hang.h> #include <asm/io.h> #include <dm/ofnode.h> diff --git a/drivers/clk/clk_pic32.c b/drivers/clk/clk_pic32.c index b3ac0d5a92a..79469c454fe 100644 --- a/drivers/clk/clk_pic32.c +++ b/drivers/clk/clk_pic32.c @@ -8,6 +8,7 @@ #include <clk-uclass.h> #include <dm.h> #include <div64.h> +#include <time.h> #include <wait_bit.h> #include <dm/lists.h> #include <asm/io.h> diff --git a/drivers/clk/mpc83xx_clk.c b/drivers/clk/mpc83xx_clk.c index 69c6207e49a..4183db28455 100644 --- a/drivers/clk/mpc83xx_clk.c +++ b/drivers/clk/mpc83xx_clk.c @@ -6,6 +6,7 @@ #include <common.h> #include <clk-uclass.h> +#include <clock_legacy.h> #include <dm.h> #include <vsprintf.h> #include <dm/lists.h> diff --git a/drivers/ddr/altera/sdram_agilex.c b/drivers/ddr/altera/sdram_agilex.c index 0cbcd140560..626fb724d4e 100644 --- a/drivers/ddr/altera/sdram_agilex.c +++ b/drivers/ddr/altera/sdram_agilex.c @@ -9,6 +9,7 @@ #include <errno.h> #include <div64.h> #include <fdtdec.h> +#include <hang.h> #include <ram.h> #include <reset.h> #include "sdram_soc64.h" diff --git a/drivers/ddr/altera/sdram_gen5.c b/drivers/ddr/altera/sdram_gen5.c index 435f42bc0ab..a3b914fdfc0 100644 --- a/drivers/ddr/altera/sdram_gen5.c +++ b/drivers/ddr/altera/sdram_gen5.c @@ -6,6 +6,7 @@ #include <dm.h> #include <errno.h> #include <div64.h> +#include <init.h> #include <ram.h> #include <reset.h> #include <watchdog.h> diff --git a/drivers/ddr/altera/sdram_s10.c b/drivers/ddr/altera/sdram_s10.c index 93c15dd18b3..0b36d6c027d 100644 --- a/drivers/ddr/altera/sdram_s10.c +++ b/drivers/ddr/altera/sdram_s10.c @@ -10,6 +10,8 @@ #include <errno.h> #include <div64.h> #include <fdtdec.h> +#include <hang.h> +#include <init.h> #include <ram.h> #include <reset.h> #include "sdram_s10.h" diff --git a/drivers/ddr/altera/sdram_soc64.c b/drivers/ddr/altera/sdram_soc64.c index 985a108b1c5..e0d04ccca28 100644 --- a/drivers/ddr/altera/sdram_soc64.c +++ b/drivers/ddr/altera/sdram_soc64.c @@ -10,6 +10,7 @@ #include <errno.h> #include <div64.h> #include <fdtdec.h> +#include <hang.h> #include <ram.h> #include <reset.h> #include "sdram_soc64.h" diff --git a/drivers/ddr/marvell/a38x/ddr3_training_ip_engine.c b/drivers/ddr/marvell/a38x/ddr3_training_ip_engine.c index 74417d61b4c..9293d54e5a0 100644 --- a/drivers/ddr/marvell/a38x/ddr3_training_ip_engine.c +++ b/drivers/ddr/marvell/a38x/ddr3_training_ip_engine.c @@ -6,6 +6,7 @@ #include "ddr3_init.h" #include "mv_ddr_regs.h" #include "ddr_training_ip_db.h" +#include <image.h> #define PATTERN_1 0x55555555 #define PATTERN_2 0xaaaaaaaa @@ -612,9 +613,9 @@ int ddr3_tip_load_pattern_to_odpg(u32 dev_num, enum hws_access_type access_type, MASK_ALL_BITS)); } - CHECK_STATUS(ddr3_tip_if_write - (dev_num, access_type, if_id, - ODPG_DATA_BUFFER_OFFS_REG, load_addr, MASK_ALL_BITS)); + CHECK_STATUS(ddr3_tip_if_write(dev_num, access_type, if_id, + ODPG_DATA_BUFFER_OFFS_REG, + image_load_addr, MASK_ALL_BITS)); return MV_OK; } diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile index d4e8638dea1..2b843de93ce 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@ -51,7 +51,6 @@ obj-$(CONFIG_LED_STATUS_GPIO) += gpio_led.o obj-$(CONFIG_MPC83XX_SERDES) += mpc83xx_serdes.o obj-$(CONFIG_MXC_OCOTP) += mxc_ocotp.o obj-$(CONFIG_MXS_OCOTP) += mxs_ocotp.o -obj-$(CONFIG_NS87308) += ns87308.o obj-$(CONFIG_NUVOTON_NCT6102D) += nuvoton_nct6102d.o obj-$(CONFIG_P2SB) += p2sb-uclass.o obj-$(CONFIG_PCA9551_LED) += pca9551_led.o diff --git a/drivers/misc/imx8/scu_api.c b/drivers/misc/imx8/scu_api.c index b2fdeef13ab..b34191753b1 100644 --- a/drivers/misc/imx8/scu_api.c +++ b/drivers/misc/imx8/scu_api.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <hang.h> #include <asm/io.h> #include <dm.h> #include <asm/arch/sci/sci.h> diff --git a/drivers/misc/ns87308.c b/drivers/misc/ns87308.c deleted file mode 100644 index f5de3329b78..00000000000 --- a/drivers/misc/ns87308.c +++ /dev/null @@ -1,100 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * (C) Copyright 2000 - * Rob Taylor, Flying Pig Systems. robt@flyingpig.com. - */ - -#include <config.h> - -#include <ns87308.h> - -void initialise_ns87308 (void) -{ -#ifdef CONFIG_SYS_NS87308_PS2MOD - unsigned char data; - - /* - * Switch floppy drive to PS/2 mode. - */ - read_pnp_config(SUPOERIO_CONF1, &data); - data &= 0xFB; - write_pnp_config(SUPOERIO_CONF1, data); -#endif - -#if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_KBC1) - PNP_SET_DEVICE_BASE(LDEV_KBC1, CONFIG_SYS_NS87308_KBC1_BASE); - write_pnp_config(LUN_CONFIG_REG, 0); - write_pnp_config(CBASE_HIGH, 0x00); - write_pnp_config(CBASE_LOW, 0x64); -#endif - -#if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_MOUSE) - PNP_ACTIVATE_DEVICE(LDEV_MOUSE); -#endif - -#if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_RTC_APC) - PNP_SET_DEVICE_BASE(LDEV_RTC_APC, CONFIG_SYS_NS87308_RTC_BASE); -#endif - -#if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_FDC) - PNP_SET_DEVICE_BASE(LDEV_FDC, CONFIG_SYS_NS87308_FDC_BASE); - write_pnp_config(LUN_CONFIG_REG, 0x40); -#endif - -#if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_RARP) - PNP_SET_DEVICE_BASE(LDEV_PARP, CONFIG_SYS_NS87308_LPT_BASE); -#endif - -#if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_UART1) - PNP_SET_DEVICE_BASE(LDEV_UART1, CONFIG_SYS_NS87308_UART1_BASE); -#endif - -#if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_UART2) - PNP_SET_DEVICE_BASE(LDEV_UART2, CONFIG_SYS_NS87308_UART2_BASE); -#endif - -#if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_GPIO) - PNP_SET_DEVICE_BASE(LDEV_GPIO, CONFIG_SYS_NS87308_GPIO_BASE); -#endif - -#if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_POWRMAN) -#ifndef CONFIG_SYS_NS87308_PWMAN_BASE - PNP_ACTIVATE_DEVICE(LDEV_POWRMAN); -#else - PNP_SET_DEVICE_BASE(LDEV_POWRMAN, CONFIG_SYS_NS87308_PWMAN_BASE); - - /* - * Enable all units - */ - write_pm_reg(CONFIG_SYS_NS87308_PWMAN_BASE, PWM_FER1, 0x7d); - write_pm_reg(CONFIG_SYS_NS87308_PWMAN_BASE, PWM_FER2, 0x87); - -#ifdef CONFIG_SYS_NS87308_PMC1 - write_pm_reg(CONFIG_SYS_NS87308_PWMAN_BASE, PWM_PMC1, CONFIG_SYS_NS87308_PMC1); -#endif - -#ifdef CONFIG_SYS_NS87308_PMC2 - write_pm_reg(CONFIG_SYS_NS87308_PWMAN_BASE, PWM_PMC2, CONFIG_SYS_NS87308_PMC2); -#endif - -#ifdef CONFIG_SYS_NS87308_PMC3 - write_pm_reg(CONFIG_SYS_NS87308_PWMAN_BASE, PWM_PMC3, CONFIG_SYS_NS87308_PMC3); -#endif -#endif -#endif - -#ifdef CONFIG_SYS_NS87308_CS0_BASE - PNP_PGCS_CSLINE_BASE(0, CONFIG_SYS_NS87308_CS0_BASE); - PNP_PGCS_CSLINE_CONF(0, CONFIG_SYS_NS87308_CS0_CONF); -#endif - -#ifdef CONFIG_SYS_NS87308_CS1_BASE - PNP_PGCS_CSLINE_BASE(1, CONFIG_SYS_NS87308_CS1_BASE); - PNP_PGCS_CSLINE_CONF(1, CONFIG_SYS_NS87308_CS1_CONF); -#endif - -#ifdef CONFIG_SYS_NS87308_CS2_BASE - PNP_PGCS_CSLINE_BASE(2, CONFIG_SYS_NS87308_CS2_BASE); - PNP_PGCS_CSLINE_CONF(2, CONFIG_SYS_NS87308_CS2_CONF); -#endif -} diff --git a/drivers/mmc/fsl_esdhc_spl.c b/drivers/mmc/fsl_esdhc_spl.c index 3021c3d6d4f..afe55fad9de 100644 --- a/drivers/mmc/fsl_esdhc_spl.c +++ b/drivers/mmc/fsl_esdhc_spl.c @@ -5,6 +5,7 @@ #include <common.h> #include <cpu_func.h> +#include <hang.h> #include <mmc.h> #include <malloc.h> diff --git a/drivers/mtd/nand/raw/mxc_nand_spl.c b/drivers/mtd/nand/raw/mxc_nand_spl.c index 6c03db8428f..e1e542519d8 100644 --- a/drivers/mtd/nand/raw/mxc_nand_spl.c +++ b/drivers/mtd/nand/raw/mxc_nand_spl.c @@ -11,6 +11,7 @@ */ #include <common.h> +#include <hang.h> #include <nand.h> #include <asm/arch/imx-regs.h> #include <asm/io.h> diff --git a/drivers/mtd/spi/fsl_espi_spl.c b/drivers/mtd/spi/fsl_espi_spl.c index 580b1e24b73..5c41d7558c2 100644 --- a/drivers/mtd/spi/fsl_espi_spl.c +++ b/drivers/mtd/spi/fsl_espi_spl.c @@ -5,6 +5,7 @@ #include <common.h> #include <cpu_func.h> +#include <hang.h> #include <spi_flash.h> #include <malloc.h> diff --git a/drivers/net/ag7xxx.c b/drivers/net/ag7xxx.c index 804d5c20b64..e3a7222efba 100644 --- a/drivers/net/ag7xxx.c +++ b/drivers/net/ag7xxx.c @@ -7,6 +7,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <cpu_func.h> #include <dm.h> #include <errno.h> diff --git a/drivers/net/fsl_mcdmafec.c b/drivers/net/fsl_mcdmafec.c index 7838fb5c10a..45954cecb6b 100644 --- a/drivers/net/fsl_mcdmafec.c +++ b/drivers/net/fsl_mcdmafec.c @@ -12,6 +12,7 @@ #include <common.h> #include <env.h> +#include <hang.h> #include <malloc.h> #include <command.h> #include <config.h> diff --git a/drivers/net/mcffec.c b/drivers/net/mcffec.c index 4ec24362d06..8caf0ba6b1c 100644 --- a/drivers/net/mcffec.c +++ b/drivers/net/mcffec.c @@ -12,6 +12,7 @@ #include <common.h> #include <env.h> +#include <hang.h> #include <malloc.h> #include <command.h> #include <net.h> diff --git a/drivers/net/mpc8xx_fec.c b/drivers/net/mpc8xx_fec.c index 0a809851922..69b2174ab3d 100644 --- a/drivers/net/mpc8xx_fec.c +++ b/drivers/net/mpc8xx_fec.c @@ -6,6 +6,7 @@ #include <common.h> #include <command.h> +#include <hang.h> #include <malloc.h> #include <net.h> #include <netdev.h> diff --git a/drivers/pci/pci_rom.c b/drivers/pci/pci_rom.c index 1d4064e3769..90f224b0452 100644 --- a/drivers/pci/pci_rom.c +++ b/drivers/pci/pci_rom.c @@ -26,6 +26,7 @@ #include <bios_emul.h> #include <dm.h> #include <errno.h> +#include <init.h> #include <malloc.h> #include <pci.h> #include <pci_rom.h> diff --git a/drivers/ram/bmips_ram.c b/drivers/ram/bmips_ram.c index 3e1dd9e2410..8f953e79afd 100644 --- a/drivers/ram/bmips_ram.c +++ b/drivers/ram/bmips_ram.c @@ -10,6 +10,7 @@ #include <common.h> #include <dm.h> #include <errno.h> +#include <init.h> #include <ram.h> #include <asm/io.h> diff --git a/drivers/ram/k3-j721e/k3-j721e-ddrss.c b/drivers/ram/k3-j721e/k3-j721e-ddrss.c index 9feb0aa766e..a9b7d40890b 100644 --- a/drivers/ram/k3-j721e/k3-j721e-ddrss.c +++ b/drivers/ram/k3-j721e/k3-j721e-ddrss.c @@ -8,6 +8,7 @@ #include <common.h> #include <clk.h> #include <dm.h> +#include <hang.h> #include <ram.h> #include <asm/io.h> #include <power-domain.h> diff --git a/drivers/ram/mpc83xx_sdram.c b/drivers/ram/mpc83xx_sdram.c index f03d0428b2a..46449d3d122 100644 --- a/drivers/ram/mpc83xx_sdram.c +++ b/drivers/ram/mpc83xx_sdram.c @@ -6,6 +6,7 @@ #include <common.h> #include <dm.h> +#include <init.h> #include <ram.h> #include <dt-bindings/memory/mpc83xx-sdram.h> diff --git a/drivers/ram/rockchip/dmc-rk3368.c b/drivers/ram/rockchip/dmc-rk3368.c index 9df8f8f4af0..8addee8cc30 100644 --- a/drivers/ram/rockchip/dmc-rk3368.c +++ b/drivers/ram/rockchip/dmc-rk3368.c @@ -6,6 +6,7 @@ #include <common.h> #include <clk.h> #include <dm.h> +#include <hang.h> #include <dt-bindings/memory/rk3368-dmc.h> #include <dt-structs.h> #include <ram.h> diff --git a/drivers/ram/rockchip/sdram_rk3188.c b/drivers/ram/rockchip/sdram_rk3188.c index d3e4316ef01..9b5eb38eccd 100644 --- a/drivers/ram/rockchip/sdram_rk3188.c +++ b/drivers/ram/rockchip/sdram_rk3188.c @@ -11,6 +11,7 @@ #include <dm.h> #include <dt-structs.h> #include <errno.h> +#include <hang.h> #include <ram.h> #include <regmap.h> #include <syscon.h> diff --git a/drivers/ram/rockchip/sdram_rk3288.c b/drivers/ram/rockchip/sdram_rk3288.c index 690751d0747..3eb14cdb32c 100644 --- a/drivers/ram/rockchip/sdram_rk3288.c +++ b/drivers/ram/rockchip/sdram_rk3288.c @@ -11,6 +11,7 @@ #include <dm.h> #include <dt-structs.h> #include <errno.h> +#include <hang.h> #include <ram.h> #include <regmap.h> #include <syscon.h> diff --git a/drivers/ram/stm32mp1/stm32mp1_ram.c b/drivers/ram/stm32mp1/stm32mp1_ram.c index a362cf98bfc..eb78f1198d7 100644 --- a/drivers/ram/stm32mp1/stm32mp1_ram.c +++ b/drivers/ram/stm32mp1/stm32mp1_ram.c @@ -6,6 +6,7 @@ #include <common.h> #include <clk.h> #include <dm.h> +#include <init.h> #include <ram.h> #include <regmap.h> #include <syscon.h> diff --git a/drivers/ram/stm32mp1/stm32mp1_tests.c b/drivers/ram/stm32mp1/stm32mp1_tests.c index 581ee4897f2..12298cf3273 100644 --- a/drivers/ram/stm32mp1/stm32mp1_tests.c +++ b/drivers/ram/stm32mp1/stm32mp1_tests.c @@ -4,6 +4,7 @@ */ #include <common.h> #include <console.h> +#include <init.h> #include <watchdog.h> #include <asm/io.h> #include <linux/log2.h> diff --git a/drivers/serial/lpc32xx_hsuart.c b/drivers/serial/lpc32xx_hsuart.c index 8b0fd254b1b..7d31c6d4a14 100644 --- a/drivers/serial/lpc32xx_hsuart.c +++ b/drivers/serial/lpc32xx_hsuart.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <dm.h> #include <serial.h> #include <dm/platform_data/lpc32xx_hsuart.h> diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index 754b6e99215..a92d2b1de88 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -4,6 +4,7 @@ * modified to use CONFIG_SYS_ISA_MEM and new defines */ +#include <clock_legacy.h> #include <common.h> #include <clk.h> #include <dm.h> diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index bf5f39215d1..baeaeaac8ea 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -6,6 +6,7 @@ #include <common.h> #include <env_internal.h> +#include <hang.h> #include <serial.h> #include <stdio_dev.h> #include <post.h> diff --git a/drivers/serial/serial_ar933x.c b/drivers/serial/serial_ar933x.c index 5249c553987..897ea5d6dc2 100644 --- a/drivers/serial/serial_ar933x.c +++ b/drivers/serial/serial_ar933x.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <dm.h> #include <div64.h> #include <errno.h> diff --git a/drivers/serial/serial_ns16550.c b/drivers/serial/serial_ns16550.c index 5afe620b9fc..ef394b72350 100644 --- a/drivers/serial/serial_ns16550.c +++ b/drivers/serial/serial_ns16550.c @@ -5,14 +5,10 @@ */ #include <common.h> -#include <linux/compiler.h> - +#include <clock_legacy.h> #include <ns16550.h> -#ifdef CONFIG_NS87308 -#include <ns87308.h> -#endif - #include <serial.h> +#include <linux/compiler.h> #ifndef CONFIG_NS16550_MIN_FUNCTIONS diff --git a/drivers/serial/serial_pxa.c b/drivers/serial/serial_pxa.c index cf4d8f64427..6f8f7e1198a 100644 --- a/drivers/serial/serial_pxa.c +++ b/drivers/serial/serial_pxa.c @@ -20,6 +20,7 @@ */ #include <common.h> +#include <hang.h> #include <asm/arch/pxa-regs.h> #include <asm/arch/regs-uart.h> #include <asm/io.h> diff --git a/drivers/spi/ath79_spi.c b/drivers/spi/ath79_spi.c index 0b8ebaabe9b..f64a28c6e0b 100644 --- a/drivers/spi/ath79_spi.c +++ b/drivers/spi/ath79_spi.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <clock_legacy.h> #include <spi.h> #include <dm.h> #include <div64.h> diff --git a/drivers/sysreset/sysreset-uclass.c b/drivers/sysreset/sysreset-uclass.c index 39202588ae4..51fdb1055e3 100644 --- a/drivers/sysreset/sysreset-uclass.c +++ b/drivers/sysreset/sysreset-uclass.c @@ -7,6 +7,8 @@ #define LOG_CATEGORY UCLASS_SYSRESET #include <common.h> +#include <cpu_func.h> +#include <hang.h> #include <sysreset.h> #include <dm.h> #include <errno.h> diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c index bcd1c5d47c1..50836db4a04 100644 --- a/drivers/usb/gadget/f_sdp.c +++ b/drivers/usb/gadget/f_sdp.c @@ -726,7 +726,7 @@ static void sdp_handle_in_ep(struct spl_image_info *spl_image) jump_to_image_no_args(&spl_image); #else /* In U-Boot, allow jumps to scripts */ - source(sdp_func->jmp_address, "script@1"); + image_source_script(sdp_func->jmp_address, "script@1"); #endif } diff --git a/drivers/usb/musb/musb_udc.c b/drivers/usb/musb/musb_udc.c index 584564bac2b..4d7723621d0 100644 --- a/drivers/usb/musb/musb_udc.c +++ b/drivers/usb/musb/musb_udc.c @@ -38,6 +38,7 @@ */ #include <common.h> +#include <hang.h> #include <serial.h> #include <usbdevice.h> #include <usb/udc.h> diff --git a/drivers/usb/phy/rockchip_usb2_phy.c b/drivers/usb/phy/rockchip_usb2_phy.c index 69e408b6c1b..ec998901ab9 100644 --- a/drivers/usb/phy/rockchip_usb2_phy.c +++ b/drivers/usb/phy/rockchip_usb2_phy.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <hang.h> #include <asm/io.h> #include "../gadget/dwc2_udc_otg_priv.h" diff --git a/drivers/video/broadwell_igd.c b/drivers/video/broadwell_igd.c index e6df037cb93..c23421d25be 100644 --- a/drivers/video/broadwell_igd.c +++ b/drivers/video/broadwell_igd.c @@ -8,6 +8,7 @@ #include <common.h> #include <bios_emul.h> #include <dm.h> +#include <init.h> #include <vbe.h> #include <video.h> #include <asm/cpu.h> diff --git a/drivers/watchdog/imx_watchdog.c b/drivers/watchdog/imx_watchdog.c index c030360c219..01762df019b 100644 --- a/drivers/watchdog/imx_watchdog.c +++ b/drivers/watchdog/imx_watchdog.c @@ -5,7 +5,9 @@ */ #include <common.h> +#include <cpu_func.h> #include <dm.h> +#include <hang.h> #include <asm/io.h> #include <wdt.h> #include <watchdog.h> diff --git a/drivers/watchdog/mtk_wdt.c b/drivers/watchdog/mtk_wdt.c index dafd2b56a8e..669a32320d4 100644 --- a/drivers/watchdog/mtk_wdt.c +++ b/drivers/watchdog/mtk_wdt.c @@ -8,6 +8,7 @@ #include <common.h> #include <dm.h> +#include <hang.h> #include <wdt.h> #include <asm/io.h> diff --git a/drivers/watchdog/ulp_wdog.c b/drivers/watchdog/ulp_wdog.c index 313019f152b..7533fc612c7 100644 --- a/drivers/watchdog/ulp_wdog.c +++ b/drivers/watchdog/ulp_wdog.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <asm/io.h> #include <asm/arch/imx-regs.h> diff --git a/drivers/watchdog/wdt-uclass.c b/drivers/watchdog/wdt-uclass.c index bbfac4f0f9b..cf1c5274739 100644 --- a/drivers/watchdog/wdt-uclass.c +++ b/drivers/watchdog/wdt-uclass.c @@ -6,6 +6,7 @@ #include <common.h> #include <dm.h> #include <errno.h> +#include <hang.h> #include <wdt.h> #include <dm/device-internal.h> #include <dm/lists.h> diff --git a/env/flash.c b/env/flash.c index b487e6701ef..e05f7ef74b9 100644 --- a/env/flash.c +++ b/env/flash.c @@ -13,6 +13,7 @@ #include <command.h> #include <env.h> #include <env_internal.h> +#include <flash.h> #include <linux/stddef.h> #include <malloc.h> #include <search.h> diff --git a/examples/api/libgenwrap.c b/examples/api/libgenwrap.c index 67b2d641fc7..769dcc70385 100644 --- a/examples/api/libgenwrap.c +++ b/examples/api/libgenwrap.c @@ -10,6 +10,7 @@ */ #include <common.h> +#include <hang.h> #include <linux/types.h> #include <api_public.h> @@ -41,7 +42,7 @@ void *malloc (size_t len) return NULL; } -void hang (void) +void hang(void) { while (1) ; } diff --git a/include/clock_legacy.h b/include/clock_legacy.h new file mode 100644 index 00000000000..b0a8333ea6e --- /dev/null +++ b/include/clock_legacy.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * (C) Copyright 2000-2009 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + */ + +#ifndef __CLOCK_LEGACY_H +#define __CLOCK_LEGACY_H + +int get_clocks(void); +unsigned long get_bus_freq(unsigned long dummy); +int get_serial_clock(void); + +#endif diff --git a/include/common.h b/include/common.h index 52c02185f40..0ef8505fc79 100644 --- a/include/common.h +++ b/include/common.h @@ -2,9 +2,8 @@ /* * Common header file for U-Boot * - * This file still includes quite a bit of stuff that should be in separate - * headers. Please think before adding more things. - * Patches to remove things are welcome. + * This file still includes quite a few headers that should be included + * individually as needed. Patches to remove things are welcome. * * (C) Copyright 2000-2009 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. @@ -14,11 +13,6 @@ #define __COMMON_H_ 1 #ifndef __ASSEMBLY__ /* put C only stuff in this section */ - -typedef volatile unsigned long vu_long; -typedef volatile unsigned short vu_short; -typedef volatile unsigned char vu_char; - #include <config.h> #include <errno.h> #include <time.h> @@ -34,159 +28,20 @@ typedef volatile unsigned char vu_char; #include <stdarg.h> #include <stdio.h> #include <linux/kernel.h> - #include <part.h> #include <flash.h> #include <image.h> - -#ifdef __LP64__ -#define CONFIG_SYS_SUPPORT_64BIT_DATA -#endif - #include <log.h> - #include <asm/u-boot.h> /* boot information for Linux kernel */ #include <asm/global_data.h> /* global data used for startup functions */ - -/* startup functions, used in: - * common/board_f.c - * common/init/board_init.c - * common/board_r.c - * common/board_info.c - */ #include <init.h> - -/* - * Function Prototypes - */ -void hang (void) __attribute__ ((noreturn)); - #include <display_options.h> - -/* common/main.c */ -void main_loop (void); - -int checkflash(void); -int checkdram(void); -extern u8 __dtb_dt_begin[]; /* embedded device tree blob */ -extern u8 __dtb_dt_spl_begin[]; /* embedded device tree blob for SPL/TPL */ -int mdm_init(void); - -/** - * arch_fixup_fdt() - Write arch-specific information to fdt - * - * Defined in arch/$(ARCH)/lib/bootm-fdt.c - * - * @blob: FDT blob to write to - * @return 0 if ok, or -ve FDT_ERR_... on failure - */ -int arch_fixup_fdt(void *blob); - -/* common/flash.c */ -void flash_perror (int); - -/* common/cmd_source.c */ -int source (ulong addr, const char *fit_uname); - -extern ulong load_addr; /* Default Load Address */ -extern ulong save_addr; /* Default Save Address */ -extern ulong save_size; /* Default Save Size */ - -/* common/cmd_net.c */ -int do_tftpb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); - -/* common/cmd_fat.c */ -int do_fat_fsload(cmd_tbl_t *, int, int, char * const []); - -/* common/cmd_ext2.c */ -int do_ext2load(cmd_tbl_t *, int, int, char * const []); - -/* common/exports.c */ -void jumptable_init(void); - -/* common/kallsysm.c */ -const char *symbol_lookup(unsigned long addr, unsigned long *caddr); - -/* common/memsize.c */ -long get_ram_size (long *, long); -phys_size_t get_effective_memsize(void); - -/* $(BOARD)/$(BOARD).c */ -void reset_phy (void); -void fdc_hw_init (void); - -#if !defined(CONFIG_ENV_EEPROM_IS_ON_I2C) && defined(CONFIG_SYS_I2C_EEPROM_ADDR) -# define CONFIG_SYS_DEF_EEPROM_ADDR CONFIG_SYS_I2C_EEPROM_ADDR -#endif - -#if defined(CONFIG_SYS_DRAM_TEST) -int testdram(void); -#endif /* CONFIG_SYS_DRAM_TEST */ - -#if defined(CONFIG_ARM) -void relocate_code(ulong); -#else -void relocate_code(ulong, gd_t *, ulong) __attribute__ ((noreturn)); -#endif - -void s_init(void); - -void upmconfig (unsigned int, unsigned int *, unsigned int); -ulong get_tbclk (void); -void reset_misc (void); -void reset_cpu (ulong addr); -void ft_cpu_setup(void *blob, bd_t *bd); -void ft_pci_setup(void *blob, bd_t *bd); - -/* $(CPU)/speed.c */ -int get_clocks (void); -ulong get_bus_freq (ulong); -int get_serial_clock(void); - -/* lib/uuid.c */ #include <uuid.h> - -/* lib/vsprintf.c */ #include <vsprintf.h> - -/* lib/net_utils.c */ #include <net.h> - #include <bootstage.h> - -#else /* __ASSEMBLY__ */ - #endif /* __ASSEMBLY__ */ -/* Put only stuff here that the assembler can digest */ - -#ifdef CONFIG_POST -#define CONFIG_HAS_POST -#ifndef CONFIG_POST_ALT_LIST -#define CONFIG_POST_STD_LIST -#endif -#endif - -#define ROUND(a,b) (((a) + (b) - 1) & ~((b) - 1)) - -/* - * check_member() - Check the offset of a structure member - * - * @structure: Name of structure (e.g. global_data) - * @member: Name of member (e.g. baudrate) - * @offset: Expected offset in bytes - */ -#define check_member(structure, member, offset) _Static_assert( \ - offsetof(struct structure, member) == offset, \ - "`struct " #structure "` offset for `" #member "` is not " #offset) - -/* Avoid using CONFIG_EFI_STUB directly as we may boot from other loaders */ -#ifdef CONFIG_EFI_STUB -#define ll_boot_init() false -#else -#define ll_boot_init() true -#endif - /* Pull in stuff for the build system */ #ifdef DO_DEPS_ONLY # include <env_internal.h> diff --git a/include/compiler.h b/include/compiler.h index 90372f239c0..ed74c272b8c 100644 --- a/include/compiler.h +++ b/include/compiler.h @@ -144,4 +144,8 @@ typedef unsigned long int uintptr_t; #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) +#ifdef __LP64__ +#define MEM_SUPPORT_64BIT_DATA +#endif + #endif diff --git a/include/cpu_func.h b/include/cpu_func.h index 46f3d92459b..f701f02bfef 100644 --- a/include/cpu_func.h +++ b/include/cpu_func.h @@ -83,5 +83,7 @@ enum { * @param flags Flags to control what is done */ int cleanup_before_linux_select(int flags); + +void reset_cpu(ulong addr); ; #endif diff --git a/include/eeprom.h b/include/eeprom.h index 61eb826a734..79118eb83de 100644 --- a/include/eeprom.h +++ b/include/eeprom.h @@ -21,4 +21,8 @@ int eeprom_write(uint dev_addr, uint offset, uchar *buffer, uint cnt); #define eeprom_write(dev_addr, offset, buffer, cnt) ((void)-ENOSYS) #endif +#if !defined(CONFIG_ENV_EEPROM_IS_ON_I2C) && defined(CONFIG_SYS_I2C_EEPROM_ADDR) +# define CONFIG_SYS_DEF_EEPROM_ADDR CONFIG_SYS_I2C_EEPROM_ADDR +#endif + #endif diff --git a/include/exports.h b/include/exports.h index 35f463287fb..cbd16fc5185 100644 --- a/include/exports.h +++ b/include/exports.h @@ -13,6 +13,9 @@ struct spi_slave; +/* Set up the jump table for use by the API */ +void jumptable_init(void); + /* These are declarations of exported functions available in C code */ unsigned long get_version(void); int getc(void); diff --git a/include/fdt_support.h b/include/fdt_support.h index 3f4bc643d44..ba14acd7f62 100644 --- a/include/fdt_support.h +++ b/include/fdt_support.h @@ -12,6 +12,20 @@ #include <asm/u-boot.h> #include <linux/libfdt.h> +/** + * arch_fixup_fdt() - Write arch-specific information to fdt + * + * Defined in arch/$(ARCH)/lib/bootm-fdt.c + * + * @blob: FDT blob to write to + * @return 0 if ok, or -ve FDT_ERR_... on failure + */ +int arch_fixup_fdt(void *blob); + +void ft_cpu_setup(void *blob, bd_t *bd); + +void ft_pci_setup(void *blob, bd_t *bd); + u32 fdt_getprop_u32_default_node(const void *fdt, int off, int cell, const char *prop, const u32 dflt); u32 fdt_getprop_u32_default(const void *fdt, const char *path, diff --git a/include/fdtdec.h b/include/fdtdec.h index 696e0fd024d..c8a143db5f1 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -111,6 +111,9 @@ struct fdt_pci_addr { u32 phys_lo; }; +extern u8 __dtb_dt_begin[]; /* embedded device tree blob */ +extern u8 __dtb_dt_spl_begin[]; /* embedded device tree blob for SPL/TPL */ + /** * Compute the size of a resource. * diff --git a/include/flash.h b/include/flash.h index 807800b524e..2655c72087f 100644 --- a/include/flash.h +++ b/include/flash.h @@ -117,6 +117,13 @@ extern int jedec_flash_match(flash_info_t *info, ulong base); #define CFI_CMDSET_AMD_LEGACY 0xFFF0 #endif +/** + * flash_perror() - Print a flash error + * + * @err: Error number of message to print (ERR_... as below) + */ +void flash_perror(int err); + /*----------------------------------------------------------------------- * return codes from flash_write(): */ diff --git a/include/fs.h b/include/fs.h index 742a535b5f0..37e35c21206 100644 --- a/include/fs.h +++ b/include/fs.h @@ -14,6 +14,28 @@ #define FS_TYPE_UBIFS 4 #define FS_TYPE_BTRFS 5 +/** + * do_fat_fsload - Run the fatload command + * + * @cmdtp: Command information for fatload + * @flag: Command flags (CMD_FLAG_...) + * @argc: Number of arguments + * @argv: List of arguments + * @return result (see enum command_ret_t) + */ +int do_fat_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]); + +/** + * do_ext2load - Run the ext2load command + * + * @cmdtp: Command information for ext2load + * @flag: Command flags (CMD_FLAG_...) + * @argc: Number of arguments + * @argv: List of arguments + * @return result (see enum command_ret_t) + */ +int do_ext2load(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]); + /* * Tell the fs layer which block device an partition to use for future * commands. This also internally identifies the filesystem that is present diff --git a/include/hang.h b/include/hang.h new file mode 100644 index 00000000000..27cda493592 --- /dev/null +++ b/include/hang.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * (C) Copyright 2000-2009 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + */ + +#ifndef __HANG_H +#define __HANG_H + +#ifndef __ASSEMBLY__ +/** + * hang() - Print a message and stop execution + * + * This shows a 'hang' message where possible and then goes into an infinite + * loop. This is called by panic() if CONFIG_PANIC_HANG is enabled. + * + * This function does not return. + */ +void hang(void) __attribute__ ((noreturn)); +#endif + +#endif diff --git a/include/image.h b/include/image.h index 4a280b78e74..9c6b6d6054b 100644 --- a/include/image.h +++ b/include/image.h @@ -112,6 +112,10 @@ struct fdt_region; # define IMAGE_OF_SYSTEM_SETUP 0 #endif +extern ulong image_load_addr; /* Default Load Address */ +extern ulong image_save_addr; /* Default Save Address */ +extern ulong image_save_size; /* Default Save Size */ + enum ih_category { IH_ARCH, IH_COMP, @@ -670,6 +674,18 @@ int fit_image_load(bootm_headers_t *images, ulong addr, int arch, int image_type, int bootstage_id, enum fit_load_op load_op, ulong *datap, ulong *lenp); +/** + * image_source_script() - Execute a script + * + * Executes a U-Boot script at a particular address in memory. The script should + * have a header (FIT or legacy) with the script type (IH_TYPE_SCRIPT). + * + * @addr: Address of script + * @fit_uname: FIT subimage name + * @return result code (enum command_ret_t) + */ +int image_source_script(ulong addr, const char *fit_uname); + #ifndef USE_HOSTCC /** * fit_get_node_from_config() - Look up an image a FIT by type @@ -930,6 +946,10 @@ int booti_setup(ulong image, ulong *relocated_addr, ulong *size, #define FIT_IGNORE_PROP "uboot-ignore" #define FIT_SIG_NODENAME "signature" +/* cipher node */ +#define FIT_CIPHER_NODENAME "cipher" +#define FIT_ALGO_PROP "algo" + /* image node */ #define FIT_DATA_PROP "data" #define FIT_DATA_POSITION_PROP "data-position" @@ -1019,6 +1039,8 @@ int fit_image_get_data_offset(const void *fit, int noffset, int *data_offset); int fit_image_get_data_position(const void *fit, int noffset, int *data_position); int fit_image_get_data_size(const void *fit, int noffset, int *data_size); +int fit_image_get_data_size_unciphered(const void *fit, int noffset, + size_t *data_size); int fit_image_get_data_and_size(const void *fit, int noffset, const void **data, size_t *size); @@ -1028,6 +1050,10 @@ int fit_image_hash_get_value(const void *fit, int noffset, uint8_t **value, int fit_set_timestamp(void *fit, int noffset, time_t timestamp); +int fit_cipher_data(const char *keydir, void *keydest, void *fit, + const char *comment, int require_keys, + const char *engine_id, const char *cmdname); + /** * fit_add_verification_data() - add verification data to FIT image nodes * @@ -1058,6 +1084,7 @@ int fit_image_verify_with_data(const void *fit, int image_noffset, int fit_image_verify(const void *fit, int noffset); int fit_config_verify(const void *fit, int conf_noffset); int fit_all_image_verify(const void *fit); +int fit_config_decrypt(const void *fit, int conf_noffset); int fit_image_check_os(const void *fit, int noffset, uint8_t os); int fit_image_check_arch(const void *fit, int noffset, uint8_t arch); int fit_image_check_type(const void *fit, int noffset, uint8_t type); @@ -1138,6 +1165,7 @@ struct image_sign_info { const char *require_keys; /* Value for 'required' property */ const char *engine_id; /* Engine to use for signing */ }; + #endif /* Allow struct image_region to always be defined for rsa.h */ /* A part of an image, used for hashing */ @@ -1284,6 +1312,11 @@ int fit_image_verify_required_sigs(const void *fit, int image_noffset, int fit_image_check_sig(const void *fit, int noffset, const void *data, size_t size, int required_keynode, char **err_msgp); +int fit_image_decrypt_data(const void *fit, + int image_noffset, int cipher_noffset, + const void *data, size_t size, + void **data_unciphered, size_t *size_unciphered); + /** * fit_region_make_list() - Make a list of regions to hash * @@ -1310,6 +1343,64 @@ static inline int fit_image_check_target_arch(const void *fdt, int node) #endif } +/* + * At present we only support ciphering on the host, and unciphering on the + * device + */ +#if defined(USE_HOSTCC) +# if defined(CONFIG_FIT_CIPHER) +# define IMAGE_ENABLE_ENCRYPT 1 +# define IMAGE_ENABLE_DECRYPT 1 +# include <openssl/evp.h> +# else +# define IMAGE_ENABLE_ENCRYPT 0 +# define IMAGE_ENABLE_DECRYPT 0 +# endif +#else +# define IMAGE_ENABLE_ENCRYPT 0 +# define IMAGE_ENABLE_DECRYPT CONFIG_IS_ENABLED(FIT_CIPHER) +#endif + +/* Information passed to the ciphering routines */ +struct image_cipher_info { + const char *keydir; /* Directory containing keys */ + const char *keyname; /* Name of key to use */ + const char *ivname; /* Name of IV to use */ + const void *fit; /* Pointer to FIT blob */ + int node_noffset; /* Offset of the cipher node */ + const char *name; /* Algorithm name */ + struct cipher_algo *cipher; /* Cipher algorithm information */ + const void *fdt_blob; /* FDT containing key and IV */ + const void *key; /* Value of the key */ + const void *iv; /* Value of the IV */ + size_t size_unciphered; /* Size of the unciphered data */ +}; + +struct cipher_algo { + const char *name; /* Name of algorithm */ + int key_len; /* Length of the key */ + int iv_len; /* Length of the IV */ + +#if IMAGE_ENABLE_ENCRYPT + const EVP_CIPHER * (*calculate_type)(void); +#endif + + int (*encrypt)(struct image_cipher_info *info, + const unsigned char *data, int data_len, + unsigned char **cipher, int *cipher_len); + + int (*add_cipher_data)(struct image_cipher_info *info, + void *keydest); + + int (*decrypt)(struct image_cipher_info *info, + const void *cipher, size_t cipher_len, + void **data, size_t *data_len); +}; + +int fit_image_cipher_get_algo(const void *fit, int noffset, char **algo); + +struct cipher_algo *image_get_cipher_algo(const char *full_name); + #ifdef CONFIG_FIT_VERBOSE #define fit_unsupported(msg) printf("! %s:%d " \ "FIT images not supported for '%s'\n", \ diff --git a/include/init.h b/include/init.h index 970a39a6a08..2a33a3fd1e4 100644 --- a/include/init.h +++ b/include/init.h @@ -12,8 +12,17 @@ #include <linux/types.h> +struct global_data; + #ifndef __ASSEMBLY__ /* put C only stuff in this section */ +/* Avoid using CONFIG_EFI_STUB directly as we may boot from other loaders */ +#ifdef CONFIG_EFI_STUB +#define ll_boot_init() false +#else +#define ll_boot_init() true +#endif + /* * Function Prototypes */ @@ -97,6 +106,11 @@ int dram_init(void); */ int dram_init_banksize(void); +long get_ram_size(long *base, long size); +phys_size_t get_effective_memsize(void); + +int testdram(void); + /** * arch_reserve_stacks() - Reserve all necessary stacks * @@ -221,6 +235,21 @@ void pci_init_board(void); void trap_init(unsigned long reloc_addr); +/** + * main_loop() - Enter the main loop of U-Boot + * + * This normally runs the command line. + */ +void main_loop(void); + +#if defined(CONFIG_ARM) +void relocate_code(ulong addr_moni); +#else +void relocate_code(ulong start_addr_sp, struct global_data *new_gd, + ulong relocaddr) + __attribute__ ((noreturn)); +#endif + #endif /* __ASSEMBLY__ */ /* Put only stuff here that the assembler can digest */ diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 564819a1c0a..b88c2100659 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -69,6 +69,8 @@ #define DIV_ROUND_UP_ULL(ll, d) DIV_ROUND_DOWN_ULL((ll) + (d) - 1, (d)) +#define ROUND(a, b) (((a) + (b) - 1) & ~((b) - 1)) + #if BITS_PER_LONG == 32 # define DIV_ROUND_UP_SECTOR_T(ll,d) DIV_ROUND_UP_ULL(ll, d) #else @@ -268,4 +270,15 @@ const typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );}) +/* + * check_member() - Check the offset of a structure member + * + * @structure: Name of structure (e.g. global_data) + * @member: Name of member (e.g. baudrate) + * @offset: Expected offset in bytes + */ +#define check_member(structure, member, offset) _Static_assert( \ + offsetof(struct structure, member) == (offset), \ + "`struct " #structure "` offset for `" #member "` is not " #offset) + #endif diff --git a/include/linux/types.h b/include/linux/types.h index bd912bcb42f..baa2c491ea5 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -163,4 +163,8 @@ struct ustat { #define DECLARE_BITMAP(name, bits) \ unsigned long name[BITS_TO_LONGS(bits)] +typedef volatile unsigned long vu_long; +typedef volatile unsigned short vu_short; +typedef volatile unsigned char vu_char; + #endif /* _LINUX_TYPES_H */ diff --git a/include/net.h b/include/net.h index 834f2449826..8a02c923a40 100644 --- a/include/net.h +++ b/include/net.h @@ -51,6 +51,17 @@ struct in_addr { }; /** + * do_tftpb - Run the tftpboot command + * + * @cmdtp: Command information for tftpboot + * @flag: Command flags (CMD_FLAG_...) + * @argc: Number of arguments + * @argv: List of arguments + * @return result (see enum command_ret_t) + */ +int do_tftpb(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]); + +/** * An incoming packet handler. * @param pkt pointer to the application packet * @param dport destination UDP port @@ -906,4 +917,12 @@ static inline struct in_addr env_get_ip(char *var) { return string_to_ip(env_get(var)); } + +/** + * reset_phy() - Reset the Ethernet PHY + * + * This should be implemented by boards if CONFIG_RESET_PHY_R is enabled + */ +void reset_phy(void); + #endif /* __NET_H__ */ diff --git a/include/ns87308.h b/include/ns87308.h deleted file mode 100644 index d5ccd3ba3be..00000000000 --- a/include/ns87308.h +++ /dev/null @@ -1,233 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * (C) Copyright 2000 - * Rob Taylor, Flying Pig Systems. robt@flyingpig.com. - */ - -#ifndef _NS87308_H_ -#define _NS87308_H_ - -#include <asm/pci_io.h> - -/* Note: I couldn't find a full data sheet for the ns87308, but the ns87307 seems to be pretty - functionally- (and pin-) equivalent to the 87308, but the 308 has better ir support. */ - -void initialise_ns87308(void); - -/* - * The following struct represents the GPIO registers on the NS87308/NS97307 - */ -struct GPIO -{ - unsigned char dta1; /* 0 data port 1 */ - unsigned char dir1; /* 1 direction port 1 */ - unsigned char out1; /* 2 output type port 1 */ - unsigned char puc1; /* 3 pull-up control port 1 */ - unsigned char dta2; /* 4 data port 2 */ - unsigned char dir2; /* 5 direction port 2 */ - unsigned char out2; /* 6 output type port 2 */ - unsigned char puc2; /* 7 pull-up control port 2 */ -}; - -/* - * The following represents the power management registers on the NS87308/NS97307 - */ -#define PWM_FER1 0 /* 0 function enable reg. 1 */ -#define PWM_FER2 1 /* 1 function enable reg. 2 */ -#define PWM_PMC1 2 /* 2 power mgmt. control 1 */ -#define PWM_PMC2 3 /* 3 power mgmt. control 2 */ -#define PWM_PMC3 4 /* 4 power mgmt. control 3 */ -#define PWM_WDTO 5 /* 5 watchdog time-out */ -#define PWM_WDCF 6 /* 6 watchdog config. */ -#define PWM_WDST 7 /* 7 watchdog status */ - -/*PNP config registers: - * these depend on the stated of BADDR1 and BADDR0 on startup - * so there's three versions here with the last two digits indicating - * for which configuration their valid - * the 1st of the two digits indicates the state of BADDR1 - * the 2st of the two digits indicates the state of BADDR0 - */ - - -#define IO_INDEX_OFFSET_0x 0x0279 /* full PnP isa Mode */ -#define IO_INDEX_OFFSET_10 0x015C /* PnP motherboard mode */ -#define IO_INDEX_OFFSET_11 0x002E /* PnP motherboard mode */ -#define IO_DATA_OFFSET_0x 0x0A79 /* full PnP isa Mode */ -#define IO_DATA_OFFSET_10 0x015D /* PnP motherboard mode */ -#define IO_DATA_OFFSET_11 0x002F /* PnP motherboard mode */ - -#if defined(CONFIG_SYS_NS87308_BADDR_0x) -#define IO_INDEX (CONFIG_SYS_ISA_IO + IO_INDEX_OFFSET_0x) -#define IO_DATA (CONFIG_SYS_ISA_IO + IO_DATA_OFFSET_0x) -#elif defined(CONFIG_SYS_NS87308_BADDR_10) -#define IO_INDEX (CONFIG_SYS_ISA_IO + IO_INDEX_OFFSET_10) -#define IO_DATA (CONFIG_SYS_ISA_IO + IO_DATA_OFFSET_10) -#elif defined(CONFIG_SYS_NS87308_BADDR_11) -#define IO_INDEX (CONFIG_SYS_ISA_IO + IO_INDEX_OFFSET_11) -#define IO_DATA (CONFIG_SYS_ISA_IO + IO_DATA_OFFSET_11) -#endif - -/* PnP register definitions */ - -#define SET_RD_DATA_PORT 0x00 -#define SERIAL_ISOLATION 0x01 -#define CONFIG_CONTROL 0x02 -#define WAKE_CSN 0x03 -#define RES_DATA 0x04 -#define STATUS 0x05 -#define SET_CSN 0x06 -#define LOGICAL_DEVICE 0x07 - -/*vendor defined values */ -#define SID_REG 0x20 -#define SUPOERIO_CONF1 0x21 -#define SUPOERIO_CONF2 0x22 -#define PGCS_INDEX 0x23 -#define PGCS_DATA 0x24 - -/* values above 30 are different for each logical device - but I can't be arsed to enter them all. the ones here - are pretty consistent between all logical devices - feel free to correct the situation if you want.. ;) - */ -#define ACTIVATE 0x30 -#define ACTIVATE_OFF 0x00 -#define ACTIVATE_ON 0x01 - -#define BASE_ADDR_HIGH 0x60 -#define BASE_ADDR_LOW 0x61 -#define LUN_CONFIG_REG 0xF0 -#define DBASE_HIGH 0x60 /* SIO KBC data base address, 15:8 */ -#define DBASE_LOW 0x61 /* SIO KBC data base address, 7:0 */ -#define CBASE_HIGH 0x62 /* SIO KBC command base addr, 15:8 */ -#define CBASE_LOW 0x63 /* SIO KBC command base addr, 7:0 */ - -/* the logical devices*/ -#define LDEV_KBC1 0x00 /* 2 devices for keyboard and mouse controller*/ -#define LDEV_KBC2 0x01 -#define LDEV_MOUSE 0x01 -#define LDEV_RTC_APC 0x02 /*Real Time Clock and Advanced Power Control*/ -#define LDEV_FDC 0x03 /*floppy disk controller*/ -#define LDEV_PARP 0x04 /*Parallel port*/ -#define LDEV_UART2 0x05 -#define LDEV_UART1 0x06 -#define LDEV_GPIO 0x07 /*General Purpose IO and chip select output signals*/ -#define LDEV_POWRMAN 0x08 /*Power Managment*/ - -#define CONFIG_SYS_NS87308_KBC1 (1 << LDEV_KBC1) -#define CONFIG_SYS_NS87308_KBC2 (1 << LDEV_KBC2) -#define CONFIG_SYS_NS87308_MOUSE (1 << LDEV_MOUSE) -#define CONFIG_SYS_NS87308_RTC_APC (1 << LDEV_RTC_APC) -#define CONFIG_SYS_NS87308_FDC (1 << LDEV_FDC) -#define CONFIG_SYS_NS87308_PARP (1 << LDEV_PARP) -#define CONFIG_SYS_NS87308_UART2 (1 << LDEV_UART2) -#define CONFIG_SYS_NS87308_UART1 (1 << LDEV_UART1) -#define CONFIG_SYS_NS87308_GPIO (1 << LDEV_GPIO) -#define CONFIG_SYS_NS87308_POWRMAN (1 << LDEV_POWRMAN) - -/*some functions and macro's for doing configuration */ - -static inline void read_pnp_config(unsigned char index, unsigned char *data) -{ - pci_writeb(index,IO_INDEX); - pci_readb(IO_DATA, *data); -} - -static inline void write_pnp_config(unsigned char index, unsigned char data) -{ - pci_writeb(index,IO_INDEX); - pci_writeb(data, IO_DATA); -} - -static inline void pnp_set_device(unsigned char dev) -{ - write_pnp_config(LOGICAL_DEVICE, dev); -} - -static inline void write_pm_reg(unsigned short base, unsigned char index, unsigned char data) -{ - pci_writeb(index, CONFIG_SYS_ISA_IO + base); - eieio(); - pci_writeb(data, CONFIG_SYS_ISA_IO + base + 1); -} - -/*void write_pnp_config(unsigned char index, unsigned char data); -void pnp_set_device(unsigned char dev); -*/ - -#define PNP_SET_DEVICE_BASE(dev,base) \ - pnp_set_device(dev); \ - write_pnp_config(ACTIVATE, ACTIVATE_OFF); \ - write_pnp_config(BASE_ADDR_HIGH, ((base) >> 8) & 0xff ); \ - write_pnp_config(BASE_ADDR_LOW, (base) &0xff); \ - write_pnp_config(ACTIVATE, ACTIVATE_ON); - -#define PNP_ACTIVATE_DEVICE(dev) \ - pnp_set_device(dev); \ - write_pnp_config(ACTIVATE, ACTIVATE_ON); - -#define PNP_DEACTIVATE_DEVICE(dev) \ - pnp_set_device(dev); \ - write_pnp_config(ACTIVATE, ACTIVATE_OFF); - - -static inline void write_pgcs_config(unsigned char index, unsigned char data) -{ - write_pnp_config(PGCS_INDEX, index); - write_pnp_config(PGCS_DATA, data); -} - -/* these macrose configure the 3 CS lines - on the sandpoint board these controll NVRAM - CS0 is connected to NVRAMCS - CS1 is connected to NVRAMAS0 - CS2 is connected to NVRAMAS1 - */ -#define PGCS_CS_ASSERT_ON_WRITE 0x10 -#define PGCS_CS_ASSERT_ON_READ 0x20 - -#define PNP_PGCS_CSLINE_BASE(cs, base) \ - write_pgcs_config((cs) << 2, ((base) >> 8) & 0xff ); \ - write_pgcs_config(((cs) << 2) + 1, (base) & 0xff ); - -#define PNP_PGCS_CSLINE_CONF(cs, conf) \ - write_pgcs_config(((cs) << 2) + 2, (conf) ); - - -/* The following sections are for 87308 extensions to the standard compoents it emulates */ - -/* extensions to 16550*/ - -#define MCR_MDSL_MSK 0xe0 /*mode select mask*/ -#define MCR_MDSL_UART 0x00 /*uart, default*/ -#define MCR_MDSL_SHRPIR 0x02 /*Sharp IR*/ -#define MCR_MDSL_SIR 0x03 /*SIR*/ -#define MCR_MDSL_CIR 0x06 /*Consumer IR*/ - -#define FCR_TXFTH0 0x10 /* these bits control threshod of data level in fifo */ -#define FCR_TXFTH1 0x20 /* for interrupt trigger */ - -/* - * Default NS87308 configuration - */ -#ifndef CONFIG_SYS_NS87308_KBC1_BASE -#define CONFIG_SYS_NS87308_KBC1_BASE 0x0060 -#endif -#ifndef CONFIG_SYS_NS87308_RTC_BASE -#define CONFIG_SYS_NS87308_RTC_BASE 0x0070 -#endif -#ifndef CONFIG_SYS_NS87308_FDC_BASE -#define CONFIG_SYS_NS87308_FDC_BASE 0x03F0 -#endif -#ifndef CONFIG_SYS_NS87308_LPT_BASE -#define CONFIG_SYS_NS87308_LPT_BASE 0x0278 -#endif -#ifndef CONFIG_SYS_NS87308_UART1_BASE -#define CONFIG_SYS_NS87308_UART1_BASE 0x03F8 -#endif -#ifndef CONFIG_SYS_NS87308_UART2_BASE -#define CONFIG_SYS_NS87308_UART2_BASE 0x02F8 -#endif - -#endif /*_NS87308_H_*/ diff --git a/include/time.h b/include/time.h index 71446c31714..e99f9c80127 100644 --- a/include/time.h +++ b/include/time.h @@ -6,6 +6,8 @@ #include <linux/typecheck.h> #include <linux/types.h> +ulong get_tbclk(void); + unsigned long get_timer(unsigned long base); /* diff --git a/include/u-boot/aes.h b/include/u-boot/aes.h new file mode 100644 index 00000000000..32281041de2 --- /dev/null +++ b/include/u-boot/aes.h @@ -0,0 +1,44 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (c) 2019, Softathome + */ + +#ifndef _AES_H +#define _AES_H + +#include <errno.h> +#include <image.h> + +#if IMAGE_ENABLE_ENCRYPT +int image_aes_encrypt(struct image_cipher_info *info, + const unsigned char *data, int size, + unsigned char **cipher, int *cipher_len); +int image_aes_add_cipher_data(struct image_cipher_info *info, void *keydest); +#else +int image_aes_encrypt(struct image_cipher_info *info, + const unsigned char *data, int size, + unsigned char **cipher, int *cipher_len) +{ + return -ENXIO; +} + +int image_aes_add_cipher_data(struct image_cipher_info *info, void *keydest) +{ + return -ENXIO; +} +#endif /* IMAGE_ENABLE_ENCRYPT */ + +#if IMAGE_ENABLE_DECRYPT +int image_aes_decrypt(struct image_cipher_info *info, + const void *cipher, size_t cipher_len, + void **data, size_t *size); +#else +int image_aes_decrypt(struct image_cipher_info *info, + const void *cipher, size_t cipher_len, + void **data, size_t *size) +{ + return -ENXIO; +} +#endif /* IMAGE_ENABLE_DECRYPT */ + +#endif diff --git a/include/uboot_aes.h b/include/uboot_aes.h index 2fda384e3b7..d2583bed992 100644 --- a/include/uboot_aes.h +++ b/include/uboot_aes.h @@ -18,16 +18,24 @@ typedef unsigned int u32; * AES encryption library, with small code size, supporting only 128-bit AES * * AES is a stream cipher which works a block at a time, with each block - * in this case being AES_KEY_LENGTH bytes. + * in this case being AES_BLOCK_LENGTH bytes. */ enum { AES_STATECOLS = 4, /* columns in the state & expanded key */ - AES_KEYCOLS = 4, /* columns in a key */ - AES_ROUNDS = 10, /* rounds in encryption */ - - AES_KEY_LENGTH = 128 / 8, - AES_EXPAND_KEY_LENGTH = 4 * AES_STATECOLS * (AES_ROUNDS + 1), + AES128_KEYCOLS = 4, /* columns in a key for aes128 */ + AES192_KEYCOLS = 6, /* columns in a key for aes128 */ + AES256_KEYCOLS = 8, /* columns in a key for aes128 */ + AES128_ROUNDS = 10, /* rounds in encryption for aes128 */ + AES192_ROUNDS = 12, /* rounds in encryption for aes192 */ + AES256_ROUNDS = 14, /* rounds in encryption for aes256 */ + AES128_KEY_LENGTH = 128 / 8, + AES192_KEY_LENGTH = 192 / 8, + AES256_KEY_LENGTH = 256 / 8, + AES128_EXPAND_KEY_LENGTH = 4 * AES_STATECOLS * (AES128_ROUNDS + 1), + AES192_EXPAND_KEY_LENGTH = 4 * AES_STATECOLS * (AES192_ROUNDS + 1), + AES256_EXPAND_KEY_LENGTH = 4 * AES_STATECOLS * (AES256_ROUNDS + 1), + AES_BLOCK_LENGTH = 128 / 8, }; /** @@ -36,33 +44,36 @@ enum { * Expand a key into a key schedule, which is then used for the other * operations. * - * @key Key, of length AES_KEY_LENGTH bytes + * @key Key + * @key_size Size of the key (in bits) * @expkey Buffer to place expanded key, AES_EXPAND_KEY_LENGTH */ -void aes_expand_key(u8 *key, u8 *expkey); +void aes_expand_key(u8 *key, u32 key_size, u8 *expkey); /** * aes_encrypt() - Encrypt single block of data with AES 128 * + * @key_size Size of the aes key (in bits) * @in Input data * @expkey Expanded key to use for encryption (from aes_expand_key()) * @out Output data */ -void aes_encrypt(u8 *in, u8 *expkey, u8 *out); +void aes_encrypt(u32 key_size, u8 *in, u8 *expkey, u8 *out); /** * aes_decrypt() - Decrypt single block of data with AES 128 * + * @key_size Size of the aes key (in bits) * @in Input data * @expkey Expanded key to use for decryption (from aes_expand_key()) * @out Output data */ -void aes_decrypt(u8 *in, u8 *expkey, u8 *out); +void aes_decrypt(u32 key_size, u8 *in, u8 *expkey, u8 *out); /** * Apply chain data to the destination using EOR * - * Each array is of length AES_KEY_LENGTH. + * Each array is of length AES_BLOCK_LENGTH. * * @cbc_chain_data Chain data * @src Source data @@ -73,25 +84,27 @@ void aes_apply_cbc_chain_data(u8 *cbc_chain_data, u8 *src, u8 *dst); /** * aes_cbc_encrypt_blocks() - Encrypt multiple blocks of data with AES CBC. * + * @key_size Size of the aes key (in bits) * @key_exp Expanded key to use * @iv Initialization vector * @src Source data to encrypt * @dst Destination buffer * @num_aes_blocks Number of AES blocks to encrypt */ -void aes_cbc_encrypt_blocks(u8 *key_exp, u8 *iv, u8 *src, u8 *dst, +void aes_cbc_encrypt_blocks(u32 key_size, u8 *key_exp, u8 *iv, u8 *src, u8 *dst, u32 num_aes_blocks); /** * Decrypt multiple blocks of data with AES CBC. * + * @key_size Size of the aes key (in bits) * @key_exp Expanded key to use * @iv Initialization vector * @src Source data to decrypt * @dst Destination buffer * @num_aes_blocks Number of AES blocks to decrypt */ -void aes_cbc_decrypt_blocks(u8 *key_exp, u8 *iv, u8 *src, u8 *dst, +void aes_cbc_decrypt_blocks(u32 key_size, u8 *key_exp, u8 *iv, u8 *src, u8 *dst, u32 num_aes_blocks); #endif /* _AES_REF_H_ */ diff --git a/lib/Makefile b/lib/Makefile index 6b7b9ce85c5..51eba80b896 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -21,6 +21,7 @@ obj-$(CONFIG_ASN1_DECODER) += asn1_decoder.o obj-y += crypto/ obj-$(CONFIG_AES) += aes.o +obj-$(CONFIG_AES) += aes/ obj-$(CONFIG_$(SPL_TPL_)BINMAN_FDT) += binman.o ifndef API_BUILD diff --git a/lib/aes.c b/lib/aes.c index a12a1920843..ce53c9f1f37 100644 --- a/lib/aes.c +++ b/lib/aes.c @@ -508,50 +508,79 @@ static u8 rcon[11] = { 0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36 }; +static u32 aes_get_rounds(u32 key_len) +{ + u32 rounds = AES128_ROUNDS; + + if (key_len == AES192_KEY_LENGTH) + rounds = AES192_ROUNDS; + else if (key_len == AES256_KEY_LENGTH) + rounds = AES256_ROUNDS; + + return rounds; +} + +static u32 aes_get_keycols(u32 key_len) +{ + u32 keycols = AES128_KEYCOLS; + + if (key_len == AES192_KEY_LENGTH) + keycols = AES192_KEYCOLS; + else if (key_len == AES256_KEY_LENGTH) + keycols = AES256_KEYCOLS; + + return keycols; +} + /* produce AES_STATECOLS bytes for each round */ -void aes_expand_key(u8 *key, u8 *expkey) +void aes_expand_key(u8 *key, u32 key_len, u8 *expkey) { u8 tmp0, tmp1, tmp2, tmp3, tmp4; - u32 idx; + u32 idx, aes_rounds, aes_keycols; - memcpy(expkey, key, AES_KEYCOLS * 4); + aes_rounds = aes_get_rounds(key_len); + aes_keycols = aes_get_keycols(key_len); - for (idx = AES_KEYCOLS; idx < AES_STATECOLS * (AES_ROUNDS + 1); idx++) { + memcpy(expkey, key, key_len); + + for (idx = aes_keycols; idx < AES_STATECOLS * (aes_rounds + 1); idx++) { tmp0 = expkey[4*idx - 4]; tmp1 = expkey[4*idx - 3]; tmp2 = expkey[4*idx - 2]; tmp3 = expkey[4*idx - 1]; - if (!(idx % AES_KEYCOLS)) { + if (!(idx % aes_keycols)) { tmp4 = tmp3; tmp3 = sbox[tmp0]; - tmp0 = sbox[tmp1] ^ rcon[idx / AES_KEYCOLS]; + tmp0 = sbox[tmp1] ^ rcon[idx / aes_keycols]; tmp1 = sbox[tmp2]; tmp2 = sbox[tmp4]; - } else if ((AES_KEYCOLS > 6) && (idx % AES_KEYCOLS == 4)) { + } else if ((aes_keycols > 6) && (idx % aes_keycols == 4)) { tmp0 = sbox[tmp0]; tmp1 = sbox[tmp1]; tmp2 = sbox[tmp2]; tmp3 = sbox[tmp3]; } - expkey[4*idx+0] = expkey[4*idx - 4*AES_KEYCOLS + 0] ^ tmp0; - expkey[4*idx+1] = expkey[4*idx - 4*AES_KEYCOLS + 1] ^ tmp1; - expkey[4*idx+2] = expkey[4*idx - 4*AES_KEYCOLS + 2] ^ tmp2; - expkey[4*idx+3] = expkey[4*idx - 4*AES_KEYCOLS + 3] ^ tmp3; + expkey[4*idx+0] = expkey[4*idx - 4*aes_keycols + 0] ^ tmp0; + expkey[4*idx+1] = expkey[4*idx - 4*aes_keycols + 1] ^ tmp1; + expkey[4*idx+2] = expkey[4*idx - 4*aes_keycols + 2] ^ tmp2; + expkey[4*idx+3] = expkey[4*idx - 4*aes_keycols + 3] ^ tmp3; } } /* encrypt one 128 bit block */ -void aes_encrypt(u8 *in, u8 *expkey, u8 *out) +void aes_encrypt(u32 key_len, u8 *in, u8 *expkey, u8 *out) { u8 state[AES_STATECOLS * 4]; - u32 round; + u32 round, aes_rounds; + + aes_rounds = aes_get_rounds(key_len); memcpy(state, in, AES_STATECOLS * 4); add_round_key((u32 *)state, (u32 *)expkey); - for (round = 1; round < AES_ROUNDS + 1; round++) { - if (round < AES_ROUNDS) + for (round = 1; round < aes_rounds + 1; round++) { + if (round < aes_rounds) mix_sub_columns(state); else shift_rows(state); @@ -563,18 +592,20 @@ void aes_encrypt(u8 *in, u8 *expkey, u8 *out) memcpy(out, state, sizeof(state)); } -void aes_decrypt(u8 *in, u8 *expkey, u8 *out) +void aes_decrypt(u32 key_len, u8 *in, u8 *expkey, u8 *out) { u8 state[AES_STATECOLS * 4]; - int round; + int round, aes_rounds; + + aes_rounds = aes_get_rounds(key_len); memcpy(state, in, sizeof(state)); add_round_key((u32 *)state, - (u32 *)expkey + AES_ROUNDS * AES_STATECOLS); + (u32 *)expkey + aes_rounds * AES_STATECOLS); inv_shift_rows(state); - for (round = AES_ROUNDS; round--; ) { + for (round = aes_rounds; round--; ) { add_round_key((u32 *)state, (u32 *)expkey + round * AES_STATECOLS); if (round) @@ -596,62 +627,62 @@ void aes_apply_cbc_chain_data(u8 *cbc_chain_data, u8 *src, u8 *dst) { int i; - for (i = 0; i < AES_KEY_LENGTH; i++) + for (i = 0; i < AES_BLOCK_LENGTH; i++) *dst++ = *src++ ^ *cbc_chain_data++; } -void aes_cbc_encrypt_blocks(u8 *key_exp, u8 *iv, u8 *src, u8 *dst, +void aes_cbc_encrypt_blocks(u32 key_len, u8 *key_exp, u8 *iv, u8 *src, u8 *dst, u32 num_aes_blocks) { - u8 tmp_data[AES_KEY_LENGTH]; + u8 tmp_data[AES_BLOCK_LENGTH]; u8 *cbc_chain_data = iv; u32 i; for (i = 0; i < num_aes_blocks; i++) { debug("encrypt_object: block %d of %d\n", i, num_aes_blocks); - debug_print_vector("AES Src", AES_KEY_LENGTH, src); + debug_print_vector("AES Src", AES_BLOCK_LENGTH, src); /* Apply the chain data */ aes_apply_cbc_chain_data(cbc_chain_data, src, tmp_data); - debug_print_vector("AES Xor", AES_KEY_LENGTH, tmp_data); + debug_print_vector("AES Xor", AES_BLOCK_LENGTH, tmp_data); /* Encrypt the AES block */ - aes_encrypt(tmp_data, key_exp, dst); - debug_print_vector("AES Dst", AES_KEY_LENGTH, dst); + aes_encrypt(key_len, tmp_data, key_exp, dst); + debug_print_vector("AES Dst", AES_BLOCK_LENGTH, dst); /* Update pointers for next loop. */ cbc_chain_data = dst; - src += AES_KEY_LENGTH; - dst += AES_KEY_LENGTH; + src += AES_BLOCK_LENGTH; + dst += AES_BLOCK_LENGTH; } } -void aes_cbc_decrypt_blocks(u8 *key_exp, u8 *iv, u8 *src, u8 *dst, +void aes_cbc_decrypt_blocks(u32 key_len, u8 *key_exp, u8 *iv, u8 *src, u8 *dst, u32 num_aes_blocks) { - u8 tmp_data[AES_KEY_LENGTH], tmp_block[AES_KEY_LENGTH]; + u8 tmp_data[AES_BLOCK_LENGTH], tmp_block[AES_BLOCK_LENGTH]; /* Convenient array of 0's for IV */ - u8 cbc_chain_data[AES_KEY_LENGTH]; + u8 cbc_chain_data[AES_BLOCK_LENGTH]; u32 i; - memcpy(cbc_chain_data, iv, AES_KEY_LENGTH); + memcpy(cbc_chain_data, iv, AES_BLOCK_LENGTH); for (i = 0; i < num_aes_blocks; i++) { debug("encrypt_object: block %d of %d\n", i, num_aes_blocks); - debug_print_vector("AES Src", AES_KEY_LENGTH, src); + debug_print_vector("AES Src", AES_BLOCK_LENGTH, src); - memcpy(tmp_block, src, AES_KEY_LENGTH); + memcpy(tmp_block, src, AES_BLOCK_LENGTH); /* Decrypt the AES block */ - aes_decrypt(src, key_exp, tmp_data); - debug_print_vector("AES Xor", AES_KEY_LENGTH, tmp_data); + aes_decrypt(key_len, src, key_exp, tmp_data); + debug_print_vector("AES Xor", AES_BLOCK_LENGTH, tmp_data); /* Apply the chain data */ aes_apply_cbc_chain_data(cbc_chain_data, tmp_data, dst); - debug_print_vector("AES Dst", AES_KEY_LENGTH, dst); + debug_print_vector("AES Dst", AES_BLOCK_LENGTH, dst); /* Update pointers for next loop. */ - memcpy(cbc_chain_data, tmp_block, AES_KEY_LENGTH); - src += AES_KEY_LENGTH; - dst += AES_KEY_LENGTH; + memcpy(cbc_chain_data, tmp_block, AES_BLOCK_LENGTH); + src += AES_BLOCK_LENGTH; + dst += AES_BLOCK_LENGTH; } } diff --git a/lib/aes/Makefile b/lib/aes/Makefile new file mode 100644 index 00000000000..daed52a713b --- /dev/null +++ b/lib/aes/Makefile @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (c) 2019, Softathome + +obj-$(CONFIG_$(SPL_)FIT_CIPHER) += aes-decrypt.o diff --git a/lib/aes/aes-decrypt.c b/lib/aes/aes-decrypt.c new file mode 100644 index 00000000000..345029fa784 --- /dev/null +++ b/lib/aes/aes-decrypt.c @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) 2019, softathome + */ + +#ifndef USE_HOSTCC +#include <common.h> +#include <malloc.h> +#endif +#include <image.h> +#include <uboot_aes.h> + +int image_aes_decrypt(struct image_cipher_info *info, + const void *cipher, size_t cipher_len, + void **data, size_t *size) +{ +#ifndef USE_HOSTCC + unsigned char key_exp[AES256_EXPAND_KEY_LENGTH]; + unsigned int aes_blocks, key_len = info->cipher->key_len; + + *data = malloc(cipher_len); + if (!*data) { + printf("Can't allocate memory to decrypt\n"); + return -ENOMEM; + } + *size = info->size_unciphered; + + memcpy(&key_exp[0], info->key, key_len); + + /* First we expand the key. */ + aes_expand_key((u8 *)info->key, key_len, key_exp); + + /* Calculate the number of AES blocks to encrypt. */ + aes_blocks = DIV_ROUND_UP(cipher_len, AES_BLOCK_LENGTH); + + aes_cbc_decrypt_blocks(key_len, key_exp, (u8 *)info->iv, + (u8 *)cipher, *data, aes_blocks); +#endif + + return 0; +} diff --git a/lib/aes/aes-encrypt.c b/lib/aes/aes-encrypt.c new file mode 100644 index 00000000000..de00a836f6b --- /dev/null +++ b/lib/aes/aes-encrypt.c @@ -0,0 +1,136 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) 2019,Softathome + */ +#include "mkimage.h" +#include <stdio.h> +#include <string.h> +#include <image.h> +#include <time.h> +#include <openssl/bn.h> +#include <openssl/rsa.h> +#include <openssl/pem.h> +#include <openssl/err.h> +#include <openssl/ssl.h> +#include <openssl/evp.h> +#include <openssl/engine.h> +#include <uboot_aes.h> + +#if OPENSSL_VERSION_NUMBER >= 0x10000000L +#define HAVE_ERR_REMOVE_THREAD_STATE +#endif + +int image_aes_encrypt(struct image_cipher_info *info, + unsigned char *data, int size, + unsigned char **cipher, int *cipher_len) +{ + EVP_CIPHER_CTX *ctx; + unsigned char *buf = NULL; + int buf_len, len, ret = 0; + + /* create and initialise the context */ + ctx = EVP_CIPHER_CTX_new(); + if (!ctx) { + printf("Can't create context\n"); + return -1; + } + + /* allocate a buffer for the result */ + buf = malloc(size + AES_BLOCK_LENGTH); + if (!buf) { + printf("Can't allocate memory to encrypt\n"); + ret = -1; + goto out; + } + + if (EVP_EncryptInit_ex(ctx, info->cipher->calculate_type(), + NULL, info->key, info->iv) != 1) { + printf("Can't init encryption\n"); + ret = -1; + goto out; + } + + if (EVP_EncryptUpdate(ctx, buf, &len, data, size) != 1) { + printf("Can't encrypt data\n"); + ret = -1; + goto out; + } + + buf_len = len; + + if (EVP_EncryptFinal_ex(ctx, buf + len, &len) != 1) { + printf("Can't finalise the encryption\n"); + ret = -1; + goto out; + } + + buf_len += len; + + *cipher = buf; + *cipher_len = buf_len; + + out: + EVP_CIPHER_CTX_free(ctx); + return ret; +} + +int image_aes_add_cipher_data(struct image_cipher_info *info, void *keydest) +{ + int parent, node; + char name[128]; + int ret = 0; + + /* Either create or overwrite the named cipher node */ + parent = fdt_subnode_offset(keydest, 0, FIT_CIPHER_NODENAME); + if (parent == -FDT_ERR_NOTFOUND) { + parent = fdt_add_subnode(keydest, 0, FIT_CIPHER_NODENAME); + if (parent < 0) { + ret = parent; + if (ret != -FDT_ERR_NOSPACE) { + fprintf(stderr, + "Couldn't create cipher node: %s\n", + fdt_strerror(parent)); + } + } + } + if (ret) + goto done; + + /* Either create or overwrite the named key node */ + snprintf(name, sizeof(name), "key-%s-%s-%s", + info->name, info->keyname, info->ivname); + node = fdt_subnode_offset(keydest, parent, name); + if (node == -FDT_ERR_NOTFOUND) { + node = fdt_add_subnode(keydest, parent, name); + if (node < 0) { + ret = node; + if (ret != -FDT_ERR_NOSPACE) { + fprintf(stderr, + "Could not create key subnode: %s\n", + fdt_strerror(node)); + } + } + } else if (node < 0) { + fprintf(stderr, "Cannot select keys parent: %s\n", + fdt_strerror(node)); + ret = node; + } + + if (!ret) + ret = fdt_setprop(keydest, node, "iv", + info->iv, info->cipher->iv_len); + + if (!ret) + ret = fdt_setprop(keydest, node, "key", + info->key, info->cipher->key_len); + + if (!ret) + ret = fdt_setprop_u32(keydest, node, "key-len", + info->cipher->key_len); + +done: + if (ret) + ret = ret == -FDT_ERR_NOSPACE ? -ENOSPC : -EIO; + + return ret; +} diff --git a/lib/display_options.c b/lib/display_options.c index ec16d75e0e4..74f769d9ff8 100644 --- a/lib/display_options.c +++ b/lib/display_options.c @@ -137,7 +137,7 @@ int print_buffer(ulong addr, const void *data, uint width, uint count, { /* linebuf as a union causes proper alignment */ union linebuf { -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA uint64_t uq[MAX_LINE_LENGTH_BYTES/sizeof(uint64_t) + 1]; #endif uint32_t ui[MAX_LINE_LENGTH_BYTES/sizeof(uint32_t) + 1]; @@ -145,7 +145,7 @@ int print_buffer(ulong addr, const void *data, uint width, uint count, uint8_t uc[MAX_LINE_LENGTH_BYTES/sizeof(uint8_t) + 1]; } lb; int i; -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA uint64_t __maybe_unused x; #else uint32_t __maybe_unused x; @@ -168,7 +168,7 @@ int print_buffer(ulong addr, const void *data, uint width, uint count, for (i = 0; i < thislinelen; i++) { if (width == 4) x = lb.ui[i] = *(volatile uint32_t *)data; -#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA +#ifdef MEM_SUPPORT_64BIT_DATA else if (width == 8) x = lb.uq[i] = *(volatile uint64_t *)data; #endif @@ -178,7 +178,7 @@ int print_buffer(ulong addr, const void *data, uint width, uint count, x = lb.uc[i] = *(volatile uint8_t *)data; #if defined(CONFIG_SPL_BUILD) printf(" %x", (uint)x); -#elif defined(CONFIG_SYS_SUPPORT_64BIT_DATA) +#elif defined(MEM_SUPPORT_64BIT_DATA) printf(" %0*llx", width * 2, (long long)x); #else printf(" %0*x", width * 2, x); diff --git a/lib/efi/efi_app.c b/lib/efi/efi_app.c index 0047998ee0c..af5a878fc39 100644 --- a/lib/efi/efi_app.c +++ b/lib/efi/efi_app.c @@ -9,6 +9,7 @@ */ #include <common.h> +#include <cpu_func.h> #include <debug_uart.h> #include <dm.h> #include <errno.h> diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 61af3472e6a..17051d409c4 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -7,6 +7,8 @@ #include <common.h> #include <boot_fit.h> #include <dm.h> +#include <hang.h> +#include <init.h> #include <dm/of_extra.h> #include <env.h> #include <errno.h> diff --git a/lib/hang.c b/lib/hang.c index 4d026a3e64c..578ac78d453 100644 --- a/lib/hang.c +++ b/lib/hang.c @@ -9,6 +9,7 @@ #include <common.h> #include <bootstage.h> +#include <hang.h> #include <os.h> /** diff --git a/lib/libavb/avb_sysdeps_posix.c b/lib/libavb/avb_sysdeps_posix.c index 4ccf41e4283..0bb0cc1498e 100644 --- a/lib/libavb/avb_sysdeps_posix.c +++ b/lib/libavb/avb_sysdeps_posix.c @@ -3,6 +3,7 @@ * Copyright (C) 2016 The Android Open Source Project */ +#include <hang.h> #include <stdarg.h> #include <stdlib.h> diff --git a/lib/optee/optee.c b/lib/optee/optee.c index c883c498e1d..9b49eb8ee76 100644 --- a/lib/optee/optee.c +++ b/lib/optee/optee.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <image.h> #include <malloc.h> #include <linux/libfdt.h> #include <tee/optee.h> diff --git a/lib/panic.c b/lib/panic.c index bae8a359354..8e72c265a61 100644 --- a/lib/panic.c +++ b/lib/panic.c @@ -10,6 +10,7 @@ */ #include <common.h> +#include <hang.h> #if !defined(CONFIG_PANIC_HANG) #include <command.h> #endif diff --git a/lib/zlib/zutil.c b/lib/zlib/zutil.c index 227343e48d3..609aac55ce1 100644 --- a/lib/zlib/zutil.c +++ b/lib/zlib/zutil.c @@ -6,6 +6,7 @@ /* @(#) $Id$ */ #include "zutil.h" +#include <hang.h> #ifndef NO_DUMMY_DECL struct internal_state {int dummy;}; /* for buggy compilers */ @@ -34,7 +35,7 @@ void z_error (m) char *m; { fprintf(stderr, "%s\n", m); - hang (); + hang(); } #endif diff --git a/net/net.c b/net/net.c index 5199d679a1f..d8a60b61191 100644 --- a/net/net.c +++ b/net/net.c @@ -93,6 +93,7 @@ #include <env.h> #include <env_internal.h> #include <errno.h> +#include <image.h> #include <net.h> #include <net/fastboot.h> #include <net/tftp.h> @@ -636,7 +637,7 @@ restart: printf("Bytes transferred = %d (%x hex)\n", net_boot_file_size, net_boot_file_size); env_set_hex("filesize", net_boot_file_size); - env_set_hex("fileaddr", load_addr); + env_set_hex("fileaddr", image_load_addr); } if (protocol != NETCONS) eth_halt(); diff --git a/net/nfs.c b/net/nfs.c index 97e62f1dceb..72e1018a3bd 100644 --- a/net/nfs.c +++ b/net/nfs.c @@ -28,6 +28,8 @@ #include <common.h> #include <command.h> +#include <flash.h> +#include <image.h> #include <net.h> #include <malloc.h> #include <mapmem.h> @@ -87,14 +89,15 @@ static inline int store_block(uchar *src, unsigned offset, unsigned len) for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++) { /* start address in flash? */ - if (load_addr + offset >= flash_info[i].start[0]) { + if (image_load_addr + offset >= flash_info[i].start[0]) { rc = 1; break; } } if (rc) { /* Flash is destination for this packet */ - rc = flash_write((uchar *)src, (ulong)(load_addr+offset), len); + rc = flash_write((uchar *)src, (ulong)image_load_addr + offset, + len); if (rc) { flash_perror(rc); return -1; @@ -102,7 +105,7 @@ static inline int store_block(uchar *src, unsigned offset, unsigned len) } else #endif /* CONFIG_SYS_DIRECT_FLASH_NFS */ { - void *ptr = map_sysmem(load_addr + offset, len); + void *ptr = map_sysmem(image_load_addr + offset, len); memcpy(ptr, src, len); unmap_sysmem(ptr); @@ -911,7 +914,7 @@ void nfs_start(void) net_boot_file_expected_size_in_blocks << 9); print_size(net_boot_file_expected_size_in_blocks << 9, ""); } - printf("\nLoad address: 0x%lx\nLoading: *\b", load_addr); + printf("\nLoad address: 0x%lx\nLoading: *\b", image_load_addr); net_set_timeout_handler(nfs_timeout, nfs_timeout_handler); net_set_udp_handler(nfs_handler); diff --git a/net/tftp.c b/net/tftp.c index 1e3c18ae69c..02401898c55 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -10,6 +10,7 @@ #include <command.h> #include <efi_loader.h> #include <env.h> +#include <image.h> #include <mapmem.h> #include <net.h> #include <net/tftp.h> @@ -221,7 +222,7 @@ static int load_block(unsigned block, uchar *dst, unsigned len) ulong tosend = len; tosend = min(net_boot_file_size - offset, tosend); - (void)memcpy(dst, (void *)(save_addr + offset), tosend); + (void)memcpy(dst, (void *)(image_save_addr + offset), tosend); debug("%s: block=%d, offset=%ld, len=%d, tosend=%ld\n", __func__, block, offset, len, tosend); return tosend; @@ -605,7 +606,7 @@ static void tftp_timeout_handler(void) } } -/* Initialize tftp_load_addr and tftp_load_size from load_addr and lmb */ +/* Initialize tftp_load_addr and tftp_load_size from image_load_addr and lmb */ static int tftp_init_load_addr(void) { #ifdef CONFIG_LMB @@ -614,13 +615,13 @@ static int tftp_init_load_addr(void) lmb_init_and_reserve(&lmb, gd->bd, (void *)gd->fdt_blob); - max_size = lmb_get_free_size(&lmb, load_addr); + max_size = lmb_get_free_size(&lmb, image_load_addr); if (!max_size) return -1; tftp_load_size = max_size; #endif - tftp_load_addr = load_addr; + tftp_load_addr = image_load_addr; return 0; } @@ -710,9 +711,9 @@ void tftp_start(enum proto_t protocol) #ifdef CONFIG_CMD_TFTPPUT tftp_put_active = (protocol == TFTPPUT); if (tftp_put_active) { - printf("Save address: 0x%lx\n", save_addr); - printf("Save size: 0x%lx\n", save_size); - net_boot_file_size = save_size; + printf("Save address: 0x%lx\n", image_save_addr); + printf("Save size: 0x%lx\n", image_save_size); + net_boot_file_size = image_save_size; puts("Saving: *\b"); tftp_state = STATE_SEND_WRQ; new_transfer(); diff --git a/post/Makefile b/post/Makefile index 5f72708214b..afd49403c28 100644 --- a/post/Makefile +++ b/post/Makefile @@ -4,7 +4,7 @@ # Wolfgang Denk, DENX Software Engineering, wd@denx.de. obj-y += post.o -obj-$(CONFIG_POST_STD_LIST) += tests.o +obj-y += tests.o obj-y += drivers/ obj-$(CONFIG_PPC) += lib_powerpc/ diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 95c0ccc9d3f..0d6dd06beae 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -1236,7 +1236,6 @@ CONFIG_NO_WAIT CONFIG_NR_DRAM_POPULATED CONFIG_NS16550_MIN_FUNCTIONS CONFIG_NS8382X -CONFIG_NS87308 CONFIG_NUM_DSP_CPUS CONFIG_NUM_PAMU CONFIG_ODROID_REV_AIN @@ -1348,7 +1347,6 @@ CONFIG_PMW_BASE CONFIG_PM_SLEEP CONFIG_POST CONFIG_POSTBOOTMENU -CONFIG_POST_ALT_LIST CONFIG_POST_BSPEC1 CONFIG_POST_BSPEC2 CONFIG_POST_BSPEC3 @@ -1356,7 +1354,6 @@ CONFIG_POST_BSPEC4 CONFIG_POST_BSPEC5 CONFIG_POST_EXTERNAL_WORD_FUNCS CONFIG_POST_SKIP_ENV_FLAGS -CONFIG_POST_STD_LIST CONFIG_POST_UART CONFIG_POST_WATCHDOG CONFIG_POWER @@ -2291,8 +2288,6 @@ CONFIG_SYS_FAST_CLK CONFIG_SYS_FAULT_ECHO_LINK_DOWN CONFIG_SYS_FAULT_MII_ADDR CONFIG_SYS_FCC_PSMR -CONFIG_SYS_FDC_DRIVE_NUMBER -CONFIG_SYS_FDC_HW_INIT CONFIG_SYS_FDT_BASE CONFIG_SYS_FDT_LOAD_ADDR CONFIG_SYS_FDT_PAD @@ -2967,8 +2962,6 @@ CONFIG_SYS_IO_BASE CONFIG_SYS_ISA_BASE CONFIG_SYS_ISA_IO CONFIG_SYS_ISA_IO_BASE_ADDRESS -CONFIG_SYS_ISA_IO_OFFSET -CONFIG_SYS_ISA_IO_STRIDE CONFIG_SYS_ISA_MEM CONFIG_SYS_JFFS2_FIRST_BANK CONFIG_SYS_JFFS2_FIRST_SECTOR @@ -3328,35 +3321,6 @@ CONFIG_SYS_NS16550_MEM32 CONFIG_SYS_NS16550_PORT_MAPPED CONFIG_SYS_NS16550_REG_SIZE CONFIG_SYS_NS16550_SERIAL -CONFIG_SYS_NS87308_CS0_BASE -CONFIG_SYS_NS87308_CS0_CONF -CONFIG_SYS_NS87308_CS1_BASE -CONFIG_SYS_NS87308_CS1_CONF -CONFIG_SYS_NS87308_CS2_BASE -CONFIG_SYS_NS87308_CS2_CONF -CONFIG_SYS_NS87308_FDC -CONFIG_SYS_NS87308_FDC_BASE -CONFIG_SYS_NS87308_GPIO -CONFIG_SYS_NS87308_GPIO_BASE -CONFIG_SYS_NS87308_KBC1 -CONFIG_SYS_NS87308_KBC1_BASE -CONFIG_SYS_NS87308_KBC2 -CONFIG_SYS_NS87308_LPT_BASE -CONFIG_SYS_NS87308_MOUSE -CONFIG_SYS_NS87308_PARP -CONFIG_SYS_NS87308_PMC1 -CONFIG_SYS_NS87308_PMC2 -CONFIG_SYS_NS87308_PMC3 -CONFIG_SYS_NS87308_POWRMAN -CONFIG_SYS_NS87308_PS2MOD -CONFIG_SYS_NS87308_PWMAN_BASE -CONFIG_SYS_NS87308_RARP -CONFIG_SYS_NS87308_RTC_APC -CONFIG_SYS_NS87308_RTC_BASE -CONFIG_SYS_NS87308_UART1 -CONFIG_SYS_NS87308_UART1_BASE -CONFIG_SYS_NS87308_UART2 -CONFIG_SYS_NS87308_UART2_BASE CONFIG_SYS_NUM_ADDR_MAP CONFIG_SYS_NUM_CPC CONFIG_SYS_NUM_FM1_10GEC @@ -3924,7 +3888,6 @@ CONFIG_SYS_STACK_SIZE CONFIG_SYS_STATUS_C CONFIG_SYS_STATUS_OK CONFIG_SYS_STMICRO_BOOT -CONFIG_SYS_SUPPORT_64BIT_DATA CONFIG_SYS_SXCNFG_VAL CONFIG_SYS_TBIPA_VALUE CONFIG_SYS_TCLK diff --git a/test/lib/Makefile b/test/lib/Makefile index 72d2ec74b5f..230068d5a00 100644 --- a/test/lib/Makefile +++ b/test/lib/Makefile @@ -8,3 +8,4 @@ obj-y += lmb.o obj-y += string.o obj-$(CONFIG_ERRNO_STR) += test_errno_str.o obj-$(CONFIG_UT_LIB_ASN1) += asn1.o +obj-$(CONFIG_AES) += test_aes.o diff --git a/test/lib/test_aes.c b/test/lib/test_aes.c new file mode 100644 index 00000000000..b7b4b775df5 --- /dev/null +++ b/test/lib/test_aes.c @@ -0,0 +1,166 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) 2019 Philippe Reynes <philippe.reynes@softathome.com> + * + * Unit tests for aes functions + */ + +#include <common.h> +#include <command.h> +#include <hexdump.h> +#include <uboot_aes.h> +#include <test/lib.h> +#include <test/test.h> +#include <test/ut.h> + +#define TEST_AES_ONE_BLOCK 0 +#define TEST_AES_CBC_CHAIN 1 + +struct test_aes_s { + int key_len; + int key_exp_len; + int type; + int num_block; +}; + +static struct test_aes_s test_aes[] = { + { AES128_KEY_LENGTH, AES128_EXPAND_KEY_LENGTH, TEST_AES_ONE_BLOCK, 1 }, + { AES128_KEY_LENGTH, AES128_EXPAND_KEY_LENGTH, TEST_AES_CBC_CHAIN, 16 }, + { AES192_KEY_LENGTH, AES192_EXPAND_KEY_LENGTH, TEST_AES_ONE_BLOCK, 1 }, + { AES192_KEY_LENGTH, AES192_EXPAND_KEY_LENGTH, TEST_AES_CBC_CHAIN, 16 }, + { AES256_KEY_LENGTH, AES256_EXPAND_KEY_LENGTH, TEST_AES_ONE_BLOCK, 1 }, + { AES256_KEY_LENGTH, AES256_EXPAND_KEY_LENGTH, TEST_AES_CBC_CHAIN, 16 }, +}; + +static void rand_buf(u8 *buf, int size) +{ + int i; + + for (i = 0; i < size; i++) + buf[i] = rand() & 0xff; +} + +static int lib_test_aes_one_block(struct unit_test_state *uts, int key_len, + u8 *key_exp, u8 *iv, int num_block, + u8 *nocipher, u8 *ciphered, u8 *uncipher) +{ + aes_encrypt(key_len, nocipher, key_exp, ciphered); + aes_decrypt(key_len, ciphered, key_exp, uncipher); + + ut_asserteq_mem(nocipher, uncipher, AES_BLOCK_LENGTH); + + /* corrupt the expanded key */ + key_exp[0]++; + aes_decrypt(key_len, ciphered, key_exp, uncipher); + ut_assertf(memcmp(nocipher, uncipher, AES_BLOCK_LENGTH), + "nocipher and uncipher should be different\n"); + + return 0; +} + +static int lib_test_aes_cbc_chain(struct unit_test_state *uts, int key_len, + u8 *key_exp, u8 *iv, int num_block, + u8 *nocipher, u8 *ciphered, u8 *uncipher) +{ + aes_cbc_encrypt_blocks(key_len, key_exp, iv, + nocipher, ciphered, num_block); + aes_cbc_decrypt_blocks(key_len, key_exp, iv, + ciphered, uncipher, num_block); + + ut_asserteq_mem(nocipher, uncipher, num_block * AES_BLOCK_LENGTH); + + /* corrupt the expanded key */ + key_exp[0]++; + aes_cbc_decrypt_blocks(key_len, key_exp, iv, + ciphered, uncipher, num_block); + ut_assertf(memcmp(nocipher, uncipher, num_block * AES_BLOCK_LENGTH), + "nocipher and uncipher should be different\n"); + + return 0; +} + +static int _lib_test_aes_run(struct unit_test_state *uts, int key_len, + int key_exp_len, int type, int num_block) +{ + u8 *key, *key_exp, *iv; + u8 *nocipher, *ciphered, *uncipher; + int ret; + + /* Allocate all the buffer */ + key = malloc(key_len); + ut_assertnonnull(key); + key_exp = malloc(key_exp_len); + ut_assertnonnull(key_exp); + iv = malloc(AES_BLOCK_LENGTH); + ut_assertnonnull(iv); + nocipher = malloc(num_block * AES_BLOCK_LENGTH); + ut_assertnonnull(nocipher); + ciphered = malloc((num_block + 1) * AES_BLOCK_LENGTH); + ut_assertnonnull(ciphered); + uncipher = malloc((num_block + 1) * AES_BLOCK_LENGTH); + ut_assertnonnull(uncipher); + + /* Initialize all buffer */ + rand_buf(key, key_len); + rand_buf(iv, AES_BLOCK_LENGTH); + rand_buf(nocipher, num_block * AES_BLOCK_LENGTH); + memset(ciphered, 0, (num_block + 1) * AES_BLOCK_LENGTH); + memset(uncipher, 0, (num_block + 1) * AES_BLOCK_LENGTH); + + /* Expand the key */ + aes_expand_key(key, key_len, key_exp); + + /* Encrypt and decrypt */ + switch (type) { + case TEST_AES_ONE_BLOCK: + ret = lib_test_aes_one_block(uts, key_len, key_exp, iv, + num_block, nocipher, + ciphered, uncipher); + break; + case TEST_AES_CBC_CHAIN: + ret = lib_test_aes_cbc_chain(uts, key_len, key_exp, iv, + num_block, nocipher, + ciphered, uncipher); + break; + default: + printf("%s: unknown type (type=%d)\n", __func__, type); + ret = -1; + }; + + /* Free all the data */ + free(key); + free(key_exp); + free(iv); + free(nocipher); + free(ciphered); + free(uncipher); + + return ret; +} + +static int lib_test_aes_run(struct unit_test_state *uts, + struct test_aes_s *test) +{ + int key_len = test->key_len; + int key_exp_len = test->key_exp_len; + int type = test->type; + int num_block = test->num_block; + + return _lib_test_aes_run(uts, key_len, key_exp_len, + type, num_block); +} + +static int lib_test_aes(struct unit_test_state *uts) +{ + int i, ret = 0; + + for (i = 0; i < ARRAY_SIZE(test_aes); i++) { + ret = lib_test_aes_run(uts, &test_aes[i]); + if (ret) + break; + } + + return ret; +} + +LIB_TEST(lib_test_aes, 0); diff --git a/tools/Makefile b/tools/Makefile index 345bc84e48d..99be724b82a 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -59,6 +59,7 @@ hostprogs-$(CONFIG_CMD_BOOTEFI_SELFTEST) += file2include FIT_OBJS-$(CONFIG_FIT) := fit_common.o fit_image.o image-host.o common/image-fit.o FIT_SIG_OBJS-$(CONFIG_FIT_SIGNATURE) := common/image-sig.o +FIT_CIPHER_OBJS-$(CONFIG_FIT_CIPHER) := common/image-cipher.o # The following files are synced with upstream DTC. # Use synced versions from scripts/dtc/libfdt/. @@ -75,6 +76,9 @@ RSA_OBJS-$(CONFIG_FIT_SIGNATURE) := $(addprefix lib/rsa/, \ rsa-sign.o rsa-verify.o rsa-checksum.o \ rsa-mod-exp.o) +AES_OBJS-$(CONFIG_FIT_CIPHER) := $(addprefix lib/aes/, \ + aes-encrypt.o aes-decrypt.o) + ROCKCHIP_OBS = lib/rc4.o rkcommon.o rkimage.o rksd.o rkspi.o # common objs for dumpimage and mkimage @@ -82,6 +86,7 @@ dumpimage-mkimage-objs := aisimage.o \ atmelimage.o \ $(FIT_OBJS-y) \ $(FIT_SIG_OBJS-y) \ + $(FIT_CIPHER_OBJS-y) \ common/bootm.o \ lib/crc32.o \ default_image.o \ @@ -116,7 +121,8 @@ dumpimage-mkimage-objs := aisimage.o \ gpimage.o \ gpimage-common.o \ mtk_image.o \ - $(RSA_OBJS-y) + $(RSA_OBJS-y) \ + $(AES_OBJS-y) dumpimage-objs := $(dumpimage-mkimage-objs) dumpimage.o mkimage-objs := $(dumpimage-mkimage-objs) mkimage.o @@ -137,6 +143,12 @@ HOST_EXTRACFLAGS += -DCONFIG_FIT_SIGNATURE HOST_EXTRACFLAGS += -DCONFIG_FIT_SIGNATURE_MAX_SIZE=$(CONFIG_FIT_SIGNATURE_MAX_SIZE) endif +ifdef CONFIG_FIT_CIPHER +# This affects include/image.h, but including the board config file +# is tricky, so manually define this options here. +HOST_EXTRACFLAGS += -DCONFIG_FIT_CIPHER +endif + ifdef CONFIG_SYS_U_BOOT_OFFS HOSTCFLAGS_kwbimage.o += -DCONFIG_SYS_U_BOOT_OFFS=$(CONFIG_SYS_U_BOOT_OFFS) endif diff --git a/tools/fit_image.c b/tools/fit_image.c index 6aa4b1c7330..dd61a816c93 100644 --- a/tools/fit_image.c +++ b/tools/fit_image.c @@ -59,6 +59,14 @@ static int fit_add_file_data(struct image_tool_params *params, size_t size_inc, } if (!ret) { + ret = fit_cipher_data(params->keydir, dest_blob, ptr, + params->comment, + params->require_keys, + params->engine_id, + params->cmdname); + } + + if (!ret) { ret = fit_add_verification_data(params->keydir, dest_blob, ptr, params->comment, params->require_keys, @@ -74,7 +82,6 @@ static int fit_add_file_data(struct image_tool_params *params, size_t size_inc, err_keydest: munmap(ptr, sbuf.st_size); close(tfd); - return ret; } @@ -621,6 +628,62 @@ err_no_fd: return ret; } +static int copyfile(const char *src, const char *dst) +{ + int fd_src = -1, fd_dst = -1; + void *buf = NULL; + ssize_t size; + size_t count; + int ret = -1; + + fd_src = open(src, O_RDONLY); + if (fd_src < 0) { + printf("Can't open file %s (%s)\n", src, strerror(errno)); + goto out; + } + + fd_dst = open(dst, O_WRONLY | O_CREAT, 0700); + if (fd_dst < 0) { + printf("Can't open file %s (%s)\n", dst, strerror(errno)); + goto out; + } + + buf = malloc(512); + if (!buf) { + printf("Can't allocate buffer to copy file\n"); + goto out; + } + + while (1) { + size = read(fd_src, buf, 512); + if (size < 0) { + printf("Can't read file %s\n", src); + goto out; + } + if (!size) + break; + + count = size; + size = write(fd_dst, buf, count); + if (size < 0) { + printf("Can't write file %s\n", dst); + goto out; + } + } + + ret = 0; + + out: + if (fd_src >= 0) + close(fd_src); + if (fd_dst >= 0) + close(fd_dst); + if (buf) + free(buf); + + return ret; +} + /** * fit_handle_file - main FIT file processing function * @@ -636,6 +699,7 @@ err_no_fd: static int fit_handle_file(struct image_tool_params *params) { char tmpfile[MKIMAGE_MAX_TMPFILE_LEN]; + char bakfile[MKIMAGE_MAX_TMPFILE_LEN + 4] = {0}; char cmd[MKIMAGE_MAX_DTC_CMDLINE_LEN]; size_t size_inc; int ret; @@ -670,6 +734,7 @@ static int fit_handle_file(struct image_tool_params *params) snprintf(cmd, sizeof(cmd), "cp \"%s\" \"%s\"", params->imagefile, tmpfile); } + if (*cmd && system(cmd) == -1) { fprintf (stderr, "%s: system(%s) failed: %s\n", params->cmdname, cmd, strerror(errno)); @@ -682,6 +747,14 @@ static int fit_handle_file(struct image_tool_params *params) goto err_system; /* + * Copy the tmpfile to bakfile, then in the following loop + * we copy bakfile to tmpfile. So we always start from the + * beginning. + */ + sprintf(bakfile, "%s%s", tmpfile, ".bak"); + rename(tmpfile, bakfile); + + /* * Set hashes for images in the blob. Unfortunately we may need more * space in either FDT, so keep trying until we succeed. * @@ -692,6 +765,11 @@ static int fit_handle_file(struct image_tool_params *params) * steps of this loop is enough to sign with several keys. */ for (size_inc = 0; size_inc < 64 * 1024; size_inc += 1024) { + if (copyfile(bakfile, tmpfile) < 0) { + printf("Can't copy %s to %s\n", bakfile, tmpfile); + ret = -EIO; + break; + } ret = fit_add_file_data(params, size_inc, tmpfile); if (!ret || ret != -ENOSPC) break; @@ -715,13 +793,16 @@ static int fit_handle_file(struct image_tool_params *params) params->cmdname, tmpfile, params->imagefile, strerror (errno)); unlink (tmpfile); + unlink(bakfile); unlink (params->imagefile); return EXIT_FAILURE; } + unlink(bakfile); return EXIT_SUCCESS; err_system: unlink(tmpfile); + unlink(bakfile); return -1; } diff --git a/tools/image-host.c b/tools/image-host.c index 88b329502ca..9483561bfa5 100644 --- a/tools/image-host.c +++ b/tools/image-host.c @@ -12,6 +12,7 @@ #include <bootm.h> #include <image.h> #include <version.h> +#include <uboot_aes.h> /** * fit_set_hash_value - set hash value in requested has node @@ -268,6 +269,262 @@ static int fit_image_process_sig(const char *keydir, void *keydest, return 0; } +static int fit_image_read_data(char *filename, unsigned char *data, + int expected_size) +{ + struct stat sbuf; + int fd, ret = -1; + ssize_t n; + + /* Open file */ + fd = open(filename, O_RDONLY | O_BINARY); + if (fd < 0) { + printf("Can't open file %s (err=%d => %s)\n", + filename, errno, strerror(errno)); + return -1; + } + + /* Compute file size */ + if (fstat(fd, &sbuf) < 0) { + printf("Can't fstat file %s (err=%d => %s)\n", + filename, errno, strerror(errno)); + goto err; + } + + /* Check file size */ + if (sbuf.st_size != expected_size) { + printf("File %s don't have the expected size (size=%ld, expected=%d)\n", + filename, sbuf.st_size, expected_size); + goto err; + } + + /* Read data */ + n = read(fd, data, sbuf.st_size); + if (n < 0) { + printf("Can't read file %s (err=%d => %s)\n", + filename, errno, strerror(errno)); + goto err; + } + + /* Check that we have read all the file */ + if (n != sbuf.st_size) { + printf("Can't read all file %s (read %ld bytes, expexted %ld)\n", + filename, n, sbuf.st_size); + goto err; + } + + ret = 0; + +err: + close(fd); + return ret; +} + +static int fit_image_setup_cipher(struct image_cipher_info *info, + const char *keydir, void *fit, + const char *image_name, int image_noffset, + const char *node_name, int noffset) +{ + char *algo_name; + char filename[128]; + int ret = -1; + + if (fit_image_cipher_get_algo(fit, noffset, &algo_name)) { + printf("Can't get algo name for cipher '%s' in image '%s'\n", + node_name, image_name); + goto out; + } + + info->keydir = keydir; + + /* Read the key name */ + info->keyname = fdt_getprop(fit, noffset, "key-name-hint", NULL); + if (!info->keyname) { + printf("Can't get key name for cipher '%s' in image '%s'\n", + node_name, image_name); + goto out; + } + + /* Read the IV name */ + info->ivname = fdt_getprop(fit, noffset, "iv-name-hint", NULL); + if (!info->ivname) { + printf("Can't get iv name for cipher '%s' in image '%s'\n", + node_name, image_name); + goto out; + } + + info->fit = fit; + info->node_noffset = noffset; + info->name = algo_name; + + info->cipher = image_get_cipher_algo(algo_name); + if (!info->cipher) { + printf("Can't get algo for cipher '%s'\n", image_name); + goto out; + } + + /* Read the key in the file */ + snprintf(filename, sizeof(filename), "%s/%s%s", + info->keydir, info->keyname, ".bin"); + info->key = malloc(info->cipher->key_len); + if (!info->key) { + printf("Can't allocate memory for key\n"); + ret = -1; + goto out; + } + ret = fit_image_read_data(filename, (unsigned char *)info->key, + info->cipher->key_len); + if (ret < 0) + goto out; + + /* Read the IV in the file */ + snprintf(filename, sizeof(filename), "%s/%s%s", + info->keydir, info->ivname, ".bin"); + info->iv = malloc(info->cipher->iv_len); + if (!info->iv) { + printf("Can't allocate memory for iv\n"); + ret = -1; + goto out; + } + ret = fit_image_read_data(filename, (unsigned char *)info->iv, + info->cipher->iv_len); + + out: + return ret; +} + +int fit_image_write_cipher(void *fit, int image_noffset, int noffset, + const void *data, size_t size, + unsigned char *data_ciphered, int data_ciphered_len) +{ + int ret = -1; + + /* Remove unciphered data */ + ret = fdt_delprop(fit, image_noffset, FIT_DATA_PROP); + if (ret) { + printf("Can't remove data (err = %d)\n", ret); + goto out; + } + + /* Add ciphered data */ + ret = fdt_setprop(fit, image_noffset, FIT_DATA_PROP, + data_ciphered, data_ciphered_len); + if (ret) { + printf("Can't add ciphered data (err = %d)\n", ret); + goto out; + } + + /* add non ciphered data size */ + ret = fdt_setprop_u32(fit, image_noffset, "data-size-unciphered", size); + if (ret) { + printf("Can't add unciphered data size (err = %d)\n", ret); + goto out; + } + + out: + return ret; +} + +static int +fit_image_process_cipher(const char *keydir, void *keydest, void *fit, + const char *image_name, int image_noffset, + const char *node_name, int node_noffset, + const void *data, size_t size, + const char *cmdname) +{ + struct image_cipher_info info; + unsigned char *data_ciphered = NULL; + int data_ciphered_len; + int ret; + + memset(&info, 0, sizeof(info)); + + ret = fit_image_setup_cipher(&info, keydir, fit, image_name, + image_noffset, node_name, node_noffset); + if (ret) + goto out; + + ret = info.cipher->encrypt(&info, data, size, + &data_ciphered, &data_ciphered_len); + if (ret) + goto out; + + /* + * Write the public key into the supplied FDT file; this might fail + * several times, since we try signing with successively increasing + * size values + */ + if (keydest) { + ret = info.cipher->add_cipher_data(&info, keydest); + if (ret) { + printf("Failed to add verification data for cipher '%s' in image '%s'\n", + info.keyname, image_name); + goto out; + } + } + + ret = fit_image_write_cipher(fit, image_noffset, node_noffset, + data, size, + data_ciphered, data_ciphered_len); + + out: + free(data_ciphered); + free((void *)info.key); + free((void *)info.iv); + return ret; +} + +int fit_image_cipher_data(const char *keydir, void *keydest, + void *fit, int image_noffset, const char *comment, + int require_keys, const char *engine_id, + const char *cmdname) +{ + const char *image_name; + const void *data; + size_t size; + int node_noffset; + + /* Get image name */ + image_name = fit_get_name(fit, image_noffset, NULL); + if (!image_name) { + printf("Can't get image name\n"); + return -1; + } + + /* Get image data and data length */ + if (fit_image_get_data(fit, image_noffset, &data, &size)) { + printf("Can't get image data/size\n"); + return -1; + } + + /* Process all hash subnodes of the component image node */ + for (node_noffset = fdt_first_subnode(fit, image_noffset); + node_noffset >= 0; + node_noffset = fdt_next_subnode(fit, node_noffset)) { + const char *node_name; + int ret = 0; + + node_name = fit_get_name(fit, node_noffset, NULL); + if (!node_name) { + printf("Can't get node name\n"); + return -1; + } + + if (IMAGE_ENABLE_ENCRYPT && keydir && + !strncmp(node_name, FIT_CIPHER_NODENAME, + strlen(FIT_CIPHER_NODENAME))) + ret = fit_image_process_cipher(keydir, keydest, + fit, image_name, + image_noffset, + node_name, node_noffset, + data, size, cmdname); + if (ret) + return ret; + } + + return 0; +} + /** * fit_image_add_verification_data() - calculate/set verig. data for image node * @@ -675,6 +932,41 @@ static int fit_config_add_verification_data(const char *keydir, void *keydest, return 0; } +int fit_cipher_data(const char *keydir, void *keydest, void *fit, + const char *comment, int require_keys, + const char *engine_id, const char *cmdname) +{ + int images_noffset; + int noffset; + int ret; + + /* Find images parent node offset */ + images_noffset = fdt_path_offset(fit, FIT_IMAGES_PATH); + if (images_noffset < 0) { + printf("Can't find images parent node '%s' (%s)\n", + FIT_IMAGES_PATH, fdt_strerror(images_noffset)); + return images_noffset; + } + + /* Process its subnodes, print out component images details */ + for (noffset = fdt_first_subnode(fit, images_noffset); + noffset >= 0; + noffset = fdt_next_subnode(fit, noffset)) { + /* + * Direct child node of the images parent node, + * i.e. component image node. + */ + ret = fit_image_cipher_data(keydir, keydest, + fit, noffset, comment, + require_keys, engine_id, + cmdname); + if (ret) + return ret; + } + + return 0; +} + int fit_add_verification_data(const char *keydir, void *keydest, void *fit, const char *comment, int require_keys, const char *engine_id, const char *cmdname) |