diff options
Diffstat (limited to 'board')
199 files changed, 603 insertions, 1157 deletions
diff --git a/board/AndesTech/ax25-ae350/ax25-ae350.c b/board/AndesTech/ax25-ae350/ax25-ae350.c index 81b0ee9923..15da58a314 100644 --- a/board/AndesTech/ax25-ae350/ax25-ae350.c +++ b/board/AndesTech/ax25-ae350/ax25-ae350.c @@ -109,7 +109,7 @@ void board_boot_order(u32 *spl_boot_list) #ifdef CONFIG_SPL_RAM_SUPPORT BOOT_DEVICE_RAM, #endif -#ifdef CONFIG_SPL_MMC_SUPPORT +#ifdef CONFIG_SPL_MMC BOOT_DEVICE_MMC1, #endif }; diff --git a/board/CarMediaLab/flea3/flea3.c b/board/CarMediaLab/flea3/flea3.c index 12c5ac331f..ecd70ecbdc 100644 --- a/board/CarMediaLab/flea3/flea3.c +++ b/board/CarMediaLab/flea3/flea3.c @@ -196,12 +196,14 @@ int board_init(void) return 0; } +#ifdef CONFIG_REVISION_TAG u32 get_board_rev(void) { int rev = 0; return (get_cpu_rev() & ~(0xF << 8)) | (rev & 0xF) << 8; } +#endif /* * called prior to booting kernel or by 'fdt boardsetup' command diff --git a/board/LaCie/netspace_v2/netspace_v2.c b/board/LaCie/netspace_v2/netspace_v2.c index 730eab7e70..22bb008745 100644 --- a/board/LaCie/netspace_v2/netspace_v2.c +++ b/board/LaCie/netspace_v2/netspace_v2.c @@ -73,8 +73,10 @@ int board_early_init_f(void) int board_init(void) { +#ifdef CONFIG_MACH_TYPE /* Machine number */ gd->bd->bi_arch_number = CONFIG_MACH_TYPE; +#endif /* Boot parameters address */ gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100; diff --git a/board/Synology/common/Makefile b/board/Synology/common/Makefile index 62354cc2e8..f688b54906 100644 --- a/board/Synology/common/Makefile +++ b/board/Synology/common/Makefile @@ -2,4 +2,4 @@ # # Copyright (C) 2021 Phil Sutter <phil@nwl.cc> -obj-y += legacy.o +obj-$(SUPPORT_PASSING_ATAGS) += legacy.o diff --git a/board/Synology/common/legacy.c b/board/Synology/common/legacy.c index 3c89e92ae7..06f964f53a 100644 --- a/board/Synology/common/legacy.c +++ b/board/Synology/common/legacy.c @@ -15,14 +15,15 @@ static unsigned int syno_board_id(void) { +#ifdef CONFIG_MACH_TYPE switch (CONFIG_MACH_TYPE) { case 527: return SYNO_DS109_ID; case 3036: return SYNO_AXP_4BAY_2BAY; - default: - return 0; } +#endif + return 0; } static unsigned int usb_port_modes(void) diff --git a/board/advantech/imx8qm_rom7720_a1/Kconfig b/board/advantech/imx8qm_rom7720_a1/Kconfig index cf3869ed92..8bf3a7d348 100644 --- a/board/advantech/imx8qm_rom7720_a1/Kconfig +++ b/board/advantech/imx8qm_rom7720_a1/Kconfig @@ -9,6 +9,9 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "imx8qm_rom7720" +config IMX_CONFIG + default "board/advantech/imx8qm_rom7720_a1/imximage.cfg" + source "board/freescale/common/Kconfig" endif diff --git a/board/advantech/imx8qm_rom7720_a1/spl.c b/board/advantech/imx8qm_rom7720_a1/spl.c index 8493bb0158..5fd60212df 100644 --- a/board/advantech/imx8qm_rom7720_a1/spl.c +++ b/board/advantech/imx8qm_rom7720_a1/spl.c @@ -172,7 +172,7 @@ int board_mmc_getcd(struct mmc *mmc) void spl_board_init(void) { -#if defined(CONFIG_SPL_SPI_SUPPORT) +#if defined(CONFIG_SPL_SPI) if (sc_rm_is_resource_owned(-1, SC_R_FSPI_0)) { if (sc_pm_set_resource_power_mode(-1, SC_R_FSPI_0, SC_PM_PW_MODE_ON)) { puts("Warning: failed to initialize FSPI0\n"); @@ -185,7 +185,7 @@ void spl_board_init(void) void spl_board_prepare_for_boot(void) { -#if defined(CONFIG_SPL_SPI_SUPPORT) +#if defined(CONFIG_SPL_SPI) if (sc_rm_is_resource_owned(-1, SC_R_FSPI_0)) { if (sc_pm_set_resource_power_mode(-1, SC_R_FSPI_0, SC_PM_PW_MODE_OFF)) { puts("Warning: failed to turn off FSPI0\n"); diff --git a/board/alliedtelesis/x530/x530.c b/board/alliedtelesis/x530/x530.c index 7bcfa828d7..8b31045a07 100644 --- a/board/alliedtelesis/x530/x530.c +++ b/board/alliedtelesis/x530/x530.c @@ -121,9 +121,8 @@ int board_init(void) void arch_preboot_os(void) { -#ifdef CONFIG_WATCHDOG - wdt_stop(gd->watchdog_dev); -#endif + if (CONFIG_IS_ENABLED(WDT)) + wdt_stop_all(); } static int led_7seg_init(unsigned int segments) diff --git a/board/aristainetos/Kconfig b/board/aristainetos/Kconfig index cc603c1bc2..2d8fcc513f 100644 --- a/board/aristainetos/Kconfig +++ b/board/aristainetos/Kconfig @@ -8,6 +8,9 @@ config SYS_BOARD config SYS_BOARD_VERSION default 5 +config IMX_CONFIG + default "board/aristainetos/aristainetos2.cfg" + endif if TARGET_ARISTAINETOS2CCSLB @@ -20,4 +23,7 @@ config SYS_BOARD config SYS_BOARD_VERSION default 6 +config IMX_CONFIG + default "board/aristainetos/aristainetos2.cfg" + endif diff --git a/board/armadeus/opos6uldev/Kconfig b/board/armadeus/opos6uldev/Kconfig index e66f060d14..2a96c0044b 100644 --- a/board/armadeus/opos6uldev/Kconfig +++ b/board/armadeus/opos6uldev/Kconfig @@ -9,7 +9,4 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "opos6uldev" -config IMX_CONFIG - default "arch/arm/mach-imx/spl_sd.cfg" - endif diff --git a/board/armltd/vexpress/Kconfig b/board/armltd/vexpress/Kconfig new file mode 100644 index 0000000000..1b0dcf9669 --- /dev/null +++ b/board/armltd/vexpress/Kconfig @@ -0,0 +1,12 @@ +if TARGET_VEXPRESS_CA9X4 + +config SYS_BOARD + default "vexpress" + +config SYS_VENDOR + default "armltd" + +config SYS_CONFIG_NAME + default "vexpress_ca9x4" + +endif diff --git a/board/armltd/vexpress/MAINTAINERS b/board/armltd/vexpress/MAINTAINERS new file mode 100644 index 0000000000..2b3e4916a5 --- /dev/null +++ b/board/armltd/vexpress/MAINTAINERS @@ -0,0 +1,6 @@ +VERSATILE EXPRESS BOARDS +M: Kristian Amlie <kristian.amlie@northern.tech> +S: Maintained +F: board/armltd/vexpress/ +F: include/configs/vexpress_ca9x4.h +F: configs/vexpress_ca9x4_defconfig diff --git a/board/armltd/vexpress/Makefile b/board/armltd/vexpress/Makefile new file mode 100644 index 0000000000..84804f5ce7 --- /dev/null +++ b/board/armltd/vexpress/Makefile @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# (C) Copyright 2000-2004 +# Wolfgang Denk, DENX Software Engineering, wd@denx.de. + +obj-y := vexpress_common.o diff --git a/board/armltd/vexpress/vexpress_common.c b/board/armltd/vexpress/vexpress_common.c new file mode 100644 index 0000000000..1c83019265 --- /dev/null +++ b/board/armltd/vexpress/vexpress_common.c @@ -0,0 +1,167 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * (C) Copyright 2002 + * Sysgo Real-Time Solutions, GmbH <www.elinos.com> + * Marius Groeger <mgroeger@sysgo.de> + * + * (C) Copyright 2002 + * David Mueller, ELSOFT AG, <d.mueller@elsoft.ch> + * + * (C) Copyright 2003 + * Texas Instruments, <www.ti.com> + * Kshitij Gupta <Kshitij@ti.com> + * + * (C) Copyright 2004 + * ARM Ltd. + * Philippe Robin, <philippe.robin@arm.com> + */ +#include <common.h> +#include <bootstage.h> +#include <cpu_func.h> +#include <init.h> +#include <malloc.h> +#include <errno.h> +#include <net.h> +#include <netdev.h> +#include <asm/global_data.h> +#include <asm/io.h> +#include <asm/mach-types.h> +#include <asm/arch/systimer.h> +#include <asm/arch/sysctrl.h> +#include <asm/arch/wdt.h> + +static struct systimer *systimer_base = (struct systimer *)V2M_TIMER01; +static struct sysctrl *sysctrl_base = (struct sysctrl *)SCTL_BASE; + +static void flash__init(void); +static void vexpress_timer_init(void); +DECLARE_GLOBAL_DATA_PTR; + +#if defined(CONFIG_SHOW_BOOT_PROGRESS) +void show_boot_progress(int progress) +{ + printf("Boot reached stage %d\n", progress); +} +#endif + +static inline void delay(ulong loops) +{ + __asm__ volatile ("1:\n" + "subs %0, %1, #1\n" + "bne 1b" : "=r" (loops) : "0" (loops)); +} + +int board_init(void) +{ + gd->bd->bi_boot_params = LINUX_BOOT_PARAM_ADDR; + gd->bd->bi_arch_number = MACH_TYPE_VEXPRESS; + + icache_enable(); + flash__init(); + vexpress_timer_init(); + + return 0; +} + +static void flash__init(void) +{ + /* Setup the sytem control register to allow writing to flash */ + writel(readl(&sysctrl_base->scflashctrl) | VEXPRESS_FLASHPROG_FLVPPEN, + &sysctrl_base->scflashctrl); +} + +int dram_init(void) +{ + gd->ram_size = + get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, PHYS_SDRAM_1_SIZE); + return 0; +} + +int dram_init_banksize(void) +{ + gd->bd->bi_dram[0].start = PHYS_SDRAM_1; + gd->bd->bi_dram[0].size = + get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE); + gd->bd->bi_dram[1].start = PHYS_SDRAM_2; + gd->bd->bi_dram[1].size = + get_ram_size((long *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE); + + return 0; +} + +/* + * Start timer: + * Setup a 32 bit timer, running at 1KHz + * Versatile Express Motherboard provides 1 MHz timer + */ +static void vexpress_timer_init(void) +{ + /* + * Set clock frequency in system controller: + * VEXPRESS_REFCLK is 32KHz + * VEXPRESS_TIMCLK is 1MHz + */ + writel(SP810_TIMER0_ENSEL | SP810_TIMER1_ENSEL | + SP810_TIMER2_ENSEL | SP810_TIMER3_ENSEL | + readl(&sysctrl_base->scctrl), &sysctrl_base->scctrl); + + /* + * Set Timer0 to be: + * Enabled, free running, no interrupt, 32-bit, wrapping + */ + writel(SYSTIMER_RELOAD, &systimer_base->timer0load); + writel(SYSTIMER_RELOAD, &systimer_base->timer0value); + writel(SYSTIMER_EN | SYSTIMER_32BIT | + readl(&systimer_base->timer0control), + &systimer_base->timer0control); +} + +int v2m_cfg_write(u32 devfn, u32 data) +{ + /* Configuration interface broken? */ + u32 val; + + devfn |= SYS_CFG_START | SYS_CFG_WRITE; + + val = readl(V2M_SYS_CFGSTAT); + writel(val & ~SYS_CFG_COMPLETE, V2M_SYS_CFGSTAT); + + writel(data, V2M_SYS_CFGDATA); + writel(devfn, V2M_SYS_CFGCTRL); + + do { + val = readl(V2M_SYS_CFGSTAT); + } while (val == 0); + + return !!(val & SYS_CFG_ERR); +} + +/* Use the ARM Watchdog System to cause reset */ +void reset_cpu(void) +{ + if (v2m_cfg_write(SYS_CFG_REBOOT | SYS_CFG_SITE_MB, 0)) + printf("Unable to reboot\n"); +} + +void lowlevel_init(void) +{ +} + +ulong get_board_rev(void){ + return readl((u32 *)SYS_ID); +} + +#ifdef CONFIG_ARMV7_NONSEC +/* Setting the address at which secondary cores start from. + * Versatile Express uses one address for all cores, so ignore corenr + */ +void smp_set_core_boot_addr(unsigned long addr, int corenr) +{ + /* The SYSFLAGS register on VExpress needs to be cleared first + * by writing to the next address, since any writes to the address + * at offset 0 will only be ORed in + */ + writel(~0, CONFIG_SYSFLAGS_ADDR + 4); + writel(addr, CONFIG_SYSFLAGS_ADDR); +} +#endif diff --git a/board/atmel/sama5d27_som1_ek/sama5d27_som1_ek.c b/board/atmel/sama5d27_som1_ek/sama5d27_som1_ek.c index 1b7d946b50..8c0cf3da54 100644 --- a/board/atmel/sama5d27_som1_ek/sama5d27_som1_ek.c +++ b/board/atmel/sama5d27_som1_ek/sama5d27_som1_ek.c @@ -6,6 +6,7 @@ #include <common.h> #include <debug_uart.h> +#include <fdtdec.h> #include <init.h> #include <asm/global_data.h> #include <asm/io.h> @@ -68,7 +69,7 @@ int board_early_init_f(void) int board_init(void) { /* address of boot parameters */ - gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; + gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100; #ifdef CONFIG_CMD_USB board_usb_hw_init(); @@ -77,11 +78,14 @@ int board_init(void) return 0; } +int dram_init_banksize(void) +{ + return fdtdec_setup_memory_banksize(); +} + int dram_init(void) { - gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE, - CONFIG_SYS_SDRAM_SIZE); - return 0; + return fdtdec_setup_mem_size_base(); } #define MAC24AA_MAC_OFFSET 0xfa diff --git a/board/atmel/sama5d2_icp/MAINTAINERS b/board/atmel/sama5d2_icp/MAINTAINERS index db984b6ae4..4a65c65ec3 100644 --- a/board/atmel/sama5d2_icp/MAINTAINERS +++ b/board/atmel/sama5d2_icp/MAINTAINERS @@ -4,4 +4,5 @@ S: Maintained F: board/atmel/sama5d2_icp/ F: include/configs/sama5d2_icp.h F: configs/sama5d2_icp_mmc_defconfig +F: configs/sama5d2_icp_qspiflash_defconfig diff --git a/board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c b/board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c index a6937e7d52..2a2439c53a 100644 --- a/board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c +++ b/board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c @@ -10,7 +10,6 @@ #include <i2c.h> #include <init.h> #include <nand.h> -#include <version.h> #include <asm/global_data.h> #include <asm/io.h> #include <asm/arch/at91_common.h> diff --git a/board/atmel/sama5d2_xplained/sama5d2_xplained.c b/board/atmel/sama5d2_xplained/sama5d2_xplained.c index 5110ec8969..8b5cd533d0 100644 --- a/board/atmel/sama5d2_xplained/sama5d2_xplained.c +++ b/board/atmel/sama5d2_xplained/sama5d2_xplained.c @@ -68,7 +68,7 @@ int board_early_init_f(void) int board_init(void) { /* address of boot parameters */ - gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; + gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100; #ifdef CONFIG_CMD_USB board_usb_hw_init(); @@ -77,11 +77,14 @@ int board_init(void) return 0; } +int dram_init_banksize(void) +{ + return fdtdec_setup_memory_banksize(); +} + int dram_init(void) { - gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE, - CONFIG_SYS_SDRAM_SIZE); - return 0; + return fdtdec_setup_mem_size_base(); } #define AT24MAC_MAC_OFFSET 0x9a diff --git a/board/beacon/imx8mm/Kconfig b/board/beacon/imx8mm/Kconfig index df3125eae9..58799c1a65 100644 --- a/board/beacon/imx8mm/Kconfig +++ b/board/beacon/imx8mm/Kconfig @@ -9,6 +9,9 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "imx8mm_beacon" +config IMX_CONFIG + default "arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg" + source "board/freescale/common/Kconfig" endif diff --git a/board/beacon/imx8mn/Kconfig b/board/beacon/imx8mn/Kconfig index 2bcfb25cf8..65d2923918 100644 --- a/board/beacon/imx8mn/Kconfig +++ b/board/beacon/imx8mn/Kconfig @@ -11,11 +11,12 @@ config SYS_CONFIG_NAME config IMX8MN_FORCE_NOM_SOC bool "Force to use nominal mode for SOC and ARM" - default n config IMX8MN_BEACON_2GB_LPDDR bool "Enable 2GB LPDDR" - default n + +config IMX_CONFIG + default "arch/arm/mach-imx/imx8m/imximage-8mn-lpddr4.cfg" source "board/freescale/common/Kconfig" diff --git a/board/beckhoff/mx53cx9020/Kconfig b/board/beckhoff/mx53cx9020/Kconfig index dcdafb68e5..d4416cf09d 100644 --- a/board/beckhoff/mx53cx9020/Kconfig +++ b/board/beckhoff/mx53cx9020/Kconfig @@ -9,4 +9,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "mx53cx9020" +config IMX_CONFIG + default "board/beckhoff/mx53cx9020/imximage.cfg" + endif diff --git a/board/beckhoff/mx53cx9020/mx53cx9020.c b/board/beckhoff/mx53cx9020/mx53cx9020.c index a3657db826..e7b131836b 100644 --- a/board/beckhoff/mx53cx9020/mx53cx9020.c +++ b/board/beckhoff/mx53cx9020/mx53cx9020.c @@ -48,6 +48,7 @@ static const u32 CCAT_MODE_RUN = 0x0033DC8F; DECLARE_GLOBAL_DATA_PTR; +#ifdef CONFIG_REVISION_TAG u32 get_board_rev(void) { struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE; @@ -59,6 +60,7 @@ u32 get_board_rev(void) return (get_cpu_rev() & ~(0xF << 8)) | (rev & 0xF) << 8; } +#endif /* * Set CCAT mode diff --git a/board/bosch/guardian/Makefile b/board/bosch/guardian/Makefile index 11625c9dd6..20cecbfb64 100644 --- a/board/bosch/guardian/Makefile +++ b/board/bosch/guardian/Makefile @@ -5,7 +5,7 @@ # Copyright (C) 2018 Robert Bosch Power Tools GmbH # -ifeq ($(CONFIG_SKIP_LOWLEVEL_INIT),) +ifeq ($(CONFIG_$(SPL_)SKIP_LOWLEVEL_INIT),) obj-y := mux.o endif diff --git a/board/bosch/guardian/board.c b/board/bosch/guardian/board.c index 179511a670..105b75e65e 100644 --- a/board/bosch/guardian/board.c +++ b/board/bosch/guardian/board.c @@ -40,7 +40,7 @@ DECLARE_GLOBAL_DATA_PTR; -#ifndef CONFIG_SKIP_LOWLEVEL_INIT +#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT) static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE; static const struct ddr_data ddr3_data = { @@ -142,7 +142,7 @@ void am33xx_spl_board_init(void) const struct dpll_params *get_dpll_ddr_params(void) { enable_i2c0_pin_mux(); - i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE); + i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); return &dpll_ddr; } diff --git a/board/bosch/shc/board.c b/board/bosch/shc/board.c index 13fd25e407..a7a9775fdf 100644 --- a/board/bosch/shc/board.c +++ b/board/bosch/shc/board.c @@ -51,16 +51,17 @@ static int shc_eeprom_valid; /* * Read header information from EEPROM into global structure. */ +#define EEPROM_ADDR 0x50 static int read_eeprom(void) { /* Check if baseboard eeprom is available */ - if (i2c_probe(CONFIG_SYS_I2C_EEPROM_ADDR)) { + if (i2c_probe(EEPROM_ADDR)) { puts("Could not probe the EEPROM; something fundamentally wrong on the I2C bus.\n"); return -ENODEV; } /* read the eeprom using i2c */ - if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, 2, (uchar *)&header, + if (i2c_read(EEPROM_ADDR, 0, 2, (uchar *)&header, sizeof(header))) { puts("Could not read the EEPROM; something fundamentally wrong on the I2C bus.\n"); return -EIO; diff --git a/board/boundary/nitrogen6x/Kconfig b/board/boundary/nitrogen6x/Kconfig index f4db56d496..9c176c071e 100644 --- a/board/boundary/nitrogen6x/Kconfig +++ b/board/boundary/nitrogen6x/Kconfig @@ -9,4 +9,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "nitrogen6x" +config DDR_MB + int "Memory size in MB" + endif diff --git a/board/broadcom/bcmstb/bcmstb.c b/board/broadcom/bcmstb/bcmstb.c index 076ac94144..276e59b3bd 100644 --- a/board/broadcom/bcmstb/bcmstb.c +++ b/board/broadcom/bcmstb/bcmstb.c @@ -38,11 +38,6 @@ int board_init(void) return 0; } -u32 get_board_rev(void) -{ - return 0; -} - void reset_cpu(void) { } diff --git a/board/compulab/cl-som-imx7/cl-som-imx7.c b/board/compulab/cl-som-imx7/cl-som-imx7.c index 454c93a572..3ee1335218 100644 --- a/board/compulab/cl-som-imx7/cl-som-imx7.c +++ b/board/compulab/cl-som-imx7/cl-som-imx7.c @@ -267,7 +267,7 @@ int board_init(void) return 0; } -#ifdef CONFIG_POWER +#if CONFIG_IS_ENABLED(POWER_LEGACY) #define I2C_PMIC 0 int power_init_board(void) { @@ -293,7 +293,7 @@ int power_init_board(void) return 0; } -#endif /* CONFIG_POWER */ +#endif /* CONFIG_IS_ENABLED(POWER_LEGACY) */ /* * cl_som_imx7_setup_wdog() - watchdog configuration. diff --git a/board/compulab/cl-som-imx7/spl.c b/board/compulab/cl-som-imx7/spl.c index 9c7332b43b..5d4c4d39e7 100644 --- a/board/compulab/cl-som-imx7/spl.c +++ b/board/compulab/cl-som-imx7/spl.c @@ -157,15 +157,15 @@ static void cl_som_imx7_spl_dram_cfg(void) } } -#ifdef CONFIG_SPL_SPI_SUPPORT +#ifdef CONFIG_SPL_SPI static void cl_som_imx7_spl_spi_init(void) { cl_som_imx7_espi1_pads_set(); } -#else /* !CONFIG_SPL_SPI_SUPPORT */ +#else /* !CONFIG_SPL_SPI */ static void cl_som_imx7_spl_spi_init(void) {} -#endif /* CONFIG_SPL_SPI_SUPPORT */ +#endif /* CONFIG_SPL_SPI */ void board_init_f(ulong dummy) { diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index f29b08247e..c54bffdae4 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -720,10 +720,12 @@ int dram_init(void) return 0; } +#ifdef CONFIG_REVISION_TAG u32 get_board_rev(void) { return cl_eeprom_get_board_rev(CONFIG_SYS_I2C_EEPROM_BUS); } +#endif static struct mxc_serial_plat cm_fx6_mxc_serial_plat = { .reg = (struct mxc_uart *)UART4_BASE, diff --git a/board/compulab/cm_fx6/spl.c b/board/compulab/cm_fx6/spl.c index c3c816181f..079f196200 100644 --- a/board/compulab/cm_fx6/spl.c +++ b/board/compulab/cm_fx6/spl.c @@ -302,7 +302,7 @@ static void cm_fx6_setup_uart(void) enable_uart_clk(1); } -#ifdef CONFIG_SPL_SPI_SUPPORT +#ifdef CONFIG_SPL_SPI static void cm_fx6_setup_ecspi(void) { cm_fx6_set_ecspi_iomux(); @@ -350,7 +350,7 @@ void board_boot_order(u32 *spl_boot_list) } } -#ifdef CONFIG_SPL_MMC_SUPPORT +#ifdef CONFIG_SPL_MMC static struct fsl_esdhc_cfg usdhc_cfg = { .esdhc_base = USDHC3_BASE_ADDR, .max_bus_width = 4, diff --git a/board/compulab/cm_t43/cm_t43.c b/board/compulab/cm_t43/cm_t43.c index efdade155b..bcfe1bfaf6 100644 --- a/board/compulab/cm_t43/cm_t43.c +++ b/board/compulab/cm_t43/cm_t43.c @@ -48,7 +48,7 @@ int board_init(void) gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; gpmc_init(); set_i2c_pin_mux(); - i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE); + i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); i2c_probe(TPS65218_CHIP_PM); return 0; diff --git a/board/compulab/cm_t43/spl.c b/board/compulab/cm_t43/spl.c index 016c63a509..9c6806c32f 100644 --- a/board/compulab/cm_t43/spl.c +++ b/board/compulab/cm_t43/spl.c @@ -106,7 +106,7 @@ const struct dpll_params *get_dpll_per_params(void) void scale_vcores(void) { set_i2c_pin_mux(); - i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE); + i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); if (i2c_probe(TPS65218_CHIP_PM)) return; diff --git a/board/compulab/common/Makefile b/board/compulab/common/Makefile index 842fb3b6a6..25dad49877 100644 --- a/board/compulab/common/Makefile +++ b/board/compulab/common/Makefile @@ -5,6 +5,6 @@ # Author: Igor Grinberg <grinberg@compulab.co.il> obj-y += common.o -obj-$(CONFIG_SYS_I2C_LEGACY) += eeprom.o +obj-$(CONFIG_$(SPL_)SYS_I2C_LEGACY) += eeprom.o obj-$(CONFIG_LCD) += omap3_display.o obj-$(CONFIG_SMC911X) += omap3_smc911x.o diff --git a/board/compulab/common/eeprom.c b/board/compulab/common/eeprom.c index b41c64d2a3..05ce33e8d6 100644 --- a/board/compulab/common/eeprom.c +++ b/board/compulab/common/eeprom.c @@ -15,15 +15,6 @@ #include <linux/kernel.h> #include "eeprom.h" -#ifndef CONFIG_SYS_I2C_EEPROM_ADDR -# define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 -# define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 -#endif - -#ifndef CONFIG_SYS_I2C_EEPROM_BUS -#define CONFIG_SYS_I2C_EEPROM_BUS 0 -#endif - #define EEPROM_LAYOUT_VER_OFFSET 44 #define BOARD_SERIAL_OFFSET 20 #define BOARD_SERIAL_OFFSET_LEGACY 8 diff --git a/board/compulab/common/eeprom.h b/board/compulab/common/eeprom.h index 51c8acf3b8..9bd7604a99 100644 --- a/board/compulab/common/eeprom.h +++ b/board/compulab/common/eeprom.h @@ -10,7 +10,7 @@ #define _EEPROM_ #include <errno.h> -#ifdef CONFIG_SYS_I2C_LEGACY +#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) int cl_eeprom_read_mac_addr(uchar *buf, uint eeprom_bus); u32 cl_eeprom_get_board_rev(uint eeprom_bus); int cl_eeprom_get_product_name(uchar *buf, uint eeprom_bus); diff --git a/board/compulab/imx8mm-cl-iot-gate/Kconfig b/board/compulab/imx8mm-cl-iot-gate/Kconfig index 7f5c794bf5..30760cbf45 100644 --- a/board/compulab/imx8mm-cl-iot-gate/Kconfig +++ b/board/compulab/imx8mm-cl-iot-gate/Kconfig @@ -9,4 +9,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "imx8mm-cl-iot-gate" +config IMX_CONFIG + default "board/compulab/imx8mm-cl-iot-gate/imximage-8mm-lpddr4.cfg" + endif diff --git a/board/compulab/imx8mm-cl-iot-gate/spl.c b/board/compulab/imx8mm-cl-iot-gate/spl.c index 8f592457d4..2dc62d6682 100644 --- a/board/compulab/imx8mm-cl-iot-gate/spl.c +++ b/board/compulab/imx8mm-cl-iot-gate/spl.c @@ -176,7 +176,7 @@ void board_init_f(ulong dummy) enable_tzc380(); - setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1); + setup_i2c(1, 100000, 0x7f, &i2c_pad_info1); power_init_board(); diff --git a/board/congatec/cgtqmx8/Kconfig b/board/congatec/cgtqmx8/Kconfig index 7273039261..74e9838d29 100644 --- a/board/congatec/cgtqmx8/Kconfig +++ b/board/congatec/cgtqmx8/Kconfig @@ -9,6 +9,9 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "cgtqmx8" +config IMX_CONFIG + default "board/congatec/cgtqmx8/imximage.cfg" + source "board/congatec/common/Kconfig" endif diff --git a/board/congatec/common/Kconfig b/board/congatec/common/Kconfig index 5c205bd830..d4a238de99 100644 --- a/board/congatec/common/Kconfig +++ b/board/congatec/common/Kconfig @@ -28,7 +28,6 @@ endif config VOL_MONITOR_LTC3882_READ depends on VID bool "Enable the LTC3882 voltage monitor read" - default n help This option enables LTC3882 voltage monitor read functionality. It is used by common VID driver. @@ -36,13 +35,11 @@ config VOL_MONITOR_LTC3882_READ config VOL_MONITOR_LTC3882_SET depends on VID bool "Enable the LTC3882 voltage monitor set" - default n help This option enables LTC3882 voltage monitor set functionality. It is used by common VID driver. config USB_TCPC bool "USB Typec port controller simple driver" - default n help Enable USB type-c port controller (TCPC) driver diff --git a/board/davinci/da8xxevm/Kconfig b/board/davinci/da8xxevm/Kconfig index bb1188b4ea..c5499a63fd 100644 --- a/board/davinci/da8xxevm/Kconfig +++ b/board/davinci/da8xxevm/Kconfig @@ -22,15 +22,6 @@ config MAC_ADDR_IN_SPIFLASH their MAC address in SPI Flash from the factory Enable this option to read the MAC from SPI Flash -config MAC_ADDR_IN_EEPROM - bool "MAC address in EEPROM" - help - The DA850 EVM comes with SoM are programmed with - their MAC address in SPI Flash from the factory, - but the kit has an optional expansion board with - EEPROM available. Enable this option to read the - MAC from the EEPROM - endif endif diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c index 6c75231ddf..2436aab71c 100644 --- a/board/davinci/da8xxevm/da850evm.c +++ b/board/davinci/da8xxevm/da850evm.c @@ -129,19 +129,12 @@ int misc_init_r(void) { dspwake(); -#if defined(CONFIG_MAC_ADDR_IN_SPIFLASH) || defined(CONFIG_MAC_ADDR_IN_EEPROM) - - uchar env_enetaddr[6]; - int enetaddr_found; +#if defined(CONFIG_MAC_ADDR_IN_SPIFLASH) + uchar env_enetaddr[6], buff[6]; + int enetaddr_found, spi_mac_read; enetaddr_found = eth_env_get_enetaddr("ethaddr", env_enetaddr); -#endif - -#ifdef CONFIG_MAC_ADDR_IN_SPIFLASH - int spi_mac_read; - uchar buff[6]; - spi_mac_read = get_mac_addr(buff); buff[0] = 0; @@ -173,34 +166,6 @@ int misc_init_r(void) "with the MAC address in the environment\n"); printf("Default using MAC address from environment\n"); } - -#elif defined(CONFIG_MAC_ADDR_IN_EEPROM) - uint8_t enetaddr[8]; - int eeprom_mac_read; - - /* Read Ethernet MAC address from EEPROM */ - eeprom_mac_read = dvevm_read_mac_address(enetaddr); - - /* - * MAC address not present in the environment - * try and read the MAC address from EEPROM flash - * and set it. - */ - if (!enetaddr_found) { - if (eeprom_mac_read) - /* Set Ethernet MAC address from EEPROM */ - davinci_sync_env_enetaddr(enetaddr); - } else { - /* - * MAC address present in environment compare it with - * the MAC address in EEPROM and warn on mismatch - */ - if (eeprom_mac_read && memcmp(enetaddr, env_enetaddr, 6)) - printf("Warning: MAC address in EEPROM don't match " - "with the MAC address in the environment\n"); - printf("Default using MAC address from environment\n"); - } - #endif return 0; } @@ -267,6 +232,7 @@ const int lpsc_size = ARRAY_SIZE(lpsc); #define REV_AM18X_EVM 0x100 +#ifdef CONFIG_REVISION_TAG /* * get_board_rev() - setup to pass kernel board revision information * Returns: @@ -294,6 +260,7 @@ u32 get_board_rev(void) rev = 1; return rev; } +#endif int board_early_init_f(void) { diff --git a/board/davinci/da8xxevm/omapl138_lcdk.c b/board/davinci/da8xxevm/omapl138_lcdk.c index d5f43bf520..cd021cc8e5 100644 --- a/board/davinci/da8xxevm/omapl138_lcdk.c +++ b/board/davinci/da8xxevm/omapl138_lcdk.c @@ -143,20 +143,6 @@ const int lpsc_size = ARRAY_SIZE(lpsc); #define CONFIG_DA850_EVM_MAX_CPU_CLK 456000000 #endif -/* - * get_board_rev() - setup to pass kernel board revision information - * Returns: - * bit[0-3] Maximum cpu clock rate supported by onboard SoC - * 0000b - 300 MHz - * 0001b - 372 MHz - * 0010b - 408 MHz - * 0011b - 456 MHz - */ -u32 get_board_rev(void) -{ - return 0; -} - int board_early_init_f(void) { /* @@ -236,12 +222,6 @@ int board_init(void) #define CFG_MAC_ADDR_OFFSET (flash->size - SZ_64K) -static int get_mac_addr(u8 *addr) -{ - /* Need to find a way to get MAC ADDRESS */ - return 0; -} - void dsp_lpsc_on(unsigned domain, unsigned int id) { dv_reg_p mdstat, mdctl, ptstat, ptcmd; @@ -304,29 +284,6 @@ int rmii_hw_init(void) int misc_init_r(void) { - uint8_t tmp[20], addr[10]; - - - if (env_get("ethaddr") == NULL) { - /* Read Ethernet MAC address from EEPROM */ - if (dvevm_read_mac_address(addr)) { - /* Set Ethernet MAC address from EEPROM */ - davinci_sync_env_enetaddr(addr); - } else { - get_mac_addr(addr); - } - - if (!is_multicast_ethaddr(addr) && !is_zero_ethaddr(addr)) { - sprintf((char *)tmp, "%02x:%02x:%02x:%02x:%02x:%02x", - addr[0], addr[1], addr[2], addr[3], addr[4], - addr[5]); - - env_set("ethaddr", (char *)tmp); - } else { - printf("Invalid MAC address read.\n"); - } - } - #ifdef CONFIG_DRIVER_TI_EMAC_USE_RMII /* Select RMII fucntion through the expander */ if (rmii_hw_init()) diff --git a/board/ea/mx7ulp_com/Kconfig b/board/ea/mx7ulp_com/Kconfig index 90883aced4..f7b1f1bf46 100644 --- a/board/ea/mx7ulp_com/Kconfig +++ b/board/ea/mx7ulp_com/Kconfig @@ -9,4 +9,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "mx7ulp_com" +config IMX_CONFIG + default "board/ea/mx7ulp_com/imximage.cfg" + endif diff --git a/board/eets/pdu001/Makefile b/board/eets/pdu001/Makefile index 08c6d536d3..a5990ce3ad 100644 --- a/board/eets/pdu001/Makefile +++ b/board/eets/pdu001/Makefile @@ -6,7 +6,7 @@ # SPDX-License-Identifier: GPL-2.0+ # -ifeq ($(CONFIG_SKIP_LOWLEVEL_INIT),) +ifeq ($(CONFIG_$(SPL_)SKIP_LOWLEVEL_INIT),) obj-y := mux.o endif diff --git a/board/eets/pdu001/board.c b/board/eets/pdu001/board.c index f806d1e767..9f3cfd4f84 100644 --- a/board/eets/pdu001/board.c +++ b/board/eets/pdu001/board.c @@ -162,7 +162,7 @@ static void set_mpu_and_core_voltage(void) } } -#ifndef CONFIG_SKIP_LOWLEVEL_INIT +#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT) static const struct ddr_data ddr2_data = { .datardsratio0 = MT47H128M16RT25E_RD_DQS, .datafwsratio0 = MT47H128M16RT25E_PHY_FIFO_WE, @@ -235,7 +235,7 @@ void sdram_init(void) config_ddr(266, &ioregs, &ddr2_data, &ddr2_cmd_ctrl_data, &ddr2_emif_reg_data, 0); } -#endif /* CONFIG_SKIP_LOWLEVEL_INIT */ +#endif /* CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT) */ #ifdef CONFIG_DEBUG_UART void board_debug_uart_init(void) diff --git a/board/embest/mx6boards/mx6boards.c b/board/embest/mx6boards/mx6boards.c index dda8502c6f..a3c23bdfb6 100644 --- a/board/embest/mx6boards/mx6boards.c +++ b/board/embest/mx6boards/mx6boards.c @@ -473,7 +473,7 @@ void board_init_f(ulong dummy) /* setup GP timer */ timer_init(); -#ifdef CONFIG_SPL_SERIAL_SUPPORT +#ifdef CONFIG_SPL_SERIAL setup_iomux_uart(); preloader_console_init(); #endif diff --git a/board/engicam/imx8mm/Kconfig b/board/engicam/imx8mm/Kconfig index ed68516df4..5495b3bf99 100644 --- a/board/engicam/imx8mm/Kconfig +++ b/board/engicam/imx8mm/Kconfig @@ -9,6 +9,9 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "imx8mm_icore_mx8mm" +config IMX_CONFIG + default "arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg" + source "board/freescale/common/Kconfig" endif diff --git a/board/freescale/common/Kconfig b/board/freescale/common/Kconfig index 35a6115e5e..69620dbb74 100644 --- a/board/freescale/common/Kconfig +++ b/board/freescale/common/Kconfig @@ -24,7 +24,6 @@ config CMD_ESBC_VALIDATE config FSL_USE_PCA9547_MUX bool "Enable PCA9547 I2C Mux on Freescale boards" - default n help This option enables the PCA9547 I2C mux on Freescale boards. diff --git a/board/freescale/common/ics307_clk.h b/board/freescale/common/ics307_clk.h index 81d1aa715d..163496930c 100644 --- a/board/freescale/common/ics307_clk.h +++ b/board/freescale/common/ics307_clk.h @@ -8,7 +8,6 @@ #ifndef __ASSEMBLY__ extern unsigned long get_board_sys_clk(void); -extern unsigned long get_board_ddr_clk(void); extern unsigned long ics307_sysclk_calculator(unsigned long out_freq); #endif diff --git a/board/freescale/imx8mm_evk/Kconfig b/board/freescale/imx8mm_evk/Kconfig index 299691a619..24cc526b0a 100644 --- a/board/freescale/imx8mm_evk/Kconfig +++ b/board/freescale/imx8mm_evk/Kconfig @@ -9,4 +9,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "imx8mm_evk" +config IMX_CONFIG + default "board/freescale/imx8mm_evk/imximage-8mm-lpddr4.cfg" + endif diff --git a/board/freescale/imx8mn_evk/Kconfig b/board/freescale/imx8mn_evk/Kconfig index 478f4ed66e..0adf87bd42 100644 --- a/board/freescale/imx8mn_evk/Kconfig +++ b/board/freescale/imx8mn_evk/Kconfig @@ -11,7 +11,9 @@ config SYS_CONFIG_NAME config IMX8MN_LOW_DRIVE_MODE bool "Enable the low drive mode of iMX8MN on EVK board" - default n + +config IMX_CONFIG + default "board/freescale/imx8mn_evk/imximage-8mn-ddr4.cfg" source "board/freescale/common/Kconfig" diff --git a/board/freescale/imx8mp_evk/Kconfig b/board/freescale/imx8mp_evk/Kconfig index 49bb29a45d..42625fd588 100644 --- a/board/freescale/imx8mp_evk/Kconfig +++ b/board/freescale/imx8mp_evk/Kconfig @@ -9,6 +9,9 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "imx8mp_evk" +config IMX_CONFIG + default "board/freescale/imx8mp_evk/imximage-8mp-lpddr4.cfg" + source "board/freescale/common/Kconfig" endif diff --git a/board/freescale/imx8mp_evk/spl.c b/board/freescale/imx8mp_evk/spl.c index a7564e9b1a..eca42c756e 100644 --- a/board/freescale/imx8mp_evk/spl.c +++ b/board/freescale/imx8mp_evk/spl.c @@ -63,7 +63,7 @@ struct i2c_pads_info i2c_pad_info1 = { }, }; -#ifdef CONFIG_POWER +#if CONFIG_IS_ENABLED(POWER_LEGACY) #define I2C_PMIC 0 int power_init_board(void) { diff --git a/board/freescale/imx8mq_evk/Kconfig b/board/freescale/imx8mq_evk/Kconfig index 421b081c76..c4d20ad7c7 100644 --- a/board/freescale/imx8mq_evk/Kconfig +++ b/board/freescale/imx8mq_evk/Kconfig @@ -9,4 +9,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "imx8mq_evk" +config IMX_CONFIG + default "arch/arm/mach-imx/imx8m/imximage.cfg" + endif diff --git a/board/freescale/imx8mq_evk/spl.c b/board/freescale/imx8mq_evk/spl.c index e8e0efe485..67d069b2b0 100644 --- a/board/freescale/imx8mq_evk/spl.c +++ b/board/freescale/imx8mq_evk/spl.c @@ -156,7 +156,7 @@ int board_mmc_init(struct bd_info *bis) return 0; } -#ifdef CONFIG_POWER +#if CONFIG_IS_ENABLED(POWER_LEGACY) #define I2C_PMIC 0 int power_init_board(void) { diff --git a/board/freescale/imx8qm_mek/Kconfig b/board/freescale/imx8qm_mek/Kconfig index 93d7d5f9c5..aed6ab25ce 100644 --- a/board/freescale/imx8qm_mek/Kconfig +++ b/board/freescale/imx8qm_mek/Kconfig @@ -9,6 +9,9 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "imx8qm_mek" +config IMX_CONFIG + default "board/freescale/imx8qm_mek/imximage.cfg" + source "board/freescale/common/Kconfig" endif diff --git a/board/freescale/imx8qxp_mek/Kconfig b/board/freescale/imx8qxp_mek/Kconfig index b67300d816..b9aab3789e 100644 --- a/board/freescale/imx8qxp_mek/Kconfig +++ b/board/freescale/imx8qxp_mek/Kconfig @@ -9,6 +9,9 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "imx8qxp_mek" +config IMX_CONFIG + default "board/freescale/imx8qxp_mek/imximage.cfg" + source "board/freescale/common/Kconfig" endif diff --git a/board/freescale/imxrt1020-evk/imxrt1020-evk.c b/board/freescale/imxrt1020-evk/imxrt1020-evk.c index 479e66bddc..54a733b12c 100644 --- a/board/freescale/imxrt1020-evk/imxrt1020-evk.c +++ b/board/freescale/imxrt1020-evk/imxrt1020-evk.c @@ -71,11 +71,6 @@ u32 spl_boot_device(void) } #endif -u32 get_board_rev(void) -{ - return 0; -} - int board_init(void) { gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100; diff --git a/board/freescale/imxrt1050-evk/imxrt1050-evk.c b/board/freescale/imxrt1050-evk/imxrt1050-evk.c index eb492390db..6132916578 100644 --- a/board/freescale/imxrt1050-evk/imxrt1050-evk.c +++ b/board/freescale/imxrt1050-evk/imxrt1050-evk.c @@ -71,11 +71,6 @@ u32 spl_boot_device(void) } #endif -u32 get_board_rev(void) -{ - return 0; -} - int board_init(void) { gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100; diff --git a/board/freescale/ls1021aqds/README b/board/freescale/ls1021aqds/README index 6cf7146fb2..e2ce00165b 100644 --- a/board/freescale/ls1021aqds/README +++ b/board/freescale/ls1021aqds/README @@ -113,6 +113,5 @@ Start Address End Address Description Size LS1021a rev1.0 Soc specific Options/Settings -------------------------------------------- -If the LS1021a Soc is rev1.0, you need modify the configure file. -Add the following define in include/configs/ls1021aqds.h: -#define CONFIG_SKIP_LOWLEVEL_INIT +If the LS1021a Soc is rev1.0, you need modify the configuration and enable +CONFIG_SPL_SKIP_LOWLEVEL_INIT in menuconfig or similar. diff --git a/board/freescale/ls1021aqds/ls1021aqds.c b/board/freescale/ls1021aqds/ls1021aqds.c index 711d8c2906..fbbd27d9d7 100644 --- a/board/freescale/ls1021aqds/ls1021aqds.c +++ b/board/freescale/ls1021aqds/ls1021aqds.c @@ -127,6 +127,7 @@ unsigned long get_board_sys_clk(void) return 66666666; } +#ifdef CONFIG_DYNAMIC_DDR_CLK_FREQ unsigned long get_board_ddr_clk(void) { u8 ddrclk_conf = QIXIS_READ(brdcfg[1]); @@ -141,6 +142,7 @@ unsigned long get_board_ddr_clk(void) } return 66666666; } +#endif int dram_init(void) { diff --git a/board/freescale/ls1021atwr/README b/board/freescale/ls1021atwr/README index 896a659476..a4639cd747 100644 --- a/board/freescale/ls1021atwr/README +++ b/board/freescale/ls1021atwr/README @@ -110,6 +110,5 @@ Start Address End Address Description Size LS1021a rev1.0 Soc specific Options/Settings -------------------------------------------- -If the LS1021a Soc is rev1.0, you need modify the configure file. -Add the following define in include/configs/ls1021atwr.h: -#define CONFIG_SKIP_LOWLEVEL_INIT +If the LS1021a Soc is rev1.0, you need modify the configuration and enable +CONFIG_SPL_SKIP_LOWLEVEL_INIT in menuconfig or similar. diff --git a/board/freescale/ls1028a/Kconfig b/board/freescale/ls1028a/Kconfig index ca22c92203..40939816ad 100644 --- a/board/freescale/ls1028a/Kconfig +++ b/board/freescale/ls1028a/Kconfig @@ -14,7 +14,6 @@ config SYS_CONFIG_NAME config EMMC_BOOT bool "Support for booting from EMMC" - default n config SYS_TEXT_BASE default 0x96000000 if SD_BOOT || EMMC_BOOT @@ -53,7 +52,6 @@ config SYS_CONFIG_NAME config EMMC_BOOT bool "Support for booting from EMMC" - default n config SYS_TEXT_BASE default 0x96000000 if SD_BOOT || EMMC_BOOT diff --git a/board/freescale/ls1028a/ls1028a.c b/board/freescale/ls1028a/ls1028a.c index 5269fd34c6..461c571b36 100644 --- a/board/freescale/ls1028a/ls1028a.c +++ b/board/freescale/ls1028a/ls1028a.c @@ -137,7 +137,7 @@ int board_early_init_f(void) u8 uart; #endif -#ifdef CONFIG_SYS_I2C_EARLY_INIT +#if defined(CONFIG_SYS_I2C_EARLY_INIT) && defined(CONFIG_SPL_BUILD) i2c_early_init_f(); #endif diff --git a/board/freescale/ls1043aqds/ls1043aqds.c b/board/freescale/ls1043aqds/ls1043aqds.c index 76bbb6087a..2d5322406a 100644 --- a/board/freescale/ls1043aqds/ls1043aqds.c +++ b/board/freescale/ls1043aqds/ls1043aqds.c @@ -52,10 +52,6 @@ enum { #define CFG_UART_MUX_SHIFT 1 #define CFG_LPUART_EN 0x1 -#ifdef CONFIG_SYS_I2C_EARLY_INIT -void i2c_early_init_f(void); -#endif - #ifdef CONFIG_TFABOOT struct ifc_regs ifc_cfg_nor_boot[CONFIG_SYS_FSL_IFC_BANK_COUNT] = { { @@ -447,7 +443,7 @@ int board_early_init_f(void) */ out_le32(cntcr, 0x1); -#ifdef CONFIG_SYS_I2C_EARLY_INIT +#if defined(CONFIG_SYS_I2C_EARLY_INIT) i2c_early_init_f(); #endif fsl_lsch2_early_init_f(); diff --git a/board/freescale/ls1043ardb/Kconfig b/board/freescale/ls1043ardb/Kconfig index 3d9e295c4e..778b8d8d5a 100644 --- a/board/freescale/ls1043ardb/Kconfig +++ b/board/freescale/ls1043ardb/Kconfig @@ -16,7 +16,6 @@ config SYS_CONFIG_NAME config SYS_HAS_ARMV8_SECURE_BASE bool "Enable secure address for PSCI image" depends on ARMV8_PSCI - default n help PSCI image can be re-located to secure RAM. If enabled, please also define the value for ARMV8_SECURE_BASE, diff --git a/board/freescale/ls1046aqds/ls1046aqds.c b/board/freescale/ls1046aqds/ls1046aqds.c index 2b0786ac30..cc95d441b6 100644 --- a/board/freescale/ls1046aqds/ls1046aqds.c +++ b/board/freescale/ls1046aqds/ls1046aqds.c @@ -37,10 +37,6 @@ DECLARE_GLOBAL_DATA_PTR; -#ifdef CONFIG_SYS_I2C_EARLY_INIT -void i2c_early_init_f(void); -#endif - #ifdef CONFIG_TFABOOT struct ifc_regs ifc_cfg_nor_boot[CONFIG_SYS_FSL_IFC_BANK_COUNT] = { { @@ -318,7 +314,7 @@ int board_early_init_f(void) */ out_le32(cntcr, 0x1); -#ifdef CONFIG_SYS_I2C_EARLY_INIT +#if defined(CONFIG_SYS_I2C_EARLY_INIT) i2c_early_init_f(); #endif fsl_lsch2_early_init_f(); diff --git a/board/freescale/ls2080aqds/ls2080aqds.c b/board/freescale/ls2080aqds/ls2080aqds.c index c48b01f7d7..62658c4702 100644 --- a/board/freescale/ls2080aqds/ls2080aqds.c +++ b/board/freescale/ls2080aqds/ls2080aqds.c @@ -241,7 +241,7 @@ int board_init(void) int board_early_init_f(void) { -#ifdef CONFIG_SYS_I2C_EARLY_INIT +#if defined(CONFIG_SYS_I2C_EARLY_INIT) i2c_early_init_f(); #endif fsl_lsch3_early_init_f(); diff --git a/board/freescale/ls2080ardb/ls2080ardb.c b/board/freescale/ls2080ardb/ls2080ardb.c index e8722f20c1..58b852383e 100644 --- a/board/freescale/ls2080ardb/ls2080ardb.c +++ b/board/freescale/ls2080ardb/ls2080ardb.c @@ -314,7 +314,7 @@ int board_init(void) int board_early_init_f(void) { -#ifdef CONFIG_SYS_I2C_EARLY_INIT +#if defined(CONFIG_SYS_I2C_EARLY_INIT) i2c_early_init_f(); #endif fsl_lsch3_early_init_f(); diff --git a/board/freescale/lx2160a/lx2160a.c b/board/freescale/lx2160a/lx2160a.c index f505e82fb9..e61289d228 100644 --- a/board/freescale/lx2160a/lx2160a.c +++ b/board/freescale/lx2160a/lx2160a.c @@ -89,7 +89,7 @@ static void uart_get_clock(void) int board_early_init_f(void) { -#ifdef CONFIG_SYS_I2C_EARLY_INIT +#if defined(CONFIG_SYS_I2C_EARLY_INIT) && defined(CONFIG_SPL_BUILD) i2c_early_init_f(); #endif /* get required clock for UART IP */ diff --git a/board/freescale/mpc8349emds/mpc8349emds.c b/board/freescale/mpc8349emds/mpc8349emds.c index 5f38639afd..eff248104d 100644 --- a/board/freescale/mpc8349emds/mpc8349emds.c +++ b/board/freescale/mpc8349emds/mpc8349emds.c @@ -50,8 +50,6 @@ int board_early_init_f (void) return 0; } -#define ns2clk(ns) (ns / (1000000000 / CONFIG_8349_CLKIN) + 1) - int dram_init(void) { volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR; @@ -102,21 +100,6 @@ int fixed_sdram(void) #if (CONFIG_SYS_DDR_SIZE != 256) #warning Currenly any ddr size other than 256 is not supported #endif -#ifdef CONFIG_DDR_II - im->ddr.csbnds[2].csbnds = CONFIG_SYS_DDR_CS2_BNDS; - im->ddr.cs_config[2] = CONFIG_SYS_DDR_CS2_CONFIG; - im->ddr.timing_cfg_0 = CONFIG_SYS_DDR_TIMING_0; - im->ddr.timing_cfg_1 = CONFIG_SYS_DDR_TIMING_1; - im->ddr.timing_cfg_2 = CONFIG_SYS_DDR_TIMING_2; - im->ddr.timing_cfg_3 = CONFIG_SYS_DDR_TIMING_3; - im->ddr.sdram_cfg = CONFIG_SYS_DDR_SDRAM_CFG; - im->ddr.sdram_cfg2 = CONFIG_SYS_DDR_SDRAM_CFG2; - im->ddr.sdram_mode = CONFIG_SYS_DDR_MODE; - im->ddr.sdram_mode2 = CONFIG_SYS_DDR_MODE2; - im->ddr.sdram_interval = CONFIG_SYS_DDR_INTERVAL; - im->ddr.sdram_clk_cntl = CONFIG_SYS_DDR_CLK_CNTL; -#else - #if ((CONFIG_SYS_SDRAM_BASE & 0x00FFFFFF) != 0) #warning Chip select bounds is only configurable in 16MB increments #endif @@ -136,18 +119,10 @@ int fixed_sdram(void) im->ddr.sdram_cfg = SDRAM_CFG_SREN -#if defined(CONFIG_DDR_2T_TIMING) - | SDRAM_CFG_2T_EN -#endif | 2 << SDRAM_CFG_SDRAM_TYPE_SHIFT; -#if defined (CONFIG_DDR_32BIT) - /* for 32-bit mode burst length is 8 */ - im->ddr.sdram_cfg |= (SDRAM_CFG_32_BE | SDRAM_CFG_8_BE); -#endif im->ddr.sdram_mode = CONFIG_SYS_DDR_MODE; im->ddr.sdram_interval = CONFIG_SYS_DDR_INTERVAL; -#endif udelay(200); /* enable DDR controller */ diff --git a/board/freescale/mx51evk/Kconfig b/board/freescale/mx51evk/Kconfig index f9b69cbd66..a26b539536 100644 --- a/board/freescale/mx51evk/Kconfig +++ b/board/freescale/mx51evk/Kconfig @@ -12,4 +12,7 @@ config SYS_SOC config SYS_CONFIG_NAME default "mx51evk" +config IMX_CONFIG + default "board/freescale/mx51evk/imximage.cfg" + endif diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c index c8439a6347..46095acedf 100644 --- a/board/freescale/mx51evk/mx51evk.c +++ b/board/freescale/mx51evk/mx51evk.c @@ -35,6 +35,7 @@ int dram_init(void) return 0; } +#ifdef CONFIG_REVISION_TAG u32 get_board_rev(void) { u32 rev = get_cpu_rev(); @@ -42,6 +43,7 @@ u32 get_board_rev(void) rev |= BOARD_REV_2_0 << BOARD_VER_OFFSET; return rev; } +#endif #define UART_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_PUS_100K_DOWN | PAD_CTL_DSE_HIGH) diff --git a/board/freescale/mx53loco/Kconfig b/board/freescale/mx53loco/Kconfig index 5ca1672bf7..a690a601ac 100644 --- a/board/freescale/mx53loco/Kconfig +++ b/board/freescale/mx53loco/Kconfig @@ -12,4 +12,7 @@ config SYS_SOC config SYS_CONFIG_NAME default "mx53loco" +config IMX_CONFIG + default "board/freescale/mx53loco/imximage.cfg" + endif diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c index 0888630569..a9800ed769 100644 --- a/board/freescale/mx53loco/mx53loco.c +++ b/board/freescale/mx53loco/mx53loco.c @@ -32,6 +32,7 @@ DECLARE_GLOBAL_DATA_PTR; +#ifdef CONFIG_REVISION_TAG u32 get_board_rev(void) { struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE; @@ -46,6 +47,7 @@ u32 get_board_rev(void) return (get_cpu_rev() & ~(0xF << 8)) | (rev & 0xF) << 8; } +#endif #define UART_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_DSE_HIGH | \ PAD_CTL_PUS_100K_UP | PAD_CTL_ODE) diff --git a/board/freescale/mx6memcal/Kconfig b/board/freescale/mx6memcal/Kconfig index 9987cba5dc..2d5c206ae4 100644 --- a/board/freescale/mx6memcal/Kconfig +++ b/board/freescale/mx6memcal/Kconfig @@ -87,12 +87,12 @@ choice help Select the type of DDR (DDR3 or LPDDR2) used on your design -config DDR3 +config DDR3 bool "DDR3" help Select this if your board design uses DDR3. -config LPDDR2 +config LPDDR2 bool "LPDDR2" help Select this if your board design uses LPDDR2. @@ -223,5 +223,8 @@ config REFR details. endmenu -endif +config IMX_CONFIG + default "arch/arm/mach-imx/spl_sd.cfg" + +endif diff --git a/board/freescale/mx6sabreauto/mx6sabreauto.c b/board/freescale/mx6sabreauto/mx6sabreauto.c index e92ef26d0a..9155dcfbd0 100644 --- a/board/freescale/mx6sabreauto/mx6sabreauto.c +++ b/board/freescale/mx6sabreauto/mx6sabreauto.c @@ -321,12 +321,14 @@ static void setup_gpmi_nand(void) } #endif +#ifdef CONFIG_REVISION_TAG u32 get_board_rev(void) { int rev = nxp_board_rev(); return (get_cpu_rev() & ~(0xF << 8)) | rev; } +#endif static int ar8031_phy_fixup(struct phy_device *phydev) { diff --git a/board/freescale/mx6slevk/Kconfig b/board/freescale/mx6slevk/Kconfig index 18482b551e..e6bbb4194f 100644 --- a/board/freescale/mx6slevk/Kconfig +++ b/board/freescale/mx6slevk/Kconfig @@ -9,4 +9,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "mx6slevk" +config IMX_CONFIG + default "board/freescale/mx6slevk/imximage.cfg" + endif diff --git a/board/freescale/mx6sllevk/Kconfig b/board/freescale/mx6sllevk/Kconfig index 4ba9bbf141..d47f1fa909 100644 --- a/board/freescale/mx6sllevk/Kconfig +++ b/board/freescale/mx6sllevk/Kconfig @@ -9,4 +9,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "mx6sllevk" +config IMX_CONFIG + default "board/freescale/mx6sllevk/imximage.cfg" + endif diff --git a/board/freescale/mx6sxsabreauto/Kconfig b/board/freescale/mx6sxsabreauto/Kconfig index ae2ea02439..e6da7b38f9 100644 --- a/board/freescale/mx6sxsabreauto/Kconfig +++ b/board/freescale/mx6sxsabreauto/Kconfig @@ -9,4 +9,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "mx6sxsabreauto" +config IMX_CONFIG + default "board/freescale/mx6sxsabreauto/imximage.cfg" + endif diff --git a/board/freescale/mx6sxsabresd/Kconfig b/board/freescale/mx6sxsabresd/Kconfig index fcfac0aae4..88ac7ee805 100644 --- a/board/freescale/mx6sxsabresd/Kconfig +++ b/board/freescale/mx6sxsabresd/Kconfig @@ -9,4 +9,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "mx6sxsabresd" +config IMX_CONFIG + default "board/freescale/mx6sxsabresd/imximage.cfg" + endif diff --git a/board/freescale/mx6ullevk/Kconfig b/board/freescale/mx6ullevk/Kconfig index 7eec497e3e..49aa302553 100644 --- a/board/freescale/mx6ullevk/Kconfig +++ b/board/freescale/mx6ullevk/Kconfig @@ -9,4 +9,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "mx6ullevk" +config IMX_CONFIG + default "board/freescale/mx6ullevk/imximage.cfg" + endif diff --git a/board/freescale/mx7dsabresd/Kconfig b/board/freescale/mx7dsabresd/Kconfig index c6a969ca67..bf3ceafe2b 100644 --- a/board/freescale/mx7dsabresd/Kconfig +++ b/board/freescale/mx7dsabresd/Kconfig @@ -9,4 +9,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "mx7dsabresd" +config IMX_CONFIG + default "board/freescale/mx7dsabresd/imximage.cfg" + endif diff --git a/board/freescale/mx7ulp_evk/Kconfig b/board/freescale/mx7ulp_evk/Kconfig index ff448311f9..591697041d 100644 --- a/board/freescale/mx7ulp_evk/Kconfig +++ b/board/freescale/mx7ulp_evk/Kconfig @@ -9,4 +9,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "mx7ulp_evk" +config IMX_CONFIG + default "board/freescale/mx7ulp_evk/imximage.cfg" + endif diff --git a/board/freescale/p1010rdb/p1010rdb.c b/board/freescale/p1010rdb/p1010rdb.c index 84fc891b67..c796330f19 100644 --- a/board/freescale/p1010rdb/p1010rdb.c +++ b/board/freescale/p1010rdb/p1010rdb.c @@ -427,7 +427,7 @@ int checkboard(void) dm_i2c_write(dev, 2, &val, 1); #else i2c_set_bus_num(I2C_PCA9557_BUS_NUM); - i2c_init(CONFIG_SYS_FSL_I2C_SPEED, CONFIG_SYS_FSL_I2C_SLAVE); + i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); val = 0x0; /* no polarity inversion */ i2c_write(I2C_PCA9557_ADDR2, 2, 1, &val, 1); #endif diff --git a/board/freescale/p1_p2_rdb_pc/spl.c b/board/freescale/p1_p2_rdb_pc/spl.c index 90188b099a..118468408e 100644 --- a/board/freescale/p1_p2_rdb_pc/spl.c +++ b/board/freescale/p1_p2_rdb_pc/spl.c @@ -99,7 +99,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) env_relocate(); #endif -#ifdef CONFIG_SYS_I2C_LEGACY +#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) i2c_init_all(); #else i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); diff --git a/board/freescale/t102xrdb/spl.c b/board/freescale/t102xrdb/spl.c index 71566851d0..ac373d7724 100644 --- a/board/freescale/t102xrdb/spl.c +++ b/board/freescale/t102xrdb/spl.c @@ -30,11 +30,6 @@ unsigned long get_board_sys_clk(void) return CONFIG_SYS_CLK_FREQ; } -unsigned long get_board_ddr_clk(void) -{ - return CONFIG_DDR_CLK_FREQ; -} - #if defined(CONFIG_SPL_MMC_BOOT) #define GPIO1_SD_SEL 0x00020000 int board_mmc_getcd(struct mmc *mmc) diff --git a/board/freescale/t102xrdb/t102xrdb.c b/board/freescale/t102xrdb/t102xrdb.c index 51a36abe36..ab7675e209 100644 --- a/board/freescale/t102xrdb/t102xrdb.c +++ b/board/freescale/t102xrdb/t102xrdb.c @@ -167,11 +167,6 @@ unsigned long get_board_sys_clk(void) return CONFIG_SYS_CLK_FREQ; } -unsigned long get_board_ddr_clk(void) -{ - return CONFIG_DDR_CLK_FREQ; -} - #ifdef CONFIG_TARGET_T1024RDB void board_reset(void) { diff --git a/board/freescale/t104xrdb/spl.c b/board/freescale/t104xrdb/spl.c index f5fe73e62d..c7df11100e 100644 --- a/board/freescale/t104xrdb/spl.c +++ b/board/freescale/t104xrdb/spl.c @@ -30,11 +30,6 @@ unsigned long get_board_sys_clk(void) return CONFIG_SYS_CLK_FREQ; } -unsigned long get_board_ddr_clk(void) -{ - return CONFIG_DDR_CLK_FREQ; -} - #define FSL_CORENET_CCSR_PORSR1_RCW_MASK 0xFF800000 void board_init_f(ulong bootflag) { diff --git a/board/freescale/t208xrdb/Kconfig b/board/freescale/t208xrdb/Kconfig index 8249c5df96..d4c061a5ea 100644 --- a/board/freescale/t208xrdb/Kconfig +++ b/board/freescale/t208xrdb/Kconfig @@ -11,7 +11,6 @@ config SYS_CONFIG_NAME config T2080RDB_REV_D bool "Support for T2080RDB revisions D and up" - default n source "board/freescale/common/Kconfig" diff --git a/board/freescale/t208xrdb/spl.c b/board/freescale/t208xrdb/spl.c index b0ce9af000..2204a98ac8 100644 --- a/board/freescale/t208xrdb/spl.c +++ b/board/freescale/t208xrdb/spl.c @@ -29,11 +29,6 @@ unsigned long get_board_sys_clk(void) return CONFIG_SYS_CLK_FREQ; } -unsigned long get_board_ddr_clk(void) -{ - return CONFIG_DDR_CLK_FREQ; -} - void board_init_f(ulong bootflag) { u32 plat_ratio, sys_clk, ccb_clk; diff --git a/board/freescale/t208xrdb/t208xrdb.c b/board/freescale/t208xrdb/t208xrdb.c index 73ebb4a55b..3611dbbf32 100644 --- a/board/freescale/t208xrdb/t208xrdb.c +++ b/board/freescale/t208xrdb/t208xrdb.c @@ -114,11 +114,6 @@ unsigned long get_board_sys_clk(void) return CONFIG_SYS_CLK_FREQ; } -unsigned long get_board_ddr_clk(void) -{ - return CONFIG_DDR_CLK_FREQ; -} - int misc_init_r(void) { u8 reg; diff --git a/board/freescale/t4rdb/spl.c b/board/freescale/t4rdb/spl.c index e2f9c9b3de..69d1449b07 100644 --- a/board/freescale/t4rdb/spl.c +++ b/board/freescale/t4rdb/spl.c @@ -35,11 +35,6 @@ unsigned long get_board_sys_clk(void) return CONFIG_SYS_CLK_FREQ; } -unsigned long get_board_ddr_clk(void) -{ - return CONFIG_DDR_CLK_FREQ; -} - void board_init_f(ulong bootflag) { u32 plat_ratio, sys_clk, ccb_clk; diff --git a/board/freescale/vf610twr/Kconfig b/board/freescale/vf610twr/Kconfig index 3b90ed67fe..208c7ae2f4 100644 --- a/board/freescale/vf610twr/Kconfig +++ b/board/freescale/vf610twr/Kconfig @@ -9,4 +9,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "vf610twr" +config IMX_CONFIG + default "board/freescale/vf610twr/imximage.cfg" + endif diff --git a/board/friendlyarm/nanopi2/board.c b/board/friendlyarm/nanopi2/board.c index c0fe2d546f..70e4dfcfa4 100644 --- a/board/friendlyarm/nanopi2/board.c +++ b/board/friendlyarm/nanopi2/board.c @@ -295,12 +295,12 @@ static void set_ether_addr(void) env_set("ethaddr", ethaddr); } -#ifdef CONFIG_REVISION_TAG +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG static void set_board_rev(void) { char info[64] = {0, }; - snprintf(info, ARRAY_SIZE(info), "%02x", get_board_rev()); + snprintf(info, ARRAY_SIZE(info), "%02x", get_board_revision()); env_set("board_rev", info); } #endif @@ -310,7 +310,7 @@ static void set_dtb_name(void) char info[64] = {0, }; snprintf(info, ARRAY_SIZE(info), - "s5p4418-nanopi2-rev%02x.dtb", get_board_rev()); + "s5p4418-nanopi2-rev%02x.dtb", get_board_revision()); env_set("dtb_name", info); } @@ -436,7 +436,7 @@ int board_late_init(void) { bd_update_env(); -#ifdef CONFIG_REVISION_TAG +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG set_board_rev(); #endif set_dtb_name(); diff --git a/board/friendlyarm/nanopi2/hwrev.c b/board/friendlyarm/nanopi2/hwrev.c index b1e23a48a8..585e08c944 100644 --- a/board/friendlyarm/nanopi2/hwrev.c +++ b/board/friendlyarm/nanopi2/hwrev.c @@ -80,11 +80,18 @@ void bd_base_rev_init(void) } /* To override __weak symbols */ -u32 get_board_rev(void) +u32 get_board_revision(void) { return (base_rev << 8) | pcb_rev; } +#ifdef CONFIG_REVISION_TAG +u32 get_board_rev(void) +{ + return get_board_revision(); +} +#endif + const char *get_board_name(void) { bd_hwrev_init(); diff --git a/board/friendlyarm/nanopi2/hwrev.h b/board/friendlyarm/nanopi2/hwrev.h index 1b1a828afb..403303131e 100644 --- a/board/friendlyarm/nanopi2/hwrev.h +++ b/board/friendlyarm/nanopi2/hwrev.h @@ -9,7 +9,7 @@ extern void bd_hwrev_init(void); extern void bd_base_rev_init(void); -extern u32 get_board_rev(void); +extern u32 get_board_revision(void); extern const char *get_board_name(void); #endif /* __BD_HW_REV_H__ */ diff --git a/board/gateworks/venice/Kconfig b/board/gateworks/venice/Kconfig index 64cb97c1e0..639bf35d20 100644 --- a/board/gateworks/venice/Kconfig +++ b/board/gateworks/venice/Kconfig @@ -9,4 +9,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "imx8mm_venice" +config IMX_CONFIG + default "arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg" + endif diff --git a/board/ge/b1x5v2/b1x5v2.c b/board/ge/b1x5v2/b1x5v2.c index de4cb0d5af..a2cbd1512e 100644 --- a/board/ge/b1x5v2/b1x5v2.c +++ b/board/ge/b1x5v2/b1x5v2.c @@ -30,7 +30,7 @@ #include <panel.h> #include <rtc.h> #include <spi_flash.h> -#include <version.h> +#include <version_string.h> #include "../common/vpd_reader.h" diff --git a/board/ge/bx50v3/bx50v3.c b/board/ge/bx50v3/bx50v3.c index 7fcebba026..ed700f4e1d 100644 --- a/board/ge/bx50v3/bx50v3.c +++ b/board/ge/bx50v3/bx50v3.c @@ -34,7 +34,7 @@ #include <power/pmic.h> #include <input.h> #include <pwm.h> -#include <version.h> +#include <version_string.h> #include <stdlib.h> #include <dm/root.h> #include "../common/ge_rtc.h" diff --git a/board/ge/mx53ppd/Kconfig b/board/ge/mx53ppd/Kconfig index bebb2fab01..728e9a9921 100644 --- a/board/ge/mx53ppd/Kconfig +++ b/board/ge/mx53ppd/Kconfig @@ -1,4 +1,3 @@ - if TARGET_MX53PPD config SYS_BOARD @@ -13,6 +12,9 @@ config SYS_SOC config SYS_CONFIG_NAME default "mx53ppd" +config IMX_CONFIG + default "board/ge/mx53ppd/imximage.cfg" + source "board/ge/common/Kconfig" endif diff --git a/board/ge/mx53ppd/mx53ppd.c b/board/ge/mx53ppd/mx53ppd.c index 6174125e72..cc462d53da 100644 --- a/board/ge/mx53ppd/mx53ppd.c +++ b/board/ge/mx53ppd/mx53ppd.c @@ -33,7 +33,7 @@ #include <fsl_pmic.h> #include <linux/fb.h> #include <ipu_pixfmt.h> -#include <version.h> +#include <version_string.h> #include <watchdog.h> #include "ppd_gpio.h" #include <stdlib.h> @@ -81,10 +81,12 @@ int dram_init_banksize(void) return 0; } +#ifdef CONFIG_REVISION_TAG u32 get_board_rev(void) { return get_cpu_rev() & ~(0xF << 8); } +#endif #ifdef CONFIG_USB_EHCI_MX5 int board_ehci_hcd_init(int port) diff --git a/board/google/imx8mq_phanbell/Kconfig b/board/google/imx8mq_phanbell/Kconfig index fba2e9ce67..54cfb99952 100644 --- a/board/google/imx8mq_phanbell/Kconfig +++ b/board/google/imx8mq_phanbell/Kconfig @@ -9,4 +9,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "imx8mq_phanbell" +config IMX_CONFIG + default "arch/arm/mach-imx/imx8m/imximage.cfg" + endif diff --git a/board/grinn/chiliboard/board.c b/board/grinn/chiliboard/board.c index 12480f5729..6423c1efb2 100644 --- a/board/grinn/chiliboard/board.c +++ b/board/grinn/chiliboard/board.c @@ -30,7 +30,7 @@ DECLARE_GLOBAL_DATA_PTR; static __maybe_unused struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE; -#ifndef CONFIG_SKIP_LOWLEVEL_INIT +#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT) static struct module_pin_mux uart0_pin_mux[] = { {OFFSET(uart0_rxd), (MODE(0) | PULLUP_EN | RXACTIVE)}, /* UART0_RXD */ {OFFSET(uart0_txd), (MODE(0) | PULLUDEN)}, /* UART0_TXD */ @@ -69,9 +69,7 @@ static void enable_board_pin_mux(void) configure_module_pin_mux(rmii1_pin_mux); configure_module_pin_mux(mmc0_pin_mux); } -#endif /* CONFIG_SKIP_LOWLEVEL_INIT */ -#ifndef CONFIG_SKIP_LOWLEVEL_INIT void set_uart_mux_conf(void) { configure_module_pin_mux(uart0_pin_mux); @@ -86,7 +84,7 @@ void am33xx_spl_board_init(void) { chilisom_spl_board_init(); } -#endif +#endif /* CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT) */ /* * Basic board specific setup. Pinmux has been handled already. diff --git a/board/imgtec/ci20/ci20.c b/board/imgtec/ci20/ci20.c index 7ee175d40a..7cbe49abd9 100644 --- a/board/imgtec/ci20/ci20.c +++ b/board/imgtec/ci20/ci20.c @@ -254,7 +254,7 @@ int checkboard(void) #ifdef CONFIG_SPL_BUILD -#if defined(CONFIG_SPL_MMC_SUPPORT) +#if defined(CONFIG_SPL_MMC) int board_mmc_init(struct bd_info *bd) { ci20_mux_mmc(); diff --git a/board/inversepath/usbarmory/usbarmory.c b/board/inversepath/usbarmory/usbarmory.c index 086d0522c7..7dbb3a9143 100644 --- a/board/inversepath/usbarmory/usbarmory.c +++ b/board/inversepath/usbarmory/usbarmory.c @@ -27,6 +27,7 @@ DECLARE_GLOBAL_DATA_PTR; +#ifdef CONFIG_REVISION_TAG u32 get_board_rev(void) { struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE; @@ -38,6 +39,7 @@ u32 get_board_rev(void) return (get_cpu_rev() & ~(0xF << 8)) | (rev & 0xF) << 8; } +#endif struct fsl_esdhc_cfg esdhc_cfg[1] = { {MMC_SDHC1_BASE_ADDR} diff --git a/board/k+p/kp_imx53/Kconfig b/board/k+p/kp_imx53/Kconfig index 017c1e30d8..fb35127696 100644 --- a/board/k+p/kp_imx53/Kconfig +++ b/board/k+p/kp_imx53/Kconfig @@ -12,4 +12,7 @@ config SYS_SOC config SYS_CONFIG_NAME default "kp_imx53" +config IMX_CONFIG + default "board/freescale/mx53loco/imximage.cfg" + endif diff --git a/board/k+p/kp_imx53/kp_id_rev.c b/board/k+p/kp_imx53/kp_id_rev.c index 7103a3e0f2..9f93cf008c 100644 --- a/board/k+p/kp_imx53/kp_id_rev.c +++ b/board/k+p/kp_imx53/kp_id_rev.c @@ -64,6 +64,10 @@ void show_eeprom(void) eth_env_set_enetaddr("ethaddr", p); } +#define I2C_EEPROM_BUS_NUM 1 +#define I2C_EEPROM_ADDR 0x50 +#define I2C_EEPROM_ADDR_LEN 2 + int read_eeprom(void) { struct udevice *dev; @@ -72,9 +76,8 @@ int read_eeprom(void) if (eeprom_has_been_read) return 0; - ret = i2c_get_chip_for_busnum(CONFIG_SYS_EEPROM_BUS_NUM, - CONFIG_SYS_I2C_EEPROM_ADDR, - CONFIG_SYS_I2C_EEPROM_ADDR_LEN, &dev); + ret = i2c_get_chip_for_busnum(I2C_EEPROM_BUS_NUM, I2C_EEPROM_ADDR, + I2C_EEPROM_ADDR_LEN, &dev); if (ret) { printf("Cannot find EEPROM !\n"); return ret; diff --git a/board/keymile/common/ivm.c b/board/keymile/common/ivm.c index 14c70b9ad0..ff550f7fe7 100644 --- a/board/keymile/common/ivm.c +++ b/board/keymile/common/ivm.c @@ -346,17 +346,17 @@ int ivm_read_eeprom(unsigned char *buf, int len, int mac_address_offset) struct udevice *eedev = NULL; ret = i2c_get_chip_for_busnum(CONFIG_KM_IVM_BUS, - CONFIG_SYS_I2C_EEPROM_ADDR, 1, &eedev); + CONFIG_SYS_IVM_EEPROM_ADR, 1, &eedev); if (ret) { printf("failed to get device for EEPROM at address 0x%02x\n", - CONFIG_SYS_I2C_EEPROM_ADDR); + CONFIG_SYS_IVM_EEPROM_ADR); return 1; } ret = dm_i2c_read(eedev, 0, buf, len); if (ret != 0) { printf("Error: Unable to read from I2C EEPROM at address %02X:%02X\n", - CONFIG_SYS_I2C_EEPROM_ADDR, 0); + CONFIG_SYS_IVM_EEPROM_ADR, 0); return 1; } #else diff --git a/board/keymile/km83xx/km83xx_i2c.c b/board/keymile/km83xx/km83xx_i2c.c index 62100b1949..b80672d1b4 100644 --- a/board/keymile/km83xx/km83xx_i2c.c +++ b/board/keymile/km83xx/km83xx_i2c.c @@ -15,7 +15,7 @@ static void i2c_write_start_seq(void) { struct fsl_i2c_base *base; base = (struct fsl_i2c_base *)(CONFIG_SYS_IMMR + - CONFIG_SYS_I2C_OFFSET); + CONFIG_SYS_FSL_I2C_OFFSET); udelay(DELAY_ABORT_SEQ); out_8(&base->cr, (I2C_CR_MEN | I2C_CR_MSTA)); udelay(DELAY_ABORT_SEQ); @@ -26,7 +26,7 @@ int i2c_make_abort(void) { struct fsl_i2c_base *base; base = (struct fsl_i2c_base *)(CONFIG_SYS_IMMR + - CONFIG_SYS_I2C_OFFSET); + CONFIG_SYS_FSL_I2C_OFFSET); uchar last; int nbr_read = 0; int i = 0; diff --git a/board/keymile/km_arm/Kconfig b/board/keymile/km_arm/Kconfig index 6f55cfab86..c52b365b17 100644 --- a/board/keymile/km_arm/Kconfig +++ b/board/keymile/km_arm/Kconfig @@ -3,37 +3,31 @@ menu "KM ARM Options" config KM_FPGA_CONFIG bool "FPGA Configuration" - default n help Include capability to change FPGA configuration. config KM_FPGA_FORCE_CONFIG bool "FPGA reconfiguration" - default n help If yes we force to reconfigure the FPGA always config KM_FPGA_NO_RESET bool "FPGA skip reset" - default n help If yes we skip triggering a reset of the FPGA config KM_ENV_IS_IN_SPI_NOR bool "Environment in SPI NOR" - default n help Put the U-Boot environment in the SPI NOR flash. config KM_PIGGY4_88E6061 bool "Piggy via Switch 88E6061" - default n help The Piggy4 board is connected via a Marvell 88E6061 switch. config KM_PIGGY4_88E6352 bool "Piggy via Switch 88E6352" - default n help The Piggy4 board is connected via a Marvell 88E6352 switch. diff --git a/board/l+g/vinco/vinco.c b/board/l+g/vinco/vinco.c index f221f05261..9c4c5fdc4a 100644 --- a/board/l+g/vinco/vinco.c +++ b/board/l+g/vinco/vinco.c @@ -30,7 +30,6 @@ #include <netdev.h> #include <nand.h> #include <spi.h> -#include <version.h> DECLARE_GLOBAL_DATA_PTR; diff --git a/board/lg/sniper/sniper.c b/board/lg/sniper/sniper.c index a70166a542..86032d7fcd 100644 --- a/board/lg/sniper/sniper.c +++ b/board/lg/sniper/sniper.c @@ -156,11 +156,13 @@ int misc_init_r(void) return 0; } +#ifdef CONFIG_REVISION_TAG u32 get_board_rev(void) { /* Sold devices are expected to be at least revision F. */ return 6; } +#endif void get_board_serial(struct tag_serialnr *serialnr) { diff --git a/board/liebherr/display5/spl.c b/board/liebherr/display5/spl.c index 39f70f578e..d5fe336d22 100644 --- a/board/liebherr/display5/spl.c +++ b/board/liebherr/display5/spl.c @@ -273,7 +273,7 @@ static void spl_dram_init(void) #endif } -#ifdef CONFIG_SPL_SPI_SUPPORT +#ifdef CONFIG_SPL_SPI static void displ5_init_ecspi(void) { displ5_set_iomux_ecspi_spl(); @@ -283,7 +283,7 @@ static void displ5_init_ecspi(void) static inline void displ5_init_ecspi(void) { } #endif -#ifdef CONFIG_SPL_MMC_SUPPORT +#ifdef CONFIG_SPL_MMC static struct fsl_esdhc_cfg usdhc_cfg = { .esdhc_base = USDHC4_BASE_ADDR, .max_bus_width = 8, diff --git a/board/mediatek/mt7620/Kconfig b/board/mediatek/mt7620/Kconfig deleted file mode 100644 index b9137adcc9..0000000000 --- a/board/mediatek/mt7620/Kconfig +++ /dev/null @@ -1,12 +0,0 @@ -if BOARD_MT7620_RFB || BOARD_MT7620_MT7530_RFB - -config SYS_BOARD - default "mt7620" - -config SYS_VENDOR - default "mediatek" - -config SYS_CONFIG_NAME - default "mt7620" - -endif diff --git a/board/mediatek/mt7622/Kconfig b/board/mediatek/mt7622/Kconfig deleted file mode 100644 index d0abdc0a67..0000000000 --- a/board/mediatek/mt7622/Kconfig +++ /dev/null @@ -1,17 +0,0 @@ -if TARGET_MT7622 - -config SYS_BOARD - default "mt7622" - -config SYS_CONFIG_NAME - default "mt7622" - -config MTK_BROM_HEADER_INFO - string - default "lk=1" - -config MTK_BROM_HEADER_INFO - string - default "media=nor" - -endif diff --git a/board/mediatek/mt7623/Kconfig b/board/mediatek/mt7623/Kconfig deleted file mode 100644 index a8c670e71f..0000000000 --- a/board/mediatek/mt7623/Kconfig +++ /dev/null @@ -1,13 +0,0 @@ -if TARGET_MT7623 - -config SYS_BOARD - default "mt7623" - -config SYS_CONFIG_NAME - default "mt7623" - -config MTK_BROM_HEADER_INFO - string - default "lk=1" - -endif diff --git a/board/mediatek/mt7628/Kconfig b/board/mediatek/mt7628/Kconfig deleted file mode 100644 index d6b6f9d632..0000000000 --- a/board/mediatek/mt7628/Kconfig +++ /dev/null @@ -1,12 +0,0 @@ -if BOARD_MT7628_RFB - -config SYS_BOARD - default "mt7628" - -config SYS_VENDOR - default "mediatek" - -config SYS_CONFIG_NAME - default "mt7628" - -endif diff --git a/board/mediatek/mt7629/Kconfig b/board/mediatek/mt7629/Kconfig deleted file mode 100644 index 6055164b52..0000000000 --- a/board/mediatek/mt7629/Kconfig +++ /dev/null @@ -1,17 +0,0 @@ -if TARGET_MT7629 - -config SYS_BOARD - default "mt7629" - -config SYS_CONFIG_NAME - default "mt7629" - -config MTK_SPL_PAD_SIZE - hex - default 0x10000 - -config MTK_BROM_HEADER_INFO - string - default "media=nor" - -endif diff --git a/board/mediatek/mt8183/Kconfig b/board/mediatek/mt8183/Kconfig deleted file mode 100644 index b75c3b8d80..0000000000 --- a/board/mediatek/mt8183/Kconfig +++ /dev/null @@ -1,13 +0,0 @@ -if TARGET_MT8183 - -config SYS_BOARD - default "mt8183" - -config SYS_CONFIG_NAME - default "mt8183" - -config MTK_BROM_HEADER_INFO - string - default "media=emmc" - -endif diff --git a/board/mediatek/mt8512/Kconfig b/board/mediatek/mt8512/Kconfig deleted file mode 100644 index 87bd1fbe69..0000000000 --- a/board/mediatek/mt8512/Kconfig +++ /dev/null @@ -1,14 +0,0 @@ -if TARGET_MT8512 - -config SYS_BOARD - default "mt8512" - -config SYS_CONFIG_NAME - default "mt8512" - - -config MTK_BROM_HEADER_INFO - string - default "media=nor" - -endif diff --git a/board/mediatek/mt8516/Kconfig b/board/mediatek/mt8516/Kconfig deleted file mode 100644 index a87d3872fe..0000000000 --- a/board/mediatek/mt8516/Kconfig +++ /dev/null @@ -1,13 +0,0 @@ -if TARGET_MT8516 - -config SYS_BOARD - default "mt8516" - -config SYS_CONFIG_NAME - default "mt8516" - -config MTK_BROM_HEADER_INFO - string - default "media=emmc" - -endif diff --git a/board/mediatek/mt8518/Kconfig b/board/mediatek/mt8518/Kconfig deleted file mode 100644 index 1971c4d8c3..0000000000 --- a/board/mediatek/mt8518/Kconfig +++ /dev/null @@ -1,14 +0,0 @@ -if TARGET_MT8518 - -config SYS_BOARD - default "mt8518" - -config SYS_CONFIG_NAME - default "mt8518" - - -config MTK_BROM_HEADER_INFO - string - default "media=nor" - -endif diff --git a/board/menlo/m53menlo/Kconfig b/board/menlo/m53menlo/Kconfig index 1953f5041b..34c92f4521 100644 --- a/board/menlo/m53menlo/Kconfig +++ b/board/menlo/m53menlo/Kconfig @@ -12,4 +12,7 @@ config SYS_SOC config SYS_CONFIG_NAME default "m53menlo" +config IMX_CONFIG + default "board/menlo/m53menlo/imximage.cfg" + endif diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c index fd3cec8358..99ca36fbbe 100644 --- a/board/nokia/rx51/rx51.c +++ b/board/nokia/rx51/rx51.c @@ -241,6 +241,7 @@ int board_init(void) return 0; } +#ifdef CONFIG_REVISION_TAG /* * Routine: get_board_revision * Description: Return board revision. @@ -249,6 +250,7 @@ u32 get_board_rev(void) { return simple_strtol(hw_build_ptr, NULL, 16); } +#endif /* * Routine: setup_board_tags diff --git a/board/novtech/meerkat96/Kconfig b/board/novtech/meerkat96/Kconfig index b0e46fcc1b..23b0ba3230 100644 --- a/board/novtech/meerkat96/Kconfig +++ b/board/novtech/meerkat96/Kconfig @@ -9,4 +9,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "meerkat96" +config IMX_CONFIG + default "board/novtech/meerkat96/imximage.cfg" + endif diff --git a/board/nvidia/seaboard/seaboard.c b/board/nvidia/seaboard/seaboard.c index b88aa8e964..829751112f 100644 --- a/board/nvidia/seaboard/seaboard.c +++ b/board/nvidia/seaboard/seaboard.c @@ -16,7 +16,7 @@ #include <asm/gpio.h> /* TODO: Remove this code when the SPI switch is working */ -#if (CONFIG_MACH_TYPE != MACH_TYPE_VENTANA) +#ifndef CONFIG_TARGET_VENTANA void gpio_early_init_uart(void) { /* Enable UART via GPIO_PI3 (port 8, bit 3) so serial console works */ diff --git a/board/phytec/pcm052/Kconfig b/board/phytec/pcm052/Kconfig index 4fde21c586..23f2565f9f 100644 --- a/board/phytec/pcm052/Kconfig +++ b/board/phytec/pcm052/Kconfig @@ -13,6 +13,9 @@ config PCM052_DDR_SIZE int default 256 +config IMX_CONFIG + default "board/phytec/pcm052/imximage.cfg" + endif if TARGET_BK4R1 @@ -30,4 +33,7 @@ config PCM052_DDR_SIZE int default 512 +config IMX_CONFIG + default "board/phytec/pcm052/imximage.cfg" + endif diff --git a/board/phytec/phycore_imx8mm/Kconfig b/board/phytec/phycore_imx8mm/Kconfig index 92f5524bdb..9868e98487 100644 --- a/board/phytec/phycore_imx8mm/Kconfig +++ b/board/phytec/phycore_imx8mm/Kconfig @@ -9,4 +9,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "phycore_imx8mm" +config IMX_CONFIG + default "arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg" + endif diff --git a/board/phytec/phycore_imx8mp/Kconfig b/board/phytec/phycore_imx8mp/Kconfig index 7a20d6e8fe..c053a46fc9 100644 --- a/board/phytec/phycore_imx8mp/Kconfig +++ b/board/phytec/phycore_imx8mp/Kconfig @@ -9,4 +9,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "phycore_imx8mp" +config IMX_CONFIG + default "board/phytec/phycore_imx8mp/imximage-8mp-sd.cfg" + endif diff --git a/board/qca/ap152/ap152.c b/board/qca/ap152/ap152.c index 1064705d26..82458c3af4 100644 --- a/board/qca/ap152/ap152.c +++ b/board/qca/ap152/ap152.c @@ -66,7 +66,7 @@ int board_early_init_f(void) void __iomem *rst_regs = map_physmem(AR71XX_RESET_BASE, AR71XX_RESET_SIZE, MAP_NOCACHE); -#ifndef CONFIG_SKIP_LOWLEVEL_INIT +#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT) /* CPU:775, DDR:650, AHB:258 */ qca956x_pll_init(); qca956x_ddr_init(); diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index 372b26b6f2..0c7d58d18d 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -419,7 +419,7 @@ int misc_init_r(void) return 0; } -static void get_board_rev(void) +static void get_board_revision(void) { ALLOC_CACHE_ALIGN_BUFFER(struct msg_get_board_rev, msg, 1); int ret; @@ -478,7 +478,7 @@ int board_init(void) hw_watchdog_init(); #endif - get_board_rev(); + get_board_revision(); gd->bd->bi_boot_params = 0x100; diff --git a/board/renesas/draak/draak.c b/board/renesas/draak/draak.c index 3d00652a8d..71efeaf313 100644 --- a/board/renesas/draak/draak.c +++ b/board/renesas/draak/draak.c @@ -38,7 +38,7 @@ DECLARE_GLOBAL_DATA_PTR; int board_early_init_f(void) { -#if defined(CONFIG_SYS_I2C_LEGACY) && defined(CONFIG_SYS_I2C_SH) +#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) && defined(CONFIG_SYS_I2C_SH) /* DVFS for reset */ mstp_clrbits_le32(SMSTPCR9, SMSTPCR9, DVFS_MSTP926); #endif diff --git a/board/renesas/grpeach/lowlevel_init.S b/board/renesas/grpeach/lowlevel_init.S index 9a66dfa6c6..b83c4e8686 100644 --- a/board/renesas/grpeach/lowlevel_init.S +++ b/board/renesas/grpeach/lowlevel_init.S @@ -4,7 +4,6 @@ * Copyright (C) 2017 Chris Brandt */ #include <config.h> -#include <version.h> #include <asm/macro.h> /* Watchdog Registers */ diff --git a/board/renesas/salvator-x/salvator-x.c b/board/renesas/salvator-x/salvator-x.c index d4752e5798..c27eb3f17d 100644 --- a/board/renesas/salvator-x/salvator-x.c +++ b/board/renesas/salvator-x/salvator-x.c @@ -37,7 +37,7 @@ DECLARE_GLOBAL_DATA_PTR; int board_early_init_f(void) { -#if defined(CONFIG_SYS_I2C_LEGACY) && defined(CONFIG_SYS_I2C_SH) +#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) && defined(CONFIG_SYS_I2C_SH) /* DVFS for reset */ mstp_clrbits_le32(SMSTPCR9, SMSTPCR9, DVFS_MSTP926); #endif @@ -75,7 +75,7 @@ int board_init(void) void reset_cpu(void) { -#if defined(CONFIG_SYS_I2C_LEGACY) && defined(CONFIG_SYS_I2C_SH) +#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) && defined(CONFIG_SYS_I2C_SH) i2c_reg_write(CONFIG_SYS_I2C_POWERIC_ADDR, 0x20, 0x80); #else /* only CA57 ? */ diff --git a/board/renesas/ulcb/ulcb.c b/board/renesas/ulcb/ulcb.c index 4626d223b0..1477750f92 100644 --- a/board/renesas/ulcb/ulcb.c +++ b/board/renesas/ulcb/ulcb.c @@ -35,7 +35,7 @@ DECLARE_GLOBAL_DATA_PTR; int board_early_init_f(void) { -#if defined(CONFIG_SYS_I2C_LEGACY) && defined(CONFIG_SYS_I2C_SH) +#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) && defined(CONFIG_SYS_I2C_SH) /* DVFS for reset */ mstp_clrbits_le32(SMSTPCR9, SMSTPCR9, DVFS_MSTP926); #endif diff --git a/board/ronetix/imx8mq-cm/Kconfig b/board/ronetix/imx8mq-cm/Kconfig index 9dd6a86add..f0a240cc0d 100644 --- a/board/ronetix/imx8mq-cm/Kconfig +++ b/board/ronetix/imx8mq-cm/Kconfig @@ -9,4 +9,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "imx8mq_cm" +config IMX_CONFIG + default "board/ronetix/imx8mq-cm/imximage-8mq-lpddr4.cfg" + endif diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c index 1c2fe025e8..97791aaeff 100644 --- a/board/samsung/common/board.c +++ b/board/samsung/common/board.c @@ -185,7 +185,7 @@ int board_early_init_f(void) } #endif -#if defined(CONFIG_POWER) || defined(CONFIG_DM_PMIC) +#if CONFIG_IS_ENABLED(POWER_LEGACY) || CONFIG_IS_ENABLED(DM_PMIC) int power_init_board(void) { set_ps_hold_ctrl(); diff --git a/board/samsung/common/exynos5-dt-types.c b/board/samsung/common/exynos5-dt-types.c index e2d5a7c9ba..554fc91cc1 100644 --- a/board/samsung/common/exynos5-dt-types.c +++ b/board/samsung/common/exynos5-dt-types.c @@ -47,18 +47,6 @@ struct odroid_rev_info odroid_info[] = { { EXYNOS5_BOARD_ODROID_UNKNOWN, 0, 4095, "unknown" }, }; -static unsigned int odroid_get_rev(void) -{ - int i; - - for (i = 0; i < ARRAY_SIZE(odroid_info); i++) { - if (odroid_info[i].board_type == gd->board_type) - return odroid_info[i].board_rev; - } - - return 0; -} - /* * Read ADC at least twice and check the resuls. If regulator providing voltage * on to measured point was just turned on, first reads might require time @@ -200,6 +188,19 @@ bool board_is_generic(void) return false; } +#ifdef CONFIG_REVISION_TAG +static unsigned int odroid_get_rev(void) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(odroid_info); i++) { + if (odroid_info[i].board_type == gd->board_type) + return odroid_info[i].board_rev; + } + + return 0; +} + /** * get_board_rev() - return detected board revision. * @@ -212,6 +213,7 @@ u32 get_board_rev(void) return odroid_get_rev(); } +#endif /** * get_board_type() - returns board type string. diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index b32b82fc2d..ba25ba27b8 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -24,11 +24,6 @@ DECLARE_GLOBAL_DATA_PTR; -u32 get_board_rev(void) -{ - return 0; -} - int board_init(void) { /* Set Initial global variables */ diff --git a/board/samsung/origen/origen.c b/board/samsung/origen/origen.c index e17454ad77..7a91f44896 100644 --- a/board/samsung/origen/origen.c +++ b/board/samsung/origen/origen.c @@ -12,11 +12,6 @@ #include <asm/arch/pinmux.h> #include <usb.h> -u32 get_board_rev(void) -{ - return 0; -} - int exynos_init(void) { return 0; diff --git a/board/samsung/trats2/trats2.c b/board/samsung/trats2/trats2.c index 59e6fbf4b0..a03dc87385 100644 --- a/board/samsung/trats2/trats2.c +++ b/board/samsung/trats2/trats2.c @@ -67,10 +67,12 @@ static void check_hw_revision(void) board_rev = modelrev << 8; } +#ifdef CONFIG_REVISION_TAG u32 get_board_rev(void) { return board_rev; } +#endif static inline u32 get_model_rev(void) { diff --git a/board/samsung/universal_c210/universal.c b/board/samsung/universal_c210/universal.c index 9ef11b8471..3764b5478b 100644 --- a/board/samsung/universal_c210/universal.c +++ b/board/samsung/universal_c210/universal.c @@ -33,10 +33,12 @@ DECLARE_GLOBAL_DATA_PTR; unsigned int board_rev; static int init_pmic_lcd(void); +#ifdef CONFIG_REVISION_TAG u32 get_board_rev(void) { return board_rev; } +#endif int exynos_power_init(void) { diff --git a/board/siemens/capricorn/Kconfig b/board/siemens/capricorn/Kconfig index 21c3ef9094..c5a28ff022 100644 --- a/board/siemens/capricorn/Kconfig +++ b/board/siemens/capricorn/Kconfig @@ -9,6 +9,8 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "giedi" +config IMX_CONFIG + default "board/siemens/capricorn/imximage.cfg" endif if TARGET_DENEB @@ -22,4 +24,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "deneb" +config IMX_CONFIG + default "board/siemens/capricorn/imximage.cfg" + endif diff --git a/board/siemens/common/board.c b/board/siemens/common/board.c index 1bdf404ac3..56283660d3 100644 --- a/board/siemens/common/board.c +++ b/board/siemens/common/board.c @@ -70,6 +70,7 @@ void sdram_init(void) #endif /* #ifdef CONFIG_SPL_BUILD */ #ifndef CONFIG_SPL_BUILD +#define FACTORYSET_EEPROM_ADDR 0x50 /* * Basic board specific setup. Pinmux has been handled already. */ @@ -87,7 +88,7 @@ int board_init(void) gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; #ifdef CONFIG_FACTORYSET - factoryset_read_eeprom(CONFIG_SYS_I2C_EEPROM_ADDR); + factoryset_read_eeprom(FACTORYSET_EEPROM_ADDR); #endif gpmc_init(); diff --git a/board/siemens/draco/board.c b/board/siemens/draco/board.c index af35bc188e..f898bba4b0 100644 --- a/board/siemens/draco/board.c +++ b/board/siemens/draco/board.c @@ -132,12 +132,16 @@ struct am335x_nand_geometry { u8 nand_bus; }; +#define EEPROM_ADDR 0x50 +#define EEPROM_ADDR_DDR3 0x90 +#define EEPROM_ADDR_CHIP 0x120 + static int draco_read_nand_geometry(void) { struct am335x_nand_geometry geo; /* Read NAND geometry */ - if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0x80, 2, + if (i2c_read(EEPROM_ADDR, 0x80, 2, (uchar *)&geo, sizeof(struct am335x_nand_geometry))) { printf("Could not read the NAND geomtery; something fundamentally wrong on the I2C bus.\n"); return -EIO; @@ -160,20 +164,20 @@ static int draco_read_nand_geometry(void) static int read_eeprom(void) { /* Check if baseboard eeprom is available */ - if (i2c_probe(CONFIG_SYS_I2C_EEPROM_ADDR)) { + if (i2c_probe(EEPROM_ADDR)) { printf("Could not probe the EEPROM; something fundamentally wrong on the I2C bus.\n"); return 1; } #ifdef CONFIG_SPL_BUILD /* Read Siemens eeprom data (DDR3) */ - if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, EEPROM_ADDR_DDR3, 2, + if (i2c_read(EEPROM_ADDR, EEPROM_ADDR_DDR3, 2, (uchar *)&settings.ddr3, sizeof(struct ddr3_data))) { printf("Could not read the EEPROM; something fundamentally wrong on the I2C bus.\nUse default DDR3 timings\n"); set_default_ddr3_timings(); } /* Read Siemens eeprom data (CHIP) */ - if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, EEPROM_ADDR_CHIP, 2, + if (i2c_read(EEPROM_ADDR, EEPROM_ADDR_CHIP, 2, (uchar *)&settings.chip, sizeof(settings.chip))) printf("Could not read chip settings\n"); diff --git a/board/sifive/unleashed/genimage_sdcard.cfg b/board/sifive/unleashed/genimage_sdcard.cfg new file mode 100644 index 0000000000..91c53bf855 --- /dev/null +++ b/board/sifive/unleashed/genimage_sdcard.cfg @@ -0,0 +1,19 @@ +image sdcard.img { + size = 128M + + hdimage { + gpt = true + } + + partition u-boot-spl { + image = "u-boot-spl.bin" + offset = 17K + partition-type-uuid = 5B193300-FC78-40CD-8002-E86C45580B47 + } + + partition u-boot { + image = "u-boot.itb" + offset = 1041K + partition-type-uuid = 2E54B353-1271-4842-806F-E436D6AF6985 + } +} diff --git a/board/sifive/unleashed/genimage_spi-nor.cfg b/board/sifive/unleashed/genimage_spi-nor.cfg new file mode 100644 index 0000000000..2e5d89bfe8 --- /dev/null +++ b/board/sifive/unleashed/genimage_spi-nor.cfg @@ -0,0 +1,19 @@ +image spi-nor.img { + size = 32M + + hdimage { + gpt = true + } + + partition u-boot-spl { + image = "u-boot-spl.bin" + offset = 20K + partition-type-uuid = 5B193300-FC78-40CD-8002-E86C45580B47 + } + + partition u-boot { + image = "u-boot.itb" + offset = 1044K + partition-type-uuid = 2E54B353-1271-4842-806F-E436D6AF6985 + } +} diff --git a/board/softing/vining_2000/Kconfig b/board/softing/vining_2000/Kconfig index 90d45a7f6e..36b20f805a 100644 --- a/board/softing/vining_2000/Kconfig +++ b/board/softing/vining_2000/Kconfig @@ -9,4 +9,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "vining_2000" +config IMX_CONFIG + default "board/softing/vining_2000/imximage.cfg" + endif diff --git a/board/somlabs/visionsom-6ull/Kconfig b/board/somlabs/visionsom-6ull/Kconfig index 37408aa798..374d427ee5 100644 --- a/board/somlabs/visionsom-6ull/Kconfig +++ b/board/somlabs/visionsom-6ull/Kconfig @@ -9,4 +9,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "somlabs_visionsom_6ull" +config IMX_CONFIG + default "board/somlabs/visionsom-6ull/imximage.cfg" + endif diff --git a/board/somlabs/visionsom-6ull/visionsom-6ull.c b/board/somlabs/visionsom-6ull/visionsom-6ull.c index c26e7b0555..38d14f6bc2 100644 --- a/board/somlabs/visionsom-6ull/visionsom-6ull.c +++ b/board/somlabs/visionsom-6ull/visionsom-6ull.c @@ -104,7 +104,7 @@ int board_init(void) /* Address of boot parameters */ gd->bd->bi_boot_params = PHYS_SDRAM + 0x100; -#ifdef CONFIG_SYS_I2C_LEGACY +#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1); #endif diff --git a/board/st/stm32f429-discovery/stm32f429-discovery.c b/board/st/stm32f429-discovery/stm32f429-discovery.c index 46fcf907fc..34f9d6bc00 100644 --- a/board/st/stm32f429-discovery/stm32f429-discovery.c +++ b/board/st/stm32f429-discovery/stm32f429-discovery.c @@ -46,11 +46,6 @@ int dram_init_banksize(void) return 0; } -u32 get_board_rev(void) -{ - return 0; -} - int board_init(void) { gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100; diff --git a/board/st/stm32f429-evaluation/stm32f429-evaluation.c b/board/st/stm32f429-evaluation/stm32f429-evaluation.c index 3b6df1f3ab..c170314ed8 100644 --- a/board/st/stm32f429-evaluation/stm32f429-evaluation.c +++ b/board/st/stm32f429-evaluation/stm32f429-evaluation.c @@ -40,11 +40,6 @@ int dram_init_banksize(void) return 0; } -u32 get_board_rev(void) -{ - return 0; -} - int board_init(void) { gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100; diff --git a/board/st/stm32f469-discovery/stm32f469-discovery.c b/board/st/stm32f469-discovery/stm32f469-discovery.c index c5df9b0d9c..122273a2ae 100644 --- a/board/st/stm32f469-discovery/stm32f469-discovery.c +++ b/board/st/stm32f469-discovery/stm32f469-discovery.c @@ -40,11 +40,6 @@ int dram_init_banksize(void) return 0; } -u32 get_board_rev(void) -{ - return 0; -} - int board_init(void) { gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100; diff --git a/board/st/stm32f746-disco/stm32f746-disco.c b/board/st/stm32f746-disco/stm32f746-disco.c index efa38a0e26..376bc06a98 100644 --- a/board/st/stm32f746-disco/stm32f746-disco.c +++ b/board/st/stm32f746-disco/stm32f746-disco.c @@ -77,12 +77,7 @@ u32 spl_boot_device(void) { return BOOT_DEVICE_XIP; } - #endif -u32 get_board_rev(void) -{ - return 0; -} int board_late_init(void) { diff --git a/board/st/stm32h743-disco/stm32h743-disco.c b/board/st/stm32h743-disco/stm32h743-disco.c index 4091d5f9fd..cc87230026 100644 --- a/board/st/stm32h743-disco/stm32h743-disco.c +++ b/board/st/stm32h743-disco/stm32h743-disco.c @@ -36,11 +36,6 @@ int dram_init_banksize(void) return 0; } -u32 get_board_rev(void) -{ - return 0; -} - int board_init(void) { gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100; diff --git a/board/st/stm32h743-eval/stm32h743-eval.c b/board/st/stm32h743-eval/stm32h743-eval.c index 4091d5f9fd..cc87230026 100644 --- a/board/st/stm32h743-eval/stm32h743-eval.c +++ b/board/st/stm32h743-eval/stm32h743-eval.c @@ -36,11 +36,6 @@ int dram_init_banksize(void) return 0; } -u32 get_board_rev(void) -{ - return 0; -} - int board_init(void) { gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100; diff --git a/board/st/stm32h750-art-pi/stm32h750-art-pi.c b/board/st/stm32h750-art-pi/stm32h750-art-pi.c index 5785b2e575..0ece8e79f2 100644 --- a/board/st/stm32h750-art-pi/stm32h750-art-pi.c +++ b/board/st/stm32h750-art-pi/stm32h750-art-pi.c @@ -41,11 +41,6 @@ int board_early_init_f(void) return 0; } -u32 get_board_rev(void) -{ - return 0; -} - int board_late_init(void) { return 0; diff --git a/board/ste/stemmy/MAINTAINERS b/board/ste/stemmy/MAINTAINERS index 37daabea9c..fa06488284 100644 --- a/board/ste/stemmy/MAINTAINERS +++ b/board/ste/stemmy/MAINTAINERS @@ -2,5 +2,6 @@ STEMMY BOARD M: Stephan Gerhold <stephan@gerhold.net> S: Maintained F: board/ste/stemmy/ -F: include/configs/stemmy.h F: configs/stemmy_defconfig +F: doc/board/ste/stemmy.rst +F: include/configs/stemmy.h diff --git a/board/ste/stemmy/README b/board/ste/stemmy/README deleted file mode 100644 index 1b83b833c0..0000000000 --- a/board/ste/stemmy/README +++ /dev/null @@ -1,50 +0,0 @@ -ST-Ericsson U8500 Samsung "stemmy" board -======================================== - -The "stemmy" board supports Samsung smartphones released with -the ST-Ericsson NovaThor U8500 SoC, e.g. - - - Samsung Galaxy S III mini (GT-I8190) "golden" - - Samsung Galaxy S Advance (GT-I9070) "janice" - - Samsung Galaxy Xcover 2 (GT-S7710) "skomer" - - Samsung Galaxy Ace 2 (GT-I8160) "codina" - -and likely others as well (untested). - -At the moment, U-Boot is intended to be chain-loaded from -the original Samsung bootloader, not replacing it entirely. - -Installation ------------- - -1. Setup cross compiler, e.g. export CROSS_COMPILE=arm-none-eabi- -2. make stemmy_defconfig -3. make - -For newer devices (golden and skomer), the U-Boot binary has to be packed into -an Android boot image. janice boots the raw U-Boot binary from the boot partition. - -4. Obtain mkbootimg, e.g. https://android.googlesource.com/platform/system/core/+/refs/tags/android-7.1.2_r37/mkbootimg/mkbootimg -5. mkbootimg \ - --kernel=u-boot.bin \ - --base=0x00000000 \ - --kernel_offset=0x00100000 \ - --ramdisk_offset=0x02000000 \ - --tags_offset=0x00000100 \ - --output=u-boot.img - -6. Enter Samsung download mode (press Power + Home + Volume Down) -7. Flash U-Boot image to Android boot partition using Heimdall: - https://gitlab.com/BenjaminDobell/Heimdall - - heimdall flash --Kernel u-boot.(bin|img) - -8. After reboot U-Boot prompt should appear via UART. - -UART ----- - -UART is available through the micro USB port, similar to the Carkit standard. -With a ~619kOhm resistor between ID and GND, 1.8V RX/TX is available at D+/D-. - -Make sure to connect the UART cable *before* turning on the phone. diff --git a/board/storopack/smegw01/Kconfig b/board/storopack/smegw01/Kconfig index 4503b65419..d8f24695d0 100644 --- a/board/storopack/smegw01/Kconfig +++ b/board/storopack/smegw01/Kconfig @@ -9,4 +9,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "smegw01" +config IMX_CONFIG + default "board/storopack/smegw01/imximage.cfg" + endif diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 1a46100e40..2b7d655678 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -47,7 +47,7 @@ #include <sy8106a.h> #include <asm/setup.h> -#if defined CONFIG_VIDEO_LCD_PANEL_I2C && !(defined CONFIG_SPL_BUILD) +#if defined(CONFIG_VIDEO_LCD_PANEL_I2C) /* So that we can use pin names in Kconfig and sunxi_name_to_gpio() */ int soft_i2c_gpio_sda; int soft_i2c_gpio_scl; diff --git a/board/tcl/sl50/Makefile b/board/tcl/sl50/Makefile index c2977d7778..0ac0ba36cd 100644 --- a/board/tcl/sl50/Makefile +++ b/board/tcl/sl50/Makefile @@ -4,7 +4,7 @@ # # Copyright (C) 2015 Toby Churchill Ltd - http://www.toby-churchill.com/ -ifeq ($(CONFIG_SKIP_LOWLEVEL_INIT),) +ifeq ($(CONFIG_$(SPL_)SKIP_LOWLEVEL_INIT),) obj-y := mux.o endif diff --git a/board/tcl/sl50/board.c b/board/tcl/sl50/board.c index d213608499..b7ddc3ba78 100644 --- a/board/tcl/sl50/board.c +++ b/board/tcl/sl50/board.c @@ -40,7 +40,7 @@ DECLARE_GLOBAL_DATA_PTR; static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE; -#ifndef CONFIG_SKIP_LOWLEVEL_INIT +#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT) static const struct ddr_data ddr3_sl50_data = { .datardsratio0 = MT41K256M16HA125E_RD_DQS, @@ -161,7 +161,7 @@ void am33xx_spl_board_init(void) const struct dpll_params *get_dpll_ddr_params(void) { enable_i2c0_pin_mux(); - i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE); + i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); return &dpll_ddr_sl50; } diff --git a/board/technexion/pico-imx7d/pico-imx7d.c b/board/technexion/pico-imx7d/pico-imx7d.c index 2d749dac19..d97e13b1cd 100644 --- a/board/technexion/pico-imx7d/pico-imx7d.c +++ b/board/technexion/pico-imx7d/pico-imx7d.c @@ -60,7 +60,7 @@ int dram_init(void) return 0; } -#ifdef CONFIG_POWER +#if CONFIG_IS_ENABLED(POWER_LEGACY) #define I2C_PMIC 3 int power_init_board(void) { diff --git a/board/technexion/pico-imx8mq/Kconfig b/board/technexion/pico-imx8mq/Kconfig index 031fc1d563..628b051149 100644 --- a/board/technexion/pico-imx8mq/Kconfig +++ b/board/technexion/pico-imx8mq/Kconfig @@ -9,4 +9,7 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "pico-imx8mq" +config IMX_CONFIG + default "arch/arm/mach-imx/imx8m/imximage.cfg" + endif diff --git a/board/ti/am335x/Makefile b/board/ti/am335x/Makefile index c34b9b1dd8..3ccf66be5b 100644 --- a/board/ti/am335x/Makefile +++ b/board/ti/am335x/Makefile @@ -4,7 +4,7 @@ # # Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ -ifeq ($(CONFIG_SKIP_LOWLEVEL_INIT),) +ifeq ($(CONFIG_$(SPL_)SKIP_LOWLEVEL_INIT),) obj-y := mux.o endif diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c index 2e4f3d102b..e8555de9c9 100644 --- a/board/ti/am335x/board.c +++ b/board/ti/am335x/board.c @@ -79,10 +79,6 @@ void do_board_detect(void) { enable_i2c0_pin_mux(); enable_i2c2_pin_mux(); -#if !CONFIG_IS_ENABLED(DM_I2C) - i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE); - i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED2, CONFIG_SYS_OMAP24_I2C_SLAVE2); -#endif if (ti_i2c_eeprom_am_get(CONFIG_EEPROM_BUS_ADDRESS, CONFIG_EEPROM_CHIP_ADDRESS)) printf("ti_i2c_eeprom_init failed\n"); @@ -99,7 +95,7 @@ struct serial_device *default_serial_console(void) } #endif -#ifndef CONFIG_SKIP_LOWLEVEL_INIT +#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT) static const struct ddr_data ddr2_data = { .datardsratio0 = MT47H128M16RT25E_RD_DQS, .datafwsratio0 = MT47H128M16RT25E_PHY_FIFO_WE, @@ -253,7 +249,7 @@ static struct emif_regs ddr3_icev2_emif_reg_data = { #ifdef CONFIG_SPL_OS_BOOT int spl_start_uboot(void) { -#ifdef CONFIG_SPL_SERIAL_SUPPORT +#ifdef CONFIG_SPL_SERIAL /* break into full u-boot on 'c' */ if (serial_tstc() && serial_getc() == 'c') return 1; @@ -339,13 +335,8 @@ static void scale_vcores_bone(int freq) if (board_is_bone() && !strncmp(board_ti_get_rev(), "00A1", 4)) return; -#if !CONFIG_IS_ENABLED(DM_I2C) - if (i2c_probe(TPS65217_CHIP_PM)) - return; -#else if (power_tps65217_init(0)) return; -#endif /* @@ -438,13 +429,8 @@ void scale_vcores_generic(int freq) * 1.10V. For MPU voltage we need to switch based on * the frequency we are running at. */ -#if !CONFIG_IS_ENABLED(DM_I2C) - if (i2c_probe(TPS65910_CTRL_I2C_ADDR)) - return; -#else if (power_tps65910_init(0)) return; -#endif /* * Depending on MPU clock and PG we will need a different * VDD to drive at that speed. @@ -472,10 +458,6 @@ void gpi2c_init(void) if (first_time) { enable_i2c0_pin_mux(); -#if !CONFIG_IS_ENABLED(DM_I2C) - i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, - CONFIG_SYS_OMAP24_I2C_SLAVE); -#endif first_time = false; } } diff --git a/board/ti/am335x/mux.c b/board/ti/am335x/mux.c index e450ff64d8..fed737fa09 100644 --- a/board/ti/am335x/mux.c +++ b/board/ti/am335x/mux.c @@ -345,14 +345,6 @@ void enable_i2c2_pin_mux(void) static unsigned short detect_daughter_board_profile(void) { unsigned short val; - -#if !CONFIG_IS_ENABLED(DM_I2C) - if (i2c_probe(I2C_CPLD_ADDR)) - return PROFILE_NONE; - - if (i2c_read(I2C_CPLD_ADDR, CFG_REG, 1, (unsigned char *)(&val), 2)) - return PROFILE_NONE; -#else struct udevice *dev = NULL; int rc; @@ -362,7 +354,6 @@ static unsigned short detect_daughter_board_profile(void) rc = dm_i2c_read(dev, CFG_REG, (unsigned char *)(&val), 2); if (rc) return PROFILE_NONE; -#endif return (1 << (val & PROFILE_MASK)); } diff --git a/board/ti/am43xx/Makefile b/board/ti/am43xx/Makefile index 60a11d8c04..8dc1d89e3a 100644 --- a/board/ti/am43xx/Makefile +++ b/board/ti/am43xx/Makefile @@ -4,7 +4,7 @@ # # Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ -ifeq ($(CONFIG_SKIP_LOWLEVEL_INIT),) +ifeq ($(CONFIG_$(SPL_)SKIP_LOWLEVEL_INIT),) obj-y := mux.o endif diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c index a71b588efc..529129ecc7 100644 --- a/board/ti/am43xx/board.c +++ b/board/ti/am43xx/board.c @@ -56,7 +56,7 @@ void do_board_detect(void) } #endif -#ifndef CONFIG_SKIP_LOWLEVEL_INIT +#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT) const struct dpll_params dpll_mpu[NUM_CRYSTAL_FREQ][NUM_OPPS] = { { /* 19.2 MHz */ @@ -393,13 +393,8 @@ void scale_vcores_generic(u32 m) { int mpu_vdd, ddr_volt; -#if !CONFIG_IS_ENABLED(DM_I2C) - if (i2c_probe(TPS65218_CHIP_PM)) - return; -#else if (power_tps65218_init(0)) return; -#endif switch (m) { case 1000: @@ -451,13 +446,8 @@ void scale_vcores_idk(u32 m) { int mpu_vdd; -#if !CONFIG_IS_ENABLED(DM_I2C) - if (i2c_probe(TPS62362_I2C_ADDR)) - return; -#else if (power_tps62362_init(0)) return; -#endif switch (m) { case 1000: @@ -492,10 +482,6 @@ void gpi2c_init(void) if (first_time) { enable_i2c0_pin_mux(); -#if !CONFIG_IS_ENABLED(DM_I2C) - i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, - CONFIG_SYS_OMAP24_I2C_SLAVE); -#endif first_time = false; } } @@ -632,28 +618,15 @@ void sdram_init(void) int power_init_board(void) { int rc; -#if !CONFIG_IS_ENABLED(DM_I2C) - struct pmic *p = NULL; -#endif if (board_is_idk()) { rc = power_tps62362_init(0); if (rc) goto done; -#if !CONFIG_IS_ENABLED(DM_I2C) - p = pmic_get("TPS62362"); - if (!p || pmic_probe(p)) - goto done; -#endif puts("PMIC: TPS62362\n"); } else { rc = power_tps65218_init(0); if (rc) goto done; -#if !CONFIG_IS_ENABLED(DM_I2C) - p = pmic_get("TPS65218_PMIC"); - if (!p || pmic_probe(p)) - goto done; -#endif puts("PMIC: TPS65218\n"); } done: diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c index fda8d5f3c8..d8062997e5 100644 --- a/board/ti/panda/panda.c +++ b/board/ti/panda/panda.c @@ -312,6 +312,7 @@ void board_mmc_power_init(void) #endif #endif +#ifdef CONFIG_REVISION_TAG /* * get_board_rev() - get board revision */ @@ -319,3 +320,4 @@ u32 get_board_rev(void) { return 0x20; } +#endif diff --git a/board/ti/sdp4430/sdp.c b/board/ti/sdp4430/sdp.c index 4895bfafd8..69726eb9ce 100644 --- a/board/ti/sdp4430/sdp.c +++ b/board/ti/sdp4430/sdp.c @@ -104,6 +104,7 @@ int spl_start_uboot(void) } #endif /* CONFIG_SPL_OS_BOOT */ +#ifdef CONFIG_REVISION_TAG /* * get_board_rev() - get board revision */ @@ -111,3 +112,4 @@ u32 get_board_rev(void) { return 0x20; } +#endif diff --git a/board/toradex/apalis-imx8/Kconfig b/board/toradex/apalis-imx8/Kconfig index c680d63fa1..b43d6281b6 100644 --- a/board/toradex/apalis-imx8/Kconfig +++ b/board/toradex/apalis-imx8/Kconfig @@ -25,6 +25,9 @@ config TDX_CFG_BLOCK_PART config TDX_CFG_BLOCK_OFFSET default "-512" +config IMX_CONFIG + default "board/toradex/apalis-imx8/apalis-imx8-imximage.cfg" + source "board/toradex/common/Kconfig" endif diff --git a/board/toradex/apalis-imx8x/Kconfig b/board/toradex/apalis-imx8x/Kconfig index ee61e09736..d6cda7e3ff 100644 --- a/board/toradex/apalis-imx8x/Kconfig +++ b/board/toradex/apalis-imx8x/Kconfig @@ -25,6 +25,9 @@ config TDX_CFG_BLOCK_PART config TDX_CFG_BLOCK_OFFSET default "-512" +config IMX_CONFIG + default "board/toradex/apalis-imx8x/apalis-imx8x-imximage.cfg" + source "board/toradex/common/Kconfig" endif diff --git a/board/toradex/apalis_imx6/Kconfig b/board/toradex/apalis_imx6/Kconfig index 14f8c10c64..c6ff387351 100644 --- a/board/toradex/apalis_imx6/Kconfig +++ b/board/toradex/apalis_imx6/Kconfig @@ -48,7 +48,6 @@ config TDX_APALIS_IMX6_V1_0 This option configures DCE mode unconditionally. Whithout this option the config block stating V1.0 HW selects DCE mode, otherwise the UARTs are configuered in DTE mode. - default n source "board/toradex/common/Kconfig" diff --git a/board/toradex/apalis_imx6/apalis_imx6.c b/board/toradex/apalis_imx6/apalis_imx6.c index 74060daadd..f4cd28d49f 100644 --- a/board/toradex/apalis_imx6/apalis_imx6.c +++ b/board/toradex/apalis_imx6/apalis_imx6.c @@ -707,12 +707,11 @@ int board_init(void) #ifdef CONFIG_BOARD_LATE_INIT int board_late_init(void) { -#if defined(CONFIG_REVISION_TAG) && \ - defined(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG) +#if defined(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG) char env_str[256]; u32 rev; - rev = get_board_rev(); + rev = get_board_revision(); snprintf(env_str, ARRAY_SIZE(env_str), "%.4x", rev); env_set("board_rev", env_str); diff --git a/board/toradex/colibri-imx6ull/Kconfig b/board/toradex/colibri-imx6ull/Kconfig index 3ce9885c12..e5e4af3364 100644 --- a/board/toradex/colibri-imx6ull/Kconfig +++ b/board/toradex/colibri-imx6ull/Kconfig @@ -24,6 +24,9 @@ config TDX_CFG_BLOCK_OFFSET2 config TDX_CFG_BLOCK_2ND_ETHADDR default y +config IMX_CONFIG + default "board/toradex/colibri-imx6ull/imximage.cfg" + source "board/toradex/common/Kconfig" endif diff --git a/board/toradex/colibri-imx8x/Kconfig b/board/toradex/colibri-imx8x/Kconfig index d97fed020e..b89840a379 100644 --- a/board/toradex/colibri-imx8x/Kconfig +++ b/board/toradex/colibri-imx8x/Kconfig @@ -25,6 +25,9 @@ config TDX_CFG_BLOCK_PART config TDX_CFG_BLOCK_OFFSET default "-512" +config IMX_CONFIG + default "board/toradex/colibri-imx8x/colibri-imx8x-imximage.cfg" + source "board/toradex/common/Kconfig" endif diff --git a/board/toradex/colibri_imx6/colibri_imx6.c b/board/toradex/colibri_imx6/colibri_imx6.c index 587d92a8e9..3b55f6c938 100644 --- a/board/toradex/colibri_imx6/colibri_imx6.c +++ b/board/toradex/colibri_imx6/colibri_imx6.c @@ -611,12 +611,11 @@ int board_init(void) #ifdef CONFIG_BOARD_LATE_INIT int board_late_init(void) { -#if defined(CONFIG_REVISION_TAG) && \ - defined(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG) +#if defined(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG) char env_str[256]; u32 rev; - rev = get_board_rev(); + rev = get_board_revision(); snprintf(env_str, ARRAY_SIZE(env_str), "%.4x", rev); env_set("board_rev", env_str); #endif diff --git a/board/toradex/colibri_imx7/Kconfig b/board/toradex/colibri_imx7/Kconfig index d33ec63523..87c416ac2f 100644 --- a/board/toradex/colibri_imx7/Kconfig +++ b/board/toradex/colibri_imx7/Kconfig @@ -71,6 +71,9 @@ config TDX_CFG_BLOCK_OFFSET endif +config IMX_CONFIG + default "board/toradex/colibri_imx7/imximage.cfg" + source "board/toradex/common/Kconfig" endif diff --git a/board/toradex/colibri_vf/Kconfig b/board/toradex/colibri_vf/Kconfig index 5f7129dd35..83315d8757 100644 --- a/board/toradex/colibri_vf/Kconfig +++ b/board/toradex/colibri_vf/Kconfig @@ -21,6 +21,9 @@ config TDX_CFG_BLOCK_OFFSET config TDX_CFG_BLOCK_2ND_ETHADDR default y +config IMX_CONFIG + default "board/toradex/colibri_vf/imximage.cfg" + source "board/toradex/common/Kconfig" endif diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c index e4f9a0db91..fe47cddad8 100644 --- a/board/toradex/common/tdx-cfg-block.c +++ b/board/toradex/common/tdx-cfg-block.c @@ -493,24 +493,24 @@ static int get_cfgblock_interactive(void) else tdx_hw_tag.prodid = COLIBRI_PXA270_520MHZ; } -#ifdef CONFIG_MACH_TYPE +#if defined(CONFIG_TARGET_APALIS_T30) || defined(CONFIG_TARGET_COLIBRI_T30) else if (!strcmp("tegra30", soc)) { - if (CONFIG_MACH_TYPE == MACH_TYPE_APALIS_T30) { - if (it == 'y' || it == 'Y') - tdx_hw_tag.prodid = APALIS_T30_IT; - else - if (gd->ram_size == 0x40000000) - tdx_hw_tag.prodid = APALIS_T30_1GB; - else - tdx_hw_tag.prodid = APALIS_T30_2GB; - } else { - if (it == 'y' || it == 'Y') - tdx_hw_tag.prodid = COLIBRI_T30_IT; +#ifdef CONFIG_TARGET_APALIS_T30 + if (it == 'y' || it == 'Y') + tdx_hw_tag.prodid = APALIS_T30_IT; + else + if (gd->ram_size == 0x40000000) + tdx_hw_tag.prodid = APALIS_T30_1GB; else - tdx_hw_tag.prodid = COLIBRI_T30; - } + tdx_hw_tag.prodid = APALIS_T30_2GB; +#else + if (it == 'y' || it == 'Y') + tdx_hw_tag.prodid = COLIBRI_T30_IT; + else + tdx_hw_tag.prodid = COLIBRI_T30; +#endif } -#endif /* CONFIG_MACH_TYPE */ +#endif /* CONFIG_TARGET_APALIS_T30 || CONFIG_TARGET_COLIBRI_T30 */ else if (!strcmp("tegra124", soc)) { tdx_hw_tag.prodid = APALIS_TK1_2GB; } else if (!strcmp("vf500", soc)) { diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c index 061abf7537..9db4553e0f 100644 --- a/board/toradex/common/tdx-common.c +++ b/board/toradex/common/tdx-common.c @@ -32,8 +32,8 @@ static char tdx_car_rev_str[6]; static char *tdx_carrier_board_name; #endif -#ifdef CONFIG_REVISION_TAG -u32 get_board_rev(void) +#if defined(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG) +u32 get_board_revision(void) { /* Check validity */ if (!tdx_hw_tag.ver_major) @@ -183,8 +183,8 @@ int ft_common_board_setup(void *blob, struct bd_info *bd) #else /* CONFIG_TDX_CFG_BLOCK */ -#ifdef CONFIG_REVISION_TAG -u32 get_board_rev(void) +#if defined(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG) +u32 get_board_revision(void) { return 0; } diff --git a/board/toradex/common/tdx-common.h b/board/toradex/common/tdx-common.h index 8020df5b44..c96e8754e9 100644 --- a/board/toradex/common/tdx-common.h +++ b/board/toradex/common/tdx-common.h @@ -10,6 +10,7 @@ #define TDX_USB_VID 0x1B67 int ft_common_board_setup(void *blob, struct bd_info *bd); +u32 get_board_revision(void); #if defined(CONFIG_DM_VIDEO) int show_boot_logo(void); diff --git a/board/toradex/verdin-imx8mm/Kconfig b/board/toradex/verdin-imx8mm/Kconfig index 149aed6da7..51e8ba618b 100644 --- a/board/toradex/verdin-imx8mm/Kconfig +++ b/board/toradex/verdin-imx8mm/Kconfig @@ -31,6 +31,9 @@ config TDX_CFG_BLOCK_PART config TDX_CFG_BLOCK_OFFSET default "-512" +config IMX_CONFIG + default "board/toradex/verdin-imx8mm/imximage.cfg" + source "board/toradex/common/Kconfig" endif diff --git a/board/tplink/wdr4300/wdr4300.c b/board/tplink/wdr4300/wdr4300.c index f2b92109b6..f2de039b6b 100644 --- a/board/tplink/wdr4300/wdr4300.c +++ b/board/tplink/wdr4300/wdr4300.c @@ -71,7 +71,7 @@ int board_early_init_f(void) wdr4300_pinmux_config(); #endif -#ifndef CONFIG_SKIP_LOWLEVEL_INIT +#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT) ar934x_pll_init(560, 480, 240); ar934x_ddr_init(560, 480, 240); #endif diff --git a/board/tqc/tqma6/tqma6.c b/board/tqc/tqma6/tqma6.c index 4f86a92901..de9c00174a 100644 --- a/board/tqc/tqma6/tqma6.c +++ b/board/tqc/tqma6/tqma6.c @@ -171,7 +171,7 @@ int board_spi_cs_gpio(unsigned bus, unsigned cs) #endif #endif -#ifdef CONFIG_SYS_I2C_LEGACY +#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) static struct i2c_pads_info tqma6_i2c3_pads = { /* I2C3: on board LM75, M24C64, */ .scl = { @@ -216,7 +216,7 @@ int board_init(void) #ifndef CONFIG_DM_SPI tqma6_iomuxc_spi(); #endif -#ifdef CONFIG_SYS_I2C_LEGACY +#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) tqma6_setup_i2c(); #endif @@ -247,7 +247,7 @@ static const char *tqma6_get_boardname(void) }; } -#ifdef CONFIG_POWER +#if CONFIG_IS_ENABLED(POWER_LEGACY) /* setup board specific PMIC */ int power_init_board(void) { diff --git a/board/udoo/neo/neo.c b/board/udoo/neo/neo.c index 92a1e084b5..ce005d31cc 100644 --- a/board/udoo/neo/neo.c +++ b/board/udoo/neo/neo.c @@ -96,7 +96,7 @@ static struct i2c_pads_info i2c_pad_info1 = { }; #endif -#ifdef CONFIG_POWER +#if CONFIG_IS_ENABLED(POWER_LEGACY) int power_init_board(void) { struct pmic *p; diff --git a/board/varisys/common/Makefile b/board/varisys/common/Makefile deleted file mode 100644 index b7358c7c64..0000000000 --- a/board/varisys/common/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0+ -# -# (C) Copyright 2006 -# Wolfgang Denk, DENX Software Engineering, wd@denx.de. - -MINIMAL= - -ifdef CONFIG_SPL_BUILD -ifdef CONFIG_SPL_INIT_MINIMAL -MINIMAL=y -endif -endif - -ifdef MINIMAL -# necessary to create built-in.o -obj- := __dummy__.o -else -ifndef CONFIG_SPL_BUILD -obj-$(CONFIG_ID_EEPROM) += sys_eeprom.o -endif -endif diff --git a/board/varisys/common/eeprom.h b/board/varisys/common/eeprom.h deleted file mode 100644 index 004816a0fd..0000000000 --- a/board/varisys/common/eeprom.h +++ /dev/null @@ -1,6 +0,0 @@ -/* EEPROM init functions for Cyrus */ - - -void init_eeprom(int bus_num, int addr, int addr_len); -void mac_read_from_fixed_id(void); -int mac_read_from_eeprom_common(void); diff --git a/board/varisys/common/sys_eeprom.c b/board/varisys/common/sys_eeprom.c deleted file mode 100644 index 8f624e5e36..0000000000 --- a/board/varisys/common/sys_eeprom.c +++ /dev/null @@ -1,500 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * Based on board/freescale/common/sys_eeprom.c - * Copyright 2006, 2008-2009, 2011 Freescale Semiconductor - * - * This defines the API for storing board information in the - * eeprom. It has been adapted from an earlier version of the - * Freescale API, but has a number of key differences. Because - * the two APIs are independent and may diverge further, the - * Varisys version of the API is implemented separately here. - */ - -#include <common.h> -#include <command.h> -#include <env.h> -#include <i2c.h> -#include <linux/ctype.h> -#include <linux/delay.h> -#include <u-boot/crc.h> - -#include "eeprom.h" - -#ifdef CONFIG_SYS_I2C_EEPROM_NXID_MAC -#define MAX_NUM_PORTS CONFIG_SYS_I2C_EEPROM_NXID_MAC -#else -#define MAX_NUM_PORTS 8 -#endif -#define NXID_VERSION 0 - -/** - * static eeprom: EEPROM layout for NXID formats - * - * See Freescale application note AN3638 for details. - */ -static struct __attribute__ ((__packed__)) eeprom { - u8 id[4]; /* 0x00 - 0x03 EEPROM Tag 'NXID' */ - u8 sn[12]; /* 0x04 - 0x0F Serial Number */ - u8 errata[5]; /* 0x10 - 0x14 Errata Level */ - u8 date[6]; /* 0x15 - 0x1a Build Date */ - u8 res_0; /* 0x1b Reserved */ - u32 version; /* 0x1c - 0x1f NXID Version */ - u8 tempcal[8]; /* 0x20 - 0x27 Temperature Calibration Factors */ - u8 tempcalsys[2]; /* 0x28 - 0x29 System Temperature Calibration Factors */ - u8 tempcalflags; /* 0x2a Temperature Calibration Flags */ - u8 res_1[21]; /* 0x2b - 0x3f Reserved */ - u8 mac_count; /* 0x40 Number of MAC addresses */ - u8 mac_flag; /* 0x41 MAC table flags */ - u8 mac[MAX_NUM_PORTS][6]; /* 0x42 - x MAC addresses */ - u32 crc; /* x+1 CRC32 checksum */ -} e; - -/* Set to 1 if we've read EEPROM into memory */ -static int has_been_read; - -/* Is this a valid NXID EEPROM? */ -#define is_valid ((e.id[0] == 'N') || (e.id[1] == 'X') || \ - (e.id[2] == 'I') || (e.id[3] == 'D')) - -/** Fixed ID field in EEPROM */ -static unsigned char uid[16]; - -static int eeprom_bus_num = -1; -static int eeprom_addr; -static int eeprom_addr_len; - -/** - * This must be called before any eeprom access. - */ -void init_eeprom(int bus_num, int addr, int addr_len) -{ - eeprom_bus_num = bus_num; - eeprom_addr = addr; - eeprom_addr_len = addr_len; -} - -/** - * show_eeprom - display the contents of the EEPROM - */ -void show_eeprom(void) -{ - int i; - unsigned int crc; - - /* EEPROM tag ID, either CCID or NXID */ - printf("ID: %c%c%c%c v%u\n", e.id[0], e.id[1], e.id[2], e.id[3], - be32_to_cpu(e.version)); - - /* Serial number */ - printf("SN: %s\n", e.sn); - - printf("UID: "); - for (i = 0; i < 16; i++) - printf("%02x", uid[i]); - printf("\n"); - - /* Errata level. */ - printf("Errata: %s\n", e.errata); - - /* Build date, BCD date values, as YYMMDDhhmmss */ - printf("Build date: 20%02x/%02x/%02x %02x:%02x:%02x %s\n", - e.date[0], e.date[1], e.date[2], - e.date[3] & 0x7F, e.date[4], e.date[5], - e.date[3] & 0x80 ? "PM" : ""); - - /* Show MAC addresses */ - for (i = 0; i < min(e.mac_count, (u8)MAX_NUM_PORTS); i++) { - u8 *p = e.mac[i]; - - printf("Eth%u: %02x:%02x:%02x:%02x:%02x:%02x\n", i, - p[0], p[1], p[2], p[3], p[4], p[5]); - } - - crc = crc32(0, (void *)&e, sizeof(e) - 4); - - if (crc == be32_to_cpu(e.crc)) - printf("CRC: %08x\n", be32_to_cpu(e.crc)); - else - printf("CRC: %08x (should be %08x)\n", - be32_to_cpu(e.crc), crc); - -#ifdef DEBUG - printf("EEPROM dump: (0x%x bytes)\n", sizeof(e)); - for (i = 0; i < sizeof(e); i++) { - if ((i % 16) == 0) - printf("%02X: ", i); - printf("%02X ", ((u8 *)&e)[i]); - if (((i % 16) == 15) || (i == sizeof(e) - 1)) - printf("\n"); - } -#endif -} - -/** - * read_eeprom - read the EEPROM into memory - */ -int read_eeprom(void) -{ - int ret; - unsigned int bus; - - if (eeprom_bus_num < 0) { - printf("EEPROM not configured\n"); - return -1; - } - - if (has_been_read) - return 0; - - bus = i2c_get_bus_num(); - i2c_set_bus_num(eeprom_bus_num); - - ret = i2c_read(eeprom_addr, 0, eeprom_addr_len, - (void *)&e, sizeof(e)); - - - /* Fixed address of ID field */ - i2c_read(0x5f, 0x80, 1, uid, 16); - - i2c_set_bus_num(bus); - -#ifdef DEBUG - show_eeprom(); -#endif - - has_been_read = (ret == 0) ? 1 : 0; - - return ret; -} - -/** - * update_crc - update the CRC - * - * This function should be called after each update to the EEPROM structure, - * to make sure the CRC is always correct. - */ -static void update_crc(void) -{ - u32 crc, crc_offset = offsetof(struct eeprom, crc); - - crc = crc32(0, (void *)&e, crc_offset); - e.crc = cpu_to_be32(crc); -} - -/** - * prog_eeprom - write the EEPROM from memory - */ -static int prog_eeprom(void) -{ - int ret = 0; - int i; - void *p; - unsigned int bus; - - if (eeprom_bus_num < 0) { - printf("EEPROM not configured\n"); - return -1; - } - - /* Set the reserved values to 0xFF */ - e.res_0 = 0xFF; - memset(e.res_1, 0xFF, sizeof(e.res_1)); - update_crc(); - - bus = i2c_get_bus_num(); - i2c_set_bus_num(eeprom_bus_num); - - /* - * The AT24C02 datasheet says that data can only be written in page - * mode, which means 8 bytes at a time, and it takes up to 5ms to - * complete a given write. - */ - for (i = 0, p = &e; i < sizeof(e); i += 8, p += 8) { - ret = i2c_write(eeprom_addr, i, eeprom_addr_len, - p, min((int)(sizeof(e) - i), 8)); - if (ret) - break; - udelay(5000); /* 5ms write cycle timing */ - } - - if (!ret) { - /* Verify the write by reading back the EEPROM and comparing */ - struct eeprom e2; - - ret = i2c_read(eeprom_addr, 0, - eeprom_addr_len, (void *)&e2, sizeof(e2)); - if (!ret && memcmp(&e, &e2, sizeof(e))) - ret = -1; - } - - i2c_set_bus_num(bus); - - if (ret) { - printf("Programming failed.\n"); - has_been_read = 0; - return -1; - } - - printf("Programming passed.\n"); - return 0; -} - -/** - * h2i - converts hex character into a number - * - * This function takes a hexadecimal character (e.g. '7' or 'C') and returns - * the integer equivalent. - */ -static inline u8 h2i(char p) -{ - if ((p >= '0') && (p <= '9')) - return p - '0'; - - if ((p >= 'A') && (p <= 'F')) - return (p - 'A') + 10; - - if ((p >= 'a') && (p <= 'f')) - return (p - 'a') + 10; - - return 0; -} - -/** - * set_date - stores the build date into the EEPROM - * - * This function takes a pointer to a string in the format "YYMMDDhhmmss" - * (2-digit year, 2-digit month, etc), converts it to a 6-byte BCD string, - * and stores it in the build date field of the EEPROM local copy. - */ -static void set_date(const char *string) -{ - unsigned int i; - - if (strlen(string) != 12) { - printf("Usage: mac date YYMMDDhhmmss\n"); - return; - } - - for (i = 0; i < 6; i++) - e.date[i] = h2i(string[2 * i]) << 4 | h2i(string[2 * i + 1]); - - update_crc(); -} - -/** - * set_mac_address - stores a MAC address into the EEPROM - * - * This function takes a pointer to MAC address string - * (i.e."XX:XX:XX:XX:XX:XX", where "XX" is a two-digit hex number) and - * stores it in one of the MAC address fields of the EEPROM local copy. - */ -static void set_mac_address(unsigned int index, const char *string) -{ - char *p = (char *)string; - unsigned int i; - - if ((index >= MAX_NUM_PORTS) || !string) { - printf("Usage: mac <n> XX:XX:XX:XX:XX:XX\n"); - return; - } - - for (i = 0; *p && (i < 6); i++) { - e.mac[index][i] = hextoul(p, &p); - if (*p == ':') - p++; - } - - update_crc(); -} - -int do_mac(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) -{ - char cmd; - - if (argc == 1) { - show_eeprom(); - return 0; - } - - cmd = argv[1][0]; - - if (cmd == 'r') { - read_eeprom(); - return 0; - } - - if (cmd == 'i') { - memcpy(e.id, "NXID", sizeof(e.id)); - e.version = NXID_VERSION; - update_crc(); - return 0; - } - - if (!is_valid) { - printf("Please read the EEPROM ('r') and/or set the ID ('i') first.\n"); - return 0; - } - - if (argc == 2) { - switch (cmd) { - case 's': /* save */ - prog_eeprom(); - break; - default: - return cmd_usage(cmdtp); - } - - return 0; - } - - /* We know we have at least one parameter */ - - switch (cmd) { - case 'n': /* serial number */ - memset(e.sn, 0, sizeof(e.sn)); - strncpy((char *)e.sn, argv[2], sizeof(e.sn) - 1); - update_crc(); - break; - case 'e': /* errata */ - memset(e.errata, 0, 5); - strncpy((char *)e.errata, argv[2], 4); - update_crc(); - break; - case 'd': /* date BCD format YYMMDDhhmmss */ - set_date(argv[2]); - break; - case 'p': /* MAC table size */ - e.mac_count = hextoul(argv[2], NULL); - update_crc(); - break; - case '0' ... '9': /* "mac 0" through "mac 22" */ - set_mac_address(dectoul(argv[1], NULL), argv[2]); - break; - case 'h': /* help */ - default: - return cmd_usage(cmdtp); - } - - return 0; -} - -int mac_read_from_generic_eeprom(const char *envvar, int chip, - int address, int mac_bus) -{ - int ret; - unsigned int bus; - unsigned char mac[6]; - char ethaddr[18]; - - bus = i2c_get_bus_num(); - i2c_set_bus_num(mac_bus); - - ret = i2c_read(chip, address, 1, mac, 6); - - i2c_set_bus_num(bus); - - if (!ret) { - sprintf(ethaddr, "%02X:%02X:%02X:%02X:%02X:%02X", - mac[0], - mac[1], - mac[2], - mac[3], - mac[4], - mac[5]); - - printf("MAC: %s\n", ethaddr); - env_set(envvar, ethaddr); - } - - return ret; -} - -void mac_read_from_fixed_id(void) -{ -#ifdef CONFIG_SYS_I2C_MAC1_CHIP_ADDR - mac_read_from_generic_eeprom("ethaddr", CONFIG_SYS_I2C_MAC1_CHIP_ADDR, - CONFIG_SYS_I2C_MAC1_DATA_ADDR, CONFIG_SYS_I2C_MAC1_BUS); -#endif -#ifdef CONFIG_SYS_I2C_MAC2_CHIP_ADDR - mac_read_from_generic_eeprom("eth1addr", CONFIG_SYS_I2C_MAC2_CHIP_ADDR, - CONFIG_SYS_I2C_MAC2_DATA_ADDR, CONFIG_SYS_I2C_MAC2_BUS); -#endif -} - -/** - * mac_read_from_eeprom - read the MAC addresses from EEPROM - * - * This function reads the MAC addresses from EEPROM and sets the - * appropriate environment variables for each one read. - * - * The environment variables are only set if they haven't been set already. - * This ensures that any user-saved variables are never overwritten. - * - * This function must be called after relocation. - * - * For NXID v1 EEPROMs, we support loading and up-converting the older NXID v0 - * format. In a v0 EEPROM, there are only eight MAC addresses and the CRC is - * located at a different offset. - */ -int mac_read_from_eeprom_common(void) -{ - unsigned int i; - u32 crc, crc_offset = offsetof(struct eeprom, crc); - u32 *crcp; /* Pointer to the CRC in the data read from the EEPROM */ - - puts("EEPROM: "); - - if (read_eeprom()) { - printf("Read failed.\n"); - return 0; - } - - if (!is_valid) { - printf("Invalid ID (%02x %02x %02x %02x)\n", - e.id[0], e.id[1], e.id[2], e.id[3]); - return 0; - } - - crc = crc32(0, (void *)&e, crc_offset); - crcp = (void *)&e + crc_offset; - if (crc != be32_to_cpu(*crcp)) { - printf("CRC mismatch (%08x != %08x)\n", crc, - be32_to_cpu(e.crc)); - return 0; - } - - /* - * MAC address #9 in v1 occupies the same position as the CRC in v0. - * Erase it so that it's not mistaken for a MAC address. We'll - * update the CRC later. - */ - if (e.version == 0) - memset(e.mac[8], 0xff, 6); - - for (i = 0; i < min(e.mac_count, (u8)MAX_NUM_PORTS); i++) { - if (memcmp(&e.mac[i], "\0\0\0\0\0\0", 6) && - memcmp(&e.mac[i], "\xFF\xFF\xFF\xFF\xFF\xFF", 6)) { - char ethaddr[18]; - char enetvar[9]; - - sprintf(ethaddr, "%02X:%02X:%02X:%02X:%02X:%02X", - e.mac[i][0], - e.mac[i][1], - e.mac[i][2], - e.mac[i][3], - e.mac[i][4], - e.mac[i][5]); - sprintf(enetvar, i ? "eth%daddr" : "ethaddr", i); - /* Only initialize environment variables that are blank - * (i.e. have not yet been set) - */ - if (!env_get(enetvar)) - env_set(enetvar, ethaddr); - } - } - - printf("%c%c%c%c v%u\n", e.id[0], e.id[1], e.id[2], e.id[3], - be32_to_cpu(e.version)); - - return 0; -} diff --git a/board/vscom/baltos/Makefile b/board/vscom/baltos/Makefile index c34b9b1dd8..3ccf66be5b 100644 --- a/board/vscom/baltos/Makefile +++ b/board/vscom/baltos/Makefile @@ -4,7 +4,7 @@ # # Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ -ifeq ($(CONFIG_SKIP_LOWLEVEL_INIT),) +ifeq ($(CONFIG_$(SPL_)SKIP_LOWLEVEL_INIT),) obj-y := mux.o endif diff --git a/board/vscom/baltos/board.c b/board/vscom/baltos/board.c index 0007cac1aa..07fe454471 100644 --- a/board/vscom/baltos/board.c +++ b/board/vscom/baltos/board.c @@ -187,7 +187,7 @@ void am33xx_spl_board_init(void) */ i2c_set_bus_num(1); - printf("I2C speed: %d Hz\n", CONFIG_SYS_OMAP24_I2C_SPEED); + printf("I2C speed: %d Hz\n", CONFIG_SYS_I2C_SPEED); if (i2c_probe(TPS65910_CTRL_I2C_ADDR)) { puts("i2c: cannot access TPS65910\n"); diff --git a/board/warp/Kconfig b/board/warp/Kconfig index dc02636319..9c2fc9df67 100644 --- a/board/warp/Kconfig +++ b/board/warp/Kconfig @@ -6,4 +6,7 @@ config SYS_BOARD config SYS_CONFIG_NAME default "warp" +config IMX_CONFIG + default "board/warp/imximage.cfg" + endif diff --git a/board/warp7/Kconfig b/board/warp7/Kconfig index c089bca2ba..e5051cdda6 100644 --- a/board/warp7/Kconfig +++ b/board/warp7/Kconfig @@ -20,4 +20,7 @@ config SYS_FDT_ADDR help The address the FDT file should be loaded to. +config IMX_CONFIG + default "board/warp7/imximage.cfg" + endif diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c index 0f202241dd..c5c5433048 100644 --- a/board/warp7/warp7.c +++ b/board/warp7/warp7.c @@ -134,7 +134,7 @@ int checkboard(void) int board_late_init(void) { struct wdog_regs *wdog = (struct wdog_regs *)WDOG1_BASE_ADDR; -#ifdef CONFIG_SERIAL_TAG +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG struct tag_serialnr serialnr; char serial_string[0x20]; #endif @@ -156,7 +156,7 @@ int board_late_init(void) env_set_ulong(HAB_ENABLED_ENVNAME, 0); #endif -#ifdef CONFIG_SERIAL_TAG +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG /* Set serial# standard environment variable based on OTP settings */ get_board_serial(&serialnr); snprintf(serial_string, sizeof(serial_string), "WaRP7-0x%08x%08x", diff --git a/board/work-microwave/work_92105/work_92105_display.c b/board/work-microwave/work_92105/work_92105_display.c index e8e559ce1f..5f625e6f52 100644 --- a/board/work-microwave/work_92105/work_92105_display.c +++ b/board/work-microwave/work_92105/work_92105_display.c @@ -20,6 +20,7 @@ #include <env.h> #include <spi.h> #include <i2c.h> +#include <timestamp.h> #include <version.h> #include <vsprintf.h> #include <linux/delay.h> |