diff options
author | Stefano Babic <sbabic@denx.de> | 2014-09-22 17:51:01 +0400 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2014-09-22 17:51:01 +0400 |
commit | 42817eb85de1d7dec399c75dbd133ea6b5351a72 (patch) | |
tree | cf93368fd5642cc995055f764103f85d7abbedf1 | |
parent | 7a56bddd7fb9fe27c775cadd18ebde6f883d7cff (diff) | |
parent | 2a8c9c86b92a9ccee3c27286de317e19bb0530b3 (diff) | |
download | u-boot-42817eb85de1d7dec399c75dbd133ea6b5351a72.tar.xz |
Merge branch 'master' of git://git.denx.de/u-boot-arm
846 files changed, 13109 insertions, 3386 deletions
diff --git a/Licenses/README b/Licenses/README index c6ff2774fc..fe6dadcc7d 100644 --- a/Licenses/README +++ b/Licenses/README @@ -66,3 +66,4 @@ BSD 2-Clause License BSD-2-Clause Y bsd-2-clause.txt http://spdx.org/license BSD 3-clause "New" or "Revised" License BSD-3-Clause Y bsd-3-clause.txt http://spdx.org/licenses/BSD-3-Clause#licenseText IBM PIBS (PowerPC Initialization and IBM-pibs ibm-pibs.txt Boot Software) license +ISC License ISC Y isc.txt https://spdx.org/licenses/ISC diff --git a/Licenses/isc.txt b/Licenses/isc.txt new file mode 100644 index 0000000000..4b7c2ba25b --- /dev/null +++ b/Licenses/isc.txt @@ -0,0 +1,17 @@ +ISC License: +Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC") +Copyright (c) 1995-2003 by Internet Software Consortium + +Permission to use, copy, modify, and/or distribute this software +for any purpose with or without fee is hereby granted, +provided that the above copyright notice and this permission notice +appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE +FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. @@ -341,7 +341,7 @@ CHECK = sparse CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ -Wbitwise -Wno-return-void -D__CHECK_ENDIAN__ $(CF) -KBUILD_CPPFLAGS := -D__KERNEL__ +KBUILD_CPPFLAGS := -D__KERNEL__ -D__UBOOT__ KBUILD_CFLAGS := -Wall -Wstrict-prototypes \ -Wno-format-security \ @@ -458,7 +458,7 @@ KBUILD_DEFCONFIG := sandbox_defconfig export KBUILD_DEFCONFIG KBUILD_KCONFIG config: scripts_basic outputmakefile FORCE - (Q)$(MAKE) $(build)=scripts/kconfig $@ + +$(Q)$(CONFIG_SHELL) $(srctree)/scripts/multiconfig.sh $@ %config: scripts_basic outputmakefile FORCE +$(Q)$(CONFIG_SHELL) $(srctree)/scripts/multiconfig.sh $@ diff --git a/arch/Kconfig b/arch/Kconfig index 8620a4f94b..c9ccb7db17 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -49,6 +49,62 @@ config X86 endchoice +config SYS_ARCH + string + help + This option should contain the architecture name to build the + appropriate arch/<CONFIG_SYS_ARCH> directory. + All the architectures should specify this option correctly. + +config SYS_CPU + string + help + This option should contain the CPU name to build the correct + arch/<CONFIG_SYS_ARCH>/cpu/<CONFIG_SYS_CPU> directory. + + This is optional. For those targets without the CPU directory, + leave this option empty. + +config SYS_SOC + string + help + This option should contain the SoC name to build the directory + arch/<CONFIG_SYS_ARCH>/cpu/<CONFIG_SYS_CPU>/<CONFIG_SYS_SOC>. + + This is optional. For those targets without the SoC directory, + leave this option empty. + +config SYS_VENDOR + string + help + This option should contain the vendor name of the target board. + If it is set and + board/<CONFIG_SYS_VENDOR>/common/Makefile exists, the vendor common + directory is compiled. + If CONFIG_SYS_BOARD is also set, the sources under + board/<CONFIG_SYS_VENDOR>/<CONFIG_SYS_BOARD> directory are compiled. + + This is optional. For those targets without the vendor directory, + leave this option empty. + +config SYS_BOARD + string + help + This option should contain the name of the target board. + If it is set, either board/<CONFIG_SYS_VENDOR>/<CONFIG_SYS_BOARD> + or board/<CONFIG_SYS_BOARD> directory is compiled depending on + whether CONFIG_SYS_VENDOR is set or not. + + This is optional. For those targets without the board directory, + leave this option empty. + +config SYS_CONFIG_NAME + string + help + This option should contain the base name of board header file. + The header file include/configs/<CONFIG_SYS_CONFIG_NAME>.h + should be included from include/config.h. + source "arch/arc/Kconfig" source "arch/arm/Kconfig" source "arch/avr32/Kconfig" diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig index 51d5aff08e..d3ef58be04 100644 --- a/arch/arc/Kconfig +++ b/arch/arc/Kconfig @@ -2,7 +2,6 @@ menu "ARC architecture" depends on ARC config SYS_ARCH - string default "arc" choice diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index f933123395..106aed985f 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -2,9 +2,11 @@ menu "ARM architecture" depends on ARM config SYS_ARCH - string default "arm" +config ARM64 + bool + choice prompt "Target select" @@ -463,15 +465,21 @@ config TEGRA config TARGET_VEXPRESS_AEMV8A bool "Support vexpress_aemv8a" - -config TARGET_VEXPRESS_AEMV8A_SEMI - bool "Support vexpress_aemv8a_semi" + select ARM64 config TARGET_LS2085A_EMU bool "Support ls2085a_emu" + select ARM64 config TARGET_LS2085A_SIMU bool "Support ls2085a_simu" + select ARM64 + +config TARGET_LS1021AQDS + bool "Support ls1021aqds_nor" + +config TARGET_LS1021ATWR + bool "Support ls1021atwr_nor" config TARGET_BALLOON3 bool "Support balloon3" @@ -514,6 +522,8 @@ config TARGET_JORNADA endchoice +source "arch/arm/cpu/armv8/Kconfig" + source "arch/arm/cpu/arm926ejs/davinci/Kconfig" source "arch/arm/cpu/armv7/exynos/Kconfig" @@ -598,6 +608,8 @@ source "board/eukrea/cpu9260/Kconfig" source "board/eukrea/cpuat91/Kconfig" source "board/faraday/a320evb/Kconfig" source "board/freescale/ls2085a/Kconfig" +source "board/freescale/ls1021aqds/Kconfig" +source "board/freescale/ls1021atwr/Kconfig" source "board/freescale/mx23evk/Kconfig" source "board/freescale/mx25pdk/Kconfig" source "board/freescale/mx28evk/Kconfig" diff --git a/arch/arm/cpu/arm926ejs/davinci/Kconfig b/arch/arm/cpu/arm926ejs/davinci/Kconfig index be1b0f9126..4c18ab631e 100644 --- a/arch/arm/cpu/arm926ejs/davinci/Kconfig +++ b/arch/arm/cpu/arm926ejs/davinci/Kconfig @@ -54,11 +54,9 @@ config TARGET_CALIMAIN endchoice config SYS_CPU - string default "arm926ejs" config SYS_SOC - string default "davinci" source "board/enbw/enbw_cmc/Kconfig" diff --git a/arch/arm/cpu/arm926ejs/kirkwood/Kconfig b/arch/arm/cpu/arm926ejs/kirkwood/Kconfig index 58867f3cf1..91ffedf732 100644 --- a/arch/arm/cpu/arm926ejs/kirkwood/Kconfig +++ b/arch/arm/cpu/arm926ejs/kirkwood/Kconfig @@ -60,11 +60,9 @@ config TARGET_GOFLEXHOME endchoice config SYS_CPU - string default "arm926ejs" config SYS_SOC - string default "kirkwood" source "board/Marvell/openrd/Kconfig" diff --git a/arch/arm/cpu/arm926ejs/nomadik/Kconfig b/arch/arm/cpu/arm926ejs/nomadik/Kconfig index 7177800a61..eda51fdc37 100644 --- a/arch/arm/cpu/arm926ejs/nomadik/Kconfig +++ b/arch/arm/cpu/arm926ejs/nomadik/Kconfig @@ -9,11 +9,9 @@ config NOMADIK_NHK8815 endchoice config SYS_CPU - string default "arm926ejs" config SYS_SOC - string default "nomadik" source "board/st/nhk8815/Kconfig" diff --git a/arch/arm/cpu/arm926ejs/orion5x/Kconfig b/arch/arm/cpu/arm926ejs/orion5x/Kconfig index aa40099037..2d0ab2be17 100644 --- a/arch/arm/cpu/arm926ejs/orion5x/Kconfig +++ b/arch/arm/cpu/arm926ejs/orion5x/Kconfig @@ -9,11 +9,9 @@ config TARGET_EDMINIV2 endchoice config SYS_CPU - string default "arm926ejs" config SYS_SOC - string default "orion5x" source "board/LaCie/edminiv2/Kconfig" diff --git a/arch/arm/cpu/arm926ejs/versatile/Kconfig b/arch/arm/cpu/arm926ejs/versatile/Kconfig index fc29c9800f..35c16d876c 100644 --- a/arch/arm/cpu/arm926ejs/versatile/Kconfig +++ b/arch/arm/cpu/arm926ejs/versatile/Kconfig @@ -1,23 +1,18 @@ if ARCH_VERSATILE config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "versatile" config SYS_VENDOR - string default "armltd" config SYS_SOC - string default "versatile" config SYS_CONFIG_NAME - string default "versatile" endif diff --git a/arch/arm/cpu/armv7/at91/clock.c b/arch/arm/cpu/armv7/at91/clock.c index 1588e0c8ea..36ed4a6394 100644 --- a/arch/arm/cpu/armv7/at91/clock.c +++ b/arch/arm/cpu/armv7/at91/clock.c @@ -114,9 +114,25 @@ int at91_clock_init(unsigned long main_clock) void at91_periph_clk_enable(int id) { struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC; + u32 regval; - if (id > 31) - writel(1 << (id - 32), &pmc->pcer1); - else - writel(1 << id, &pmc->pcer); + if (id > AT91_PMC_PCR_PID_MASK) + return; + + regval = AT91_PMC_PCR_EN | AT91_PMC_PCR_CMD_WRITE | id; + + writel(regval, &pmc->pcr); +} + +void at91_periph_clk_disable(int id) +{ + struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC; + u32 regval; + + if (id > AT91_PMC_PCR_PID_MASK) + return; + + regval = AT91_PMC_PCR_CMD_WRITE | id; + + writel(regval, &pmc->pcr); } diff --git a/arch/arm/cpu/armv7/exynos/Kconfig b/arch/arm/cpu/armv7/exynos/Kconfig index b6a558b235..d132f03514 100644 --- a/arch/arm/cpu/armv7/exynos/Kconfig +++ b/arch/arm/cpu/armv7/exynos/Kconfig @@ -39,11 +39,9 @@ config TARGET_PEACH_PIT endchoice config SYS_CPU - string default "armv7" config SYS_SOC - string default "exynos" source "board/samsung/smdkv310/Kconfig" diff --git a/arch/arm/cpu/armv7/highbank/Kconfig b/arch/arm/cpu/armv7/highbank/Kconfig index 9527928f6a..29ff99511c 100644 --- a/arch/arm/cpu/armv7/highbank/Kconfig +++ b/arch/arm/cpu/armv7/highbank/Kconfig @@ -1,19 +1,15 @@ if ARCH_HIGHBANK config SYS_CPU - string default "armv7" config SYS_BOARD - string default "highbank" config SYS_SOC - string default "highbank" config SYS_CONFIG_NAME - string default "highbank" endif diff --git a/arch/arm/cpu/armv7/keystone/Kconfig b/arch/arm/cpu/armv7/keystone/Kconfig index 24d0cbe820..8249b5e270 100644 --- a/arch/arm/cpu/armv7/keystone/Kconfig +++ b/arch/arm/cpu/armv7/keystone/Kconfig @@ -12,11 +12,9 @@ config TARGET_K2E_EVM endchoice config SYS_CPU - string default "armv7" config SYS_SOC - string default "keystone" source "board/ti/ks2_evm/Kconfig" diff --git a/arch/arm/cpu/armv7/keystone/ddr3.c b/arch/arm/cpu/armv7/keystone/ddr3.c index 2391e794e8..2eabec10f9 100644 --- a/arch/arm/cpu/armv7/keystone/ddr3.c +++ b/arch/arm/cpu/armv7/keystone/ddr3.c @@ -10,6 +10,7 @@ #include <asm/io.h> #include <common.h> #include <asm/arch/ddr3.h> +#include <asm/arch/psc_defs.h> void ddr3_init_ddrphy(u32 base, struct ddr3_phy_config *phy_cfg) { @@ -86,3 +87,77 @@ void ddr3_reset_ddrphy(void) tmp &= ~KS2_DDR3_PLLCTRL_PHY_RESET; __raw_writel(tmp, KS2_DDR3APLLCTL1); } + +#ifdef CONFIG_SOC_K2HK +/** + * ddr3_reset_workaround - reset workaround in case if leveling error + * detected for PG 1.0 and 1.1 k2hk SoCs + */ +void ddr3_err_reset_workaround(void) +{ + unsigned int tmp; + unsigned int tmp_a; + unsigned int tmp_b; + + /* + * Check for PGSR0 error bits of DDR3 PHY. + * Check for WLERR, QSGERR, WLAERR, + * RDERR, WDERR, REERR, WEERR error to see if they are set or not + */ + tmp_a = __raw_readl(KS2_DDR3A_DDRPHYC + KS2_DDRPHY_PGSR0_OFFSET); + tmp_b = __raw_readl(KS2_DDR3B_DDRPHYC + KS2_DDRPHY_PGSR0_OFFSET); + + if (((tmp_a & 0x0FE00000) != 0) || ((tmp_b & 0x0FE00000) != 0)) { + printf("DDR Leveling Error Detected!\n"); + printf("DDR3A PGSR0 = 0x%x\n", tmp_a); + printf("DDR3B PGSR0 = 0x%x\n", tmp_b); + + /* + * Write Keys to KICK registers to enable writes to registers + * in boot config space + */ + __raw_writel(KS2_KICK0_MAGIC, KS2_KICK0); + __raw_writel(KS2_KICK1_MAGIC, KS2_KICK1); + + /* + * Move DDR3A Module out of reset isolation by setting + * MDCTL23[12] = 0 + */ + tmp_a = __raw_readl(KS2_PSC_BASE + + PSC_REG_MDCTL(KS2_LPSC_EMIF4F_DDR3A)); + + tmp_a = PSC_REG_MDCTL_SET_RESET_ISO(tmp_a, 0); + __raw_writel(tmp_a, KS2_PSC_BASE + + PSC_REG_MDCTL(KS2_LPSC_EMIF4F_DDR3A)); + + /* + * Move DDR3B Module out of reset isolation by setting + * MDCTL24[12] = 0 + */ + tmp_b = __raw_readl(KS2_PSC_BASE + + PSC_REG_MDCTL(KS2_LPSC_EMIF4F_DDR3B)); + tmp_b = PSC_REG_MDCTL_SET_RESET_ISO(tmp_b, 0); + __raw_writel(tmp_b, KS2_PSC_BASE + + PSC_REG_MDCTL(KS2_LPSC_EMIF4F_DDR3B)); + + /* + * Write 0x5A69 Key to RSTCTRL[15:0] to unlock writes + * to RSTCTRL and RSTCFG + */ + tmp = __raw_readl(KS2_RSTCTRL); + tmp &= KS2_RSTCTRL_MASK; + tmp |= KS2_RSTCTRL_KEY; + __raw_writel(tmp, KS2_RSTCTRL); + + /* + * Set PLL Controller to drive hard reset on SW trigger by + * setting RSTCFG[13] = 0 + */ + tmp = __raw_readl(KS2_RSTCTRL_RSCFG); + tmp &= ~KS2_RSTYPE_PLL_SOFT; + __raw_writel(tmp, KS2_RSTCTRL_RSCFG); + + reset_cpu(0); + } +} +#endif diff --git a/arch/arm/cpu/armv7/ls102xa/Makefile b/arch/arm/cpu/armv7/ls102xa/Makefile new file mode 100644 index 0000000000..d82ce8d014 --- /dev/null +++ b/arch/arm/cpu/armv7/ls102xa/Makefile @@ -0,0 +1,12 @@ +# +# Copyright 2014 Freescale Semiconductor, Inc. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += cpu.o +obj-y += clock.o +obj-y += timer.o + +obj-$(CONFIG_OF_LIBFDT) += fdt.o +obj-$(CONFIG_SYS_HAS_SERDES) += fsl_ls1_serdes.o ls102xa_serdes.o diff --git a/arch/arm/cpu/armv7/ls102xa/clock.c b/arch/arm/cpu/armv7/ls102xa/clock.c new file mode 100644 index 0000000000..8f80c6175f --- /dev/null +++ b/arch/arm/cpu/armv7/ls102xa/clock.c @@ -0,0 +1,130 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <asm/io.h> +#include <asm/arch/immap_ls102xa.h> +#include <asm/arch/clock.h> +#include <fsl_ifc.h> + +DECLARE_GLOBAL_DATA_PTR; + +#ifndef CONFIG_SYS_FSL_NUM_CC_PLLS +#define CONFIG_SYS_FSL_NUM_CC_PLLS 2 +#endif + +void get_sys_info(struct sys_info *sys_info) +{ + struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR); +#ifdef CONFIG_FSL_IFC + struct fsl_ifc *ifc_regs = (void *)CONFIG_SYS_IFC_ADDR; + u32 ccr; +#endif + struct ccsr_clk *clk = (void *)(CONFIG_SYS_FSL_LS1_CLK_ADDR); + unsigned int cpu; + const u8 core_cplx_pll[6] = { + [0] = 0, /* CC1 PPL / 1 */ + [1] = 0, /* CC1 PPL / 2 */ + [4] = 1, /* CC2 PPL / 1 */ + [5] = 1, /* CC2 PPL / 2 */ + }; + + const u8 core_cplx_pll_div[6] = { + [0] = 1, /* CC1 PPL / 1 */ + [1] = 2, /* CC1 PPL / 2 */ + [4] = 1, /* CC2 PPL / 1 */ + [5] = 2, /* CC2 PPL / 2 */ + }; + + uint i; + uint freq_c_pll[CONFIG_SYS_FSL_NUM_CC_PLLS]; + uint ratio[CONFIG_SYS_FSL_NUM_CC_PLLS]; + unsigned long sysclk = CONFIG_SYS_CLK_FREQ; + + sys_info->freq_systembus = sysclk; +#ifdef CONFIG_DDR_CLK_FREQ + sys_info->freq_ddrbus = CONFIG_DDR_CLK_FREQ; +#else + sys_info->freq_ddrbus = sysclk; +#endif + + sys_info->freq_systembus *= (in_be32(&gur->rcwsr[0]) >> + RCWSR0_SYS_PLL_RAT_SHIFT) & RCWSR0_SYS_PLL_RAT_MASK; + sys_info->freq_ddrbus *= (in_be32(&gur->rcwsr[0]) >> + RCWSR0_MEM_PLL_RAT_SHIFT) & RCWSR0_MEM_PLL_RAT_MASK; + + for (i = 0; i < CONFIG_SYS_FSL_NUM_CC_PLLS; i++) { + ratio[i] = (in_be32(&clk->pllcgsr[i].pllcngsr) >> 1) & 0x3f; + if (ratio[i] > 4) + freq_c_pll[i] = sysclk * ratio[i]; + else + freq_c_pll[i] = sys_info->freq_systembus * ratio[i]; + } + + for (cpu = 0; cpu < CONFIG_MAX_CPUS; cpu++) { + u32 c_pll_sel = (in_be32(&clk->clkcsr[cpu].clkcncsr) >> 27) + & 0xf; + u32 cplx_pll = core_cplx_pll[c_pll_sel]; + + sys_info->freq_processor[cpu] = + freq_c_pll[cplx_pll] / core_cplx_pll_div[c_pll_sel]; + } + +#if defined(CONFIG_FSL_IFC) + ccr = in_be32(&ifc_regs->ifc_ccr); + ccr = ((ccr & IFC_CCR_CLK_DIV_MASK) >> IFC_CCR_CLK_DIV_SHIFT) + 1; + + sys_info->freq_localbus = sys_info->freq_systembus / ccr; +#endif +} + +int get_clocks(void) +{ + struct sys_info sys_info; + + get_sys_info(&sys_info); + gd->cpu_clk = sys_info.freq_processor[0]; + gd->bus_clk = sys_info.freq_systembus; + gd->mem_clk = sys_info.freq_ddrbus * 2; + +#if defined(CONFIG_FSL_ESDHC) + gd->arch.sdhc_clk = gd->bus_clk; +#endif + + return 0; +} + +ulong get_bus_freq(ulong dummy) +{ + return gd->bus_clk; +} + +ulong get_ddr_freq(ulong dummy) +{ + return gd->mem_clk; +} + +int get_serial_clock(void) +{ + return gd->bus_clk / 2; +} + +unsigned int mxc_get_clock(enum mxc_clock clk) +{ + switch (clk) { + case MXC_I2C_CLK: + return get_bus_freq(0) / 2; + case MXC_ESDHC_CLK: + return get_bus_freq(0); + case MXC_DSPI_CLK: + return get_bus_freq(0) / 2; + case MXC_UART_CLK: + return get_bus_freq(0) / 2; + default: + printf("Unsupported clock\n"); + } + return 0; +} diff --git a/arch/arm/cpu/armv7/ls102xa/cpu.c b/arch/arm/cpu/armv7/ls102xa/cpu.c new file mode 100644 index 0000000000..b7dde45ed3 --- /dev/null +++ b/arch/arm/cpu/armv7/ls102xa/cpu.c @@ -0,0 +1,103 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <asm/arch/clock.h> +#include <asm/io.h> +#include <asm/arch/immap_ls102xa.h> +#include <tsec.h> +#include <netdev.h> +#include <fsl_esdhc.h> + +DECLARE_GLOBAL_DATA_PTR; + +#if defined(CONFIG_DISPLAY_CPUINFO) +int print_cpuinfo(void) +{ + char buf1[32], buf2[32]; + struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR); + unsigned int svr, major, minor, ver, i; + + svr = in_be32(&gur->svr); + major = SVR_MAJ(svr); + minor = SVR_MIN(svr); + + puts("CPU: Freescale LayerScape "); + + ver = SVR_SOC_VER(svr); + switch (ver) { + case SOC_VER_SLS1020: + puts("SLS1020"); + break; + case SOC_VER_LS1020: + puts("LS1020"); + break; + case SOC_VER_LS1021: + puts("LS1021"); + break; + case SOC_VER_LS1022: + puts("LS1022"); + break; + default: + puts("Unknown"); + break; + } + + if (IS_E_PROCESSOR(svr) && (ver != SOC_VER_SLS1020)) + puts("E"); + + printf(", Version: %d.%d, (0x%08x)\n", major, minor, svr); + + puts("Clock Configuration:"); + + printf("\n CPU0(ARMV7):%-4s MHz, ", strmhz(buf1, gd->cpu_clk)); + printf("\n Bus:%-4s MHz, ", strmhz(buf1, gd->bus_clk)); + printf("DDR:%-4s MHz (%s MT/s data rate), ", + strmhz(buf1, gd->mem_clk/2), strmhz(buf2, gd->mem_clk)); + puts("\n"); + + /* Display the RCW, so that no one gets confused as to what RCW + * we're actually using for this boot. + */ + puts("Reset Configuration Word (RCW):"); + for (i = 0; i < ARRAY_SIZE(gur->rcwsr); i++) { + u32 rcw = in_be32(&gur->rcwsr[i]); + + if ((i % 4) == 0) + printf("\n %08x:", i * 4); + printf(" %08x", rcw); + } + puts("\n"); + + return 0; +} +#endif + +void enable_caches(void) +{ +#ifndef CONFIG_SYS_ICACHE_OFF + icache_enable(); +#endif +#ifndef CONFIG_SYS_DCACHE_OFF + dcache_enable(); +#endif +} + +#ifdef CONFIG_FSL_ESDHC +int cpu_mmc_init(bd_t *bis) +{ + return fsl_esdhc_mmc_init(bis); +} +#endif + +int cpu_eth_init(bd_t *bis) +{ +#ifdef CONFIG_TSEC_ENET + tsec_standard_init(bis); +#endif + + return 0; +} diff --git a/arch/arm/cpu/armv7/ls102xa/fdt.c b/arch/arm/cpu/armv7/ls102xa/fdt.c new file mode 100644 index 0000000000..4ce38086f4 --- /dev/null +++ b/arch/arm/cpu/armv7/ls102xa/fdt.c @@ -0,0 +1,136 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <libfdt.h> +#include <fdt_support.h> +#include <asm/io.h> +#include <asm/processor.h> +#include <asm/arch/clock.h> +#include <linux/ctype.h> +#ifdef CONFIG_FSL_ESDHC +#include <fsl_esdhc.h> +#endif +#include <tsec.h> + +DECLARE_GLOBAL_DATA_PTR; + +void ft_fixup_enet_phy_connect_type(void *fdt) +{ + struct eth_device *dev; + struct tsec_private *priv; + const char *enet_path, *phy_path; + char enet[16]; + char phy[16]; + int phy_node; + int i = 0; + int enet_id = 0; + uint32_t ph; + + while ((dev = eth_get_dev_by_index(i++)) != NULL) { + if (strstr(dev->name, "eTSEC1")) + enet_id = 0; + else if (strstr(dev->name, "eTSEC2")) + enet_id = 1; + else if (strstr(dev->name, "eTSEC3")) + enet_id = 2; + else + continue; + + priv = dev->priv; + if (priv->flags & TSEC_SGMII) + continue; + + sprintf(enet, "ethernet%d", enet_id); + enet_path = fdt_get_alias(fdt, enet); + if (!enet_path) + continue; + + sprintf(phy, "enet%d_rgmii_phy", enet_id); + phy_path = fdt_get_alias(fdt, phy); + if (!phy_path) + continue; + + phy_node = fdt_path_offset(fdt, phy_path); + if (phy_node < 0) + continue; + + ph = fdt_create_phandle(fdt, phy_node); + if (ph) + do_fixup_by_path_u32(fdt, enet_path, + "phy-handle", ph, 1); + + do_fixup_by_path(fdt, enet_path, "phy-connection-type", + phy_string_for_interface( + PHY_INTERFACE_MODE_RGMII_ID), + sizeof(phy_string_for_interface( + PHY_INTERFACE_MODE_RGMII_ID)), + 1); + } +} + +void ft_cpu_setup(void *blob, bd_t *bd) +{ + int off; + int val; + const char *sysclk_path; + + unsigned long busclk = get_bus_freq(0); + + fdt_fixup_ethernet(blob); + + off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4); + while (off != -FDT_ERR_NOTFOUND) { + val = gd->cpu_clk; + fdt_setprop(blob, off, "clock-frequency", &val, 4); + off = fdt_node_offset_by_prop_value(blob, off, + "device_type", "cpu", 4); + } + + do_fixup_by_prop_u32(blob, "device_type", "soc", + 4, "bus-frequency", busclk / 2, 1); + + ft_fixup_enet_phy_connect_type(blob); + +#ifdef CONFIG_SYS_NS16550 + do_fixup_by_compat_u32(blob, "fsl,16550-FIFO64", + "clock-frequency", CONFIG_SYS_NS16550_CLK, 1); +#endif + + sysclk_path = fdt_get_alias(blob, "sysclk"); + if (sysclk_path) + do_fixup_by_path_u32(blob, sysclk_path, "clock-frequency", + CONFIG_SYS_CLK_FREQ, 1); + do_fixup_by_compat_u32(blob, "fsl,qoriq-sysclk-2.0", + "clock-frequency", CONFIG_SYS_CLK_FREQ, 1); + +#if defined(CONFIG_FSL_ESDHC) + fdt_fixup_esdhc(blob, bd); +#endif + + /* + * platform bus clock = system bus clock/2 + * Here busclk = system bus clock + * We are using the platform bus clock as 1588 Timer reference + * clock source select + */ + do_fixup_by_compat_u32(blob, "fsl, gianfar-ptp-timer", + "timer-frequency", busclk / 2, 1); + + /* + * clock-freq should change to clock-frequency and + * flexcan-v1.0 should change to p1010-flexcan respectively + * in the future. + */ + do_fixup_by_compat_u32(blob, "fsl, flexcan-v1.0", + "clock_freq", busclk / 2, 1); + + do_fixup_by_compat_u32(blob, "fsl, flexcan-v1.0", + "clock-frequency", busclk / 2, 1); + + do_fixup_by_compat_u32(blob, "fsl, ls1021a-flexcan", + "clock-frequency", busclk / 2, 1); +} diff --git a/arch/arm/cpu/armv7/ls102xa/fsl_ls1_serdes.c b/arch/arm/cpu/armv7/ls102xa/fsl_ls1_serdes.c new file mode 100644 index 0000000000..9b78acb25a --- /dev/null +++ b/arch/arm/cpu/armv7/ls102xa/fsl_ls1_serdes.c @@ -0,0 +1,120 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <asm/arch/fsl_serdes.h> +#include <asm/arch/immap_ls102xa.h> +#include <asm/errno.h> +#include <asm/io.h> +#include "fsl_ls1_serdes.h" + +#ifdef CONFIG_SYS_FSL_SRDS_1 +static u64 serdes1_prtcl_map; +#endif +#ifdef CONFIG_SYS_FSL_SRDS_2 +static u64 serdes2_prtcl_map; +#endif + +int is_serdes_configured(enum srds_prtcl device) +{ + u64 ret = 0; + +#ifdef CONFIG_SYS_FSL_SRDS_1 + ret |= (1ULL << device) & serdes1_prtcl_map; +#endif +#ifdef CONFIG_SYS_FSL_SRDS_2 + ret |= (1ULL << device) & serdes2_prtcl_map; +#endif + + return !!ret; +} + +int serdes_get_first_lane(u32 sd, enum srds_prtcl device) +{ + struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR); + u32 cfg = in_be32(&gur->rcwsr[4]); + int i; + + switch (sd) { +#ifdef CONFIG_SYS_FSL_SRDS_1 + case FSL_SRDS_1: + cfg &= RCWSR4_SRDS1_PRTCL_MASK; + cfg >>= RCWSR4_SRDS1_PRTCL_SHIFT; + break; +#endif +#ifdef CONFIG_SYS_FSL_SRDS_2 + case FSL_SRDS_2: + cfg &= RCWSR4_SRDS2_PRTCL_MASK; + cfg >>= RCWSR4_SRDS2_PRTCL_SHIFT; + break; +#endif + default: + printf("invalid SerDes%d\n", sd); + break; + } + /* Is serdes enabled at all? */ + if (unlikely(cfg == 0)) + return -ENODEV; + + for (i = 0; i < SRDS_MAX_LANES; i++) { + if (serdes_get_prtcl(sd, cfg, i) == device) + return i; + } + + return -ENODEV; +} + +u64 serdes_init(u32 sd, u32 sd_addr, u32 sd_prctl_mask, u32 sd_prctl_shift) +{ + struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR); + u64 serdes_prtcl_map = 0; + u32 cfg; + int lane; + + cfg = in_be32(&gur->rcwsr[4]) & sd_prctl_mask; + cfg >>= sd_prctl_shift; + printf("Using SERDES%d Protocol: %d (0x%x)\n", sd + 1, cfg, cfg); + + if (!is_serdes_prtcl_valid(sd, cfg)) + printf("SERDES%d[PRTCL] = 0x%x is not valid\n", sd + 1, cfg); + + for (lane = 0; lane < SRDS_MAX_LANES; lane++) { + enum srds_prtcl lane_prtcl = serdes_get_prtcl(sd, cfg, lane); + + serdes_prtcl_map |= (1ULL << lane_prtcl); + } + + return serdes_prtcl_map; +} + +void fsl_serdes_init(void) +{ +#ifdef CONFIG_SYS_FSL_SRDS_1 + serdes1_prtcl_map = serdes_init(FSL_SRDS_1, + CONFIG_SYS_FSL_SERDES_ADDR, + RCWSR4_SRDS1_PRTCL_MASK, + RCWSR4_SRDS1_PRTCL_SHIFT); +#endif +#ifdef CONFIG_SYS_FSL_SRDS_2 + serdes2_prtcl_map = serdes_init(FSL_SRDS_2, + CONFIG_SYS_FSL_SERDES_ADDR + + FSL_SRDS_2 * 0x1000, + RCWSR4_SRDS2_PRTCL_MASK, + RCWSR4_SRDS2_PRTCL_SHIFT); +#endif +} + +const char *serdes_clock_to_string(u32 clock) +{ + switch (clock) { + case SRDS_PLLCR0_RFCK_SEL_100: + return "100"; + case SRDS_PLLCR0_RFCK_SEL_125: + return "125"; + default: + return "100"; + } +} diff --git a/arch/arm/cpu/armv7/ls102xa/fsl_ls1_serdes.h b/arch/arm/cpu/armv7/ls102xa/fsl_ls1_serdes.h new file mode 100644 index 0000000000..834aa532bf --- /dev/null +++ b/arch/arm/cpu/armv7/ls102xa/fsl_ls1_serdes.h @@ -0,0 +1,12 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __FSL_LS1_SERDES_H +#define __FSL_LS1_SERDES_H + +int is_serdes_prtcl_valid(int serdes, u32 prtcl); +int serdes_lane_enabled(int lane); +#endif /* __FSL_LS1_SERDES_H */ diff --git a/arch/arm/cpu/armv7/ls102xa/ls102xa_serdes.c b/arch/arm/cpu/armv7/ls102xa/ls102xa_serdes.c new file mode 100644 index 0000000000..cc53910bbb --- /dev/null +++ b/arch/arm/cpu/armv7/ls102xa/ls102xa_serdes.c @@ -0,0 +1,41 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <asm/arch/fsl_serdes.h> +#include <asm/arch/immap_ls102xa.h> + +static u8 serdes_cfg_tbl[][SRDS_MAX_LANES] = { + [0x00] = {PCIE1, PCIE1, PCIE1, PCIE1}, + [0x10] = {PCIE1, SATA1, PCIE2, PCIE2}, + [0x20] = {PCIE1, SGMII_TSEC1, PCIE2, SGMII_TSEC2}, + [0x30] = {PCIE1, SATA1, SGMII_TSEC1, SGMII_TSEC2}, + [0x40] = {PCIE1, PCIE1, SATA1, SGMII_TSEC2}, + [0x50] = {PCIE1, PCIE1, PCIE2, SGMII_TSEC2}, + [0x60] = {PCIE1, PCIE1, SGMII_TSEC1, SGMII_TSEC2}, + [0x70] = {PCIE1, SATA1, PCIE2, SGMII_TSEC2}, + [0x80] = {PCIE2, PCIE2, PCIE2, PCIE2}, +}; + +enum srds_prtcl serdes_get_prtcl(int serdes, int cfg, int lane) +{ + return serdes_cfg_tbl[cfg][lane]; +} + +int is_serdes_prtcl_valid(int serdes, u32 prtcl) +{ + int i; + + if (prtcl >= ARRAY_SIZE(serdes_cfg_tbl)) + return 0; + + for (i = 0; i < SRDS_MAX_LANES; i++) { + if (serdes_cfg_tbl[prtcl][i] != NONE) + return 1; + } + + return 0; +} diff --git a/arch/arm/cpu/armv7/ls102xa/timer.c b/arch/arm/cpu/armv7/ls102xa/timer.c new file mode 100644 index 0000000000..11b17b2c74 --- /dev/null +++ b/arch/arm/cpu/armv7/ls102xa/timer.c @@ -0,0 +1,127 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <asm/io.h> +#include <div64.h> +#include <asm/arch/immap_ls102xa.h> +#include <asm/arch/clock.h> + +DECLARE_GLOBAL_DATA_PTR; + +/* + * This function is intended for SHORT delays only. + * It will overflow at around 10 seconds @ 400MHz, + * or 20 seconds @ 200MHz. + */ +unsigned long usec2ticks(unsigned long usec) +{ + ulong ticks; + + if (usec < 1000) + ticks = ((usec * (get_tbclk()/1000)) + 500) / 1000; + else + ticks = ((usec / 10) * (get_tbclk() / 100000)); + + return ticks; +} + +static inline unsigned long long tick_to_time(unsigned long long tick) +{ + unsigned long freq; + + asm volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (freq)); + + tick *= CONFIG_SYS_HZ; + do_div(tick, freq); + + return tick; +} + +static inline unsigned long long us_to_tick(unsigned long long usec) +{ + unsigned long freq; + + asm volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (freq)); + + usec = usec * freq + 999999; + do_div(usec, 1000000); + + return usec; +} + +int timer_init(void) +{ + struct sctr_regs *sctr = (struct sctr_regs *)SCTR_BASE_ADDR; + unsigned long ctrl, val, freq; + + /* Enable System Counter */ + writel(SYS_COUNTER_CTRL_ENABLE, &sctr->cntcr); + + freq = GENERIC_TIMER_CLK; + asm("mcr p15, 0, %0, c14, c0, 0" : : "r" (freq)); + + /* Set PL1 Physical Timer Ctrl */ + ctrl = ARCH_TIMER_CTRL_ENABLE; + asm("mcr p15, 0, %0, c14, c2, 1" : : "r" (ctrl)); + + /* Set PL1 Physical Comp Value */ + val = TIMER_COMP_VAL; + asm("mcrr p15, 2, %Q0, %R0, c14" : : "r" (val)); + + gd->arch.tbl = 0; + gd->arch.tbu = 0; + + return 0; +} + +unsigned long long get_ticks(void) +{ + unsigned long long now; + + asm("mrrc p15, 0, %Q0, %R0, c14" : "=r" (now)); + + gd->arch.tbl = (unsigned long)(now & 0xffffffff); + gd->arch.tbu = (unsigned long)(now >> 32); + + return now; +} + +unsigned long get_timer_masked(void) +{ + return tick_to_time(get_ticks()); +} + +unsigned long get_timer(ulong base) +{ + return get_timer_masked() - base; +} + +/* delay x useconds and preserve advance timstamp value */ +void __udelay(unsigned long usec) +{ + unsigned long long start; + unsigned long tmo; + + start = get_ticks(); /* get current timestamp */ + tmo = us_to_tick(usec); /* convert usecs to ticks */ + + while ((get_ticks() - start) < tmo) + ; /* loop till time has passed */ +} + +/* + * This function is derived from PowerPC code (timebase clock frequency). + * On ARM it returns the number of timer ticks per second. + */ +unsigned long get_tbclk(void) +{ + unsigned long freq; + + asm volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (freq)); + + return freq; +} diff --git a/arch/arm/cpu/armv7/omap3/Kconfig b/arch/arm/cpu/armv7/omap3/Kconfig index 6578f0cf5a..6fae1e5f36 100644 --- a/arch/arm/cpu/armv7/omap3/Kconfig +++ b/arch/arm/cpu/armv7/omap3/Kconfig @@ -75,11 +75,9 @@ config TARGET_TWISTER endchoice config SYS_CPU - string default "armv7" config SYS_SOC - string default "omap3" source "board/logicpd/am3517evm/Kconfig" diff --git a/arch/arm/cpu/armv7/omap4/Kconfig b/arch/arm/cpu/armv7/omap4/Kconfig index 20d2c1141a..e270895135 100644 --- a/arch/arm/cpu/armv7/omap4/Kconfig +++ b/arch/arm/cpu/armv7/omap4/Kconfig @@ -15,11 +15,9 @@ config TARGET_OMAP4_SDP4430 endchoice config SYS_CPU - string default "armv7" config SYS_SOC - string default "omap4" source "board/gumstix/duovero/Kconfig" diff --git a/arch/arm/cpu/armv7/omap5/Kconfig b/arch/arm/cpu/armv7/omap5/Kconfig index be803939bc..2ccf5b919d 100644 --- a/arch/arm/cpu/armv7/omap5/Kconfig +++ b/arch/arm/cpu/armv7/omap5/Kconfig @@ -15,11 +15,9 @@ config TARGET_DRA7XX_EVM endchoice config SYS_CPU - string default "armv7" config SYS_SOC - string default "omap5" source "board/compulab/cm_t54/Kconfig" diff --git a/arch/arm/cpu/armv7/rmobile/Kconfig b/arch/arm/cpu/armv7/rmobile/Kconfig index 55c620a7c4..6c2bb22a85 100644 --- a/arch/arm/cpu/armv7/rmobile/Kconfig +++ b/arch/arm/cpu/armv7/rmobile/Kconfig @@ -21,11 +21,9 @@ config TARGET_ALT endchoice config SYS_CPU - string default "armv7" config SYS_SOC - string default "rmobile" source "board/atmark-techno/armadillo-800eva/Kconfig" diff --git a/arch/arm/cpu/armv7/tegra-common/Kconfig b/arch/arm/cpu/armv7/tegra-common/Kconfig index 8e2153bb83..bcae2d6033 100644 --- a/arch/arm/cpu/armv7/tegra-common/Kconfig +++ b/arch/arm/cpu/armv7/tegra-common/Kconfig @@ -18,7 +18,6 @@ config TEGRA124 endchoice config SYS_CPU - string default "arm720t" if SPL_BUILD default "armv7" if !SPL_BUILD diff --git a/arch/arm/cpu/armv7/tegra114/Kconfig b/arch/arm/cpu/armv7/tegra114/Kconfig index 33a22da535..31012bc770 100644 --- a/arch/arm/cpu/armv7/tegra114/Kconfig +++ b/arch/arm/cpu/armv7/tegra114/Kconfig @@ -9,7 +9,6 @@ config TARGET_DALMORE endchoice config SYS_SOC - string default "tegra114" source "board/nvidia/dalmore/Kconfig" diff --git a/arch/arm/cpu/armv7/tegra124/Kconfig b/arch/arm/cpu/armv7/tegra124/Kconfig index 753f511eda..6a1c83a27b 100644 --- a/arch/arm/cpu/armv7/tegra124/Kconfig +++ b/arch/arm/cpu/armv7/tegra124/Kconfig @@ -12,7 +12,6 @@ config TARGET_VENICE2 endchoice config SYS_SOC - string default "tegra124" source "board/nvidia/jetson-tk1/Kconfig" diff --git a/arch/arm/cpu/armv7/tegra20/Kconfig b/arch/arm/cpu/armv7/tegra20/Kconfig index e2e08900b9..a354e2ad1f 100644 --- a/arch/arm/cpu/armv7/tegra20/Kconfig +++ b/arch/arm/cpu/armv7/tegra20/Kconfig @@ -36,7 +36,6 @@ config TARGET_COLIBRI_T20_IRIS endchoice config SYS_SOC - string default "tegra20" source "board/nvidia/harmony/Kconfig" diff --git a/arch/arm/cpu/armv7/tegra30/Kconfig b/arch/arm/cpu/armv7/tegra30/Kconfig index 694e1cd974..54aec4ed50 100644 --- a/arch/arm/cpu/armv7/tegra30/Kconfig +++ b/arch/arm/cpu/armv7/tegra30/Kconfig @@ -18,7 +18,6 @@ config TARGET_TEC_NG endchoice config SYS_SOC - string default "tegra30" source "board/nvidia/beaver/Kconfig" diff --git a/arch/arm/cpu/armv7/zynq/Kconfig b/arch/arm/cpu/armv7/zynq/Kconfig index 6b88f1841b..d6655a972b 100644 --- a/arch/arm/cpu/armv7/zynq/Kconfig +++ b/arch/arm/cpu/armv7/zynq/Kconfig @@ -18,23 +18,18 @@ config TARGET_ZYNQ_ZC770 endchoice config SYS_CPU - string default "armv7" config SYS_BOARD - string default "zynq" config SYS_VENDOR - string default "xilinx" config SYS_SOC - string default "zynq" config SYS_CONFIG_NAME - string default "zynq_zed" if TARGET_ZYNQ_ZED default "zynq_microzed" if TARGET_ZYNQ_MICROZED default "zynq_zc70x" if TARGET_ZYNQ_ZC70X diff --git a/arch/arm/cpu/armv8/Kconfig b/arch/arm/cpu/armv8/Kconfig new file mode 100644 index 0000000000..3d1655bd5c --- /dev/null +++ b/arch/arm/cpu/armv8/Kconfig @@ -0,0 +1,6 @@ +if ARM64 + +config SYS_CPU + default "armv8" + +endif diff --git a/arch/arm/dts/tegra114-dalmore.dts b/arch/arm/dts/tegra114-dalmore.dts index 435c01e9f6..81ad212e71 100644 --- a/arch/arm/dts/tegra114-dalmore.dts +++ b/arch/arm/dts/tegra114-dalmore.dts @@ -6,6 +6,10 @@ model = "NVIDIA Dalmore"; compatible = "nvidia,dalmore", "nvidia,tegra114"; + chosen { + stdout-path = &uartd; + }; + aliases { i2c0 = "/i2c@7000d000"; i2c1 = "/i2c@7000c000"; diff --git a/arch/arm/dts/tegra114.dtsi b/arch/arm/dts/tegra114.dtsi index 59434e0a8f..88bdc49045 100644 --- a/arch/arm/dts/tegra114.dtsi +++ b/arch/arm/dts/tegra114.dtsi @@ -1,3 +1,4 @@ +#include <dt-bindings/clock/tegra114-car.h> #include <dt-bindings/gpio/tegra-gpio.h> #include <dt-bindings/interrupt-controller/arm-gic.h> @@ -116,6 +117,58 @@ status = "disabled"; }; + uarta: serial@70006000 { + compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart"; + reg = <0x70006000 0x40>; + reg-shift = <2>; + interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&tegra_car TEGRA114_CLK_UARTA>; + resets = <&tegra_car 6>; + reset-names = "serial"; + dmas = <&apbdma 8>, <&apbdma 8>; + dma-names = "rx", "tx"; + status = "disabled"; + }; + + uartb: serial@70006040 { + compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart"; + reg = <0x70006040 0x40>; + reg-shift = <2>; + interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&tegra_car TEGRA114_CLK_UARTB>; + resets = <&tegra_car 7>; + reset-names = "serial"; + dmas = <&apbdma 9>, <&apbdma 9>; + dma-names = "rx", "tx"; + status = "disabled"; + }; + + uartc: serial@70006200 { + compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart"; + reg = <0x70006200 0x100>; + reg-shift = <2>; + interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&tegra_car TEGRA114_CLK_UARTC>; + resets = <&tegra_car 55>; + reset-names = "serial"; + dmas = <&apbdma 10>, <&apbdma 10>; + dma-names = "rx", "tx"; + status = "disabled"; + }; + + uartd: serial@70006300 { + compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart"; + reg = <0x70006300 0x100>; + reg-shift = <2>; + interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&tegra_car TEGRA114_CLK_UARTD>; + resets = <&tegra_car 65>; + reset-names = "serial"; + dmas = <&apbdma 19>, <&apbdma 19>; + dma-names = "rx", "tx"; + status = "disabled"; + }; + spi@7000d400 { compatible = "nvidia,tegra114-spi"; reg = <0x7000d400 0x200>; diff --git a/arch/arm/dts/tegra124-jetson-tk1.dts b/arch/arm/dts/tegra124-jetson-tk1.dts index 464287e03e..ffad1160cd 100644 --- a/arch/arm/dts/tegra124-jetson-tk1.dts +++ b/arch/arm/dts/tegra124-jetson-tk1.dts @@ -6,6 +6,10 @@ model = "NVIDIA Jetson TK1"; compatible = "nvidia,jetson-tk1", "nvidia,tegra124"; + chosen { + stdout-path = &uartd; + }; + aliases { i2c0 = "/i2c@7000d000"; i2c1 = "/i2c@7000c000"; diff --git a/arch/arm/dts/tegra124-venice2.dts b/arch/arm/dts/tegra124-venice2.dts index f003413bd7..f7ccfc5ddd 100644 --- a/arch/arm/dts/tegra124-venice2.dts +++ b/arch/arm/dts/tegra124-venice2.dts @@ -6,6 +6,10 @@ model = "NVIDIA Venice2"; compatible = "nvidia,venice2", "nvidia,tegra124"; + chosen { + stdout-path = &uarta; + }; + aliases { i2c0 = "/i2c@7000d000"; i2c1 = "/i2c@7000c000"; diff --git a/arch/arm/dts/tegra124.dtsi b/arch/arm/dts/tegra124.dtsi index 4561c5f839..3288f28dae 100644 --- a/arch/arm/dts/tegra124.dtsi +++ b/arch/arm/dts/tegra124.dtsi @@ -1,3 +1,4 @@ +#include <dt-bindings/clock/tegra124-car.h> #include <dt-bindings/gpio/tegra-gpio.h> #include <dt-bindings/interrupt-controller/arm-gic.h> @@ -126,6 +127,71 @@ status = "disabled"; }; + uarta: serial@70006000 { + compatible = "nvidia,tegra124-uart", "nvidia,tegra20-uart"; + reg = <0x70006000 0x40>; + reg-shift = <2>; + interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&tegra_car TEGRA124_CLK_UARTA>; + resets = <&tegra_car 6>; + reset-names = "serial"; + dmas = <&apbdma 8>, <&apbdma 8>; + dma-names = "rx", "tx"; + status = "disabled"; + }; + + uartb: serial@70006040 { + compatible = "nvidia,tegra124-uart", "nvidia,tegra20-uart"; + reg = <0x70006040 0x40>; + reg-shift = <2>; + interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&tegra_car TEGRA124_CLK_UARTB>; + resets = <&tegra_car 7>; + reset-names = "serial"; + dmas = <&apbdma 9>, <&apbdma 9>; + dma-names = "rx", "tx"; + status = "disabled"; + }; + + uartc: serial@70006200 { + compatible = "nvidia,tegra124-uart", "nvidia,tegra20-uart"; + reg = <0x70006200 0x40>; + reg-shift = <2>; + interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&tegra_car TEGRA124_CLK_UARTC>; + resets = <&tegra_car 55>; + reset-names = "serial"; + dmas = <&apbdma 10>, <&apbdma 10>; + dma-names = "rx", "tx"; + status = "disabled"; + }; + + uartd: serial@70006300 { + compatible = "nvidia,tegra124-uart", "nvidia,tegra20-uart"; + reg = <0x70006300 0x40>; + reg-shift = <2>; + interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&tegra_car TEGRA124_CLK_UARTD>; + resets = <&tegra_car 65>; + reset-names = "serial"; + dmas = <&apbdma 19>, <&apbdma 19>; + dma-names = "rx", "tx"; + status = "disabled"; + }; + + uarte: serial@70006400 { + compatible = "nvidia,tegra124-uart", "nvidia,tegra20-uart"; + reg = <0x70006400 0x40>; + reg-shift = <2>; + interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&tegra_car TEGRA124_CLK_UARTE>; + resets = <&tegra_car 66>; + reset-names = "serial"; + dmas = <&apbdma 20>, <&apbdma 20>; + dma-names = "rx", "tx"; + status = "disabled"; + }; + spi@7000d400 { compatible = "nvidia,tegra124-spi", "nvidia,tegra114-spi"; reg = <0x7000d400 0x200>; diff --git a/arch/arm/dts/tegra20-colibri_t20_iris.dts b/arch/arm/dts/tegra20-colibri_t20_iris.dts index c0e54af886..7cf08f4101 100644 --- a/arch/arm/dts/tegra20-colibri_t20_iris.dts +++ b/arch/arm/dts/tegra20-colibri_t20_iris.dts @@ -6,6 +6,10 @@ model = "Toradex Colibri T20"; compatible = "toradex,t20", "nvidia,tegra20"; + chosen { + stdout-path = &uarta; + }; + aliases { usb0 = "/usb@c5008000"; usb1 = "/usb@c5000000"; diff --git a/arch/arm/dts/tegra20-harmony.dts b/arch/arm/dts/tegra20-harmony.dts index b115f87821..982a14c61c 100644 --- a/arch/arm/dts/tegra20-harmony.dts +++ b/arch/arm/dts/tegra20-harmony.dts @@ -6,6 +6,10 @@ model = "NVIDIA Tegra20 Harmony evaluation board"; compatible = "nvidia,harmony", "nvidia,tegra20"; + chosen { + stdout-path = &uartd; + }; + aliases { usb0 = "/usb@c5008000"; usb1 = "/usb@c5004000"; diff --git a/arch/arm/dts/tegra20-medcom-wide.dts b/arch/arm/dts/tegra20-medcom-wide.dts index a9a07f9bcd..be2ed42dbd 100644 --- a/arch/arm/dts/tegra20-medcom-wide.dts +++ b/arch/arm/dts/tegra20-medcom-wide.dts @@ -6,6 +6,10 @@ model = "Avionic Design Medcom-Wide"; compatible = "ad,medcom-wide", "nvidia,tegra20"; + chosen { + stdout-path = &uartd; + }; + aliases { usb0 = "/usb@c5008000"; sdhci0 = "/sdhci@c8000600"; diff --git a/arch/arm/dts/tegra20-paz00.dts b/arch/arm/dts/tegra20-paz00.dts index 780203cfb3..9d735b5e6b 100644 --- a/arch/arm/dts/tegra20-paz00.dts +++ b/arch/arm/dts/tegra20-paz00.dts @@ -6,6 +6,10 @@ model = "Toshiba AC100 / Dynabook AZ"; compatible = "compal,paz00", "nvidia,tegra20"; + chosen { + stdout-path = &uarta; + }; + aliases { usb0 = "/usb@c5008000"; sdhci0 = "/sdhci@c8000600"; diff --git a/arch/arm/dts/tegra20-plutux.dts b/arch/arm/dts/tegra20-plutux.dts index 20016f29bb..e5562a9ca5 100644 --- a/arch/arm/dts/tegra20-plutux.dts +++ b/arch/arm/dts/tegra20-plutux.dts @@ -6,6 +6,10 @@ model = "Avionic Design Plutux"; compatible = "ad,plutux", "nvidia,tegra20"; + chosen { + stdout-path = &uartd; + }; + aliases { usb0 = "/usb@c5008000"; sdhci0 = "/sdhci@c8000600"; diff --git a/arch/arm/dts/tegra20-seaboard.dts b/arch/arm/dts/tegra20-seaboard.dts index c0e2e1e5fd..43b9911c89 100644 --- a/arch/arm/dts/tegra20-seaboard.dts +++ b/arch/arm/dts/tegra20-seaboard.dts @@ -10,6 +10,10 @@ bootargs = "vmalloc=192M video=tegrafb console=ttyS0,115200n8 root=/dev/mmcblk1p3 rw rootwait"; }; + chosen { + stdout-path = &uartd; + }; + aliases { /* This defines the order of our ports */ usb0 = "/usb@c5008000"; diff --git a/arch/arm/dts/tegra20-tec.dts b/arch/arm/dts/tegra20-tec.dts index 4c1b08d768..e99bd447c1 100644 --- a/arch/arm/dts/tegra20-tec.dts +++ b/arch/arm/dts/tegra20-tec.dts @@ -6,6 +6,10 @@ model = "Avionic Design Tamonten Evaluation Carrier"; compatible = "ad,tec", "nvidia,tegra20"; + chosen { + stdout-path = &uartd; + }; + aliases { usb0 = "/usb@c5008000"; sdhci0 = "/sdhci@c8000600"; diff --git a/arch/arm/dts/tegra20-trimslice.dts b/arch/arm/dts/tegra20-trimslice.dts index ee31476c1e..cee5cfe0d2 100644 --- a/arch/arm/dts/tegra20-trimslice.dts +++ b/arch/arm/dts/tegra20-trimslice.dts @@ -6,6 +6,10 @@ model = "Compulab TrimSlice board"; compatible = "compulab,trimslice", "nvidia,tegra20"; + chosen { + stdout-path = &uarta; + }; + aliases { usb0 = "/usb@c5008000"; usb1 = "/usb@c5000000"; diff --git a/arch/arm/dts/tegra20-ventana.dts b/arch/arm/dts/tegra20-ventana.dts index 1a526bab64..6812203918 100644 --- a/arch/arm/dts/tegra20-ventana.dts +++ b/arch/arm/dts/tegra20-ventana.dts @@ -6,6 +6,10 @@ model = "NVIDIA Tegra20 Ventana evaluation board"; compatible = "nvidia,ventana", "nvidia,tegra20"; + chosen { + stdout-path = &uartd; + }; + aliases { usb0 = "/usb@c5008000"; sdhci0 = "/sdhci@c8000600"; diff --git a/arch/arm/dts/tegra20-whistler.dts b/arch/arm/dts/tegra20-whistler.dts index eb92264f9d..4fd2496dbc 100644 --- a/arch/arm/dts/tegra20-whistler.dts +++ b/arch/arm/dts/tegra20-whistler.dts @@ -6,6 +6,10 @@ model = "NVIDIA Tegra20 Whistler evaluation board"; compatible = "nvidia,whistler", "nvidia,tegra20"; + chosen { + stdout-path = &uarta; + }; + aliases { i2c0 = "/i2c@7000d000"; usb0 = "/usb@c5008000"; diff --git a/arch/arm/dts/tegra20.dtsi b/arch/arm/dts/tegra20.dtsi index a524f6eed4..5f927f7e0d 100644 --- a/arch/arm/dts/tegra20.dtsi +++ b/arch/arm/dts/tegra20.dtsi @@ -1,3 +1,4 @@ +#include <dt-bindings/clock/tegra20-car.h> #include <dt-bindings/gpio/tegra-gpio.h> #include <dt-bindings/interrupt-controller/arm-gic.h> @@ -189,39 +190,69 @@ dma-channel = < 1 >; }; - serial@70006000 { + uarta: serial@70006000 { compatible = "nvidia,tegra20-uart"; reg = <0x70006000 0x40>; reg-shift = <2>; - interrupts = < 68 >; + interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&tegra_car TEGRA20_CLK_UARTA>; + resets = <&tegra_car 6>; + reset-names = "serial"; + dmas = <&apbdma 8>, <&apbdma 8>; + dma-names = "rx", "tx"; + status = "disabled"; }; - serial@70006040 { + uartb: serial@70006040 { compatible = "nvidia,tegra20-uart"; reg = <0x70006040 0x40>; reg-shift = <2>; - interrupts = < 69 >; + interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&tegra_car TEGRA20_CLK_UARTB>; + resets = <&tegra_car 7>; + reset-names = "serial"; + dmas = <&apbdma 9>, <&apbdma 9>; + dma-names = "rx", "tx"; + status = "disabled"; }; - serial@70006200 { + uartc: serial@70006200 { compatible = "nvidia,tegra20-uart"; reg = <0x70006200 0x100>; reg-shift = <2>; - interrupts = < 78 >; + interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&tegra_car TEGRA20_CLK_UARTC>; + resets = <&tegra_car 55>; + reset-names = "serial"; + dmas = <&apbdma 10>, <&apbdma 10>; + dma-names = "rx", "tx"; + status = "disabled"; }; - serial@70006300 { + uartd: serial@70006300 { compatible = "nvidia,tegra20-uart"; reg = <0x70006300 0x100>; reg-shift = <2>; - interrupts = < 122 >; + interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&tegra_car TEGRA20_CLK_UARTD>; + resets = <&tegra_car 65>; + reset-names = "serial"; + dmas = <&apbdma 19>, <&apbdma 19>; + dma-names = "rx", "tx"; + status = "disabled"; }; - serial@70006400 { + uarte: serial@70006400 { compatible = "nvidia,tegra20-uart"; reg = <0x70006400 0x100>; reg-shift = <2>; - interrupts = < 123 >; + interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&tegra_car TEGRA20_CLK_UARTE>; + resets = <&tegra_car 66>; + reset-names = "serial"; + dmas = <&apbdma 20>, <&apbdma 20>; + dma-names = "rx", "tx"; + status = "disabled"; }; nand: nand-controller@70008000 { diff --git a/arch/arm/dts/tegra30-beaver.dts b/arch/arm/dts/tegra30-beaver.dts index 85e62e9db3..ad140def95 100644 --- a/arch/arm/dts/tegra30-beaver.dts +++ b/arch/arm/dts/tegra30-beaver.dts @@ -6,6 +6,10 @@ model = "NVIDIA Beaver"; compatible = "nvidia,beaver", "nvidia,tegra30"; + chosen { + stdout-path = &uarta; + }; + aliases { i2c0 = "/i2c@7000d000"; i2c1 = "/i2c@7000c000"; diff --git a/arch/arm/dts/tegra30-cardhu.dts b/arch/arm/dts/tegra30-cardhu.dts index ea2cf76ff3..b4fbe71aa5 100644 --- a/arch/arm/dts/tegra30-cardhu.dts +++ b/arch/arm/dts/tegra30-cardhu.dts @@ -6,6 +6,10 @@ model = "NVIDIA Cardhu"; compatible = "nvidia,cardhu", "nvidia,tegra30"; + chosen { + stdout-path = &uarta; + }; + aliases { i2c0 = "/i2c@7000d000"; i2c1 = "/i2c@7000c000"; diff --git a/arch/arm/dts/tegra30-tamonten.dtsi b/arch/arm/dts/tegra30-tamonten.dtsi index 50d5762311..c73afef34a 100644 --- a/arch/arm/dts/tegra30-tamonten.dtsi +++ b/arch/arm/dts/tegra30-tamonten.dtsi @@ -8,6 +8,10 @@ reg = <0x80000000 0x40000000>; }; + chosen { + stdout-path = &uartd; + }; + aliases { i2c0 = "/i2c@7000c000"; i2c1 = "/i2c@7000c700"; diff --git a/arch/arm/dts/tegra30.dtsi b/arch/arm/dts/tegra30.dtsi index 7be3791fc9..fb92a0fef9 100644 --- a/arch/arm/dts/tegra30.dtsi +++ b/arch/arm/dts/tegra30.dtsi @@ -1,3 +1,4 @@ +#include <dt-bindings/clock/tegra30-car.h> #include <dt-bindings/gpio/tegra-gpio.h> #include <dt-bindings/interrupt-controller/arm-gic.h> @@ -122,6 +123,71 @@ status = "disabled"; }; + uarta: serial@70006000 { + compatible = "nvidia,tegra30-uart", "nvidia,tegra20-uart"; + reg = <0x70006000 0x40>; + reg-shift = <2>; + interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&tegra_car TEGRA30_CLK_UARTA>; + resets = <&tegra_car 6>; + reset-names = "serial"; + dmas = <&apbdma 8>, <&apbdma 8>; + dma-names = "rx", "tx"; + status = "disabled"; + }; + + uartb: serial@70006040 { + compatible = "nvidia,tegra30-uart", "nvidia,tegra20-uart"; + reg = <0x70006040 0x40>; + reg-shift = <2>; + interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&tegra_car TEGRA30_CLK_UARTB>; + resets = <&tegra_car 7>; + reset-names = "serial"; + dmas = <&apbdma 9>, <&apbdma 9>; + dma-names = "rx", "tx"; + status = "disabled"; + }; + + uartc: serial@70006200 { + compatible = "nvidia,tegra30-uart", "nvidia,tegra20-uart"; + reg = <0x70006200 0x100>; + reg-shift = <2>; + interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&tegra_car TEGRA30_CLK_UARTC>; + resets = <&tegra_car 55>; + reset-names = "serial"; + dmas = <&apbdma 10>, <&apbdma 10>; + dma-names = "rx", "tx"; + status = "disabled"; + }; + + uartd: serial@70006300 { + compatible = "nvidia,tegra30-uart", "nvidia,tegra20-uart"; + reg = <0x70006300 0x100>; + reg-shift = <2>; + interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&tegra_car TEGRA30_CLK_UARTD>; + resets = <&tegra_car 65>; + reset-names = "serial"; + dmas = <&apbdma 19>, <&apbdma 19>; + dma-names = "rx", "tx"; + status = "disabled"; + }; + + uarte: serial@70006400 { + compatible = "nvidia,tegra30-uart", "nvidia,tegra20-uart"; + reg = <0x70006400 0x100>; + reg-shift = <2>; + interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&tegra_car TEGRA30_CLK_UARTE>; + resets = <&tegra_car 66>; + reset-names = "serial"; + dmas = <&apbdma 20>, <&apbdma 20>; + dma-names = "rx", "tx"; + status = "disabled"; + }; + spi@7000d400 { compatible = "nvidia,tegra30-slink", "nvidia,tegra20-slink"; reg = <0x7000d400 0x200>; diff --git a/arch/arm/include/asm/arch-at91/at91_pmc.h b/arch/arm/include/asm/arch-at91/at91_pmc.h index 04f6239fd0..27331ff2d1 100644 --- a/arch/arm/include/asm/arch-at91/at91_pmc.h +++ b/arch/arm/include/asm/arch-at91/at91_pmc.h @@ -54,7 +54,7 @@ typedef struct at91_pmc { u32 reserved5[21]; u32 wpmr; /* 0xE4 Write Protect Mode Register (CAP0) */ u32 wpsr; /* 0xE8 Write Protect Status Register (CAP0) */ -#ifdef CONFIG_SAMA5D3 +#ifdef CPU_HAS_PCR u32 reserved6[8]; u32 pcer1; /* 0x100 Periperial Clock Enable Register 1 */ u32 pcdr1; /* 0x104 Periperial Clock Disable Register 1 */ @@ -147,6 +147,10 @@ typedef struct at91_pmc { #define AT91_PMC_IXR_PCKRDY3 0x00000800 #define AT91_PMC_IXR_MOSCSELS 0x00010000 +#define AT91_PMC_PCR_PID_MASK (0x3f) +#define AT91_PMC_PCR_CMD_WRITE (0x1 << 12) +#define AT91_PMC_PCR_EN (0x1 << 28) + #define AT91_PMC_PCK (1 << 0) /* Processor Clock */ #define AT91RM9200_PMC_UDP (1 << 1) /* USB Devcice Port Clock [AT91RM9200 only] */ #define AT91RM9200_PMC_MCKUDP (1 << 2) /* USB Device Port Master Clock Automatic Disable on Suspend [AT91RM9200 only] */ diff --git a/arch/arm/include/asm/arch-at91/clk.h b/arch/arm/include/asm/arch-at91/clk.h index ce9e28f11c..4076a78a86 100644 --- a/arch/arm/include/asm/arch-at91/clk.h +++ b/arch/arm/include/asm/arch-at91/clk.h @@ -80,4 +80,5 @@ static inline unsigned long get_mci_clk_rate(void) int at91_clock_init(unsigned long main_clock); void at91_periph_clk_enable(int id); +void at91_periph_clk_disable(int id); #endif /* __ASM_ARM_ARCH_CLK_H__ */ diff --git a/arch/arm/include/asm/arch-at91/sama5d3.h b/arch/arm/include/asm/arch-at91/sama5d3.h index 6d936f47fa..f7bc4ad338 100644 --- a/arch/arm/include/asm/arch-at91/sama5d3.h +++ b/arch/arm/include/asm/arch-at91/sama5d3.h @@ -188,6 +188,7 @@ #define ATMEL_PIO_PORTS 5 #define CPU_HAS_PIO3 #define PIO_SCDR_DIV 0x3fff +#define CPU_HAS_PCR /* * PMECC table in ROM diff --git a/arch/arm/include/asm/arch-at91/sama5d3_smc.h b/arch/arm/include/asm/arch-at91/sama5d3_smc.h index 6caa9b6ed8..a859b6db9b 100644 --- a/arch/arm/include/asm/arch-at91/sama5d3_smc.h +++ b/arch/arm/include/asm/arch-at91/sama5d3_smc.h @@ -14,7 +14,8 @@ #define AT91_ASM_SMC_SETUP0 (ATMEL_BASE_SMC + 0x600) #define AT91_ASM_SMC_PULSE0 (ATMEL_BASE_SMC + 0x604) #define AT91_ASM_SMC_CYCLE0 (ATMEL_BASE_SMC + 0x608) -#define AT91_ASM_SMC_MODE0 (ATMEL_BASE_SMC + 0x60C) +#define AT91_ASM_SMC_TIMINGS0 (ATMEL_BASE_SMC + 0x60c) +#define AT91_ASM_SMC_MODE0 (ATMEL_BASE_SMC + 0x610) #else struct at91_cs { u32 setup; /* 0x600 SMC Setup Register */ diff --git a/arch/arm/include/asm/arch-keystone/ddr3.h b/arch/arm/include/asm/arch-keystone/ddr3.h index 4d229a25fa..6bf35d3543 100644 --- a/arch/arm/include/asm/arch-keystone/ddr3.h +++ b/arch/arm/include/asm/arch-keystone/ddr3.h @@ -50,6 +50,7 @@ struct ddr3_emif_config { void ddr3_init(void); void ddr3_reset_ddrphy(void); +void ddr3_err_reset_workaround(void); void ddr3_init_ddrphy(u32 base, struct ddr3_phy_config *phy_cfg); void ddr3_init_ddremif(u32 base, struct ddr3_emif_config *emif_cfg); diff --git a/arch/arm/include/asm/arch-keystone/hardware.h b/arch/arm/include/asm/arch-keystone/hardware.h index d6726a1eca..76e6441e57 100644 --- a/arch/arm/include/asm/arch-keystone/hardware.h +++ b/arch/arm/include/asm/arch-keystone/hardware.h @@ -121,9 +121,11 @@ typedef volatile unsigned int *dv_reg_p; #define KS2_CLOCK_BASE KS2_PLL_CNTRL_BASE #define KS2_RSTCTRL_RSTYPE (KS2_PLL_CNTRL_BASE + 0xe4) #define KS2_RSTCTRL (KS2_PLL_CNTRL_BASE + 0xe8) +#define KS2_RSTCTRL_RSCFG (KS2_PLL_CNTRL_BASE + 0xec) #define KS2_RSTCTRL_KEY 0x5a69 #define KS2_RSTCTRL_MASK 0xffff0000 #define KS2_RSTCTRL_SWRST 0xfffe0000 +#define KS2_RSTYPE_PLL_SOFT BIT(13) /* SPI */ #define KS2_SPI0_BASE 0x21000400 diff --git a/arch/arm/include/asm/arch-ls102xa/clock.h b/arch/arm/include/asm/arch-ls102xa/clock.h new file mode 100644 index 0000000000..fd36bb0a50 --- /dev/null +++ b/arch/arm/include/asm/arch-ls102xa/clock.h @@ -0,0 +1,23 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + * + */ + +#ifndef __ASM_ARCH_LS102XA_CLOCK_H_ +#define __ASM_ARCH_LS102XA_CLOCK_H_ + +#include <common.h> + +enum mxc_clock { + MXC_ARM_CLK = 0, + MXC_UART_CLK, + MXC_ESDHC_CLK, + MXC_I2C_CLK, + MXC_DSPI_CLK, +}; + +unsigned int mxc_get_clock(enum mxc_clock clk); + +#endif /* __ASM_ARCH_LS102XA_CLOCK_H_ */ diff --git a/arch/arm/include/asm/arch-ls102xa/config.h b/arch/arm/include/asm/arch-ls102xa/config.h new file mode 100644 index 0000000000..ed78c33e0a --- /dev/null +++ b/arch/arm/include/asm/arch-ls102xa/config.h @@ -0,0 +1,78 @@ +/* + * Copyright 2014, Freescale Semiconductor + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef _ASM_ARMV7_LS102XA_CONFIG_ +#define _ASM_ARMV7_LS102XA_CONFIG_ + +#define CONFIG_SYS_CACHELINE_SIZE 64 + +#define OCRAM_BASE_ADDR 0x10000000 +#define OCRAM_SIZE 0x00020000 + +#define CONFIG_SYS_IMMR 0x01000000 + +#define CONFIG_SYS_FSL_DDR_ADDR (CONFIG_SYS_IMMR + 0x00080000) +#define CONFIG_SYS_CCI400_ADDR (CONFIG_SYS_IMMR + 0x00180000) +#define CONFIG_SYS_IFC_ADDR (CONFIG_SYS_IMMR + 0x00530000) +#define CONFIG_SYS_FSL_ESDHC_ADDR (CONFIG_SYS_IMMR + 0x00560000) +#define CONFIG_SYS_FSL_SCFG_ADDR (CONFIG_SYS_IMMR + 0x00570000) +#define CONFIG_SYS_FSL_SERDES_ADDR (CONFIG_SYS_IMMR + 0x00ea0000) +#define CONFIG_SYS_FSL_GUTS_ADDR (CONFIG_SYS_IMMR + 0x00ee0000) +#define CONFIG_SYS_FSL_LS1_CLK_ADDR (CONFIG_SYS_IMMR + 0x00ee1000) +#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_IMMR + 0x011c0500) +#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_IMMR + 0x011d0500) +#define CONFIG_SYS_DCU_ADDR (CONFIG_SYS_IMMR + 0x01ce0000) + +#define CONFIG_SYS_TSEC1_OFFSET 0x01d10000 +#define CONFIG_SYS_TSEC2_OFFSET 0x01d50000 +#define CONFIG_SYS_TSEC3_OFFSET 0x01d90000 +#define CONFIG_SYS_MDIO1_OFFSET 0x01d24000 + +#define TSEC_BASE_ADDR (CONFIG_SYS_IMMR + CONFIG_SYS_TSEC1_OFFSET) +#define MDIO_BASE_ADDR (CONFIG_SYS_IMMR + CONFIG_SYS_MDIO1_OFFSET) + +#define SCTR_BASE_ADDR (CONFIG_SYS_IMMR + 0x01b00000) + +#define I2C1_BASE_ADDR (CONFIG_SYS_IMMR + 0x01180000) +#define I2C2_BASE_ADDR (CONFIG_SYS_IMMR + 0x01190000) +#define I2C3_BASE_ADDR (CONFIG_SYS_IMMR + 0x011a0000) + +#define WDOG1_BASE_ADDR (CONFIG_SYS_IMMR + 0x01ad0000) + +#define QSPI0_BASE_ADDR (CONFIG_SYS_IMMR + 0x00550000) +#define DSPI1_BASE_ADDR (CONFIG_SYS_IMMR + 0x01100000) + +#define LPUART_BASE (CONFIG_SYS_IMMR + 0x01950000) + +#ifdef CONFIG_DDR_SPD +#define CONFIG_SYS_FSL_DDR_BE +#define CONFIG_VERY_BIG_RAM +#define CONFIG_SYS_FSL_DDRC_ARM_GEN3 +#define CONFIG_SYS_FSL_DDR +#define CONFIG_SYS_LS1_DDR_BLOCK1_SIZE ((phys_size_t)2 << 30) +#define CONFIG_MAX_MEM_MAPPED CONFIG_SYS_LS1_DDR_BLOCK1_SIZE +#endif + +#define CONFIG_SYS_FSL_IFC_BE +#define CONFIG_SYS_FSL_ESDHC_BE +#define CONFIG_SYS_FSL_WDOG_BE +#define CONFIG_SYS_FSL_DSPI_BE +#define CONFIG_SYS_FSL_QSPI_BE +#define CONFIG_SYS_FSL_DCU_BE + +#define DCU_LAYER_MAX_NUM 16 + +#define CONFIG_SYS_FSL_SRDS_1 + +#ifdef CONFIG_LS102XA +#define CONFIG_MAX_CPUS 2 +#define CONFIG_SYS_FSL_IFC_BANK_COUNT 8 +#define CONFIG_NUM_DDR_CONTROLLERS 1 +#else +#error SoC not defined +#endif + +#endif /* _ASM_ARMV7_LS102XA_CONFIG_ */ diff --git a/arch/arm/include/asm/arch-ls102xa/fsl_serdes.h b/arch/arm/include/asm/arch-ls102xa/fsl_serdes.h new file mode 100644 index 0000000000..3a92f5a7b4 --- /dev/null +++ b/arch/arm/include/asm/arch-ls102xa/fsl_serdes.h @@ -0,0 +1,33 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __FSL_SERDES_H +#define __FSL_SERDES_H + +#include <config.h> + +enum srds_prtcl { + NONE = 0, + PCIE1, + PCIE2, + SATA1, + SGMII_TSEC1, + SGMII_TSEC2, +}; + +enum srds { + FSL_SRDS_1 = 0, + FSL_SRDS_2 = 1, +}; + +int is_serdes_configured(enum srds_prtcl device); +void fsl_serdes_init(void); +const char *serdes_clock_to_string(u32 clock); + +int serdes_get_first_lane(u32 sd, enum srds_prtcl device); +enum srds_prtcl serdes_get_prtcl(int serdes, int cfg, int lane); + +#endif /* __FSL_SERDES_H */ diff --git a/arch/arm/include/asm/arch-ls102xa/immap_ls102xa.h b/arch/arm/include/asm/arch-ls102xa/immap_ls102xa.h new file mode 100644 index 0000000000..7995fe262b --- /dev/null +++ b/arch/arm/include/asm/arch-ls102xa/immap_ls102xa.h @@ -0,0 +1,493 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __ASM_ARCH_LS102XA_IMMAP_H_ +#define __ASM_ARCH_LS102XA_IMMAP_H_ + +#define SVR_MAJ(svr) (((svr) >> 4) & 0xf) +#define SVR_MIN(svr) (((svr) >> 0) & 0xf) +#define SVR_SOC_VER(svr) (((svr) >> 8) & 0x7ff) +#define IS_E_PROCESSOR(svr) (svr & 0x80000) + +#define SOC_VER_SLS1020 0x00 +#define SOC_VER_LS1020 0x10 +#define SOC_VER_LS1021 0x11 +#define SOC_VER_LS1022 0x12 + +#define RCWSR0_SYS_PLL_RAT_SHIFT 25 +#define RCWSR0_SYS_PLL_RAT_MASK 0x1f +#define RCWSR0_MEM_PLL_RAT_SHIFT 16 +#define RCWSR0_MEM_PLL_RAT_MASK 0x3f + +#define RCWSR4_SRDS1_PRTCL_SHIFT 24 +#define RCWSR4_SRDS1_PRTCL_MASK 0xff000000 + +#define TIMER_COMP_VAL 0xffffffff +#define ARCH_TIMER_CTRL_ENABLE (1 << 0) +#define SYS_COUNTER_CTRL_ENABLE (1 << 24) + +struct sys_info { + unsigned long freq_processor[CONFIG_MAX_CPUS]; + unsigned long freq_systembus; + unsigned long freq_ddrbus; + unsigned long freq_localbus; +}; + +/* Device Configuration and Pin Control */ +struct ccsr_gur { + u32 porsr1; /* POR status 1 */ + u32 porsr2; /* POR status 2 */ + u8 res_008[0x20-0x8]; + u32 gpporcr1; /* General-purpose POR configuration */ + u32 gpporcr2; + u32 dcfg_fusesr; /* Fuse status register */ + u8 res_02c[0x70-0x2c]; + u32 devdisr; /* Device disable control */ + u32 devdisr2; /* Device disable control 2 */ + u32 devdisr3; /* Device disable control 3 */ + u32 devdisr4; /* Device disable control 4 */ + u32 devdisr5; /* Device disable control 5 */ + u8 res_084[0x94-0x84]; + u32 coredisru; /* uppper portion for support of 64 cores */ + u32 coredisrl; /* lower portion for support of 64 cores */ + u8 res_09c[0xa4-0x9c]; + u32 svr; /* System version */ + u8 res_0a8[0xb0-0xa8]; + u32 rstcr; /* Reset control */ + u32 rstrqpblsr; /* Reset request preboot loader status */ + u8 res_0b8[0xc0-0xb8]; + u32 rstrqmr1; /* Reset request mask */ + u8 res_0c4[0xc8-0xc4]; + u32 rstrqsr1; /* Reset request status */ + u8 res_0cc[0xd4-0xcc]; + u32 rstrqwdtmrl; /* Reset request WDT mask */ + u8 res_0d8[0xdc-0xd8]; + u32 rstrqwdtsrl; /* Reset request WDT status */ + u8 res_0e0[0xe4-0xe0]; + u32 brrl; /* Boot release */ + u8 res_0e8[0x100-0xe8]; + u32 rcwsr[16]; /* Reset control word status */ + u8 res_140[0x200-0x140]; + u32 scratchrw[4]; /* Scratch Read/Write */ + u8 res_210[0x300-0x210]; + u32 scratchw1r[4]; /* Scratch Read (Write once) */ + u8 res_310[0x400-0x310]; + u32 crstsr; + u8 res_404[0x550-0x404]; + u32 sataliodnr; + u8 res_554[0x604-0x554]; + u32 pamubypenr; + u32 dmacr1; + u8 res_60c[0x740-0x60c]; /* add more registers when needed */ + u32 tp_ityp[64]; /* Topology Initiator Type Register */ + struct { + u32 upper; + u32 lower; + } tp_cluster[1]; /* Core Cluster n Topology Register */ + u8 res_848[0xe60-0x848]; + u32 ddrclkdr; + u8 res_e60[0xe68-0xe64]; + u32 ifcclkdr; + u8 res_e68[0xe80-0xe6c]; + u32 sdhcpcr; +}; + +#define SCFG_SCFGREVCR_REV 0xffffffff +#define SCFG_SCFGREVCR_NOREV 0 +#define SCFG_ETSECDMAMCR_LE_BD_FR 0xf8001a0f +#define SCFG_ETSECCMCR_GE2_CLK125 0x04000000 +#define SCFG_PIXCLKCR_PXCKEN 0x80000000 + +/* Supplemental Configuration Unit */ +struct ccsr_scfg { + u32 dpslpcr; + u32 resv0[2]; + u32 etsecclkdpslpcr; + u32 resv1[5]; + u32 fuseovrdcr; + u32 pixclkcr; + u32 resv2[5]; + u32 spimsicr; + u32 resv3[6]; + u32 pex1pmwrcr; + u32 pex1pmrdsr; + u32 resv4[3]; + u32 usb3prm1cr; + u32 usb4prm2cr; + u32 pex1rdmsgpldlsbsr; + u32 pex1rdmsgpldmsbsr; + u32 pex2rdmsgpldlsbsr; + u32 pex2rdmsgpldmsbsr; + u32 pex1rdmmsgrqsr; + u32 pex2rdmmsgrqsr; + u32 spimsiclrcr; + u32 pex1mscportsr; + u32 pex2mscportsr; + u32 pex2pmwrcr; + u32 resv5[24]; + u32 mac1_streamid; + u32 mac2_streamid; + u32 mac3_streamid; + u32 pex1_streamid; + u32 pex2_streamid; + u32 dma_streamid; + u32 sata_streamid; + u32 usb3_streamid; + u32 qe_streamid; + u32 sdhc_streamid; + u32 adma_streamid; + u32 letechsftrstcr; + u32 core0_sft_rst; + u32 core1_sft_rst; + u32 resv6[1]; + u32 usb_hi_addr; + u32 etsecclkadjcr; + u32 sai_clk; + u32 resv7[1]; + u32 dcu_streamid; + u32 usb2_streamid; + u32 ftm_reset; + u32 altcbar; + u32 qspi_cfg; + u32 pmcintecr; + u32 pmcintlecr; + u32 pmcintsr; + u32 qos1; + u32 qos2; + u32 qos3; + u32 cci_cfg; + u32 resv8[1]; + u32 etsecdmamcr; + u32 usb3prm3cr; + u32 resv9[1]; + u32 debug_streamid; + u32 resv10[5]; + u32 snpcnfgcr; + u32 resv11[1]; + u32 intpcr; + u32 resv12[20]; + u32 scfgrevcr; + u32 coresrencr; + u32 pex2pmrdsr; + u32 ddrc1cr; + u32 ddrc2cr; + u32 ddrc3cr; + u32 ddrc4cr; + u32 ddrgcr; + u32 resv13[120]; + u32 qeioclkcr; + u32 etsecmcr; + u32 sdhciovserlcr; + u32 resv14[61]; + u32 sparecr; +}; + +/* Clocking */ +struct ccsr_clk { + struct { + u32 clkcncsr; /* core cluster n clock control status */ + u8 res_004[0x1c]; + } clkcsr[2]; + u8 res_040[0x7c0]; /* 0x100 */ + struct { + u32 pllcngsr; + u8 res_804[0x1c]; + } pllcgsr[2]; + u8 res_840[0x1c0]; + u32 clkpcsr; /* 0xa00 Platform clock domain control/status */ + u8 res_a04[0x1fc]; + u32 pllpgsr; /* 0xc00 Platform PLL General Status */ + u8 res_c04[0x1c]; + u32 plldgsr; /* 0xc20 DDR PLL General Status */ + u8 res_c24[0x3dc]; +}; + +/* System Counter */ +struct sctr_regs { + u32 cntcr; + u32 cntsr; + u32 cntcv1; + u32 cntcv2; + u32 resv1[4]; + u32 cntfid0; + u32 cntfid1; + u32 resv2[1002]; + u32 counterid[12]; +}; + +#define MAX_SERDES 1 +#define SRDS_MAX_LANES 4 +#define SRDS_MAX_BANK 2 + +#define SRDS_RSTCTL_RST 0x80000000 +#define SRDS_RSTCTL_RSTDONE 0x40000000 +#define SRDS_RSTCTL_RSTERR 0x20000000 +#define SRDS_RSTCTL_SWRST 0x10000000 +#define SRDS_RSTCTL_SDEN 0x00000020 +#define SRDS_RSTCTL_SDRST_B 0x00000040 +#define SRDS_RSTCTL_PLLRST_B 0x00000080 +#define SRDS_PLLCR0_POFF 0x80000000 +#define SRDS_PLLCR0_RFCK_SEL_MASK 0x70000000 +#define SRDS_PLLCR0_RFCK_SEL_100 0x00000000 +#define SRDS_PLLCR0_RFCK_SEL_125 0x10000000 +#define SRDS_PLLCR0_RFCK_SEL_156_25 0x20000000 +#define SRDS_PLLCR0_RFCK_SEL_150 0x30000000 +#define SRDS_PLLCR0_RFCK_SEL_161_13 0x40000000 +#define SRDS_PLLCR0_RFCK_SEL_122_88 0x50000000 +#define SRDS_PLLCR0_PLL_LCK 0x00800000 +#define SRDS_PLLCR0_FRATE_SEL_MASK 0x000f0000 +#define SRDS_PLLCR0_FRATE_SEL_5 0x00000000 +#define SRDS_PLLCR0_FRATE_SEL_3_75 0x00050000 +#define SRDS_PLLCR0_FRATE_SEL_5_15 0x00060000 +#define SRDS_PLLCR0_FRATE_SEL_4 0x00070000 +#define SRDS_PLLCR0_FRATE_SEL_3_12 0x00090000 +#define SRDS_PLLCR0_FRATE_SEL_3 0x000a0000 +#define SRDS_PLLCR1_PLL_BWSEL 0x08000000 + +struct ccsr_serdes { + struct { + u32 rstctl; /* Reset Control Register */ + + u32 pllcr0; /* PLL Control Register 0 */ + + u32 pllcr1; /* PLL Control Register 1 */ + u32 res_0c; /* 0x00c */ + u32 pllcr3; + u32 pllcr4; + u8 res_18[0x20-0x18]; + } bank[2]; + u8 res_40[0x90-0x40]; + u32 srdstcalcr; /* 0x90 TX Calibration Control */ + u8 res_94[0xa0-0x94]; + u32 srdsrcalcr; /* 0xa0 RX Calibration Control */ + u8 res_a4[0xb0-0xa4]; + u32 srdsgr0; /* 0xb0 General Register 0 */ + u8 res_b4[0xe0-0xb4]; + u32 srdspccr0; /* 0xe0 Protocol Converter Config 0 */ + u32 srdspccr1; /* 0xe4 Protocol Converter Config 1 */ + u32 srdspccr2; /* 0xe8 Protocol Converter Config 2 */ + u32 srdspccr3; /* 0xec Protocol Converter Config 3 */ + u32 srdspccr4; /* 0xf0 Protocol Converter Config 4 */ + u8 res_f4[0x100-0xf4]; + struct { + u32 lnpssr; /* 0x100, 0x120, ..., 0x1e0 */ + u8 res_104[0x120-0x104]; + } srdslnpssr[4]; + u8 res_180[0x300-0x180]; + u32 srdspexeqcr; + u32 srdspexeqpcr[11]; + u8 res_330[0x400-0x330]; + u32 srdspexapcr; + u8 res_404[0x440-0x404]; + u32 srdspexbpcr; + u8 res_444[0x800-0x444]; + struct { + u32 gcr0; /* 0x800 General Control Register 0 */ + u32 gcr1; /* 0x804 General Control Register 1 */ + u32 gcr2; /* 0x808 General Control Register 2 */ + u32 sscr0; + u32 recr0; /* 0x810 Receive Equalization Control */ + u32 recr1; + u32 tecr0; /* 0x818 Transmit Equalization Control */ + u32 sscr1; + u32 ttlcr0; /* 0x820 Transition Tracking Loop Ctrl 0 */ + u8 res_824[0x83c-0x824]; + u32 tcsr3; + } lane[4]; /* Lane A, B, C, D, E, F, G, H */ + u8 res_a00[0x1000-0xa00]; /* from 0xa00 to 0xfff */ +}; + +#define DDR_SDRAM_CFG 0x470c0008 +#define DDR_CS0_BNDS 0x008000bf +#define DDR_CS0_CONFIG 0x80014302 +#define DDR_TIMING_CFG_0 0x50550004 +#define DDR_TIMING_CFG_1 0xbcb38c56 +#define DDR_TIMING_CFG_2 0x0040d120 +#define DDR_TIMING_CFG_3 0x010e1000 +#define DDR_TIMING_CFG_4 0x00000001 +#define DDR_TIMING_CFG_5 0x03401400 +#define DDR_SDRAM_CFG_2 0x00401010 +#define DDR_SDRAM_MODE 0x00061c60 +#define DDR_SDRAM_MODE_2 0x00180000 +#define DDR_SDRAM_INTERVAL 0x18600618 +#define DDR_DDR_WRLVL_CNTL 0x8655f605 +#define DDR_DDR_WRLVL_CNTL_2 0x05060607 +#define DDR_DDR_WRLVL_CNTL_3 0x05050505 +#define DDR_DDR_CDR1 0x80040000 +#define DDR_DDR_CDR2 0x00000001 +#define DDR_SDRAM_CLK_CNTL 0x02000000 +#define DDR_DDR_ZQ_CNTL 0x89080600 +#define DDR_CS0_CONFIG_2 0 +#define DDR_SDRAM_CFG_MEM_EN 0x80000000 + +/* DDR memory controller registers */ +struct ccsr_ddr { + u32 cs0_bnds; /* Chip Select 0 Memory Bounds */ + u32 resv1[1]; + u32 cs1_bnds; /* Chip Select 1 Memory Bounds */ + u32 resv2[1]; + u32 cs2_bnds; /* Chip Select 2 Memory Bounds */ + u32 resv3[1]; + u32 cs3_bnds; /* Chip Select 3 Memory Bounds */ + u32 resv4[25]; + u32 cs0_config; /* Chip Select Configuration */ + u32 cs1_config; /* Chip Select Configuration */ + u32 cs2_config; /* Chip Select Configuration */ + u32 cs3_config; /* Chip Select Configuration */ + u32 resv5[12]; + u32 cs0_config_2; /* Chip Select Configuration 2 */ + u32 cs1_config_2; /* Chip Select Configuration 2 */ + u32 cs2_config_2; /* Chip Select Configuration 2 */ + u32 cs3_config_2; /* Chip Select Configuration 2 */ + u32 resv6[12]; + u32 timing_cfg_3; /* SDRAM Timing Configuration 3 */ + u32 timing_cfg_0; /* SDRAM Timing Configuration 0 */ + u32 timing_cfg_1; /* SDRAM Timing Configuration 1 */ + u32 timing_cfg_2; /* SDRAM Timing Configuration 2 */ + u32 sdram_cfg; /* SDRAM Control Configuration */ + u32 sdram_cfg_2; /* SDRAM Control Configuration 2 */ + u32 sdram_mode; /* SDRAM Mode Configuration */ + u32 sdram_mode_2; /* SDRAM Mode Configuration 2 */ + u32 sdram_md_cntl; /* SDRAM Mode Control */ + u32 sdram_interval; /* SDRAM Interval Configuration */ + u32 sdram_data_init; /* SDRAM Data initialization */ + u32 resv7[1]; + u32 sdram_clk_cntl; /* SDRAM Clock Control */ + u32 resv8[5]; + u32 init_addr; /* training init addr */ + u32 init_ext_addr; /* training init extended addr */ + u32 resv9[4]; + u32 timing_cfg_4; /* SDRAM Timing Configuration 4 */ + u32 timing_cfg_5; /* SDRAM Timing Configuration 5 */ + u32 timing_cfg_6; /* SDRAM Timing Configuration 6 */ + u32 timing_cfg_7; /* SDRAM Timing Configuration 7 */ + u32 ddr_zq_cntl; /* ZQ calibration control*/ + u32 ddr_wrlvl_cntl; /* write leveling control*/ + u32 resv10[1]; + u32 ddr_sr_cntr; /* self refresvh counter */ + u32 ddr_sdram_rcw_1; /* Control Words 1 */ + u32 ddr_sdram_rcw_2; /* Control Words 2 */ + u32 resv11[2]; + u32 ddr_wrlvl_cntl_2; /* write leveling control 2 */ + u32 ddr_wrlvl_cntl_3; /* write leveling control 3 */ + u32 resv12[2]; + u32 ddr_sdram_rcw_3; /* Control Words 3 */ + u32 ddr_sdram_rcw_4; /* Control Words 4 */ + u32 ddr_sdram_rcw_5; /* Control Words 5 */ + u32 ddr_sdram_rcw_6; /* Control Words 6 */ + u32 resv13[20]; + u32 sdram_mode_3; /* SDRAM Mode Configuration 3 */ + u32 sdram_mode_4; /* SDRAM Mode Configuration 4 */ + u32 sdram_mode_5; /* SDRAM Mode Configuration 5 */ + u32 sdram_mode_6; /* SDRAM Mode Configuration 6 */ + u32 sdram_mode_7; /* SDRAM Mode Configuration 7 */ + u32 sdram_mode_8; /* SDRAM Mode Configuration 8 */ + u32 sdram_mode_9; /* SDRAM Mode Configuration 9 */ + u32 sdram_mode_10; /* SDRAM Mode Configuration 10 */ + u32 sdram_mode_11; /* SDRAM Mode Configuration 11 */ + u32 sdram_mode_12; /* SDRAM Mode Configuration 12 */ + u32 sdram_mode_13; /* SDRAM Mode Configuration 13 */ + u32 sdram_mode_14; /* SDRAM Mode Configuration 14 */ + u32 sdram_mode_15; /* SDRAM Mode Configuration 15 */ + u32 sdram_mode_16; /* SDRAM Mode Configuration 16 */ + u32 resv14[4]; + u32 timing_cfg_8; /* SDRAM Timing Configuration 8 */ + u32 timing_cfg_9; /* SDRAM Timing Configuration 9 */ + u32 resv15[2]; + u32 sdram_cfg_3; /* SDRAM Control Configuration 3 */ + u32 resv16[15]; + u32 deskew_cntl; /* SDRAM Deskew Control */ + u32 resv17[545]; + u32 ddr_dsr1; /* Debug Status 1 */ + u32 ddr_dsr2; /* Debug Status 2 */ + u32 ddr_cdr1; /* Control Driver 1 */ + u32 ddr_cdr2; /* Control Driver 2 */ + u32 resv18[50]; + u32 ip_rev1; /* IP Block Revision 1 */ + u32 ip_rev2; /* IP Block Revision 2 */ + u32 eor; /* Enhanced Optimization Register */ + u32 resv19[63]; + u32 mtcr; /* Memory Test Control Register */ + u32 resv20[7]; + u32 mtp1; /* Memory Test Pattern 1 */ + u32 mtp2; /* Memory Test Pattern 2 */ + u32 mtp3; /* Memory Test Pattern 3 */ + u32 mtp4; /* Memory Test Pattern 4 */ + u32 mtp5; /* Memory Test Pattern 5 */ + u32 mtp6; /* Memory Test Pattern 6 */ + u32 mtp7; /* Memory Test Pattern 7 */ + u32 mtp8; /* Memory Test Pattern 8 */ + u32 mtp9; /* Memory Test Pattern 9 */ + u32 mtp10; /* Memory Test Pattern 10 */ + u32 resv21[6]; + u32 ddr_mt_st_ext_addr; /* Memory Test Start Extended Address */ + u32 ddr_mt_st_addr; /* Memory Test Start Address */ + u32 ddr_mt_end_ext_addr; /* Memory Test End Extended Address */ + u32 ddr_mt_end_addr; /* Memory Test End Address */ + u32 resv22[36]; + u32 data_err_inject_hi; /* Data Path Err Injection Mask High */ + u32 data_err_inject_lo; /* Data Path Err Injection Mask Low */ + u32 ecc_err_inject; /* Data Path Err Injection Mask ECC */ + u32 resv23[5]; + u32 capture_data_hi; /* Data Path Read Capture High */ + u32 capture_data_lo; /* Data Path Read Capture Low */ + u32 capture_ecc; /* Data Path Read Capture ECC */ + u32 resv24[5]; + u32 err_detect; /* Error Detect */ + u32 err_disable; /* Error Disable */ + u32 err_int_en; + u32 capture_attributes; /* Error Attrs Capture */ + u32 capture_address; /* Error Addr Capture */ + u32 capture_ext_address; /* Error Extended Addr Capture */ + u32 err_sbe; /* Single-Bit ECC Error Management */ + u32 resv25[105]; +}; + +#define CCI400_CTRLORD_TERM_BARRIER 0x00000008 +#define CCI400_CTRLORD_EN_BARRIER 0 + +/* CCI-400 registers */ +struct ccsr_cci400 { + u32 ctrl_ord; /* Control Override */ + u32 spec_ctrl; /* Speculation Control */ + u32 secure_access; /* Secure Access */ + u32 status; /* Status */ + u32 impr_err; /* Imprecise Error */ + u8 res_14[0x100 - 0x14]; + u32 pmcr; /* Performance Monitor Control */ + u8 res_104[0xfd0 - 0x104]; + u32 pid[8]; /* Peripheral ID */ + u32 cid[4]; /* Component ID */ + struct { + u32 snoop_ctrl; /* Snoop Control */ + u32 sha_ord; /* Shareable Override */ + u8 res_1008[0x1100 - 0x1008]; + u32 rc_qos_ord; /* read channel QoS Value Override */ + u32 wc_qos_ord; /* read channel QoS Value Override */ + u8 res_1108[0x110c - 0x1108]; + u32 qos_ctrl; /* QoS Control */ + u32 max_ot; /* Max OT */ + u8 res_1114[0x1130 - 0x1114]; + u32 target_lat; /* Target Latency */ + u32 latency_regu; /* Latency Regulation */ + u32 qos_range; /* QoS Range */ + u8 res_113c[0x2000 - 0x113c]; + } slave[5]; /* Slave Interface */ + u8 res_6000[0x9004 - 0x6000]; + u32 cycle_counter; /* Cycle counter */ + u32 count_ctrl; /* Count Control */ + u32 overflow_status; /* Overflow Flag Status */ + u8 res_9010[0xa000 - 0x9010]; + struct { + u32 event_select; /* Event Select */ + u32 event_count; /* Event Count */ + u32 counter_ctrl; /* Counter Control */ + u32 overflow_status; /* Overflow Flag Status */ + u8 res_a010[0xb000 - 0xa010]; + } pcounter[4]; /* Performance Counter */ + u8 res_e004[0x10000 - 0xe004]; +}; +#endif /* __ASM_ARCH_LS102XA_IMMAP_H_ */ diff --git a/arch/arm/include/asm/arch-ls102xa/imx-regs.h b/arch/arm/include/asm/arch-ls102xa/imx-regs.h new file mode 100644 index 0000000000..f9cd75b021 --- /dev/null +++ b/arch/arm/include/asm/arch-ls102xa/imx-regs.h @@ -0,0 +1,53 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + * + */ + +#ifndef __ASM_ARCH_IMX_REGS_H__ +#define __ASM_ARCH_IMX_REGS_H__ + +#define I2C_QUIRK_REG /* enable 8-bit driver */ + +#ifdef CONFIG_LPUART_32B_REG +struct lpuart_fsl { + u32 baud; + u32 stat; + u32 ctrl; + u32 data; + u32 match; + u32 modir; + u32 fifo; + u32 water; +}; +#else +struct lpuart_fsl { + u8 ubdh; + u8 ubdl; + u8 uc1; + u8 uc2; + u8 us1; + u8 us2; + u8 uc3; + u8 ud; + u8 uma1; + u8 uma2; + u8 uc4; + u8 uc5; + u8 ued; + u8 umodem; + u8 uir; + u8 reserved; + u8 upfifo; + u8 ucfifo; + u8 usfifo; + u8 utwfifo; + u8 utcfifo; + u8 urwfifo; + u8 urcfifo; + u8 rsvd[28]; +}; +#endif + +#endif /* __ASM_ARCH_IMX_REGS_H__ */ diff --git a/arch/arm/include/asm/arch-tegra/gpio.h b/arch/arm/include/asm/arch-tegra/gpio.h index 44cd455699..7334e0ccd5 100644 --- a/arch/arm/include/asm/arch-tegra/gpio.h +++ b/arch/arm/include/asm/arch-tegra/gpio.h @@ -6,6 +6,8 @@ #ifndef _TEGRA_GPIO_H_ #define _TEGRA_GPIO_H_ +#define TEGRA_GPIOS_PER_PORT 8 +#define TEGRA_PORTS_PER_BANK 4 #define MAX_NUM_GPIOS (TEGRA_GPIO_PORTS * TEGRA_GPIO_BANKS * 8) #define GPIO_NAME_SIZE 20 /* gpio_request max label len */ @@ -25,9 +27,14 @@ struct tegra_gpio_config { u32 init:2; }; -/* - * Tegra-specific GPIO API +/** + * tegra_spl_gpio_direction_output() - set the output value of a GPIO + * + * This function is only used from SPL on seaboard, which needs to enable a + * GPIO to get the UART running. It could be done in U-Boot rather than SPL, + * but for now, this gets it working */ +int tegra_spl_gpio_direction_output(int gpio, int value); /** * Configure a list of GPIOs @@ -37,8 +44,4 @@ struct tegra_gpio_config { */ void gpio_config_table(const struct tegra_gpio_config *config, int len); -void gpio_info(void); - -#define gpio_status() gpio_info() - #endif /* TEGRA_GPIO_H_ */ diff --git a/arch/arm/include/asm/config.h b/arch/arm/include/asm/config.h index 5f2a5f4ea9..be80434dee 100644 --- a/arch/arm/include/asm/config.h +++ b/arch/arm/include/asm/config.h @@ -23,4 +23,8 @@ #include <asm/arch-fsl-lsch3/config.h> #endif +#ifdef CONFIG_LS102XA +#include <asm/arch/config.h> +#endif + #endif diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index 88ecddbc41..bfbe0a0988 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h @@ -376,7 +376,12 @@ out: return retval; } -#elif !defined(readb) +#else +#define memset_io(a, b, c) memset((void *)(a), (b), (c)) +#define memcpy_fromio(a, b, c) memcpy((a), (void *)(b), (c)) +#define memcpy_toio(a, b, c) memcpy((void *)(a), (b), (c)) + +#if !defined(readb) #define readb(addr) (__readwrite_bug("readb"),0) #define readw(addr) (__readwrite_bug("readw"),0) @@ -389,6 +394,7 @@ out: #define check_signature(io,sig,len) (0) +#endif #endif /* __mem_pci */ /* diff --git a/arch/arm/lib/spl.c b/arch/arm/lib/spl.c index 75ab546923..dfcc596815 100644 --- a/arch/arm/lib/spl.c +++ b/arch/arm/lib/spl.c @@ -28,6 +28,9 @@ void __weak board_init_f(ulong dummy) /* Clear the BSS. */ memset(__bss_start, 0, __bss_end - __bss_start); + /* Set global data pointer. */ + gd = &gdata; + board_init_r(NULL, 0); } diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig index 46337aea55..66de2ad7ef 100644 --- a/arch/avr32/Kconfig +++ b/arch/avr32/Kconfig @@ -2,7 +2,6 @@ menu "AVR32 architecture" depends on AVR32 config SYS_ARCH - string default "avr32" choice diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig index bb8a133059..31913fe29f 100644 --- a/arch/blackfin/Kconfig +++ b/arch/blackfin/Kconfig @@ -2,7 +2,6 @@ menu "Blackfin architecture" depends on BLACKFIN config SYS_ARCH - string default "blackfin" choice diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 6cda7db699..5374b4d6eb 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig @@ -2,7 +2,6 @@ menu "M68000 architecture" depends on M68K config SYS_ARCH - string default "m68k" choice diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index ddaa45fb66..33bfd9f2f4 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig @@ -2,7 +2,6 @@ menu "MicroBlaze architecture" depends on MICROBLAZE config SYS_ARCH - string default "microblaze" choice diff --git a/arch/microblaze/include/asm/posix_types.h b/arch/microblaze/include/asm/posix_types.h index 38dc5aa85d..ccc6235c8d 100644 --- a/arch/microblaze/include/asm/posix_types.h +++ b/arch/microblaze/include/asm/posix_types.h @@ -27,7 +27,11 @@ typedef int __kernel_pid_t; typedef unsigned short __kernel_ipc_pid_t; typedef unsigned int __kernel_uid_t; typedef unsigned int __kernel_gid_t; +#ifdef __GNUC__ +typedef __SIZE_TYPE__ __kernel_size_t; +#else typedef unsigned int __kernel_size_t; +#endif typedef int __kernel_ssize_t; typedef int __kernel_ptrdiff_t; typedef long __kernel_time_t; diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 5bf0df4ff1..7686b779bf 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -2,7 +2,6 @@ menu "MIPS architecture" depends on MIPS config SYS_ARCH - string default "mips" choice diff --git a/arch/nds32/Kconfig b/arch/nds32/Kconfig index 743a8fe736..81b0a0158f 100644 --- a/arch/nds32/Kconfig +++ b/arch/nds32/Kconfig @@ -2,7 +2,6 @@ menu "NDS32 architecture" depends on NDS32 config SYS_ARCH - string default "nds32" choice diff --git a/arch/nios2/Kconfig b/arch/nios2/Kconfig index 0cba45bdbe..b3be7b56c3 100644 --- a/arch/nios2/Kconfig +++ b/arch/nios2/Kconfig @@ -2,7 +2,6 @@ menu "Nios II architecture" depends on NIOS2 config SYS_ARCH - string default "nios2" choice diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig index cc54a2eec1..4d62b4c977 100644 --- a/arch/openrisc/Kconfig +++ b/arch/openrisc/Kconfig @@ -2,7 +2,6 @@ menu "OpenRISC architecture" depends on OPENRISC config SYS_ARCH - string default "openrisc" choice diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 3325af3e5c..6f96c7cc52 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -2,7 +2,6 @@ menu "PowerPC architecture" depends on PPC config SYS_ARCH - string default "powerpc" choice diff --git a/arch/powerpc/cpu/74xx_7xx/Kconfig b/arch/powerpc/cpu/74xx_7xx/Kconfig index 6ce464da76..3378c91645 100644 --- a/arch/powerpc/cpu/74xx_7xx/Kconfig +++ b/arch/powerpc/cpu/74xx_7xx/Kconfig @@ -2,7 +2,6 @@ menu "74xx_7xx CPU" depends on 74xx_7xx config SYS_CPU - string default "74xx_7xx" choice diff --git a/arch/powerpc/cpu/mpc512x/Kconfig b/arch/powerpc/cpu/mpc512x/Kconfig index bfc4eae980..a0f0ede6f3 100644 --- a/arch/powerpc/cpu/mpc512x/Kconfig +++ b/arch/powerpc/cpu/mpc512x/Kconfig @@ -2,7 +2,6 @@ menu "mpc512x CPU" depends on MPC512X config SYS_CPU - string default "mpc512x" choice diff --git a/arch/powerpc/cpu/mpc5xx/Kconfig b/arch/powerpc/cpu/mpc5xx/Kconfig index 79579d7683..aad4a7cdd8 100644 --- a/arch/powerpc/cpu/mpc5xx/Kconfig +++ b/arch/powerpc/cpu/mpc5xx/Kconfig @@ -2,7 +2,6 @@ menu "mpc5xx CPU" depends on 5xx config SYS_CPU - string default "mpc5xx" choice diff --git a/arch/powerpc/cpu/mpc5xxx/Kconfig b/arch/powerpc/cpu/mpc5xxx/Kconfig index b2f0bad544..cca58e5bbb 100644 --- a/arch/powerpc/cpu/mpc5xxx/Kconfig +++ b/arch/powerpc/cpu/mpc5xxx/Kconfig @@ -2,7 +2,6 @@ menu "mpc5xxx CPU" depends on MPC5xxx config SYS_CPU - string default "mpc5xxx" choice diff --git a/arch/powerpc/cpu/mpc824x/Kconfig b/arch/powerpc/cpu/mpc824x/Kconfig index 309833f8c8..4f984230a4 100644 --- a/arch/powerpc/cpu/mpc824x/Kconfig +++ b/arch/powerpc/cpu/mpc824x/Kconfig @@ -2,7 +2,6 @@ menu "mpc824x CPU" depends on MPC824X config SYS_CPU - string default "mpc824x" choice diff --git a/arch/powerpc/cpu/mpc8260/Kconfig b/arch/powerpc/cpu/mpc8260/Kconfig index 1a8707de3b..41e4e5f1ec 100644 --- a/arch/powerpc/cpu/mpc8260/Kconfig +++ b/arch/powerpc/cpu/mpc8260/Kconfig @@ -2,7 +2,6 @@ menu "mpc8260 CPU" depends on MPC8260 config SYS_CPU - string default "mpc8260" choice diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig index 5fd33934b3..6de9265088 100644 --- a/arch/powerpc/cpu/mpc83xx/Kconfig +++ b/arch/powerpc/cpu/mpc83xx/Kconfig @@ -2,7 +2,6 @@ menu "mpc83xx CPU" depends on MPC83xx config SYS_CPU - string default "mpc83xx" choice diff --git a/arch/powerpc/cpu/mpc85xx/Kconfig b/arch/powerpc/cpu/mpc85xx/Kconfig index 0f703804da..8c1c01c342 100644 --- a/arch/powerpc/cpu/mpc85xx/Kconfig +++ b/arch/powerpc/cpu/mpc85xx/Kconfig @@ -2,7 +2,6 @@ menu "mpc85xx CPU" depends on MPC85xx config SYS_CPU - string default "mpc85xx" choice diff --git a/arch/powerpc/cpu/mpc86xx/Kconfig b/arch/powerpc/cpu/mpc86xx/Kconfig index f0ff4419d1..14e8b1aa66 100644 --- a/arch/powerpc/cpu/mpc86xx/Kconfig +++ b/arch/powerpc/cpu/mpc86xx/Kconfig @@ -2,7 +2,6 @@ menu "mpc86xx CPU" depends on MPC86xx config SYS_CPU - string default "mpc86xx" choice diff --git a/arch/powerpc/cpu/mpc8xx/Kconfig b/arch/powerpc/cpu/mpc8xx/Kconfig index 2c39244fa7..f1dca90eba 100644 --- a/arch/powerpc/cpu/mpc8xx/Kconfig +++ b/arch/powerpc/cpu/mpc8xx/Kconfig @@ -2,7 +2,6 @@ menu "mpc8xx CPU" depends on 8xx config SYS_CPU - string default "mpc8xx" choice diff --git a/arch/powerpc/cpu/ppc4xx/Kconfig b/arch/powerpc/cpu/ppc4xx/Kconfig index 2d15dd1210..41b525c16d 100644 --- a/arch/powerpc/cpu/ppc4xx/Kconfig +++ b/arch/powerpc/cpu/ppc4xx/Kconfig @@ -2,7 +2,6 @@ menu "ppc4xx CPU" depends on 4xx config SYS_CPU - string default "ppc4xx" choice diff --git a/arch/powerpc/include/asm/fsl_enet.h b/arch/powerpc/include/asm/fsl_enet.h deleted file mode 100644 index 96146b6e32..0000000000 --- a/arch/powerpc/include/asm/fsl_enet.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010 Freescale Semiconductor, Inc. - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#ifndef __ASM_PPC_FSL_ENET_H -#define __ASM_PPC_FSL_ENET_H - -#include <phy.h> - -struct tsec_mii_mng { - u32 miimcfg; /* MII management configuration reg */ - u32 miimcom; /* MII management command reg */ - u32 miimadd; /* MII management address reg */ - u32 miimcon; /* MII management control reg */ - u32 miimstat; /* MII management status reg */ - u32 miimind; /* MII management indication reg */ - u32 ifstat; /* Interface Status Register */ -} __attribute__ ((packed)); - -int fdt_fixup_phy_connection(void *blob, int offset, phy_interface_t phyc); - -#endif /* __ASM_PPC_FSL_ENET_H */ diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig index c393550694..3057325b47 100644 --- a/arch/sandbox/Kconfig +++ b/arch/sandbox/Kconfig @@ -2,15 +2,12 @@ menu "Sandbox architecture" depends on SANDBOX config SYS_ARCH - string default "sandbox" config SYS_BOARD - string default "sandbox" config SYS_CONFIG_NAME - string default "sandbox" endmenu diff --git a/arch/sandbox/dts/sandbox.dts b/arch/sandbox/dts/sandbox.dts index efffacba1d..797478a2c7 100644 --- a/arch/sandbox/dts/sandbox.dts +++ b/arch/sandbox/dts/sandbox.dts @@ -1,6 +1,16 @@ /dts-v1/; / { + chosen { + stdout-path = "/serial"; + }; + + /* Needs to be available prior to relocation */ + uart0: serial { + compatible = "sandbox,serial"; + sandbox,text-colour = "cyan"; + }; + triangle { compatible = "demo-shape"; colour = "cyan"; diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index e6ded16b20..4bf9afc384 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -2,7 +2,6 @@ menu "SuperH architecture" depends on SH config SYS_ARCH - string default "sh" choice diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index fc9291037c..733334f931 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -2,7 +2,6 @@ menu "SPARC architecture" depends on SPARC config SYS_ARCH - string default "sparc" choice diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 8fc619a3c0..ff9935acc4 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -2,7 +2,6 @@ menu "x86 architecture" depends on X86 config SYS_ARCH - string default "x86" choice diff --git a/board/8dtech/eco5pk/Kconfig b/board/8dtech/eco5pk/Kconfig index 0af1b30318..55535669fa 100644 --- a/board/8dtech/eco5pk/Kconfig +++ b/board/8dtech/eco5pk/Kconfig @@ -1,15 +1,12 @@ if TARGET_ECO5PK config SYS_BOARD - string default "eco5pk" config SYS_VENDOR - string default "8dtech" config SYS_CONFIG_NAME - string default "eco5pk" endif diff --git a/board/AndesTech/adp-ag101/Kconfig b/board/AndesTech/adp-ag101/Kconfig index 356754344d..8f0197a638 100644 --- a/board/AndesTech/adp-ag101/Kconfig +++ b/board/AndesTech/adp-ag101/Kconfig @@ -1,23 +1,18 @@ if TARGET_ADP_AG101 config SYS_CPU - string default "n1213" config SYS_BOARD - string default "adp-ag101" config SYS_VENDOR - string default "AndesTech" config SYS_SOC - string default "ag101" config SYS_CONFIG_NAME - string default "adp-ag101" endif diff --git a/board/AndesTech/adp-ag101p/Kconfig b/board/AndesTech/adp-ag101p/Kconfig index ee551a67da..5e8aa22c44 100644 --- a/board/AndesTech/adp-ag101p/Kconfig +++ b/board/AndesTech/adp-ag101p/Kconfig @@ -1,23 +1,18 @@ if TARGET_ADP_AG101P config SYS_CPU - string default "n1213" config SYS_BOARD - string default "adp-ag101p" config SYS_VENDOR - string default "AndesTech" config SYS_SOC - string default "ag101" config SYS_CONFIG_NAME - string default "adp-ag101p" endif diff --git a/board/AndesTech/adp-ag102/Kconfig b/board/AndesTech/adp-ag102/Kconfig index 34566bd071..fc17be3989 100644 --- a/board/AndesTech/adp-ag102/Kconfig +++ b/board/AndesTech/adp-ag102/Kconfig @@ -1,23 +1,18 @@ if TARGET_ADP_AG102 config SYS_CPU - string default "n1213" config SYS_BOARD - string default "adp-ag102" config SYS_VENDOR - string default "AndesTech" config SYS_SOC - string default "ag102" config SYS_CONFIG_NAME - string default "adp-ag102" endif diff --git a/board/Barix/ipam390/Kconfig b/board/Barix/ipam390/Kconfig index 588ee73791..b85d4da44b 100644 --- a/board/Barix/ipam390/Kconfig +++ b/board/Barix/ipam390/Kconfig @@ -1,15 +1,12 @@ if TARGET_IPAM390 config SYS_BOARD - string default "ipam390" config SYS_VENDOR - string default "Barix" config SYS_CONFIG_NAME - string default "ipam390" endif diff --git a/board/BuR/kwb/Kconfig b/board/BuR/kwb/Kconfig index 5676c4fe5b..f9107a9a4b 100644 --- a/board/BuR/kwb/Kconfig +++ b/board/BuR/kwb/Kconfig @@ -1,23 +1,18 @@ if TARGET_KWB config SYS_CPU - string default "armv7" config SYS_BOARD - string default "kwb" config SYS_VENDOR - string default "BuR" config SYS_SOC - string default "am33xx" config SYS_CONFIG_NAME - string default "kwb" endif diff --git a/board/BuR/tseries/Kconfig b/board/BuR/tseries/Kconfig index f452023180..ee510d3480 100644 --- a/board/BuR/tseries/Kconfig +++ b/board/BuR/tseries/Kconfig @@ -1,23 +1,18 @@ if TARGET_TSERIES config SYS_CPU - string default "armv7" config SYS_BOARD - string default "tseries" config SYS_VENDOR - string default "BuR" config SYS_SOC - string default "am33xx" config SYS_CONFIG_NAME - string default "tseries" endif diff --git a/board/BuS/eb_cpu5282/Kconfig b/board/BuS/eb_cpu5282/Kconfig index f53f295187..237dc1b5c0 100644 --- a/board/BuS/eb_cpu5282/Kconfig +++ b/board/BuS/eb_cpu5282/Kconfig @@ -1,19 +1,15 @@ if TARGET_EB_CPU5282 config SYS_CPU - string default "mcf52x2" config SYS_BOARD - string default "eb_cpu5282" config SYS_VENDOR - string default "BuS" config SYS_CONFIG_NAME - string default "eb_cpu5282" endif diff --git a/board/BuS/eb_cpux9k2/Kconfig b/board/BuS/eb_cpux9k2/Kconfig index 3a36cf3344..85d335a0e5 100644 --- a/board/BuS/eb_cpux9k2/Kconfig +++ b/board/BuS/eb_cpux9k2/Kconfig @@ -1,23 +1,18 @@ if TARGET_EB_CPUX9K2 config SYS_CPU - string default "arm920t" config SYS_BOARD - string default "eb_cpux9k2" config SYS_VENDOR - string default "BuS" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "eb_cpux9k2" endif diff --git a/board/BuS/vl_ma2sc/Kconfig b/board/BuS/vl_ma2sc/Kconfig index d4a6e5202e..bb6a7e787d 100644 --- a/board/BuS/vl_ma2sc/Kconfig +++ b/board/BuS/vl_ma2sc/Kconfig @@ -1,23 +1,18 @@ if TARGET_VL_MA2SC config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "vl_ma2sc" config SYS_VENDOR - string default "BuS" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "vl_ma2sc" endif diff --git a/board/CarMediaLab/flea3/Kconfig b/board/CarMediaLab/flea3/Kconfig index cbc004a44d..1448703dc1 100644 --- a/board/CarMediaLab/flea3/Kconfig +++ b/board/CarMediaLab/flea3/Kconfig @@ -1,23 +1,18 @@ if TARGET_FLEA3 config SYS_CPU - string default "arm1136" config SYS_BOARD - string default "flea3" config SYS_VENDOR - string default "CarMediaLab" config SYS_SOC - string default "mx35" config SYS_CONFIG_NAME - string default "flea3" endif diff --git a/board/LEOX/elpt860/Kconfig b/board/LEOX/elpt860/Kconfig index 2cfa5bcbcb..ed74956b83 100644 --- a/board/LEOX/elpt860/Kconfig +++ b/board/LEOX/elpt860/Kconfig @@ -1,15 +1,12 @@ if TARGET_ELPT860 config SYS_BOARD - string default "elpt860" config SYS_VENDOR - string default "LEOX" config SYS_CONFIG_NAME - string default "ELPT860" endif diff --git a/board/LaCie/edminiv2/Kconfig b/board/LaCie/edminiv2/Kconfig index 9675a9efb5..ac3fe3fbcb 100644 --- a/board/LaCie/edminiv2/Kconfig +++ b/board/LaCie/edminiv2/Kconfig @@ -1,15 +1,12 @@ if TARGET_EDMINIV2 config SYS_BOARD - string default "edminiv2" config SYS_VENDOR - string default "LaCie" config SYS_CONFIG_NAME - string default "edminiv2" endif diff --git a/board/LaCie/net2big_v2/Kconfig b/board/LaCie/net2big_v2/Kconfig index e8eb9ad5bc..ba460dba45 100644 --- a/board/LaCie/net2big_v2/Kconfig +++ b/board/LaCie/net2big_v2/Kconfig @@ -1,15 +1,12 @@ if TARGET_NET2BIG_V2 config SYS_BOARD - string default "net2big_v2" config SYS_VENDOR - string default "LaCie" config SYS_CONFIG_NAME - string default "lacie_kw" endif diff --git a/board/LaCie/netspace_v2/Kconfig b/board/LaCie/netspace_v2/Kconfig index 6242a42389..930b822dfb 100644 --- a/board/LaCie/netspace_v2/Kconfig +++ b/board/LaCie/netspace_v2/Kconfig @@ -1,15 +1,12 @@ if TARGET_NETSPACE_V2 config SYS_BOARD - string default "netspace_v2" config SYS_VENDOR - string default "LaCie" config SYS_CONFIG_NAME - string default "lacie_kw" endif diff --git a/board/LaCie/wireless_space/Kconfig b/board/LaCie/wireless_space/Kconfig index ea6850f477..75a2fc5a75 100644 --- a/board/LaCie/wireless_space/Kconfig +++ b/board/LaCie/wireless_space/Kconfig @@ -1,15 +1,12 @@ if TARGET_WIRELESS_SPACE config SYS_BOARD - string default "wireless_space" config SYS_VENDOR - string default "LaCie" config SYS_CONFIG_NAME - string default "wireless_space" endif diff --git a/board/Marvell/aspenite/Kconfig b/board/Marvell/aspenite/Kconfig index 7edcd8102d..ee2ec06f1e 100644 --- a/board/Marvell/aspenite/Kconfig +++ b/board/Marvell/aspenite/Kconfig @@ -1,23 +1,18 @@ if TARGET_ASPENITE config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "aspenite" config SYS_VENDOR - string default "Marvell" config SYS_SOC - string default "armada100" config SYS_CONFIG_NAME - string default "aspenite" endif diff --git a/board/Marvell/db64360/Kconfig b/board/Marvell/db64360/Kconfig index c08fd05b9e..c5118f8c88 100644 --- a/board/Marvell/db64360/Kconfig +++ b/board/Marvell/db64360/Kconfig @@ -1,15 +1,12 @@ if TARGET_DB64360 config SYS_BOARD - string default "db64360" config SYS_VENDOR - string default "Marvell" config SYS_CONFIG_NAME - string default "DB64360" endif diff --git a/board/Marvell/db64460/Kconfig b/board/Marvell/db64460/Kconfig index 3cd2eb433e..f53e3a9c85 100644 --- a/board/Marvell/db64460/Kconfig +++ b/board/Marvell/db64460/Kconfig @@ -1,15 +1,12 @@ if TARGET_DB64460 config SYS_BOARD - string default "db64460" config SYS_VENDOR - string default "Marvell" config SYS_CONFIG_NAME - string default "DB64460" endif diff --git a/board/Marvell/dkb/Kconfig b/board/Marvell/dkb/Kconfig index 7ce761b94d..33d5157bc3 100644 --- a/board/Marvell/dkb/Kconfig +++ b/board/Marvell/dkb/Kconfig @@ -1,23 +1,18 @@ if TARGET_DKB config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "dkb" config SYS_VENDOR - string default "Marvell" config SYS_SOC - string default "pantheon" config SYS_CONFIG_NAME - string default "dkb" endif diff --git a/board/Marvell/dreamplug/Kconfig b/board/Marvell/dreamplug/Kconfig index afaddf4a81..f65ff73713 100644 --- a/board/Marvell/dreamplug/Kconfig +++ b/board/Marvell/dreamplug/Kconfig @@ -1,15 +1,12 @@ if TARGET_DREAMPLUG config SYS_BOARD - string default "dreamplug" config SYS_VENDOR - string default "Marvell" config SYS_CONFIG_NAME - string default "dreamplug" endif diff --git a/board/Marvell/gplugd/Kconfig b/board/Marvell/gplugd/Kconfig index 94cdd4887a..102c18d30d 100644 --- a/board/Marvell/gplugd/Kconfig +++ b/board/Marvell/gplugd/Kconfig @@ -1,23 +1,18 @@ if TARGET_GPLUGD config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "gplugd" config SYS_VENDOR - string default "Marvell" config SYS_SOC - string default "armada100" config SYS_CONFIG_NAME - string default "gplugd" endif diff --git a/board/Marvell/guruplug/Kconfig b/board/Marvell/guruplug/Kconfig index 0b10e9f774..529e6e3b4b 100644 --- a/board/Marvell/guruplug/Kconfig +++ b/board/Marvell/guruplug/Kconfig @@ -1,15 +1,12 @@ if TARGET_GURUPLUG config SYS_BOARD - string default "guruplug" config SYS_VENDOR - string default "Marvell" config SYS_CONFIG_NAME - string default "guruplug" endif diff --git a/board/Marvell/mv88f6281gtw_ge/Kconfig b/board/Marvell/mv88f6281gtw_ge/Kconfig index 49654fe769..00d7d1c5ee 100644 --- a/board/Marvell/mv88f6281gtw_ge/Kconfig +++ b/board/Marvell/mv88f6281gtw_ge/Kconfig @@ -1,15 +1,12 @@ if TARGET_MV88F6281GTW_GE config SYS_BOARD - string default "mv88f6281gtw_ge" config SYS_VENDOR - string default "Marvell" config SYS_CONFIG_NAME - string default "mv88f6281gtw_ge" endif diff --git a/board/Marvell/openrd/Kconfig b/board/Marvell/openrd/Kconfig index 7032ba57ce..124b66da0f 100644 --- a/board/Marvell/openrd/Kconfig +++ b/board/Marvell/openrd/Kconfig @@ -1,15 +1,12 @@ if TARGET_OPENRD config SYS_BOARD - string default "openrd" config SYS_VENDOR - string default "Marvell" config SYS_CONFIG_NAME - string default "openrd" endif diff --git a/board/Marvell/rd6281a/Kconfig b/board/Marvell/rd6281a/Kconfig index e8702a7d19..025ee26dc6 100644 --- a/board/Marvell/rd6281a/Kconfig +++ b/board/Marvell/rd6281a/Kconfig @@ -1,15 +1,12 @@ if TARGET_RD6281A config SYS_BOARD - string default "rd6281a" config SYS_VENDOR - string default "Marvell" config SYS_CONFIG_NAME - string default "rd6281a" endif diff --git a/board/Marvell/sheevaplug/Kconfig b/board/Marvell/sheevaplug/Kconfig index 1c24d24221..e5f9284729 100644 --- a/board/Marvell/sheevaplug/Kconfig +++ b/board/Marvell/sheevaplug/Kconfig @@ -1,15 +1,12 @@ if TARGET_SHEEVAPLUG config SYS_BOARD - string default "sheevaplug" config SYS_VENDOR - string default "Marvell" config SYS_CONFIG_NAME - string default "sheevaplug" endif diff --git a/board/RRvision/Kconfig b/board/RRvision/Kconfig index ac6bebcdf1..7c8a6f634c 100644 --- a/board/RRvision/Kconfig +++ b/board/RRvision/Kconfig @@ -1,11 +1,9 @@ if TARGET_RRVISION config SYS_BOARD - string default "RRvision" config SYS_CONFIG_NAME - string default "RRvision" endif diff --git a/board/Seagate/dockstar/Kconfig b/board/Seagate/dockstar/Kconfig index 13ea620ea6..b50cd3b7f6 100644 --- a/board/Seagate/dockstar/Kconfig +++ b/board/Seagate/dockstar/Kconfig @@ -1,15 +1,12 @@ if TARGET_DOCKSTAR config SYS_BOARD - string default "dockstar" config SYS_VENDOR - string default "Seagate" config SYS_CONFIG_NAME - string default "dockstar" endif diff --git a/board/Seagate/goflexhome/Kconfig b/board/Seagate/goflexhome/Kconfig index 2fb14ef86f..0cbeaf7ca7 100644 --- a/board/Seagate/goflexhome/Kconfig +++ b/board/Seagate/goflexhome/Kconfig @@ -1,15 +1,12 @@ if TARGET_GOFLEXHOME config SYS_BOARD - string default "goflexhome" config SYS_VENDOR - string default "Seagate" config SYS_CONFIG_NAME - string default "goflexhome" endif diff --git a/board/a3000/Kconfig b/board/a3000/Kconfig index 9ce64fdb7e..21a9e487e4 100644 --- a/board/a3000/Kconfig +++ b/board/a3000/Kconfig @@ -1,11 +1,9 @@ if TARGET_A3000 config SYS_BOARD - string default "a3000" config SYS_CONFIG_NAME - string default "A3000" endif diff --git a/board/a3m071/Kconfig b/board/a3m071/Kconfig index ab32d5ca1c..444c450d8a 100644 --- a/board/a3m071/Kconfig +++ b/board/a3m071/Kconfig @@ -1,11 +1,9 @@ if TARGET_A3M071 config SYS_BOARD - string default "a3m071" config SYS_CONFIG_NAME - string default "a3m071" endif diff --git a/board/a4m072/Kconfig b/board/a4m072/Kconfig index cc3194756c..ba5447fb9a 100644 --- a/board/a4m072/Kconfig +++ b/board/a4m072/Kconfig @@ -1,11 +1,9 @@ if TARGET_A4M072 config SYS_BOARD - string default "a4m072" config SYS_CONFIG_NAME - string default "a4m072" endif diff --git a/board/abilis/tb100/Kconfig b/board/abilis/tb100/Kconfig index eccf92817c..904a92c7a0 100644 --- a/board/abilis/tb100/Kconfig +++ b/board/abilis/tb100/Kconfig @@ -1,19 +1,15 @@ if TARGET_TB100 config SYS_CPU - string default "arc700" config SYS_BOARD - string default "tb100" config SYS_VENDOR - string default "abilis" config SYS_CONFIG_NAME - string default "tb100" endif diff --git a/board/afeb9260/Kconfig b/board/afeb9260/Kconfig index 008d943425..ff191811ba 100644 --- a/board/afeb9260/Kconfig +++ b/board/afeb9260/Kconfig @@ -1,19 +1,15 @@ if TARGET_AFEB9260 config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "afeb9260" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "afeb9260" endif diff --git a/board/ait/cam_enc_4xx/Kconfig b/board/ait/cam_enc_4xx/Kconfig index 2b886929b5..64e18f4e23 100644 --- a/board/ait/cam_enc_4xx/Kconfig +++ b/board/ait/cam_enc_4xx/Kconfig @@ -1,15 +1,12 @@ if TARGET_CAM_ENC_4XX config SYS_BOARD - string default "cam_enc_4xx" config SYS_VENDOR - string default "ait" config SYS_CONFIG_NAME - string default "cam_enc_4xx" endif diff --git a/board/alphaproject/ap_sh4a_4a/Kconfig b/board/alphaproject/ap_sh4a_4a/Kconfig index 78931643a4..2352e66806 100644 --- a/board/alphaproject/ap_sh4a_4a/Kconfig +++ b/board/alphaproject/ap_sh4a_4a/Kconfig @@ -1,19 +1,15 @@ if TARGET_AP_SH4A_4A config SYS_CPU - string default "sh4" config SYS_BOARD - string default "ap_sh4a_4a" config SYS_VENDOR - string default "alphaproject" config SYS_CONFIG_NAME - string default "ap_sh4a_4a" endif diff --git a/board/altera/nios2-generic/Kconfig b/board/altera/nios2-generic/Kconfig index 12096380b8..cd3d0980a7 100644 --- a/board/altera/nios2-generic/Kconfig +++ b/board/altera/nios2-generic/Kconfig @@ -1,15 +1,12 @@ if TARGET_NIOS2_GENERIC config SYS_BOARD - string default "nios2-generic" config SYS_VENDOR - string default "altera" config SYS_CONFIG_NAME - string default "nios2-generic" endif diff --git a/board/altera/socfpga/Kconfig b/board/altera/socfpga/Kconfig index d0d90128bc..f8595781d9 100644 --- a/board/altera/socfpga/Kconfig +++ b/board/altera/socfpga/Kconfig @@ -1,23 +1,18 @@ if TARGET_SOCFPGA_CYCLONE5 config SYS_CPU - string default "armv7" config SYS_BOARD - string default "socfpga" config SYS_VENDOR - string default "altera" config SYS_SOC - string default "socfpga" config SYS_CONFIG_NAME - string default "socfpga_cyclone5" endif diff --git a/board/amcc/acadia/Kconfig b/board/amcc/acadia/Kconfig index 096f02e5ee..033deaf7d6 100644 --- a/board/amcc/acadia/Kconfig +++ b/board/amcc/acadia/Kconfig @@ -1,15 +1,12 @@ if TARGET_ACADIA config SYS_BOARD - string default "acadia" config SYS_VENDOR - string default "amcc" config SYS_CONFIG_NAME - string default "acadia" endif diff --git a/board/amcc/bamboo/Kconfig b/board/amcc/bamboo/Kconfig index a002cfa428..c0bd40aee7 100644 --- a/board/amcc/bamboo/Kconfig +++ b/board/amcc/bamboo/Kconfig @@ -1,15 +1,12 @@ if TARGET_BAMBOO config SYS_BOARD - string default "bamboo" config SYS_VENDOR - string default "amcc" config SYS_CONFIG_NAME - string default "bamboo" endif diff --git a/board/amcc/bluestone/Kconfig b/board/amcc/bluestone/Kconfig index 2f5999d194..255e013777 100644 --- a/board/amcc/bluestone/Kconfig +++ b/board/amcc/bluestone/Kconfig @@ -1,15 +1,12 @@ if TARGET_BLUESTONE config SYS_BOARD - string default "bluestone" config SYS_VENDOR - string default "amcc" config SYS_CONFIG_NAME - string default "bluestone" endif diff --git a/board/amcc/bubinga/Kconfig b/board/amcc/bubinga/Kconfig index 29f769b009..540d9b6235 100644 --- a/board/amcc/bubinga/Kconfig +++ b/board/amcc/bubinga/Kconfig @@ -1,15 +1,12 @@ if TARGET_BUBINGA config SYS_BOARD - string default "bubinga" config SYS_VENDOR - string default "amcc" config SYS_CONFIG_NAME - string default "bubinga" endif diff --git a/board/amcc/canyonlands/Kconfig b/board/amcc/canyonlands/Kconfig index 545056a15c..530a6efd60 100644 --- a/board/amcc/canyonlands/Kconfig +++ b/board/amcc/canyonlands/Kconfig @@ -1,15 +1,12 @@ if TARGET_CANYONLANDS config SYS_BOARD - string default "canyonlands" config SYS_VENDOR - string default "amcc" config SYS_CONFIG_NAME - string default "canyonlands" endif diff --git a/board/amcc/ebony/Kconfig b/board/amcc/ebony/Kconfig index cc1448f133..62394b68fa 100644 --- a/board/amcc/ebony/Kconfig +++ b/board/amcc/ebony/Kconfig @@ -1,15 +1,12 @@ if TARGET_EBONY config SYS_BOARD - string default "ebony" config SYS_VENDOR - string default "amcc" config SYS_CONFIG_NAME - string default "ebony" endif diff --git a/board/amcc/katmai/Kconfig b/board/amcc/katmai/Kconfig index 2a8d783a53..fc606cff1c 100644 --- a/board/amcc/katmai/Kconfig +++ b/board/amcc/katmai/Kconfig @@ -1,15 +1,12 @@ if TARGET_KATMAI config SYS_BOARD - string default "katmai" config SYS_VENDOR - string default "amcc" config SYS_CONFIG_NAME - string default "katmai" endif diff --git a/board/amcc/kilauea/Kconfig b/board/amcc/kilauea/Kconfig index 3564cc3c89..3f2f434827 100644 --- a/board/amcc/kilauea/Kconfig +++ b/board/amcc/kilauea/Kconfig @@ -1,15 +1,12 @@ if TARGET_KILAUEA config SYS_BOARD - string default "kilauea" config SYS_VENDOR - string default "amcc" config SYS_CONFIG_NAME - string default "kilauea" endif diff --git a/board/amcc/luan/Kconfig b/board/amcc/luan/Kconfig index 7f199809b5..3df90af484 100644 --- a/board/amcc/luan/Kconfig +++ b/board/amcc/luan/Kconfig @@ -1,15 +1,12 @@ if TARGET_LUAN config SYS_BOARD - string default "luan" config SYS_VENDOR - string default "amcc" config SYS_CONFIG_NAME - string default "luan" endif diff --git a/board/amcc/makalu/Kconfig b/board/amcc/makalu/Kconfig index 7f95bdcbe1..31ce5f10c6 100644 --- a/board/amcc/makalu/Kconfig +++ b/board/amcc/makalu/Kconfig @@ -1,15 +1,12 @@ if TARGET_MAKALU config SYS_BOARD - string default "makalu" config SYS_VENDOR - string default "amcc" config SYS_CONFIG_NAME - string default "makalu" endif diff --git a/board/amcc/ocotea/Kconfig b/board/amcc/ocotea/Kconfig index 5eaf812557..18c1a15ef4 100644 --- a/board/amcc/ocotea/Kconfig +++ b/board/amcc/ocotea/Kconfig @@ -1,15 +1,12 @@ if TARGET_OCOTEA config SYS_BOARD - string default "ocotea" config SYS_VENDOR - string default "amcc" config SYS_CONFIG_NAME - string default "ocotea" endif diff --git a/board/amcc/redwood/Kconfig b/board/amcc/redwood/Kconfig index 001d40088d..d710590998 100644 --- a/board/amcc/redwood/Kconfig +++ b/board/amcc/redwood/Kconfig @@ -1,15 +1,12 @@ if TARGET_REDWOOD config SYS_BOARD - string default "redwood" config SYS_VENDOR - string default "amcc" config SYS_CONFIG_NAME - string default "redwood" endif diff --git a/board/amcc/sequoia/Kconfig b/board/amcc/sequoia/Kconfig index ddcaced7ae..67ee3ca2eb 100644 --- a/board/amcc/sequoia/Kconfig +++ b/board/amcc/sequoia/Kconfig @@ -1,15 +1,12 @@ if TARGET_SEQUOIA config SYS_BOARD - string default "sequoia" config SYS_VENDOR - string default "amcc" config SYS_CONFIG_NAME - string default "sequoia" endif diff --git a/board/amcc/taihu/Kconfig b/board/amcc/taihu/Kconfig index 8411a82861..fc5cb1de7e 100644 --- a/board/amcc/taihu/Kconfig +++ b/board/amcc/taihu/Kconfig @@ -1,15 +1,12 @@ if TARGET_TAIHU config SYS_BOARD - string default "taihu" config SYS_VENDOR - string default "amcc" config SYS_CONFIG_NAME - string default "taihu" endif diff --git a/board/amcc/taishan/Kconfig b/board/amcc/taishan/Kconfig index 0022063dc7..abd07f570d 100644 --- a/board/amcc/taishan/Kconfig +++ b/board/amcc/taishan/Kconfig @@ -1,15 +1,12 @@ if TARGET_TAISHAN config SYS_BOARD - string default "taishan" config SYS_VENDOR - string default "amcc" config SYS_CONFIG_NAME - string default "taishan" endif diff --git a/board/amcc/walnut/Kconfig b/board/amcc/walnut/Kconfig index f98cec5bc9..94e3dc9e78 100644 --- a/board/amcc/walnut/Kconfig +++ b/board/amcc/walnut/Kconfig @@ -1,15 +1,12 @@ if TARGET_WALNUT config SYS_BOARD - string default "walnut" config SYS_VENDOR - string default "amcc" config SYS_CONFIG_NAME - string default "walnut" endif diff --git a/board/amcc/yosemite/Kconfig b/board/amcc/yosemite/Kconfig index 8aa62c0129..dfa10687c2 100644 --- a/board/amcc/yosemite/Kconfig +++ b/board/amcc/yosemite/Kconfig @@ -1,15 +1,12 @@ if TARGET_YOSEMITE config SYS_BOARD - string default "yosemite" config SYS_VENDOR - string default "amcc" config SYS_CONFIG_NAME - string default "yosemite" endif diff --git a/board/amcc/yucca/Kconfig b/board/amcc/yucca/Kconfig index 945333f157..61d95891e4 100644 --- a/board/amcc/yucca/Kconfig +++ b/board/amcc/yucca/Kconfig @@ -1,15 +1,12 @@ if TARGET_YUCCA config SYS_BOARD - string default "yucca" config SYS_VENDOR - string default "amcc" config SYS_CONFIG_NAME - string default "yucca" endif diff --git a/board/aristainetos/Kconfig b/board/aristainetos/Kconfig index 58078eacf5..ac35d6de6f 100644 --- a/board/aristainetos/Kconfig +++ b/board/aristainetos/Kconfig @@ -1,19 +1,15 @@ if TARGET_ARISTAINETOS config SYS_CPU - string default "armv7" config SYS_BOARD - string default "aristainetos" config SYS_SOC - string default "mx6" config SYS_CONFIG_NAME - string default "aristainetos" endif diff --git a/board/armadeus/apf27/Kconfig b/board/armadeus/apf27/Kconfig index f2d33c6378..53532bba58 100644 --- a/board/armadeus/apf27/Kconfig +++ b/board/armadeus/apf27/Kconfig @@ -1,23 +1,18 @@ if TARGET_APF27 config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "apf27" config SYS_VENDOR - string default "armadeus" config SYS_SOC - string default "mx27" config SYS_CONFIG_NAME - string default "apf27" endif diff --git a/board/armltd/integrator/Kconfig b/board/armltd/integrator/Kconfig index c1ac6b1872..49553131b9 100644 --- a/board/armltd/integrator/Kconfig +++ b/board/armltd/integrator/Kconfig @@ -1,19 +1,15 @@ if TARGET_INTEGRATORAP_CM720T config SYS_CPU - string default "arm720t" config SYS_BOARD - string default "integrator" config SYS_VENDOR - string default "armltd" config SYS_CONFIG_NAME - string default "integratorap" endif @@ -21,19 +17,15 @@ endif if TARGET_INTEGRATORAP_CM920T config SYS_CPU - string default "arm920t" config SYS_BOARD - string default "integrator" config SYS_VENDOR - string default "armltd" config SYS_CONFIG_NAME - string default "integratorap" endif @@ -41,19 +33,15 @@ endif if TARGET_INTEGRATORCP_CM920T config SYS_CPU - string default "arm920t" config SYS_BOARD - string default "integrator" config SYS_VENDOR - string default "armltd" config SYS_CONFIG_NAME - string default "integratorcp" endif @@ -61,19 +49,15 @@ endif if TARGET_INTEGRATORAP_CM926EJS config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "integrator" config SYS_VENDOR - string default "armltd" config SYS_CONFIG_NAME - string default "integratorap" endif @@ -81,19 +65,15 @@ endif if TARGET_INTEGRATORCP_CM926EJS config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "integrator" config SYS_VENDOR - string default "armltd" config SYS_CONFIG_NAME - string default "integratorcp" endif @@ -101,19 +81,15 @@ endif if TARGET_INTEGRATORCP_CM1136 config SYS_CPU - string default "arm1136" config SYS_BOARD - string default "integrator" config SYS_VENDOR - string default "armltd" config SYS_CONFIG_NAME - string default "integratorcp" endif @@ -121,19 +97,15 @@ endif if TARGET_INTEGRATORAP_CM946ES config SYS_CPU - string default "arm946es" config SYS_BOARD - string default "integrator" config SYS_VENDOR - string default "armltd" config SYS_CONFIG_NAME - string default "integratorap" endif @@ -141,19 +113,15 @@ endif if TARGET_INTEGRATORCP_CM946ES config SYS_CPU - string default "arm946es" config SYS_BOARD - string default "integrator" config SYS_VENDOR - string default "armltd" config SYS_CONFIG_NAME - string default "integratorcp" endif diff --git a/board/armltd/vexpress/Kconfig b/board/armltd/vexpress/Kconfig index e49e87133a..7fa30c65f9 100644 --- a/board/armltd/vexpress/Kconfig +++ b/board/armltd/vexpress/Kconfig @@ -1,19 +1,15 @@ if TARGET_VEXPRESS_CA15_TC2 config SYS_CPU - string default "armv7" config SYS_BOARD - string default "vexpress" config SYS_VENDOR - string default "armltd" config SYS_CONFIG_NAME - string default "vexpress_ca15_tc2" endif @@ -21,19 +17,15 @@ endif if TARGET_VEXPRESS_CA5X2 config SYS_CPU - string default "armv7" config SYS_BOARD - string default "vexpress" config SYS_VENDOR - string default "armltd" config SYS_CONFIG_NAME - string default "vexpress_ca5x2" endif @@ -41,19 +33,15 @@ endif if TARGET_VEXPRESS_CA9X4 config SYS_CPU - string default "armv7" config SYS_BOARD - string default "vexpress" config SYS_VENDOR - string default "armltd" config SYS_CONFIG_NAME - string default "vexpress_ca9x4" endif diff --git a/board/armltd/vexpress64/Kconfig b/board/armltd/vexpress64/Kconfig index 91eb8d2997..7ebea6317f 100644 --- a/board/armltd/vexpress64/Kconfig +++ b/board/armltd/vexpress64/Kconfig @@ -1,39 +1,12 @@ if TARGET_VEXPRESS_AEMV8A -config SYS_CPU - string - default "armv8" - -config SYS_BOARD - string - default "vexpress64" - -config SYS_VENDOR - string - default "armltd" - -config SYS_CONFIG_NAME - string - default "vexpress_aemv8a" - -endif - -if TARGET_VEXPRESS_AEMV8A_SEMI - -config SYS_CPU - string - default "armv8" - config SYS_BOARD - string default "vexpress64" config SYS_VENDOR - string default "armltd" config SYS_CONFIG_NAME - string default "vexpress_aemv8a" endif diff --git a/board/astro/mcf5373l/Kconfig b/board/astro/mcf5373l/Kconfig index 6e947dce0a..a7c04cef83 100644 --- a/board/astro/mcf5373l/Kconfig +++ b/board/astro/mcf5373l/Kconfig @@ -1,19 +1,15 @@ if TARGET_ASTRO_MCF5373L config SYS_CPU - string default "mcf532x" config SYS_BOARD - string default "mcf5373l" config SYS_VENDOR - string default "astro" config SYS_CONFIG_NAME - string default "astro_mcf5373l" endif diff --git a/board/atc/Kconfig b/board/atc/Kconfig index 826753f043..9b336caafd 100644 --- a/board/atc/Kconfig +++ b/board/atc/Kconfig @@ -1,11 +1,9 @@ if TARGET_ATC config SYS_BOARD - string default "atc" config SYS_CONFIG_NAME - string default "atc" endif diff --git a/board/atmark-techno/armadillo-800eva/Kconfig b/board/atmark-techno/armadillo-800eva/Kconfig index 3365c7b61f..cd37dd4861 100644 --- a/board/atmark-techno/armadillo-800eva/Kconfig +++ b/board/atmark-techno/armadillo-800eva/Kconfig @@ -1,15 +1,12 @@ if TARGET_ARMADILLO_800EVA config SYS_BOARD - string default "armadillo-800eva" config SYS_VENDOR - string default "atmark-techno" config SYS_CONFIG_NAME - string default "armadillo-800eva" endif diff --git a/board/atmel/at91rm9200ek/Kconfig b/board/atmel/at91rm9200ek/Kconfig index d7ee4f49fd..61db2e2d40 100644 --- a/board/atmel/at91rm9200ek/Kconfig +++ b/board/atmel/at91rm9200ek/Kconfig @@ -1,23 +1,18 @@ if TARGET_AT91RM9200EK config SYS_CPU - string default "arm920t" config SYS_BOARD - string default "at91rm9200ek" config SYS_VENDOR - string default "atmel" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "at91rm9200ek" endif diff --git a/board/atmel/at91sam9260ek/Kconfig b/board/atmel/at91sam9260ek/Kconfig index 14af5bcd40..24a645bc94 100644 --- a/board/atmel/at91sam9260ek/Kconfig +++ b/board/atmel/at91sam9260ek/Kconfig @@ -1,23 +1,18 @@ if TARGET_AT91SAM9260EK config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "at91sam9260ek" config SYS_VENDOR - string default "atmel" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "at91sam9260ek" endif diff --git a/board/atmel/at91sam9261ek/Kconfig b/board/atmel/at91sam9261ek/Kconfig index 63dcdd8da0..301bf1a61c 100644 --- a/board/atmel/at91sam9261ek/Kconfig +++ b/board/atmel/at91sam9261ek/Kconfig @@ -1,23 +1,18 @@ if TARGET_AT91SAM9261EK config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "at91sam9261ek" config SYS_VENDOR - string default "atmel" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "at91sam9261ek" endif diff --git a/board/atmel/at91sam9263ek/Kconfig b/board/atmel/at91sam9263ek/Kconfig index fa0a58acb5..f8e2b48149 100644 --- a/board/atmel/at91sam9263ek/Kconfig +++ b/board/atmel/at91sam9263ek/Kconfig @@ -1,23 +1,18 @@ if TARGET_AT91SAM9263EK config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "at91sam9263ek" config SYS_VENDOR - string default "atmel" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "at91sam9263ek" endif diff --git a/board/atmel/at91sam9m10g45ek/Kconfig b/board/atmel/at91sam9m10g45ek/Kconfig index 8567f95753..d2e191c141 100644 --- a/board/atmel/at91sam9m10g45ek/Kconfig +++ b/board/atmel/at91sam9m10g45ek/Kconfig @@ -1,23 +1,18 @@ if TARGET_AT91SAM9M10G45EK config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "at91sam9m10g45ek" config SYS_VENDOR - string default "atmel" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "at91sam9m10g45ek" endif diff --git a/board/atmel/at91sam9n12ek/Kconfig b/board/atmel/at91sam9n12ek/Kconfig index 4fc714b1b2..845cd36442 100644 --- a/board/atmel/at91sam9n12ek/Kconfig +++ b/board/atmel/at91sam9n12ek/Kconfig @@ -1,23 +1,18 @@ if TARGET_AT91SAM9N12EK config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "at91sam9n12ek" config SYS_VENDOR - string default "atmel" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "at91sam9n12ek" endif diff --git a/board/atmel/at91sam9rlek/Kconfig b/board/atmel/at91sam9rlek/Kconfig index 178f80dc04..517f22a8a9 100644 --- a/board/atmel/at91sam9rlek/Kconfig +++ b/board/atmel/at91sam9rlek/Kconfig @@ -1,23 +1,18 @@ if TARGET_AT91SAM9RLEK config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "at91sam9rlek" config SYS_VENDOR - string default "atmel" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "at91sam9rlek" endif diff --git a/board/atmel/at91sam9x5ek/Kconfig b/board/atmel/at91sam9x5ek/Kconfig index 0a0b132138..d236b1ad66 100644 --- a/board/atmel/at91sam9x5ek/Kconfig +++ b/board/atmel/at91sam9x5ek/Kconfig @@ -1,23 +1,18 @@ if TARGET_AT91SAM9X5EK config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "at91sam9x5ek" config SYS_VENDOR - string default "atmel" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "at91sam9x5ek" endif diff --git a/board/atmel/atngw100/Kconfig b/board/atmel/atngw100/Kconfig index a966b31830..28037b67b4 100644 --- a/board/atmel/atngw100/Kconfig +++ b/board/atmel/atngw100/Kconfig @@ -1,19 +1,15 @@ if TARGET_ATNGW100 config SYS_BOARD - string default "atngw100" config SYS_VENDOR - string default "atmel" config SYS_SOC - string default "at32ap700x" config SYS_CONFIG_NAME - string default "atngw100" endif diff --git a/board/atmel/atngw100mkii/Kconfig b/board/atmel/atngw100mkii/Kconfig index dcea07ec02..ca04269080 100644 --- a/board/atmel/atngw100mkii/Kconfig +++ b/board/atmel/atngw100mkii/Kconfig @@ -1,19 +1,15 @@ if TARGET_ATNGW100MKII config SYS_BOARD - string default "atngw100mkii" config SYS_VENDOR - string default "atmel" config SYS_SOC - string default "at32ap700x" config SYS_CONFIG_NAME - string default "atngw100mkii" endif diff --git a/board/atmel/atstk1000/Kconfig b/board/atmel/atstk1000/Kconfig index 1a24409c6e..6d4151453f 100644 --- a/board/atmel/atstk1000/Kconfig +++ b/board/atmel/atstk1000/Kconfig @@ -1,19 +1,15 @@ if TARGET_ATSTK1002 config SYS_BOARD - string default "atstk1000" config SYS_VENDOR - string default "atmel" config SYS_SOC - string default "at32ap700x" config SYS_CONFIG_NAME - string default "atstk1002" endif @@ -21,19 +17,15 @@ endif if TARGET_ATSTK1003 config SYS_BOARD - string default "atstk1000" config SYS_VENDOR - string default "atmel" config SYS_SOC - string default "at32ap700x" config SYS_CONFIG_NAME - string default "atstk1003" endif @@ -41,19 +33,15 @@ endif if TARGET_ATSTK1004 config SYS_BOARD - string default "atstk1000" config SYS_VENDOR - string default "atmel" config SYS_SOC - string default "at32ap700x" config SYS_CONFIG_NAME - string default "atstk1004" endif @@ -61,19 +49,15 @@ endif if TARGET_ATSTK1006 config SYS_BOARD - string default "atstk1000" config SYS_VENDOR - string default "atmel" config SYS_SOC - string default "at32ap700x" config SYS_CONFIG_NAME - string default "atstk1006" endif diff --git a/board/atmel/sama5d3_xplained/Kconfig b/board/atmel/sama5d3_xplained/Kconfig index 603b2411ba..0ca1ec006a 100644 --- a/board/atmel/sama5d3_xplained/Kconfig +++ b/board/atmel/sama5d3_xplained/Kconfig @@ -1,23 +1,18 @@ if TARGET_SAMA5D3_XPLAINED config SYS_CPU - string default "armv7" config SYS_BOARD - string default "sama5d3_xplained" config SYS_VENDOR - string default "atmel" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "sama5d3_xplained" endif diff --git a/board/atmel/sama5d3xek/Kconfig b/board/atmel/sama5d3xek/Kconfig index 5b4eb6f25d..f0dd04a06e 100644 --- a/board/atmel/sama5d3xek/Kconfig +++ b/board/atmel/sama5d3xek/Kconfig @@ -1,23 +1,18 @@ if TARGET_SAMA5D3XEK config SYS_CPU - string default "armv7" config SYS_BOARD - string default "sama5d3xek" config SYS_VENDOR - string default "atmel" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "sama5d3xek" endif diff --git a/board/atmel/sama5d3xek/sama5d3xek.c b/board/atmel/sama5d3xek/sama5d3xek.c index c835c12d02..f53754bc87 100644 --- a/board/atmel/sama5d3xek/sama5d3xek.c +++ b/board/atmel/sama5d3xek/sama5d3xek.c @@ -67,6 +67,61 @@ void sama5d3xek_nand_hw_init(void) } #endif +#ifndef CONFIG_SYS_NO_FLASH +static void sama5d3xek_nor_hw_init(void) +{ + struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC; + + at91_periph_clk_enable(ATMEL_ID_SMC); + + /* Configure SMC CS0 for NOR flash */ + writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(0) | + AT91_SMC_SETUP_NRD(2) | AT91_SMC_SETUP_NCS_RD(0), + &smc->cs[0].setup); + writel(AT91_SMC_PULSE_NWE(10) | AT91_SMC_PULSE_NCS_WR(11) | + AT91_SMC_PULSE_NRD(10) | AT91_SMC_PULSE_NCS_RD(11), + &smc->cs[0].pulse); + writel(AT91_SMC_CYCLE_NWE(11) | AT91_SMC_CYCLE_NRD(14), + &smc->cs[0].cycle); + writel(AT91_SMC_TIMINGS_TCLR(0) | AT91_SMC_TIMINGS_TADL(0) | + AT91_SMC_TIMINGS_TAR(0) | AT91_SMC_TIMINGS_TRR(0) | + AT91_SMC_TIMINGS_TWB(0) | AT91_SMC_TIMINGS_RBNSEL(0)| + AT91_SMC_TIMINGS_NFSEL(0), &smc->cs[0].timings); + writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE | + AT91_SMC_MODE_EXNW_DISABLE | + AT91_SMC_MODE_DBW_16 | + AT91_SMC_MODE_TDF_CYCLE(1), + &smc->cs[0].mode); + + /* Address pin (A1 ~ A23) configuration */ + at91_set_a_periph(AT91_PIO_PORTE, 1, 0); + at91_set_a_periph(AT91_PIO_PORTE, 2, 0); + at91_set_a_periph(AT91_PIO_PORTE, 3, 0); + at91_set_a_periph(AT91_PIO_PORTE, 4, 0); + at91_set_a_periph(AT91_PIO_PORTE, 5, 0); + at91_set_a_periph(AT91_PIO_PORTE, 6, 0); + at91_set_a_periph(AT91_PIO_PORTE, 7, 0); + at91_set_a_periph(AT91_PIO_PORTE, 8, 0); + at91_set_a_periph(AT91_PIO_PORTE, 9, 0); + at91_set_a_periph(AT91_PIO_PORTE, 10, 0); + at91_set_a_periph(AT91_PIO_PORTE, 11, 0); + at91_set_a_periph(AT91_PIO_PORTE, 12, 0); + at91_set_a_periph(AT91_PIO_PORTE, 13, 0); + at91_set_a_periph(AT91_PIO_PORTE, 14, 0); + at91_set_a_periph(AT91_PIO_PORTE, 15, 0); + at91_set_a_periph(AT91_PIO_PORTE, 16, 0); + at91_set_a_periph(AT91_PIO_PORTE, 17, 0); + at91_set_a_periph(AT91_PIO_PORTE, 18, 0); + at91_set_a_periph(AT91_PIO_PORTE, 19, 0); + at91_set_a_periph(AT91_PIO_PORTE, 20, 0); + at91_set_a_periph(AT91_PIO_PORTE, 21, 0); + at91_set_a_periph(AT91_PIO_PORTE, 22, 0); + at91_set_a_periph(AT91_PIO_PORTE, 23, 0); + /* CS0 pin configuration */ + at91_set_a_periph(AT91_PIO_PORTE, 26, 0); +} +#endif + #ifdef CONFIG_CMD_USB static void sama5d3xek_usb_hw_init(void) { @@ -181,6 +236,9 @@ int board_init(void) #ifdef CONFIG_NAND_ATMEL sama5d3xek_nand_hw_init(); #endif +#ifndef CONFIG_SYS_NO_FLASH + sama5d3xek_nor_hw_init(); +#endif #ifdef CONFIG_CMD_USB sama5d3xek_usb_hw_init(); #endif diff --git a/board/avionic-design/medcom-wide/Kconfig b/board/avionic-design/medcom-wide/Kconfig index 16001e4b07..267647cb41 100644 --- a/board/avionic-design/medcom-wide/Kconfig +++ b/board/avionic-design/medcom-wide/Kconfig @@ -1,15 +1,12 @@ if TARGET_MEDCOM_WIDE config SYS_BOARD - string default "medcom-wide" config SYS_VENDOR - string default "avionic-design" config SYS_CONFIG_NAME - string default "medcom-wide" endif diff --git a/board/avionic-design/plutux/Kconfig b/board/avionic-design/plutux/Kconfig index c9a90247a2..09a3ac940d 100644 --- a/board/avionic-design/plutux/Kconfig +++ b/board/avionic-design/plutux/Kconfig @@ -1,15 +1,12 @@ if TARGET_PLUTUX config SYS_BOARD - string default "plutux" config SYS_VENDOR - string default "avionic-design" config SYS_CONFIG_NAME - string default "plutux" endif diff --git a/board/avionic-design/tec-ng/Kconfig b/board/avionic-design/tec-ng/Kconfig index e6b69e8430..36a0cec1be 100644 --- a/board/avionic-design/tec-ng/Kconfig +++ b/board/avionic-design/tec-ng/Kconfig @@ -1,15 +1,12 @@ if TARGET_TEC_NG config SYS_BOARD - string default "tec-ng" config SYS_VENDOR - string default "avionic-design" config SYS_CONFIG_NAME - string default "tec-ng" endif diff --git a/board/avionic-design/tec/Kconfig b/board/avionic-design/tec/Kconfig index fbf7f46976..bc9751b108 100644 --- a/board/avionic-design/tec/Kconfig +++ b/board/avionic-design/tec/Kconfig @@ -1,15 +1,12 @@ if TARGET_TEC config SYS_BOARD - string default "tec" config SYS_VENDOR - string default "avionic-design" config SYS_CONFIG_NAME - string default "tec" endif diff --git a/board/avnet/fx12mm/Kconfig b/board/avnet/fx12mm/Kconfig index 7b1687ee43..0b67ebde93 100644 --- a/board/avnet/fx12mm/Kconfig +++ b/board/avnet/fx12mm/Kconfig @@ -1,15 +1,12 @@ if TARGET_FX12MM config SYS_BOARD - string default "fx12mm" config SYS_VENDOR - string default "avnet" config SYS_CONFIG_NAME - string default "fx12mm" endif diff --git a/board/avnet/v5fx30teval/Kconfig b/board/avnet/v5fx30teval/Kconfig index 8ae22e93a0..079387b707 100644 --- a/board/avnet/v5fx30teval/Kconfig +++ b/board/avnet/v5fx30teval/Kconfig @@ -1,15 +1,12 @@ if TARGET_V5FX30TEVAL config SYS_BOARD - string default "v5fx30teval" config SYS_VENDOR - string default "avnet" config SYS_CONFIG_NAME - string default "v5fx30teval" endif diff --git a/board/balloon3/Kconfig b/board/balloon3/Kconfig index aee21933d5..fb1cf3f0ef 100644 --- a/board/balloon3/Kconfig +++ b/board/balloon3/Kconfig @@ -1,15 +1,12 @@ if TARGET_BALLOON3 config SYS_CPU - string default "pxa" config SYS_BOARD - string default "balloon3" config SYS_CONFIG_NAME - string default "balloon3" endif diff --git a/board/barco/titanium/Kconfig b/board/barco/titanium/Kconfig index a2ddd87f84..56ed7d670b 100644 --- a/board/barco/titanium/Kconfig +++ b/board/barco/titanium/Kconfig @@ -1,23 +1,18 @@ if TARGET_TITANIUM config SYS_CPU - string default "armv7" config SYS_BOARD - string default "titanium" config SYS_VENDOR - string default "barco" config SYS_SOC - string default "mx6" config SYS_CONFIG_NAME - string default "titanium" endif diff --git a/board/bc3450/Kconfig b/board/bc3450/Kconfig index ba058db089..a0fc19f63c 100644 --- a/board/bc3450/Kconfig +++ b/board/bc3450/Kconfig @@ -1,11 +1,9 @@ if TARGET_BC3450 config SYS_BOARD - string default "bc3450" config SYS_CONFIG_NAME - string default "BC3450" endif diff --git a/board/bct-brettl2/Kconfig b/board/bct-brettl2/Kconfig index c3e3837c36..9c5407e7b2 100644 --- a/board/bct-brettl2/Kconfig +++ b/board/bct-brettl2/Kconfig @@ -1,11 +1,9 @@ if TARGET_BCT_BRETTL2 config SYS_BOARD - string default "bct-brettl2" config SYS_CONFIG_NAME - string default "bct-brettl2" endif diff --git a/board/bf506f-ezkit/Kconfig b/board/bf506f-ezkit/Kconfig index 749ad2bf76..e6fc12ccb2 100644 --- a/board/bf506f-ezkit/Kconfig +++ b/board/bf506f-ezkit/Kconfig @@ -1,11 +1,9 @@ if TARGET_BF506F_EZKIT config SYS_BOARD - string default "bf506f-ezkit" config SYS_CONFIG_NAME - string default "bf506f-ezkit" endif diff --git a/board/bf518f-ezbrd/Kconfig b/board/bf518f-ezbrd/Kconfig index 5656d1c288..a0e80a8bde 100644 --- a/board/bf518f-ezbrd/Kconfig +++ b/board/bf518f-ezbrd/Kconfig @@ -1,11 +1,9 @@ if TARGET_BF518F_EZBRD config SYS_BOARD - string default "bf518f-ezbrd" config SYS_CONFIG_NAME - string default "bf518f-ezbrd" endif diff --git a/board/bf525-ucr2/Kconfig b/board/bf525-ucr2/Kconfig index 5967d04597..cd52daaacd 100644 --- a/board/bf525-ucr2/Kconfig +++ b/board/bf525-ucr2/Kconfig @@ -1,11 +1,9 @@ if TARGET_BF525_UCR2 config SYS_BOARD - string default "bf525-ucr2" config SYS_CONFIG_NAME - string default "bf525-ucr2" endif diff --git a/board/bf526-ezbrd/Kconfig b/board/bf526-ezbrd/Kconfig index 6793c0e319..e138ea5545 100644 --- a/board/bf526-ezbrd/Kconfig +++ b/board/bf526-ezbrd/Kconfig @@ -1,11 +1,9 @@ if TARGET_BF526_EZBRD config SYS_BOARD - string default "bf526-ezbrd" config SYS_CONFIG_NAME - string default "bf526-ezbrd" endif diff --git a/board/bf527-ad7160-eval/Kconfig b/board/bf527-ad7160-eval/Kconfig index 6febd7f94a..fe56241212 100644 --- a/board/bf527-ad7160-eval/Kconfig +++ b/board/bf527-ad7160-eval/Kconfig @@ -1,11 +1,9 @@ if TARGET_BF527_AD7160_EVAL config SYS_BOARD - string default "bf527-ad7160-eval" config SYS_CONFIG_NAME - string default "bf527-ad7160-eval" endif diff --git a/board/bf527-ezkit/Kconfig b/board/bf527-ezkit/Kconfig index 459d9710dc..df49d7a60d 100644 --- a/board/bf527-ezkit/Kconfig +++ b/board/bf527-ezkit/Kconfig @@ -1,11 +1,9 @@ if TARGET_BF527_EZKIT config SYS_BOARD - string default "bf527-ezkit" config SYS_CONFIG_NAME - string default "bf527-ezkit" endif diff --git a/board/bf527-sdp/Kconfig b/board/bf527-sdp/Kconfig index 8d54fb8732..928bd776b9 100644 --- a/board/bf527-sdp/Kconfig +++ b/board/bf527-sdp/Kconfig @@ -1,11 +1,9 @@ if TARGET_BF527_SDP config SYS_BOARD - string default "bf527-sdp" config SYS_CONFIG_NAME - string default "bf527-sdp" endif diff --git a/board/bf533-ezkit/Kconfig b/board/bf533-ezkit/Kconfig index c0317c2eb5..555ab298f2 100644 --- a/board/bf533-ezkit/Kconfig +++ b/board/bf533-ezkit/Kconfig @@ -1,11 +1,9 @@ if TARGET_BF533_EZKIT config SYS_BOARD - string default "bf533-ezkit" config SYS_CONFIG_NAME - string default "bf533-ezkit" endif diff --git a/board/bf533-stamp/Kconfig b/board/bf533-stamp/Kconfig index 3f01c2b944..0cffde3b47 100644 --- a/board/bf533-stamp/Kconfig +++ b/board/bf533-stamp/Kconfig @@ -1,11 +1,9 @@ if TARGET_BF533_STAMP config SYS_BOARD - string default "bf533-stamp" config SYS_CONFIG_NAME - string default "bf533-stamp" endif diff --git a/board/bf537-minotaur/Kconfig b/board/bf537-minotaur/Kconfig index 6704f2d481..204f609e09 100644 --- a/board/bf537-minotaur/Kconfig +++ b/board/bf537-minotaur/Kconfig @@ -1,11 +1,9 @@ if TARGET_BF537_MINOTAUR config SYS_BOARD - string default "bf537-minotaur" config SYS_CONFIG_NAME - string default "bf537-minotaur" endif diff --git a/board/bf537-pnav/Kconfig b/board/bf537-pnav/Kconfig index 125a9fa344..acb1f89233 100644 --- a/board/bf537-pnav/Kconfig +++ b/board/bf537-pnav/Kconfig @@ -1,11 +1,9 @@ if TARGET_BF537_PNAV config SYS_BOARD - string default "bf537-pnav" config SYS_CONFIG_NAME - string default "bf537-pnav" endif diff --git a/board/bf537-srv1/Kconfig b/board/bf537-srv1/Kconfig index 658a6e5588..2ddcd69482 100644 --- a/board/bf537-srv1/Kconfig +++ b/board/bf537-srv1/Kconfig @@ -1,11 +1,9 @@ if TARGET_BF537_SRV1 config SYS_BOARD - string default "bf537-srv1" config SYS_CONFIG_NAME - string default "bf537-srv1" endif diff --git a/board/bf537-stamp/Kconfig b/board/bf537-stamp/Kconfig index 9330a4c68f..4f86128e9c 100644 --- a/board/bf537-stamp/Kconfig +++ b/board/bf537-stamp/Kconfig @@ -1,11 +1,9 @@ if TARGET_BF537_STAMP config SYS_BOARD - string default "bf537-stamp" config SYS_CONFIG_NAME - string default "bf537-stamp" endif diff --git a/board/bf538f-ezkit/Kconfig b/board/bf538f-ezkit/Kconfig index 5b9c8d9e2c..e40fcdb2a2 100644 --- a/board/bf538f-ezkit/Kconfig +++ b/board/bf538f-ezkit/Kconfig @@ -1,11 +1,9 @@ if TARGET_BF538F_EZKIT config SYS_BOARD - string default "bf538f-ezkit" config SYS_CONFIG_NAME - string default "bf538f-ezkit" endif diff --git a/board/bf548-ezkit/Kconfig b/board/bf548-ezkit/Kconfig index 8d799aae45..550227fa30 100644 --- a/board/bf548-ezkit/Kconfig +++ b/board/bf548-ezkit/Kconfig @@ -1,11 +1,9 @@ if TARGET_BF548_EZKIT config SYS_BOARD - string default "bf548-ezkit" config SYS_CONFIG_NAME - string default "bf548-ezkit" endif diff --git a/board/bf561-acvilon/Kconfig b/board/bf561-acvilon/Kconfig index 6c1789c22e..ba1580d87b 100644 --- a/board/bf561-acvilon/Kconfig +++ b/board/bf561-acvilon/Kconfig @@ -1,11 +1,9 @@ if TARGET_BF561_ACVILON config SYS_BOARD - string default "bf561-acvilon" config SYS_CONFIG_NAME - string default "bf561-acvilon" endif diff --git a/board/bf561-ezkit/Kconfig b/board/bf561-ezkit/Kconfig index d1cb81f567..495a5c51eb 100644 --- a/board/bf561-ezkit/Kconfig +++ b/board/bf561-ezkit/Kconfig @@ -1,11 +1,9 @@ if TARGET_BF561_EZKIT config SYS_BOARD - string default "bf561-ezkit" config SYS_CONFIG_NAME - string default "bf561-ezkit" endif diff --git a/board/bf609-ezkit/Kconfig b/board/bf609-ezkit/Kconfig index ad959d7022..7992e1ec86 100644 --- a/board/bf609-ezkit/Kconfig +++ b/board/bf609-ezkit/Kconfig @@ -1,11 +1,9 @@ if TARGET_BF609_EZKIT config SYS_BOARD - string default "bf609-ezkit" config SYS_CONFIG_NAME - string default "bf609-ezkit" endif diff --git a/board/blackstamp/Kconfig b/board/blackstamp/Kconfig index 0046b9372e..7ce086a78f 100644 --- a/board/blackstamp/Kconfig +++ b/board/blackstamp/Kconfig @@ -1,11 +1,9 @@ if TARGET_BLACKSTAMP config SYS_BOARD - string default "blackstamp" config SYS_CONFIG_NAME - string default "blackstamp" endif diff --git a/board/blackvme/Kconfig b/board/blackvme/Kconfig index 72aaa29ead..5e73f84eff 100644 --- a/board/blackvme/Kconfig +++ b/board/blackvme/Kconfig @@ -1,11 +1,9 @@ if TARGET_BLACKVME config SYS_BOARD - string default "blackvme" config SYS_CONFIG_NAME - string default "blackvme" endif diff --git a/board/bluegiga/apx4devkit/Kconfig b/board/bluegiga/apx4devkit/Kconfig index acccec911a..7d1534a647 100644 --- a/board/bluegiga/apx4devkit/Kconfig +++ b/board/bluegiga/apx4devkit/Kconfig @@ -1,23 +1,18 @@ if TARGET_APX4DEVKIT config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "apx4devkit" config SYS_VENDOR - string default "bluegiga" config SYS_SOC - string default "mxs" config SYS_CONFIG_NAME - string default "apx4devkit" endif diff --git a/board/bluewater/snapper9260/Kconfig b/board/bluewater/snapper9260/Kconfig index 81eb911eda..1c8f78dee2 100644 --- a/board/bluewater/snapper9260/Kconfig +++ b/board/bluewater/snapper9260/Kconfig @@ -1,23 +1,18 @@ if TARGET_SNAPPER9260 config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "snapper9260" config SYS_VENDOR - string default "bluewater" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "snapper9260" endif diff --git a/board/boundary/nitrogen6x/Kconfig b/board/boundary/nitrogen6x/Kconfig index 190809c239..298c9fdb8c 100644 --- a/board/boundary/nitrogen6x/Kconfig +++ b/board/boundary/nitrogen6x/Kconfig @@ -1,23 +1,18 @@ if TARGET_NITROGEN6X config SYS_CPU - string default "armv7" config SYS_BOARD - string default "nitrogen6x" config SYS_VENDOR - string default "boundary" config SYS_SOC - string default "mx6" config SYS_CONFIG_NAME - string default "nitrogen6x" endif diff --git a/board/br4/Kconfig b/board/br4/Kconfig index 03d9783739..a10a06053a 100644 --- a/board/br4/Kconfig +++ b/board/br4/Kconfig @@ -1,11 +1,9 @@ if TARGET_BR4 config SYS_BOARD - string default "br4" config SYS_CONFIG_NAME - string default "br4" endif diff --git a/board/broadcom/bcm28155_ap/Kconfig b/board/broadcom/bcm28155_ap/Kconfig index 20c83d3622..2e779f0174 100644 --- a/board/broadcom/bcm28155_ap/Kconfig +++ b/board/broadcom/bcm28155_ap/Kconfig @@ -1,23 +1,18 @@ if TARGET_BCM28155_AP config SYS_CPU - string default "armv7" config SYS_BOARD - string default "bcm28155_ap" config SYS_VENDOR - string default "broadcom" config SYS_SOC - string default "bcm281xx" config SYS_CONFIG_NAME - string default "bcm28155_ap" endif diff --git a/board/broadcom/bcm958300k/Kconfig b/board/broadcom/bcm958300k/Kconfig index 165cee71de..d627a3885f 100644 --- a/board/broadcom/bcm958300k/Kconfig +++ b/board/broadcom/bcm958300k/Kconfig @@ -1,23 +1,18 @@ if TARGET_BCM958300K config SYS_CPU - string default "armv7" config SYS_BOARD - string default "bcm_ep" config SYS_VENDOR - string default "broadcom" config SYS_SOC - string default "bcmcygnus" config SYS_CONFIG_NAME - string default "bcm_ep_board" endif diff --git a/board/broadcom/bcm958622hr/Kconfig b/board/broadcom/bcm958622hr/Kconfig index 6d0959221a..9038f5b0a3 100644 --- a/board/broadcom/bcm958622hr/Kconfig +++ b/board/broadcom/bcm958622hr/Kconfig @@ -1,23 +1,18 @@ if TARGET_BCM958622HR config SYS_CPU - string default "armv7" config SYS_BOARD - string default "bcm_ep" config SYS_VENDOR - string default "broadcom" config SYS_SOC - string default "bcmnsp" config SYS_CONFIG_NAME - string default "bcm_ep_board" endif diff --git a/board/buffalo/lsxl/Kconfig b/board/buffalo/lsxl/Kconfig index 50a620e821..ef78896378 100644 --- a/board/buffalo/lsxl/Kconfig +++ b/board/buffalo/lsxl/Kconfig @@ -1,15 +1,12 @@ if TARGET_LSXL config SYS_BOARD - string default "lsxl" config SYS_VENDOR - string default "buffalo" config SYS_CONFIG_NAME - string default "lsxl" endif diff --git a/board/calao/sbc35_a9g20/Kconfig b/board/calao/sbc35_a9g20/Kconfig index 192d22826c..b2528dcd26 100644 --- a/board/calao/sbc35_a9g20/Kconfig +++ b/board/calao/sbc35_a9g20/Kconfig @@ -1,23 +1,18 @@ if TARGET_SBC35_A9G20 config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "sbc35_a9g20" config SYS_VENDOR - string default "calao" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "sbc35_a9g20" endif diff --git a/board/calao/tny_a9260/Kconfig b/board/calao/tny_a9260/Kconfig index 3d33d5c409..7fad578d5c 100644 --- a/board/calao/tny_a9260/Kconfig +++ b/board/calao/tny_a9260/Kconfig @@ -1,23 +1,18 @@ if TARGET_TNY_A9260 config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "tny_a9260" config SYS_VENDOR - string default "calao" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "tny_a9260" endif diff --git a/board/calao/usb_a9263/Kconfig b/board/calao/usb_a9263/Kconfig index 8141c7d692..4209b36136 100644 --- a/board/calao/usb_a9263/Kconfig +++ b/board/calao/usb_a9263/Kconfig @@ -1,23 +1,18 @@ if TARGET_USB_A9263 config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "usb_a9263" config SYS_VENDOR - string default "calao" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "usb_a9263" endif diff --git a/board/canmb/Kconfig b/board/canmb/Kconfig index 042cc354a9..b5cf2057f4 100644 --- a/board/canmb/Kconfig +++ b/board/canmb/Kconfig @@ -1,11 +1,9 @@ if TARGET_CANMB config SYS_BOARD - string default "canmb" config SYS_CONFIG_NAME - string default "canmb" endif diff --git a/board/chromebook-x86/coreboot/Kconfig b/board/chromebook-x86/coreboot/Kconfig index 64cd347f31..83385c7207 100644 --- a/board/chromebook-x86/coreboot/Kconfig +++ b/board/chromebook-x86/coreboot/Kconfig @@ -1,19 +1,15 @@ if TARGET_COREBOOT config SYS_BOARD - string default "coreboot" config SYS_VENDOR - string default "chromebook-x86" config SYS_SOC - string default "coreboot" config SYS_CONFIG_NAME - string default "coreboot" endif diff --git a/board/cirrus/edb93xx/Kconfig b/board/cirrus/edb93xx/Kconfig index 0a9bdb2da7..f063d55708 100644 --- a/board/cirrus/edb93xx/Kconfig +++ b/board/cirrus/edb93xx/Kconfig @@ -1,23 +1,18 @@ if TARGET_EDB93XX config SYS_CPU - string default "arm920t" config SYS_BOARD - string default "edb93xx" config SYS_VENDOR - string default "cirrus" config SYS_SOC - string default "ep93xx" config SYS_CONFIG_NAME - string default "edb93xx" endif diff --git a/board/cloudengines/pogo_e02/Kconfig b/board/cloudengines/pogo_e02/Kconfig index fe36314f48..eaa68d9375 100644 --- a/board/cloudengines/pogo_e02/Kconfig +++ b/board/cloudengines/pogo_e02/Kconfig @@ -1,15 +1,12 @@ if TARGET_POGO_E02 config SYS_BOARD - string default "pogo_e02" config SYS_VENDOR - string default "cloudengines" config SYS_CONFIG_NAME - string default "pogo_e02" endif diff --git a/board/cm-bf527/Kconfig b/board/cm-bf527/Kconfig index d43d30620e..8d14179124 100644 --- a/board/cm-bf527/Kconfig +++ b/board/cm-bf527/Kconfig @@ -1,11 +1,9 @@ if TARGET_CM_BF527 config SYS_BOARD - string default "cm-bf527" config SYS_CONFIG_NAME - string default "cm-bf527" endif diff --git a/board/cm-bf533/Kconfig b/board/cm-bf533/Kconfig index af5bbb2fc2..cedd7529d5 100644 --- a/board/cm-bf533/Kconfig +++ b/board/cm-bf533/Kconfig @@ -1,11 +1,9 @@ if TARGET_CM_BF533 config SYS_BOARD - string default "cm-bf533" config SYS_CONFIG_NAME - string default "cm-bf533" endif diff --git a/board/cm-bf537e/Kconfig b/board/cm-bf537e/Kconfig index 83c160d347..af2e548cb9 100644 --- a/board/cm-bf537e/Kconfig +++ b/board/cm-bf537e/Kconfig @@ -1,11 +1,9 @@ if TARGET_CM_BF537E config SYS_BOARD - string default "cm-bf537e" config SYS_CONFIG_NAME - string default "cm-bf537e" endif diff --git a/board/cm-bf537u/Kconfig b/board/cm-bf537u/Kconfig index de384b7000..baf9e8cf61 100644 --- a/board/cm-bf537u/Kconfig +++ b/board/cm-bf537u/Kconfig @@ -1,11 +1,9 @@ if TARGET_CM_BF537U config SYS_BOARD - string default "cm-bf537u" config SYS_CONFIG_NAME - string default "cm-bf537u" endif diff --git a/board/cm-bf548/Kconfig b/board/cm-bf548/Kconfig index 29b027d425..b96cb5f153 100644 --- a/board/cm-bf548/Kconfig +++ b/board/cm-bf548/Kconfig @@ -1,11 +1,9 @@ if TARGET_CM_BF548 config SYS_BOARD - string default "cm-bf548" config SYS_CONFIG_NAME - string default "cm-bf548" endif diff --git a/board/cm-bf561/Kconfig b/board/cm-bf561/Kconfig index 94d110c551..8b302a5c8f 100644 --- a/board/cm-bf561/Kconfig +++ b/board/cm-bf561/Kconfig @@ -1,11 +1,9 @@ if TARGET_CM_BF561 config SYS_BOARD - string default "cm-bf561" config SYS_CONFIG_NAME - string default "cm-bf561" endif diff --git a/board/cm4008/Kconfig b/board/cm4008/Kconfig index 397794d260..a7f3b2f812 100644 --- a/board/cm4008/Kconfig +++ b/board/cm4008/Kconfig @@ -1,19 +1,15 @@ if TARGET_CM4008 config SYS_CPU - string default "arm920t" config SYS_BOARD - string default "cm4008" config SYS_SOC - string default "ks8695" config SYS_CONFIG_NAME - string default "cm4008" endif diff --git a/board/cm41xx/Kconfig b/board/cm41xx/Kconfig index ae2831ecd7..b537e2674c 100644 --- a/board/cm41xx/Kconfig +++ b/board/cm41xx/Kconfig @@ -1,19 +1,15 @@ if TARGET_CM41XX config SYS_CPU - string default "arm920t" config SYS_BOARD - string default "cm41xx" config SYS_SOC - string default "ks8695" config SYS_CONFIG_NAME - string default "cm41xx" endif diff --git a/board/cm5200/Kconfig b/board/cm5200/Kconfig index b4c8f22f71..ccea5c96e4 100644 --- a/board/cm5200/Kconfig +++ b/board/cm5200/Kconfig @@ -1,11 +1,9 @@ if TARGET_CM5200 config SYS_BOARD - string default "cm5200" config SYS_CONFIG_NAME - string default "cm5200" endif diff --git a/board/cmi/Kconfig b/board/cmi/Kconfig index 8040e59bc6..6efe6b1cb7 100644 --- a/board/cmi/Kconfig +++ b/board/cmi/Kconfig @@ -1,11 +1,9 @@ if TARGET_CMI_MPC5XX config SYS_BOARD - string default "cmi" config SYS_CONFIG_NAME - string default "cmi_mpc5xx" endif diff --git a/board/cobra5272/Kconfig b/board/cobra5272/Kconfig index 6e55d435f6..ba04622c21 100644 --- a/board/cobra5272/Kconfig +++ b/board/cobra5272/Kconfig @@ -1,15 +1,12 @@ if TARGET_COBRA5272 config SYS_CPU - string default "mcf52x2" config SYS_BOARD - string default "cobra5272" config SYS_CONFIG_NAME - string default "cobra5272" endif diff --git a/board/cogent/Kconfig b/board/cogent/Kconfig index 113034dc6b..7f34a14972 100644 --- a/board/cogent/Kconfig +++ b/board/cogent/Kconfig @@ -1,11 +1,9 @@ if TARGET_COGENT_MPC8260 config SYS_BOARD - string default "cogent" config SYS_CONFIG_NAME - string default "cogent_mpc8260" endif @@ -13,11 +11,9 @@ endif if TARGET_COGENT_MPC8XX config SYS_BOARD - string default "cogent" config SYS_CONFIG_NAME - string default "cogent_mpc8xx" endif diff --git a/board/comelit/dig297/Kconfig b/board/comelit/dig297/Kconfig index 4c5ea09b96..6dccaff5b0 100644 --- a/board/comelit/dig297/Kconfig +++ b/board/comelit/dig297/Kconfig @@ -1,15 +1,12 @@ if TARGET_DIG297 config SYS_BOARD - string default "dig297" config SYS_VENDOR - string default "comelit" config SYS_CONFIG_NAME - string default "dig297" endif diff --git a/board/compal/paz00/Kconfig b/board/compal/paz00/Kconfig index 690d7a7782..30ba11d360 100644 --- a/board/compal/paz00/Kconfig +++ b/board/compal/paz00/Kconfig @@ -1,15 +1,12 @@ if TARGET_PAZ00 config SYS_BOARD - string default "paz00" config SYS_VENDOR - string default "compal" config SYS_CONFIG_NAME - string default "paz00" endif diff --git a/board/compulab/cm_t335/Kconfig b/board/compulab/cm_t335/Kconfig index 4a1adf3c34..61159765ab 100644 --- a/board/compulab/cm_t335/Kconfig +++ b/board/compulab/cm_t335/Kconfig @@ -1,23 +1,18 @@ if TARGET_CM_T335 config SYS_CPU - string default "armv7" config SYS_BOARD - string default "cm_t335" config SYS_VENDOR - string default "compulab" config SYS_SOC - string default "am33xx" config SYS_CONFIG_NAME - string default "cm_t335" endif diff --git a/board/compulab/cm_t35/Kconfig b/board/compulab/cm_t35/Kconfig index 06de69261d..d87741f146 100644 --- a/board/compulab/cm_t35/Kconfig +++ b/board/compulab/cm_t35/Kconfig @@ -1,15 +1,12 @@ if TARGET_CM_T35 config SYS_BOARD - string default "cm_t35" config SYS_VENDOR - string default "compulab" config SYS_CONFIG_NAME - string default "cm_t35" endif diff --git a/board/compulab/cm_t54/Kconfig b/board/compulab/cm_t54/Kconfig index 0edab5c76a..52d38804df 100644 --- a/board/compulab/cm_t54/Kconfig +++ b/board/compulab/cm_t54/Kconfig @@ -1,15 +1,12 @@ if TARGET_CM_T54 config SYS_BOARD - string default "cm_t54" config SYS_VENDOR - string default "compulab" config SYS_CONFIG_NAME - string default "cm_t54" endif diff --git a/board/compulab/trimslice/Kconfig b/board/compulab/trimslice/Kconfig index 6ae030c737..3576914034 100644 --- a/board/compulab/trimslice/Kconfig +++ b/board/compulab/trimslice/Kconfig @@ -1,15 +1,12 @@ if TARGET_TRIMSLICE config SYS_BOARD - string default "trimslice" config SYS_VENDOR - string default "compulab" config SYS_CONFIG_NAME - string default "trimslice" endif diff --git a/board/congatec/cgtqmx6eval/Kconfig b/board/congatec/cgtqmx6eval/Kconfig index 155fa2cae5..0774784f78 100644 --- a/board/congatec/cgtqmx6eval/Kconfig +++ b/board/congatec/cgtqmx6eval/Kconfig @@ -1,23 +1,18 @@ if TARGET_CGTQMX6EVAL config SYS_CPU - string default "armv7" config SYS_BOARD - string default "cgtqmx6eval" config SYS_VENDOR - string default "congatec" config SYS_SOC - string default "mx6" config SYS_CONFIG_NAME - string default "cgtqmx6eval" endif diff --git a/board/corscience/tricorder/Kconfig b/board/corscience/tricorder/Kconfig index 5147fd76b8..345ac83d48 100644 --- a/board/corscience/tricorder/Kconfig +++ b/board/corscience/tricorder/Kconfig @@ -1,15 +1,12 @@ if TARGET_TRICORDER config SYS_BOARD - string default "tricorder" config SYS_VENDOR - string default "corscience" config SYS_CONFIG_NAME - string default "tricorder" endif diff --git a/board/cpc45/Kconfig b/board/cpc45/Kconfig index fd1a5367c0..c564caff09 100644 --- a/board/cpc45/Kconfig +++ b/board/cpc45/Kconfig @@ -1,11 +1,9 @@ if TARGET_CPC45 config SYS_BOARD - string default "cpc45" config SYS_CONFIG_NAME - string default "CPC45" endif diff --git a/board/cpu86/Kconfig b/board/cpu86/Kconfig index 27f1e4e25d..ac3ae9886e 100644 --- a/board/cpu86/Kconfig +++ b/board/cpu86/Kconfig @@ -1,11 +1,9 @@ if TARGET_CPU86 config SYS_BOARD - string default "cpu86" config SYS_CONFIG_NAME - string default "CPU86" endif diff --git a/board/cpu87/Kconfig b/board/cpu87/Kconfig index b45225dd09..a4f2768cdb 100644 --- a/board/cpu87/Kconfig +++ b/board/cpu87/Kconfig @@ -1,11 +1,9 @@ if TARGET_CPU87 config SYS_BOARD - string default "cpu87" config SYS_CONFIG_NAME - string default "CPU87" endif diff --git a/board/cray/L1/Kconfig b/board/cray/L1/Kconfig index fa9a7022c1..35a290af61 100644 --- a/board/cray/L1/Kconfig +++ b/board/cray/L1/Kconfig @@ -1,15 +1,12 @@ if TARGET_CRAYL1 config SYS_BOARD - string default "L1" config SYS_VENDOR - string default "cray" config SYS_CONFIG_NAME - string default "CRAYL1" endif diff --git a/board/creative/xfi3/Kconfig b/board/creative/xfi3/Kconfig index 9baf515cad..2255cc98bc 100644 --- a/board/creative/xfi3/Kconfig +++ b/board/creative/xfi3/Kconfig @@ -1,23 +1,18 @@ if TARGET_XFI3 config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "xfi3" config SYS_VENDOR - string default "creative" config SYS_SOC - string default "mxs" config SYS_CONFIG_NAME - string default "xfi3" endif diff --git a/board/csb272/Kconfig b/board/csb272/Kconfig index 90f94a3f13..eed04f0431 100644 --- a/board/csb272/Kconfig +++ b/board/csb272/Kconfig @@ -1,11 +1,9 @@ if TARGET_CSB272 config SYS_BOARD - string default "csb272" config SYS_CONFIG_NAME - string default "csb272" endif diff --git a/board/csb472/Kconfig b/board/csb472/Kconfig index 05230a01f9..53b1e7ad9a 100644 --- a/board/csb472/Kconfig +++ b/board/csb472/Kconfig @@ -1,11 +1,9 @@ if TARGET_CSB472 config SYS_BOARD - string default "csb472" config SYS_CONFIG_NAME - string default "csb472" endif diff --git a/board/cu824/Kconfig b/board/cu824/Kconfig index d866688791..7927b05637 100644 --- a/board/cu824/Kconfig +++ b/board/cu824/Kconfig @@ -1,11 +1,9 @@ if TARGET_CU824 config SYS_BOARD - string default "cu824" config SYS_CONFIG_NAME - string default "CU824" endif diff --git a/board/d-link/dns325/Kconfig b/board/d-link/dns325/Kconfig index 763f93c2ce..f6341ada60 100644 --- a/board/d-link/dns325/Kconfig +++ b/board/d-link/dns325/Kconfig @@ -1,15 +1,12 @@ if TARGET_DNS325 config SYS_BOARD - string default "dns325" config SYS_VENDOR - string default "d-link" config SYS_CONFIG_NAME - string default "dns325" endif diff --git a/board/dave/PPChameleonEVB/Kconfig b/board/dave/PPChameleonEVB/Kconfig index 3e95654239..bfe0011649 100644 --- a/board/dave/PPChameleonEVB/Kconfig +++ b/board/dave/PPChameleonEVB/Kconfig @@ -1,15 +1,12 @@ if TARGET_CATCENTER config SYS_BOARD - string default "PPChameleonEVB" config SYS_VENDOR - string default "dave" config SYS_CONFIG_NAME - string default "CATcenter" endif @@ -17,15 +14,12 @@ endif if TARGET_PPCHAMELEONEVB config SYS_BOARD - string default "PPChameleonEVB" config SYS_VENDOR - string default "dave" config SYS_CONFIG_NAME - string default "PPChameleonEVB" endif diff --git a/board/davedenx/aria/Kconfig b/board/davedenx/aria/Kconfig index f5d2aef365..54a86b9e13 100644 --- a/board/davedenx/aria/Kconfig +++ b/board/davedenx/aria/Kconfig @@ -1,15 +1,12 @@ if TARGET_ARIA config SYS_BOARD - string default "aria" config SYS_VENDOR - string default "davedenx" config SYS_CONFIG_NAME - string default "aria" endif diff --git a/board/davedenx/qong/Kconfig b/board/davedenx/qong/Kconfig index 51b9428edc..54cb4502f0 100644 --- a/board/davedenx/qong/Kconfig +++ b/board/davedenx/qong/Kconfig @@ -1,23 +1,18 @@ if TARGET_QONG config SYS_CPU - string default "arm1136" config SYS_BOARD - string default "qong" config SYS_VENDOR - string default "davedenx" config SYS_SOC - string default "mx31" config SYS_CONFIG_NAME - string default "qong" endif diff --git a/board/davinci/da8xxevm/Kconfig b/board/davinci/da8xxevm/Kconfig index b1237030aa..1a841ce6e0 100644 --- a/board/davinci/da8xxevm/Kconfig +++ b/board/davinci/da8xxevm/Kconfig @@ -1,15 +1,12 @@ if TARGET_DA830EVM config SYS_BOARD - string default "da8xxevm" config SYS_VENDOR - string default "davinci" config SYS_CONFIG_NAME - string default "da830evm" endif @@ -17,15 +14,12 @@ endif if TARGET_DA850EVM config SYS_BOARD - string default "da8xxevm" config SYS_VENDOR - string default "davinci" config SYS_CONFIG_NAME - string default "da850evm" endif @@ -33,15 +27,12 @@ endif if TARGET_HAWKBOARD config SYS_BOARD - string default "da8xxevm" config SYS_VENDOR - string default "davinci" config SYS_CONFIG_NAME - string default "hawkboard" endif diff --git a/board/davinci/dm355evm/Kconfig b/board/davinci/dm355evm/Kconfig index 7490bc0f2d..ec2c27623d 100644 --- a/board/davinci/dm355evm/Kconfig +++ b/board/davinci/dm355evm/Kconfig @@ -1,15 +1,12 @@ if TARGET_DAVINCI_DM355EVM config SYS_BOARD - string default "dm355evm" config SYS_VENDOR - string default "davinci" config SYS_CONFIG_NAME - string default "davinci_dm355evm" endif diff --git a/board/davinci/dm355leopard/Kconfig b/board/davinci/dm355leopard/Kconfig index 73a53ffb9d..ab4230a637 100644 --- a/board/davinci/dm355leopard/Kconfig +++ b/board/davinci/dm355leopard/Kconfig @@ -1,15 +1,12 @@ if TARGET_DAVINCI_DM355LEOPARD config SYS_BOARD - string default "dm355leopard" config SYS_VENDOR - string default "davinci" config SYS_CONFIG_NAME - string default "davinci_dm355leopard" endif diff --git a/board/davinci/dm365evm/Kconfig b/board/davinci/dm365evm/Kconfig index 266c6eea27..724c7b6204 100644 --- a/board/davinci/dm365evm/Kconfig +++ b/board/davinci/dm365evm/Kconfig @@ -1,15 +1,12 @@ if TARGET_DAVINCI_DM365EVM config SYS_BOARD - string default "dm365evm" config SYS_VENDOR - string default "davinci" config SYS_CONFIG_NAME - string default "davinci_dm365evm" endif diff --git a/board/davinci/dm6467evm/Kconfig b/board/davinci/dm6467evm/Kconfig index 1c4d0f0b68..56d2ab487d 100644 --- a/board/davinci/dm6467evm/Kconfig +++ b/board/davinci/dm6467evm/Kconfig @@ -1,15 +1,12 @@ if TARGET_DAVINCI_DM6467EVM config SYS_BOARD - string default "dm6467evm" config SYS_VENDOR - string default "davinci" config SYS_CONFIG_NAME - string default "davinci_dm6467evm" endif diff --git a/board/davinci/dvevm/Kconfig b/board/davinci/dvevm/Kconfig index e020f8d55d..3f0ef82215 100644 --- a/board/davinci/dvevm/Kconfig +++ b/board/davinci/dvevm/Kconfig @@ -1,15 +1,12 @@ if TARGET_DAVINCI_DVEVM config SYS_BOARD - string default "dvevm" config SYS_VENDOR - string default "davinci" config SYS_CONFIG_NAME - string default "davinci_dvevm" endif diff --git a/board/davinci/ea20/Kconfig b/board/davinci/ea20/Kconfig index 93950fd2ff..ae5b16e142 100644 --- a/board/davinci/ea20/Kconfig +++ b/board/davinci/ea20/Kconfig @@ -1,15 +1,12 @@ if TARGET_EA20 config SYS_BOARD - string default "ea20" config SYS_VENDOR - string default "davinci" config SYS_CONFIG_NAME - string default "ea20" endif diff --git a/board/davinci/schmoogie/Kconfig b/board/davinci/schmoogie/Kconfig index 7aa459deb5..35810755f9 100644 --- a/board/davinci/schmoogie/Kconfig +++ b/board/davinci/schmoogie/Kconfig @@ -1,15 +1,12 @@ if TARGET_DAVINCI_SCHMOOGIE config SYS_BOARD - string default "schmoogie" config SYS_VENDOR - string default "davinci" config SYS_CONFIG_NAME - string default "davinci_schmoogie" endif diff --git a/board/davinci/sffsdr/Kconfig b/board/davinci/sffsdr/Kconfig index 95461fc043..dc48f3118c 100644 --- a/board/davinci/sffsdr/Kconfig +++ b/board/davinci/sffsdr/Kconfig @@ -1,15 +1,12 @@ if TARGET_DAVINCI_SFFSDR config SYS_BOARD - string default "sffsdr" config SYS_VENDOR - string default "davinci" config SYS_CONFIG_NAME - string default "davinci_sffsdr" endif diff --git a/board/davinci/sonata/Kconfig b/board/davinci/sonata/Kconfig index a21fb8ed80..4440d95bc2 100644 --- a/board/davinci/sonata/Kconfig +++ b/board/davinci/sonata/Kconfig @@ -1,15 +1,12 @@ if TARGET_DAVINCI_SONATA config SYS_BOARD - string default "sonata" config SYS_VENDOR - string default "davinci" config SYS_CONFIG_NAME - string default "davinci_sonata" endif diff --git a/board/dbau1x00/Kconfig b/board/dbau1x00/Kconfig index 5fca62deb2..1a8946d06c 100644 --- a/board/dbau1x00/Kconfig +++ b/board/dbau1x00/Kconfig @@ -1,19 +1,15 @@ if TARGET_DBAU1X00 config SYS_CPU - string default "mips32" config SYS_BOARD - string default "dbau1x00" config SYS_SOC - string default "au1x00" config SYS_CONFIG_NAME - string default "dbau1x00" endif diff --git a/board/denx/m28evk/Kconfig b/board/denx/m28evk/Kconfig index 05f79ad831..b1c16c702b 100644 --- a/board/denx/m28evk/Kconfig +++ b/board/denx/m28evk/Kconfig @@ -1,23 +1,18 @@ if TARGET_M28EVK config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "m28evk" config SYS_VENDOR - string default "denx" config SYS_SOC - string default "mxs" config SYS_CONFIG_NAME - string default "m28evk" endif diff --git a/board/denx/m53evk/Kconfig b/board/denx/m53evk/Kconfig index 5e3298c1da..5dbb7f8d5f 100644 --- a/board/denx/m53evk/Kconfig +++ b/board/denx/m53evk/Kconfig @@ -1,23 +1,18 @@ if TARGET_M53EVK config SYS_CPU - string default "armv7" config SYS_BOARD - string default "m53evk" config SYS_VENDOR - string default "denx" config SYS_SOC - string default "mx5" config SYS_CONFIG_NAME - string default "m53evk" endif diff --git a/board/dnp5370/Kconfig b/board/dnp5370/Kconfig index f03a1e729e..797081d5f2 100644 --- a/board/dnp5370/Kconfig +++ b/board/dnp5370/Kconfig @@ -1,11 +1,9 @@ if TARGET_DNP5370 config SYS_BOARD - string default "dnp5370" config SYS_CONFIG_NAME - string default "dnp5370" endif diff --git a/board/eXalion/Kconfig b/board/eXalion/Kconfig index 42ba092a2c..a22f58a459 100644 --- a/board/eXalion/Kconfig +++ b/board/eXalion/Kconfig @@ -1,11 +1,9 @@ if TARGET_EXALION config SYS_BOARD - string default "eXalion" config SYS_CONFIG_NAME - string default "eXalion" endif diff --git a/board/earthlcd/favr-32-ezkit/Kconfig b/board/earthlcd/favr-32-ezkit/Kconfig index c0cd1b710b..50e29ec241 100644 --- a/board/earthlcd/favr-32-ezkit/Kconfig +++ b/board/earthlcd/favr-32-ezkit/Kconfig @@ -1,19 +1,15 @@ if TARGET_FAVR_32_EZKIT config SYS_BOARD - string default "favr-32-ezkit" config SYS_VENDOR - string default "earthlcd" config SYS_SOC - string default "at32ap700x" config SYS_CONFIG_NAME - string default "favr-32-ezkit" endif diff --git a/board/egnite/ethernut5/Kconfig b/board/egnite/ethernut5/Kconfig index cd2e53ce6a..281e43a17f 100644 --- a/board/egnite/ethernut5/Kconfig +++ b/board/egnite/ethernut5/Kconfig @@ -1,23 +1,18 @@ if TARGET_ETHERNUT5 config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "ethernut5" config SYS_VENDOR - string default "egnite" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "ethernut5" endif diff --git a/board/eltec/elppc/Kconfig b/board/eltec/elppc/Kconfig index 55564dc960..d4003e5340 100644 --- a/board/eltec/elppc/Kconfig +++ b/board/eltec/elppc/Kconfig @@ -1,15 +1,12 @@ if TARGET_ELPPC config SYS_BOARD - string default "elppc" config SYS_VENDOR - string default "eltec" config SYS_CONFIG_NAME - string default "ELPPC" endif diff --git a/board/eltec/mhpc/Kconfig b/board/eltec/mhpc/Kconfig index 69c8358a53..5a4c8844f0 100644 --- a/board/eltec/mhpc/Kconfig +++ b/board/eltec/mhpc/Kconfig @@ -1,15 +1,12 @@ if TARGET_MHPC config SYS_BOARD - string default "mhpc" config SYS_VENDOR - string default "eltec" config SYS_CONFIG_NAME - string default "MHPC" endif diff --git a/board/embest/mx6boards/Kconfig b/board/embest/mx6boards/Kconfig index b0c823e322..8e39fce6fe 100644 --- a/board/embest/mx6boards/Kconfig +++ b/board/embest/mx6boards/Kconfig @@ -1,23 +1,18 @@ if TARGET_EMBESTMX6BOARDS config SYS_CPU - string default "armv7" config SYS_BOARD - string default "mx6boards" config SYS_VENDOR - string default "embest" config SYS_SOC - string default "mx6" config SYS_CONFIG_NAME - string default "embestmx6boards" endif diff --git a/board/emk/top5200/Kconfig b/board/emk/top5200/Kconfig index 1d4e3265c7..bba1fd4d9b 100644 --- a/board/emk/top5200/Kconfig +++ b/board/emk/top5200/Kconfig @@ -1,15 +1,12 @@ if TARGET_TOP5200 config SYS_BOARD - string default "top5200" config SYS_VENDOR - string default "emk" config SYS_CONFIG_NAME - string default "TOP5200" endif diff --git a/board/emk/top860/Kconfig b/board/emk/top860/Kconfig index 4da934e081..7b5afdadfc 100644 --- a/board/emk/top860/Kconfig +++ b/board/emk/top860/Kconfig @@ -1,15 +1,12 @@ if TARGET_TOP860 config SYS_BOARD - string default "top860" config SYS_VENDOR - string default "emk" config SYS_CONFIG_NAME - string default "TOP860" endif diff --git a/board/emk/top9000/Kconfig b/board/emk/top9000/Kconfig index 421f7b2464..2dbe0603b7 100644 --- a/board/emk/top9000/Kconfig +++ b/board/emk/top9000/Kconfig @@ -1,23 +1,18 @@ if TARGET_TOP9000 config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "top9000" config SYS_VENDOR - string default "emk" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "top9000" endif diff --git a/board/enbw/enbw_cmc/Kconfig b/board/enbw/enbw_cmc/Kconfig index 183334b292..796736d865 100644 --- a/board/enbw/enbw_cmc/Kconfig +++ b/board/enbw/enbw_cmc/Kconfig @@ -1,15 +1,12 @@ if TARGET_ENBW_CMC config SYS_BOARD - string default "enbw_cmc" config SYS_VENDOR - string default "enbw" config SYS_CONFIG_NAME - string default "enbw_cmc" endif diff --git a/board/ep8260/Kconfig b/board/ep8260/Kconfig index 15ca9623d6..5d876f4872 100644 --- a/board/ep8260/Kconfig +++ b/board/ep8260/Kconfig @@ -1,11 +1,9 @@ if TARGET_EP8260 config SYS_BOARD - string default "ep8260" config SYS_CONFIG_NAME - string default "ep8260" endif diff --git a/board/ep82xxm/Kconfig b/board/ep82xxm/Kconfig index b4121a6b09..d842091271 100644 --- a/board/ep82xxm/Kconfig +++ b/board/ep82xxm/Kconfig @@ -1,11 +1,9 @@ if TARGET_EP82XXM config SYS_BOARD - string default "ep82xxm" config SYS_CONFIG_NAME - string default "ep82xxm" endif diff --git a/board/esd/apc405/Kconfig b/board/esd/apc405/Kconfig index 83cd8bd9bb..6b03460aa5 100644 --- a/board/esd/apc405/Kconfig +++ b/board/esd/apc405/Kconfig @@ -1,15 +1,12 @@ if TARGET_APC405 config SYS_BOARD - string default "apc405" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "APC405" endif diff --git a/board/esd/ar405/Kconfig b/board/esd/ar405/Kconfig index e35fc5e743..4ad9d51922 100644 --- a/board/esd/ar405/Kconfig +++ b/board/esd/ar405/Kconfig @@ -1,15 +1,12 @@ if TARGET_AR405 config SYS_BOARD - string default "ar405" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "AR405" endif diff --git a/board/esd/ash405/Kconfig b/board/esd/ash405/Kconfig index e9558a44c5..02c7c14249 100644 --- a/board/esd/ash405/Kconfig +++ b/board/esd/ash405/Kconfig @@ -1,15 +1,12 @@ if TARGET_ASH405 config SYS_BOARD - string default "ash405" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "ASH405" endif diff --git a/board/esd/cms700/Kconfig b/board/esd/cms700/Kconfig index 398d22a69f..da11bc0e96 100644 --- a/board/esd/cms700/Kconfig +++ b/board/esd/cms700/Kconfig @@ -1,15 +1,12 @@ if TARGET_CMS700 config SYS_BOARD - string default "cms700" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "CMS700" endif diff --git a/board/esd/cpci2dp/Kconfig b/board/esd/cpci2dp/Kconfig index c99404c903..646e8ffa1c 100644 --- a/board/esd/cpci2dp/Kconfig +++ b/board/esd/cpci2dp/Kconfig @@ -1,15 +1,12 @@ if TARGET_CPCI2DP config SYS_BOARD - string default "cpci2dp" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "CPCI2DP" endif diff --git a/board/esd/cpci405/Kconfig b/board/esd/cpci405/Kconfig index 0b9f9f4bed..bc569070ce 100644 --- a/board/esd/cpci405/Kconfig +++ b/board/esd/cpci405/Kconfig @@ -1,15 +1,12 @@ if TARGET_CPCI405 config SYS_BOARD - string default "cpci405" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "CPCI405" endif @@ -17,15 +14,12 @@ endif if TARGET_CPCI4052 config SYS_BOARD - string default "cpci405" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "CPCI4052" endif @@ -33,15 +27,12 @@ endif if TARGET_CPCI405AB config SYS_BOARD - string default "cpci405" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "CPCI405AB" endif @@ -49,15 +40,12 @@ endif if TARGET_CPCI405DT config SYS_BOARD - string default "cpci405" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "CPCI405DT" endif diff --git a/board/esd/cpci5200/Kconfig b/board/esd/cpci5200/Kconfig index 29fa9e60cd..ddd9418d3d 100644 --- a/board/esd/cpci5200/Kconfig +++ b/board/esd/cpci5200/Kconfig @@ -1,15 +1,12 @@ if TARGET_CPCI5200 config SYS_BOARD - string default "cpci5200" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "cpci5200" endif diff --git a/board/esd/cpci750/Kconfig b/board/esd/cpci750/Kconfig index 99f8c2dc14..32d4ee60b7 100644 --- a/board/esd/cpci750/Kconfig +++ b/board/esd/cpci750/Kconfig @@ -1,15 +1,12 @@ if TARGET_CPCI750 config SYS_BOARD - string default "cpci750" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "CPCI750" endif diff --git a/board/esd/cpciiser4/Kconfig b/board/esd/cpciiser4/Kconfig index 1357a51943..4079b2f719 100644 --- a/board/esd/cpciiser4/Kconfig +++ b/board/esd/cpciiser4/Kconfig @@ -1,15 +1,12 @@ if TARGET_CPCIISER4 config SYS_BOARD - string default "cpciiser4" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "CPCIISER4" endif diff --git a/board/esd/dp405/Kconfig b/board/esd/dp405/Kconfig index 0fd7014571..c0163aef0f 100644 --- a/board/esd/dp405/Kconfig +++ b/board/esd/dp405/Kconfig @@ -1,15 +1,12 @@ if TARGET_DP405 config SYS_BOARD - string default "dp405" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "DP405" endif diff --git a/board/esd/du405/Kconfig b/board/esd/du405/Kconfig index f2857f695f..2913fb9721 100644 --- a/board/esd/du405/Kconfig +++ b/board/esd/du405/Kconfig @@ -1,15 +1,12 @@ if TARGET_DU405 config SYS_BOARD - string default "du405" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "DU405" endif diff --git a/board/esd/du440/Kconfig b/board/esd/du440/Kconfig index f80e1819ba..b4b3e6bc43 100644 --- a/board/esd/du440/Kconfig +++ b/board/esd/du440/Kconfig @@ -1,15 +1,12 @@ if TARGET_DU440 config SYS_BOARD - string default "du440" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "DU440" endif diff --git a/board/esd/hh405/Kconfig b/board/esd/hh405/Kconfig index 0dc4b062da..8a8623a8b0 100644 --- a/board/esd/hh405/Kconfig +++ b/board/esd/hh405/Kconfig @@ -1,15 +1,12 @@ if TARGET_HH405 config SYS_BOARD - string default "hh405" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "HH405" endif diff --git a/board/esd/hub405/Kconfig b/board/esd/hub405/Kconfig index e355dd2f87..2b9556a195 100644 --- a/board/esd/hub405/Kconfig +++ b/board/esd/hub405/Kconfig @@ -1,15 +1,12 @@ if TARGET_HUB405 config SYS_BOARD - string default "hub405" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "HUB405" endif diff --git a/board/esd/mecp5123/Kconfig b/board/esd/mecp5123/Kconfig index 74237e34cb..3f2a411196 100644 --- a/board/esd/mecp5123/Kconfig +++ b/board/esd/mecp5123/Kconfig @@ -1,15 +1,12 @@ if TARGET_MECP5123 config SYS_BOARD - string default "mecp5123" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "mecp5123" endif diff --git a/board/esd/mecp5200/Kconfig b/board/esd/mecp5200/Kconfig index dfcaefdbf6..cfd5307751 100644 --- a/board/esd/mecp5200/Kconfig +++ b/board/esd/mecp5200/Kconfig @@ -1,15 +1,12 @@ if TARGET_MECP5200 config SYS_BOARD - string default "mecp5200" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "mecp5200" endif diff --git a/board/esd/meesc/Kconfig b/board/esd/meesc/Kconfig index 86a28353d1..7d5c3ca980 100644 --- a/board/esd/meesc/Kconfig +++ b/board/esd/meesc/Kconfig @@ -1,23 +1,18 @@ if TARGET_MEESC config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "meesc" config SYS_VENDOR - string default "esd" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "meesc" endif diff --git a/board/esd/ocrtc/Kconfig b/board/esd/ocrtc/Kconfig index 83fa495947..44b402d8ef 100644 --- a/board/esd/ocrtc/Kconfig +++ b/board/esd/ocrtc/Kconfig @@ -1,15 +1,12 @@ if TARGET_OCRTC config SYS_BOARD - string default "ocrtc" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "OCRTC" endif diff --git a/board/esd/otc570/Kconfig b/board/esd/otc570/Kconfig index ec6e4d9823..7c5ce90a7d 100644 --- a/board/esd/otc570/Kconfig +++ b/board/esd/otc570/Kconfig @@ -1,23 +1,18 @@ if TARGET_OTC570 config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "otc570" config SYS_VENDOR - string default "esd" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "otc570" endif diff --git a/board/esd/pci405/Kconfig b/board/esd/pci405/Kconfig index a1a3971659..0a6524d073 100644 --- a/board/esd/pci405/Kconfig +++ b/board/esd/pci405/Kconfig @@ -1,15 +1,12 @@ if TARGET_PCI405 config SYS_BOARD - string default "pci405" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "PCI405" endif diff --git a/board/esd/pf5200/Kconfig b/board/esd/pf5200/Kconfig index 82f30afe09..c596e7a66c 100644 --- a/board/esd/pf5200/Kconfig +++ b/board/esd/pf5200/Kconfig @@ -1,15 +1,12 @@ if TARGET_PF5200 config SYS_BOARD - string default "pf5200" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "pf5200" endif diff --git a/board/esd/plu405/Kconfig b/board/esd/plu405/Kconfig index b9783d776d..b3082cb022 100644 --- a/board/esd/plu405/Kconfig +++ b/board/esd/plu405/Kconfig @@ -1,15 +1,12 @@ if TARGET_PLU405 config SYS_BOARD - string default "plu405" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "PLU405" endif diff --git a/board/esd/pmc405/Kconfig b/board/esd/pmc405/Kconfig index e3c3c82041..3738c68c9c 100644 --- a/board/esd/pmc405/Kconfig +++ b/board/esd/pmc405/Kconfig @@ -1,15 +1,12 @@ if TARGET_PMC405 config SYS_BOARD - string default "pmc405" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "PMC405" endif diff --git a/board/esd/pmc405de/Kconfig b/board/esd/pmc405de/Kconfig index f06b26b1f2..4b05787a49 100644 --- a/board/esd/pmc405de/Kconfig +++ b/board/esd/pmc405de/Kconfig @@ -1,15 +1,12 @@ if TARGET_PMC405DE config SYS_BOARD - string default "pmc405de" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "PMC405DE" endif diff --git a/board/esd/pmc440/Kconfig b/board/esd/pmc440/Kconfig index 28db4ab187..df8bd65ab7 100644 --- a/board/esd/pmc440/Kconfig +++ b/board/esd/pmc440/Kconfig @@ -1,15 +1,12 @@ if TARGET_PMC440 config SYS_BOARD - string default "pmc440" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "PMC440" endif diff --git a/board/esd/tasreg/Kconfig b/board/esd/tasreg/Kconfig index 8fb80dc265..85417d4841 100644 --- a/board/esd/tasreg/Kconfig +++ b/board/esd/tasreg/Kconfig @@ -1,19 +1,15 @@ if TARGET_TASREG config SYS_CPU - string default "mcf52x2" config SYS_BOARD - string default "tasreg" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "TASREG" endif diff --git a/board/esd/vme8349/Kconfig b/board/esd/vme8349/Kconfig index 4fd507c332..b8d9432dcc 100644 --- a/board/esd/vme8349/Kconfig +++ b/board/esd/vme8349/Kconfig @@ -1,15 +1,12 @@ if TARGET_VME8349 config SYS_BOARD - string default "vme8349" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "vme8349" endif diff --git a/board/esd/voh405/Kconfig b/board/esd/voh405/Kconfig index ef3d073c37..d9fe9d2e87 100644 --- a/board/esd/voh405/Kconfig +++ b/board/esd/voh405/Kconfig @@ -1,15 +1,12 @@ if TARGET_VOH405 config SYS_BOARD - string default "voh405" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "VOH405" endif diff --git a/board/esd/vom405/Kconfig b/board/esd/vom405/Kconfig index 90ba34a04d..ecdf8c9fea 100644 --- a/board/esd/vom405/Kconfig +++ b/board/esd/vom405/Kconfig @@ -1,15 +1,12 @@ if TARGET_VOM405 config SYS_BOARD - string default "vom405" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "VOM405" endif diff --git a/board/esd/wuh405/Kconfig b/board/esd/wuh405/Kconfig index 214af9f8ac..8a7df4db4e 100644 --- a/board/esd/wuh405/Kconfig +++ b/board/esd/wuh405/Kconfig @@ -1,15 +1,12 @@ if TARGET_WUH405 config SYS_BOARD - string default "wuh405" config SYS_VENDOR - string default "esd" config SYS_CONFIG_NAME - string default "WUH405" endif diff --git a/board/esg/ima3-mx53/Kconfig b/board/esg/ima3-mx53/Kconfig index fc27625d52..5593689e72 100644 --- a/board/esg/ima3-mx53/Kconfig +++ b/board/esg/ima3-mx53/Kconfig @@ -1,23 +1,18 @@ if TARGET_IMA3_MX53 config SYS_CPU - string default "armv7" config SYS_BOARD - string default "ima3-mx53" config SYS_VENDOR - string default "esg" config SYS_SOC - string default "mx5" config SYS_CONFIG_NAME - string default "ima3-mx53" endif diff --git a/board/espt/Kconfig b/board/espt/Kconfig index 7527e34ae6..6c7cd24155 100644 --- a/board/espt/Kconfig +++ b/board/espt/Kconfig @@ -1,15 +1,12 @@ if TARGET_ESPT config SYS_CPU - string default "sh4" config SYS_BOARD - string default "espt" config SYS_CONFIG_NAME - string default "espt" endif diff --git a/board/esteem192e/Kconfig b/board/esteem192e/Kconfig index 848fef8b22..f895bc4f24 100644 --- a/board/esteem192e/Kconfig +++ b/board/esteem192e/Kconfig @@ -1,11 +1,9 @@ if TARGET_ESTEEM192E config SYS_BOARD - string default "esteem192e" config SYS_CONFIG_NAME - string default "ESTEEM192E" endif diff --git a/board/eukrea/cpu9260/Kconfig b/board/eukrea/cpu9260/Kconfig index d86044ed46..53ae917c76 100644 --- a/board/eukrea/cpu9260/Kconfig +++ b/board/eukrea/cpu9260/Kconfig @@ -1,23 +1,18 @@ if TARGET_CPU9260 config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "cpu9260" config SYS_VENDOR - string default "eukrea" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "cpu9260" endif diff --git a/board/eukrea/cpuat91/Kconfig b/board/eukrea/cpuat91/Kconfig index ced3748b1b..f2b02dc1c2 100644 --- a/board/eukrea/cpuat91/Kconfig +++ b/board/eukrea/cpuat91/Kconfig @@ -1,23 +1,18 @@ if TARGET_CPUAT91 config SYS_CPU - string default "arm920t" config SYS_BOARD - string default "cpuat91" config SYS_VENDOR - string default "eukrea" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "cpuat91" endif diff --git a/board/evb64260/Kconfig b/board/evb64260/Kconfig index f7f86c9e87..933e6d6ae6 100644 --- a/board/evb64260/Kconfig +++ b/board/evb64260/Kconfig @@ -1,11 +1,9 @@ if TARGET_P3G4 config SYS_BOARD - string default "evb64260" config SYS_CONFIG_NAME - string default "P3G4" endif @@ -13,11 +11,9 @@ endif if TARGET_ZUMA config SYS_BOARD - string default "evb64260" config SYS_CONFIG_NAME - string default "ZUMA" endif diff --git a/board/exmeritus/hww1u1a/Kconfig b/board/exmeritus/hww1u1a/Kconfig index 126ce2fe95..7a76b4358e 100644 --- a/board/exmeritus/hww1u1a/Kconfig +++ b/board/exmeritus/hww1u1a/Kconfig @@ -1,15 +1,12 @@ if TARGET_HWW1U1A config SYS_BOARD - string default "hww1u1a" config SYS_VENDOR - string default "exmeritus" config SYS_CONFIG_NAME - string default "HWW1U1A" endif diff --git a/board/faraday/a320evb/Kconfig b/board/faraday/a320evb/Kconfig index 353c8734e5..bfa620708d 100644 --- a/board/faraday/a320evb/Kconfig +++ b/board/faraday/a320evb/Kconfig @@ -1,23 +1,18 @@ if TARGET_A320EVB config SYS_CPU - string default "arm920t" config SYS_BOARD - string default "a320evb" config SYS_VENDOR - string default "faraday" config SYS_SOC - string default "a320" config SYS_CONFIG_NAME - string default "a320evb" endif diff --git a/board/freescale/b4860qds/Kconfig b/board/freescale/b4860qds/Kconfig index c5321d64dc..c7aab7521b 100644 --- a/board/freescale/b4860qds/Kconfig +++ b/board/freescale/b4860qds/Kconfig @@ -1,15 +1,12 @@ if TARGET_B4860QDS config SYS_BOARD - string default "b4860qds" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "B4860QDS" endif diff --git a/board/freescale/bsc9131rdb/Kconfig b/board/freescale/bsc9131rdb/Kconfig index 6099d4d063..dd9f765d7d 100644 --- a/board/freescale/bsc9131rdb/Kconfig +++ b/board/freescale/bsc9131rdb/Kconfig @@ -1,15 +1,12 @@ if TARGET_BSC9131RDB config SYS_BOARD - string default "bsc9131rdb" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "BSC9131RDB" endif diff --git a/board/freescale/bsc9132qds/Kconfig b/board/freescale/bsc9132qds/Kconfig index 955069b15a..db3a1f1d47 100644 --- a/board/freescale/bsc9132qds/Kconfig +++ b/board/freescale/bsc9132qds/Kconfig @@ -1,15 +1,12 @@ if TARGET_BSC9132QDS config SYS_BOARD - string default "bsc9132qds" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "BSC9132QDS" endif diff --git a/board/freescale/c29xpcie/Kconfig b/board/freescale/c29xpcie/Kconfig index be9c237839..17369b8ca7 100644 --- a/board/freescale/c29xpcie/Kconfig +++ b/board/freescale/c29xpcie/Kconfig @@ -1,15 +1,12 @@ if TARGET_C29XPCIE config SYS_BOARD - string default "c29xpcie" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "C29XPCIE" endif diff --git a/board/freescale/common/Makefile b/board/freescale/common/Makefile index 50d77317df..32b5a3b70c 100644 --- a/board/freescale/common/Makefile +++ b/board/freescale/common/Makefile @@ -36,6 +36,8 @@ endif obj-$(CONFIG_FSL_DIU_CH7301) += diu_ch7301.o +obj-$(CONFIG_FSL_DCU_SII9022A) += dcu_sii9022a.o + obj-$(CONFIG_MPC8541CDS) += cds_pci_ft.o obj-$(CONFIG_MPC8548CDS) += cds_pci_ft.o obj-$(CONFIG_MPC8555CDS) += cds_pci_ft.o diff --git a/board/freescale/common/dcu_sii9022a.c b/board/freescale/common/dcu_sii9022a.c new file mode 100644 index 0000000000..2da627e1f9 --- /dev/null +++ b/board/freescale/common/dcu_sii9022a.c @@ -0,0 +1,153 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <asm/io.h> +#include <common.h> +#include <fsl_dcu_fb.h> +#include <i2c.h> +#include <linux/fb.h> + +#define PIXEL_CLK_LSB_REG 0x00 +#define PIXEL_CLK_MSB_REG 0x01 +#define VERT_FREQ_LSB_REG 0x02 +#define VERT_FREQ_MSB_REG 0x03 +#define TOTAL_PIXELS_LSB_REG 0x04 +#define TOTAL_PIXELS_MSB_REG 0x05 +#define TOTAL_LINES_LSB_REG 0x06 +#define TOTAL_LINES_MSB_REG 0x07 +#define TPI_INBUS_FMT_REG 0x08 +#define TPI_INPUT_FMT_REG 0x09 +#define TPI_OUTPUT_FMT_REG 0x0A +#define TPI_SYS_CTRL_REG 0x1A +#define TPI_PWR_STAT_REG 0x1E +#define TPI_AUDIO_HANDING_REG 0x25 +#define TPI_AUDIO_INTF_REG 0x26 +#define TPI_AUDIO_FREQ_REG 0x27 +#define TPI_SET_PAGE_REG 0xBC +#define TPI_SET_OFFSET_REG 0xBD +#define TPI_RW_ACCESS_REG 0xBE +#define TPI_TRANS_MODE_REG 0xC7 + +#define TPI_INBUS_CLOCK_RATIO_1 (1 << 6) +#define TPI_INBUS_FULL_PIXEL_WIDE (1 << 5) +#define TPI_INBUS_RISING_EDGE (1 << 4) +#define TPI_INPUT_CLR_DEPTH_8BIT (0 << 6) +#define TPI_INPUT_VRANGE_EXPAN_AUTO (0 << 2) +#define TPI_INPUT_CLR_RGB (0 << 0) +#define TPI_OUTPUT_CLR_DEPTH_8BIT (0 << 6) +#define TPI_OUTPUT_VRANGE_COMPRE_AUTO (0 << 2) +#define TPI_OUTPUT_CLR_HDMI_RGB (0 << 0) +#define TPI_SYS_TMDS_OUTPUT (0 << 4) +#define TPI_SYS_AV_NORAML (0 << 3) +#define TPI_SYS_AV_MUTE (1 << 3) +#define TPI_SYS_DVI_MODE (0 << 0) +#define TPI_SYS_HDMI_MODE (1 << 0) +#define TPI_PWR_STAT_MASK (3 << 0) +#define TPI_PWR_STAT_D0 (0 << 0) +#define TPI_AUDIO_PASS_BASIC (0 << 0) +#define TPI_AUDIO_INTF_I2S (2 << 6) +#define TPI_AUDIO_INTF_NORMAL (0 << 4) +#define TPI_AUDIO_TYPE_PCM (1 << 0) +#define TPI_AUDIO_SAMP_SIZE_16BIT (1 << 6) +#define TPI_AUDIO_SAMP_FREQ_44K (2 << 3) +#define TPI_SET_PAGE_SII9022A 0x01 +#define TPI_SET_OFFSET_SII9022A 0x82 +#define TPI_RW_EN_SRC_TERMIN (1 << 0) +#define TPI_TRANS_MODE_ENABLE (0 << 7) + +/* Programming of Silicon SIi9022a HDMI Transmitter */ +int dcu_set_dvi_encoder(struct fb_videomode *videomode) +{ + u8 temp; + u16 temp1, temp2; + u32 temp3; + + i2c_set_bus_num(CONFIG_SYS_I2C_DVI_BUS_NUM); + + /* Enable TPI transmitter mode */ + temp = TPI_TRANS_MODE_ENABLE; + i2c_write(CONFIG_SYS_I2C_DVI_ADDR, TPI_TRANS_MODE_REG, 1, &temp, 1); + + /* Enter into D0 state, full operation */ + i2c_read(CONFIG_SYS_I2C_DVI_ADDR, TPI_PWR_STAT_REG, 1, &temp, 1); + temp &= ~TPI_PWR_STAT_MASK; + temp |= TPI_PWR_STAT_D0; + i2c_write(CONFIG_SYS_I2C_DVI_ADDR, TPI_PWR_STAT_REG, 1, &temp, 1); + + /* Enable source termination */ + temp = TPI_SET_PAGE_SII9022A; + i2c_write(CONFIG_SYS_I2C_DVI_ADDR, TPI_SET_PAGE_REG, 1, &temp, 1); + temp = TPI_SET_OFFSET_SII9022A; + i2c_write(CONFIG_SYS_I2C_DVI_ADDR, TPI_SET_OFFSET_REG, 1, &temp, 1); + + i2c_read(CONFIG_SYS_I2C_DVI_ADDR, TPI_RW_ACCESS_REG, 1, &temp, 1); + temp |= TPI_RW_EN_SRC_TERMIN; + i2c_write(CONFIG_SYS_I2C_DVI_ADDR, TPI_RW_ACCESS_REG, 1, &temp, 1); + + /* Set TPI system control */ + temp = TPI_SYS_TMDS_OUTPUT | TPI_SYS_AV_NORAML | TPI_SYS_DVI_MODE; + i2c_write(CONFIG_SYS_I2C_DVI_ADDR, TPI_SYS_CTRL_REG, 1, &temp, 1); + + /* Set pixel clock */ + temp1 = PICOS2KHZ(videomode->pixclock) / 10; + temp = (u8)(temp1 & 0xFF); + i2c_write(CONFIG_SYS_I2C_DVI_ADDR, PIXEL_CLK_LSB_REG, 1, &temp, 1); + temp = (u8)(temp1 >> 8); + i2c_write(CONFIG_SYS_I2C_DVI_ADDR, PIXEL_CLK_MSB_REG, 1, &temp, 1); + + /* Set total pixels per line */ + temp1 = videomode->hsync_len + videomode->left_margin + + videomode->xres + videomode->right_margin; + temp = (u8)(temp1 & 0xFF); + i2c_write(CONFIG_SYS_I2C_DVI_ADDR, TOTAL_PIXELS_LSB_REG, 1, &temp, 1); + temp = (u8)(temp1 >> 8); + i2c_write(CONFIG_SYS_I2C_DVI_ADDR, TOTAL_PIXELS_MSB_REG, 1, &temp, 1); + + /* Set total lines */ + temp2 = videomode->vsync_len + videomode->upper_margin + + videomode->yres + videomode->lower_margin; + temp = (u8)(temp2 & 0xFF); + i2c_write(CONFIG_SYS_I2C_DVI_ADDR, TOTAL_LINES_LSB_REG, 1, &temp, 1); + temp = (u8)(temp2 >> 8); + i2c_write(CONFIG_SYS_I2C_DVI_ADDR, TOTAL_LINES_MSB_REG, 1, &temp, 1); + + /* Set vertical frequency in Hz */ + temp3 = temp1 * temp2; + temp3 = (PICOS2KHZ(videomode->pixclock) * 1000) / temp3; + temp1 = (u16)temp3 * 100; + temp = (u8)(temp1 & 0xFF); + i2c_write(CONFIG_SYS_I2C_DVI_ADDR, VERT_FREQ_LSB_REG, 1, &temp, 1); + temp = (u8)(temp1 >> 8); + i2c_write(CONFIG_SYS_I2C_DVI_ADDR, VERT_FREQ_MSB_REG, 1, &temp, 1); + + /* Set TPI input bus and pixel repetition data */ + temp = TPI_INBUS_CLOCK_RATIO_1 | TPI_INBUS_FULL_PIXEL_WIDE | + TPI_INBUS_RISING_EDGE; + i2c_write(CONFIG_SYS_I2C_DVI_ADDR, TPI_INBUS_FMT_REG, 1, &temp, 1); + + /* Set TPI AVI Input format data */ + temp = TPI_INPUT_CLR_DEPTH_8BIT | TPI_INPUT_VRANGE_EXPAN_AUTO | + TPI_INPUT_CLR_RGB; + i2c_write(CONFIG_SYS_I2C_DVI_ADDR, TPI_INPUT_FMT_REG, 1, &temp, 1); + + /* Set TPI AVI Output format data */ + temp = TPI_OUTPUT_CLR_DEPTH_8BIT | TPI_OUTPUT_VRANGE_COMPRE_AUTO | + TPI_OUTPUT_CLR_HDMI_RGB; + i2c_write(CONFIG_SYS_I2C_DVI_ADDR, TPI_OUTPUT_FMT_REG, 1, &temp, 1); + + /* Set TPI audio configuration write data */ + temp = TPI_AUDIO_PASS_BASIC; + i2c_write(CONFIG_SYS_I2C_DVI_ADDR, TPI_AUDIO_HANDING_REG, 1, &temp, 1); + + temp = TPI_AUDIO_INTF_I2S | TPI_AUDIO_INTF_NORMAL | + TPI_AUDIO_TYPE_PCM; + i2c_write(CONFIG_SYS_I2C_DVI_ADDR, TPI_AUDIO_INTF_REG, 1, &temp, 1); + + temp = TPI_AUDIO_SAMP_SIZE_16BIT | TPI_AUDIO_SAMP_FREQ_44K; + i2c_write(CONFIG_SYS_I2C_DVI_ADDR, TPI_AUDIO_FREQ_REG, 1, &temp, 1); + + return 0; +} diff --git a/board/freescale/common/dcu_sii9022a.h b/board/freescale/common/dcu_sii9022a.h new file mode 100644 index 0000000000..de76733b36 --- /dev/null +++ b/board/freescale/common/dcu_sii9022a.h @@ -0,0 +1,13 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __DCU_HDMI_SII9022A__ +#define __DCU_HDMI_SII9022A__ + +/* Programming of Silicon SII9022A connector HDMI Transmitter*/ +int dcu_set_dvi_encoder(struct fb_videomode *videomode); + +#endif diff --git a/board/freescale/corenet_ds/Kconfig b/board/freescale/corenet_ds/Kconfig index 8c3bd9c152..433f539d99 100644 --- a/board/freescale/corenet_ds/Kconfig +++ b/board/freescale/corenet_ds/Kconfig @@ -1,15 +1,12 @@ if TARGET_P3041DS config SYS_BOARD - string default "corenet_ds" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "P3041DS" endif @@ -17,15 +14,12 @@ endif if TARGET_P4080DS config SYS_BOARD - string default "corenet_ds" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "P4080DS" endif @@ -33,15 +27,12 @@ endif if TARGET_P5020DS config SYS_BOARD - string default "corenet_ds" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "P5020DS" endif @@ -49,15 +40,12 @@ endif if TARGET_P5040DS config SYS_BOARD - string default "corenet_ds" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "P5040DS" endif diff --git a/board/freescale/ls1021aqds/Kconfig b/board/freescale/ls1021aqds/Kconfig new file mode 100644 index 0000000000..3cee468a3d --- /dev/null +++ b/board/freescale/ls1021aqds/Kconfig @@ -0,0 +1,18 @@ +if TARGET_LS1021AQDS + +config SYS_CPU + default "armv7" + +config SYS_BOARD + default "ls1021aqds" + +config SYS_VENDOR + default "freescale" + +config SYS_SOC + default "ls102xa" + +config SYS_CONFIG_NAME + default "ls1021aqds" + +endif diff --git a/board/freescale/ls1021aqds/MAINTAINERS b/board/freescale/ls1021aqds/MAINTAINERS new file mode 100644 index 0000000000..021d82b74d --- /dev/null +++ b/board/freescale/ls1021aqds/MAINTAINERS @@ -0,0 +1,6 @@ +LS1021AQDS BOARD +M: Alison Wang <alison.wang@freescale.com> +S: Maintained +F: board/freescale/ls1021aqds/ +F: include/configs/ls1021aqds.h +F: configs/ls1021aqds_nor_defconfig diff --git a/board/freescale/ls1021aqds/Makefile b/board/freescale/ls1021aqds/Makefile new file mode 100644 index 0000000000..3b6903c83b --- /dev/null +++ b/board/freescale/ls1021aqds/Makefile @@ -0,0 +1,9 @@ +# +# Copyright 2014 Freescale Semiconductor, Inc. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += ls1021aqds.o +obj-y += ddr.o +obj-y += eth.o diff --git a/board/freescale/ls1021aqds/README b/board/freescale/ls1021aqds/README new file mode 100644 index 0000000000..c561776621 --- /dev/null +++ b/board/freescale/ls1021aqds/README @@ -0,0 +1,112 @@ +Overview +-------- +The LS1021AQDS is a Freescale reference board that hosts the LS1021A SoC. + +LS1021A SoC Overview +------------------ +The QorIQ LS1 family, which includes the LS1021A communications processor, +is built on Layerscape architecture, the industry's first software-aware, +core-agnostic networking architecture to offer unprecedented efficiency +and scale. + +A member of the value-performance tier, the QorIQ LS1021A processor provides +extensive integration and power efficiency for fanless, small form factor +enterprise networking applications. Incorporating dual ARM Cortex-A7 cores +running up to 1.0 GHz, the LS1021A processor delivers pre-silicon CoreMark +performance of over 6,000, as well as virtualization support, advanced +security features and the broadest array of high-speed interconnects and +optimized peripheral features ever offered in a sub-3 W processor. + +The QorIQ LS1021A processor features an integrated LCD controller, +CAN controller for implementing industrial protocols, DDR3L/4 running +up to 1600 MHz, integrated security engine and QUICC Engine, and ECC +protection on both L1 and L2 caches. The LS1021A processor is pin- and +software-compatible with the QorIQ LS1020A and LS1022A processors. + +The LS1021A SoC includes the following function and features: + + - ARM Cortex-A7 MPCore compliant with ARMv7-A architecture + - Dual high-preformance ARM Cortex-A7 cores, each core includes: + - 32 Kbyte L1 Instruction Cache and Data Cache for each core (ECC protection) + - 512 Kbyte shared coherent L2 Cache (with ECC protection) + - NEON Co-processor (per core) + - 40-bit physical addressing + - Vector floating-point support + - ARM Core-Link CCI-400 Cache Coherent Interconnect + - One DDR3L/DDR4 SDRAM memory controller with x8/x16/x32-bit configuration + supporting speeds up to 1600Mtps + - ECC and interleaving support + - VeTSEC Ethernet complex + - Up to 3x virtualized 10/100/1000 Ethernet controllers + - MII, RMII, RGMII, and SGMII support + - QoS, lossless flow control, and IEEE 1588 support + - 4-lane 6GHz SerDes + - High speed interconnect (4 SerDes lanes with are muxed for these protocol) + - Two PCI Express Gen2 controllers running at up to 5 GHz + - One Serial ATA 3.0 supporting 6 GT/s operation + - Two SGMII interfaces supporting 1000 Mbps + - Additional peripheral interfaces + - One high-speed USB 3.0 controller with integrated PHY and one high-speed + USB 2.00 controller with ULPI + - Integrated flash controller (IFC) with 16-bit interface + - Quad SPI NOR Flash + - One enhanced Secure digital host controller + - Display controller unit (DCU) 24-bit RGB (12-bit DDR pin interface) + - Ten UARTs comprised of two 16550 compliant DUARTs, and six low power + UARTs + - Three I2C controllers + - Eight FlexTimers four supporting PWM and four FlexCAN ports + - Four GPIO controllers supporting up to 109 general purpose I/O signals + - Integrated advanced audio block: + - Four synchronous audio interfaces (SAI) + - Sony/Philips Digital Interconnect Format (SPDIF) + - Asynchronous Sample Rate Converter (ASRC) + - Hardware based crypto offload engine + - IPSec forwarding at up to 1Gbps + - QorIQ Trust Architecture, Secure Boot, and ARM TrustZone supported + - Public key hardware accelerator + - True Random Number Generator (NIST Certified) + - Advanced Encryption Standard Accelerators (AESA) + - Data Encryption Standard Accelerators + - QUICC Engine ULite block + - Two universal communication controllers (TDM and HDLC) supporting 64 + multichannels, each running at 64 Kbps + - Support for 256 channels of HDLC + - QorIQ TrustArchitecture with Secure Boot, as well as ARM TrustZone supported + +LS1021AQDS board Overview +------------------------- + - DDR Controller + - Supports rates of up to 1600 MHz data-rate + - Supports one DDR3LP UDIMM, of single-, dual- types. + - IFC/Local Bus + - NAND flash: 512M 8-bit NAND flash + - NOR: 128MB 16-bit NOR Flash + - Ethernet + - Three on-board RGMII 10/100/1G ethernet ports. + - FPGA + - Clocks + - System and DDR clock (SYSCLK, DDRCLK) + - SERDES clocks + - Power Supplies + - SDHC + - SDHC/SDXC connector + - Other IO + - Two Serial ports + - Three I2C ports + +Memory map +----------- +The addresses in brackets are physical addresses. + +Start Address End Address Description Size +0x00_0000_0000 0x00_000F_FFFF Secure Boot ROM 1MB +0x00_0100_0000 0x00_0FFF_FFFF CCSRBAR 240MB +0x00_1000_0000 0x00_1000_FFFF OCRAM0 64KB +0x00_1001_0000 0x00_1001_FFFF OCRAM1 64KB +0x00_2000_0000 0x00_20FF_FFFF DCSR 16MB +0x00_4000_0000 0x00_5FFF_FFFF QSPI 512MB +0x00_6000_0000 0x00_67FF_FFFF IFC - NOR Flash 128MB +0x00_7E80_0000 0x00_7E80_FFFF IFC - NAND Flash 64KB +0x00_7FB0_0000 0x00_7FB0_0FFF IFC - FPGA 4KB +0x00_8000_0000 0x00_FFFF_FFFF DRAM1 2GB diff --git a/board/freescale/ls1021aqds/ddr.c b/board/freescale/ls1021aqds/ddr.c new file mode 100644 index 0000000000..679c654fb5 --- /dev/null +++ b/board/freescale/ls1021aqds/ddr.c @@ -0,0 +1,159 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <fsl_ddr_sdram.h> +#include <fsl_ddr_dimm_params.h> +#include "ddr.h" + +DECLARE_GLOBAL_DATA_PTR; + +void fsl_ddr_board_options(memctl_options_t *popts, + dimm_params_t *pdimm, + unsigned int ctrl_num) +{ + const struct board_specific_parameters *pbsp, *pbsp_highest = NULL; + ulong ddr_freq; + + if (ctrl_num > 3) { + printf("Not supported controller number %d\n", ctrl_num); + return; + } + if (!pdimm->n_ranks) + return; + + pbsp = udimms[0]; + + /* Get clk_adjust, wrlvl_start, wrlvl_ctl, according to the board ddr + * freqency and n_banks specified in board_specific_parameters table. + */ + ddr_freq = get_ddr_freq(0) / 1000000; + while (pbsp->datarate_mhz_high) { + if (pbsp->n_ranks == pdimm->n_ranks) { + if (ddr_freq <= pbsp->datarate_mhz_high) { + popts->clk_adjust = pbsp->clk_adjust; + popts->wrlvl_start = pbsp->wrlvl_start; + popts->wrlvl_ctl_2 = pbsp->wrlvl_ctl_2; + popts->wrlvl_ctl_3 = pbsp->wrlvl_ctl_3; + popts->cpo_override = pbsp->cpo_override; + popts->write_data_delay = + pbsp->write_data_delay; + goto found; + } + pbsp_highest = pbsp; + } + pbsp++; + } + + if (pbsp_highest) { + printf("Error: board specific timing not found for %lu MT/s\n", + ddr_freq); + printf("Trying to use the highest speed (%u) parameters\n", + pbsp_highest->datarate_mhz_high); + popts->clk_adjust = pbsp_highest->clk_adjust; + popts->wrlvl_start = pbsp_highest->wrlvl_start; + popts->wrlvl_ctl_2 = pbsp->wrlvl_ctl_2; + popts->wrlvl_ctl_3 = pbsp->wrlvl_ctl_3; + } else { + panic("DIMM is not supported by this board"); + } +found: + debug("Found timing match: n_ranks %d, data rate %d, rank_gb %d\n", + pbsp->n_ranks, pbsp->datarate_mhz_high, pbsp->rank_gb); + + /* force DDR bus width to 32 bits */ + popts->data_bus_width = 1; + popts->otf_burst_chop_en = 0; + popts->burst_length = DDR_BL8; + + /* + * Factors to consider for half-strength driver enable: + * - number of DIMMs installed + */ + popts->half_strength_driver_enable = 1; + /* + * Write leveling override + */ + popts->wrlvl_override = 1; + popts->wrlvl_sample = 0xf; + popts->cswl_override = DDR_CSWL_CS0; + + /* + * Rtt and Rtt_WR override + */ + popts->rtt_override = 0; + + /* Enable ZQ calibration */ + popts->zq_en = 1; + + /* DHC_EN =1, ODT = 75 Ohm */ + popts->ddr_cdr1 = DDR_CDR1_DHC_EN | DDR_CDR1_ODT(DDR_CDR_ODT_75ohm); + popts->ddr_cdr2 = DDR_CDR2_ODT(DDR_CDR_ODT_75ohm); +} + +#ifdef CONFIG_SYS_DDR_RAW_TIMING +dimm_params_t ddr_raw_timing = { + .n_ranks = 1, + .rank_density = 1073741824u, + .capacity = 1073741824u, + .primary_sdram_width = 32, + .ec_sdram_width = 0, + .registered_dimm = 0, + .mirrored_dimm = 0, + .n_row_addr = 15, + .n_col_addr = 10, + .n_banks_per_sdram_device = 8, + .edc_config = 0, + .burst_lengths_bitmask = 0x0c, + + .tckmin_x_ps = 1071, + .caslat_x = 0xfe << 4, /* 5,6,7,8 */ + .taa_ps = 13125, + .twr_ps = 15000, + .trcd_ps = 13125, + .trrd_ps = 7500, + .trp_ps = 13125, + .tras_ps = 37500, + .trc_ps = 50625, + .trfc_ps = 160000, + .twtr_ps = 7500, + .trtp_ps = 7500, + .refresh_rate_ps = 7800000, + .tfaw_ps = 37500, +}; + +int fsl_ddr_get_dimm_params(dimm_params_t *pdimm, + unsigned int controller_number, + unsigned int dimm_number) +{ + static const char dimm_model[] = "Fixed DDR on board"; + + if (((controller_number == 0) && (dimm_number == 0)) || + ((controller_number == 1) && (dimm_number == 0))) { + memcpy(pdimm, &ddr_raw_timing, sizeof(dimm_params_t)); + memset(pdimm->mpart, 0, sizeof(pdimm->mpart)); + memcpy(pdimm->mpart, dimm_model, sizeof(dimm_model) - 1); + } + + return 0; +} +#endif + +phys_size_t initdram(int board_type) +{ + phys_size_t dram_size; + + puts("Initializing DDR....using SPD\n"); + dram_size = fsl_ddr_sdram(); + + return dram_size; +} + +void dram_init_banksize(void) +{ + gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; + gd->bd->bi_dram[0].size = gd->ram_size; +} diff --git a/board/freescale/ls1021aqds/ddr.h b/board/freescale/ls1021aqds/ddr.h new file mode 100644 index 0000000000..16d87cbe82 --- /dev/null +++ b/board/freescale/ls1021aqds/ddr.h @@ -0,0 +1,49 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __DDR_H__ +#define __DDR_H__ +struct board_specific_parameters { + u32 n_ranks; + u32 datarate_mhz_high; + u32 rank_gb; + u32 clk_adjust; + u32 wrlvl_start; + u32 wrlvl_ctl_2; + u32 wrlvl_ctl_3; + u32 cpo_override; + u32 write_data_delay; + u32 force_2t; +}; + +/* + * These tables contain all valid speeds we want to override with board + * specific parameters. datarate_mhz_high values need to be in ascending order + * for each n_ranks group. + */ +static const struct board_specific_parameters udimm0[] = { + /* + * memory controller 0 + * num| hi| rank| clk| wrlvl | wrlvl | wrlvl | cpo |wrdata|2T + * ranks| mhz| GB |adjst| start | ctl2 | ctl3 | |delay | + */ + {1, 833, 1, 6, 8, 0x06060607, 0x08080807, 0x1f, 2, 0}, + {1, 1350, 1, 6, 8, 0x0708080A, 0x0A0B0C09, 0x1f, 2, 0}, + {1, 833, 2, 6, 8, 0x06060607, 0x08080807, 0x1f, 2, 0}, + {1, 1350, 2, 6, 8, 0x0708080A, 0x0A0B0C09, 0x1f, 2, 0}, + {2, 833, 4, 6, 8, 0x06060607, 0x08080807, 0x1f, 2, 0}, + {2, 1350, 4, 6, 8, 0x0708080A, 0x0A0B0C09, 0x1f, 2, 0}, + {2, 1350, 0, 6, 8, 0x0708080A, 0x0A0B0C09, 0x1f, 2, 0}, + {2, 1666, 4, 4, 0xa, 0x0B08090C, 0x0B0E0D0A, 0x1f, 2, 0}, + {2, 1666, 0, 4, 0xa, 0x0B08090C, 0x0B0E0D0A, 0x1f, 2, 0}, + {} +}; + +static const struct board_specific_parameters *udimms[] = { + udimm0, +}; + +#endif diff --git a/board/freescale/ls1021aqds/eth.c b/board/freescale/ls1021aqds/eth.c new file mode 100644 index 0000000000..be351befec --- /dev/null +++ b/board/freescale/ls1021aqds/eth.c @@ -0,0 +1,186 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + * + * This file handles the board muxing between the RGMII/SGMII PHYs on + * Freescale LS1021AQDS board. The RGMII PHYs are the three on-board 1Gb + * ports. The SGMII PHYs are provided by the standard Freescale four-port + * SGMII riser card. + * + * Muxing is handled via the PIXIS BRDCFG4 register. The EMI1 bits control + * muxing among the RGMII PHYs and the SGMII PHYs. The value for RGMII depends + * on which port is used. The value for SGMII depends on which slot the riser + * is inserted in. + */ + +#include <common.h> +#include <netdev.h> +#include <asm/arch/fsl_serdes.h> +#include <fsl_mdio.h> +#include <tsec.h> +#include <malloc.h> + +#include "../common/sgmii_riser.h" +#include "../common/qixis.h" + +#define EMI1_MASK 0x1f +#define EMI1_RGMII0 1 +#define EMI1_RGMII1 2 +#define EMI1_RGMII2 3 +#define EMI1_SGMII1 0x1c +#define EMI1_SGMII2 0x1d + +struct ls1021a_mdio { + struct mii_dev *realbus; +}; + +static void ls1021a_mux_mdio(int addr) +{ + u8 brdcfg4; + + brdcfg4 = QIXIS_READ(brdcfg[4]); + brdcfg4 &= EMI1_MASK; + + switch (addr) { + case EMI1_RGMII0: + brdcfg4 |= 0; + break; + case EMI1_RGMII1: + brdcfg4 |= 0x20; + break; + case EMI1_RGMII2: + brdcfg4 |= 0x40; + break; + case EMI1_SGMII1: + brdcfg4 |= 0x60; + break; + case EMI1_SGMII2: + brdcfg4 |= 0x80; + break; + default: + brdcfg4 |= 0xa0; + break; + } + + QIXIS_WRITE(brdcfg[4], brdcfg4); +} + +static int ls1021a_mdio_read(struct mii_dev *bus, int addr, int devad, + int regnum) +{ + struct ls1021a_mdio *priv = bus->priv; + + ls1021a_mux_mdio(addr); + + return priv->realbus->read(priv->realbus, addr, devad, regnum); +} + +static int ls1021a_mdio_write(struct mii_dev *bus, int addr, int devad, + int regnum, u16 value) +{ + struct ls1021a_mdio *priv = bus->priv; + + ls1021a_mux_mdio(addr); + + return priv->realbus->write(priv->realbus, addr, devad, regnum, value); +} + +static int ls1021a_mdio_reset(struct mii_dev *bus) +{ + struct ls1021a_mdio *priv = bus->priv; + + return priv->realbus->reset(priv->realbus); +} + +static int ls1021a_mdio_init(char *realbusname, char *fakebusname) +{ + struct ls1021a_mdio *lsmdio; + struct mii_dev *bus = mdio_alloc(); + + if (!bus) { + printf("Failed to allocate LS102xA MDIO bus\n"); + return -1; + } + + lsmdio = malloc(sizeof(*lsmdio)); + if (!lsmdio) { + printf("Failed to allocate LS102xA private data\n"); + free(bus); + return -1; + } + + bus->read = ls1021a_mdio_read; + bus->write = ls1021a_mdio_write; + bus->reset = ls1021a_mdio_reset; + sprintf(bus->name, fakebusname); + + lsmdio->realbus = miiphy_get_dev_by_name(realbusname); + + if (!lsmdio->realbus) { + printf("No bus with name %s\n", realbusname); + free(bus); + free(lsmdio); + return -1; + } + + bus->priv = lsmdio; + + return mdio_register(bus); +} + +int board_eth_init(bd_t *bis) +{ + struct fsl_pq_mdio_info mdio_info; + struct tsec_info_struct tsec_info[3]; + int num = 0; + +#ifdef CONFIG_TSEC1 + SET_STD_TSEC_INFO(tsec_info[num], 1); + if (is_serdes_configured(SGMII_TSEC1)) { + puts("eTSEC1 is in sgmii mode\n"); + tsec_info[num].flags |= TSEC_SGMII; + tsec_info[num].mii_devname = "LS1021A_SGMII_MDIO"; + } else { + tsec_info[num].mii_devname = "LS1021A_RGMII_MDIO"; + } + num++; +#endif +#ifdef CONFIG_TSEC2 + SET_STD_TSEC_INFO(tsec_info[num], 2); + if (is_serdes_configured(SGMII_TSEC2)) { + puts("eTSEC2 is in sgmii mode\n"); + tsec_info[num].flags |= TSEC_SGMII; + tsec_info[num].mii_devname = "LS1021A_SGMII_MDIO"; + } else { + tsec_info[num].mii_devname = "LS1021A_RGMII_MDIO"; + } + num++; +#endif +#ifdef CONFIG_TSEC3 + SET_STD_TSEC_INFO(tsec_info[num], 3); + tsec_info[num].mii_devname = "LS1021A_RGMII_MDIO"; + num++; +#endif + if (!num) { + printf("No TSECs initialized\n"); + return 0; + } + +#ifdef CONFIG_FSL_SGMII_RISER + fsl_sgmii_riser_init(tsec_info, num); +#endif + + mdio_info.regs = (struct tsec_mii_mng *)CONFIG_SYS_MDIO_BASE_ADDR; + mdio_info.name = DEFAULT_MII_NAME; + + fsl_pq_mdio_init(bis, &mdio_info); + + /* Register the virtual MDIO front-ends */ + ls1021a_mdio_init(DEFAULT_MII_NAME, "LS1021A_RGMII_MDIO"); + ls1021a_mdio_init(DEFAULT_MII_NAME, "LS1021A_SGMII_MDIO"); + + tsec_eth_init(bis, tsec_info, num); + + return pci_eth_init(bis); +} diff --git a/board/freescale/ls1021aqds/ls1021aqds.c b/board/freescale/ls1021aqds/ls1021aqds.c new file mode 100644 index 0000000000..12e83f7645 --- /dev/null +++ b/board/freescale/ls1021aqds/ls1021aqds.c @@ -0,0 +1,255 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <i2c.h> +#include <asm/io.h> +#include <asm/arch/immap_ls102xa.h> +#include <asm/arch/clock.h> +#include <asm/arch/fsl_serdes.h> +#include <mmc.h> +#include <fsl_esdhc.h> +#include <fsl_ifc.h> + +#include "../common/qixis.h" +#include "ls1021aqds_qixis.h" + +DECLARE_GLOBAL_DATA_PTR; + +enum { + MUX_TYPE_SD_PCI4, + MUX_TYPE_SD_PC_SA_SG_SG, + MUX_TYPE_SD_PC_SA_PC_SG, + MUX_TYPE_SD_PC_SG_SG, +}; + +int checkboard(void) +{ + char buf[64]; + u8 sw; + + puts("Board: LS1021AQDS\n"); + + sw = QIXIS_READ(brdcfg[0]); + sw = (sw & QIXIS_LBMAP_MASK) >> QIXIS_LBMAP_SHIFT; + + if (sw < 0x8) + printf("vBank: %d\n", sw); + else if (sw == 0x8) + puts("PromJet\n"); + else if (sw == 0x9) + puts("NAND\n"); + else if (sw == 0x15) + printf("IFCCard\n"); + else + printf("invalid setting of SW%u\n", QIXIS_LBMAP_SWITCH); + + printf("Sys ID:0x%02x, Sys Ver: 0x%02x\n", + QIXIS_READ(id), QIXIS_READ(arch)); + + printf("FPGA: v%d (%s), build %d\n", + (int)QIXIS_READ(scver), qixis_read_tag(buf), + (int)qixis_read_minor()); + + return 0; +} + +unsigned long get_board_sys_clk(void) +{ + u8 sysclk_conf = QIXIS_READ(brdcfg[1]); + + switch (sysclk_conf & 0x0f) { + case QIXIS_SYSCLK_64: + return 64000000; + case QIXIS_SYSCLK_83: + return 83333333; + case QIXIS_SYSCLK_100: + return 100000000; + case QIXIS_SYSCLK_125: + return 125000000; + case QIXIS_SYSCLK_133: + return 133333333; + case QIXIS_SYSCLK_150: + return 150000000; + case QIXIS_SYSCLK_160: + return 160000000; + case QIXIS_SYSCLK_166: + return 166666666; + } + return 66666666; +} + +unsigned long get_board_ddr_clk(void) +{ + u8 ddrclk_conf = QIXIS_READ(brdcfg[1]); + + switch ((ddrclk_conf & 0x30) >> 4) { + case QIXIS_DDRCLK_100: + return 100000000; + case QIXIS_DDRCLK_125: + return 125000000; + case QIXIS_DDRCLK_133: + return 133333333; + } + return 66666666; +} + +int dram_init(void) +{ + gd->ram_size = initdram(0); + + return 0; +} + +#ifdef CONFIG_FSL_ESDHC +struct fsl_esdhc_cfg esdhc_cfg[1] = { + {CONFIG_SYS_FSL_ESDHC_ADDR}, +}; + +int board_mmc_init(bd_t *bis) +{ + esdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK); + + return fsl_esdhc_initialize(bis, &esdhc_cfg[0]); +} +#endif + +int select_i2c_ch_pca9547(u8 ch) +{ + int ret; + + ret = i2c_write(I2C_MUX_PCA_ADDR_PRI, 0, 1, &ch, 1); + if (ret) { + puts("PCA: failed to select proper channel\n"); + return ret; + } + + return 0; +} + +int board_early_init_f(void) +{ + struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR; + struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR; + +#ifdef CONFIG_TSEC_ENET + out_be32(&scfg->scfgrevcr, SCFG_SCFGREVCR_REV); + out_be32(&scfg->etsecdmamcr, SCFG_ETSECDMAMCR_LE_BD_FR); + out_be32(&scfg->scfgrevcr, SCFG_SCFGREVCR_NOREV); +#endif + +#ifdef CONFIG_FSL_IFC + init_early_memctl_regs(); +#endif + + /* Workaround for the issue that DDR could not respond to + * barrier transaction which is generated by executing DSB/ISB + * instruction. Set CCI-400 control override register to + * terminate the barrier transaction. After DDR is initialized, + * allow barrier transaction to DDR again */ + out_le32(&cci->ctrl_ord, CCI400_CTRLORD_TERM_BARRIER); + + return 0; +} + +int config_board_mux(int ctrl_type) +{ + u8 reg12; + + reg12 = QIXIS_READ(brdcfg[12]); + + switch (ctrl_type) { + case MUX_TYPE_SD_PCI4: + reg12 = 0x38; + break; + case MUX_TYPE_SD_PC_SA_SG_SG: + reg12 = 0x01; + break; + case MUX_TYPE_SD_PC_SA_PC_SG: + reg12 = 0x01; + break; + case MUX_TYPE_SD_PC_SG_SG: + reg12 = 0x21; + break; + default: + printf("Wrong mux interface type\n"); + return -1; + } + + QIXIS_WRITE(brdcfg[12], reg12); + + return 0; +} + +int config_serdes_mux(void) +{ + struct ccsr_gur *gur = (struct ccsr_gur *)CONFIG_SYS_FSL_GUTS_ADDR; + u32 cfg; + + cfg = in_be32(&gur->rcwsr[4]) & RCWSR4_SRDS1_PRTCL_MASK; + cfg >>= RCWSR4_SRDS1_PRTCL_SHIFT; + + switch (cfg) { + case 0x0: + config_board_mux(MUX_TYPE_SD_PCI4); + break; + case 0x30: + config_board_mux(MUX_TYPE_SD_PC_SA_SG_SG); + break; + case 0x60: + config_board_mux(MUX_TYPE_SD_PC_SG_SG); + break; + case 0x70: + config_board_mux(MUX_TYPE_SD_PC_SA_PC_SG); + break; + default: + printf("SRDS1 prtcl:0x%x\n", cfg); + break; + } + + return 0; +} + +int board_init(void) +{ + struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR; + + /* Set CCI-400 control override register to + * enable barrier transaction */ + out_le32(&cci->ctrl_ord, CCI400_CTRLORD_EN_BARRIER); + + select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT); + +#ifndef CONFIG_SYS_FSL_NO_SERDES + fsl_serdes_init(); + config_serdes_mux(); +#endif + return 0; +} + +void ft_board_setup(void *blob, bd_t *bd) +{ + ft_cpu_setup(blob, bd); +} + +u8 flash_read8(void *addr) +{ + return __raw_readb(addr + 1); +} + +void flash_write16(u16 val, void *addr) +{ + u16 shftval = (((val >> 8) & 0xff) | ((val << 8) & 0xff00)); + + __raw_writew(shftval, addr); +} + +u16 flash_read16(void *addr) +{ + u16 val = __raw_readw(addr); + + return (((val) >> 8) & 0x00ff) | (((val) << 8) & 0xff00); +} diff --git a/board/freescale/ls1021aqds/ls1021aqds_qixis.h b/board/freescale/ls1021aqds/ls1021aqds_qixis.h new file mode 100644 index 0000000000..09b3be2f9c --- /dev/null +++ b/board/freescale/ls1021aqds/ls1021aqds_qixis.h @@ -0,0 +1,35 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __LS1021AQDS_QIXIS_H__ +#define __LS1021AQDS_QIXIS_H__ + +/* Definitions of QIXIS Registers for LS1021AQDS */ + +/* BRDCFG4[4:7]] select EC1 and EC2 as a pair */ +#define BRDCFG4_EMISEL_MASK 0xe0 +#define BRDCFG4_EMISEL_SHIFT 5 + +/* SYSCLK */ +#define QIXIS_SYSCLK_66 0x0 +#define QIXIS_SYSCLK_83 0x1 +#define QIXIS_SYSCLK_100 0x2 +#define QIXIS_SYSCLK_125 0x3 +#define QIXIS_SYSCLK_133 0x4 +#define QIXIS_SYSCLK_150 0x5 +#define QIXIS_SYSCLK_160 0x6 +#define QIXIS_SYSCLK_166 0x7 +#define QIXIS_SYSCLK_64 0x8 + +/* DDRCLK */ +#define QIXIS_DDRCLK_66 0x0 +#define QIXIS_DDRCLK_100 0x1 +#define QIXIS_DDRCLK_125 0x2 +#define QIXIS_DDRCLK_133 0x3 + +#define QIXIS_SRDS1CLK_100 0x0 + +#endif diff --git a/board/freescale/ls1021atwr/Kconfig b/board/freescale/ls1021atwr/Kconfig new file mode 100644 index 0000000000..312f9388fc --- /dev/null +++ b/board/freescale/ls1021atwr/Kconfig @@ -0,0 +1,18 @@ +if TARGET_LS1021ATWR + +config SYS_CPU + default "armv7" + +config SYS_BOARD + default "ls1021atwr" + +config SYS_VENDOR + default "freescale" + +config SYS_SOC + default "ls102xa" + +config SYS_CONFIG_NAME + default "ls1021atwr" + +endif diff --git a/board/freescale/ls1021atwr/MAINTAINERS b/board/freescale/ls1021atwr/MAINTAINERS new file mode 100644 index 0000000000..4e5bc15a0d --- /dev/null +++ b/board/freescale/ls1021atwr/MAINTAINERS @@ -0,0 +1,6 @@ +LS1021ATWR BOARD +M: Alison Wang <alison.wang@freescale.com> +S: Maintained +F: board/freescale/ls1021atwr/ +F: include/configs/ls1021atwr.h +F: configs/ls1021atwr_nor_defconfig diff --git a/board/freescale/ls1021atwr/Makefile b/board/freescale/ls1021atwr/Makefile new file mode 100644 index 0000000000..01296c04b2 --- /dev/null +++ b/board/freescale/ls1021atwr/Makefile @@ -0,0 +1,8 @@ +# +# Copyright 2014 Freescale Semiconductor, Inc. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += ls1021atwr.o +obj-$(CONFIG_FSL_DCU_FB) += dcu.o diff --git a/board/freescale/ls1021atwr/README b/board/freescale/ls1021atwr/README new file mode 100644 index 0000000000..d2821cbb6b --- /dev/null +++ b/board/freescale/ls1021atwr/README @@ -0,0 +1,109 @@ +Overview +-------- +The LS1021ATWR is a Freescale reference board that hosts the LS1021A SoC. + +LS1021A SoC Overview +------------------ +The QorIQ LS1 family, which includes the LS1021A communications processor, +is built on Layerscape architecture, the industry's first software-aware, +core-agnostic networking architecture to offer unprecedented efficiency +and scale. + +A member of the value-performance tier, the QorIQ LS1021A processor provides +extensive integration and power efficiency for fanless, small form factor +enterprise networking applications. Incorporating dual ARM Cortex-A7 cores +running up to 1.0 GHz, the LS1021A processor delivers pre-silicon CoreMark +performance of over 6,000, as well as virtualization support, advanced +security features and the broadest array of high-speed interconnects and +optimized peripheral features ever offered in a sub-3 W processor. + +The QorIQ LS1021A processor features an integrated LCD controller, +CAN controller for implementing industrial protocols, DDR3L/4 running +up to 1600 MHz, integrated security engine and QUICC Engine, and ECC +protection on both L1 and L2 caches. The LS1021A processor is pin- and +software-compatible with the QorIQ LS1020A and LS1022A processors. + +The LS1021A SoC includes the following function and features: + + - ARM Cortex-A7 MPCore compliant with ARMv7-A architecture + - Dual high-preformance ARM Cortex-A7 cores, each core includes: + - 32 Kbyte L1 Instruction Cache and Data Cache for each core (ECC protection) + - 512 Kbyte shared coherent L2 Cache (with ECC protection) + - NEON Co-processor (per core) + - 40-bit physical addressing + - Vector floating-point support + - ARM Core-Link CCI-400 Cache Coherent Interconnect + - One DDR3L/DDR4 SDRAM memory controller with x8/x16/x32-bit configuration + supporting speeds up to 1600Mtps + - ECC and interleaving support + - VeTSEC Ethernet complex + - Up to 3x virtualized 10/100/1000 Ethernet controllers + - MII, RMII, RGMII, and SGMII support + - QoS, lossless flow control, and IEEE 1588 support + - 4-lane 6GHz SerDes + - High speed interconnect (4 SerDes lanes with are muxed for these protocol) + - Two PCI Express Gen2 controllers running at up to 5 GHz + - One Serial ATA 3.0 supporting 6 GT/s operation + - Two SGMII interfaces supporting 1000 Mbps + - Additional peripheral interfaces + - One high-speed USB 3.0 controller with integrated PHY and one high-speed + USB 2.00 controller with ULPI + - Integrated flash controller (IFC) with 16-bit interface + - Quad SPI NOR Flash + - One enhanced Secure digital host controller + - Display controller unit (DCU) 24-bit RGB (12-bit DDR pin interface) + - Ten UARTs comprised of two 16550 compliant DUARTs, and six low power + UARTs + - Three I2C controllers + - Eight FlexTimers four supporting PWM and four FlexCAN ports + - Four GPIO controllers supporting up to 109 general purpose I/O signals + - Integrated advanced audio block: + - Four synchronous audio interfaces (SAI) + - Sony/Philips Digital Interconnect Format (SPDIF) + - Asynchronous Sample Rate Converter (ASRC) + - Hardware based crypto offload engine + - IPSec forwarding at up to 1Gbps + - QorIQ Trust Architecture, Secure Boot, and ARM TrustZone supported + - Public key hardware accelerator + - True Random Number Generator (NIST Certified) + - Advanced Encryption Standard Accelerators (AESA) + - Data Encryption Standard Accelerators + - QUICC Engine ULite block + - Two universal communication controllers (TDM and HDLC) supporting 64 + multichannels, each running at 64 Kbps + - Support for 256 channels of HDLC + - QorIQ TrustArchitecture with Secure Boot, as well as ARM TrustZone supported + +LS1021ATWR board Overview +------------------------- + - DDR Controller + - Supports rates of up to 1600 MHz data-rate + - Supports one DDR3LP SDRAM. + - IFC/Local Bus + - NOR: 128MB 16-bit NOR Flash + - Ethernet + - Three on-board RGMII 10/100/1G ethernet ports. + - CPLD + - Clocks + - System and DDR clock (SYSCLK, DDRCLK) + - SERDES clocks + - Power Supplies + - SDHC + - SDHC/SDXC connector + - Other IO + - One Serial port + - Three I2C ports + +Memory map +----------- +The addresses in brackets are physical addresses. + +Start Address End Address Description Size +0x00_0000_0000 0x00_000F_FFFF Secure Boot ROM 1MB +0x00_0100_0000 0x00_0FFF_FFFF CCSRBAR 240MB +0x00_1000_0000 0x00_1000_FFFF OCRAM0 64KB +0x00_1001_0000 0x00_1001_FFFF OCRAM1 64KB +0x00_2000_0000 0x00_20FF_FFFF DCSR 16MB +0x00_4000_0000 0x00_5FFF_FFFF QSPI 512MB +0x00_6000_0000 0x00_67FF_FFFF IFC - NOR Flash 128MB +0x00_8000_0000 0x00_FFFF_FFFF DRAM1 2GB diff --git a/board/freescale/ls1021atwr/dcu.c b/board/freescale/ls1021atwr/dcu.c new file mode 100644 index 0000000000..8fe4ccbeb4 --- /dev/null +++ b/board/freescale/ls1021atwr/dcu.c @@ -0,0 +1,47 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * FSL DCU Framebuffer driver + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <fsl_dcu_fb.h> +#include "div64.h" +#include "../common/dcu_sii9022a.h" + +DECLARE_GLOBAL_DATA_PTR; + +unsigned int dcu_set_pixel_clock(unsigned int pixclock) +{ + unsigned long long div; + + div = (unsigned long long)(gd->bus_clk / 1000); + div *= (unsigned long long)pixclock; + do_div(div, 1000000000); + + return div; +} + +int platform_dcu_init(unsigned int xres, unsigned int yres, + const char *port, + struct fb_videomode *dcu_fb_videomode) +{ + const char *name; + unsigned int pixel_format; + + if (strncmp(port, "twr_lcd", 4) == 0) { + name = "TWR_LCD_RGB card"; + } else { + name = "HDMI"; + dcu_set_dvi_encoder(dcu_fb_videomode); + } + + printf("DCU: Switching to %s monitor @ %ux%u\n", name, xres, yres); + + pixel_format = 32; + fsl_dcu_init(xres, yres, pixel_format); + + return 0; +} diff --git a/board/freescale/ls1021atwr/ls1021atwr.c b/board/freescale/ls1021atwr/ls1021atwr.c new file mode 100644 index 0000000000..b522ff28e5 --- /dev/null +++ b/board/freescale/ls1021atwr/ls1021atwr.c @@ -0,0 +1,488 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <i2c.h> +#include <asm/io.h> +#include <asm/arch/immap_ls102xa.h> +#include <asm/arch/clock.h> +#include <asm/arch/fsl_serdes.h> +#include <mmc.h> +#include <fsl_esdhc.h> +#include <fsl_ifc.h> +#include <netdev.h> +#include <fsl_mdio.h> +#include <tsec.h> + +DECLARE_GLOBAL_DATA_PTR; + +#define VERSION_MASK 0x00FF +#define BANK_MASK 0x0001 +#define CONFIG_RESET 0x1 +#define INIT_RESET 0x1 + +#define CPLD_SET_MUX_SERDES 0x20 +#define CPLD_SET_BOOT_BANK 0x40 + +#define BOOT_FROM_UPPER_BANK 0x0 +#define BOOT_FROM_LOWER_BANK 0x1 + +#define LANEB_SATA (0x01) +#define LANEB_SGMII1 (0x02) +#define LANEC_SGMII1 (0x04) +#define LANEC_PCIEX1 (0x08) +#define LANED_PCIEX2 (0x10) +#define LANED_SGMII2 (0x20) + +#define MASK_LANE_B 0x1 +#define MASK_LANE_C 0x2 +#define MASK_LANE_D 0x4 +#define MASK_SGMII 0x8 + +#define KEEP_STATUS 0x0 +#define NEED_RESET 0x1 + +struct cpld_data { + u8 cpld_ver; /* cpld revision */ + u8 cpld_ver_sub; /* cpld sub revision */ + u8 pcba_ver; /* pcb revision number */ + u8 system_rst; /* reset system by cpld */ + u8 soft_mux_on; /* CPLD override physical switches Enable */ + u8 cfg_rcw_src1; /* Reset config word 1 */ + u8 cfg_rcw_src2; /* Reset config word 2 */ + u8 vbank; /* Flash bank selection Control */ + u8 gpio; /* GPIO for TWR-ELEV */ + u8 i2c3_ifc_mux; + u8 mux_spi2; + u8 can3_usb2_mux; /* CAN3 and USB2 Selection */ + u8 qe_lcd_mux; /* QE and LCD Selection */ + u8 serdes_mux; /* Multiplexed pins for SerDes Lanes */ + u8 global_rst; /* reset with init CPLD reg to default */ + u8 rev1; /* Reserved */ + u8 rev2; /* Reserved */ +}; + +static void convert_serdes_mux(int type, int need_reset); + +void cpld_show(void) +{ + struct cpld_data *cpld_data = (void *)(CONFIG_SYS_CPLD_BASE); + + printf("CPLD: V%x.%x\nPCBA: V%x.0\nVBank: %d\n", + in_8(&cpld_data->cpld_ver) & VERSION_MASK, + in_8(&cpld_data->cpld_ver_sub) & VERSION_MASK, + in_8(&cpld_data->pcba_ver) & VERSION_MASK, + in_8(&cpld_data->vbank) & BANK_MASK); + +#ifdef CONFIG_DEBUG + printf("soft_mux_on =%x\n", + in_8(&cpld_data->soft_mux_on)); + printf("cfg_rcw_src1 =%x\n", + in_8(&cpld_data->cfg_rcw_src1)); + printf("cfg_rcw_src2 =%x\n", + in_8(&cpld_data->cfg_rcw_src2)); + printf("vbank =%x\n", + in_8(&cpld_data->vbank)); + printf("gpio =%x\n", + in_8(&cpld_data->gpio)); + printf("i2c3_ifc_mux =%x\n", + in_8(&cpld_data->i2c3_ifc_mux)); + printf("mux_spi2 =%x\n", + in_8(&cpld_data->mux_spi2)); + printf("can3_usb2_mux =%x\n", + in_8(&cpld_data->can3_usb2_mux)); + printf("qe_lcd_mux =%x\n", + in_8(&cpld_data->qe_lcd_mux)); + printf("serdes_mux =%x\n", + in_8(&cpld_data->serdes_mux)); +#endif +} + +int checkboard(void) +{ + puts("Board: LS1021ATWR\n"); + cpld_show(); + + return 0; +} + +void ddrmc_init(void) +{ + struct ccsr_ddr *ddr = (struct ccsr_ddr *)CONFIG_SYS_FSL_DDR_ADDR; + + out_be32(&ddr->sdram_cfg, DDR_SDRAM_CFG); + + out_be32(&ddr->cs0_bnds, DDR_CS0_BNDS); + out_be32(&ddr->cs0_config, DDR_CS0_CONFIG); + + out_be32(&ddr->timing_cfg_0, DDR_TIMING_CFG_0); + out_be32(&ddr->timing_cfg_1, DDR_TIMING_CFG_1); + out_be32(&ddr->timing_cfg_2, DDR_TIMING_CFG_2); + out_be32(&ddr->timing_cfg_3, DDR_TIMING_CFG_3); + out_be32(&ddr->timing_cfg_4, DDR_TIMING_CFG_4); + out_be32(&ddr->timing_cfg_5, DDR_TIMING_CFG_5); + + out_be32(&ddr->sdram_cfg_2, DDR_SDRAM_CFG_2); + + out_be32(&ddr->sdram_mode, DDR_SDRAM_MODE); + out_be32(&ddr->sdram_mode_2, DDR_SDRAM_MODE_2); + + out_be32(&ddr->sdram_interval, DDR_SDRAM_INTERVAL); + + out_be32(&ddr->ddr_wrlvl_cntl, DDR_DDR_WRLVL_CNTL); + + out_be32(&ddr->ddr_wrlvl_cntl_2, DDR_DDR_WRLVL_CNTL_2); + out_be32(&ddr->ddr_wrlvl_cntl_3, DDR_DDR_WRLVL_CNTL_3); + + out_be32(&ddr->ddr_cdr1, DDR_DDR_CDR1); + out_be32(&ddr->ddr_cdr2, DDR_DDR_CDR2); + + out_be32(&ddr->sdram_clk_cntl, DDR_SDRAM_CLK_CNTL); + out_be32(&ddr->ddr_zq_cntl, DDR_DDR_ZQ_CNTL); + + out_be32(&ddr->cs0_config_2, DDR_CS0_CONFIG_2); + udelay(1); + out_be32(&ddr->sdram_cfg, DDR_SDRAM_CFG | DDR_SDRAM_CFG_MEM_EN); +} + +int dram_init(void) +{ +#if (!defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD)) + ddrmc_init(); +#endif + + gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE); + return 0; +} + +#ifdef CONFIG_FSL_ESDHC +struct fsl_esdhc_cfg esdhc_cfg[1] = { + {CONFIG_SYS_FSL_ESDHC_ADDR}, +}; + +int board_mmc_init(bd_t *bis) +{ + esdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK); + + return fsl_esdhc_initialize(bis, &esdhc_cfg[0]); +} +#endif + +#ifdef CONFIG_TSEC_ENET +int board_eth_init(bd_t *bis) +{ + struct fsl_pq_mdio_info mdio_info; + struct tsec_info_struct tsec_info[4]; + int num = 0; + +#ifdef CONFIG_TSEC1 + SET_STD_TSEC_INFO(tsec_info[num], 1); + if (is_serdes_configured(SGMII_TSEC1)) { + puts("eTSEC1 is in sgmii mode.\n"); + tsec_info[num].flags |= TSEC_SGMII; + } + num++; +#endif +#ifdef CONFIG_TSEC2 + SET_STD_TSEC_INFO(tsec_info[num], 2); + if (is_serdes_configured(SGMII_TSEC2)) { + puts("eTSEC2 is in sgmii mode.\n"); + tsec_info[num].flags |= TSEC_SGMII; + } + num++; +#endif +#ifdef CONFIG_TSEC3 + SET_STD_TSEC_INFO(tsec_info[num], 3); + num++; +#endif + if (!num) { + printf("No TSECs initialized\n"); + return 0; + } + + mdio_info.regs = (struct tsec_mii_mng *)CONFIG_SYS_MDIO_BASE_ADDR; + mdio_info.name = DEFAULT_MII_NAME; + fsl_pq_mdio_init(bis, &mdio_info); + + tsec_eth_init(bis, tsec_info, num); + + return pci_eth_init(bis); +} +#endif + +int config_serdes_mux(void) +{ + struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR); + u32 protocol = in_be32(&gur->rcwsr[4]) & RCWSR4_SRDS1_PRTCL_MASK; + + protocol >>= RCWSR4_SRDS1_PRTCL_SHIFT; + switch (protocol) { + case 0x10: + convert_serdes_mux(LANEB_SATA, KEEP_STATUS); + convert_serdes_mux(LANED_PCIEX2 | + LANEC_PCIEX1, KEEP_STATUS); + break; + case 0x20: + convert_serdes_mux(LANEB_SGMII1, KEEP_STATUS); + convert_serdes_mux(LANEC_PCIEX1, KEEP_STATUS); + convert_serdes_mux(LANED_SGMII2, KEEP_STATUS); + break; + case 0x30: + convert_serdes_mux(LANEB_SATA, KEEP_STATUS); + convert_serdes_mux(LANEC_SGMII1, KEEP_STATUS); + convert_serdes_mux(LANED_SGMII2, KEEP_STATUS); + break; + case 0x70: + convert_serdes_mux(LANEB_SATA, KEEP_STATUS); + convert_serdes_mux(LANEC_PCIEX1, KEEP_STATUS); + convert_serdes_mux(LANED_SGMII2, KEEP_STATUS); + break; + } + + return 0; +} + +int board_early_init_f(void) +{ + struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR; + +#ifdef CONFIG_TSEC_ENET + out_be32(&scfg->scfgrevcr, SCFG_SCFGREVCR_REV); + out_be32(&scfg->etsecdmamcr, SCFG_ETSECDMAMCR_LE_BD_FR); + out_be32(&scfg->etsecmcr, SCFG_ETSECCMCR_GE2_CLK125); + udelay(10); + out_be32(&scfg->scfgrevcr, SCFG_SCFGREVCR_NOREV); +#endif + +#ifdef CONFIG_FSL_IFC + init_early_memctl_regs(); +#endif + +#ifdef CONFIG_FSL_DCU_FB + out_be32(&scfg->scfgrevcr, SCFG_SCFGREVCR_REV); + out_be32(&scfg->pixclkcr, SCFG_PIXCLKCR_PXCKEN); + out_be32(&scfg->scfgrevcr, SCFG_SCFGREVCR_NOREV); +#endif + + return 0; +} + +int board_init(void) +{ +#ifndef CONFIG_SYS_FSL_NO_SERDES + fsl_serdes_init(); + config_serdes_mux(); +#endif + + return 0; +} + +void ft_board_setup(void *blob, bd_t *bd) +{ + ft_cpu_setup(blob, bd); +} + +u8 flash_read8(void *addr) +{ + return __raw_readb(addr + 1); +} + +void flash_write16(u16 val, void *addr) +{ + u16 shftval = (((val >> 8) & 0xff) | ((val << 8) & 0xff00)); + + __raw_writew(shftval, addr); +} + +u16 flash_read16(void *addr) +{ + u16 val = __raw_readw(addr); + + return (((val) >> 8) & 0x00ff) | (((val) << 8) & 0xff00); +} + +static void convert_flash_bank(char bank) +{ + struct cpld_data *cpld_data = (void *)(CONFIG_SYS_CPLD_BASE); + + printf("Now switch to boot from flash bank %d.\n", bank); + cpld_data->soft_mux_on = CPLD_SET_BOOT_BANK; + cpld_data->vbank = bank; + + printf("Reset board to enable configuration.\n"); + cpld_data->system_rst = CONFIG_RESET; +} + +static int flash_bank_cmd(cmd_tbl_t *cmdtp, int flag, int argc, + char * const argv[]) +{ + if (argc != 2) + return CMD_RET_USAGE; + if (strcmp(argv[1], "0") == 0) + convert_flash_bank(BOOT_FROM_UPPER_BANK); + else if (strcmp(argv[1], "1") == 0) + convert_flash_bank(BOOT_FROM_LOWER_BANK); + else + return CMD_RET_USAGE; + + return 0; +} + +U_BOOT_CMD( + boot_bank, 2, 0, flash_bank_cmd, + "Flash bank Selection Control", + "bank[0-upper bank/1-lower bank] (e.g. boot_bank 0)" +); + +static int cpld_reset_cmd(cmd_tbl_t *cmdtp, int flag, int argc, + char * const argv[]) +{ + struct cpld_data *cpld_data = (void *)(CONFIG_SYS_CPLD_BASE); + + if (argc > 2) + return CMD_RET_USAGE; + if ((argc == 1) || (strcmp(argv[1], "conf") == 0)) + cpld_data->system_rst = CONFIG_RESET; + else if (strcmp(argv[1], "init") == 0) + cpld_data->global_rst = INIT_RESET; + else + return CMD_RET_USAGE; + + return 0; +} + +U_BOOT_CMD( + cpld_reset, 2, 0, cpld_reset_cmd, + "Reset via CPLD", + "conf\n" + " -reset with current CPLD configuration\n" + "init\n" + " -reset and initial CPLD configuration with default value" + +); + +static void convert_serdes_mux(int type, int need_reset) +{ + char current_serdes; + struct cpld_data *cpld_data = (void *)(CONFIG_SYS_CPLD_BASE); + + current_serdes = cpld_data->serdes_mux; + + switch (type) { + case LANEB_SATA: + current_serdes &= ~MASK_LANE_B; + break; + case LANEB_SGMII1: + current_serdes |= (MASK_LANE_B | MASK_SGMII | MASK_LANE_C); + break; + case LANEC_SGMII1: + current_serdes &= ~(MASK_LANE_B | MASK_SGMII | MASK_LANE_C); + break; + case LANED_SGMII2: + current_serdes |= MASK_LANE_D; + break; + case LANEC_PCIEX1: + current_serdes |= MASK_LANE_C; + break; + case (LANED_PCIEX2 | LANEC_PCIEX1): + current_serdes |= MASK_LANE_C; + current_serdes &= ~MASK_LANE_D; + break; + default: + printf("CPLD serdes MUX: unsupported MUX type 0x%x\n", type); + return; + } + + cpld_data->soft_mux_on |= CPLD_SET_MUX_SERDES; + cpld_data->serdes_mux = current_serdes; + + if (need_reset == 1) { + printf("Reset board to enable configuration\n"); + cpld_data->system_rst = CONFIG_RESET; + } +} + +void print_serdes_mux(void) +{ + char current_serdes; + struct cpld_data *cpld_data = (void *)(CONFIG_SYS_CPLD_BASE); + + current_serdes = cpld_data->serdes_mux; + + printf("Serdes Lane B: "); + if ((current_serdes & MASK_LANE_B) == 0) + printf("SATA,\n"); + else + printf("SGMII 1,\n"); + + printf("Serdes Lane C: "); + if ((current_serdes & MASK_LANE_C) == 0) + printf("SGMII 1,\n"); + else + printf("PCIe,\n"); + + printf("Serdes Lane D: "); + if ((current_serdes & MASK_LANE_D) == 0) + printf("PCIe,\n"); + else + printf("SGMII 2,\n"); + + printf("SGMII 1 is on lane "); + if ((current_serdes & MASK_SGMII) == 0) + printf("C.\n"); + else + printf("B.\n"); +} + +static int serdes_mux_cmd(cmd_tbl_t *cmdtp, int flag, int argc, + char * const argv[]) +{ + if (argc != 2) + return CMD_RET_USAGE; + if (strcmp(argv[1], "sata") == 0) { + printf("Set serdes lane B to SATA.\n"); + convert_serdes_mux(LANEB_SATA, NEED_RESET); + } else if (strcmp(argv[1], "sgmii1b") == 0) { + printf("Set serdes lane B to SGMII 1.\n"); + convert_serdes_mux(LANEB_SGMII1, NEED_RESET); + } else if (strcmp(argv[1], "sgmii1c") == 0) { + printf("Set serdes lane C to SGMII 1.\n"); + convert_serdes_mux(LANEC_SGMII1, NEED_RESET); + } else if (strcmp(argv[1], "sgmii2") == 0) { + printf("Set serdes lane D to SGMII 2.\n"); + convert_serdes_mux(LANED_SGMII2, NEED_RESET); + } else if (strcmp(argv[1], "pciex1") == 0) { + printf("Set serdes lane C to PCIe X1.\n"); + convert_serdes_mux(LANEC_PCIEX1, NEED_RESET); + } else if (strcmp(argv[1], "pciex2") == 0) { + printf("Set serdes lane C & lane D to PCIe X2.\n"); + convert_serdes_mux((LANED_PCIEX2 | LANEC_PCIEX1), NEED_RESET); + } else if (strcmp(argv[1], "show") == 0) { + print_serdes_mux(); + } else { + return CMD_RET_USAGE; + } + + return 0; +} + +U_BOOT_CMD( + lane_bank, 2, 0, serdes_mux_cmd, + "Multiplexed function setting for SerDes Lanes", + "sata\n" + " -change lane B to sata\n" + "lane_bank sgmii1b\n" + " -change lane B to SGMII1\n" + "lane_bank sgmii1c\n" + " -change lane C to SGMII1\n" + "lane_bank sgmii2\n" + " -change lane D to SGMII2\n" + "lane_bank pciex1\n" + " -change lane C to PCIeX1\n" + "lane_bank pciex2\n" + " -change lane C & lane D to PCIeX2\n" + "\nWARNING: If you aren't familiar with the setting of serdes, don't try to change anything!\n" +); diff --git a/board/freescale/ls2085a/Kconfig b/board/freescale/ls2085a/Kconfig index 5655e186c4..f51afc8234 100644 --- a/board/freescale/ls2085a/Kconfig +++ b/board/freescale/ls2085a/Kconfig @@ -1,47 +1,31 @@ if TARGET_LS2085A_EMU -config SYS_CPU - string - default "armv8" - config SYS_BOARD - string default "ls2085a" config SYS_VENDOR - string default "freescale" config SYS_SOC - string default "fsl-lsch3" config SYS_CONFIG_NAME - string default "ls2085a_emu" endif if TARGET_LS2085A_SIMU -config SYS_CPU - string - default "armv8" - config SYS_BOARD - string default "ls2085a" config SYS_VENDOR - string default "freescale" config SYS_SOC - string default "fsl-lsch3" config SYS_CONFIG_NAME - string default "ls2085a_simu" endif diff --git a/board/freescale/m5208evbe/Kconfig b/board/freescale/m5208evbe/Kconfig index 9b1fa42865..9b416afbdc 100644 --- a/board/freescale/m5208evbe/Kconfig +++ b/board/freescale/m5208evbe/Kconfig @@ -1,19 +1,15 @@ if TARGET_M5208EVBE config SYS_CPU - string default "mcf52x2" config SYS_BOARD - string default "m5208evbe" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "M5208EVBE" endif diff --git a/board/freescale/m52277evb/Kconfig b/board/freescale/m52277evb/Kconfig index 54a86e4f4a..c4278926a4 100644 --- a/board/freescale/m52277evb/Kconfig +++ b/board/freescale/m52277evb/Kconfig @@ -1,19 +1,15 @@ if TARGET_M52277EVB config SYS_CPU - string default "mcf5227x" config SYS_BOARD - string default "m52277evb" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "M52277EVB" endif diff --git a/board/freescale/m5235evb/Kconfig b/board/freescale/m5235evb/Kconfig index f996ca2bd1..fc8341999a 100644 --- a/board/freescale/m5235evb/Kconfig +++ b/board/freescale/m5235evb/Kconfig @@ -1,19 +1,15 @@ if TARGET_M5235EVB config SYS_CPU - string default "mcf523x" config SYS_BOARD - string default "m5235evb" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "M5235EVB" endif diff --git a/board/freescale/m5249evb/Kconfig b/board/freescale/m5249evb/Kconfig index 87643e4457..0f624776b5 100644 --- a/board/freescale/m5249evb/Kconfig +++ b/board/freescale/m5249evb/Kconfig @@ -1,19 +1,15 @@ if TARGET_M5249EVB config SYS_CPU - string default "mcf52x2" config SYS_BOARD - string default "m5249evb" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "M5249EVB" endif diff --git a/board/freescale/m5253demo/Kconfig b/board/freescale/m5253demo/Kconfig index 76197a74a5..303d29bc23 100644 --- a/board/freescale/m5253demo/Kconfig +++ b/board/freescale/m5253demo/Kconfig @@ -1,19 +1,15 @@ if TARGET_M5253DEMO config SYS_CPU - string default "mcf52x2" config SYS_BOARD - string default "m5253demo" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "M5253DEMO" endif diff --git a/board/freescale/m5253evbe/Kconfig b/board/freescale/m5253evbe/Kconfig index bdc6c27e9d..d97b87c4ca 100644 --- a/board/freescale/m5253evbe/Kconfig +++ b/board/freescale/m5253evbe/Kconfig @@ -1,19 +1,15 @@ if TARGET_M5253EVBE config SYS_CPU - string default "mcf52x2" config SYS_BOARD - string default "m5253evbe" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "M5253EVBE" endif diff --git a/board/freescale/m5272c3/Kconfig b/board/freescale/m5272c3/Kconfig index b69c37af2a..aee0b239b3 100644 --- a/board/freescale/m5272c3/Kconfig +++ b/board/freescale/m5272c3/Kconfig @@ -1,19 +1,15 @@ if TARGET_M5272C3 config SYS_CPU - string default "mcf52x2" config SYS_BOARD - string default "m5272c3" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "M5272C3" endif diff --git a/board/freescale/m5275evb/Kconfig b/board/freescale/m5275evb/Kconfig index 85514b7775..5a6de9c1c9 100644 --- a/board/freescale/m5275evb/Kconfig +++ b/board/freescale/m5275evb/Kconfig @@ -1,19 +1,15 @@ if TARGET_M5275EVB config SYS_CPU - string default "mcf52x2" config SYS_BOARD - string default "m5275evb" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "M5275EVB" endif diff --git a/board/freescale/m5282evb/Kconfig b/board/freescale/m5282evb/Kconfig index 33e98a7c52..2ffdd528f6 100644 --- a/board/freescale/m5282evb/Kconfig +++ b/board/freescale/m5282evb/Kconfig @@ -1,19 +1,15 @@ if TARGET_M5282EVB config SYS_CPU - string default "mcf52x2" config SYS_BOARD - string default "m5282evb" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "M5282EVB" endif diff --git a/board/freescale/m53017evb/Kconfig b/board/freescale/m53017evb/Kconfig index 99ffd7db64..8ab89e52b2 100644 --- a/board/freescale/m53017evb/Kconfig +++ b/board/freescale/m53017evb/Kconfig @@ -1,19 +1,15 @@ if TARGET_M53017EVB config SYS_CPU - string default "mcf532x" config SYS_BOARD - string default "m53017evb" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "M53017EVB" endif diff --git a/board/freescale/m5329evb/Kconfig b/board/freescale/m5329evb/Kconfig index c9a621ad48..930fbba246 100644 --- a/board/freescale/m5329evb/Kconfig +++ b/board/freescale/m5329evb/Kconfig @@ -1,19 +1,15 @@ if TARGET_M5329EVB config SYS_CPU - string default "mcf532x" config SYS_BOARD - string default "m5329evb" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "M5329EVB" endif diff --git a/board/freescale/m5373evb/Kconfig b/board/freescale/m5373evb/Kconfig index 583a4b5c77..67d049d79e 100644 --- a/board/freescale/m5373evb/Kconfig +++ b/board/freescale/m5373evb/Kconfig @@ -1,19 +1,15 @@ if TARGET_M5373EVB config SYS_CPU - string default "mcf532x" config SYS_BOARD - string default "m5373evb" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "M5373EVB" endif diff --git a/board/freescale/m54418twr/Kconfig b/board/freescale/m54418twr/Kconfig index 7d73b945f2..4199a3f549 100644 --- a/board/freescale/m54418twr/Kconfig +++ b/board/freescale/m54418twr/Kconfig @@ -1,19 +1,15 @@ if TARGET_M54418TWR config SYS_CPU - string default "mcf5445x" config SYS_BOARD - string default "m54418twr" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "M54418TWR" endif diff --git a/board/freescale/m54451evb/Kconfig b/board/freescale/m54451evb/Kconfig index 814db72d98..f460e51c9b 100644 --- a/board/freescale/m54451evb/Kconfig +++ b/board/freescale/m54451evb/Kconfig @@ -1,19 +1,15 @@ if TARGET_M54451EVB config SYS_CPU - string default "mcf5445x" config SYS_BOARD - string default "m54451evb" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "M54451EVB" endif diff --git a/board/freescale/m54455evb/Kconfig b/board/freescale/m54455evb/Kconfig index acdd13f096..096bce8312 100644 --- a/board/freescale/m54455evb/Kconfig +++ b/board/freescale/m54455evb/Kconfig @@ -1,19 +1,15 @@ if TARGET_M54455EVB config SYS_CPU - string default "mcf5445x" config SYS_BOARD - string default "m54455evb" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "M54455EVB" endif diff --git a/board/freescale/m547xevb/Kconfig b/board/freescale/m547xevb/Kconfig index d21072e2ef..8cfe20ab8d 100644 --- a/board/freescale/m547xevb/Kconfig +++ b/board/freescale/m547xevb/Kconfig @@ -1,19 +1,15 @@ if TARGET_M5475EVB config SYS_CPU - string default "mcf547x_8x" config SYS_BOARD - string default "m547xevb" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "M5475EVB" endif diff --git a/board/freescale/m548xevb/Kconfig b/board/freescale/m548xevb/Kconfig index 2afe11c41a..da924e3ce9 100644 --- a/board/freescale/m548xevb/Kconfig +++ b/board/freescale/m548xevb/Kconfig @@ -1,19 +1,15 @@ if TARGET_M5485EVB config SYS_CPU - string default "mcf547x_8x" config SYS_BOARD - string default "m548xevb" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "M5485EVB" endif diff --git a/board/freescale/mpc5121ads/Kconfig b/board/freescale/mpc5121ads/Kconfig index 9989ccbbc5..f125f9e596 100644 --- a/board/freescale/mpc5121ads/Kconfig +++ b/board/freescale/mpc5121ads/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC5121ADS config SYS_BOARD - string default "mpc5121ads" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "mpc5121ads" endif diff --git a/board/freescale/mpc7448hpc2/Kconfig b/board/freescale/mpc7448hpc2/Kconfig index 0ea712ccf1..3e7f6e8d2e 100644 --- a/board/freescale/mpc7448hpc2/Kconfig +++ b/board/freescale/mpc7448hpc2/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC7448HPC2 config SYS_BOARD - string default "mpc7448hpc2" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "mpc7448hpc2" endif diff --git a/board/freescale/mpc8266ads/Kconfig b/board/freescale/mpc8266ads/Kconfig index 7c5a646434..78963b9c32 100644 --- a/board/freescale/mpc8266ads/Kconfig +++ b/board/freescale/mpc8266ads/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC8266ADS config SYS_BOARD - string default "mpc8266ads" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "MPC8266ADS" endif diff --git a/board/freescale/mpc8308rdb/Kconfig b/board/freescale/mpc8308rdb/Kconfig index b47765a0a2..48d25e5a26 100644 --- a/board/freescale/mpc8308rdb/Kconfig +++ b/board/freescale/mpc8308rdb/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC8308RDB config SYS_BOARD - string default "mpc8308rdb" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "MPC8308RDB" endif diff --git a/board/freescale/mpc8313erdb/Kconfig b/board/freescale/mpc8313erdb/Kconfig index 078f437c5a..145608feab 100644 --- a/board/freescale/mpc8313erdb/Kconfig +++ b/board/freescale/mpc8313erdb/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC8313ERDB config SYS_BOARD - string default "mpc8313erdb" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "MPC8313ERDB" endif diff --git a/board/freescale/mpc8315erdb/Kconfig b/board/freescale/mpc8315erdb/Kconfig index 46833ca0df..f76b0d1d6d 100644 --- a/board/freescale/mpc8315erdb/Kconfig +++ b/board/freescale/mpc8315erdb/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC8315ERDB config SYS_BOARD - string default "mpc8315erdb" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "MPC8315ERDB" endif diff --git a/board/freescale/mpc8323erdb/Kconfig b/board/freescale/mpc8323erdb/Kconfig index a1c0a610a4..acf8122196 100644 --- a/board/freescale/mpc8323erdb/Kconfig +++ b/board/freescale/mpc8323erdb/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC8323ERDB config SYS_BOARD - string default "mpc8323erdb" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "MPC8323ERDB" endif diff --git a/board/freescale/mpc832xemds/Kconfig b/board/freescale/mpc832xemds/Kconfig index 83af2c2782..e4cfa15a6f 100644 --- a/board/freescale/mpc832xemds/Kconfig +++ b/board/freescale/mpc832xemds/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC832XEMDS config SYS_BOARD - string default "mpc832xemds" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "MPC832XEMDS" endif diff --git a/board/freescale/mpc8349emds/Kconfig b/board/freescale/mpc8349emds/Kconfig index 8f549dc73a..51f0b34f39 100644 --- a/board/freescale/mpc8349emds/Kconfig +++ b/board/freescale/mpc8349emds/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC8349EMDS config SYS_BOARD - string default "mpc8349emds" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "MPC8349EMDS" endif diff --git a/board/freescale/mpc8349itx/Kconfig b/board/freescale/mpc8349itx/Kconfig index af3fedd97b..ce3fffda7d 100644 --- a/board/freescale/mpc8349itx/Kconfig +++ b/board/freescale/mpc8349itx/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC8349ITX config SYS_BOARD - string default "mpc8349itx" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "MPC8349ITX" endif diff --git a/board/freescale/mpc8360emds/Kconfig b/board/freescale/mpc8360emds/Kconfig index d6e7766362..3f4f95cac2 100644 --- a/board/freescale/mpc8360emds/Kconfig +++ b/board/freescale/mpc8360emds/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC8360EMDS config SYS_BOARD - string default "mpc8360emds" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "MPC8360EMDS" endif diff --git a/board/freescale/mpc8360emds/mpc8360emds.c b/board/freescale/mpc8360emds/mpc8360emds.c index ac96163aa4..5ff9dff587 100644 --- a/board/freescale/mpc8360emds/mpc8360emds.c +++ b/board/freescale/mpc8360emds/mpc8360emds.c @@ -11,13 +11,13 @@ #include <i2c.h> #include <miiphy.h> #include <phy.h> +#include <fsl_mdio.h> #if defined(CONFIG_PCI) #include <pci.h> #endif #include <spd_sdram.h> #include <asm/mmu.h> #include <asm/io.h> -#include <asm/fsl_enet.h> #include <asm/mmu.h> #if defined(CONFIG_OF_LIBFDT) #include <libfdt.h> diff --git a/board/freescale/mpc8360erdk/Kconfig b/board/freescale/mpc8360erdk/Kconfig index bfb3b1f44d..5c9be7c9c1 100644 --- a/board/freescale/mpc8360erdk/Kconfig +++ b/board/freescale/mpc8360erdk/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC8360ERDK config SYS_BOARD - string default "mpc8360erdk" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "MPC8360ERDK" endif diff --git a/board/freescale/mpc837xemds/Kconfig b/board/freescale/mpc837xemds/Kconfig index b0357cb5fb..20d29db099 100644 --- a/board/freescale/mpc837xemds/Kconfig +++ b/board/freescale/mpc837xemds/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC837XEMDS config SYS_BOARD - string default "mpc837xemds" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "MPC837XEMDS" endif diff --git a/board/freescale/mpc837xemds/mpc837xemds.c b/board/freescale/mpc837xemds/mpc837xemds.c index 0a3c9720d6..c749e5553a 100644 --- a/board/freescale/mpc837xemds/mpc837xemds.c +++ b/board/freescale/mpc837xemds/mpc837xemds.c @@ -10,7 +10,6 @@ #include <i2c.h> #include <asm/io.h> #include <asm/fsl_mpc83xx_serdes.h> -#include <asm/fsl_enet.h> #include <spd_sdram.h> #include <tsec.h> #include <libfdt.h> diff --git a/board/freescale/mpc837xerdb/Kconfig b/board/freescale/mpc837xerdb/Kconfig index f8e33e6d27..03415f9fc9 100644 --- a/board/freescale/mpc837xerdb/Kconfig +++ b/board/freescale/mpc837xerdb/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC837XERDB config SYS_BOARD - string default "mpc837xerdb" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "MPC837XERDB" endif diff --git a/board/freescale/mpc8536ds/Kconfig b/board/freescale/mpc8536ds/Kconfig index c7c818cde0..1a6a9d4598 100644 --- a/board/freescale/mpc8536ds/Kconfig +++ b/board/freescale/mpc8536ds/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC8536DS config SYS_BOARD - string default "mpc8536ds" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "MPC8536DS" endif diff --git a/board/freescale/mpc8540ads/Kconfig b/board/freescale/mpc8540ads/Kconfig index 2cf252c44c..35a8545547 100644 --- a/board/freescale/mpc8540ads/Kconfig +++ b/board/freescale/mpc8540ads/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC8540ADS config SYS_BOARD - string default "mpc8540ads" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "MPC8540ADS" endif diff --git a/board/freescale/mpc8541cds/Kconfig b/board/freescale/mpc8541cds/Kconfig index 2beefc2dc1..034eab2544 100644 --- a/board/freescale/mpc8541cds/Kconfig +++ b/board/freescale/mpc8541cds/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC8541CDS config SYS_BOARD - string default "mpc8541cds" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "MPC8541CDS" endif diff --git a/board/freescale/mpc8544ds/Kconfig b/board/freescale/mpc8544ds/Kconfig index d55b6802b8..c3e25b89a0 100644 --- a/board/freescale/mpc8544ds/Kconfig +++ b/board/freescale/mpc8544ds/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC8544DS config SYS_BOARD - string default "mpc8544ds" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "MPC8544DS" endif diff --git a/board/freescale/mpc8548cds/Kconfig b/board/freescale/mpc8548cds/Kconfig index 69d717ef92..09f3b0b766 100644 --- a/board/freescale/mpc8548cds/Kconfig +++ b/board/freescale/mpc8548cds/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC8548CDS config SYS_BOARD - string default "mpc8548cds" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "MPC8548CDS" endif diff --git a/board/freescale/mpc8555cds/Kconfig b/board/freescale/mpc8555cds/Kconfig index 585830884b..04bd572212 100644 --- a/board/freescale/mpc8555cds/Kconfig +++ b/board/freescale/mpc8555cds/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC8555CDS config SYS_BOARD - string default "mpc8555cds" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "MPC8555CDS" endif diff --git a/board/freescale/mpc8560ads/Kconfig b/board/freescale/mpc8560ads/Kconfig index 55cdb62137..828c068e9e 100644 --- a/board/freescale/mpc8560ads/Kconfig +++ b/board/freescale/mpc8560ads/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC8560ADS config SYS_BOARD - string default "mpc8560ads" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "MPC8560ADS" endif diff --git a/board/freescale/mpc8568mds/Kconfig b/board/freescale/mpc8568mds/Kconfig index b02946b151..4e178c5039 100644 --- a/board/freescale/mpc8568mds/Kconfig +++ b/board/freescale/mpc8568mds/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC8568MDS config SYS_BOARD - string default "mpc8568mds" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "MPC8568MDS" endif diff --git a/board/freescale/mpc8569mds/Kconfig b/board/freescale/mpc8569mds/Kconfig index f13a07eb03..48718575ff 100644 --- a/board/freescale/mpc8569mds/Kconfig +++ b/board/freescale/mpc8569mds/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC8569MDS config SYS_BOARD - string default "mpc8569mds" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "MPC8569MDS" endif diff --git a/board/freescale/mpc8572ds/Kconfig b/board/freescale/mpc8572ds/Kconfig index 3794f036a2..38132cf3fe 100644 --- a/board/freescale/mpc8572ds/Kconfig +++ b/board/freescale/mpc8572ds/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC8572DS config SYS_BOARD - string default "mpc8572ds" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "MPC8572DS" endif diff --git a/board/freescale/mpc8610hpcd/Kconfig b/board/freescale/mpc8610hpcd/Kconfig index 463a433aef..8f713beaa8 100644 --- a/board/freescale/mpc8610hpcd/Kconfig +++ b/board/freescale/mpc8610hpcd/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC8610HPCD config SYS_BOARD - string default "mpc8610hpcd" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "MPC8610HPCD" endif diff --git a/board/freescale/mpc8641hpcn/Kconfig b/board/freescale/mpc8641hpcn/Kconfig index 9fc4241149..ae45d63337 100644 --- a/board/freescale/mpc8641hpcn/Kconfig +++ b/board/freescale/mpc8641hpcn/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPC8641HPCN config SYS_BOARD - string default "mpc8641hpcn" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "MPC8641HPCN" endif diff --git a/board/freescale/mx23evk/Kconfig b/board/freescale/mx23evk/Kconfig index ee7911ca35..1bbbe2d5f5 100644 --- a/board/freescale/mx23evk/Kconfig +++ b/board/freescale/mx23evk/Kconfig @@ -1,23 +1,18 @@ if TARGET_MX23EVK config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "mx23evk" config SYS_VENDOR - string default "freescale" config SYS_SOC - string default "mxs" config SYS_CONFIG_NAME - string default "mx23evk" endif diff --git a/board/freescale/mx25pdk/Kconfig b/board/freescale/mx25pdk/Kconfig index 67cb5ecb14..a693239701 100644 --- a/board/freescale/mx25pdk/Kconfig +++ b/board/freescale/mx25pdk/Kconfig @@ -1,23 +1,18 @@ if TARGET_MX25PDK config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "mx25pdk" config SYS_VENDOR - string default "freescale" config SYS_SOC - string default "mx25" config SYS_CONFIG_NAME - string default "mx25pdk" endif diff --git a/board/freescale/mx28evk/Kconfig b/board/freescale/mx28evk/Kconfig index 2fe6f327ca..cc654bcfa5 100644 --- a/board/freescale/mx28evk/Kconfig +++ b/board/freescale/mx28evk/Kconfig @@ -1,23 +1,18 @@ if TARGET_MX28EVK config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "mx28evk" config SYS_VENDOR - string default "freescale" config SYS_SOC - string default "mxs" config SYS_CONFIG_NAME - string default "mx28evk" endif diff --git a/board/freescale/mx31ads/Kconfig b/board/freescale/mx31ads/Kconfig index 96116dd254..b4ea64b405 100644 --- a/board/freescale/mx31ads/Kconfig +++ b/board/freescale/mx31ads/Kconfig @@ -1,23 +1,18 @@ if TARGET_MX31ADS config SYS_CPU - string default "arm1136" config SYS_BOARD - string default "mx31ads" config SYS_VENDOR - string default "freescale" config SYS_SOC - string default "mx31" config SYS_CONFIG_NAME - string default "mx31ads" endif diff --git a/board/freescale/mx31pdk/Kconfig b/board/freescale/mx31pdk/Kconfig index 6ac6a59e6d..68c3880638 100644 --- a/board/freescale/mx31pdk/Kconfig +++ b/board/freescale/mx31pdk/Kconfig @@ -1,23 +1,18 @@ if TARGET_MX31PDK config SYS_CPU - string default "arm1136" config SYS_BOARD - string default "mx31pdk" config SYS_VENDOR - string default "freescale" config SYS_SOC - string default "mx31" config SYS_CONFIG_NAME - string default "mx31pdk" endif diff --git a/board/freescale/mx35pdk/Kconfig b/board/freescale/mx35pdk/Kconfig index 5555b0ba37..ca5b40f07d 100644 --- a/board/freescale/mx35pdk/Kconfig +++ b/board/freescale/mx35pdk/Kconfig @@ -1,23 +1,18 @@ if TARGET_MX35PDK config SYS_CPU - string default "arm1136" config SYS_BOARD - string default "mx35pdk" config SYS_VENDOR - string default "freescale" config SYS_SOC - string default "mx35" config SYS_CONFIG_NAME - string default "mx35pdk" endif diff --git a/board/freescale/mx51evk/Kconfig b/board/freescale/mx51evk/Kconfig index a6dbbdd2ae..07861a9706 100644 --- a/board/freescale/mx51evk/Kconfig +++ b/board/freescale/mx51evk/Kconfig @@ -1,23 +1,18 @@ if TARGET_MX51EVK config SYS_CPU - string default "armv7" config SYS_BOARD - string default "mx51evk" config SYS_VENDOR - string default "freescale" config SYS_SOC - string default "mx5" config SYS_CONFIG_NAME - string default "mx51evk" endif diff --git a/board/freescale/mx53ard/Kconfig b/board/freescale/mx53ard/Kconfig index eaaa1b2a0c..566df85985 100644 --- a/board/freescale/mx53ard/Kconfig +++ b/board/freescale/mx53ard/Kconfig @@ -1,23 +1,18 @@ if TARGET_MX53ARD config SYS_CPU - string default "armv7" config SYS_BOARD - string default "mx53ard" config SYS_VENDOR - string default "freescale" config SYS_SOC - string default "mx5" config SYS_CONFIG_NAME - string default "mx53ard" endif diff --git a/board/freescale/mx53evk/Kconfig b/board/freescale/mx53evk/Kconfig index dda1ada32b..d064b104dc 100644 --- a/board/freescale/mx53evk/Kconfig +++ b/board/freescale/mx53evk/Kconfig @@ -1,23 +1,18 @@ if TARGET_MX53EVK config SYS_CPU - string default "armv7" config SYS_BOARD - string default "mx53evk" config SYS_VENDOR - string default "freescale" config SYS_SOC - string default "mx5" config SYS_CONFIG_NAME - string default "mx53evk" endif diff --git a/board/freescale/mx53loco/Kconfig b/board/freescale/mx53loco/Kconfig index 8b285d28a8..bc44e59bfc 100644 --- a/board/freescale/mx53loco/Kconfig +++ b/board/freescale/mx53loco/Kconfig @@ -1,23 +1,18 @@ if TARGET_MX53LOCO config SYS_CPU - string default "armv7" config SYS_BOARD - string default "mx53loco" config SYS_VENDOR - string default "freescale" config SYS_SOC - string default "mx5" config SYS_CONFIG_NAME - string default "mx53loco" endif diff --git a/board/freescale/mx53smd/Kconfig b/board/freescale/mx53smd/Kconfig index 1f7e42f9f3..62c37d4e0c 100644 --- a/board/freescale/mx53smd/Kconfig +++ b/board/freescale/mx53smd/Kconfig @@ -1,23 +1,18 @@ if TARGET_MX53SMD config SYS_CPU - string default "armv7" config SYS_BOARD - string default "mx53smd" config SYS_VENDOR - string default "freescale" config SYS_SOC - string default "mx5" config SYS_CONFIG_NAME - string default "mx53smd" endif diff --git a/board/freescale/mx6qarm2/Kconfig b/board/freescale/mx6qarm2/Kconfig index 2c42e9aeab..f7f18db9fc 100644 --- a/board/freescale/mx6qarm2/Kconfig +++ b/board/freescale/mx6qarm2/Kconfig @@ -1,23 +1,18 @@ if TARGET_MX6QARM2 config SYS_CPU - string default "armv7" config SYS_BOARD - string default "mx6qarm2" config SYS_VENDOR - string default "freescale" config SYS_SOC - string default "mx6" config SYS_CONFIG_NAME - string default "mx6qarm2" endif diff --git a/board/freescale/mx6qsabreauto/Kconfig b/board/freescale/mx6qsabreauto/Kconfig index 21fb4fc4bb..d0cf355bc1 100644 --- a/board/freescale/mx6qsabreauto/Kconfig +++ b/board/freescale/mx6qsabreauto/Kconfig @@ -1,23 +1,18 @@ if TARGET_MX6QSABREAUTO config SYS_CPU - string default "armv7" config SYS_BOARD - string default "mx6qsabreauto" config SYS_VENDOR - string default "freescale" config SYS_SOC - string default "mx6" config SYS_CONFIG_NAME - string default "mx6qsabreauto" endif diff --git a/board/freescale/mx6sabresd/Kconfig b/board/freescale/mx6sabresd/Kconfig index 65d67368a0..15b65c09f1 100644 --- a/board/freescale/mx6sabresd/Kconfig +++ b/board/freescale/mx6sabresd/Kconfig @@ -1,23 +1,18 @@ if TARGET_MX6SABRESD config SYS_CPU - string default "armv7" config SYS_BOARD - string default "mx6sabresd" config SYS_VENDOR - string default "freescale" config SYS_SOC - string default "mx6" config SYS_CONFIG_NAME - string default "mx6sabresd" endif diff --git a/board/freescale/mx6slevk/Kconfig b/board/freescale/mx6slevk/Kconfig index 23c31545e0..558aeab0e3 100644 --- a/board/freescale/mx6slevk/Kconfig +++ b/board/freescale/mx6slevk/Kconfig @@ -1,23 +1,18 @@ if TARGET_MX6SLEVK config SYS_CPU - string default "armv7" config SYS_BOARD - string default "mx6slevk" config SYS_VENDOR - string default "freescale" config SYS_SOC - string default "mx6" config SYS_CONFIG_NAME - string default "mx6slevk" endif diff --git a/board/freescale/mx6sxsabresd/Kconfig b/board/freescale/mx6sxsabresd/Kconfig index ee8f4a63ef..2a86b68afc 100644 --- a/board/freescale/mx6sxsabresd/Kconfig +++ b/board/freescale/mx6sxsabresd/Kconfig @@ -1,23 +1,18 @@ if TARGET_MX6SXSABRESD config SYS_CPU - string default "armv7" config SYS_BOARD - string default "mx6sxsabresd" config SYS_VENDOR - string default "freescale" config SYS_SOC - string default "mx6" config SYS_CONFIG_NAME - string default "mx6sxsabresd" endif diff --git a/board/freescale/p1010rdb/Kconfig b/board/freescale/p1010rdb/Kconfig index 2abe1c09b2..b0a7a8d9df 100644 --- a/board/freescale/p1010rdb/Kconfig +++ b/board/freescale/p1010rdb/Kconfig @@ -1,15 +1,12 @@ if TARGET_P1010RDB config SYS_BOARD - string default "p1010rdb" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "P1010RDB" endif diff --git a/board/freescale/p1022ds/Kconfig b/board/freescale/p1022ds/Kconfig index 39e37bdda8..f1792de8e3 100644 --- a/board/freescale/p1022ds/Kconfig +++ b/board/freescale/p1022ds/Kconfig @@ -1,15 +1,12 @@ if TARGET_P1022DS config SYS_BOARD - string default "p1022ds" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "P1022DS" endif diff --git a/board/freescale/p1023rdb/Kconfig b/board/freescale/p1023rdb/Kconfig index 95d329562a..1e4cd10c6c 100644 --- a/board/freescale/p1023rdb/Kconfig +++ b/board/freescale/p1023rdb/Kconfig @@ -1,15 +1,12 @@ if TARGET_P1023RDB config SYS_BOARD - string default "p1023rdb" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "P1023RDB" endif diff --git a/board/freescale/p1_p2_rdb/Kconfig b/board/freescale/p1_p2_rdb/Kconfig index 6d718b94f8..d7ad35d403 100644 --- a/board/freescale/p1_p2_rdb/Kconfig +++ b/board/freescale/p1_p2_rdb/Kconfig @@ -1,15 +1,12 @@ if TARGET_P1_P2_RDB config SYS_BOARD - string default "p1_p2_rdb" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "P1_P2_RDB" endif diff --git a/board/freescale/p1_p2_rdb_pc/Kconfig b/board/freescale/p1_p2_rdb_pc/Kconfig index 01b89fa048..d3352d2856 100644 --- a/board/freescale/p1_p2_rdb_pc/Kconfig +++ b/board/freescale/p1_p2_rdb_pc/Kconfig @@ -1,15 +1,12 @@ if TARGET_P1_P2_RDB_PC config SYS_BOARD - string default "p1_p2_rdb_pc" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "p1_p2_rdb_pc" endif diff --git a/board/freescale/p1_twr/Kconfig b/board/freescale/p1_twr/Kconfig index 5fb47053c3..8f9a8d4415 100644 --- a/board/freescale/p1_twr/Kconfig +++ b/board/freescale/p1_twr/Kconfig @@ -1,15 +1,12 @@ if TARGET_P1_TWR config SYS_BOARD - string default "p1_twr" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "p1_twr" endif diff --git a/board/freescale/p2020come/Kconfig b/board/freescale/p2020come/Kconfig index d4d7e13d59..8ce5cf1300 100644 --- a/board/freescale/p2020come/Kconfig +++ b/board/freescale/p2020come/Kconfig @@ -1,15 +1,12 @@ if TARGET_P2020COME config SYS_BOARD - string default "p2020come" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "P2020COME" endif diff --git a/board/freescale/p2020ds/Kconfig b/board/freescale/p2020ds/Kconfig index 29031d0d99..e527ec9722 100644 --- a/board/freescale/p2020ds/Kconfig +++ b/board/freescale/p2020ds/Kconfig @@ -1,15 +1,12 @@ if TARGET_P2020DS config SYS_BOARD - string default "p2020ds" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "P2020DS" endif diff --git a/board/freescale/p2041rdb/Kconfig b/board/freescale/p2041rdb/Kconfig index b086b1b922..78e11214a5 100644 --- a/board/freescale/p2041rdb/Kconfig +++ b/board/freescale/p2041rdb/Kconfig @@ -1,15 +1,12 @@ if TARGET_P2041RDB config SYS_BOARD - string default "p2041rdb" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "P2041RDB" endif diff --git a/board/freescale/qemu-ppce500/Kconfig b/board/freescale/qemu-ppce500/Kconfig index 314f6a1576..236cd17f99 100644 --- a/board/freescale/qemu-ppce500/Kconfig +++ b/board/freescale/qemu-ppce500/Kconfig @@ -1,15 +1,12 @@ if TARGET_QEMU_PPCE500 config SYS_BOARD - string default "qemu-ppce500" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "qemu-ppce500" endif diff --git a/board/freescale/t1040qds/Kconfig b/board/freescale/t1040qds/Kconfig index c1c96f03a1..1bb1684011 100644 --- a/board/freescale/t1040qds/Kconfig +++ b/board/freescale/t1040qds/Kconfig @@ -1,15 +1,12 @@ if TARGET_T1040QDS config SYS_BOARD - string default "t1040qds" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "T1040QDS" endif diff --git a/board/freescale/t104xrdb/Kconfig b/board/freescale/t104xrdb/Kconfig index d0fd3de0c4..f28728d33d 100644 --- a/board/freescale/t104xrdb/Kconfig +++ b/board/freescale/t104xrdb/Kconfig @@ -1,15 +1,12 @@ if TARGET_T104XRDB config SYS_BOARD - string default "t104xrdb" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "T104xRDB" endif diff --git a/board/freescale/t208xqds/Kconfig b/board/freescale/t208xqds/Kconfig index 3d0c6ab88b..4e329dddf3 100644 --- a/board/freescale/t208xqds/Kconfig +++ b/board/freescale/t208xqds/Kconfig @@ -1,15 +1,12 @@ if TARGET_T208XQDS config SYS_BOARD - string default "t208xqds" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "T208xQDS" endif diff --git a/board/freescale/t208xrdb/Kconfig b/board/freescale/t208xrdb/Kconfig index f8d2c3cf1d..845af3dd2f 100644 --- a/board/freescale/t208xrdb/Kconfig +++ b/board/freescale/t208xrdb/Kconfig @@ -1,15 +1,12 @@ if TARGET_T208XRDB config SYS_BOARD - string default "t208xrdb" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "T208xRDB" endif diff --git a/board/freescale/t4qds/Kconfig b/board/freescale/t4qds/Kconfig index f4b0ba2322..ab34b9ef4c 100644 --- a/board/freescale/t4qds/Kconfig +++ b/board/freescale/t4qds/Kconfig @@ -1,15 +1,12 @@ if TARGET_T4240EMU config SYS_BOARD - string default "t4qds" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "T4240EMU" endif @@ -17,15 +14,12 @@ endif if TARGET_T4240QDS config SYS_BOARD - string default "t4qds" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "T4240QDS" endif diff --git a/board/freescale/t4rdb/Kconfig b/board/freescale/t4rdb/Kconfig index 07e3c0df0e..d93e4532ac 100644 --- a/board/freescale/t4rdb/Kconfig +++ b/board/freescale/t4rdb/Kconfig @@ -1,15 +1,12 @@ if TARGET_T4240RDB config SYS_BOARD - string default "t4rdb" config SYS_VENDOR - string default "freescale" config SYS_CONFIG_NAME - string default "T4240RDB" endif diff --git a/board/freescale/vf610twr/Kconfig b/board/freescale/vf610twr/Kconfig index 56bc52ad5c..684ef279c3 100644 --- a/board/freescale/vf610twr/Kconfig +++ b/board/freescale/vf610twr/Kconfig @@ -1,23 +1,18 @@ if TARGET_VF610TWR config SYS_CPU - string default "armv7" config SYS_BOARD - string default "vf610twr" config SYS_VENDOR - string default "freescale" config SYS_SOC - string default "vf610" config SYS_CONFIG_NAME - string default "vf610twr" endif diff --git a/board/funkwerk/vovpn-gw/Kconfig b/board/funkwerk/vovpn-gw/Kconfig index dc3deca530..6b6c328f67 100644 --- a/board/funkwerk/vovpn-gw/Kconfig +++ b/board/funkwerk/vovpn-gw/Kconfig @@ -1,15 +1,12 @@ if TARGET_VOVPN_GW config SYS_BOARD - string default "vovpn-gw" config SYS_VENDOR - string default "funkwerk" config SYS_CONFIG_NAME - string default "VoVPN-GW" endif diff --git a/board/g2000/Kconfig b/board/g2000/Kconfig index eae4886746..031fae991d 100644 --- a/board/g2000/Kconfig +++ b/board/g2000/Kconfig @@ -1,11 +1,9 @@ if TARGET_G2000 config SYS_BOARD - string default "g2000" config SYS_CONFIG_NAME - string default "G2000" endif diff --git a/board/gaisler/gr_cpci_ax2000/Kconfig b/board/gaisler/gr_cpci_ax2000/Kconfig index d5a2eb4a17..8da050404c 100644 --- a/board/gaisler/gr_cpci_ax2000/Kconfig +++ b/board/gaisler/gr_cpci_ax2000/Kconfig @@ -1,19 +1,15 @@ if TARGET_GR_CPCI_AX2000 config SYS_CPU - string default "leon3" config SYS_BOARD - string default "gr_cpci_ax2000" config SYS_VENDOR - string default "gaisler" config SYS_CONFIG_NAME - string default "gr_cpci_ax2000" endif diff --git a/board/gaisler/gr_ep2s60/Kconfig b/board/gaisler/gr_ep2s60/Kconfig index e742ea8706..00b2097cf4 100644 --- a/board/gaisler/gr_ep2s60/Kconfig +++ b/board/gaisler/gr_ep2s60/Kconfig @@ -1,19 +1,15 @@ if TARGET_GR_EP2S60 config SYS_CPU - string default "leon3" config SYS_BOARD - string default "gr_ep2s60" config SYS_VENDOR - string default "gaisler" config SYS_CONFIG_NAME - string default "gr_ep2s60" endif diff --git a/board/gaisler/gr_xc3s_1500/Kconfig b/board/gaisler/gr_xc3s_1500/Kconfig index 6d9f107e4e..765e028b51 100644 --- a/board/gaisler/gr_xc3s_1500/Kconfig +++ b/board/gaisler/gr_xc3s_1500/Kconfig @@ -1,19 +1,15 @@ if TARGET_GR_XC3S_1500 config SYS_CPU - string default "leon3" config SYS_BOARD - string default "gr_xc3s_1500" config SYS_VENDOR - string default "gaisler" config SYS_CONFIG_NAME - string default "gr_xc3s_1500" endif diff --git a/board/gaisler/grsim/Kconfig b/board/gaisler/grsim/Kconfig index 10f51e1cf8..751fa03be4 100644 --- a/board/gaisler/grsim/Kconfig +++ b/board/gaisler/grsim/Kconfig @@ -1,19 +1,15 @@ if TARGET_GRSIM config SYS_CPU - string default "leon3" config SYS_BOARD - string default "grsim" config SYS_VENDOR - string default "gaisler" config SYS_CONFIG_NAME - string default "grsim" endif diff --git a/board/gaisler/grsim_leon2/Kconfig b/board/gaisler/grsim_leon2/Kconfig index 8dd2d27abd..0907f3af89 100644 --- a/board/gaisler/grsim_leon2/Kconfig +++ b/board/gaisler/grsim_leon2/Kconfig @@ -1,19 +1,15 @@ if TARGET_GRSIM_LEON2 config SYS_CPU - string default "leon2" config SYS_BOARD - string default "grsim_leon2" config SYS_VENDOR - string default "gaisler" config SYS_CONFIG_NAME - string default "grsim_leon2" endif diff --git a/board/galaxy5200/Kconfig b/board/galaxy5200/Kconfig index 04f079cf2b..31035811e9 100644 --- a/board/galaxy5200/Kconfig +++ b/board/galaxy5200/Kconfig @@ -1,11 +1,9 @@ if TARGET_GALAXY5200 config SYS_BOARD - string default "galaxy5200" config SYS_CONFIG_NAME - string default "galaxy5200" endif diff --git a/board/gateworks/gw_ventana/Kconfig b/board/gateworks/gw_ventana/Kconfig index a9ff70a761..82909a80a3 100644 --- a/board/gateworks/gw_ventana/Kconfig +++ b/board/gateworks/gw_ventana/Kconfig @@ -1,23 +1,18 @@ if TARGET_GW_VENTANA config SYS_CPU - string default "armv7" config SYS_BOARD - string default "gw_ventana" config SYS_VENDOR - string default "gateworks" config SYS_SOC - string default "mx6" config SYS_CONFIG_NAME - string default "gw_ventana" endif diff --git a/board/gdsys/405ep/Kconfig b/board/gdsys/405ep/Kconfig index 8a5d3f51ae..20cb80fc2e 100644 --- a/board/gdsys/405ep/Kconfig +++ b/board/gdsys/405ep/Kconfig @@ -1,15 +1,12 @@ if TARGET_DLVISION_10G config SYS_BOARD - string default "405ep" config SYS_VENDOR - string default "gdsys" config SYS_CONFIG_NAME - string default "dlvision-10g" endif @@ -17,15 +14,12 @@ endif if TARGET_IO config SYS_BOARD - string default "405ep" config SYS_VENDOR - string default "gdsys" config SYS_CONFIG_NAME - string default "io" endif @@ -33,15 +27,12 @@ endif if TARGET_IOCON config SYS_BOARD - string default "405ep" config SYS_VENDOR - string default "gdsys" config SYS_CONFIG_NAME - string default "iocon" endif @@ -49,15 +40,12 @@ endif if TARGET_NEO config SYS_BOARD - string default "405ep" config SYS_VENDOR - string default "gdsys" config SYS_CONFIG_NAME - string default "neo" endif diff --git a/board/gdsys/405ex/Kconfig b/board/gdsys/405ex/Kconfig index b4fb9753fd..52a8d89011 100644 --- a/board/gdsys/405ex/Kconfig +++ b/board/gdsys/405ex/Kconfig @@ -1,15 +1,12 @@ if TARGET_IO64 config SYS_BOARD - string default "405ex" config SYS_VENDOR - string default "gdsys" config SYS_CONFIG_NAME - string default "io64" endif diff --git a/board/gdsys/dlvision/Kconfig b/board/gdsys/dlvision/Kconfig index af8334e96c..8db4fbeee5 100644 --- a/board/gdsys/dlvision/Kconfig +++ b/board/gdsys/dlvision/Kconfig @@ -1,15 +1,12 @@ if TARGET_DLVISION config SYS_BOARD - string default "dlvision" config SYS_VENDOR - string default "gdsys" config SYS_CONFIG_NAME - string default "dlvision" endif diff --git a/board/gdsys/gdppc440etx/Kconfig b/board/gdsys/gdppc440etx/Kconfig index 5a05c1c7fe..1f21c89175 100644 --- a/board/gdsys/gdppc440etx/Kconfig +++ b/board/gdsys/gdppc440etx/Kconfig @@ -1,15 +1,12 @@ if TARGET_GDPPC440ETX config SYS_BOARD - string default "gdppc440etx" config SYS_VENDOR - string default "gdsys" config SYS_CONFIG_NAME - string default "gdppc440etx" endif diff --git a/board/gdsys/intip/Kconfig b/board/gdsys/intip/Kconfig index 7be439c6f2..479bb1231c 100644 --- a/board/gdsys/intip/Kconfig +++ b/board/gdsys/intip/Kconfig @@ -1,15 +1,12 @@ if TARGET_INTIP config SYS_BOARD - string default "intip" config SYS_VENDOR - string default "gdsys" config SYS_CONFIG_NAME - string default "intip" endif diff --git a/board/gdsys/p1022/Kconfig b/board/gdsys/p1022/Kconfig index 277ed7d193..8514d086b9 100644 --- a/board/gdsys/p1022/Kconfig +++ b/board/gdsys/p1022/Kconfig @@ -1,15 +1,12 @@ if TARGET_CONTROLCENTERD config SYS_BOARD - string default "p1022" config SYS_VENDOR - string default "gdsys" config SYS_CONFIG_NAME - string default "controlcenterd" endif diff --git a/board/genesi/mx51_efikamx/Kconfig b/board/genesi/mx51_efikamx/Kconfig index adfddebff1..87d15a59d4 100644 --- a/board/genesi/mx51_efikamx/Kconfig +++ b/board/genesi/mx51_efikamx/Kconfig @@ -1,23 +1,18 @@ if TARGET_MX51_EFIKAMX config SYS_CPU - string default "armv7" config SYS_BOARD - string default "mx51_efikamx" config SYS_VENDOR - string default "genesi" config SYS_SOC - string default "mx5" config SYS_CONFIG_NAME - string default "mx51_efikamx" endif diff --git a/board/gumstix/duovero/Kconfig b/board/gumstix/duovero/Kconfig index f662798fbf..2f8558aaf3 100644 --- a/board/gumstix/duovero/Kconfig +++ b/board/gumstix/duovero/Kconfig @@ -1,15 +1,12 @@ if TARGET_DUOVERO config SYS_BOARD - string default "duovero" config SYS_VENDOR - string default "gumstix" config SYS_CONFIG_NAME - string default "duovero" endif diff --git a/board/gumstix/pepper/Kconfig b/board/gumstix/pepper/Kconfig index 290b428b68..0b73955167 100644 --- a/board/gumstix/pepper/Kconfig +++ b/board/gumstix/pepper/Kconfig @@ -1,23 +1,18 @@ if TARGET_PEPPER config SYS_CPU - string default "armv7" config SYS_BOARD - string default "pepper" config SYS_VENDOR - string default "gumstix" config SYS_SOC - string default "am33xx" config SYS_CONFIG_NAME - string default "pepper" endif diff --git a/board/gw8260/Kconfig b/board/gw8260/Kconfig index ce8d1b0fee..1d6aa80764 100644 --- a/board/gw8260/Kconfig +++ b/board/gw8260/Kconfig @@ -1,11 +1,9 @@ if TARGET_GW8260 config SYS_BOARD - string default "gw8260" config SYS_CONFIG_NAME - string default "gw8260" endif diff --git a/board/h2200/Kconfig b/board/h2200/Kconfig index f36b4d9de0..75956be823 100644 --- a/board/h2200/Kconfig +++ b/board/h2200/Kconfig @@ -1,15 +1,12 @@ if TARGET_H2200 config SYS_CPU - string default "pxa" config SYS_BOARD - string default "h2200" config SYS_CONFIG_NAME - string default "h2200" endif diff --git a/board/hale/tt01/Kconfig b/board/hale/tt01/Kconfig index 549c18b1b7..40e56cb11f 100644 --- a/board/hale/tt01/Kconfig +++ b/board/hale/tt01/Kconfig @@ -1,23 +1,18 @@ if TARGET_TT01 config SYS_CPU - string default "arm1136" config SYS_BOARD - string default "tt01" config SYS_VENDOR - string default "hale" config SYS_SOC - string default "mx31" config SYS_CONFIG_NAME - string default "tt01" endif diff --git a/board/hermes/Kconfig b/board/hermes/Kconfig index 9d8065029d..deb37fdfd4 100644 --- a/board/hermes/Kconfig +++ b/board/hermes/Kconfig @@ -1,11 +1,9 @@ if TARGET_HERMES config SYS_BOARD - string default "hermes" config SYS_CONFIG_NAME - string default "hermes" endif diff --git a/board/htkw/mcx/Kconfig b/board/htkw/mcx/Kconfig index 343ff4d0f0..25ba548dab 100644 --- a/board/htkw/mcx/Kconfig +++ b/board/htkw/mcx/Kconfig @@ -1,15 +1,12 @@ if TARGET_MCX config SYS_BOARD - string default "mcx" config SYS_VENDOR - string default "htkw" config SYS_CONFIG_NAME - string default "mcx" endif diff --git a/board/hymod/Kconfig b/board/hymod/Kconfig index 106a837604..fa162ebc96 100644 --- a/board/hymod/Kconfig +++ b/board/hymod/Kconfig @@ -1,11 +1,9 @@ if TARGET_HYMOD config SYS_BOARD - string default "hymod" config SYS_CONFIG_NAME - string default "hymod" endif diff --git a/board/ibf-dsp561/Kconfig b/board/ibf-dsp561/Kconfig index 5183afff98..acf5d7c6f9 100644 --- a/board/ibf-dsp561/Kconfig +++ b/board/ibf-dsp561/Kconfig @@ -1,11 +1,9 @@ if TARGET_IBF_DSP561 config SYS_BOARD - string default "ibf-dsp561" config SYS_CONFIG_NAME - string default "ibf-dsp561" endif diff --git a/board/icecube/Kconfig b/board/icecube/Kconfig index d409cd7c67..e5b2153911 100644 --- a/board/icecube/Kconfig +++ b/board/icecube/Kconfig @@ -1,11 +1,9 @@ if TARGET_ICECUBE config SYS_BOARD - string default "icecube" config SYS_CONFIG_NAME - string default "IceCube" endif diff --git a/board/icpdas/lp8x4x/Kconfig b/board/icpdas/lp8x4x/Kconfig index 6d58984ad7..4374fb654f 100644 --- a/board/icpdas/lp8x4x/Kconfig +++ b/board/icpdas/lp8x4x/Kconfig @@ -1,19 +1,15 @@ if TARGET_LP8X4X config SYS_CPU - string default "pxa" config SYS_BOARD - string default "lp8x4x" config SYS_VENDOR - string default "icpdas" config SYS_CONFIG_NAME - string default "lp8x4x" endif diff --git a/board/icu862/Kconfig b/board/icu862/Kconfig index d2a7a0adae..da11d7b450 100644 --- a/board/icu862/Kconfig +++ b/board/icu862/Kconfig @@ -1,11 +1,9 @@ if TARGET_ICU862 config SYS_BOARD - string default "icu862" config SYS_CONFIG_NAME - string default "ICU862" endif diff --git a/board/ids/ids8247/Kconfig b/board/ids/ids8247/Kconfig index a80af9e8aa..bbab727d78 100644 --- a/board/ids/ids8247/Kconfig +++ b/board/ids/ids8247/Kconfig @@ -1,15 +1,12 @@ if TARGET_IDS8247 config SYS_BOARD - string default "ids8247" config SYS_VENDOR - string default "ids" config SYS_CONFIG_NAME - string default "IDS8247" endif diff --git a/board/ids/ids8313/Kconfig b/board/ids/ids8313/Kconfig index b38877b0ce..d165b4be7a 100644 --- a/board/ids/ids8313/Kconfig +++ b/board/ids/ids8313/Kconfig @@ -1,15 +1,12 @@ if TARGET_IDS8313 config SYS_BOARD - string default "ids8313" config SYS_VENDOR - string default "ids" config SYS_CONFIG_NAME - string default "ids8313" endif diff --git a/board/ifm/ac14xx/Kconfig b/board/ifm/ac14xx/Kconfig index 0772d57b75..97e80d5ddd 100644 --- a/board/ifm/ac14xx/Kconfig +++ b/board/ifm/ac14xx/Kconfig @@ -1,15 +1,12 @@ if TARGET_AC14XX config SYS_BOARD - string default "ac14xx" config SYS_VENDOR - string default "ifm" config SYS_CONFIG_NAME - string default "ac14xx" endif diff --git a/board/ifm/o2dnt2/Kconfig b/board/ifm/o2dnt2/Kconfig index 53e9c0f849..e9d32ddc54 100644 --- a/board/ifm/o2dnt2/Kconfig +++ b/board/ifm/o2dnt2/Kconfig @@ -1,15 +1,12 @@ if TARGET_O2D config SYS_BOARD - string default "o2dnt2" config SYS_VENDOR - string default "ifm" config SYS_CONFIG_NAME - string default "o2d" endif @@ -17,15 +14,12 @@ endif if TARGET_O2D300 config SYS_BOARD - string default "o2dnt2" config SYS_VENDOR - string default "ifm" config SYS_CONFIG_NAME - string default "o2d300" endif @@ -33,15 +27,12 @@ endif if TARGET_O2DNT2 config SYS_BOARD - string default "o2dnt2" config SYS_VENDOR - string default "ifm" config SYS_CONFIG_NAME - string default "o2dnt2" endif @@ -49,15 +40,12 @@ endif if TARGET_O2I config SYS_BOARD - string default "o2dnt2" config SYS_VENDOR - string default "ifm" config SYS_CONFIG_NAME - string default "o2i" endif @@ -65,15 +53,12 @@ endif if TARGET_O2MNT config SYS_BOARD - string default "o2dnt2" config SYS_VENDOR - string default "ifm" config SYS_CONFIG_NAME - string default "o2mnt" endif @@ -81,15 +66,12 @@ endif if TARGET_O3DNT config SYS_BOARD - string default "o2dnt2" config SYS_VENDOR - string default "ifm" config SYS_CONFIG_NAME - string default "o3dnt" endif diff --git a/board/imgtec/malta/Kconfig b/board/imgtec/malta/Kconfig index 8e5cab1a44..401962c4bd 100644 --- a/board/imgtec/malta/Kconfig +++ b/board/imgtec/malta/Kconfig @@ -1,19 +1,15 @@ if TARGET_MALTA config SYS_CPU - string default "mips32" config SYS_BOARD - string default "malta" config SYS_VENDOR - string default "imgtec" config SYS_CONFIG_NAME - string default "malta" endif diff --git a/board/imx31_phycore/Kconfig b/board/imx31_phycore/Kconfig index c74f4a60cd..cf3358dfe0 100644 --- a/board/imx31_phycore/Kconfig +++ b/board/imx31_phycore/Kconfig @@ -1,19 +1,15 @@ if TARGET_IMX31_PHYCORE config SYS_CPU - string default "arm1136" config SYS_BOARD - string default "imx31_phycore" config SYS_SOC - string default "mx31" config SYS_CONFIG_NAME - string default "imx31_phycore" endif diff --git a/board/in-circuit/grasshopper/Kconfig b/board/in-circuit/grasshopper/Kconfig index da3bcc3a83..30e3855ae0 100644 --- a/board/in-circuit/grasshopper/Kconfig +++ b/board/in-circuit/grasshopper/Kconfig @@ -1,19 +1,15 @@ if TARGET_GRASSHOPPER config SYS_BOARD - string default "grasshopper" config SYS_VENDOR - string default "in-circuit" config SYS_SOC - string default "at32ap700x" config SYS_CONFIG_NAME - string default "grasshopper" endif diff --git a/board/inka4x0/Kconfig b/board/inka4x0/Kconfig index 44bca351ff..94a41f01a5 100644 --- a/board/inka4x0/Kconfig +++ b/board/inka4x0/Kconfig @@ -1,11 +1,9 @@ if TARGET_INKA4X0 config SYS_BOARD - string default "inka4x0" config SYS_CONFIG_NAME - string default "inka4x0" endif diff --git a/board/intercontrol/digsy_mtc/Kconfig b/board/intercontrol/digsy_mtc/Kconfig index 0b14bc0e58..1cf2275d81 100644 --- a/board/intercontrol/digsy_mtc/Kconfig +++ b/board/intercontrol/digsy_mtc/Kconfig @@ -1,15 +1,12 @@ if TARGET_DIGSY_MTC config SYS_BOARD - string default "digsy_mtc" config SYS_VENDOR - string default "intercontrol" config SYS_CONFIG_NAME - string default "digsy_mtc" endif diff --git a/board/iomega/iconnect/Kconfig b/board/iomega/iconnect/Kconfig index f75c06b7a3..e56b029416 100644 --- a/board/iomega/iconnect/Kconfig +++ b/board/iomega/iconnect/Kconfig @@ -1,15 +1,12 @@ if TARGET_ICONNECT config SYS_BOARD - string default "iconnect" config SYS_VENDOR - string default "iomega" config SYS_CONFIG_NAME - string default "iconnect" endif diff --git a/board/ip04/Kconfig b/board/ip04/Kconfig index 95abe63d80..670bf89922 100644 --- a/board/ip04/Kconfig +++ b/board/ip04/Kconfig @@ -1,11 +1,9 @@ if TARGET_IP04 config SYS_BOARD - string default "ip04" config SYS_CONFIG_NAME - string default "ip04" endif diff --git a/board/ip860/Kconfig b/board/ip860/Kconfig index df1ce8def9..955c9dbaa1 100644 --- a/board/ip860/Kconfig +++ b/board/ip860/Kconfig @@ -1,11 +1,9 @@ if TARGET_IP860 config SYS_BOARD - string default "ip860" config SYS_CONFIG_NAME - string default "IP860" endif diff --git a/board/ipek01/Kconfig b/board/ipek01/Kconfig index a2a1f86354..34e094d79d 100644 --- a/board/ipek01/Kconfig +++ b/board/ipek01/Kconfig @@ -1,11 +1,9 @@ if TARGET_IPEK01 config SYS_BOARD - string default "ipek01" config SYS_CONFIG_NAME - string default "ipek01" endif diff --git a/board/iphase4539/Kconfig b/board/iphase4539/Kconfig index 1ce42f34d6..74594d2b1c 100644 --- a/board/iphase4539/Kconfig +++ b/board/iphase4539/Kconfig @@ -1,11 +1,9 @@ if TARGET_IPHASE4539 config SYS_BOARD - string default "iphase4539" config SYS_CONFIG_NAME - string default "IPHASE4539" endif diff --git a/board/isee/igep0033/Kconfig b/board/isee/igep0033/Kconfig index cdb67ed175..4f3aaf481b 100644 --- a/board/isee/igep0033/Kconfig +++ b/board/isee/igep0033/Kconfig @@ -1,23 +1,18 @@ if TARGET_AM335X_IGEP0033 config SYS_CPU - string default "armv7" config SYS_BOARD - string default "igep0033" config SYS_VENDOR - string default "isee" config SYS_SOC - string default "am33xx" config SYS_CONFIG_NAME - string default "am335x_igep0033" endif diff --git a/board/isee/igep00x0/Kconfig b/board/isee/igep00x0/Kconfig index c9352fdc88..aa46882b05 100644 --- a/board/isee/igep00x0/Kconfig +++ b/board/isee/igep00x0/Kconfig @@ -1,15 +1,12 @@ if TARGET_OMAP3_IGEP00X0 config SYS_BOARD - string default "igep00x0" config SYS_VENDOR - string default "isee" config SYS_CONFIG_NAME - string default "omap3_igep00x0" endif diff --git a/board/ivm/Kconfig b/board/ivm/Kconfig index ab3da79fbf..6ff302556d 100644 --- a/board/ivm/Kconfig +++ b/board/ivm/Kconfig @@ -1,11 +1,9 @@ if TARGET_IVML24 config SYS_BOARD - string default "ivm" config SYS_CONFIG_NAME - string default "IVML24" endif @@ -13,11 +11,9 @@ endif if TARGET_IVMS8 config SYS_BOARD - string default "ivm" config SYS_CONFIG_NAME - string default "IVMS8" endif diff --git a/board/jornada/Kconfig b/board/jornada/Kconfig index 345d3b6013..9c11a13651 100644 --- a/board/jornada/Kconfig +++ b/board/jornada/Kconfig @@ -1,15 +1,12 @@ if TARGET_JORNADA config SYS_CPU - string default "sa1100" config SYS_BOARD - string default "jornada" config SYS_CONFIG_NAME - string default "jornada" endif diff --git a/board/jse/Kconfig b/board/jse/Kconfig index bb265f2079..48905fa76f 100644 --- a/board/jse/Kconfig +++ b/board/jse/Kconfig @@ -1,11 +1,9 @@ if TARGET_JSE config SYS_BOARD - string default "jse" config SYS_CONFIG_NAME - string default "JSE" endif diff --git a/board/jupiter/Kconfig b/board/jupiter/Kconfig index 36e43b7974..d71acbbc4d 100644 --- a/board/jupiter/Kconfig +++ b/board/jupiter/Kconfig @@ -1,11 +1,9 @@ if TARGET_JUPITER config SYS_BOARD - string default "jupiter" config SYS_CONFIG_NAME - string default "jupiter" endif diff --git a/board/karo/tk71/Kconfig b/board/karo/tk71/Kconfig index 24071f67e2..7b3d548667 100644 --- a/board/karo/tk71/Kconfig +++ b/board/karo/tk71/Kconfig @@ -1,15 +1,12 @@ if TARGET_TK71 config SYS_BOARD - string default "tk71" config SYS_VENDOR - string default "karo" config SYS_CONFIG_NAME - string default "tk71" endif diff --git a/board/karo/tx25/Kconfig b/board/karo/tx25/Kconfig index 095b1a52a7..24edcc43bc 100644 --- a/board/karo/tx25/Kconfig +++ b/board/karo/tx25/Kconfig @@ -1,23 +1,18 @@ if TARGET_TX25 config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "tx25" config SYS_VENDOR - string default "karo" config SYS_SOC - string default "mx25" config SYS_CONFIG_NAME - string default "tx25" endif diff --git a/board/keymile/km82xx/Kconfig b/board/keymile/km82xx/Kconfig index c29032a50a..c9a093ce02 100644 --- a/board/keymile/km82xx/Kconfig +++ b/board/keymile/km82xx/Kconfig @@ -1,15 +1,12 @@ if TARGET_KM82XX config SYS_BOARD - string default "km82xx" config SYS_VENDOR - string default "keymile" config SYS_CONFIG_NAME - string default "km82xx" endif diff --git a/board/keymile/km83xx/Kconfig b/board/keymile/km83xx/Kconfig index 934c45d1fc..d6c594c96a 100644 --- a/board/keymile/km83xx/Kconfig +++ b/board/keymile/km83xx/Kconfig @@ -1,15 +1,12 @@ if TARGET_KM8360 config SYS_BOARD - string default "km83xx" config SYS_VENDOR - string default "keymile" config SYS_CONFIG_NAME - string default "km8360" endif @@ -17,15 +14,12 @@ endif if TARGET_SUVD3 config SYS_BOARD - string default "km83xx" config SYS_VENDOR - string default "keymile" config SYS_CONFIG_NAME - string default "suvd3" endif @@ -33,15 +27,12 @@ endif if TARGET_TUXX1 config SYS_BOARD - string default "km83xx" config SYS_VENDOR - string default "keymile" config SYS_CONFIG_NAME - string default "tuxx1" endif diff --git a/board/keymile/km_arm/Kconfig b/board/keymile/km_arm/Kconfig index 3e9cddb54b..3476780847 100644 --- a/board/keymile/km_arm/Kconfig +++ b/board/keymile/km_arm/Kconfig @@ -1,15 +1,12 @@ if TARGET_KM_KIRKWOOD config SYS_BOARD - string default "km_arm" config SYS_VENDOR - string default "keymile" config SYS_CONFIG_NAME - string default "km_kirkwood" endif diff --git a/board/keymile/kmp204x/Kconfig b/board/keymile/kmp204x/Kconfig index 0236f69f9e..7b45a13cfb 100644 --- a/board/keymile/kmp204x/Kconfig +++ b/board/keymile/kmp204x/Kconfig @@ -1,15 +1,12 @@ if TARGET_KMP204X config SYS_BOARD - string default "kmp204x" config SYS_VENDOR - string default "keymile" config SYS_CONFIG_NAME - string default "kmp204x" endif diff --git a/board/kmc/kzm9g/Kconfig b/board/kmc/kzm9g/Kconfig index ab4812f000..f163efd989 100644 --- a/board/kmc/kzm9g/Kconfig +++ b/board/kmc/kzm9g/Kconfig @@ -1,15 +1,12 @@ if TARGET_KZM9G config SYS_BOARD - string default "kzm9g" config SYS_VENDOR - string default "kmc" config SYS_CONFIG_NAME - string default "kzm9g" endif diff --git a/board/korat/Kconfig b/board/korat/Kconfig index c23061c00e..f434dea7f3 100644 --- a/board/korat/Kconfig +++ b/board/korat/Kconfig @@ -1,11 +1,9 @@ if TARGET_KORAT config SYS_BOARD - string default "korat" config SYS_CONFIG_NAME - string default "korat" endif diff --git a/board/kup/kup4k/Kconfig b/board/kup/kup4k/Kconfig index bac89aa55e..903c3419b7 100644 --- a/board/kup/kup4k/Kconfig +++ b/board/kup/kup4k/Kconfig @@ -1,15 +1,12 @@ if TARGET_KUP4K config SYS_BOARD - string default "kup4k" config SYS_VENDOR - string default "kup" config SYS_CONFIG_NAME - string default "KUP4K" endif diff --git a/board/kup/kup4x/Kconfig b/board/kup/kup4x/Kconfig index e04b919e66..eeb5d8305a 100644 --- a/board/kup/kup4x/Kconfig +++ b/board/kup/kup4x/Kconfig @@ -1,15 +1,12 @@ if TARGET_KUP4X config SYS_BOARD - string default "kup4x" config SYS_VENDOR - string default "kup" config SYS_CONFIG_NAME - string default "KUP4X" endif diff --git a/board/logicpd/am3517evm/Kconfig b/board/logicpd/am3517evm/Kconfig index 1012d3ddc5..901f6094bb 100644 --- a/board/logicpd/am3517evm/Kconfig +++ b/board/logicpd/am3517evm/Kconfig @@ -1,15 +1,12 @@ if TARGET_AM3517_EVM config SYS_BOARD - string default "am3517evm" config SYS_VENDOR - string default "logicpd" config SYS_CONFIG_NAME - string default "am3517_evm" endif diff --git a/board/logicpd/imx27lite/Kconfig b/board/logicpd/imx27lite/Kconfig index f107267217..842d1baa47 100644 --- a/board/logicpd/imx27lite/Kconfig +++ b/board/logicpd/imx27lite/Kconfig @@ -1,23 +1,18 @@ if TARGET_IMX27LITE config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "imx27lite" config SYS_VENDOR - string default "logicpd" config SYS_SOC - string default "mx27" config SYS_CONFIG_NAME - string default "imx27lite" endif @@ -25,23 +20,18 @@ endif if TARGET_MAGNESIUM config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "imx27lite" config SYS_VENDOR - string default "logicpd" config SYS_SOC - string default "mx27" config SYS_CONFIG_NAME - string default "magnesium" endif diff --git a/board/logicpd/imx31_litekit/Kconfig b/board/logicpd/imx31_litekit/Kconfig index ae3343bb39..a87fa81d82 100644 --- a/board/logicpd/imx31_litekit/Kconfig +++ b/board/logicpd/imx31_litekit/Kconfig @@ -1,23 +1,18 @@ if TARGET_IMX31_LITEKIT config SYS_CPU - string default "arm1136" config SYS_BOARD - string default "imx31_litekit" config SYS_VENDOR - string default "logicpd" config SYS_SOC - string default "mx31" config SYS_CONFIG_NAME - string default "imx31_litekit" endif diff --git a/board/logicpd/omap3som/Kconfig b/board/logicpd/omap3som/Kconfig index adeaf4d033..03d272a806 100644 --- a/board/logicpd/omap3som/Kconfig +++ b/board/logicpd/omap3som/Kconfig @@ -1,15 +1,12 @@ if TARGET_OMAP3_LOGIC config SYS_BOARD - string default "omap3som" config SYS_VENDOR - string default "logicpd" config SYS_CONFIG_NAME - string default "omap3_logic" endif diff --git a/board/logicpd/zoom1/Kconfig b/board/logicpd/zoom1/Kconfig index e9a56230ce..d76cb663f7 100644 --- a/board/logicpd/zoom1/Kconfig +++ b/board/logicpd/zoom1/Kconfig @@ -1,15 +1,12 @@ if TARGET_OMAP3_ZOOM1 config SYS_BOARD - string default "zoom1" config SYS_VENDOR - string default "logicpd" config SYS_CONFIG_NAME - string default "omap3_zoom1" endif diff --git a/board/lwmon/Kconfig b/board/lwmon/Kconfig index a0c7587ef3..e98c794767 100644 --- a/board/lwmon/Kconfig +++ b/board/lwmon/Kconfig @@ -1,11 +1,9 @@ if TARGET_LWMON config SYS_BOARD - string default "lwmon" config SYS_CONFIG_NAME - string default "lwmon" endif diff --git a/board/lwmon5/Kconfig b/board/lwmon5/Kconfig index 79cf08e97f..90566d825b 100644 --- a/board/lwmon5/Kconfig +++ b/board/lwmon5/Kconfig @@ -1,11 +1,9 @@ if TARGET_LWMON5 config SYS_BOARD - string default "lwmon5" config SYS_CONFIG_NAME - string default "lwmon5" endif diff --git a/board/manroland/hmi1001/Kconfig b/board/manroland/hmi1001/Kconfig index 2f576dde92..996a87f101 100644 --- a/board/manroland/hmi1001/Kconfig +++ b/board/manroland/hmi1001/Kconfig @@ -1,15 +1,12 @@ if TARGET_HMI1001 config SYS_BOARD - string default "hmi1001" config SYS_VENDOR - string default "manroland" config SYS_CONFIG_NAME - string default "hmi1001" endif diff --git a/board/manroland/mucmc52/Kconfig b/board/manroland/mucmc52/Kconfig index 4be0722b2e..a033610cbf 100644 --- a/board/manroland/mucmc52/Kconfig +++ b/board/manroland/mucmc52/Kconfig @@ -1,15 +1,12 @@ if TARGET_MUCMC52 config SYS_BOARD - string default "mucmc52" config SYS_VENDOR - string default "manroland" config SYS_CONFIG_NAME - string default "mucmc52" endif diff --git a/board/manroland/uc100/Kconfig b/board/manroland/uc100/Kconfig index a41a780435..08f681b0a9 100644 --- a/board/manroland/uc100/Kconfig +++ b/board/manroland/uc100/Kconfig @@ -1,15 +1,12 @@ if TARGET_UC100 config SYS_BOARD - string default "uc100" config SYS_VENDOR - string default "manroland" config SYS_CONFIG_NAME - string default "uc100" endif diff --git a/board/manroland/uc101/Kconfig b/board/manroland/uc101/Kconfig index 07cfcc63a7..c285b22f1b 100644 --- a/board/manroland/uc101/Kconfig +++ b/board/manroland/uc101/Kconfig @@ -1,15 +1,12 @@ if TARGET_UC101 config SYS_BOARD - string default "uc101" config SYS_VENDOR - string default "manroland" config SYS_CONFIG_NAME - string default "uc101" endif diff --git a/board/matrix_vision/mergerbox/Kconfig b/board/matrix_vision/mergerbox/Kconfig index 5b292dca4f..3857535a25 100644 --- a/board/matrix_vision/mergerbox/Kconfig +++ b/board/matrix_vision/mergerbox/Kconfig @@ -1,15 +1,12 @@ if TARGET_MERGERBOX config SYS_BOARD - string default "mergerbox" config SYS_VENDOR - string default "matrix_vision" config SYS_CONFIG_NAME - string default "MERGERBOX" endif diff --git a/board/matrix_vision/mvbc_p/Kconfig b/board/matrix_vision/mvbc_p/Kconfig index ab1fe65014..4a68493fa3 100644 --- a/board/matrix_vision/mvbc_p/Kconfig +++ b/board/matrix_vision/mvbc_p/Kconfig @@ -1,15 +1,12 @@ if TARGET_MVBC_P config SYS_BOARD - string default "mvbc_p" config SYS_VENDOR - string default "matrix_vision" config SYS_CONFIG_NAME - string default "MVBC_P" endif diff --git a/board/matrix_vision/mvblm7/Kconfig b/board/matrix_vision/mvblm7/Kconfig index c5998b36b3..ea7a6f82c0 100644 --- a/board/matrix_vision/mvblm7/Kconfig +++ b/board/matrix_vision/mvblm7/Kconfig @@ -1,15 +1,12 @@ if TARGET_MVBLM7 config SYS_BOARD - string default "mvblm7" config SYS_VENDOR - string default "matrix_vision" config SYS_CONFIG_NAME - string default "MVBLM7" endif diff --git a/board/matrix_vision/mvblx/Kconfig b/board/matrix_vision/mvblx/Kconfig index 69f05661cb..adbc20a934 100644 --- a/board/matrix_vision/mvblx/Kconfig +++ b/board/matrix_vision/mvblx/Kconfig @@ -1,15 +1,12 @@ if TARGET_OMAP3_MVBLX config SYS_BOARD - string default "mvblx" config SYS_VENDOR - string default "matrix_vision" config SYS_CONFIG_NAME - string default "omap3_mvblx" endif diff --git a/board/matrix_vision/mvsmr/Kconfig b/board/matrix_vision/mvsmr/Kconfig index 1627a36026..d725c5ac49 100644 --- a/board/matrix_vision/mvsmr/Kconfig +++ b/board/matrix_vision/mvsmr/Kconfig @@ -1,15 +1,12 @@ if TARGET_MVSMR config SYS_BOARD - string default "mvsmr" config SYS_VENDOR - string default "matrix_vision" config SYS_CONFIG_NAME - string default "MVSMR" endif diff --git a/board/mcc200/Kconfig b/board/mcc200/Kconfig index c4e8cf168c..3b27eeb1de 100644 --- a/board/mcc200/Kconfig +++ b/board/mcc200/Kconfig @@ -1,11 +1,9 @@ if TARGET_MCC200 config SYS_BOARD - string default "mcc200" config SYS_CONFIG_NAME - string default "mcc200" endif diff --git a/board/micronas/vct/Kconfig b/board/micronas/vct/Kconfig index 76c5f7cc9e..75046fe7ab 100644 --- a/board/micronas/vct/Kconfig +++ b/board/micronas/vct/Kconfig @@ -1,19 +1,15 @@ if TARGET_VCT config SYS_CPU - string default "mips32" config SYS_BOARD - string default "vct" config SYS_VENDOR - string default "micronas" config SYS_CONFIG_NAME - string default "vct" endif diff --git a/board/mimc/mimc200/Kconfig b/board/mimc/mimc200/Kconfig index 146c3b79a8..18736d7f96 100644 --- a/board/mimc/mimc200/Kconfig +++ b/board/mimc/mimc200/Kconfig @@ -1,19 +1,15 @@ if TARGET_MIMC200 config SYS_BOARD - string default "mimc200" config SYS_VENDOR - string default "mimc" config SYS_SOC - string default "at32ap700x" config SYS_CONFIG_NAME - string default "mimc200" endif diff --git a/board/miromico/hammerhead/Kconfig b/board/miromico/hammerhead/Kconfig index 9795e55b1d..1f09ef782e 100644 --- a/board/miromico/hammerhead/Kconfig +++ b/board/miromico/hammerhead/Kconfig @@ -1,19 +1,15 @@ if TARGET_HAMMERHEAD config SYS_BOARD - string default "hammerhead" config SYS_VENDOR - string default "miromico" config SYS_SOC - string default "at32ap700x" config SYS_CONFIG_NAME - string default "hammerhead" endif diff --git a/board/mosaixtech/icon/Kconfig b/board/mosaixtech/icon/Kconfig index c439b1468c..3145a061c6 100644 --- a/board/mosaixtech/icon/Kconfig +++ b/board/mosaixtech/icon/Kconfig @@ -1,15 +1,12 @@ if TARGET_ICON config SYS_BOARD - string default "icon" config SYS_VENDOR - string default "mosaixtech" config SYS_CONFIG_NAME - string default "icon" endif diff --git a/board/motionpro/Kconfig b/board/motionpro/Kconfig index c8ee0438e7..f624f6c95f 100644 --- a/board/motionpro/Kconfig +++ b/board/motionpro/Kconfig @@ -1,11 +1,9 @@ if TARGET_MOTIONPRO config SYS_BOARD - string default "motionpro" config SYS_CONFIG_NAME - string default "motionpro" endif diff --git a/board/mpc8308_p1m/Kconfig b/board/mpc8308_p1m/Kconfig index 6e84bdf3d0..b7e39dafbc 100644 --- a/board/mpc8308_p1m/Kconfig +++ b/board/mpc8308_p1m/Kconfig @@ -1,11 +1,9 @@ if TARGET_MPC8308_P1M config SYS_BOARD - string default "mpc8308_p1m" config SYS_CONFIG_NAME - string default "mpc8308_p1m" endif diff --git a/board/mpl/mip405/Kconfig b/board/mpl/mip405/Kconfig index 6705260d3c..48ba91a529 100644 --- a/board/mpl/mip405/Kconfig +++ b/board/mpl/mip405/Kconfig @@ -1,15 +1,12 @@ if TARGET_MIP405 config SYS_BOARD - string default "mip405" config SYS_VENDOR - string default "mpl" config SYS_CONFIG_NAME - string default "MIP405" endif diff --git a/board/mpl/pati/Kconfig b/board/mpl/pati/Kconfig index b902cbd273..b141da3984 100644 --- a/board/mpl/pati/Kconfig +++ b/board/mpl/pati/Kconfig @@ -1,15 +1,12 @@ if TARGET_PATI config SYS_BOARD - string default "pati" config SYS_VENDOR - string default "mpl" config SYS_CONFIG_NAME - string default "PATI" endif diff --git a/board/mpl/pip405/Kconfig b/board/mpl/pip405/Kconfig index 1e1295b0ce..f485367410 100644 --- a/board/mpl/pip405/Kconfig +++ b/board/mpl/pip405/Kconfig @@ -1,15 +1,12 @@ if TARGET_PIP405 config SYS_BOARD - string default "pip405" config SYS_VENDOR - string default "mpl" config SYS_CONFIG_NAME - string default "PIP405" endif diff --git a/board/mpl/vcma9/Kconfig b/board/mpl/vcma9/Kconfig index 91246be71b..08b0fa0184 100644 --- a/board/mpl/vcma9/Kconfig +++ b/board/mpl/vcma9/Kconfig @@ -1,23 +1,18 @@ if TARGET_VCMA9 config SYS_CPU - string default "arm920t" config SYS_BOARD - string default "vcma9" config SYS_VENDOR - string default "mpl" config SYS_SOC - string default "s3c24x0" config SYS_CONFIG_NAME - string default "VCMA9" endif diff --git a/board/mpr2/Kconfig b/board/mpr2/Kconfig index 93bec5991f..79a60c2f2d 100644 --- a/board/mpr2/Kconfig +++ b/board/mpr2/Kconfig @@ -1,15 +1,12 @@ if TARGET_MPR2 config SYS_CPU - string default "sh3" config SYS_BOARD - string default "mpr2" config SYS_CONFIG_NAME - string default "mpr2" endif diff --git a/board/ms7720se/Kconfig b/board/ms7720se/Kconfig index 8873062a4d..d935affdd9 100644 --- a/board/ms7720se/Kconfig +++ b/board/ms7720se/Kconfig @@ -1,15 +1,12 @@ if TARGET_MS7720SE config SYS_CPU - string default "sh3" config SYS_BOARD - string default "ms7720se" config SYS_CONFIG_NAME - string default "ms7720se" endif diff --git a/board/ms7722se/Kconfig b/board/ms7722se/Kconfig index c5b5b4f3c4..17073e81e9 100644 --- a/board/ms7722se/Kconfig +++ b/board/ms7722se/Kconfig @@ -1,15 +1,12 @@ if TARGET_MS7722SE config SYS_CPU - string default "sh4" config SYS_BOARD - string default "ms7722se" config SYS_CONFIG_NAME - string default "ms7722se" endif diff --git a/board/ms7750se/Kconfig b/board/ms7750se/Kconfig index 0c9d88fd9b..07aa0247b7 100644 --- a/board/ms7750se/Kconfig +++ b/board/ms7750se/Kconfig @@ -1,15 +1,12 @@ if TARGET_MS7750SE config SYS_CPU - string default "sh4" config SYS_BOARD - string default "ms7750se" config SYS_CONFIG_NAME - string default "ms7750se" endif diff --git a/board/muas3001/Kconfig b/board/muas3001/Kconfig index 982d32f083..94a00b3d01 100644 --- a/board/muas3001/Kconfig +++ b/board/muas3001/Kconfig @@ -1,11 +1,9 @@ if TARGET_MUAS3001 config SYS_BOARD - string default "muas3001" config SYS_CONFIG_NAME - string default "muas3001" endif diff --git a/board/munices/Kconfig b/board/munices/Kconfig index d242d568eb..019aaae3e9 100644 --- a/board/munices/Kconfig +++ b/board/munices/Kconfig @@ -1,11 +1,9 @@ if TARGET_MUNICES config SYS_BOARD - string default "munices" config SYS_CONFIG_NAME - string default "munices" endif diff --git a/board/musenki/Kconfig b/board/musenki/Kconfig index ea33d16298..26b680f299 100644 --- a/board/musenki/Kconfig +++ b/board/musenki/Kconfig @@ -1,11 +1,9 @@ if TARGET_MUSENKI config SYS_BOARD - string default "musenki" config SYS_CONFIG_NAME - string default "MUSENKI" endif diff --git a/board/mvblue/Kconfig b/board/mvblue/Kconfig index a70bcbe099..cee206b8c4 100644 --- a/board/mvblue/Kconfig +++ b/board/mvblue/Kconfig @@ -1,11 +1,9 @@ if TARGET_MVBLUE config SYS_BOARD - string default "mvblue" config SYS_CONFIG_NAME - string default "MVBLUE" endif diff --git a/board/netvia/Kconfig b/board/netvia/Kconfig index d177b705ba..3e740e5dfa 100644 --- a/board/netvia/Kconfig +++ b/board/netvia/Kconfig @@ -1,11 +1,9 @@ if TARGET_NETVIA config SYS_BOARD - string default "netvia" config SYS_CONFIG_NAME - string default "NETVIA" endif diff --git a/board/nokia/rx51/Kconfig b/board/nokia/rx51/Kconfig index faa90d2533..ec6a571a22 100644 --- a/board/nokia/rx51/Kconfig +++ b/board/nokia/rx51/Kconfig @@ -1,15 +1,12 @@ if TARGET_NOKIA_RX51 config SYS_BOARD - string default "rx51" config SYS_VENDOR - string default "nokia" config SYS_CONFIG_NAME - string default "nokia_rx51" endif diff --git a/board/nvidia/beaver/Kconfig b/board/nvidia/beaver/Kconfig index e487b66f13..23f7c945f5 100644 --- a/board/nvidia/beaver/Kconfig +++ b/board/nvidia/beaver/Kconfig @@ -1,15 +1,12 @@ if TARGET_BEAVER config SYS_BOARD - string default "beaver" config SYS_VENDOR - string default "nvidia" config SYS_CONFIG_NAME - string default "beaver" endif diff --git a/board/nvidia/cardhu/Kconfig b/board/nvidia/cardhu/Kconfig index 150815f7a6..63ace66aa7 100644 --- a/board/nvidia/cardhu/Kconfig +++ b/board/nvidia/cardhu/Kconfig @@ -1,15 +1,12 @@ if TARGET_CARDHU config SYS_BOARD - string default "cardhu" config SYS_VENDOR - string default "nvidia" config SYS_CONFIG_NAME - string default "cardhu" endif diff --git a/board/nvidia/dalmore/Kconfig b/board/nvidia/dalmore/Kconfig index 9eed19c353..96eaa01cf8 100644 --- a/board/nvidia/dalmore/Kconfig +++ b/board/nvidia/dalmore/Kconfig @@ -1,15 +1,12 @@ if TARGET_DALMORE config SYS_BOARD - string default "dalmore" config SYS_VENDOR - string default "nvidia" config SYS_CONFIG_NAME - string default "dalmore" endif diff --git a/board/nvidia/harmony/Kconfig b/board/nvidia/harmony/Kconfig index 7d75f2d271..328c94677d 100644 --- a/board/nvidia/harmony/Kconfig +++ b/board/nvidia/harmony/Kconfig @@ -1,15 +1,12 @@ if TARGET_HARMONY config SYS_BOARD - string default "harmony" config SYS_VENDOR - string default "nvidia" config SYS_CONFIG_NAME - string default "harmony" endif diff --git a/board/nvidia/jetson-tk1/Kconfig b/board/nvidia/jetson-tk1/Kconfig index 02b46b7a86..d90a74ea38 100644 --- a/board/nvidia/jetson-tk1/Kconfig +++ b/board/nvidia/jetson-tk1/Kconfig @@ -1,15 +1,12 @@ if TARGET_JETSON_TK1 config SYS_BOARD - string default "jetson-tk1" config SYS_VENDOR - string default "nvidia" config SYS_CONFIG_NAME - string default "jetson-tk1" endif diff --git a/board/nvidia/seaboard/Kconfig b/board/nvidia/seaboard/Kconfig index 786370226e..0924bde480 100644 --- a/board/nvidia/seaboard/Kconfig +++ b/board/nvidia/seaboard/Kconfig @@ -1,15 +1,12 @@ if TARGET_SEABOARD config SYS_BOARD - string default "seaboard" config SYS_VENDOR - string default "nvidia" config SYS_CONFIG_NAME - string default "seaboard" endif diff --git a/board/nvidia/seaboard/seaboard.c b/board/nvidia/seaboard/seaboard.c index ce2db40f9e..6a243f0aea 100644 --- a/board/nvidia/seaboard/seaboard.c +++ b/board/nvidia/seaboard/seaboard.c @@ -22,7 +22,7 @@ void gpio_early_init_uart(void) #ifndef CONFIG_SPL_BUILD gpio_request(GPIO_PI3, NULL); #endif - gpio_direction_output(GPIO_PI3, 0); + tegra_spl_gpio_direction_output(GPIO_PI3, 0); } #endif diff --git a/board/nvidia/venice2/Kconfig b/board/nvidia/venice2/Kconfig index 993da79d6e..6905f0014e 100644 --- a/board/nvidia/venice2/Kconfig +++ b/board/nvidia/venice2/Kconfig @@ -1,15 +1,12 @@ if TARGET_VENICE2 config SYS_BOARD - string default "venice2" config SYS_VENDOR - string default "nvidia" config SYS_CONFIG_NAME - string default "venice2" endif diff --git a/board/nvidia/ventana/Kconfig b/board/nvidia/ventana/Kconfig index 95840a8f06..c1ad7b7671 100644 --- a/board/nvidia/ventana/Kconfig +++ b/board/nvidia/ventana/Kconfig @@ -1,15 +1,12 @@ if TARGET_VENTANA config SYS_BOARD - string default "ventana" config SYS_VENDOR - string default "nvidia" config SYS_CONFIG_NAME - string default "ventana" endif diff --git a/board/nvidia/whistler/Kconfig b/board/nvidia/whistler/Kconfig index 113e2ef70e..5febc07777 100644 --- a/board/nvidia/whistler/Kconfig +++ b/board/nvidia/whistler/Kconfig @@ -1,15 +1,12 @@ if TARGET_WHISTLER config SYS_BOARD - string default "whistler" config SYS_VENDOR - string default "nvidia" config SYS_CONFIG_NAME - string default "whistler" endif diff --git a/board/olimex/mx23_olinuxino/Kconfig b/board/olimex/mx23_olinuxino/Kconfig index 07b328487d..fb09309285 100644 --- a/board/olimex/mx23_olinuxino/Kconfig +++ b/board/olimex/mx23_olinuxino/Kconfig @@ -1,23 +1,18 @@ if TARGET_MX23_OLINUXINO config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "mx23_olinuxino" config SYS_VENDOR - string default "olimex" config SYS_SOC - string default "mxs" config SYS_CONFIG_NAME - string default "mx23_olinuxino" endif diff --git a/board/omicron/calimain/Kconfig b/board/omicron/calimain/Kconfig index 46e95d89dc..1ec48e6b55 100644 --- a/board/omicron/calimain/Kconfig +++ b/board/omicron/calimain/Kconfig @@ -1,15 +1,12 @@ if TARGET_CALIMAIN config SYS_BOARD - string default "calimain" config SYS_VENDOR - string default "omicron" config SYS_CONFIG_NAME - string default "calimain" endif diff --git a/board/openrisc/openrisc-generic/Kconfig b/board/openrisc/openrisc-generic/Kconfig index 71a8246c07..cd2a94f025 100644 --- a/board/openrisc/openrisc-generic/Kconfig +++ b/board/openrisc/openrisc-generic/Kconfig @@ -1,15 +1,12 @@ if TARGET_OPENRISC_GENERIC config SYS_BOARD - string default "openrisc-generic" config SYS_VENDOR - string default "openrisc" config SYS_CONFIG_NAME - string default "openrisc-generic" endif diff --git a/board/overo/Kconfig b/board/overo/Kconfig index d1ea236a8a..74572a62be 100644 --- a/board/overo/Kconfig +++ b/board/overo/Kconfig @@ -1,11 +1,9 @@ if TARGET_OMAP3_OVERO config SYS_BOARD - string default "overo" config SYS_CONFIG_NAME - string default "omap3_overo" endif diff --git a/board/palmld/Kconfig b/board/palmld/Kconfig index bed99b6e8d..a749c8d2bb 100644 --- a/board/palmld/Kconfig +++ b/board/palmld/Kconfig @@ -1,15 +1,12 @@ if TARGET_PALMLD config SYS_CPU - string default "pxa" config SYS_BOARD - string default "palmld" config SYS_CONFIG_NAME - string default "palmld" endif diff --git a/board/palmtc/Kconfig b/board/palmtc/Kconfig index 86fb63b5d1..5207490e88 100644 --- a/board/palmtc/Kconfig +++ b/board/palmtc/Kconfig @@ -1,15 +1,12 @@ if TARGET_PALMTC config SYS_CPU - string default "pxa" config SYS_BOARD - string default "palmtc" config SYS_CONFIG_NAME - string default "palmtc" endif diff --git a/board/palmtreo680/Kconfig b/board/palmtreo680/Kconfig index 4df6c6368a..1992970aed 100644 --- a/board/palmtreo680/Kconfig +++ b/board/palmtreo680/Kconfig @@ -1,15 +1,12 @@ if TARGET_PALMTREO680 config SYS_CPU - string default "pxa" config SYS_BOARD - string default "palmtreo680" config SYS_CONFIG_NAME - string default "palmtreo680" endif diff --git a/board/pandora/Kconfig b/board/pandora/Kconfig index 6f410050d2..0b33818008 100644 --- a/board/pandora/Kconfig +++ b/board/pandora/Kconfig @@ -1,11 +1,9 @@ if TARGET_OMAP3_PANDORA config SYS_BOARD - string default "pandora" config SYS_CONFIG_NAME - string default "omap3_pandora" endif diff --git a/board/pb1x00/Kconfig b/board/pb1x00/Kconfig index 0ad3f2364e..ef2844a497 100644 --- a/board/pb1x00/Kconfig +++ b/board/pb1x00/Kconfig @@ -1,19 +1,15 @@ if TARGET_PB1X00 config SYS_CPU - string default "mips32" config SYS_BOARD - string default "pb1x00" config SYS_SOC - string default "au1x00" config SYS_CONFIG_NAME - string default "pb1x00" endif diff --git a/board/pcs440ep/Kconfig b/board/pcs440ep/Kconfig index 7e69fd34b7..5b280f6e77 100644 --- a/board/pcs440ep/Kconfig +++ b/board/pcs440ep/Kconfig @@ -1,11 +1,9 @@ if TARGET_PCS440EP config SYS_BOARD - string default "pcs440ep" config SYS_CONFIG_NAME - string default "pcs440ep" endif diff --git a/board/pdm360ng/Kconfig b/board/pdm360ng/Kconfig index e7a8985119..33173a0a2a 100644 --- a/board/pdm360ng/Kconfig +++ b/board/pdm360ng/Kconfig @@ -1,11 +1,9 @@ if TARGET_PDM360NG config SYS_BOARD - string default "pdm360ng" config SYS_CONFIG_NAME - string default "pdm360ng" endif diff --git a/board/phytec/pcm030/Kconfig b/board/phytec/pcm030/Kconfig index 6eea7e8ea5..3a3eab8576 100644 --- a/board/phytec/pcm030/Kconfig +++ b/board/phytec/pcm030/Kconfig @@ -1,15 +1,12 @@ if TARGET_PCM030 config SYS_BOARD - string default "pcm030" config SYS_VENDOR - string default "phytec" config SYS_CONFIG_NAME - string default "pcm030" endif diff --git a/board/phytec/pcm051/Kconfig b/board/phytec/pcm051/Kconfig index e7104455ac..f4ed7fdbac 100644 --- a/board/phytec/pcm051/Kconfig +++ b/board/phytec/pcm051/Kconfig @@ -1,23 +1,18 @@ if TARGET_PCM051 config SYS_CPU - string default "armv7" config SYS_BOARD - string default "pcm051" config SYS_VENDOR - string default "phytec" config SYS_SOC - string default "am33xx" config SYS_CONFIG_NAME - string default "pcm051" endif diff --git a/board/pm520/Kconfig b/board/pm520/Kconfig index d32f857e91..3f0a258a2b 100644 --- a/board/pm520/Kconfig +++ b/board/pm520/Kconfig @@ -1,11 +1,9 @@ if TARGET_PM520 config SYS_BOARD - string default "pm520" config SYS_CONFIG_NAME - string default "PM520" endif diff --git a/board/pm826/Kconfig b/board/pm826/Kconfig index f1de16a689..dd11b7a89c 100644 --- a/board/pm826/Kconfig +++ b/board/pm826/Kconfig @@ -1,11 +1,9 @@ if TARGET_PM826 config SYS_BOARD - string default "pm826" config SYS_CONFIG_NAME - string default "PM826" endif diff --git a/board/pm828/Kconfig b/board/pm828/Kconfig index 20f6b34f67..e7970a30bb 100644 --- a/board/pm828/Kconfig +++ b/board/pm828/Kconfig @@ -1,11 +1,9 @@ if TARGET_PM828 config SYS_BOARD - string default "pm828" config SYS_CONFIG_NAME - string default "PM828" endif diff --git a/board/ppcag/bg0900/Kconfig b/board/ppcag/bg0900/Kconfig index e4fb601d14..9d301c2926 100644 --- a/board/ppcag/bg0900/Kconfig +++ b/board/ppcag/bg0900/Kconfig @@ -1,23 +1,18 @@ if TARGET_BG0900 config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "bg0900" config SYS_VENDOR - string default "ppcag" config SYS_SOC - string default "mxs" config SYS_CONFIG_NAME - string default "bg0900" endif diff --git a/board/ppmc7xx/Kconfig b/board/ppmc7xx/Kconfig index a28ab98837..f101940b0b 100644 --- a/board/ppmc7xx/Kconfig +++ b/board/ppmc7xx/Kconfig @@ -1,11 +1,9 @@ if TARGET_PPMC7XX config SYS_BOARD - string default "ppmc7xx" config SYS_CONFIG_NAME - string default "ppmc7xx" endif diff --git a/board/ppmc8260/Kconfig b/board/ppmc8260/Kconfig index e2e8793c94..1a6dcd30a8 100644 --- a/board/ppmc8260/Kconfig +++ b/board/ppmc8260/Kconfig @@ -1,11 +1,9 @@ if TARGET_PPMC8260 config SYS_BOARD - string default "ppmc8260" config SYS_CONFIG_NAME - string default "ppmc8260" endif diff --git a/board/pr1/Kconfig b/board/pr1/Kconfig index 2d80cd4d60..fb04648716 100644 --- a/board/pr1/Kconfig +++ b/board/pr1/Kconfig @@ -1,11 +1,9 @@ if TARGET_PR1 config SYS_BOARD - string default "pr1" config SYS_CONFIG_NAME - string default "pr1" endif diff --git a/board/prodrive/alpr/Kconfig b/board/prodrive/alpr/Kconfig index 6e99fc7a68..543b4557ee 100644 --- a/board/prodrive/alpr/Kconfig +++ b/board/prodrive/alpr/Kconfig @@ -1,15 +1,12 @@ if TARGET_ALPR config SYS_BOARD - string default "alpr" config SYS_VENDOR - string default "prodrive" config SYS_CONFIG_NAME - string default "alpr" endif diff --git a/board/prodrive/p3mx/Kconfig b/board/prodrive/p3mx/Kconfig index 89dcba0556..28fb8bb3a0 100644 --- a/board/prodrive/p3mx/Kconfig +++ b/board/prodrive/p3mx/Kconfig @@ -1,15 +1,12 @@ if TARGET_P3MX config SYS_BOARD - string default "p3mx" config SYS_VENDOR - string default "prodrive" config SYS_CONFIG_NAME - string default "p3mx" endif diff --git a/board/prodrive/p3p440/Kconfig b/board/prodrive/p3p440/Kconfig index a0eabe1c8d..cf53aac57b 100644 --- a/board/prodrive/p3p440/Kconfig +++ b/board/prodrive/p3p440/Kconfig @@ -1,15 +1,12 @@ if TARGET_P3P440 config SYS_BOARD - string default "p3p440" config SYS_VENDOR - string default "prodrive" config SYS_CONFIG_NAME - string default "p3p440" endif diff --git a/board/pxa255_idp/Kconfig b/board/pxa255_idp/Kconfig index e231f2806f..e8b1d47fcf 100644 --- a/board/pxa255_idp/Kconfig +++ b/board/pxa255_idp/Kconfig @@ -1,15 +1,12 @@ if TARGET_PXA255_IDP config SYS_CPU - string default "pxa" config SYS_BOARD - string default "pxa255_idp" config SYS_CONFIG_NAME - string default "pxa255_idp" endif diff --git a/board/qemu-mips/Kconfig b/board/qemu-mips/Kconfig index 0ca816d07d..e4d9663c2d 100644 --- a/board/qemu-mips/Kconfig +++ b/board/qemu-mips/Kconfig @@ -1,15 +1,12 @@ if TARGET_QEMU_MIPS config SYS_CPU - string default "mips32" config SYS_BOARD - string default "qemu-mips" config SYS_CONFIG_NAME - string default "qemu-mips" endif @@ -17,15 +14,12 @@ endif if TARGET_QEMU_MIPS64 config SYS_CPU - string default "mips64" config SYS_BOARD - string default "qemu-mips" config SYS_CONFIG_NAME - string default "qemu-mips64" endif diff --git a/board/r360mpi/Kconfig b/board/r360mpi/Kconfig index ea4614fbbf..fe8484faa9 100644 --- a/board/r360mpi/Kconfig +++ b/board/r360mpi/Kconfig @@ -1,11 +1,9 @@ if TARGET_R360MPI config SYS_BOARD - string default "r360mpi" config SYS_CONFIG_NAME - string default "R360MPI" endif diff --git a/board/raidsonic/ib62x0/Kconfig b/board/raidsonic/ib62x0/Kconfig index c0c3a93b02..129aac8b6d 100644 --- a/board/raidsonic/ib62x0/Kconfig +++ b/board/raidsonic/ib62x0/Kconfig @@ -1,15 +1,12 @@ if TARGET_IB62X0 config SYS_BOARD - string default "ib62x0" config SYS_VENDOR - string default "raidsonic" config SYS_CONFIG_NAME - string default "ib62x0" endif diff --git a/board/raspberrypi/rpi_b/Kconfig b/board/raspberrypi/rpi_b/Kconfig index 6e99c916af..1a767b2871 100644 --- a/board/raspberrypi/rpi_b/Kconfig +++ b/board/raspberrypi/rpi_b/Kconfig @@ -1,23 +1,18 @@ if TARGET_RPI_B config SYS_CPU - string default "arm1176" config SYS_BOARD - string default "rpi_b" config SYS_VENDOR - string default "raspberrypi" config SYS_SOC - string default "bcm2835" config SYS_CONFIG_NAME - string default "rpi_b" endif diff --git a/board/renesas/MigoR/Kconfig b/board/renesas/MigoR/Kconfig index d72a4537b6..10dffeda9f 100644 --- a/board/renesas/MigoR/Kconfig +++ b/board/renesas/MigoR/Kconfig @@ -1,19 +1,15 @@ if TARGET_MIGOR config SYS_CPU - string default "sh4" config SYS_BOARD - string default "MigoR" config SYS_VENDOR - string default "renesas" config SYS_CONFIG_NAME - string default "MigoR" endif diff --git a/board/renesas/alt/Kconfig b/board/renesas/alt/Kconfig index dc01a38adb..957962de20 100644 --- a/board/renesas/alt/Kconfig +++ b/board/renesas/alt/Kconfig @@ -1,15 +1,12 @@ if TARGET_ALT config SYS_BOARD - string default "alt" config SYS_VENDOR - string default "renesas" config SYS_CONFIG_NAME - string default "alt" endif diff --git a/board/renesas/ap325rxa/Kconfig b/board/renesas/ap325rxa/Kconfig index ac1e9ef76e..45bd6003bd 100644 --- a/board/renesas/ap325rxa/Kconfig +++ b/board/renesas/ap325rxa/Kconfig @@ -1,19 +1,15 @@ if TARGET_AP325RXA config SYS_CPU - string default "sh4" config SYS_BOARD - string default "ap325rxa" config SYS_VENDOR - string default "renesas" config SYS_CONFIG_NAME - string default "ap325rxa" endif diff --git a/board/renesas/ecovec/Kconfig b/board/renesas/ecovec/Kconfig index d62389e33a..a24fe911e0 100644 --- a/board/renesas/ecovec/Kconfig +++ b/board/renesas/ecovec/Kconfig @@ -1,19 +1,15 @@ if TARGET_ECOVEC config SYS_CPU - string default "sh4" config SYS_BOARD - string default "ecovec" config SYS_VENDOR - string default "renesas" config SYS_CONFIG_NAME - string default "ecovec" endif diff --git a/board/renesas/koelsch/Kconfig b/board/renesas/koelsch/Kconfig index e7c6437ada..6475f02b66 100644 --- a/board/renesas/koelsch/Kconfig +++ b/board/renesas/koelsch/Kconfig @@ -1,15 +1,12 @@ if TARGET_KOELSCH config SYS_BOARD - string default "koelsch" config SYS_VENDOR - string default "renesas" config SYS_CONFIG_NAME - string default "koelsch" endif diff --git a/board/renesas/lager/Kconfig b/board/renesas/lager/Kconfig index 07dc98c705..e990c2019c 100644 --- a/board/renesas/lager/Kconfig +++ b/board/renesas/lager/Kconfig @@ -1,15 +1,12 @@ if TARGET_LAGER config SYS_BOARD - string default "lager" config SYS_VENDOR - string default "renesas" config SYS_CONFIG_NAME - string default "lager" endif diff --git a/board/renesas/r0p7734/Kconfig b/board/renesas/r0p7734/Kconfig index 2eb1de2f07..bda785dc97 100644 --- a/board/renesas/r0p7734/Kconfig +++ b/board/renesas/r0p7734/Kconfig @@ -1,19 +1,15 @@ if TARGET_R0P7734 config SYS_CPU - string default "sh4" config SYS_BOARD - string default "r0p7734" config SYS_VENDOR - string default "renesas" config SYS_CONFIG_NAME - string default "r0p7734" endif diff --git a/board/renesas/r2dplus/Kconfig b/board/renesas/r2dplus/Kconfig index d674d77276..c55c109f6b 100644 --- a/board/renesas/r2dplus/Kconfig +++ b/board/renesas/r2dplus/Kconfig @@ -1,19 +1,15 @@ if TARGET_R2DPLUS config SYS_CPU - string default "sh4" config SYS_BOARD - string default "r2dplus" config SYS_VENDOR - string default "renesas" config SYS_CONFIG_NAME - string default "r2dplus" endif diff --git a/board/renesas/r7780mp/Kconfig b/board/renesas/r7780mp/Kconfig index a862f5947f..2d3cbeca5b 100644 --- a/board/renesas/r7780mp/Kconfig +++ b/board/renesas/r7780mp/Kconfig @@ -1,19 +1,15 @@ if TARGET_R7780MP config SYS_CPU - string default "sh4" config SYS_BOARD - string default "r7780mp" config SYS_VENDOR - string default "renesas" config SYS_CONFIG_NAME - string default "r7780mp" endif diff --git a/board/renesas/rsk7203/Kconfig b/board/renesas/rsk7203/Kconfig index 61e9913f36..5eb2923fb9 100644 --- a/board/renesas/rsk7203/Kconfig +++ b/board/renesas/rsk7203/Kconfig @@ -1,19 +1,15 @@ if TARGET_RSK7203 config SYS_CPU - string default "sh2" config SYS_BOARD - string default "rsk7203" config SYS_VENDOR - string default "renesas" config SYS_CONFIG_NAME - string default "rsk7203" endif diff --git a/board/renesas/rsk7264/Kconfig b/board/renesas/rsk7264/Kconfig index a32d3ca788..af71295a25 100644 --- a/board/renesas/rsk7264/Kconfig +++ b/board/renesas/rsk7264/Kconfig @@ -1,19 +1,15 @@ if TARGET_RSK7264 config SYS_CPU - string default "sh2" config SYS_BOARD - string default "rsk7264" config SYS_VENDOR - string default "renesas" config SYS_CONFIG_NAME - string default "rsk7264" endif diff --git a/board/renesas/rsk7269/Kconfig b/board/renesas/rsk7269/Kconfig index c126fcbadd..cc0092c2fb 100644 --- a/board/renesas/rsk7269/Kconfig +++ b/board/renesas/rsk7269/Kconfig @@ -1,19 +1,15 @@ if TARGET_RSK7269 config SYS_CPU - string default "sh2" config SYS_BOARD - string default "rsk7269" config SYS_VENDOR - string default "renesas" config SYS_CONFIG_NAME - string default "rsk7269" endif diff --git a/board/renesas/sh7752evb/Kconfig b/board/renesas/sh7752evb/Kconfig index 12e52b48ca..7c6aae94bf 100644 --- a/board/renesas/sh7752evb/Kconfig +++ b/board/renesas/sh7752evb/Kconfig @@ -1,19 +1,15 @@ if TARGET_SH7752EVB config SYS_CPU - string default "sh4" config SYS_BOARD - string default "sh7752evb" config SYS_VENDOR - string default "renesas" config SYS_CONFIG_NAME - string default "sh7752evb" endif diff --git a/board/renesas/sh7753evb/Kconfig b/board/renesas/sh7753evb/Kconfig index a1f4cd03ef..8abdea0b13 100644 --- a/board/renesas/sh7753evb/Kconfig +++ b/board/renesas/sh7753evb/Kconfig @@ -1,19 +1,15 @@ if TARGET_SH7753EVB config SYS_CPU - string default "sh4" config SYS_BOARD - string default "sh7753evb" config SYS_VENDOR - string default "renesas" config SYS_CONFIG_NAME - string default "sh7753evb" endif diff --git a/board/renesas/sh7757lcr/Kconfig b/board/renesas/sh7757lcr/Kconfig index a0e3265fcb..97d966feb2 100644 --- a/board/renesas/sh7757lcr/Kconfig +++ b/board/renesas/sh7757lcr/Kconfig @@ -1,19 +1,15 @@ if TARGET_SH7757LCR config SYS_CPU - string default "sh4" config SYS_BOARD - string default "sh7757lcr" config SYS_VENDOR - string default "renesas" config SYS_CONFIG_NAME - string default "sh7757lcr" endif diff --git a/board/renesas/sh7763rdp/Kconfig b/board/renesas/sh7763rdp/Kconfig index fbc11af7cc..d512988138 100644 --- a/board/renesas/sh7763rdp/Kconfig +++ b/board/renesas/sh7763rdp/Kconfig @@ -1,19 +1,15 @@ if TARGET_SH7763RDP config SYS_CPU - string default "sh4" config SYS_BOARD - string default "sh7763rdp" config SYS_VENDOR - string default "renesas" config SYS_CONFIG_NAME - string default "sh7763rdp" endif diff --git a/board/renesas/sh7785lcr/Kconfig b/board/renesas/sh7785lcr/Kconfig index 8939f7d73f..15787e645e 100644 --- a/board/renesas/sh7785lcr/Kconfig +++ b/board/renesas/sh7785lcr/Kconfig @@ -1,19 +1,15 @@ if TARGET_SH7785LCR config SYS_CPU - string default "sh4" config SYS_BOARD - string default "sh7785lcr" config SYS_VENDOR - string default "renesas" config SYS_CONFIG_NAME - string default "sh7785lcr" endif diff --git a/board/ronetix/pm9261/Kconfig b/board/ronetix/pm9261/Kconfig index 1cb9149761..4a2ca02c67 100644 --- a/board/ronetix/pm9261/Kconfig +++ b/board/ronetix/pm9261/Kconfig @@ -1,23 +1,18 @@ if TARGET_PM9261 config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "pm9261" config SYS_VENDOR - string default "ronetix" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "pm9261" endif diff --git a/board/ronetix/pm9263/Kconfig b/board/ronetix/pm9263/Kconfig index 292ccd6905..95129190fd 100644 --- a/board/ronetix/pm9263/Kconfig +++ b/board/ronetix/pm9263/Kconfig @@ -1,23 +1,18 @@ if TARGET_PM9263 config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "pm9263" config SYS_VENDOR - string default "ronetix" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "pm9263" endif diff --git a/board/ronetix/pm9g45/Kconfig b/board/ronetix/pm9g45/Kconfig index e60e9aaef9..0c0af962d4 100644 --- a/board/ronetix/pm9g45/Kconfig +++ b/board/ronetix/pm9g45/Kconfig @@ -1,23 +1,18 @@ if TARGET_PM9G45 config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "pm9g45" config SYS_VENDOR - string default "ronetix" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "pm9g45" endif diff --git a/board/sacsng/Kconfig b/board/sacsng/Kconfig index f716a911f0..1646425101 100644 --- a/board/sacsng/Kconfig +++ b/board/sacsng/Kconfig @@ -1,11 +1,9 @@ if TARGET_SACSNG config SYS_BOARD - string default "sacsng" config SYS_CONFIG_NAME - string default "sacsng" endif diff --git a/board/samsung/arndale/Kconfig b/board/samsung/arndale/Kconfig index 5fdbacbbac..b620974ba0 100644 --- a/board/samsung/arndale/Kconfig +++ b/board/samsung/arndale/Kconfig @@ -1,15 +1,12 @@ if TARGET_ARNDALE config SYS_BOARD - string default "arndale" config SYS_VENDOR - string default "samsung" config SYS_CONFIG_NAME - string default "arndale" endif diff --git a/board/samsung/goni/Kconfig b/board/samsung/goni/Kconfig index 0be535e49a..a320c2bcb5 100644 --- a/board/samsung/goni/Kconfig +++ b/board/samsung/goni/Kconfig @@ -1,23 +1,18 @@ if TARGET_S5P_GONI config SYS_CPU - string default "armv7" config SYS_BOARD - string default "goni" config SYS_VENDOR - string default "samsung" config SYS_SOC - string default "s5pc1xx" config SYS_CONFIG_NAME - string default "s5p_goni" endif diff --git a/board/samsung/odroid/Kconfig b/board/samsung/odroid/Kconfig index 8dcfb4808d..8b52a0d589 100644 --- a/board/samsung/odroid/Kconfig +++ b/board/samsung/odroid/Kconfig @@ -1,15 +1,12 @@ if TARGET_ODROID config SYS_BOARD - string default "odroid" config SYS_VENDOR - string default "samsung" config SYS_CONFIG_NAME - string default "odroid" endif diff --git a/board/samsung/origen/Kconfig b/board/samsung/origen/Kconfig index 3eda350e2d..63e3efe21c 100644 --- a/board/samsung/origen/Kconfig +++ b/board/samsung/origen/Kconfig @@ -1,15 +1,12 @@ if TARGET_ORIGEN config SYS_BOARD - string default "origen" config SYS_VENDOR - string default "samsung" config SYS_CONFIG_NAME - string default "origen" endif diff --git a/board/samsung/smdk2410/Kconfig b/board/samsung/smdk2410/Kconfig index e921c0986c..94f1e3c4cc 100644 --- a/board/samsung/smdk2410/Kconfig +++ b/board/samsung/smdk2410/Kconfig @@ -1,23 +1,18 @@ if TARGET_SMDK2410 config SYS_CPU - string default "arm920t" config SYS_BOARD - string default "smdk2410" config SYS_VENDOR - string default "samsung" config SYS_SOC - string default "s3c24x0" config SYS_CONFIG_NAME - string default "smdk2410" endif diff --git a/board/samsung/smdk5250/Kconfig b/board/samsung/smdk5250/Kconfig index e7036f5965..698ee9125c 100644 --- a/board/samsung/smdk5250/Kconfig +++ b/board/samsung/smdk5250/Kconfig @@ -1,15 +1,12 @@ if TARGET_SMDK5250 config SYS_BOARD - string default "smdk5250" config SYS_VENDOR - string default "samsung" config SYS_CONFIG_NAME - string default "smdk5250" endif @@ -17,15 +14,12 @@ endif if TARGET_SNOW config SYS_BOARD - string default "smdk5250" config SYS_VENDOR - string default "samsung" config SYS_CONFIG_NAME - string default "snow" endif diff --git a/board/samsung/smdk5420/Kconfig b/board/samsung/smdk5420/Kconfig index fb9beddb1c..d3a5b7f7d7 100644 --- a/board/samsung/smdk5420/Kconfig +++ b/board/samsung/smdk5420/Kconfig @@ -1,15 +1,12 @@ if TARGET_PEACH_PIT config SYS_BOARD - string default "smdk5420" config SYS_VENDOR - string default "samsung" config SYS_CONFIG_NAME - string default "peach-pit" endif @@ -17,15 +14,12 @@ endif if TARGET_SMDK5420 config SYS_BOARD - string default "smdk5420" config SYS_VENDOR - string default "samsung" config SYS_CONFIG_NAME - string default "smdk5420" endif diff --git a/board/samsung/smdkc100/Kconfig b/board/samsung/smdkc100/Kconfig index 9c2b4da71c..5e6b0ddcda 100644 --- a/board/samsung/smdkc100/Kconfig +++ b/board/samsung/smdkc100/Kconfig @@ -1,23 +1,18 @@ if TARGET_SMDKC100 config SYS_CPU - string default "armv7" config SYS_BOARD - string default "smdkc100" config SYS_VENDOR - string default "samsung" config SYS_SOC - string default "s5pc1xx" config SYS_CONFIG_NAME - string default "smdkc100" endif diff --git a/board/samsung/smdkv310/Kconfig b/board/samsung/smdkv310/Kconfig index 785fae29b8..a6fd657697 100644 --- a/board/samsung/smdkv310/Kconfig +++ b/board/samsung/smdkv310/Kconfig @@ -1,15 +1,12 @@ if TARGET_SMDKV310 config SYS_BOARD - string default "smdkv310" config SYS_VENDOR - string default "samsung" config SYS_CONFIG_NAME - string default "smdkv310" endif diff --git a/board/samsung/trats/Kconfig b/board/samsung/trats/Kconfig index 8bfb12d5cd..7e8377bb94 100644 --- a/board/samsung/trats/Kconfig +++ b/board/samsung/trats/Kconfig @@ -1,15 +1,12 @@ if TARGET_TRATS config SYS_BOARD - string default "trats" config SYS_VENDOR - string default "samsung" config SYS_CONFIG_NAME - string default "trats" endif diff --git a/board/samsung/trats2/Kconfig b/board/samsung/trats2/Kconfig index f359c03e29..5670e14fae 100644 --- a/board/samsung/trats2/Kconfig +++ b/board/samsung/trats2/Kconfig @@ -1,15 +1,12 @@ if TARGET_TRATS2 config SYS_BOARD - string default "trats2" config SYS_VENDOR - string default "samsung" config SYS_CONFIG_NAME - string default "trats2" endif diff --git a/board/samsung/universal_c210/Kconfig b/board/samsung/universal_c210/Kconfig index 72b879a26b..e692668115 100644 --- a/board/samsung/universal_c210/Kconfig +++ b/board/samsung/universal_c210/Kconfig @@ -1,15 +1,12 @@ if TARGET_S5PC210_UNIVERSAL config SYS_BOARD - string default "universal_c210" config SYS_VENDOR - string default "samsung" config SYS_CONFIG_NAME - string default "s5pc210_universal" endif diff --git a/board/sandburst/karef/Kconfig b/board/sandburst/karef/Kconfig index d4aaea58af..1b04576b9c 100644 --- a/board/sandburst/karef/Kconfig +++ b/board/sandburst/karef/Kconfig @@ -1,15 +1,12 @@ if TARGET_KAREF config SYS_BOARD - string default "karef" config SYS_VENDOR - string default "sandburst" config SYS_CONFIG_NAME - string default "KAREF" endif diff --git a/board/sandburst/metrobox/Kconfig b/board/sandburst/metrobox/Kconfig index be2affc79d..4a771efef4 100644 --- a/board/sandburst/metrobox/Kconfig +++ b/board/sandburst/metrobox/Kconfig @@ -1,15 +1,12 @@ if TARGET_METROBOX config SYS_BOARD - string default "metrobox" config SYS_VENDOR - string default "sandburst" config SYS_CONFIG_NAME - string default "METROBOX" endif diff --git a/board/sandisk/sansa_fuze_plus/Kconfig b/board/sandisk/sansa_fuze_plus/Kconfig index eddbfd8c9a..99e7379cd2 100644 --- a/board/sandisk/sansa_fuze_plus/Kconfig +++ b/board/sandisk/sansa_fuze_plus/Kconfig @@ -1,23 +1,18 @@ if TARGET_SANSA_FUZE_PLUS config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "sansa_fuze_plus" config SYS_VENDOR - string default "sandisk" config SYS_SOC - string default "mxs" config SYS_CONFIG_NAME - string default "sansa_fuze_plus" endif diff --git a/board/sandpoint/Kconfig b/board/sandpoint/Kconfig index 3cc99de214..c19b63e183 100644 --- a/board/sandpoint/Kconfig +++ b/board/sandpoint/Kconfig @@ -1,11 +1,9 @@ if TARGET_SANDPOINT8240 config SYS_BOARD - string default "sandpoint" config SYS_CONFIG_NAME - string default "Sandpoint8240" endif @@ -13,11 +11,9 @@ endif if TARGET_SANDPOINT8245 config SYS_BOARD - string default "sandpoint" config SYS_CONFIG_NAME - string default "Sandpoint8245" endif diff --git a/board/sbc405/Kconfig b/board/sbc405/Kconfig index 77082bfbcf..4e7e843f46 100644 --- a/board/sbc405/Kconfig +++ b/board/sbc405/Kconfig @@ -1,11 +1,9 @@ if TARGET_SBC405 config SYS_BOARD - string default "sbc405" config SYS_CONFIG_NAME - string default "sbc405" endif diff --git a/board/sbc8349/Kconfig b/board/sbc8349/Kconfig index 5b851f8bab..129d6b92ec 100644 --- a/board/sbc8349/Kconfig +++ b/board/sbc8349/Kconfig @@ -1,11 +1,9 @@ if TARGET_SBC8349 config SYS_BOARD - string default "sbc8349" config SYS_CONFIG_NAME - string default "sbc8349" endif diff --git a/board/sbc8548/Kconfig b/board/sbc8548/Kconfig index 5223d3d667..626cbdf2ab 100644 --- a/board/sbc8548/Kconfig +++ b/board/sbc8548/Kconfig @@ -1,11 +1,9 @@ if TARGET_SBC8548 config SYS_BOARD - string default "sbc8548" config SYS_CONFIG_NAME - string default "sbc8548" endif diff --git a/board/sbc8641d/Kconfig b/board/sbc8641d/Kconfig index 7f77bca186..8dfc90cf8b 100644 --- a/board/sbc8641d/Kconfig +++ b/board/sbc8641d/Kconfig @@ -1,11 +1,9 @@ if TARGET_SBC8641D config SYS_BOARD - string default "sbc8641d" config SYS_CONFIG_NAME - string default "sbc8641d" endif diff --git a/board/sc3/Kconfig b/board/sc3/Kconfig index 74694be907..88a6d86d8b 100644 --- a/board/sc3/Kconfig +++ b/board/sc3/Kconfig @@ -1,11 +1,9 @@ if TARGET_SC3 config SYS_BOARD - string default "sc3" config SYS_CONFIG_NAME - string default "sc3" endif diff --git a/board/scb9328/Kconfig b/board/scb9328/Kconfig index 040d055bb6..7ff7dbc4a5 100644 --- a/board/scb9328/Kconfig +++ b/board/scb9328/Kconfig @@ -1,19 +1,15 @@ if TARGET_SCB9328 config SYS_CPU - string default "arm920t" config SYS_BOARD - string default "scb9328" config SYS_SOC - string default "imx" config SYS_CONFIG_NAME - string default "scb9328" endif diff --git a/board/schulercontrol/sc_sps_1/Kconfig b/board/schulercontrol/sc_sps_1/Kconfig index 30071ed74c..379e53b556 100644 --- a/board/schulercontrol/sc_sps_1/Kconfig +++ b/board/schulercontrol/sc_sps_1/Kconfig @@ -1,23 +1,18 @@ if TARGET_SC_SPS_1 config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "sc_sps_1" config SYS_VENDOR - string default "schulercontrol" config SYS_SOC - string default "mxs" config SYS_CONFIG_NAME - string default "sc_sps_1" endif diff --git a/board/shmin/Kconfig b/board/shmin/Kconfig index cb9fb9fa2a..a1c383e1b2 100644 --- a/board/shmin/Kconfig +++ b/board/shmin/Kconfig @@ -1,15 +1,12 @@ if TARGET_SHMIN config SYS_CPU - string default "sh3" config SYS_BOARD - string default "shmin" config SYS_CONFIG_NAME - string default "shmin" endif diff --git a/board/siemens/corvus/Kconfig b/board/siemens/corvus/Kconfig index e24364cab5..80018c51b5 100644 --- a/board/siemens/corvus/Kconfig +++ b/board/siemens/corvus/Kconfig @@ -1,23 +1,18 @@ if TARGET_CORVUS config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "corvus" config SYS_VENDOR - string default "siemens" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "corvus" endif diff --git a/board/siemens/draco/Kconfig b/board/siemens/draco/Kconfig index c6dac1c0c7..b930a76fa9 100644 --- a/board/siemens/draco/Kconfig +++ b/board/siemens/draco/Kconfig @@ -1,23 +1,18 @@ if TARGET_DRACO config SYS_CPU - string default "armv7" config SYS_BOARD - string default "draco" config SYS_VENDOR - string default "siemens" config SYS_SOC - string default "am33xx" config SYS_CONFIG_NAME - string default "draco" endif @@ -25,23 +20,18 @@ endif if TARGET_DXR2 config SYS_CPU - string default "armv7" config SYS_BOARD - string default "draco" config SYS_VENDOR - string default "siemens" config SYS_SOC - string default "am33xx" config SYS_CONFIG_NAME - string default "dxr2" endif diff --git a/board/siemens/pxm2/Kconfig b/board/siemens/pxm2/Kconfig index db695378ce..f76ec69bba 100644 --- a/board/siemens/pxm2/Kconfig +++ b/board/siemens/pxm2/Kconfig @@ -1,23 +1,18 @@ if TARGET_PXM2 config SYS_CPU - string default "armv7" config SYS_BOARD - string default "pxm2" config SYS_VENDOR - string default "siemens" config SYS_SOC - string default "am33xx" config SYS_CONFIG_NAME - string default "pxm2" endif diff --git a/board/siemens/rut/Kconfig b/board/siemens/rut/Kconfig index c4d9e7ef1b..b7e49dac26 100644 --- a/board/siemens/rut/Kconfig +++ b/board/siemens/rut/Kconfig @@ -1,23 +1,18 @@ if TARGET_RUT config SYS_CPU - string default "armv7" config SYS_BOARD - string default "rut" config SYS_VENDOR - string default "siemens" config SYS_SOC - string default "am33xx" config SYS_CONFIG_NAME - string default "rut" endif diff --git a/board/siemens/taurus/Kconfig b/board/siemens/taurus/Kconfig index 3ef14c6129..1fedbd36bc 100644 --- a/board/siemens/taurus/Kconfig +++ b/board/siemens/taurus/Kconfig @@ -1,23 +1,18 @@ if TARGET_TAURUS config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "taurus" config SYS_VENDOR - string default "siemens" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "taurus" endif diff --git a/board/silica/pengwyn/Kconfig b/board/silica/pengwyn/Kconfig index abf86b1bdd..90bfb69e5e 100644 --- a/board/silica/pengwyn/Kconfig +++ b/board/silica/pengwyn/Kconfig @@ -1,23 +1,18 @@ if TARGET_PENGWYN config SYS_CPU - string default "armv7" config SYS_BOARD - string default "pengwyn" config SYS_VENDOR - string default "silica" config SYS_SOC - string default "am33xx" config SYS_CONFIG_NAME - string default "pengwyn" endif diff --git a/board/socrates/Kconfig b/board/socrates/Kconfig index 06abd9d365..ca945c278d 100644 --- a/board/socrates/Kconfig +++ b/board/socrates/Kconfig @@ -1,11 +1,9 @@ if TARGET_SOCRATES config SYS_BOARD - string default "socrates" config SYS_CONFIG_NAME - string default "socrates" endif diff --git a/board/solidrun/hummingboard/Kconfig b/board/solidrun/hummingboard/Kconfig index a412347666..a4eb62fcef 100644 --- a/board/solidrun/hummingboard/Kconfig +++ b/board/solidrun/hummingboard/Kconfig @@ -1,23 +1,18 @@ if TARGET_HUMMINGBOARD config SYS_CPU - string default "armv7" config SYS_BOARD - string default "hummingboard" config SYS_VENDOR - string default "solidrun" config SYS_SOC - string default "mx6" config SYS_CONFIG_NAME - string default "hummingboard" endif diff --git a/board/spd8xx/Kconfig b/board/spd8xx/Kconfig index 4845cba28f..2430616ec2 100644 --- a/board/spd8xx/Kconfig +++ b/board/spd8xx/Kconfig @@ -1,11 +1,9 @@ if TARGET_SPD823TS config SYS_BOARD - string default "spd8xx" config SYS_CONFIG_NAME - string default "SPD823TS" endif diff --git a/board/spear/spear300/Kconfig b/board/spear/spear300/Kconfig index 7e49e34253..5b702ced69 100644 --- a/board/spear/spear300/Kconfig +++ b/board/spear/spear300/Kconfig @@ -1,23 +1,18 @@ if TARGET_SPEAR300 config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "spear300" config SYS_VENDOR - string default "spear" config SYS_SOC - string default "spear" config SYS_CONFIG_NAME - string default "spear3xx_evb" endif diff --git a/board/spear/spear310/Kconfig b/board/spear/spear310/Kconfig index de7104029a..b8f5154733 100644 --- a/board/spear/spear310/Kconfig +++ b/board/spear/spear310/Kconfig @@ -1,23 +1,18 @@ if TARGET_SPEAR310 config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "spear310" config SYS_VENDOR - string default "spear" config SYS_SOC - string default "spear" config SYS_CONFIG_NAME - string default "spear3xx_evb" endif diff --git a/board/spear/spear320/Kconfig b/board/spear/spear320/Kconfig index 4cf6baf08d..150d64ff98 100644 --- a/board/spear/spear320/Kconfig +++ b/board/spear/spear320/Kconfig @@ -1,23 +1,18 @@ if TARGET_SPEAR320 config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "spear320" config SYS_VENDOR - string default "spear" config SYS_SOC - string default "spear" config SYS_CONFIG_NAME - string default "spear3xx_evb" endif diff --git a/board/spear/spear600/Kconfig b/board/spear/spear600/Kconfig index d62f9e7bec..f03e19ebd3 100644 --- a/board/spear/spear600/Kconfig +++ b/board/spear/spear600/Kconfig @@ -1,23 +1,18 @@ if TARGET_SPEAR600 config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "spear600" config SYS_VENDOR - string default "spear" config SYS_SOC - string default "spear" config SYS_CONFIG_NAME - string default "spear6xx_evb" endif diff --git a/board/spear/x600/Kconfig b/board/spear/x600/Kconfig index a9245591bf..620be5f56e 100644 --- a/board/spear/x600/Kconfig +++ b/board/spear/x600/Kconfig @@ -1,23 +1,18 @@ if TARGET_X600 config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "x600" config SYS_VENDOR - string default "spear" config SYS_SOC - string default "spear" config SYS_CONFIG_NAME - string default "x600" endif diff --git a/board/st-ericsson/snowball/Kconfig b/board/st-ericsson/snowball/Kconfig index b5ead0fcfa..7eb99697d5 100644 --- a/board/st-ericsson/snowball/Kconfig +++ b/board/st-ericsson/snowball/Kconfig @@ -1,23 +1,18 @@ if TARGET_SNOWBALL config SYS_CPU - string default "armv7" config SYS_BOARD - string default "snowball" config SYS_VENDOR - string default "st-ericsson" config SYS_SOC - string default "u8500" config SYS_CONFIG_NAME - string default "snowball" endif diff --git a/board/st-ericsson/u8500/Kconfig b/board/st-ericsson/u8500/Kconfig index bbcfdafc54..ca25876269 100644 --- a/board/st-ericsson/u8500/Kconfig +++ b/board/st-ericsson/u8500/Kconfig @@ -1,23 +1,18 @@ if TARGET_U8500_HREF config SYS_CPU - string default "armv7" config SYS_BOARD - string default "u8500" config SYS_VENDOR - string default "st-ericsson" config SYS_SOC - string default "u8500" config SYS_CONFIG_NAME - string default "u8500_href" endif diff --git a/board/st/nhk8815/Kconfig b/board/st/nhk8815/Kconfig index ba2e7c2e09..94547dc118 100644 --- a/board/st/nhk8815/Kconfig +++ b/board/st/nhk8815/Kconfig @@ -1,15 +1,12 @@ if NOMADIK_NHK8815 config SYS_BOARD - string default "nhk8815" config SYS_VENDOR - string default "st" config SYS_CONFIG_NAME - string default "nhk8815" endif diff --git a/board/stx/stxgp3/Kconfig b/board/stx/stxgp3/Kconfig index aac2940f78..910b31b24f 100644 --- a/board/stx/stxgp3/Kconfig +++ b/board/stx/stxgp3/Kconfig @@ -1,15 +1,12 @@ if TARGET_STXGP3 config SYS_BOARD - string default "stxgp3" config SYS_VENDOR - string default "stx" config SYS_CONFIG_NAME - string default "stxgp3" endif diff --git a/board/stx/stxssa/Kconfig b/board/stx/stxssa/Kconfig index 06dd8bef8b..bd47b04444 100644 --- a/board/stx/stxssa/Kconfig +++ b/board/stx/stxssa/Kconfig @@ -1,15 +1,12 @@ if TARGET_STXSSA config SYS_BOARD - string default "stxssa" config SYS_VENDOR - string default "stx" config SYS_CONFIG_NAME - string default "stxssa" endif diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index 7bdf958afe..bcd0a55a1e 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -1,7 +1,6 @@ if TARGET_SUN4I config SYS_CONFIG_NAME - string default "sun4i" endif @@ -9,7 +8,6 @@ endif if TARGET_SUN5I config SYS_CONFIG_NAME - string default "sun5i" endif @@ -17,7 +15,6 @@ endif if TARGET_SUN7I config SYS_CONFIG_NAME - string default "sun7i" endif @@ -25,15 +22,12 @@ endif if TARGET_SUN4I || TARGET_SUN5I || TARGET_SUN7I config SYS_CPU - string default "armv7" config SYS_BOARD - string default "sunxi" config SYS_SOC - string default "sunxi" config FDTFILE diff --git a/board/synopsys/Kconfig b/board/synopsys/Kconfig index 22034c19f1..a54d3dfde3 100644 --- a/board/synopsys/Kconfig +++ b/board/synopsys/Kconfig @@ -1,15 +1,12 @@ if TARGET_ARCANGEL4 config SYS_CPU - string default "arc700" config SYS_VENDOR - string default "synopsys" config SYS_CONFIG_NAME - string default "arcangel4" endif @@ -17,15 +14,12 @@ endif if TARGET_ARCANGEL4_BE config SYS_CPU - string default "arc700" config SYS_VENDOR - string default "synopsys" config SYS_CONFIG_NAME - string default "arcangel4-be" endif diff --git a/board/synopsys/axs101/Kconfig b/board/synopsys/axs101/Kconfig index 535b8ebf48..8448265888 100644 --- a/board/synopsys/axs101/Kconfig +++ b/board/synopsys/axs101/Kconfig @@ -1,19 +1,15 @@ if TARGET_AXS101 config SYS_CPU - string default "arc700" config SYS_BOARD - string default "axs101" config SYS_VENDOR - string default "synopsys" config SYS_CONFIG_NAME - string default "axs101" endif diff --git a/board/syteco/jadecpu/Kconfig b/board/syteco/jadecpu/Kconfig index c00204a785..3965e90ad9 100644 --- a/board/syteco/jadecpu/Kconfig +++ b/board/syteco/jadecpu/Kconfig @@ -1,23 +1,18 @@ if TARGET_JADECPU config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "jadecpu" config SYS_VENDOR - string default "syteco" config SYS_SOC - string default "mb86r0x" config SYS_CONFIG_NAME - string default "jadecpu" endif diff --git a/board/syteco/zmx25/Kconfig b/board/syteco/zmx25/Kconfig index dbf34e5f05..260774dced 100644 --- a/board/syteco/zmx25/Kconfig +++ b/board/syteco/zmx25/Kconfig @@ -1,23 +1,18 @@ if TARGET_ZMX25 config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "zmx25" config SYS_VENDOR - string default "syteco" config SYS_SOC - string default "mx25" config SYS_CONFIG_NAME - string default "zmx25" endif diff --git a/board/t3corp/Kconfig b/board/t3corp/Kconfig index 818293a2e6..82ed4c95b8 100644 --- a/board/t3corp/Kconfig +++ b/board/t3corp/Kconfig @@ -1,11 +1,9 @@ if TARGET_T3CORP config SYS_BOARD - string default "t3corp" config SYS_CONFIG_NAME - string default "t3corp" endif diff --git a/board/taskit/stamp9g20/Kconfig b/board/taskit/stamp9g20/Kconfig index 3aecad90df..67be227b72 100644 --- a/board/taskit/stamp9g20/Kconfig +++ b/board/taskit/stamp9g20/Kconfig @@ -1,23 +1,18 @@ if TARGET_STAMP9G20 config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "stamp9g20" config SYS_VENDOR - string default "taskit" config SYS_SOC - string default "at91" config SYS_CONFIG_NAME - string default "stamp9g20" endif diff --git a/board/tcm-bf518/Kconfig b/board/tcm-bf518/Kconfig index a24609921b..558c2fe495 100644 --- a/board/tcm-bf518/Kconfig +++ b/board/tcm-bf518/Kconfig @@ -1,11 +1,9 @@ if TARGET_TCM_BF518 config SYS_BOARD - string default "tcm-bf518" config SYS_CONFIG_NAME - string default "tcm-bf518" endif diff --git a/board/tcm-bf537/Kconfig b/board/tcm-bf537/Kconfig index a7f1b21a3b..e0127c641e 100644 --- a/board/tcm-bf537/Kconfig +++ b/board/tcm-bf537/Kconfig @@ -1,11 +1,9 @@ if TARGET_TCM_BF537 config SYS_BOARD - string default "tcm-bf537" config SYS_CONFIG_NAME - string default "tcm-bf537" endif diff --git a/board/technexion/tao3530/Kconfig b/board/technexion/tao3530/Kconfig index 910a9cdaa7..27bc91f8ca 100644 --- a/board/technexion/tao3530/Kconfig +++ b/board/technexion/tao3530/Kconfig @@ -1,15 +1,12 @@ if TARGET_TAO3530 config SYS_BOARD - string default "tao3530" config SYS_VENDOR - string default "technexion" config SYS_CONFIG_NAME - string default "tao3530" endif diff --git a/board/technexion/twister/Kconfig b/board/technexion/twister/Kconfig index e6f811a19d..4c0ace8edd 100644 --- a/board/technexion/twister/Kconfig +++ b/board/technexion/twister/Kconfig @@ -1,15 +1,12 @@ if TARGET_TWISTER config SYS_BOARD - string default "twister" config SYS_VENDOR - string default "technexion" config SYS_CONFIG_NAME - string default "twister" endif diff --git a/board/teejet/mt_ventoux/Kconfig b/board/teejet/mt_ventoux/Kconfig index a5672049bf..fd7196a6f9 100644 --- a/board/teejet/mt_ventoux/Kconfig +++ b/board/teejet/mt_ventoux/Kconfig @@ -1,15 +1,12 @@ if TARGET_MT_VENTOUX config SYS_BOARD - string default "mt_ventoux" config SYS_VENDOR - string default "teejet" config SYS_CONFIG_NAME - string default "mt_ventoux" endif diff --git a/board/ti/am335x/Kconfig b/board/ti/am335x/Kconfig index 80701f5b98..d8958ef0b8 100644 --- a/board/ti/am335x/Kconfig +++ b/board/ti/am335x/Kconfig @@ -1,23 +1,18 @@ if TARGET_AM335X_EVM config SYS_CPU - string default "armv7" config SYS_BOARD - string default "am335x" config SYS_VENDOR - string default "ti" config SYS_SOC - string default "am33xx" config SYS_CONFIG_NAME - string default "am335x_evm" config CONS_INDEX diff --git a/board/ti/am3517crane/Kconfig b/board/ti/am3517crane/Kconfig index c44dab5b61..ad025a3228 100644 --- a/board/ti/am3517crane/Kconfig +++ b/board/ti/am3517crane/Kconfig @@ -1,15 +1,12 @@ if TARGET_AM3517_CRANE config SYS_BOARD - string default "am3517crane" config SYS_VENDOR - string default "ti" config SYS_CONFIG_NAME - string default "am3517_crane" endif diff --git a/board/ti/am43xx/Kconfig b/board/ti/am43xx/Kconfig index 3c61ec1d76..47b96bd7ed 100644 --- a/board/ti/am43xx/Kconfig +++ b/board/ti/am43xx/Kconfig @@ -1,23 +1,18 @@ if TARGET_AM43XX_EVM config SYS_CPU - string default "armv7" config SYS_BOARD - string default "am43xx" config SYS_VENDOR - string default "ti" config SYS_SOC - string default "am33xx" config SYS_CONFIG_NAME - string default "am43xx_evm" endif diff --git a/board/ti/beagle/Kconfig b/board/ti/beagle/Kconfig index 10c81c2bee..c2eff9e71b 100644 --- a/board/ti/beagle/Kconfig +++ b/board/ti/beagle/Kconfig @@ -1,15 +1,12 @@ if TARGET_OMAP3_BEAGLE config SYS_BOARD - string default "beagle" config SYS_VENDOR - string default "ti" config SYS_CONFIG_NAME - string default "omap3_beagle" endif diff --git a/board/ti/dra7xx/Kconfig b/board/ti/dra7xx/Kconfig index 9ee13c53d3..3bbd86644d 100644 --- a/board/ti/dra7xx/Kconfig +++ b/board/ti/dra7xx/Kconfig @@ -1,15 +1,12 @@ if TARGET_DRA7XX_EVM config SYS_BOARD - string default "dra7xx" config SYS_VENDOR - string default "ti" config SYS_CONFIG_NAME - string default "dra7xx_evm" endif diff --git a/board/ti/evm/Kconfig b/board/ti/evm/Kconfig index c54ce3322b..f02aa31a91 100644 --- a/board/ti/evm/Kconfig +++ b/board/ti/evm/Kconfig @@ -1,15 +1,12 @@ if TARGET_OMAP3_EVM config SYS_BOARD - string default "evm" config SYS_VENDOR - string default "ti" config SYS_CONFIG_NAME - string default "omap3_evm" endif @@ -17,15 +14,12 @@ endif if TARGET_OMAP3_EVM_QUICK_MMC config SYS_BOARD - string default "evm" config SYS_VENDOR - string default "ti" config SYS_CONFIG_NAME - string default "omap3_evm_quick_mmc" endif @@ -33,15 +27,12 @@ endif if TARGET_OMAP3_EVM_QUICK_NAND config SYS_BOARD - string default "evm" config SYS_VENDOR - string default "ti" config SYS_CONFIG_NAME - string default "omap3_evm_quick_nand" endif diff --git a/board/ti/ks2_evm/Kconfig b/board/ti/ks2_evm/Kconfig index 3108782876..9c1e103a20 100644 --- a/board/ti/ks2_evm/Kconfig +++ b/board/ti/ks2_evm/Kconfig @@ -1,15 +1,12 @@ if TARGET_K2E_EVM config SYS_BOARD - string default "ks2_evm" config SYS_VENDOR - string default "ti" config SYS_CONFIG_NAME - string default "k2e_evm" endif @@ -17,15 +14,12 @@ endif if TARGET_K2HK_EVM config SYS_BOARD - string default "ks2_evm" config SYS_VENDOR - string default "ti" config SYS_CONFIG_NAME - string default "k2hk_evm" endif diff --git a/board/ti/ks2_evm/ddr3_k2hk.c b/board/ti/ks2_evm/ddr3_k2hk.c index 21a5a0a252..6070a99770 100644 --- a/board/ti/ks2_evm/ddr3_k2hk.c +++ b/board/ti/ks2_evm/ddr3_k2hk.c @@ -81,4 +81,8 @@ void ddr3_init(void) while (1) ; } + + /* Apply the workaround for PG 1.0 and 1.1 Silicons */ + if (cpu_revision() <= 1) + ddr3_err_reset_workaround(); } diff --git a/board/ti/omap5_uevm/Kconfig b/board/ti/omap5_uevm/Kconfig index 3592e7be03..aa13844544 100644 --- a/board/ti/omap5_uevm/Kconfig +++ b/board/ti/omap5_uevm/Kconfig @@ -1,15 +1,12 @@ if TARGET_OMAP5_UEVM config SYS_BOARD - string default "omap5_uevm" config SYS_VENDOR - string default "ti" config SYS_CONFIG_NAME - string default "omap5_uevm" endif diff --git a/board/ti/panda/Kconfig b/board/ti/panda/Kconfig index b69218b6c3..8f277b612a 100644 --- a/board/ti/panda/Kconfig +++ b/board/ti/panda/Kconfig @@ -1,15 +1,12 @@ if TARGET_OMAP4_PANDA config SYS_BOARD - string default "panda" config SYS_VENDOR - string default "ti" config SYS_CONFIG_NAME - string default "omap4_panda" endif diff --git a/board/ti/sdp3430/Kconfig b/board/ti/sdp3430/Kconfig index fcf732989b..7e73d99aba 100644 --- a/board/ti/sdp3430/Kconfig +++ b/board/ti/sdp3430/Kconfig @@ -1,15 +1,12 @@ if TARGET_OMAP3_SDP3430 config SYS_BOARD - string default "sdp3430" config SYS_VENDOR - string default "ti" config SYS_CONFIG_NAME - string default "omap3_sdp3430" endif diff --git a/board/ti/sdp4430/Kconfig b/board/ti/sdp4430/Kconfig index 9c1d8fe35a..5826d8fd0b 100644 --- a/board/ti/sdp4430/Kconfig +++ b/board/ti/sdp4430/Kconfig @@ -1,15 +1,12 @@ if TARGET_OMAP4_SDP4430 config SYS_BOARD - string default "sdp4430" config SYS_VENDOR - string default "ti" config SYS_CONFIG_NAME - string default "omap4_sdp4430" endif diff --git a/board/ti/ti814x/Kconfig b/board/ti/ti814x/Kconfig index 4d4f52cef4..9bd3d73427 100644 --- a/board/ti/ti814x/Kconfig +++ b/board/ti/ti814x/Kconfig @@ -1,23 +1,18 @@ if TARGET_TI814X_EVM config SYS_CPU - string default "armv7" config SYS_BOARD - string default "ti814x" config SYS_VENDOR - string default "ti" config SYS_SOC - string default "am33xx" config SYS_CONFIG_NAME - string default "ti814x_evm" endif diff --git a/board/ti/ti816x/Kconfig b/board/ti/ti816x/Kconfig index 5821172b34..c0bdb9eac3 100644 --- a/board/ti/ti816x/Kconfig +++ b/board/ti/ti816x/Kconfig @@ -1,23 +1,18 @@ if TARGET_TI816X_EVM config SYS_CPU - string default "armv7" config SYS_BOARD - string default "ti816x" config SYS_VENDOR - string default "ti" config SYS_SOC - string default "am33xx" config SYS_CONFIG_NAME - string default "ti816x_evm" endif diff --git a/board/ti/tnetv107xevm/Kconfig b/board/ti/tnetv107xevm/Kconfig index 9cffd7c646..aa80d0f41a 100644 --- a/board/ti/tnetv107xevm/Kconfig +++ b/board/ti/tnetv107xevm/Kconfig @@ -1,23 +1,18 @@ if TARGET_TNETV107X_EVM config SYS_CPU - string default "arm1176" config SYS_BOARD - string default "tnetv107xevm" config SYS_VENDOR - string default "ti" config SYS_SOC - string default "tnetv107x" config SYS_CONFIG_NAME - string default "tnetv107x_evm" endif diff --git a/board/timll/devkit3250/Kconfig b/board/timll/devkit3250/Kconfig index 4caee60210..087356d4ba 100644 --- a/board/timll/devkit3250/Kconfig +++ b/board/timll/devkit3250/Kconfig @@ -1,23 +1,18 @@ if TARGET_DEVKIT3250 config SYS_CPU - string default "arm926ejs" config SYS_BOARD - string default "devkit3250" config SYS_VENDOR - string default "timll" config SYS_SOC - string default "lpc32xx" config SYS_CONFIG_NAME - string default "devkit3250" endif diff --git a/board/timll/devkit8000/Kconfig b/board/timll/devkit8000/Kconfig index d1603f4741..3c63ced9a1 100644 --- a/board/timll/devkit8000/Kconfig +++ b/board/timll/devkit8000/Kconfig @@ -1,15 +1,12 @@ if TARGET_DEVKIT8000 config SYS_BOARD - string default "devkit8000" config SYS_VENDOR - string default "timll" config SYS_CONFIG_NAME - string default "devkit8000" endif diff --git a/board/toradex/colibri_pxa270/Kconfig b/board/toradex/colibri_pxa270/Kconfig index 9367c8898e..e4b1a5e508 100644 --- a/board/toradex/colibri_pxa270/Kconfig +++ b/board/toradex/colibri_pxa270/Kconfig @@ -1,19 +1,15 @@ if TARGET_COLIBRI_PXA270 config SYS_CPU - string default "pxa" config SYS_BOARD - string default "colibri_pxa270" config SYS_VENDOR - string default "toradex" config SYS_CONFIG_NAME - string default "colibri_pxa270" endif diff --git a/board/toradex/colibri_t20_iris/Kconfig b/board/toradex/colibri_t20_iris/Kconfig index cccdd584c8..4bf727809e 100644 --- a/board/toradex/colibri_t20_iris/Kconfig +++ b/board/toradex/colibri_t20_iris/Kconfig @@ -1,15 +1,12 @@ if TARGET_COLIBRI_T20_IRIS config SYS_BOARD - string default "colibri_t20_iris" config SYS_VENDOR - string default "toradex" config SYS_CONFIG_NAME - string default "colibri_t20_iris" endif diff --git a/board/toradex/colibri_t30/Kconfig b/board/toradex/colibri_t30/Kconfig index ea6c08a59c..3e436a2d3f 100644 --- a/board/toradex/colibri_t30/Kconfig +++ b/board/toradex/colibri_t30/Kconfig @@ -1,15 +1,12 @@ if TARGET_COLIBRI_T30 config SYS_BOARD - string default "colibri_t30" config SYS_VENDOR - string default "toradex" config SYS_CONFIG_NAME - string default "colibri_t30" endif diff --git a/board/total5200/Kconfig b/board/total5200/Kconfig index 774eb9889e..ffa9516a55 100644 --- a/board/total5200/Kconfig +++ b/board/total5200/Kconfig @@ -1,11 +1,9 @@ if TARGET_TOTAL5200 config SYS_BOARD - string default "total5200" config SYS_CONFIG_NAME - string default "Total5200" endif diff --git a/board/tqc/tqm5200/Kconfig b/board/tqc/tqm5200/Kconfig index c692196550..0e4cd69a2d 100644 --- a/board/tqc/tqm5200/Kconfig +++ b/board/tqc/tqm5200/Kconfig @@ -1,15 +1,12 @@ if TARGET_AEV config SYS_BOARD - string default "tqm5200" config SYS_VENDOR - string default "tqc" config SYS_CONFIG_NAME - string default "aev" endif @@ -17,15 +14,12 @@ endif if TARGET_CHARON config SYS_BOARD - string default "tqm5200" config SYS_VENDOR - string default "tqc" config SYS_CONFIG_NAME - string default "charon" endif @@ -33,15 +27,12 @@ endif if TARGET_TB5200 config SYS_BOARD - string default "tqm5200" config SYS_VENDOR - string default "tqc" config SYS_CONFIG_NAME - string default "TB5200" endif @@ -49,15 +40,12 @@ endif if TARGET_TQM5200 config SYS_BOARD - string default "tqm5200" config SYS_VENDOR - string default "tqc" config SYS_CONFIG_NAME - string default "TQM5200" endif diff --git a/board/tqc/tqm8260/Kconfig b/board/tqc/tqm8260/Kconfig index 0cf80ddb80..90a96ebebe 100644 --- a/board/tqc/tqm8260/Kconfig +++ b/board/tqc/tqm8260/Kconfig @@ -1,15 +1,12 @@ if TARGET_TQM8260 config SYS_BOARD - string default "tqm8260" config SYS_VENDOR - string default "tqc" config SYS_CONFIG_NAME - string default "TQM8260" endif diff --git a/board/tqc/tqm8272/Kconfig b/board/tqc/tqm8272/Kconfig index 9be43d3bae..7b5cd8bc7c 100644 --- a/board/tqc/tqm8272/Kconfig +++ b/board/tqc/tqm8272/Kconfig @@ -1,15 +1,12 @@ if TARGET_TQM8272 config SYS_BOARD - string default "tqm8272" config SYS_VENDOR - string default "tqc" config SYS_CONFIG_NAME - string default "TQM8272" endif diff --git a/board/tqc/tqm834x/Kconfig b/board/tqc/tqm834x/Kconfig index cd2e817a4e..028b8466e8 100644 --- a/board/tqc/tqm834x/Kconfig +++ b/board/tqc/tqm834x/Kconfig @@ -1,15 +1,12 @@ if TARGET_TQM834X config SYS_BOARD - string default "tqm834x" config SYS_VENDOR - string default "tqc" config SYS_CONFIG_NAME - string default "TQM834x" endif diff --git a/board/tqc/tqm8xx/Kconfig b/board/tqc/tqm8xx/Kconfig index 5700d22162..926a37afc5 100644 --- a/board/tqc/tqm8xx/Kconfig +++ b/board/tqc/tqm8xx/Kconfig @@ -1,15 +1,12 @@ if TARGET_FPS850L config SYS_BOARD - string default "tqm8xx" config SYS_VENDOR - string default "tqc" config SYS_CONFIG_NAME - string default "FPS850L" endif @@ -17,15 +14,12 @@ endif if TARGET_FPS860L config SYS_BOARD - string default "tqm8xx" config SYS_VENDOR - string default "tqc" config SYS_CONFIG_NAME - string default "FPS860L" endif @@ -33,15 +27,12 @@ endif if TARGET_NSCU config SYS_BOARD - string default "tqm8xx" config SYS_VENDOR - string default "tqc" config SYS_CONFIG_NAME - string default "NSCU" endif @@ -49,15 +40,12 @@ endif if TARGET_SM850 config SYS_BOARD - string default "tqm8xx" config SYS_VENDOR - string default "tqc" config SYS_CONFIG_NAME - string default "SM850" endif @@ -65,15 +53,12 @@ endif if TARGET_TK885D config SYS_BOARD - string default "tqm8xx" config SYS_VENDOR - string default "tqc" config SYS_CONFIG_NAME - string default "TK885D" endif @@ -81,15 +66,12 @@ endif if TARGET_TQM823L config SYS_BOARD - string default "tqm8xx" config SYS_VENDOR - string default "tqc" config SYS_CONFIG_NAME - string default "TQM823L" endif @@ -97,15 +79,12 @@ endif if TARGET_TQM823M config SYS_BOARD - string default "tqm8xx" config SYS_VENDOR - string default "tqc" config SYS_CONFIG_NAME - string default "TQM823M" endif @@ -113,15 +92,12 @@ endif if TARGET_TQM850L config SYS_BOARD - string default "tqm8xx" config SYS_VENDOR - string default "tqc" config SYS_CONFIG_NAME - string default "TQM850L" endif @@ -129,15 +105,12 @@ endif if TARGET_TQM850M config SYS_BOARD - string default "tqm8xx" config SYS_VENDOR - string default "tqc" config SYS_CONFIG_NAME - string default "TQM850M" endif @@ -145,15 +118,12 @@ endif if TARGET_TQM855L config SYS_BOARD - string default "tqm8xx" config SYS_VENDOR - string default "tqc" config SYS_CONFIG_NAME - string default "TQM855L" endif @@ -161,15 +131,12 @@ endif if TARGET_TQM855M config SYS_BOARD - string default "tqm8xx" config SYS_VENDOR - string default "tqc" config SYS_CONFIG_NAME - string default "TQM855M" endif @@ -177,15 +144,12 @@ endif if TARGET_TQM860L config SYS_BOARD - string default "tqm8xx" config SYS_VENDOR - string default "tqc" config SYS_CONFIG_NAME - string default "TQM860L" endif @@ -193,15 +157,12 @@ endif if TARGET_TQM860M config SYS_BOARD - string default "tqm8xx" config SYS_VENDOR - string default "tqc" config SYS_CONFIG_NAME - string default "TQM860M" endif @@ -209,15 +170,12 @@ endif if TARGET_TQM862L config SYS_BOARD - string default "tqm8xx" config SYS_VENDOR - string default "tqc" config SYS_CONFIG_NAME - string default "TQM862L" endif @@ -225,15 +183,12 @@ endif if TARGET_TQM862M config SYS_BOARD - string default "tqm8xx" config SYS_VENDOR - string default "tqc" config SYS_CONFIG_NAME - string default "TQM862M" endif @@ -241,15 +196,12 @@ endif if TARGET_TQM866M config SYS_BOARD - string default "tqm8xx" config SYS_VENDOR - string default "tqc" config SYS_CONFIG_NAME - string default "TQM866M" endif @@ -257,15 +209,12 @@ endif if TARGET_TQM885D config SYS_BOARD - string default "tqm8xx" config SYS_VENDOR - string default "tqc" config SYS_CONFIG_NAME - string default "TQM885D" endif @@ -273,15 +222,12 @@ endif if TARGET_VIRTLAB2 config SYS_BOARD - string default "tqm8xx" config SYS_VENDOR - string default "tqc" config SYS_CONFIG_NAME - string default "virtlab2" endif diff --git a/board/tqc/tqma6/Kconfig b/board/tqc/tqma6/Kconfig index 44b4142924..b70cbf09df 100644 --- a/board/tqc/tqma6/Kconfig +++ b/board/tqc/tqma6/Kconfig @@ -1,23 +1,18 @@ if TARGET_TQMA6 config SYS_CPU - string default "armv7" config SYS_BOARD - string default "tqma6" config SYS_VENDOR - string default "tqc" config SYS_SOC - string default "mx6" config SYS_CONFIG_NAME - string default "tqma6" endif diff --git a/board/trizepsiv/Kconfig b/board/trizepsiv/Kconfig index ddd2ce3f3e..9844c692a1 100644 --- a/board/trizepsiv/Kconfig +++ b/board/trizepsiv/Kconfig @@ -1,15 +1,12 @@ if TARGET_TRIZEPSIV config SYS_CPU - string default "pxa" config SYS_BOARD - string default "trizepsiv" config SYS_CONFIG_NAME - string default "trizepsiv" endif diff --git a/board/ttcontrol/vision2/Kconfig b/board/ttcontrol/vision2/Kconfig index 3b18bea57a..4e2271bdad 100644 --- a/board/ttcontrol/vision2/Kconfig +++ b/board/ttcontrol/vision2/Kconfig @@ -1,23 +1,18 @@ if TARGET_VISION2 config SYS_CPU - string default "armv7" config SYS_BOARD - string default "vision2" config SYS_VENDOR - string default "ttcontrol" config SYS_SOC - string default "mx5" config SYS_CONFIG_NAME - string default "vision2" endif diff --git a/board/udoo/Kconfig b/board/udoo/Kconfig index 69dbce0e25..a98d0d6a4c 100644 --- a/board/udoo/Kconfig +++ b/board/udoo/Kconfig @@ -1,19 +1,15 @@ if TARGET_UDOO config SYS_CPU - string default "armv7" config SYS_BOARD - string default "udoo" config SYS_SOC - string default "mx6" config SYS_CONFIG_NAME - string default "udoo" endif diff --git a/board/utx8245/Kconfig b/board/utx8245/Kconfig index 3dd264b0ca..aec0eb96ad 100644 --- a/board/utx8245/Kconfig +++ b/board/utx8245/Kconfig @@ -1,11 +1,9 @@ if TARGET_UTX8245 config SYS_BOARD - string default "utx8245" config SYS_CONFIG_NAME - string default "utx8245" endif diff --git a/board/v38b/Kconfig b/board/v38b/Kconfig index f473d89e58..653bfc1c3b 100644 --- a/board/v38b/Kconfig +++ b/board/v38b/Kconfig @@ -1,11 +1,9 @@ if TARGET_V38B config SYS_BOARD - string default "v38b" config SYS_CONFIG_NAME - string default "v38b" endif diff --git a/board/ve8313/Kconfig b/board/ve8313/Kconfig index ed9efbfbb6..a63744b154 100644 --- a/board/ve8313/Kconfig +++ b/board/ve8313/Kconfig @@ -1,11 +1,9 @@ if TARGET_VE8313 config SYS_BOARD - string default "ve8313" config SYS_CONFIG_NAME - string default "ve8313" endif diff --git a/board/vpac270/Kconfig b/board/vpac270/Kconfig index e9170b0b7a..a046f01f6d 100644 --- a/board/vpac270/Kconfig +++ b/board/vpac270/Kconfig @@ -1,15 +1,12 @@ if TARGET_VPAC270 config SYS_CPU - string default "pxa" config SYS_BOARD - string default "vpac270" config SYS_CONFIG_NAME - string default "vpac270" endif diff --git a/board/w7o/Kconfig b/board/w7o/Kconfig index c0e879a6b7..fd1b422318 100644 --- a/board/w7o/Kconfig +++ b/board/w7o/Kconfig @@ -1,11 +1,9 @@ if TARGET_W7OLMC config SYS_BOARD - string default "w7o" config SYS_CONFIG_NAME - string default "W7OLMC" endif @@ -13,11 +11,9 @@ endif if TARGET_W7OLMG config SYS_BOARD - string default "w7o" config SYS_CONFIG_NAME - string default "W7OLMG" endif diff --git a/board/wandboard/Kconfig b/board/wandboard/Kconfig index a323afab2a..c8627693f2 100644 --- a/board/wandboard/Kconfig +++ b/board/wandboard/Kconfig @@ -1,19 +1,15 @@ if TARGET_WANDBOARD config SYS_CPU - string default "armv7" config SYS_BOARD - string default "wandboard" config SYS_SOC - string default "mx6" config SYS_CONFIG_NAME - string default "wandboard" endif diff --git a/board/woodburn/Kconfig b/board/woodburn/Kconfig index 1aca934f03..67023199b6 100644 --- a/board/woodburn/Kconfig +++ b/board/woodburn/Kconfig @@ -1,19 +1,15 @@ if TARGET_WOODBURN config SYS_CPU - string default "arm1136" config SYS_BOARD - string default "woodburn" config SYS_SOC - string default "mx35" config SYS_CONFIG_NAME - string default "woodburn" endif @@ -21,19 +17,15 @@ endif if TARGET_WOODBURN_SD config SYS_CPU - string default "arm1136" config SYS_BOARD - string default "woodburn" config SYS_SOC - string default "mx35" config SYS_CONFIG_NAME - string default "woodburn_sd" endif diff --git a/board/xaeniax/Kconfig b/board/xaeniax/Kconfig index 9b41435911..288f24b227 100644 --- a/board/xaeniax/Kconfig +++ b/board/xaeniax/Kconfig @@ -1,15 +1,12 @@ if TARGET_XAENIAX config SYS_CPU - string default "pxa" config SYS_BOARD - string default "xaeniax" config SYS_CONFIG_NAME - string default "xaeniax" endif diff --git a/board/xes/xpedite1000/Kconfig b/board/xes/xpedite1000/Kconfig index 115439a249..4d0ab2f66e 100644 --- a/board/xes/xpedite1000/Kconfig +++ b/board/xes/xpedite1000/Kconfig @@ -1,15 +1,12 @@ if TARGET_XPEDITE1000 config SYS_BOARD - string default "xpedite1000" config SYS_VENDOR - string default "xes" config SYS_CONFIG_NAME - string default "xpedite1000" endif diff --git a/board/xes/xpedite517x/Kconfig b/board/xes/xpedite517x/Kconfig index b938746990..91bbd22451 100644 --- a/board/xes/xpedite517x/Kconfig +++ b/board/xes/xpedite517x/Kconfig @@ -1,15 +1,12 @@ if TARGET_XPEDITE517X config SYS_BOARD - string default "xpedite517x" config SYS_VENDOR - string default "xes" config SYS_CONFIG_NAME - string default "xpedite517x" endif diff --git a/board/xes/xpedite520x/Kconfig b/board/xes/xpedite520x/Kconfig index e524ff1c90..9c0c2461fd 100644 --- a/board/xes/xpedite520x/Kconfig +++ b/board/xes/xpedite520x/Kconfig @@ -1,15 +1,12 @@ if TARGET_XPEDITE520X config SYS_BOARD - string default "xpedite520x" config SYS_VENDOR - string default "xes" config SYS_CONFIG_NAME - string default "xpedite520x" endif diff --git a/board/xes/xpedite537x/Kconfig b/board/xes/xpedite537x/Kconfig index cab2ab3f6e..35b3917a6d 100644 --- a/board/xes/xpedite537x/Kconfig +++ b/board/xes/xpedite537x/Kconfig @@ -1,15 +1,12 @@ if TARGET_XPEDITE537X config SYS_BOARD - string default "xpedite537x" config SYS_VENDOR - string default "xes" config SYS_CONFIG_NAME - string default "xpedite537x" endif diff --git a/board/xes/xpedite550x/Kconfig b/board/xes/xpedite550x/Kconfig index fa11719ea0..1b00137a48 100644 --- a/board/xes/xpedite550x/Kconfig +++ b/board/xes/xpedite550x/Kconfig @@ -1,15 +1,12 @@ if TARGET_XPEDITE550X config SYS_BOARD - string default "xpedite550x" config SYS_VENDOR - string default "xes" config SYS_CONFIG_NAME - string default "xpedite550x" endif diff --git a/board/xilinx/microblaze-generic/Kconfig b/board/xilinx/microblaze-generic/Kconfig index b9cb33471c..461d7dce2c 100644 --- a/board/xilinx/microblaze-generic/Kconfig +++ b/board/xilinx/microblaze-generic/Kconfig @@ -1,15 +1,12 @@ if TARGET_MICROBLAZE_GENERIC config SYS_BOARD - string default "microblaze-generic" config SYS_VENDOR - string default "xilinx" config SYS_CONFIG_NAME - string default "microblaze-generic" endif diff --git a/board/xilinx/ml507/Kconfig b/board/xilinx/ml507/Kconfig index 6f3483d896..d580a7beaf 100644 --- a/board/xilinx/ml507/Kconfig +++ b/board/xilinx/ml507/Kconfig @@ -1,15 +1,12 @@ if TARGET_ML507 config SYS_BOARD - string default "ml507" config SYS_VENDOR - string default "xilinx" config SYS_CONFIG_NAME - string default "ml507" endif diff --git a/board/xilinx/ppc405-generic/Kconfig b/board/xilinx/ppc405-generic/Kconfig index 98411c7ff4..dfbc07b425 100644 --- a/board/xilinx/ppc405-generic/Kconfig +++ b/board/xilinx/ppc405-generic/Kconfig @@ -1,15 +1,12 @@ if TARGET_XILINX_PPC405_GENERIC config SYS_BOARD - string default "ppc405-generic" config SYS_VENDOR - string default "xilinx" config SYS_CONFIG_NAME - string default "xilinx-ppc405-generic" endif diff --git a/board/xilinx/ppc440-generic/Kconfig b/board/xilinx/ppc440-generic/Kconfig index 37abe633e4..d40783a28f 100644 --- a/board/xilinx/ppc440-generic/Kconfig +++ b/board/xilinx/ppc440-generic/Kconfig @@ -1,15 +1,12 @@ if TARGET_XILINX_PPC440_GENERIC config SYS_BOARD - string default "ppc440-generic" config SYS_VENDOR - string default "xilinx" config SYS_CONFIG_NAME - string default "xilinx-ppc440-generic" endif diff --git a/board/zeus/Kconfig b/board/zeus/Kconfig index 56786940e3..67796508f3 100644 --- a/board/zeus/Kconfig +++ b/board/zeus/Kconfig @@ -1,11 +1,9 @@ if TARGET_ZEUS config SYS_BOARD - string default "zeus" config SYS_CONFIG_NAME - string default "zeus" endif diff --git a/board/zipitz2/Kconfig b/board/zipitz2/Kconfig index 702edbff5f..5f7fe1b23d 100644 --- a/board/zipitz2/Kconfig +++ b/board/zipitz2/Kconfig @@ -1,15 +1,12 @@ if TARGET_ZIPITZ2 config SYS_CPU - string default "pxa" config SYS_BOARD - string default "zipitz2" config SYS_CONFIG_NAME - string default "zipitz2" endif diff --git a/common/aboot.c b/common/aboot.c new file mode 100644 index 0000000000..d5c464bd7d --- /dev/null +++ b/common/aboot.c @@ -0,0 +1,243 @@ +/* + * Copyright (c) 2009, Google Inc. + * All rights reserved. + * + * Copyright (c) 2009-2014, The Linux Foundation. All rights reserved. + * Portions Copyright 2014 Broadcom Corporation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Linux Foundation nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * NOTE: + * Although it is very similar, this license text is not identical + * to the "BSD-3-Clause", therefore, DO NOT MODIFY THIS LICENSE TEXT! + */ + +#include <config.h> +#include <common.h> +#include <aboot.h> +#include <malloc.h> +#include <part.h> +#include <sparse_format.h> + +void write_sparse_image(block_dev_desc_t *dev_desc, + disk_partition_t *info, const char *part_name, + void *data, unsigned sz) +{ + lbaint_t blk; + lbaint_t blkcnt; + lbaint_t blks; + uint32_t bytes_written = 0; + unsigned int chunk; + unsigned int chunk_data_sz; + uint32_t *fill_buf = NULL; + uint32_t fill_val; + sparse_header_t *sparse_header; + chunk_header_t *chunk_header; + uint32_t total_blocks = 0; + int i; + + /* Read and skip over sparse image header */ + sparse_header = (sparse_header_t *) data; + + data += sparse_header->file_hdr_sz; + if (sparse_header->file_hdr_sz > sizeof(sparse_header_t)) + { + /* + * Skip the remaining bytes in a header that is longer than + * we expected. + */ + data += (sparse_header->file_hdr_sz - sizeof(sparse_header_t)); + } + + debug("=== Sparse Image Header ===\n"); + debug("magic: 0x%x\n", sparse_header->magic); + debug("major_version: 0x%x\n", sparse_header->major_version); + debug("minor_version: 0x%x\n", sparse_header->minor_version); + debug("file_hdr_sz: %d\n", sparse_header->file_hdr_sz); + debug("chunk_hdr_sz: %d\n", sparse_header->chunk_hdr_sz); + debug("blk_sz: %d\n", sparse_header->blk_sz); + debug("total_blks: %d\n", sparse_header->total_blks); + debug("total_chunks: %d\n", sparse_header->total_chunks); + + /* verify sparse_header->blk_sz is an exact multiple of info->blksz */ + if (sparse_header->blk_sz != + (sparse_header->blk_sz & ~(info->blksz - 1))) { + printf("%s: Sparse image block size issue [%u]\n", + __func__, sparse_header->blk_sz); + fastboot_fail("sparse image block size issue"); + return; + } + + puts("Flashing Sparse Image\n"); + + /* Start processing chunks */ + blk = info->start; + for (chunk=0; chunk<sparse_header->total_chunks; chunk++) + { + /* Read and skip over chunk header */ + chunk_header = (chunk_header_t *) data; + data += sizeof(chunk_header_t); + + if (chunk_header->chunk_type != CHUNK_TYPE_RAW) { + debug("=== Chunk Header ===\n"); + debug("chunk_type: 0x%x\n", chunk_header->chunk_type); + debug("chunk_data_sz: 0x%x\n", chunk_header->chunk_sz); + debug("total_size: 0x%x\n", chunk_header->total_sz); + } + + if (sparse_header->chunk_hdr_sz > sizeof(chunk_header_t)) + { + /* + * Skip the remaining bytes in a header that is longer + * than we expected. + */ + data += (sparse_header->chunk_hdr_sz - + sizeof(chunk_header_t)); + } + + chunk_data_sz = sparse_header->blk_sz * chunk_header->chunk_sz; + blkcnt = chunk_data_sz / info->blksz; + switch (chunk_header->chunk_type) + { + case CHUNK_TYPE_RAW: + if (chunk_header->total_sz != + (sparse_header->chunk_hdr_sz + chunk_data_sz)) + { + fastboot_fail( + "Bogus chunk size for chunk type Raw"); + return; + } + + if (blk + blkcnt > info->start + info->size) { + printf( + "%s: Request would exceed partition size!\n", + __func__); + fastboot_fail( + "Request would exceed partition size!"); + return; + } + + blks = dev_desc->block_write(dev_desc->dev, blk, blkcnt, + data); + if (blks != blkcnt) { + printf("%s: Write failed " LBAFU "\n", + __func__, blks); + fastboot_fail("flash write failure"); + return; + } + blk += blkcnt; + bytes_written += blkcnt * info->blksz; + total_blocks += chunk_header->chunk_sz; + data += chunk_data_sz; + break; + + case CHUNK_TYPE_FILL: + if (chunk_header->total_sz != + (sparse_header->chunk_hdr_sz + sizeof(uint32_t))) + { + fastboot_fail( + "Bogus chunk size for chunk type FILL"); + return; + } + + fill_buf = (uint32_t *) + memalign(ARCH_DMA_MINALIGN, + ROUNDUP(info->blksz, + ARCH_DMA_MINALIGN)); + if (!fill_buf) + { + fastboot_fail( + "Malloc failed for: CHUNK_TYPE_FILL"); + return; + } + + fill_val = *(uint32_t *)data; + data = (char *) data + sizeof(uint32_t); + + for (i = 0; i < (info->blksz / sizeof(fill_val)); i++) + fill_buf[i] = fill_val; + + if (blk + blkcnt > info->start + info->size) { + printf( + "%s: Request would exceed partition size!\n", + __func__); + fastboot_fail( + "Request would exceed partition size!"); + return; + } + + for (i = 0; i < blkcnt; i++) { + blks = dev_desc->block_write(dev_desc->dev, + blk, 1, fill_buf); + if (blks != 1) { + printf( + "%s: Write failed, block # " LBAFU "\n", + __func__, blkcnt); + fastboot_fail("flash write failure"); + free(fill_buf); + return; + } + blk++; + } + bytes_written += blkcnt * info->blksz; + total_blocks += chunk_data_sz / sparse_header->blk_sz; + + free(fill_buf); + break; + + case CHUNK_TYPE_DONT_CARE: + total_blocks += chunk_header->chunk_sz; + break; + + case CHUNK_TYPE_CRC32: + if (chunk_header->total_sz != + sparse_header->chunk_hdr_sz) + { + fastboot_fail( + "Bogus chunk size for chunk type Dont Care"); + return; + } + total_blocks += chunk_header->chunk_sz; + data += chunk_data_sz; + break; + + default: + printf("%s: Unknown chunk type: %x\n", __func__, + chunk_header->chunk_type); + fastboot_fail("Unknown chunk type"); + return; + } + } + + debug("Wrote %d blocks, expected to write %d blocks\n", + total_blocks, sparse_header->total_blks); + printf("........ wrote %u bytes to '%s'\n", bytes_written, part_name); + + if (total_blocks != sparse_header->total_blks) + fastboot_fail("sparse image write failure"); + + fastboot_okay(""); + return; +} diff --git a/common/board_f.c b/common/board_f.c index 4ece2b6c9f..e6aa298d5a 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -34,7 +34,7 @@ #ifdef CONFIG_MPC5xxx #include <mpc5xxx.h> #endif -#if (defined(CONFIG_MPC86xx) || defined(CONFIG_E500)) +#if defined(CONFIG_MP) && (defined(CONFIG_MPC86xx) || defined(CONFIG_E500)) #include <asm/mp.h> #endif @@ -341,21 +341,23 @@ static int setup_ram_buf(void) static int setup_fdt(void) { -#ifdef CONFIG_OF_EMBED +#ifdef CONFIG_OF_CONTROL +# ifdef CONFIG_OF_EMBED /* Get a pointer to the FDT */ gd->fdt_blob = __dtb_dt_begin; -#elif defined CONFIG_OF_SEPARATE +# elif defined CONFIG_OF_SEPARATE /* FDT is at end of image */ gd->fdt_blob = (ulong *)&_end; -#elif defined(CONFIG_OF_HOSTFILE) +# elif defined(CONFIG_OF_HOSTFILE) if (read_fdt_from_file()) { puts("Failed to read control FDT\n"); return -1; } -#endif +# endif /* Allow the early environment to override the fdt address */ gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16, (uintptr_t)gd->fdt_blob); +#endif return 0; } @@ -392,7 +394,7 @@ static int setup_dest_addr(void) gd->ram_top = board_get_usable_ram_top(gd->mon_len); gd->relocaddr = gd->ram_top; debug("Ram top: %08lX\n", (ulong)gd->ram_top); -#if (defined(CONFIG_MPC86xx) || defined(CONFIG_E500)) +#if defined(CONFIG_MP) && (defined(CONFIG_MPC86xx) || defined(CONFIG_E500)) /* * We need to make sure the location we intend to put secondary core * boot code is reserved and not used by any part of u-boot @@ -831,6 +833,8 @@ static init_fnc_t init_sequence_f[] = { #ifdef CONFIG_OF_CONTROL fdtdec_check_fdt, #endif + initf_malloc, + initf_dm, #if defined(CONFIG_BOARD_EARLY_INIT_F) board_early_init_f, #endif @@ -866,8 +870,6 @@ static init_fnc_t init_sequence_f[] = { sdram_adjust_866, init_timebase, #endif - initf_malloc, - initf_dm, init_baud_rate, /* initialze baudrate settings */ serial_init, /* serial communications setup */ console_init_f, /* stage 1 init of console */ diff --git a/common/board_r.c b/common/board_r.c index 551429c843..231c6d6711 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -715,6 +715,15 @@ init_fnc_t init_sequence_r[] = { /* TODO: could x86/PPC have this also perhaps? */ #ifdef CONFIG_ARM initr_caches, +#endif + initr_reloc_global_data, + initr_barrier, + initr_malloc, + bootstage_relocate, +#ifdef CONFIG_DM + initr_dm, +#endif +#ifdef CONFIG_ARM board_init, /* Setup chipselects */ #endif /* @@ -726,7 +735,7 @@ init_fnc_t init_sequence_r[] = { #ifdef CONFIG_CLOCKS set_cpu_clk_info, /* Setup clock information */ #endif - initr_reloc_global_data, + stdio_init_tables, initr_serial, initr_announce, INIT_FUNC_WATCHDOG_RESET @@ -763,12 +772,6 @@ init_fnc_t init_sequence_r[] = { #ifdef CONFIG_WINBOND_83C553 initr_w83c553f, #endif - initr_barrier, - initr_malloc, - bootstage_relocate, -#ifdef CONFIG_DM - initr_dm, -#endif #ifdef CONFIG_ARCH_EARLY_INIT_R arch_early_init_r, #endif @@ -818,7 +821,7 @@ init_fnc_t init_sequence_r[] = { */ initr_pci, #endif - stdio_init, + stdio_add_devices, initr_jumptable, #ifdef CONFIG_API initr_api, diff --git a/common/bouncebuf.c b/common/bouncebuf.c index 9eece6d758..054d9e0302 100644 --- a/common/bouncebuf.c +++ b/common/bouncebuf.c @@ -23,7 +23,7 @@ static int addr_aligned(struct bounce_buffer *state) /* Check if length is aligned */ if (state->len != state->len_aligned) { - debug("Unaligned buffer length %d\n", state->len); + debug("Unaligned buffer length %zu\n", state->len); return 0; } diff --git a/common/cmd_mem.c b/common/cmd_mem.c index 1febddb916..bfca59e351 100644 --- a/common/cmd_mem.c +++ b/common/cmd_mem.c @@ -215,7 +215,7 @@ static int do_mem_mw(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } #ifdef CONFIG_MX_CYCLIC -int do_mem_mdc ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +static int do_mem_mdc(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int i; ulong count; @@ -242,7 +242,7 @@ int do_mem_mdc ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 0; } -int do_mem_mwc ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +static int do_mem_mwc(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int i; ulong count; @@ -595,7 +595,8 @@ static int do_mem_loop(cmd_tbl_t *cmdtp, int flag, int argc, } #ifdef CONFIG_LOOPW -int do_mem_loopw (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +static int do_mem_loopw(cmd_tbl_t *cmdtp, int flag, int argc, + char * const argv[]) { ulong addr, length, i, bytes; int size; diff --git a/common/cmd_mtdparts.c b/common/cmd_mtdparts.c index 3cb0571df3..422c069513 100644 --- a/common/cmd_mtdparts.c +++ b/common/cmd_mtdparts.c @@ -862,7 +862,7 @@ static int device_parse(const char *const mtd_dev, const char **ret, struct mtd_ debug("dev type = %d (%s), dev num = %d, mtd-id = %s\n", id->type, MTD_DEV_TYPE(id->type), id->num, id->mtd_id); - debug("parsing partitions %.*s\n", (pend ? pend - p : strlen(p)), p); + debug("parsing partitions %.*s\n", (int)(pend ? pend - p : strlen(p)), p); /* parse partitions */ @@ -1007,7 +1007,7 @@ static struct mtdids* id_find_by_mtd_id(const char *mtd_id, unsigned int mtd_id_ list_for_each(entry, &mtdids) { id = list_entry(entry, struct mtdids, link); - debug("entry: '%s' (len = %d)\n", + debug("entry: '%s' (len = %zu)\n", id->mtd_id, strlen(id->mtd_id)); if (mtd_id_len != strlen(id->mtd_id)) diff --git a/common/kgdb.c b/common/kgdb.c index 8a621ad1fc..d357463695 100644 --- a/common/kgdb.c +++ b/common/kgdb.c @@ -103,7 +103,7 @@ static char remcomOutBuffer[BUFMAX]; static char remcomRegBuffer[BUFMAX]; static int initialized = 0; -static int kgdb_active = 0, first_entry = 1; +static int kgdb_active; static struct pt_regs entry_regs; static long error_jmp_buf[BUFMAX/2]; static int longjmp_on_fault = 0; @@ -348,16 +348,7 @@ handle_exception (struct pt_regs *regs) kgdb_enter(regs, &kd); - if (first_entry) { - /* - * the first time we enter kgdb, we save the processor - * state so that we can return to the monitor if the - * remote end quits gdb (or at least, tells us to quit - * with the 'k' packet) - */ - entry_regs = *regs; - first_entry = 0; - } + entry_regs = *regs; ptr = remcomOutBuffer; @@ -459,7 +450,6 @@ handle_exception (struct pt_regs *regs) case 'k': /* kill the program, actually return to monitor */ kd.extype = KGDBEXIT_KILL; *regs = entry_regs; - first_entry = 1; goto doexit; case 'C': /* CSS continue with signal SS */ diff --git a/common/spl/spl.c b/common/spl/spl.c index 774fdad252..b16664f845 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -86,7 +86,7 @@ void spl_parse_image_header(const struct image_header *header) spl_image.os = image_get_os(header); spl_image.name = image_get_name(header); debug("spl: payload image: %.*s load addr: 0x%x size: %d\n", - sizeof(spl_image.name), spl_image.name, + (int)sizeof(spl_image.name), spl_image.name, spl_image.load_addr, spl_image.size); } else { /* Signature not found - assume u-boot.bin */ diff --git a/common/stdio.c b/common/stdio.c index 692ca7f1cd..c878103a48 100644 --- a/common/stdio.c +++ b/common/stdio.c @@ -215,7 +215,7 @@ int stdio_deregister(const char *devname) } #endif /* CONFIG_SYS_STDIO_DEREGISTER */ -int stdio_init (void) +int stdio_init_tables(void) { #if defined(CONFIG_NEEDS_MANUAL_RELOC) /* already relocated for current ARM implementation */ @@ -232,6 +232,11 @@ int stdio_init (void) /* Initialize the list */ INIT_LIST_HEAD(&(devs.list)); + return 0; +} + +int stdio_add_devices(void) +{ #ifdef CONFIG_SYS_I2C i2c_init_all(); #else @@ -265,5 +270,14 @@ int stdio_init (void) #ifdef CONFIG_CBMEM_CONSOLE cbmemc_init(); #endif - return (0); + + return 0; +} + +int stdio_init(void) +{ + stdio_init_tables(); + stdio_add_devices(); + + return 0; } diff --git a/configs/ls1021aqds_nor_defconfig b/configs/ls1021aqds_nor_defconfig new file mode 100644 index 0000000000..9e42d61095 --- /dev/null +++ b/configs/ls1021aqds_nor_defconfig @@ -0,0 +1,2 @@ +CONFIG_ARM=y +CONFIG_TARGET_LS1021AQDS=y diff --git a/configs/ls1021atwr_nor_defconfig b/configs/ls1021atwr_nor_defconfig new file mode 100644 index 0000000000..5f465d3100 --- /dev/null +++ b/configs/ls1021atwr_nor_defconfig @@ -0,0 +1,2 @@ +CONFIG_ARM=y +CONFIG_TARGET_LS1021ATWR=y diff --git a/configs/ls2085a_emu_D4_defconfig b/configs/ls2085a_emu_D4_defconfig index f2f6882c99..0bc36ed0b0 100644 --- a/configs/ls2085a_emu_D4_defconfig +++ b/configs/ls2085a_emu_D4_defconfig @@ -1,3 +1,3 @@ -CONFIG_SYS_EXTRA_OPTIONS="ARM64,EMU,SYS_FSL_DDR4" +CONFIG_SYS_EXTRA_OPTIONS="EMU,SYS_FSL_DDR4" CONFIG_ARM=y CONFIG_TARGET_LS2085A_EMU=y diff --git a/configs/ls2085a_emu_defconfig b/configs/ls2085a_emu_defconfig index 51ffa56a4c..a2efec3ccf 100644 --- a/configs/ls2085a_emu_defconfig +++ b/configs/ls2085a_emu_defconfig @@ -1,3 +1,3 @@ -CONFIG_SYS_EXTRA_OPTIONS="ARM64,EMU" +CONFIG_SYS_EXTRA_OPTIONS="EMU" CONFIG_ARM=y CONFIG_TARGET_LS2085A_EMU=y diff --git a/configs/ls2085a_simu_defconfig b/configs/ls2085a_simu_defconfig index efa8e74548..7563a7546e 100644 --- a/configs/ls2085a_simu_defconfig +++ b/configs/ls2085a_simu_defconfig @@ -1,3 +1,3 @@ -CONFIG_SYS_EXTRA_OPTIONS="ARM64,SIMU" +CONFIG_SYS_EXTRA_OPTIONS="SIMU" CONFIG_ARM=y CONFIG_TARGET_LS2085A_SIMU=y diff --git a/configs/vexpress_aemv8a_defconfig b/configs/vexpress_aemv8a_defconfig index a335abcf78..9e0a1755a0 100644 --- a/configs/vexpress_aemv8a_defconfig +++ b/configs/vexpress_aemv8a_defconfig @@ -1,3 +1,2 @@ -CONFIG_SYS_EXTRA_OPTIONS="ARM64" CONFIG_ARM=y CONFIG_TARGET_VEXPRESS_AEMV8A=y diff --git a/configs/vexpress_aemv8a_semi_defconfig b/configs/vexpress_aemv8a_semi_defconfig index e6dd8e7224..8fdf4e0fab 100644 --- a/configs/vexpress_aemv8a_semi_defconfig +++ b/configs/vexpress_aemv8a_semi_defconfig @@ -1,3 +1,3 @@ -CONFIG_SYS_EXTRA_OPTIONS="ARM64,SEMIHOSTING,BASE_FVP" +CONFIG_SYS_EXTRA_OPTIONS="SEMIHOSTING,BASE_FVP" CONFIG_ARM=y -CONFIG_TARGET_VEXPRESS_AEMV8A_SEMI=y +CONFIG_TARGET_VEXPRESS_AEMV8A=y diff --git a/doc/README.fsl-esdhc b/doc/README.fsl-esdhc new file mode 100644 index 0000000000..b70f271d1a --- /dev/null +++ b/doc/README.fsl-esdhc @@ -0,0 +1,5 @@ +CONFIG_SYS_FSL_ESDHC_LE means ESDHC IP is in little-endian mode. +CONFIG_SYS_FSL_ESDHC_BE means ESDHC IP is in big-endian mode. + +Accessing ESDHC registers can be determined by ESDHC IP's endian +mode or processor's endian mode. diff --git a/doc/README.scrapyard b/doc/README.scrapyard index 7ef5a225d9..2f5034f362 100644 --- a/doc/README.scrapyard +++ b/doc/README.scrapyard @@ -12,12 +12,14 @@ The list should be sorted in reverse chronological order. Board Arch CPU Commit Removed Last known maintainer/contact ================================================================================================= -flagadm powerpc mpc8xx - - Kári DavÃðsson <kd@flaga.is> -gen860t powerpc mpc8xx - - Keith Outwater <Keith_Outwater@mvis.com> -sixnet powerpc mpc8xx - - Dave Ellis <DGE@sixnetio.com> -svm_sc8xx powerpc mpc8xx - - John Zhan <zhanz@sinovee.com> -stxxtc powerpc mpc8xx - - Dan Malek <dan@embeddedalley.com> -omap5912osk arm arm926ejs - - Rishi Bhattacharya <rishi@ti.com> +PK1C20 nios2 - 70fbc461 2014-08-24 Scott McNutt <smcnutt@psyent.com> +PCI5441 nios2 - 70fbc461 2014-08-24 Scott McNutt <smcnutt@psyent.com> +flagadm powerpc mpc8xx aec6f8c5 2014-08-22 Kári DavÃðsson <kd@flaga.is> +gen860t powerpc mpc8xx 6bde1ec1 2014-08-22 Keith Outwater <Keith_Outwater@mvis.com> +sixnet powerpc mpc8xx 4723ce49 2014-08-22 Dave Ellis <DGE@sixnetio.com> +svm_sc8xx powerpc mpc8xx d1a4aafd 2014-08-22 John Zhan <zhanz@sinovee.com> +stxxtc powerpc mpc8xx 0ace4d9d 2014-08-22 Dan Malek <dan@embeddedalley.com> +omap5912osk arm arm926ejs 62d636aa 2014-08-22 Rishi Bhattacharya <rishi@ti.com> p1023rds powerpc mpc85xx d0bc5140 2014-07-22 Roy Zang <tie-fei.zang@freescale.com> spc1920 powerpc mpc8xx 98ad54be 2014-07-07 v37 powerpc mpc8xx b8c1438a 2014-07-07 diff --git a/doc/device-tree-bindings/serial/ns16550.txt b/doc/device-tree-bindings/serial/ns16550.txt new file mode 100644 index 0000000000..ef0b9aee6d --- /dev/null +++ b/doc/device-tree-bindings/serial/ns16550.txt @@ -0,0 +1,10 @@ +NS16550 UART + +This UART driver supports many chip variants and is used in mamy SoCs. + +Required properties: +- compatible: "ns16550" or "nvidia,tegra20-uart" +- reg: start address and size of registers +- reg-shift: shift value indicating register size: 0=byte, 1=16bit,2=32bit etc. +- clock-frequency: input clock frequency for the UART (used to calculate the + baud rate divisor) diff --git a/doc/device-tree-bindings/serial/sandbox-serial.txt b/doc/device-tree-bindings/serial/sandbox-serial.txt new file mode 100644 index 0000000000..f429c90421 --- /dev/null +++ b/doc/device-tree-bindings/serial/sandbox-serial.txt @@ -0,0 +1,13 @@ +Sandbox serial + +The sandbox serial device is an emulated device which displays its output +on the host machine's console, and accepts input from its keyboard. + +Required properties: + compatible: "sandbox,serial" + +Optional properties: + sandbox,text-colour: If present, this is the colour of the console text. + Supported values are: + "black", "red", "green", "yellow", "blue", "megenta", "cyan", + "white" diff --git a/drivers/core/lists.c b/drivers/core/lists.c index 0f08bfd6ff..699f94b435 100644 --- a/drivers/core/lists.c +++ b/drivers/core/lists.c @@ -118,7 +118,8 @@ static int driver_check_compatible(const void *blob, int offset, return -ENOENT; } -int lists_bind_fdt(struct udevice *parent, const void *blob, int offset) +int lists_bind_fdt(struct udevice *parent, const void *blob, int offset, + struct udevice **devp) { struct driver *driver = ll_entry_start(struct driver, driver); const int n_ents = ll_entry_count(struct driver, driver); @@ -130,6 +131,8 @@ int lists_bind_fdt(struct udevice *parent, const void *blob, int offset) int ret = 0; dm_dbg("bind node %s\n", fdt_get_name(blob, offset, NULL)); + if (devp) + *devp = NULL; for (entry = driver; entry != driver + n_ents; entry++) { ret = driver_check_compatible(blob, offset, entry->of_match); name = fdt_get_name(blob, offset, NULL); @@ -149,10 +152,11 @@ int lists_bind_fdt(struct udevice *parent, const void *blob, int offset) ret = device_bind(parent, entry, name, NULL, offset, &dev); if (ret) { dm_warn("Error binding driver '%s'\n", entry->name); - if (!result || ret != -ENOENT) - result = ret; + return ret; } else { found = true; + if (devp) + *devp = dev; } break; } diff --git a/drivers/core/root.c b/drivers/core/root.c index 393dd98b9d..a328a4876f 100644 --- a/drivers/core/root.c +++ b/drivers/core/root.c @@ -91,7 +91,7 @@ int dm_scan_fdt_node(struct udevice *parent, const void *blob, int offset, if (pre_reloc_only && !fdt_getprop(blob, offset, "u-boot,dm-pre-reloc", NULL)) continue; - err = lists_bind_fdt(parent, blob, offset); + err = lists_bind_fdt(parent, blob, offset, NULL); if (err && !ret) ret = err; } diff --git a/drivers/ddr/fsl/arm_ddr_gen3.c b/drivers/ddr/fsl/arm_ddr_gen3.c index d4ed9aec2a..59f2fd6610 100644 --- a/drivers/ddr/fsl/arm_ddr_gen3.c +++ b/drivers/ddr/fsl/arm_ddr_gen3.c @@ -194,7 +194,7 @@ step2: * For example, 2GB on 666MT/s 64-bit bus takes about 402ms * Let's wait for 800ms */ - bus_width = 3 - ((ddr->sdram_cfg & SDRAM_CFG_DBW_MASK) + bus_width = 3 - ((ddr_in32(&ddr->sdram_cfg) & SDRAM_CFG_DBW_MASK) >> SDRAM_CFG_DBW_SHIFT); timeout = ((total_gb_size_per_controller << (6 - bus_width)) * 100 / (get_ddr_freq(0) >> 20)) << 1; diff --git a/drivers/ddr/fsl/ctrl_regs.c b/drivers/ddr/fsl/ctrl_regs.c index 04e4178b15..d9cac2296a 100644 --- a/drivers/ddr/fsl/ctrl_regs.c +++ b/drivers/ddr/fsl/ctrl_regs.c @@ -693,6 +693,7 @@ static void set_ddr_sdram_cfg(fsl_ddr_cfg_regs_t *ddr, unsigned int x32_en = 0; /* x32 enable */ unsigned int pchb8 = 0; /* precharge bit 8 enable */ unsigned int hse; /* Global half strength override */ + unsigned int acc_ecc_en = 0; /* Accumulated ECC enable */ unsigned int mem_halt = 0; /* memory controller halt */ unsigned int bi = 0; /* Bypass initialization */ @@ -736,6 +737,9 @@ static void set_ddr_sdram_cfg(fsl_ddr_cfg_regs_t *ddr, ba_intlv_ctl = popts->ba_intlv_ctl; hse = popts->half_strength_driver_enable; + /* set when ddr bus width < 64 */ + acc_ecc_en = (dbw != 0 && ecc_en == 1) ? 1 : 0; + ddr->ddr_sdram_cfg = (0 | ((mem_en & 0x1) << 31) | ((sren & 0x1) << 30) @@ -752,6 +756,7 @@ static void set_ddr_sdram_cfg(fsl_ddr_cfg_regs_t *ddr, | ((x32_en & 0x1) << 5) | ((pchb8 & 0x1) << 4) | ((hse & 0x1) << 3) + | ((acc_ecc_en & 0x1) << 2) | ((mem_halt & 0x1) << 1) | ((bi & 0x1) << 0) ); @@ -2271,6 +2276,9 @@ compute_fsl_memctl_config_regs(const memctl_options_t *popts, if (ip_rev > 0x40400) unq_mrs_en = 1; + if (ip_rev > 0x40700) + ddr->debug[18] = popts->cswl_override; + set_ddr_sdram_cfg_2(ddr, popts, unq_mrs_en); set_ddr_sdram_mode(ddr, popts, common_dimm, cas_latency, additive_latency, unq_mrs_en); diff --git a/drivers/ddr/fsl/interactive.c b/drivers/ddr/fsl/interactive.c index 7fb418744e..6aa16b23dd 100644 --- a/drivers/ddr/fsl/interactive.c +++ b/drivers/ddr/fsl/interactive.c @@ -511,6 +511,7 @@ static void fsl_ddr_options_edit(fsl_ddr_info_t *pinfo, CTRL_OPTIONS(wrlvl_override), CTRL_OPTIONS(wrlvl_sample), CTRL_OPTIONS(wrlvl_start), + CTRL_OPTIONS(cswl_override), CTRL_OPTIONS(rcw_override), CTRL_OPTIONS(rcw_1), CTRL_OPTIONS(rcw_2), @@ -801,6 +802,7 @@ static void print_memctl_options(const memctl_options_t *popts) CTRL_OPTIONS(wrlvl_override), CTRL_OPTIONS(wrlvl_sample), CTRL_OPTIONS(wrlvl_start), + CTRL_OPTIONS_HEX(cswl_override), CTRL_OPTIONS(rcw_override), CTRL_OPTIONS(rcw_1), CTRL_OPTIONS(rcw_2), diff --git a/drivers/gpio/tegra_gpio.c b/drivers/gpio/tegra_gpio.c index fea9d17f8e..1cc4abb8a9 100644 --- a/drivers/gpio/tegra_gpio.c +++ b/drivers/gpio/tegra_gpio.c @@ -12,10 +12,17 @@ */ #include <common.h> +#include <dm.h> +#include <malloc.h> +#include <errno.h> +#include <fdtdec.h> #include <asm/io.h> #include <asm/bitops.h> #include <asm/arch/tegra.h> #include <asm/gpio.h> +#include <dm/device-internal.h> + +DECLARE_GLOBAL_DATA_PTR; enum { TEGRA_CMD_INFO, @@ -24,14 +31,18 @@ enum { TEGRA_CMD_INPUT, }; -static struct gpio_names { - char name[GPIO_NAME_SIZE]; -} gpio_names[MAX_NUM_GPIOS]; +struct tegra_gpio_platdata { + struct gpio_ctlr_bank *bank; + const char *port_name; /* Name of port, e.g. "B" */ + int base_gpio; /* Port number for this port (0, 1,.., n-1) */ +}; -static char *get_name(int i) -{ - return *gpio_names[i].name ? gpio_names[i].name : "UNKNOWN"; -} +/* Information about each port at run-time */ +struct tegra_port_info { + char label[TEGRA_GPIOS_PER_PORT][GPIO_NAME_SIZE]; + struct gpio_ctlr_bank *bank; + int base_gpio; /* Port number for this port (0, 1,.., n-1) */ +}; /* Return config of pin 'gpio' as GPIO (1) or SFPIO (0) */ static int get_config(unsigned gpio) @@ -121,38 +132,72 @@ static void set_level(unsigned gpio, int high) writel(u, &bank->gpio_out[GPIO_PORT(gpio)]); } +static int check_reserved(struct udevice *dev, unsigned offset, + const char *func) +{ + struct tegra_port_info *state = dev_get_priv(dev); + struct gpio_dev_priv *uc_priv = dev->uclass_priv; + + if (!*state->label[offset]) { + printf("tegra_gpio: %s: error: gpio %s%d not reserved\n", + func, uc_priv->bank_name, offset); + return -EBUSY; + } + + return 0; +} + +/* set GPIO pin 'gpio' as an output, with polarity 'value' */ +int tegra_spl_gpio_direction_output(int gpio, int value) +{ + /* Configure as a GPIO */ + set_config(gpio, 1); + + /* Configure GPIO output value. */ + set_level(gpio, value); + + /* Configure GPIO direction as output. */ + set_direction(gpio, 1); + + return 0; +} + /* * Generic_GPIO primitives. */ -int gpio_request(unsigned gpio, const char *label) +static int tegra_gpio_request(struct udevice *dev, unsigned offset, + const char *label) { - if (gpio >= MAX_NUM_GPIOS) - return -1; + struct tegra_port_info *state = dev_get_priv(dev); - if (label != NULL) { - strncpy(gpio_names[gpio].name, label, GPIO_NAME_SIZE); - gpio_names[gpio].name[GPIO_NAME_SIZE - 1] = '\0'; - } + if (*state->label[offset]) + return -EBUSY; + + strncpy(state->label[offset], label, GPIO_NAME_SIZE); + state->label[offset][GPIO_NAME_SIZE - 1] = '\0'; /* Configure as a GPIO */ - set_config(gpio, 1); + set_config(state->base_gpio + offset, 1); return 0; } -int gpio_free(unsigned gpio) +static int tegra_gpio_free(struct udevice *dev, unsigned offset) { - if (gpio >= MAX_NUM_GPIOS) - return -1; + struct tegra_port_info *state = dev_get_priv(dev); + int ret; + + ret = check_reserved(dev, offset, __func__); + if (ret) + return ret; + state->label[offset][0] = '\0'; - gpio_names[gpio].name[0] = '\0'; - /* Do not configure as input or change pin mux here */ return 0; } /* read GPIO OUT value of pin 'gpio' */ -static int gpio_get_output_value(unsigned gpio) +static int tegra_gpio_get_output_value(unsigned gpio) { struct gpio_ctlr *ctlr = (struct gpio_ctlr *)NV_PA_GPIO_BASE; struct gpio_ctlr_bank *bank = &ctlr->gpio_bank[GPIO_BANK(gpio)]; @@ -166,24 +211,34 @@ static int gpio_get_output_value(unsigned gpio) return (val >> GPIO_BIT(gpio)) & 1; } + /* set GPIO pin 'gpio' as an input */ -int gpio_direction_input(unsigned gpio) +static int tegra_gpio_direction_input(struct udevice *dev, unsigned offset) { - debug("gpio_direction_input: pin = %d (port %d:bit %d)\n", - gpio, GPIO_FULLPORT(gpio), GPIO_BIT(gpio)); + struct tegra_port_info *state = dev_get_priv(dev); + int ret; + + ret = check_reserved(dev, offset, __func__); + if (ret) + return ret; /* Configure GPIO direction as input. */ - set_direction(gpio, 0); + set_direction(state->base_gpio + offset, 0); return 0; } /* set GPIO pin 'gpio' as an output, with polarity 'value' */ -int gpio_direction_output(unsigned gpio, int value) +static int tegra_gpio_direction_output(struct udevice *dev, unsigned offset, + int value) { - debug("gpio_direction_output: pin = %d (port %d:bit %d) = %s\n", - gpio, GPIO_FULLPORT(gpio), GPIO_BIT(gpio), - value ? "HIGH" : "LOW"); + struct tegra_port_info *state = dev_get_priv(dev); + int gpio = state->base_gpio + offset; + int ret; + + ret = check_reserved(dev, offset, __func__); + if (ret) + return ret; /* Configure GPIO output value. */ set_level(gpio, value); @@ -195,25 +250,38 @@ int gpio_direction_output(unsigned gpio, int value) } /* read GPIO IN value of pin 'gpio' */ -int gpio_get_value(unsigned gpio) +static int tegra_gpio_get_value(struct udevice *dev, unsigned offset) { - struct gpio_ctlr *ctlr = (struct gpio_ctlr *)NV_PA_GPIO_BASE; - struct gpio_ctlr_bank *bank = &ctlr->gpio_bank[GPIO_BANK(gpio)]; + struct tegra_port_info *state = dev_get_priv(dev); + int gpio = state->base_gpio + offset; + int ret; int val; - debug("gpio_get_value: pin = %d (port %d:bit %d)\n", - gpio, GPIO_FULLPORT(gpio), GPIO_BIT(gpio)); + ret = check_reserved(dev, offset, __func__); + if (ret) + return ret; + + debug("%s: pin = %d (port %d:bit %d)\n", __func__, + gpio, GPIO_FULLPORT(gpio), GPIO_BIT(gpio)); - val = readl(&bank->gpio_in[GPIO_PORT(gpio)]); + val = readl(&state->bank->gpio_in[GPIO_PORT(gpio)]); return (val >> GPIO_BIT(gpio)) & 1; } /* write GPIO OUT value to pin 'gpio' */ -int gpio_set_value(unsigned gpio, int value) +static int tegra_gpio_set_value(struct udevice *dev, unsigned offset, int value) { + struct tegra_port_info *state = dev_get_priv(dev); + int gpio = state->base_gpio + offset; + int ret; + + ret = check_reserved(dev, offset, __func__); + if (ret) + return ret; + debug("gpio_set_value: pin = %d (port %d:bit %d), value = %d\n", - gpio, GPIO_FULLPORT(gpio), GPIO_BIT(gpio), value); + gpio, GPIO_FULLPORT(gpio), GPIO_BIT(gpio), value); /* Configure GPIO output value. */ set_level(gpio, value); @@ -241,26 +309,175 @@ void gpio_config_table(const struct tegra_gpio_config *config, int len) } } -/* - * Display Tegra GPIO information +static int tegra_gpio_get_function(struct udevice *dev, unsigned offset) +{ + struct tegra_port_info *state = dev_get_priv(dev); + int gpio = state->base_gpio + offset; + + if (!*state->label[offset]) + return GPIOF_UNUSED; + if (!get_config(gpio)) + return GPIOF_FUNC; + else if (get_direction(gpio)) + return GPIOF_OUTPUT; + else + return GPIOF_INPUT; +} + +static int tegra_gpio_get_state(struct udevice *dev, unsigned int offset, + char *buf, int bufsize) +{ + struct gpio_dev_priv *uc_priv = dev->uclass_priv; + struct tegra_port_info *state = dev_get_priv(dev); + int gpio = state->base_gpio + offset; + const char *label; + int is_output; + int is_gpio; + int size; + + label = state->label[offset]; + is_gpio = get_config(gpio); /* GPIO, not SFPIO */ + size = snprintf(buf, bufsize, "%s%d: ", + uc_priv->bank_name ? uc_priv->bank_name : "", offset); + buf += size; + bufsize -= size; + if (is_gpio) { + is_output = get_direction(gpio); + + snprintf(buf, bufsize, "%s: %d [%c]%s%s", + is_output ? "out" : " in", + is_output ? + tegra_gpio_get_output_value(gpio) : + tegra_gpio_get_value(dev, offset), + *label ? 'x' : ' ', + *label ? " " : "", + label); + } else { + snprintf(buf, bufsize, "sfpio"); + } + + return 0; +} + +static const struct dm_gpio_ops gpio_tegra_ops = { + .request = tegra_gpio_request, + .free = tegra_gpio_free, + .direction_input = tegra_gpio_direction_input, + .direction_output = tegra_gpio_direction_output, + .get_value = tegra_gpio_get_value, + .set_value = tegra_gpio_set_value, + .get_function = tegra_gpio_get_function, + .get_state = tegra_gpio_get_state, +}; + +/** + * Returns the name of a GPIO port + * + * GPIOs are named A, B, C, ..., Z, AA, BB, CC, ... + * + * @base_port: Base port number (0, 1..n-1) + * @return allocated string containing the name */ -void gpio_info(void) +static char *gpio_port_name(int base_port) { - unsigned c; - int type; + char *name, *s; + + name = malloc(3); + if (name) { + s = name; + *s++ = 'A' + (base_port % 26); + if (base_port >= 26) + *s++ = *name; + *s = '\0'; + } - for (c = 0; c < MAX_NUM_GPIOS; c++) { - type = get_config(c); /* GPIO, not SFPIO */ - if (type) { - printf("GPIO_%d:\t%s is an %s, ", c, - get_name(c), - get_direction(c) ? "OUTPUT" : "INPUT"); - if (get_direction(c)) - printf("value = %d", gpio_get_output_value(c)); - else - printf("value = %d", gpio_get_value(c)); - printf("\n"); - } else - continue; + return name; +} + +static const struct udevice_id tegra_gpio_ids[] = { + { .compatible = "nvidia,tegra30-gpio" }, + { .compatible = "nvidia,tegra20-gpio" }, + { } +}; + +static int gpio_tegra_probe(struct udevice *dev) +{ + struct gpio_dev_priv *uc_priv = dev->uclass_priv; + struct tegra_port_info *priv = dev->priv; + struct tegra_gpio_platdata *plat = dev->platdata; + + /* Only child devices have ports */ + if (!plat) + return 0; + + priv->bank = plat->bank; + priv->base_gpio = plat->base_gpio; + + uc_priv->gpio_count = TEGRA_GPIOS_PER_PORT; + uc_priv->bank_name = plat->port_name; + + return 0; +} + +/** + * We have a top-level GPIO device with no actual GPIOs. It has a child + * device for each Tegra port. + */ +static int gpio_tegra_bind(struct udevice *parent) +{ + struct tegra_gpio_platdata *plat = parent->platdata; + struct gpio_ctlr *ctlr; + int bank_count; + int bank; + int ret; + int len; + + /* If this is a child device, there is nothing to do here */ + if (plat) + return 0; + + /* + * This driver does not make use of interrupts, other than to figure + * out the number of GPIO banks + */ + if (!fdt_getprop(gd->fdt_blob, parent->of_offset, "interrupts", &len)) + return -EINVAL; + bank_count = len / 3 / sizeof(u32); + ctlr = (struct gpio_ctlr *)fdtdec_get_addr(gd->fdt_blob, + parent->of_offset, "reg"); + for (bank = 0; bank < bank_count; bank++) { + int port; + + for (port = 0; port < TEGRA_PORTS_PER_BANK; port++) { + struct tegra_gpio_platdata *plat; + struct udevice *dev; + int base_port; + + plat = calloc(1, sizeof(*plat)); + if (!plat) + return -ENOMEM; + plat->bank = &ctlr->gpio_bank[bank]; + base_port = bank * TEGRA_PORTS_PER_BANK + port; + plat->base_gpio = TEGRA_GPIOS_PER_PORT * base_port; + plat->port_name = gpio_port_name(base_port); + + ret = device_bind(parent, parent->driver, + plat->port_name, plat, -1, &dev); + if (ret) + return ret; + dev->of_offset = parent->of_offset; + } } + + return 0; } + +U_BOOT_DRIVER(gpio_tegra) = { + .name = "gpio_tegra", + .id = UCLASS_GPIO, + .of_match = tegra_gpio_ids, + .bind = gpio_tegra_bind, + .probe = gpio_tegra_probe, + .priv_auto_alloc_size = sizeof(struct tegra_port_info), + .ops = &gpio_tegra_ops, +}; diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c index c14797ce0e..021b2fe511 100644 --- a/drivers/i2c/mxc_i2c.c +++ b/drivers/i2c/mxc_i2c.c @@ -423,7 +423,7 @@ static void * const i2c_bases[] = { (void *)IMX_I2C2_BASE #elif defined(CONFIG_MX31) || defined(CONFIG_MX35) || \ defined(CONFIG_MX51) || defined(CONFIG_MX53) || \ - defined(CONFIG_MX6) + defined(CONFIG_MX6) || defined(CONFIG_LS102XA) (void *)I2C1_BASE_ADDR, (void *)I2C2_BASE_ADDR, (void *)I2C3_BASE_ADDR @@ -545,7 +545,7 @@ U_BOOT_I2C_ADAP_COMPLETE(mxc1, mxc_i2c_init, mxc_i2c_probe, CONFIG_SYS_MXC_I2C2_SLAVE, 1) #if defined(CONFIG_MX31) || defined(CONFIG_MX35) ||\ defined(CONFIG_MX51) || defined(CONFIG_MX53) ||\ - defined(CONFIG_MX6) + defined(CONFIG_MX6) || defined(CONFIG_LS102XA) U_BOOT_I2C_ADAP_COMPLETE(mxc2, mxc_i2c_init, mxc_i2c_probe, mxc_i2c_read, mxc_i2c_write, mxc_i2c_set_bus_speed, diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index 55416136ab..97d0389d9d 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -96,7 +96,7 @@ static uint esdhc_xfertyp(struct mmc_cmd *cmd, struct mmc_data *data) else if (cmd->resp_type & MMC_RSP_PRESENT) xfertyp |= XFERTYP_RSPTYP_48; -#if defined(CONFIG_MX53) || defined(CONFIG_PPC_T4240) +#if defined(CONFIG_MX53) || defined(CONFIG_PPC_T4240) || defined(CONFIG_LS102XA) if (cmd->cmdidx == MMC_CMD_STOP_TRANSMISSION) xfertyp |= XFERTYP_CMDTYP_ABORT; #endif @@ -561,7 +561,7 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg) memset(&cfg->cfg, 0, sizeof(cfg->cfg)); voltage_caps = 0; - caps = regs->hostcapblt; + caps = esdhc_read32(®s->hostcapblt); #ifdef CONFIG_SYS_FSL_ERRATUM_ESDHC135 caps = caps & ~(ESDHC_HOSTCAPBLT_SRS | diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c index 39daeabd9f..3e36918f1c 100644 --- a/drivers/mtd/mtdconcat.c +++ b/drivers/mtd/mtdconcat.c @@ -10,7 +10,6 @@ * */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/kernel.h> #include <linux/module.h> diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 6ad03575f6..cb27ff22be 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -9,7 +9,6 @@ * */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/module.h> #include <linux/kernel.h> @@ -804,7 +803,7 @@ void mtd_get_len_incl_bad(struct mtd_info *mtd, uint64_t offset, *truncated = 0; *len_incl_bad = 0; - if (!mtd->block_isbad) { + if (!mtd->_block_isbad) { *len_incl_bad = length; return; } @@ -820,7 +819,7 @@ void mtd_get_len_incl_bad(struct mtd_info *mtd, uint64_t offset, block_len = mtd->erasesize - (offset & (mtd->erasesize - 1)); - if (!mtd->block_isbad(mtd, offset & ~(mtd->erasesize - 1))) + if (!mtd->_block_isbad(mtd, offset & ~(mtd->erasesize - 1))) len_excl_bad += block_len; *len_incl_bad += block_len; diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index 2f20b92a88..cfbaa3d9a0 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c @@ -9,7 +9,6 @@ * */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/module.h> #include <linux/types.h> diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c index e73834d2ef..9114a86da2 100644 --- a/drivers/mtd/nand/atmel_nand.c +++ b/drivers/mtd/nand/atmel_nand.c @@ -164,7 +164,7 @@ static void pmecc_gen_syndrome(struct mtd_info *mtd, int sector) /* Fill odd syndromes */ for (i = 0; i < host->pmecc_corr_cap; i++) { - value = readl(&host->pmecc->rem_port[sector].rem[i / 2]); + value = pmecc_readl(host->pmecc, rem_port[sector].rem[i / 2]); if (i & 1) value >>= 16; value &= 0xffff; @@ -392,10 +392,11 @@ static int pmecc_err_location(struct mtd_info *mtd) int16_t *smu = host->pmecc_smu; int timeout = PMECC_MAX_TIMEOUT_US; - writel(PMERRLOC_DISABLE, &host->pmerrloc->eldis); + pmecc_writel(host->pmerrloc, eldis, PMERRLOC_DISABLE); for (i = 0; i <= host->pmecc_lmu[cap + 1] >> 1; i++) { - writel(smu[(cap + 1) * num + i], &host->pmerrloc->sigma[i]); + pmecc_writel(host->pmerrloc, sigma[i], + smu[(cap + 1) * num + i]); err_nbr++; } @@ -403,12 +404,12 @@ static int pmecc_err_location(struct mtd_info *mtd) if (sector_size == 1024) val |= PMERRLOC_ELCFG_SECTOR_1024; - writel(val, &host->pmerrloc->elcfg); - writel(sector_size * 8 + host->pmecc_degree * cap, - &host->pmerrloc->elen); + pmecc_writel(host->pmerrloc, elcfg, val); + pmecc_writel(host->pmerrloc, elen, + sector_size * 8 + host->pmecc_degree * cap); while (--timeout) { - if (readl(&host->pmerrloc->elisr) & PMERRLOC_CALC_DONE) + if (pmecc_readl(host->pmerrloc, elisr) & PMERRLOC_CALC_DONE) break; WATCHDOG_RESET(); udelay(1); @@ -419,7 +420,7 @@ static int pmecc_err_location(struct mtd_info *mtd) return -1; } - roots_nbr = (readl(&host->pmerrloc->elisr) & PMERRLOC_ERR_NUM_MASK) + roots_nbr = (pmecc_readl(host->pmerrloc, elisr) & PMERRLOC_ERR_NUM_MASK) >> 8; /* Number of roots == degree of smu hence <= cap */ if (roots_nbr == host->pmecc_lmu[cap + 1] >> 1) @@ -443,7 +444,7 @@ static void pmecc_correct_data(struct mtd_info *mtd, uint8_t *buf, uint8_t *ecc, sector_size = host->pmecc_sector_size; while (err_nbr) { - tmp = readl(&host->pmerrloc->el[i]) - 1; + tmp = pmecc_readl(host->pmerrloc, el[i]) - 1; byte_pos = tmp / 8; bit_pos = tmp % 8; @@ -597,7 +598,7 @@ static int atmel_nand_pmecc_write_page(struct mtd_info *mtd, pos = i * host->pmecc_bytes_per_sector + j; chip->oob_poi[eccpos[pos]] = - readb(&host->pmecc->ecc_port[i].ecc[j]); + pmecc_readb(host->pmecc, ecc_port[i].ecc[j]); } } chip->write_buf(mtd, chip->oob_poi, mtd->oobsize); @@ -881,6 +882,7 @@ static int atmel_pmecc_nand_init_params(struct nand_chip *nand, return -ENOMEM; } + nand->options |= NAND_NO_SUBPAGE_WRITE; nand->ecc.read_page = atmel_nand_pmecc_read_page; nand->ecc.write_page = atmel_nand_pmecc_write_page; nand->ecc.strength = cap; diff --git a/drivers/mtd/nand/atmel_nand_ecc.h b/drivers/mtd/nand/atmel_nand_ecc.h index 55d7711c8b..92d4ec59fd 100644 --- a/drivers/mtd/nand/atmel_nand_ecc.h +++ b/drivers/mtd/nand/atmel_nand_ecc.h @@ -34,6 +34,9 @@ #define pmecc_readl(addr, reg) \ readl(&addr->reg) +#define pmecc_readb(addr, reg) \ + readb(&addr->reg) + #define pmecc_writel(addr, reg, value) \ writel((value), &addr->reg) diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c index 02a1130af9..41689b5165 100644 --- a/drivers/mtd/nand/davinci_nand.c +++ b/drivers/mtd/nand/davinci_nand.c @@ -363,6 +363,7 @@ static struct nand_ecclayout nand_keystone_rbl_4bit_layout_oobfirst = { * @raw: use _raw version of write_page */ static int nand_davinci_write_page(struct mtd_info *mtd, struct nand_chip *chip, + uint32_t offset, int data_len, const uint8_t *buf, int oob_required, int page, int cached, int raw) { diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 085b1541cd..7153e3ca36 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -29,7 +29,6 @@ * */ -#define __UBOOT__ #ifndef __UBOOT__ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c index c8f28c792b..cf4a82d93a 100644 --- a/drivers/mtd/nand/nand_bbt.c +++ b/drivers/mtd/nand/nand_bbt.c @@ -59,7 +59,6 @@ * */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/slab.h> #include <linux/types.h> diff --git a/drivers/mtd/nand/nand_ids.c b/drivers/mtd/nand/nand_ids.c index 54f9f13896..9ed05778d3 100644 --- a/drivers/mtd/nand/nand_ids.c +++ b/drivers/mtd/nand/nand_ids.c @@ -8,7 +8,6 @@ * published by the Free Software Foundation. * */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/module.h> #include <linux/mtd/nand.h> diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c index 9fce02ef26..1bdbfa71d9 100644 --- a/drivers/mtd/ubi/attach.c +++ b/drivers/mtd/ubi/attach.c @@ -70,7 +70,6 @@ * o Otherwise this is corruption type 2. */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/err.h> #include <linux/slab.h> diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index ff8bf0cedf..584cf5f22b 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -17,7 +17,6 @@ * later using the "UBI control device". */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/module.h> #include <linux/moduleparam.h> diff --git a/drivers/mtd/ubi/crc32.c b/drivers/mtd/ubi/crc32.c index 0d65bf4b8a..9c54ea4db0 100644 --- a/drivers/mtd/ubi/crc32.c +++ b/drivers/mtd/ubi/crc32.c @@ -20,7 +20,6 @@ * Version 2. See the file COPYING for more details. */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/crc32.h> #include <linux/kernel.h> diff --git a/drivers/mtd/ubi/debug.c b/drivers/mtd/ubi/debug.c index af254da488..6dcc4e4844 100644 --- a/drivers/mtd/ubi/debug.c +++ b/drivers/mtd/ubi/debug.c @@ -8,7 +8,6 @@ #include <ubi_uboot.h> #include "ubi.h" -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/debugfs.h> #include <linux/uaccess.h> diff --git a/drivers/mtd/ubi/debug.h b/drivers/mtd/ubi/debug.h index 980eb11ed2..bfa9dfb42b 100644 --- a/drivers/mtd/ubi/debug.h +++ b/drivers/mtd/ubi/debug.h @@ -13,7 +13,6 @@ void ubi_dump_flash(struct ubi_device *ubi, int pnum, int offset, int len); void ubi_dump_ec_hdr(const struct ubi_ec_hdr *ec_hdr); void ubi_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr); -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/random.h> #endif diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c index 3c2a7e69e1..fce0ff8bdf 100644 --- a/drivers/mtd/ubi/eba.c +++ b/drivers/mtd/ubi/eba.c @@ -29,7 +29,6 @@ * 64 bits is enough to never overflow. */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/slab.h> #include <linux/crc32.h> diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c index 787522fa2e..a2166e431c 100644 --- a/drivers/mtd/ubi/fastmap.c +++ b/drivers/mtd/ubi/fastmap.c @@ -6,7 +6,6 @@ * */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/crc32.h> #else diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c index 41d7eb7638..0e2e9335fe 100644 --- a/drivers/mtd/ubi/io.c +++ b/drivers/mtd/ubi/io.c @@ -73,7 +73,6 @@ * back and writes the whole sub-page. */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/crc32.h> #include <linux/err.h> diff --git a/drivers/mtd/ubi/kapi.c b/drivers/mtd/ubi/kapi.c index 0183c93b0b..fd2bbd64f1 100644 --- a/drivers/mtd/ubi/kapi.c +++ b/drivers/mtd/ubi/kapi.c @@ -8,7 +8,6 @@ /* This file mostly implements UBI kernel API functions */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/module.h> #include <linux/slab.h> diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h index 20fd704eca..754b3371d2 100644 --- a/drivers/mtd/ubi/ubi.h +++ b/drivers/mtd/ubi/ubi.h @@ -10,7 +10,6 @@ #ifndef __UBI_UBI_H__ #define __UBI_UBI_H__ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/types.h> #include <linux/list.h> diff --git a/drivers/mtd/ubi/upd.c b/drivers/mtd/ubi/upd.c index 220c120515..c52c9ce776 100644 --- a/drivers/mtd/ubi/upd.c +++ b/drivers/mtd/ubi/upd.c @@ -26,7 +26,6 @@ * transaction with a roll-back capability. */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/uaccess.h> #else diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c index d9665a446a..f4392f5969 100644 --- a/drivers/mtd/ubi/vmt.c +++ b/drivers/mtd/ubi/vmt.c @@ -11,7 +11,6 @@ * resizing. */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/err.h> #include <linux/slab.h> diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c index e6c8f5bbe0..ae8ea38c62 100644 --- a/drivers/mtd/ubi/vtbl.c +++ b/drivers/mtd/ubi/vtbl.c @@ -43,7 +43,6 @@ * damaged. */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/crc32.h> #include <linux/err.h> diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index 102309016a..6886f89df2 100644 --- a/drivers/mtd/ubi/wl.c +++ b/drivers/mtd/ubi/wl.c @@ -86,7 +86,6 @@ * room for future re-works of the WL sub-system. */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/slab.h> #include <linux/crc32.h> diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c index af06d4fb82..46c82bbb40 100644 --- a/drivers/net/ethoc.c +++ b/drivers/net/ethoc.c @@ -189,12 +189,12 @@ struct ethoc_bd { u32 addr; }; -static inline u32 ethoc_read(struct eth_device *dev, loff_t offset) +static inline u32 ethoc_read(struct eth_device *dev, size_t offset) { return readl(dev->iobase + offset); } -static inline void ethoc_write(struct eth_device *dev, loff_t offset, u32 data) +static inline void ethoc_write(struct eth_device *dev, size_t offset, u32 data) { writel(data, dev->iobase + offset); } @@ -202,7 +202,7 @@ static inline void ethoc_write(struct eth_device *dev, loff_t offset, u32 data) static inline void ethoc_read_bd(struct eth_device *dev, int index, struct ethoc_bd *bd) { - loff_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd)); + size_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd)); bd->stat = ethoc_read(dev, offset + 0); bd->addr = ethoc_read(dev, offset + 4); } @@ -210,7 +210,7 @@ static inline void ethoc_read_bd(struct eth_device *dev, int index, static inline void ethoc_write_bd(struct eth_device *dev, int index, const struct ethoc_bd *bd) { - loff_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd)); + size_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd)); ethoc_write(dev, offset + 0, bd->stat); ethoc_write(dev, offset + 4, bd->addr); } diff --git a/drivers/net/fm/dtsec.c b/drivers/net/fm/dtsec.c index 78bbd439f1..8d3dc0e308 100644 --- a/drivers/net/fm/dtsec.c +++ b/drivers/net/fm/dtsec.c @@ -7,7 +7,6 @@ #include <common.h> #include <asm/types.h> #include <asm/io.h> -#include <asm/fsl_enet.h> #include <asm/fsl_dtsec.h> #include <fsl_mdio.h> #include <phy.h> diff --git a/drivers/net/fm/fm.h b/drivers/net/fm/fm.h index 316e06e17e..a9691c635a 100644 --- a/drivers/net/fm/fm.h +++ b/drivers/net/fm/fm.h @@ -8,8 +8,8 @@ #define __FM_H__ #include <common.h> +#include <phy.h> #include <fm_eth.h> -#include <asm/fsl_enet.h> #include <asm/fsl_fman.h> /* Port ID */ diff --git a/drivers/net/fm/init.c b/drivers/net/fm/init.c index ff04695c32..6cf21c6f65 100644 --- a/drivers/net/fm/init.c +++ b/drivers/net/fm/init.c @@ -6,6 +6,7 @@ #include <common.h> #include <asm/io.h> #include <asm/fsl_serdes.h> +#include <fsl_mdio.h> #include "fm.h" diff --git a/drivers/net/fm/memac.c b/drivers/net/fm/memac.c index 592a67f2a5..9499290bba 100644 --- a/drivers/net/fm/memac.c +++ b/drivers/net/fm/memac.c @@ -12,7 +12,6 @@ #include <phy.h> #include <asm/types.h> #include <asm/io.h> -#include <asm/fsl_enet.h> #include <asm/fsl_memac.h> #include "fm.h" diff --git a/drivers/net/fm/tgec.c b/drivers/net/fm/tgec.c index f450f800e2..50171230ea 100644 --- a/drivers/net/fm/tgec.c +++ b/drivers/net/fm/tgec.c @@ -12,7 +12,6 @@ #include <phy.h> #include <asm/types.h> #include <asm/io.h> -#include <asm/fsl_enet.h> #include <asm/fsl_tgec.h> #include "fm.h" diff --git a/drivers/net/fsl_mdio.c b/drivers/net/fsl_mdio.c index 1d88e6504b..d6b181b386 100644 --- a/drivers/net/fsl_mdio.c +++ b/drivers/net/fsl_mdio.c @@ -11,7 +11,6 @@ #include <fsl_mdio.h> #include <asm/io.h> #include <asm/errno.h> -#include <asm/fsl_enet.h> void tsec_local_mdio_write(struct tsec_mii_mng __iomem *phyregs, int port_addr, int dev_addr, int regnum, int value) @@ -20,7 +19,8 @@ void tsec_local_mdio_write(struct tsec_mii_mng __iomem *phyregs, int port_addr, out_be32(&phyregs->miimadd, (port_addr << 8) | (regnum & 0x1f)); out_be32(&phyregs->miimcon, value); - asm("sync"); + /* Memory barrier */ + mb(); while ((in_be32(&phyregs->miimind) & MIIMIND_BUSY) && timeout--) ; @@ -38,11 +38,13 @@ int tsec_local_mdio_read(struct tsec_mii_mng __iomem *phyregs, int port_addr, /* Clear the command register, and wait */ out_be32(&phyregs->miimcom, 0); - asm("sync"); + /* Memory barrier */ + mb(); /* Initiate a read command, and wait */ out_be32(&phyregs->miimcom, MIIMCOM_READ_CYCLE); - asm("sync"); + /* Memory barrier */ + mb(); /* Wait for the the indication that the read is done */ while ((in_be32(&phyregs->miimind) & (MIIMIND_NOTVALID | MIIMIND_BUSY)) diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c index d040ab171b..c3ce17516c 100644 --- a/drivers/net/rtl8169.c +++ b/drivers/net/rtl8169.c @@ -469,7 +469,6 @@ static int rtl_recv(struct eth_device *dev) rtl_inval_buffer(tpc->RxBufferRing[cur_rx], length); memcpy(rxdata, tpc->RxBufferRing[cur_rx], length); - NetReceive(rxdata, length); if (cur_rx == NUM_RX_DESC - 1) tpc->RxDescArray[cur_rx].status = @@ -480,6 +479,8 @@ static int rtl_recv(struct eth_device *dev) tpc->RxDescArray[cur_rx].buf_addr = cpu_to_le32(bus_to_phys(tpc->RxBufferRing[cur_rx])); rtl_flush_rx_desc(&tpc->RxDescArray[cur_rx]); + + NetReceive(rxdata, length); } else { puts("Error Rx"); } diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c index e9138f0338..79d656133a 100644 --- a/drivers/net/tsec.c +++ b/drivers/net/tsec.c @@ -20,6 +20,7 @@ #include <fsl_mdio.h> #include <asm/errno.h> #include <asm/processor.h> +#include <asm/io.h> DECLARE_GLOBAL_DATA_PTR; @@ -270,6 +271,9 @@ void redundant_init(struct eth_device *dev) out_be32(®s->tstat, TSTAT_CLEAR_THALT); out_be32(®s->rstat, RSTAT_CLEAR_RHALT); clrbits_be32(®s->dmactrl, DMACTRL_GRS | DMACTRL_GTS); +#ifdef CONFIG_LS102XA + setbits_be32(®s->dmactrl, DMACTRL_LE); +#endif do { uint16_t status; @@ -366,6 +370,9 @@ static void startup_tsec(struct eth_device *dev) out_be32(®s->tstat, TSTAT_CLEAR_THALT); out_be32(®s->rstat, RSTAT_CLEAR_RHALT); clrbits_be32(®s->dmactrl, DMACTRL_GRS | DMACTRL_GTS); +#ifdef CONFIG_LS102XA + setbits_be32(®s->dmactrl, DMACTRL_LE); +#endif } /* This returns the status bits of the device. The return value diff --git a/drivers/qe/uec.h b/drivers/qe/uec.h index 48a163411c..6b559f7974 100644 --- a/drivers/qe/uec.h +++ b/drivers/qe/uec.h @@ -13,7 +13,6 @@ #include "qe.h" #include "uccf.h" #include <phy.h> -#include <asm/fsl_enet.h> #define MAX_TX_THREADS 8 #define MAX_RX_THREADS 8 diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile index 571c18fa93..853a8c6919 100644 --- a/drivers/serial/Makefile +++ b/drivers/serial/Makefile @@ -5,7 +5,12 @@ # SPDX-License-Identifier: GPL-2.0+ # +ifdef CONFIG_DM_SERIAL +obj-y += serial-uclass.o +else obj-y += serial.o +obj-$(CONFIG_SYS_NS16550_SERIAL) += serial_ns16550.o +endif obj-$(CONFIG_ALTERA_UART) += altera_uart.o obj-$(CONFIG_ALTERA_JTAG_UART) += altera_jtag_uart.o @@ -16,7 +21,6 @@ obj-$(CONFIG_MCFUART) += mcfuart.o obj-$(CONFIG_OPENCORES_YANU) += opencores_yanu.o obj-$(CONFIG_SYS_NS16550) += ns16550.o obj-$(CONFIG_S5P) += serial_s5p.o -obj-$(CONFIG_SYS_NS16550_SERIAL) += serial_ns16550.o obj-$(CONFIG_IMX_SERIAL) += serial_imx.o obj-$(CONFIG_KS8695_SERIAL) += serial_ks8695.o obj-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o @@ -34,6 +38,7 @@ obj-$(CONFIG_BFIN_SERIAL) += serial_bfin.o obj-$(CONFIG_FSL_LPUART) += serial_lpuart.o obj-$(CONFIG_MXS_AUART) += mxs_auart.o obj-$(CONFIG_ARC_SERIAL) += serial_arc.o +obj-$(CONFIG_TEGRA_SERIAL) += serial_tegra.o ifndef CONFIG_SPL_BUILD obj-$(CONFIG_USB_TTY) += usbtty.o diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index 079f67d380..63a9ef6844 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -4,18 +4,26 @@ * modified to use CONFIG_SYS_ISA_MEM and new defines */ -#include <config.h> +#include <common.h> +#include <dm.h> +#include <errno.h> +#include <fdtdec.h> #include <ns16550.h> +#include <serial.h> #include <watchdog.h> #include <linux/types.h> #include <asm/io.h> +DECLARE_GLOBAL_DATA_PTR; + #define UART_LCRVAL UART_LCR_8N1 /* 8 data, 1 stop, no parity */ #define UART_MCRVAL (UART_MCR_DTR | \ UART_MCR_RTS) /* RTS/DTR */ #define UART_FCRVAL (UART_FCR_FIFO_EN | \ UART_FCR_RXSR | \ UART_FCR_TXSR) /* Clear & enable FIFOs */ + +#ifndef CONFIG_DM_SERIAL #ifdef CONFIG_SYS_NS16550_PORT_MAPPED #define serial_out(x, y) outb(x, (ulong)y) #define serial_in(y) inb((ulong)y) @@ -29,6 +37,7 @@ #define serial_out(x, y) writeb(x, y) #define serial_in(y) readb(y) #endif +#endif /* !CONFIG_DM_SERIAL */ #if defined(CONFIG_SOC_KEYSTONE) #define UART_REG_VAL_PWREMU_MGMT_UART_DISABLE 0 @@ -45,6 +54,82 @@ #define CONFIG_SYS_NS16550_IER 0x00 #endif /* CONFIG_SYS_NS16550_IER */ +#ifdef CONFIG_DM_SERIAL +static void ns16550_writeb(NS16550_t port, int offset, int value) +{ + struct ns16550_platdata *plat = port->plat; + unsigned char *addr; + + offset *= 1 << plat->reg_shift; + addr = plat->base + offset; + /* + * As far as we know it doesn't make sense to support selection of + * these options at run-time, so use the existing CONFIG options. + */ +#ifdef CONFIG_SYS_NS16550_PORT_MAPPED + outb(value, addr); +#elif defined(CONFIG_SYS_NS16550_MEM32) && !defined(CONFIG_SYS_BIG_ENDIAN) + out_le32(addr, value); +#elif defined(CONFIG_SYS_NS16550_MEM32) && defined(CONFIG_SYS_BIG_ENDIAN) + out_be32(addr, value); +#elif defined(CONFIG_SYS_BIG_ENDIAN) + writeb(value, addr + (1 << plat->reg_shift) - 1); +#else + writeb(value, addr); +#endif +} + +static int ns16550_readb(NS16550_t port, int offset) +{ + struct ns16550_platdata *plat = port->plat; + unsigned char *addr; + + offset *= 1 << plat->reg_shift; + addr = plat->base + offset; +#ifdef CONFIG_SYS_NS16550_PORT_MAPPED + return inb(addr); +#elif defined(CONFIG_SYS_NS16550_MEM32) && !defined(CONFIG_SYS_BIG_ENDIAN) + return in_le32(addr); +#elif defined(CONFIG_SYS_NS16550_MEM32) && defined(CONFIG_SYS_BIG_ENDIAN) + return in_be32(addr); +#elif defined(CONFIG_SYS_BIG_ENDIAN) + return readb(addr + (1 << plat->reg_shift) - 1); +#else + return readb(addr); +#endif +} + +/* We can clean these up once everything is moved to driver model */ +#define serial_out(value, addr) \ + ns16550_writeb(com_port, addr - (unsigned char *)com_port, value) +#define serial_in(addr) \ + ns16550_readb(com_port, addr - (unsigned char *)com_port) +#endif + +int ns16550_calc_divisor(NS16550_t port, int clock, int baudrate) +{ + const unsigned int mode_x_div = 16; + +#ifdef CONFIG_OMAP1510 + /* If can't cleanly clock 115200 set div to 1 */ + if ((clock == 12000000) && (baudrate == 115200)) { + port->osc_12m_sel = OSC_12M_SEL; /* enable 6.5 * divisor */ + return 1; /* return 1 for base divisor */ + } + port->osc_12m_sel = 0; /* clear if previsouly set */ +#endif + + return DIV_ROUND_CLOSEST(clock, mode_x_div * baudrate); +} + +static void NS16550_setbrg(NS16550_t com_port, int baud_divisor) +{ + serial_out(UART_LCR_BKSE | UART_LCRVAL, &com_port->lcr); + serial_out(baud_divisor & 0xff, &com_port->dll); + serial_out((baud_divisor >> 8) & 0xff, &com_port->dlm); + serial_out(UART_LCRVAL, &com_port->lcr); +} + void NS16550_init(NS16550_t com_port, int baud_divisor) { #if (defined(CONFIG_SPL_BUILD) && defined(CONFIG_OMAP34XX)) @@ -55,10 +140,8 @@ void NS16550_init(NS16550_t com_port, int baud_divisor) */ if ((serial_in(&com_port->lsr) & (UART_LSR_TEMT | UART_LSR_THRE)) == UART_LSR_THRE) { - serial_out(UART_LCR_DLAB, &com_port->lcr); - serial_out(baud_divisor & 0xff, &com_port->dll); - serial_out((baud_divisor >> 8) & 0xff, &com_port->dlm); - serial_out(UART_LCRVAL, &com_port->lcr); + if (baud_divisor != -1) + NS16550_setbrg(com_port, baud_divisor); serial_out(0, &com_port->mdr1); } #endif @@ -71,16 +154,11 @@ void NS16550_init(NS16550_t com_port, int baud_divisor) defined(CONFIG_TI81XX) || defined(CONFIG_AM43XX) serial_out(0x7, &com_port->mdr1); /* mode select reset TL16C750*/ #endif - serial_out(UART_LCR_BKSE | UART_LCRVAL, &com_port->lcr); - serial_out(0, &com_port->dll); - serial_out(0, &com_port->dlm); - serial_out(UART_LCRVAL, &com_port->lcr); + NS16550_setbrg(com_port, 0); serial_out(UART_MCRVAL, &com_port->mcr); serial_out(UART_FCRVAL, &com_port->fcr); - serial_out(UART_LCR_BKSE | UART_LCRVAL, &com_port->lcr); - serial_out(baud_divisor & 0xff, &com_port->dll); - serial_out((baud_divisor >> 8) & 0xff, &com_port->dlm); - serial_out(UART_LCRVAL, &com_port->lcr); + if (baud_divisor != -1) + NS16550_setbrg(com_port, baud_divisor); #if defined(CONFIG_OMAP) || \ defined(CONFIG_AM33XX) || defined(CONFIG_SOC_DA8XX) || \ defined(CONFIG_TI81XX) || defined(CONFIG_AM43XX) @@ -97,16 +175,10 @@ void NS16550_init(NS16550_t com_port, int baud_divisor) void NS16550_reinit(NS16550_t com_port, int baud_divisor) { serial_out(CONFIG_SYS_NS16550_IER, &com_port->ier); - serial_out(UART_LCR_BKSE | UART_LCRVAL, &com_port->lcr); - serial_out(0, &com_port->dll); - serial_out(0, &com_port->dlm); - serial_out(UART_LCRVAL, &com_port->lcr); + NS16550_setbrg(com_port, 0); serial_out(UART_MCRVAL, &com_port->mcr); serial_out(UART_FCRVAL, &com_port->fcr); - serial_out(UART_LCR_BKSE, &com_port->lcr); - serial_out(baud_divisor & 0xff, &com_port->dll); - serial_out((baud_divisor >> 8) & 0xff, &com_port->dlm); - serial_out(UART_LCRVAL, &com_port->lcr); + NS16550_setbrg(com_port, baud_divisor); } #endif /* CONFIG_NS16550_MIN_FUNCTIONS */ @@ -145,3 +217,92 @@ int NS16550_tstc(NS16550_t com_port) } #endif /* CONFIG_NS16550_MIN_FUNCTIONS */ + +#ifdef CONFIG_DM_SERIAL +static int ns16550_serial_putc(struct udevice *dev, const char ch) +{ + struct NS16550 *const com_port = dev_get_priv(dev); + + if (!(serial_in(&com_port->lsr) & UART_LSR_THRE)) + return -EAGAIN; + serial_out(ch, &com_port->thr); + + /* + * Call watchdog_reset() upon newline. This is done here in putc + * since the environment code uses a single puts() to print the complete + * environment upon "printenv". So we can't put this watchdog call + * in puts(). + */ + if (ch == '\n') + WATCHDOG_RESET(); + + return 0; +} + +static int ns16550_serial_pending(struct udevice *dev, bool input) +{ + struct NS16550 *const com_port = dev_get_priv(dev); + + if (input) + return serial_in(&com_port->lsr) & UART_LSR_DR ? 1 : 0; + else + return serial_in(&com_port->lsr) & UART_LSR_THRE ? 0 : 1; +} + +static int ns16550_serial_getc(struct udevice *dev) +{ + struct NS16550 *const com_port = dev_get_priv(dev); + + if (!serial_in(&com_port->lsr) & UART_LSR_DR) + return -EAGAIN; + + return serial_in(&com_port->rbr); +} + +static int ns16550_serial_setbrg(struct udevice *dev, int baudrate) +{ + struct NS16550 *const com_port = dev_get_priv(dev); + struct ns16550_platdata *plat = com_port->plat; + int clock_divisor; + + clock_divisor = ns16550_calc_divisor(com_port, plat->clock, baudrate); + + NS16550_setbrg(com_port, clock_divisor); + + return 0; +} + +int ns16550_serial_probe(struct udevice *dev) +{ + struct NS16550 *const com_port = dev_get_priv(dev); + + NS16550_init(com_port, -1); + + return 0; +} + +int ns16550_serial_ofdata_to_platdata(struct udevice *dev) +{ + struct NS16550 *const com_port = dev_get_priv(dev); + struct ns16550_platdata *plat = dev->platdata; + fdt_addr_t addr; + + addr = fdtdec_get_addr(gd->fdt_blob, dev->of_offset, "reg"); + if (addr == FDT_ADDR_T_NONE) + return -EINVAL; + + plat->base = (unsigned char *)addr; + plat->reg_shift = fdtdec_get_int(gd->fdt_blob, dev->of_offset, + "reg-shift", 1); + com_port->plat = plat; + + return 0; +} + +const struct dm_serial_ops ns16550_serial_ops = { + .putc = ns16550_serial_putc, + .pending = ns16550_serial_pending, + .getc = ns16550_serial_getc, + .setbrg = ns16550_serial_setbrg, +}; +#endif /* CONFIG_DM_SERIAL */ diff --git a/drivers/serial/sandbox.c b/drivers/serial/sandbox.c index 51fd871dff..cd2f91e28e 100644 --- a/drivers/serial/sandbox.c +++ b/drivers/serial/sandbox.c @@ -11,12 +11,16 @@ */ #include <common.h> +#include <dm.h> +#include <fdtdec.h> #include <lcd.h> #include <os.h> #include <serial.h> #include <linux/compiler.h> #include <asm/state.h> +DECLARE_GLOBAL_DATA_PTR; + /* * * serial_buf: A buffer that holds keyboard characters for the @@ -30,27 +34,69 @@ static char serial_buf[16]; static unsigned int serial_buf_write; static unsigned int serial_buf_read; -static int sandbox_serial_init(void) +struct sandbox_serial_platdata { + int colour; /* Text colour to use for output, -1 for none */ +}; + +struct sandbox_serial_priv { + bool start_of_line; +}; + +/** + * output_ansi_colour() - Output an ANSI colour code + * + * @colour: Colour to output (0-7) + */ +static void output_ansi_colour(int colour) +{ + char ansi_code[] = "\x1b[1;3Xm"; + + ansi_code[5] = '0' + colour; + os_write(1, ansi_code, sizeof(ansi_code) - 1); +} + +static void output_ansi_reset(void) +{ + os_write(1, "\x1b[0m", 4); +} + +static int sandbox_serial_probe(struct udevice *dev) { struct sandbox_state *state = state_get_current(); + struct sandbox_serial_priv *priv = dev_get_priv(dev); if (state->term_raw != STATE_TERM_COOKED) os_tty_raw(0, state->term_raw == STATE_TERM_RAW_WITH_SIGS); + priv->start_of_line = 0; + return 0; } -static void sandbox_serial_setbrg(void) +static int sandbox_serial_remove(struct udevice *dev) { + struct sandbox_serial_platdata *plat = dev->platdata; + + if (plat->colour != -1) + output_ansi_reset(); + + return 0; } -static void sandbox_serial_putc(const char ch) +static int sandbox_serial_putc(struct udevice *dev, const char ch) { + struct sandbox_serial_priv *priv = dev_get_priv(dev); + struct sandbox_serial_platdata *plat = dev->platdata; + + if (priv->start_of_line && plat->colour != -1) { + priv->start_of_line = false; + output_ansi_colour(plat->colour); + } + os_write(1, &ch, 1); -} + if (ch == '\n') + priv->start_of_line = true; -static void sandbox_serial_puts(const char *str) -{ - os_write(1, str, strlen(str)); + return 0; } static unsigned int increment_buffer_index(unsigned int index) @@ -58,12 +104,15 @@ static unsigned int increment_buffer_index(unsigned int index) return (index + 1) % ARRAY_SIZE(serial_buf); } -static int sandbox_serial_tstc(void) +static int sandbox_serial_pending(struct udevice *dev, bool input) { const unsigned int next_index = increment_buffer_index(serial_buf_write); ssize_t count; + if (!input) + return 0; + os_usleep(100); #ifdef CONFIG_LCD lcd_sync(); @@ -74,38 +123,77 @@ static int sandbox_serial_tstc(void) count = os_read_no_block(0, &serial_buf[serial_buf_write], 1); if (count == 1) serial_buf_write = next_index; + return serial_buf_write != serial_buf_read; } -static int sandbox_serial_getc(void) +static int sandbox_serial_getc(struct udevice *dev) { int result; - while (!sandbox_serial_tstc()) - ; /* buffer empty */ + if (!sandbox_serial_pending(dev, true)) + return -EAGAIN; /* buffer empty */ result = serial_buf[serial_buf_read]; serial_buf_read = increment_buffer_index(serial_buf_read); return result; } -static struct serial_device sandbox_serial_drv = { - .name = "sandbox_serial", - .start = sandbox_serial_init, - .stop = NULL, - .setbrg = sandbox_serial_setbrg, - .putc = sandbox_serial_putc, - .puts = sandbox_serial_puts, - .getc = sandbox_serial_getc, - .tstc = sandbox_serial_tstc, +static const char * const ansi_colour[] = { + "black", "red", "green", "yellow", "blue", "megenta", "cyan", + "white", }; -void sandbox_serial_initialize(void) +static int sandbox_serial_ofdata_to_platdata(struct udevice *dev) { - serial_register(&sandbox_serial_drv); -} + struct sandbox_serial_platdata *plat = dev->platdata; + const char *colour; + int i; + + plat->colour = -1; + colour = fdt_getprop(gd->fdt_blob, dev->of_offset, + "sandbox,text-colour", NULL); + if (colour) { + for (i = 0; i < ARRAY_SIZE(ansi_colour); i++) { + if (!strcmp(colour, ansi_colour[i])) { + plat->colour = i; + break; + } + } + } -__weak struct serial_device *default_serial_console(void) -{ - return &sandbox_serial_drv; + return 0; } + +static const struct dm_serial_ops sandbox_serial_ops = { + .putc = sandbox_serial_putc, + .pending = sandbox_serial_pending, + .getc = sandbox_serial_getc, +}; + +static const struct udevice_id sandbox_serial_ids[] = { + { .compatible = "sandbox,serial" }, + { } +}; + +U_BOOT_DRIVER(serial_sandbox) = { + .name = "serial_sandbox", + .id = UCLASS_SERIAL, + .of_match = sandbox_serial_ids, + .ofdata_to_platdata = sandbox_serial_ofdata_to_platdata, + .platdata_auto_alloc_size = sizeof(struct sandbox_serial_platdata), + .priv_auto_alloc_size = sizeof(struct sandbox_serial_priv), + .probe = sandbox_serial_probe, + .remove = sandbox_serial_remove, + .ops = &sandbox_serial_ops, + .flags = DM_FLAG_PRE_RELOC, +}; + +static const struct sandbox_serial_platdata platdata_non_fdt = { + .colour = -1, +}; + +U_BOOT_DEVICE(serial_sandbox_non_fdt) = { + .name = "serial_sandbox", + .platdata = &platdata_non_fdt, +}; diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c new file mode 100644 index 0000000000..d04104e747 --- /dev/null +++ b/drivers/serial/serial-uclass.c @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2014 The Chromium OS Authors. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <dm.h> +#include <errno.h> +#include <fdtdec.h> +#include <os.h> +#include <serial.h> +#include <stdio_dev.h> +#include <dm/lists.h> +#include <dm/device-internal.h> + +DECLARE_GLOBAL_DATA_PTR; + +/* The currently-selected console serial device */ +struct udevice *cur_dev __attribute__ ((section(".data"))); + +#ifndef CONFIG_SYS_MALLOC_F_LEN +#error "Serial is required before relocation - define CONFIG_SYS_MALLOC_F_LEN to make this work" +#endif + +static void serial_find_console_or_panic(void) +{ + int node; + + /* Check for a chosen console */ + node = fdtdec_get_chosen_node(gd->fdt_blob, "stdout-path"); + if (node < 0) + node = fdtdec_get_alias_node(gd->fdt_blob, "console"); + if (!uclass_get_device_by_of_offset(UCLASS_SERIAL, node, &cur_dev)) + return; + + /* + * If the console is not marked to be bound before relocation, bind + * it anyway. + */ + if (node > 0 && + !lists_bind_fdt(gd->dm_root, gd->fdt_blob, node, &cur_dev)) { + if (!device_probe(cur_dev)) + return; + cur_dev = NULL; + } + + /* + * Failing that, get the device with sequence number 0, or in extremis + * just the first serial device we can find. But we insist on having + * a console (even if it is silent). + */ + if (uclass_get_device_by_seq(UCLASS_SERIAL, 0, &cur_dev) && + (uclass_first_device(UCLASS_SERIAL, &cur_dev) || !cur_dev)) + panic("No serial driver found"); +} + +/* Called prior to relocation */ +int serial_init(void) +{ + serial_find_console_or_panic(); + gd->flags |= GD_FLG_SERIAL_READY; + + return 0; +} + +/* Called after relocation */ +void serial_initialize(void) +{ + serial_find_console_or_panic(); +} + +void serial_putc(char ch) +{ + struct dm_serial_ops *ops = serial_get_ops(cur_dev); + int err; + + do { + err = ops->putc(cur_dev, ch); + } while (err == -EAGAIN); + if (ch == '\n') + serial_putc('\r'); +} + +void serial_setbrg(void) +{ + struct dm_serial_ops *ops = serial_get_ops(cur_dev); + + if (ops->setbrg) + ops->setbrg(cur_dev, gd->baudrate); +} + +void serial_puts(const char *str) +{ + while (*str) + serial_putc(*str++); +} + +int serial_tstc(void) +{ + struct dm_serial_ops *ops = serial_get_ops(cur_dev); + + if (ops->pending) + return ops->pending(cur_dev, true); + + return 1; +} + +int serial_getc(void) +{ + struct dm_serial_ops *ops = serial_get_ops(cur_dev); + int err; + + do { + err = ops->getc(cur_dev); + } while (err == -EAGAIN); + + return err >= 0 ? err : 0; +} + +void serial_stdio_init(void) +{ +} + +void serial_stub_putc(struct stdio_dev *sdev, const char ch) +{ + struct udevice *dev = sdev->priv; + struct dm_serial_ops *ops = serial_get_ops(dev); + + ops->putc(dev, ch); +} + +void serial_stub_puts(struct stdio_dev *sdev, const char *str) +{ + while (*str) + serial_stub_putc(sdev, *str++); +} + +int serial_stub_getc(struct stdio_dev *sdev) +{ + struct udevice *dev = sdev->priv; + struct dm_serial_ops *ops = serial_get_ops(dev); + + int err; + + do { + err = ops->getc(dev); + } while (err == -EAGAIN); + + return err >= 0 ? err : 0; +} + +int serial_stub_tstc(struct stdio_dev *sdev) +{ + struct udevice *dev = sdev->priv; + struct dm_serial_ops *ops = serial_get_ops(dev); + + if (ops->pending) + return ops->pending(dev, true); + + return 1; +} + +static int serial_post_probe(struct udevice *dev) +{ + struct stdio_dev sdev; + struct dm_serial_ops *ops = serial_get_ops(dev); + struct serial_dev_priv *upriv = dev->uclass_priv; + int ret; + + /* Set the baud rate */ + if (ops->setbrg) { + ret = ops->setbrg(dev, gd->baudrate); + if (ret) + return ret; + } + + if (!(gd->flags & GD_FLG_RELOC)) + return 0; + + memset(&sdev, '\0', sizeof(sdev)); + + strncpy(sdev.name, dev->name, sizeof(sdev.name)); + sdev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_INPUT; + sdev.priv = dev; + sdev.putc = serial_stub_putc; + sdev.puts = serial_stub_puts; + sdev.getc = serial_stub_getc; + sdev.tstc = serial_stub_tstc; + stdio_register_dev(&sdev, &upriv->sdev); + + return 0; +} + +static int serial_pre_remove(struct udevice *dev) +{ +#ifdef CONFIG_SYS_STDIO_DEREGISTER + struct serial_dev_priv *upriv = dev->uclass_priv; + + if (stdio_deregister_dev(upriv->sdev)) + return -EPERM; +#endif + + return 0; +} + +UCLASS_DRIVER(serial) = { + .id = UCLASS_SERIAL, + .name = "serial", + .post_probe = serial_post_probe, + .pre_remove = serial_pre_remove, + .per_device_auto_alloc_size = sizeof(struct serial_dev_priv), +}; diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index d2eb7520d0..bbe60af627 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -320,6 +320,7 @@ void serial_stdio_init(void) dev.puts = serial_stub_puts; dev.getc = serial_stub_getc; dev.tstc = serial_stub_tstc; + dev.priv = s; stdio_register(&dev); diff --git a/drivers/serial/serial_lpuart.c b/drivers/serial/serial_lpuart.c index 0a5e15919f..63fc388b26 100644 --- a/drivers/serial/serial_lpuart.c +++ b/drivers/serial/serial_lpuart.c @@ -22,10 +22,34 @@ #define SFIFO_RXOF (1 << 2) #define SFIFO_RXUF (1 << 0) +#define STAT_LBKDIF (1 << 31) +#define STAT_RXEDGIF (1 << 30) +#define STAT_TDRE (1 << 23) +#define STAT_RDRF (1 << 21) +#define STAT_IDLE (1 << 20) +#define STAT_OR (1 << 19) +#define STAT_NF (1 << 18) +#define STAT_FE (1 << 17) +#define STAT_PF (1 << 16) +#define STAT_MA1F (1 << 15) +#define STAT_MA2F (1 << 14) +#define STAT_FLAGS (STAT_LBKDIF | STAT_RXEDGIF | STAT_IDLE | STAT_OR | \ + STAT_NF | STAT_FE | STAT_PF | STAT_MA1F | STAT_MA2F) + +#define CTRL_TE (1 << 19) +#define CTRL_RE (1 << 18) + +#define FIFO_TXFE 0x80 +#define FIFO_RXFE 0x40 + +#define WATER_TXWATER_OFF 1 +#define WATER_RXWATER_OFF 16 + DECLARE_GLOBAL_DATA_PTR; struct lpuart_fsl *base = (struct lpuart_fsl *)LPUART_BASE; +#ifndef CONFIG_LPUART_32B_REG static void lpuart_serial_setbrg(void) { u32 clk = mxc_get_clock(MXC_UART_CLK); @@ -114,13 +138,107 @@ static struct serial_device lpuart_serial_drv = { .getc = lpuart_serial_getc, .tstc = lpuart_serial_tstc, }; +#else +static void lpuart32_serial_setbrg(void) +{ + u32 clk = CONFIG_SYS_CLK_FREQ; + u32 sbr; + + if (!gd->baudrate) + gd->baudrate = CONFIG_BAUDRATE; + + sbr = (clk / (16 * gd->baudrate)); + /* place adjustment later - n/32 BRFA */ + + out_be32(&base->baud, sbr); +} + +static int lpuart32_serial_getc(void) +{ + u32 stat; + + while (((stat = in_be32(&base->stat)) & STAT_RDRF) == 0) { + out_be32(&base->stat, STAT_FLAGS); + WATCHDOG_RESET(); + } + + return in_be32(&base->data) & 0x3ff; +} + +static void lpuart32_serial_putc(const char c) +{ + if (c == '\n') + serial_putc('\r'); + + while (!(in_be32(&base->stat) & STAT_TDRE)) + WATCHDOG_RESET(); + + out_be32(&base->data, c); +} + +/* + * Test whether a character is in the RX buffer + */ +static int lpuart32_serial_tstc(void) +{ + if ((in_be32(&base->water) >> 24) == 0) + return 0; + + return 1; +} + +/* + * Initialise the serial port with the given baudrate. The settings + * are always 8 data bits, no parity, 1 stop bit, no start bits. + */ +static int lpuart32_serial_init(void) +{ + u8 ctrl; + + ctrl = in_be32(&base->ctrl); + ctrl &= ~CTRL_RE; + ctrl &= ~CTRL_TE; + out_be32(&base->ctrl, ctrl); + + out_be32(&base->modir, 0); + out_be32(&base->fifo, ~(FIFO_TXFE | FIFO_RXFE)); + + out_be32(&base->match, 0); + /* provide data bits, parity, stop bit, etc */ + + serial_setbrg(); + + out_be32(&base->ctrl, CTRL_RE | CTRL_TE); + + return 0; +} + +static struct serial_device lpuart32_serial_drv = { + .name = "lpuart32_serial", + .start = lpuart32_serial_init, + .stop = NULL, + .setbrg = lpuart32_serial_setbrg, + .putc = lpuart32_serial_putc, + .puts = default_serial_puts, + .getc = lpuart32_serial_getc, + .tstc = lpuart32_serial_tstc, +}; +#endif void lpuart_serial_initialize(void) { +#ifdef CONFIG_LPUART_32B_REG + serial_register(&lpuart32_serial_drv); +#else serial_register(&lpuart_serial_drv); +#endif } __weak struct serial_device *default_serial_console(void) { +#ifdef CONFIG_LPUART_32B_REG + return &lpuart32_serial_drv; +#else return &lpuart_serial_drv; +#endif } diff --git a/drivers/serial/serial_ns16550.c b/drivers/serial/serial_ns16550.c index dafeed742d..632da4cf70 100644 --- a/drivers/serial/serial_ns16550.c +++ b/drivers/serial/serial_ns16550.c @@ -81,7 +81,8 @@ static NS16550_t serial_ports[6] = { static int eserial##port##_init(void) \ { \ int clock_divisor; \ - clock_divisor = calc_divisor(serial_ports[port-1]); \ + clock_divisor = ns16550_calc_divisor(serial_ports[port-1], \ + CONFIG_SYS_NS16550_CLK, gd->baudrate); \ NS16550_init(serial_ports[port-1], clock_divisor); \ return 0 ; \ } \ @@ -118,14 +119,6 @@ static NS16550_t serial_ports[6] = { .puts = eserial##port##_puts, \ } -static int calc_divisor (NS16550_t port) -{ - const unsigned int mode_x_div = 16; - - return DIV_ROUND_CLOSEST(CONFIG_SYS_NS16550_CLK, - mode_x_div * gd->baudrate); -} - void _serial_putc(const char c,const int port) { @@ -167,7 +160,8 @@ _serial_setbrg (const int port) { int clock_divisor; - clock_divisor = calc_divisor(PORT); + clock_divisor = ns16550_calc_divisor(PORT, CONFIG_SYS_NS16550_CLK, + gd->baudrate); NS16550_reinit(PORT, clock_divisor); } diff --git a/drivers/serial/serial_tegra.c b/drivers/serial/serial_tegra.c new file mode 100644 index 0000000000..7eb70e1de1 --- /dev/null +++ b/drivers/serial/serial_tegra.c @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2014 Google, Inc + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <dm.h> +#include <ns16550.h> +#include <serial.h> + +static const struct udevice_id tegra_serial_ids[] = { + { .compatible = "nvidia,tegra20-uart" }, + { } +}; + +static int tegra_serial_ofdata_to_platdata(struct udevice *dev) +{ + struct ns16550_platdata *plat = dev_get_platdata(dev); + int ret; + + ret = ns16550_serial_ofdata_to_platdata(dev); + if (ret) + return ret; + plat->clock = V_NS16550_CLK; + + return 0; +} +U_BOOT_DRIVER(serial_ns16550) = { + .name = "serial_tegra20", + .id = UCLASS_SERIAL, + .of_match = tegra_serial_ids, + .ofdata_to_platdata = tegra_serial_ofdata_to_platdata, + .platdata_auto_alloc_size = sizeof(struct ns16550_platdata), + .priv_auto_alloc_size = sizeof(struct NS16550), + .probe = ns16550_serial_probe, + .ops = &ns16550_serial_ops, +}; diff --git a/drivers/usb/eth/smsc95xx.c b/drivers/usb/eth/smsc95xx.c index 7a7a6767c7..6bca34dcf5 100644 --- a/drivers/usb/eth/smsc95xx.c +++ b/drivers/usb/eth/smsc95xx.c @@ -1,6 +1,7 @@ /* * Copyright (c) 2011 The Chromium OS Authors. * Copyright (C) 2009 NVIDIA, Corporation + * Copyright (C) 2007-2008 SMSC (Steve Glendinning) * * SPDX-License-Identifier: GPL-2.0+ */ diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c index 9ffe5010be..9a8f004ece 100644 --- a/drivers/usb/host/ehci-atmel.c +++ b/drivers/usb/host/ehci-atmel.c @@ -40,7 +40,11 @@ int ehci_hcd_init(int index, enum usb_init_type init, } /* Enable USB Host clock */ +#ifdef CPU_HAS_PCR + at91_periph_clk_enable(ATMEL_ID_UHPHS); +#else writel(1 << ATMEL_ID_UHPHS, &pmc->pcer); +#endif *hccr = (struct ehci_hccr *)ATMEL_BASE_EHCI; *hcor = (struct ehci_hcor *)((uint32_t)*hccr + @@ -55,7 +59,11 @@ int ehci_hcd_stop(int index) ulong start_time, tmp_time; /* Disable USB Host Clock */ +#ifdef CPU_HAS_PCR + at91_periph_clk_disable(ATMEL_ID_UHPHS); +#else writel(1 << ATMEL_ID_UHPHS, &pmc->pcdr); +#endif start_time = get_timer(0); /* Disable UTMI PLL */ diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index c24505e78e..820e2e56ef 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -38,8 +38,8 @@ int usb_cpu_init(void) #endif /* Enable USB host clock. */ -#ifdef CONFIG_SAMA5D3 - writel(1 << (ATMEL_ID_UHP - 32), &pmc->pcer1); +#ifdef CPU_HAS_PCR + at91_periph_clk_enable(ATMEL_ID_UHP); #else writel(1 << ATMEL_ID_UHP, &pmc->pcer); #endif @@ -58,8 +58,8 @@ int usb_cpu_stop(void) at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC; /* Disable USB host clock. */ -#ifdef CONFIG_SAMA5D3 - writel(1 << (ATMEL_ID_UHP - 32), &pmc->pcdr1); +#ifdef CPU_HAS_PCR + at91_periph_clk_disable(ATMEL_ID_UHP); #else writel(1 << ATMEL_ID_UHP, &pmc->pcdr); #endif diff --git a/drivers/usb/musb-new/am35x.c b/drivers/usb/musb-new/am35x.c index 57c9bd393b..857d7eb0cc 100644 --- a/drivers/usb/musb-new/am35x.c +++ b/drivers/usb/musb-new/am35x.c @@ -26,7 +26,6 @@ * */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/init.h> #include <linux/module.h> diff --git a/drivers/usb/musb-new/musb_core.c b/drivers/usb/musb-new/musb_core.c index 36681b6fc8..4edd6d729d 100644 --- a/drivers/usb/musb-new/musb_core.c +++ b/drivers/usb/musb-new/musb_core.c @@ -89,7 +89,6 @@ * Most of the conditional compilation will (someday) vanish. */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/usb/musb-new/musb_dsps.c b/drivers/usb/musb-new/musb_dsps.c index 9a03917e87..17ed224488 100644 --- a/drivers/usb/musb-new/musb_dsps.c +++ b/drivers/usb/musb-new/musb_dsps.c @@ -29,7 +29,6 @@ * da8xx.c would be merged to this file after testing. */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/init.h> #include <linux/io.h> diff --git a/drivers/usb/musb-new/musb_gadget.c b/drivers/usb/musb-new/musb_gadget.c index d2cb91a898..97acf93d31 100644 --- a/drivers/usb/musb-new/musb_gadget.c +++ b/drivers/usb/musb-new/musb_gadget.c @@ -33,7 +33,6 @@ * */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/kernel.h> #include <linux/list.h> diff --git a/drivers/usb/musb-new/musb_gadget_ep0.c b/drivers/usb/musb-new/musb_gadget_ep0.c index 8c3b0a145a..5a715013a2 100644 --- a/drivers/usb/musb-new/musb_gadget_ep0.c +++ b/drivers/usb/musb-new/musb_gadget_ep0.c @@ -33,7 +33,6 @@ * */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/kernel.h> #include <linux/list.h> diff --git a/drivers/usb/musb-new/musb_host.c b/drivers/usb/musb-new/musb_host.c index 9a2cf59d92..bbcee88241 100644 --- a/drivers/usb/musb-new/musb_host.c +++ b/drivers/usb/musb-new/musb_host.c @@ -33,7 +33,6 @@ * */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/usb/musb-new/musb_uboot.c b/drivers/usb/musb-new/musb_uboot.c index 0d7b89fcf6..2676f09c38 100644 --- a/drivers/usb/musb-new/musb_uboot.c +++ b/drivers/usb/musb-new/musb_uboot.c @@ -4,7 +4,6 @@ #include <linux/usb/ch9.h> #include <linux/usb/gadget.h> -#define __UBOOT__ #include <usb.h> #include "linux-compat.h" #include "usb-compat.h" diff --git a/drivers/usb/musb-new/omap2430.c b/drivers/usb/musb-new/omap2430.c index b1c4dc7828..98f4830912 100644 --- a/drivers/usb/musb-new/omap2430.c +++ b/drivers/usb/musb-new/omap2430.c @@ -24,7 +24,6 @@ * Suite 330, Boston, MA 02111-1307 USA * */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/module.h> #include <linux/kernel.h> diff --git a/drivers/video/Makefile b/drivers/video/Makefile index 248aa350b7..14a6781edc 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -15,6 +15,7 @@ obj-$(CONFIG_EXYNOS_MIPI_DSIM) += exynos_mipi_dsi.o exynos_mipi_dsi_common.o \ exynos_mipi_dsi_lowlevel.o obj-$(CONFIG_EXYNOS_PWM_BL) += exynos_pwm_bl.o obj-$(CONFIG_FSL_DIU_FB) += fsl_diu_fb.o videomodes.o +obj-$(CONFIG_FSL_DCU_FB) += fsl_dcu_fb.o videomodes.o obj-$(CONFIG_L5F31188) += l5f31188.o obj-$(CONFIG_MPC8XX_LCD) += mpc8xx_lcd.o obj-$(CONFIG_PXA_LCD) += pxa_lcd.o diff --git a/drivers/video/fsl_dcu_fb.c b/drivers/video/fsl_dcu_fb.c new file mode 100644 index 0000000000..d4cd382776 --- /dev/null +++ b/drivers/video/fsl_dcu_fb.c @@ -0,0 +1,365 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * FSL DCU Framebuffer driver + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <asm/io.h> +#include <common.h> +#include <fsl_dcu_fb.h> +#include <linux/fb.h> +#include <malloc.h> +#include <video_fb.h> +#include "videomodes.h" + +/* Convert the X,Y resolution pair into a single number */ +#define RESOLUTION(x, y) (((u32)(x) << 16) | (y)) + +#ifdef CONFIG_SYS_FSL_DCU_LE +#define dcu_read32 in_le32 +#define dcu_write32 out_le32 +#elif defined(CONFIG_SYS_FSL_DCU_BE) +#define dcu_read32 in_be32 +#define dcu_write32 out_be32 +#endif + +#define DCU_MODE_BLEND_ITER(x) ((x) << 20) +#define DCU_MODE_RASTER_EN (1 << 14) +#define DCU_MODE_NORMAL 1 +#define DCU_MODE_COLORBAR 3 +#define DCU_BGND_R(x) ((x) << 16) +#define DCU_BGND_G(x) ((x) << 8) +#define DCU_BGND_B(x) (x) +#define DCU_DISP_SIZE_DELTA_Y(x) ((x) << 16) +#define DCU_DISP_SIZE_DELTA_X(x) (x) +#define DCU_HSYN_PARA_BP(x) ((x) << 22) +#define DCU_HSYN_PARA_PW(x) ((x) << 11) +#define DCU_HSYN_PARA_FP(x) (x) +#define DCU_VSYN_PARA_BP(x) ((x) << 22) +#define DCU_VSYN_PARA_PW(x) ((x) << 11) +#define DCU_VSYN_PARA_FP(x) (x) +#define DCU_SYN_POL_INV_PXCK_FALL (0 << 6) +#define DCU_SYN_POL_NEG_REMAIN (0 << 5) +#define DCU_SYN_POL_INV_VS_LOW (1 << 1) +#define DCU_SYN_POL_INV_HS_LOW (1) +#define DCU_THRESHOLD_LS_BF_VS(x) ((x) << 16) +#define DCU_THRESHOLD_OUT_BUF_HIGH(x) ((x) << 8) +#define DCU_THRESHOLD_OUT_BUF_LOW(x) (x) +#define DCU_UPDATE_MODE_MODE (1 << 31) +#define DCU_UPDATE_MODE_READREG (1 << 30) + +#define DCU_CTRLDESCLN_1_HEIGHT(x) ((x) << 16) +#define DCU_CTRLDESCLN_1_WIDTH(x) (x) +#define DCU_CTRLDESCLN_2_POSY(x) ((x) << 16) +#define DCU_CTRLDESCLN_2_POSX(x) (x) +#define DCU_CTRLDESCLN_4_EN (1 << 31) +#define DCU_CTRLDESCLN_4_TILE_EN (1 << 30) +#define DCU_CTRLDESCLN_4_DATA_SEL_CLUT (1 << 29) +#define DCU_CTRLDESCLN_4_SAFETY_EN (1 << 28) +#define DCU_CTRLDESCLN_4_TRANS(x) ((x) << 20) +#define DCU_CTRLDESCLN_4_BPP(x) ((x) << 16) +#define DCU_CTRLDESCLN_4_RLE_EN (1 << 15) +#define DCU_CTRLDESCLN_4_LUOFFS(x) ((x) << 4) +#define DCU_CTRLDESCLN_4_BB_ON (1 << 2) +#define DCU_CTRLDESCLN_4_AB(x) (x) +#define DCU_CTRLDESCLN_5_CKMAX_R(x) ((x) << 16) +#define DCU_CTRLDESCLN_5_CKMAX_G(x) ((x) << 8) +#define DCU_CTRLDESCLN_5_CKMAX_B(x) (x) +#define DCU_CTRLDESCLN_6_CKMIN_R(x) ((x) << 16) +#define DCU_CTRLDESCLN_6_CKMIN_G(x) ((x) << 8) +#define DCU_CTRLDESCLN_6_CKMIN_B(x) (x) +#define DCU_CTRLDESCLN_7_TILE_VER(x) ((x) << 16) +#define DCU_CTRLDESCLN_7_TILE_HOR(x) (x) +#define DCU_CTRLDESCLN_8_FG_FCOLOR(x) (x) +#define DCU_CTRLDESCLN_9_BG_BCOLOR(x) (x) + +#define BPP_16_RGB565 4 +#define BPP_24_RGB888 5 +#define BPP_32_ARGB8888 6 + +/* + * This setting is used for the TWR_LCD_RGB card + */ +static struct fb_videomode fsl_dcu_mode_480_272 = { + .name = "480x272-60", + .refresh = 60, + .xres = 480, + .yres = 272, + .pixclock = 91996, + .left_margin = 2, + .right_margin = 2, + .upper_margin = 1, + .lower_margin = 1, + .hsync_len = 41, + .vsync_len = 2, + .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, + .vmode = FB_VMODE_NONINTERLACED +}; + +/* + * This setting is used for Siliconimage SiI9022A HDMI + */ +static struct fb_videomode fsl_dcu_mode_640_480 = { + .name = "640x480-60", + .refresh = 60, + .xres = 640, + .yres = 480, + .pixclock = 39722, + .left_margin = 48, + .right_margin = 16, + .upper_margin = 33, + .lower_margin = 10, + .hsync_len = 96, + .vsync_len = 2, + .sync = 0, + .vmode = FB_VMODE_NONINTERLACED, +}; + +/* + * DCU register map + */ +struct dcu_reg { + u32 desc_cursor[4]; + u32 mode; + u32 bgnd; + u32 disp_size; + u32 hsyn_para; + u32 vsyn_para; + u32 synpol; + u32 threshold; + u32 int_status; + u32 int_mask; + u32 colbar[8]; + u32 div_ratio; + u32 sign_calc[2]; + u32 crc_val; + u8 res_064[0x6c-0x64]; + u32 parr_err_status1; + u8 res_070[0x7c-0x70]; + u32 parr_err_status3; + u32 mparr_err_status1; + u8 res_084[0x90-0x84]; + u32 mparr_err_status3; + u32 threshold_inp_buf[2]; + u8 res_09c[0xa0-0x9c]; + u32 luma_comp; + u32 chroma_red; + u32 chroma_green; + u32 chroma_blue; + u32 crc_pos; + u32 lyr_intpol_en; + u32 lyr_luma_comp; + u32 lyr_chrm_red; + u32 lyr_chrm_grn; + u32 lyr_chrm_blue; + u8 res_0c4[0xcc-0xc8]; + u32 update_mode; + u32 underrun; + u8 res_0d4[0x100-0xd4]; + u32 gpr; + u32 slr_l[2]; + u32 slr_disp_size; + u32 slr_hvsync_para; + u32 slr_pol; + u32 slr_l_transp[2]; + u8 res_120[0x200-0x120]; + u32 ctrldescl[DCU_LAYER_MAX_NUM][16]; +}; + +static struct fb_info info; + +static void reset_total_layers(void) +{ + struct dcu_reg *regs = (struct dcu_reg *)CONFIG_SYS_DCU_ADDR; + int i; + + for (i = 0; i < DCU_LAYER_MAX_NUM; i++) { + dcu_write32(®s->ctrldescl[i][0], 0); + dcu_write32(®s->ctrldescl[i][1], 0); + dcu_write32(®s->ctrldescl[i][2], 0); + dcu_write32(®s->ctrldescl[i][3], 0); + dcu_write32(®s->ctrldescl[i][4], 0); + dcu_write32(®s->ctrldescl[i][5], 0); + dcu_write32(®s->ctrldescl[i][6], 0); + dcu_write32(®s->ctrldescl[i][7], 0); + dcu_write32(®s->ctrldescl[i][8], 0); + dcu_write32(®s->ctrldescl[i][9], 0); + dcu_write32(®s->ctrldescl[i][10], 0); + } + + dcu_write32(®s->update_mode, DCU_UPDATE_MODE_READREG); +} + +static int layer_ctrldesc_init(int index, u32 pixel_format) +{ + struct dcu_reg *regs = (struct dcu_reg *)CONFIG_SYS_DCU_ADDR; + unsigned int bpp = BPP_24_RGB888; + + dcu_write32(®s->ctrldescl[index][0], + DCU_CTRLDESCLN_1_HEIGHT(info.var.yres) | + DCU_CTRLDESCLN_1_WIDTH(info.var.xres)); + + dcu_write32(®s->ctrldescl[index][1], + DCU_CTRLDESCLN_2_POSY(0) | + DCU_CTRLDESCLN_2_POSX(0)); + + dcu_write32(®s->ctrldescl[index][2], (unsigned int)info.screen_base); + + switch (pixel_format) { + case 16: + bpp = BPP_16_RGB565; + break; + case 24: + bpp = BPP_24_RGB888; + break; + case 32: + bpp = BPP_32_ARGB8888; + break; + default: + printf("unsupported color depth: %u\n", pixel_format); + } + + dcu_write32(®s->ctrldescl[index][3], + DCU_CTRLDESCLN_4_EN | + DCU_CTRLDESCLN_4_TRANS(0xff) | + DCU_CTRLDESCLN_4_BPP(bpp) | + DCU_CTRLDESCLN_4_AB(0)); + + dcu_write32(®s->ctrldescl[index][4], + DCU_CTRLDESCLN_5_CKMAX_R(0xff) | + DCU_CTRLDESCLN_5_CKMAX_G(0xff) | + DCU_CTRLDESCLN_5_CKMAX_B(0xff)); + dcu_write32(®s->ctrldescl[index][5], + DCU_CTRLDESCLN_6_CKMIN_R(0) | + DCU_CTRLDESCLN_6_CKMIN_G(0) | + DCU_CTRLDESCLN_6_CKMIN_B(0)); + + dcu_write32(®s->ctrldescl[index][6], + DCU_CTRLDESCLN_7_TILE_VER(0) | + DCU_CTRLDESCLN_7_TILE_HOR(0)); + + dcu_write32(®s->ctrldescl[index][7], DCU_CTRLDESCLN_8_FG_FCOLOR(0)); + dcu_write32(®s->ctrldescl[index][8], DCU_CTRLDESCLN_9_BG_BCOLOR(0)); + + dcu_write32(®s->update_mode, DCU_UPDATE_MODE_READREG); + + return 0; +} + +int fsl_dcu_init(unsigned int xres, unsigned int yres, + unsigned int pixel_format) +{ + struct dcu_reg *regs = (struct dcu_reg *)CONFIG_SYS_DCU_ADDR; + unsigned int div, mode; + + /* Memory allocation for framebuffer */ + info.screen_size = + info.var.xres * info.var.yres * (info.var.bits_per_pixel / 8); + info.screen_base = (char *)memalign(ARCH_DMA_MINALIGN, + roundup(info.screen_size, ARCH_DMA_MINALIGN)); + memset(info.screen_base, 0, info.screen_size); + + reset_total_layers(); + div = dcu_set_pixel_clock(info.var.pixclock); + dcu_write32(®s->div_ratio, (div - 1)); + + dcu_write32(®s->disp_size, + DCU_DISP_SIZE_DELTA_Y(info.var.yres) | + DCU_DISP_SIZE_DELTA_X(info.var.xres / 16)); + + dcu_write32(®s->hsyn_para, + DCU_HSYN_PARA_BP(info.var.left_margin) | + DCU_HSYN_PARA_PW(info.var.hsync_len) | + DCU_HSYN_PARA_FP(info.var.right_margin)); + + dcu_write32(®s->vsyn_para, + DCU_VSYN_PARA_BP(info.var.upper_margin) | + DCU_VSYN_PARA_PW(info.var.vsync_len) | + DCU_VSYN_PARA_FP(info.var.lower_margin)); + + dcu_write32(®s->synpol, + DCU_SYN_POL_INV_PXCK_FALL | + DCU_SYN_POL_NEG_REMAIN | + DCU_SYN_POL_INV_VS_LOW | + DCU_SYN_POL_INV_HS_LOW); + + dcu_write32(®s->bgnd, + DCU_BGND_R(0) | DCU_BGND_G(0) | DCU_BGND_B(0)); + + dcu_write32(®s->mode, + DCU_MODE_BLEND_ITER(DCU_LAYER_MAX_NUM) | + DCU_MODE_RASTER_EN); + + dcu_write32(®s->threshold, + DCU_THRESHOLD_LS_BF_VS(0x3) | + DCU_THRESHOLD_OUT_BUF_HIGH(0x78) | + DCU_THRESHOLD_OUT_BUF_LOW(0)); + + mode = dcu_read32(®s->mode); + dcu_write32(®s->mode, mode | DCU_MODE_NORMAL); + + layer_ctrldesc_init(0, pixel_format); + + return 0; +} + +void *video_hw_init(void) +{ + static GraphicDevice ctfb; + const char *options; + unsigned int depth = 0, freq = 0; + struct fb_videomode *fsl_dcu_mode_db = &fsl_dcu_mode_480_272; + + if (!video_get_video_mode(&ctfb.winSizeX, &ctfb.winSizeY, &depth, &freq, + &options)) + return NULL; + + /* Find the monitor port, which is a required option */ + if (!options) + return NULL; + if (strncmp(options, "monitor=", 8) != 0) + return NULL; + + switch (RESOLUTION(ctfb.winSizeX, ctfb.winSizeY)) { + case RESOLUTION(480, 272): + fsl_dcu_mode_db = &fsl_dcu_mode_480_272; + break; + case RESOLUTION(640, 480): + fsl_dcu_mode_db = &fsl_dcu_mode_640_480; + break; + default: + printf("unsupported resolution %ux%u\n", + ctfb.winSizeX, ctfb.winSizeY); + } + + info.var.xres = fsl_dcu_mode_db->xres; + info.var.yres = fsl_dcu_mode_db->yres; + info.var.bits_per_pixel = 32; + info.var.pixclock = fsl_dcu_mode_db->pixclock; + info.var.left_margin = fsl_dcu_mode_db->left_margin; + info.var.right_margin = fsl_dcu_mode_db->right_margin; + info.var.upper_margin = fsl_dcu_mode_db->upper_margin; + info.var.lower_margin = fsl_dcu_mode_db->lower_margin; + info.var.hsync_len = fsl_dcu_mode_db->hsync_len; + info.var.vsync_len = fsl_dcu_mode_db->vsync_len; + info.var.sync = fsl_dcu_mode_db->sync; + info.var.vmode = fsl_dcu_mode_db->vmode; + info.fix.line_length = info.var.xres * info.var.bits_per_pixel / 8; + + if (platform_dcu_init(ctfb.winSizeX, ctfb.winSizeY, + options + 8, fsl_dcu_mode_db) < 0) + return NULL; + + ctfb.frameAdrs = (unsigned int)info.screen_base; + ctfb.plnSizeX = ctfb.winSizeX; + ctfb.plnSizeY = ctfb.winSizeY; + + ctfb.gdfBytesPP = 4; + ctfb.gdfIndex = GDF_32BIT_X888RGB; + + ctfb.memSize = info.screen_size; + + return &ctfb; +} diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile index 0276a10564..1dc0f5aa10 100644 --- a/drivers/watchdog/Makefile +++ b/drivers/watchdog/Makefile @@ -7,7 +7,7 @@ obj-$(CONFIG_AT91SAM9_WATCHDOG) += at91sam9_wdt.o obj-$(CONFIG_FTWDT010_WATCHDOG) += ftwdt010_wdt.o -ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 vf610)) +ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 vf610 ls102xa)) obj-y += imx_watchdog.o endif obj-$(CONFIG_TNETV107X_WATCHDOG) += tnetv107x_wdt.o diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile index 2dacba2eba..0863a8cda2 100644 --- a/examples/standalone/Makefile +++ b/examples/standalone/Makefile @@ -22,7 +22,7 @@ extra-$(CONFIG_PPC) += sched ELF := $(strip $(extra-y)) extra-y += $(addsuffix .srec,$(extra-y)) $(addsuffix .bin,$(extra-y)) -clean-files := $(extra-) $(addsuffix .srec,$(extra-)) $(addsuffix .bin,$(extra-)) +clean-files := *.srec *.bin COBJS := $(ELF:=.o) diff --git a/examples/standalone/stubs.c b/examples/standalone/stubs.c index c5c025dab3..0bf690e73d 100644 --- a/examples/standalone/stubs.c +++ b/examples/standalone/stubs.c @@ -1,9 +1,6 @@ #include <common.h> #include <exports.h> - -#ifndef GCC_VERSION -#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__) -#endif /* GCC_VERSION */ +#include <linux/compiler.h> #if defined(CONFIG_X86) /* @@ -237,7 +234,7 @@ gd_t *global_data; * implementation. On the other hand, asm() statements with * arguments can be used only inside the functions (gcc limitation) */ -#if GCC_VERSION < 3004 +#if GCC_VERSION < 30400 static #endif /* GCC_VERSION */ void __attribute__((unused)) dummy(void) diff --git a/fs/ubifs/budget.c b/fs/ubifs/budget.c index 9ed40177cb..c626cbf484 100644 --- a/fs/ubifs/budget.c +++ b/fs/ubifs/budget.c @@ -20,7 +20,6 @@ */ #include "ubifs.h" -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/writeback.h> #else diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c index 2f50a554bb..6e6f018b2f 100644 --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c @@ -16,7 +16,6 @@ * various local functions of those subsystems. */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/module.h> #include <linux/debugfs.h> diff --git a/fs/ubifs/debug.h b/fs/ubifs/debug.h index 6d325af8bc..807ce1b733 100644 --- a/fs/ubifs/debug.h +++ b/fs/ubifs/debug.h @@ -12,7 +12,6 @@ #ifndef __UBIFS_DEBUG_H__ #define __UBIFS_DEBUG_H__ -#define __UBOOT__ /* Checking helper functions */ typedef int (*dbg_leaf_callback)(struct ubifs_info *c, struct ubifs_zbranch *zbr, void *priv); diff --git a/fs/ubifs/io.c b/fs/ubifs/io.c index f87341e108..bdccdc45e1 100644 --- a/fs/ubifs/io.c +++ b/fs/ubifs/io.c @@ -59,7 +59,6 @@ * they are read from the flash media. */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/crc32.h> #include <linux/slab.h> diff --git a/fs/ubifs/log.c b/fs/ubifs/log.c index ced04240c5..0355fe2b04 100644 --- a/fs/ubifs/log.c +++ b/fs/ubifs/log.c @@ -16,7 +16,6 @@ * journal. */ -#define __UBOOT__ #ifdef __UBOOT__ #include <linux/err.h> #endif diff --git a/fs/ubifs/lprops.c b/fs/ubifs/lprops.c index fc6686bb08..a1a814f779 100644 --- a/fs/ubifs/lprops.c +++ b/fs/ubifs/lprops.c @@ -17,7 +17,6 @@ * an empty LEB for the journal, or a very dirty LEB for garbage collection. */ -#define __UBOOT__ #ifdef __UBOOT__ #include <linux/err.h> #endif diff --git a/fs/ubifs/lpt.c b/fs/ubifs/lpt.c index c49d3b0687..8489e90e4a 100644 --- a/fs/ubifs/lpt.c +++ b/fs/ubifs/lpt.c @@ -33,7 +33,6 @@ */ #include "ubifs.h" -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/crc16.h> #include <linux/math64.h> diff --git a/fs/ubifs/lpt_commit.c b/fs/ubifs/lpt_commit.c index cad422e066..c818d4ca5a 100644 --- a/fs/ubifs/lpt_commit.c +++ b/fs/ubifs/lpt_commit.c @@ -14,7 +14,6 @@ * subsystem. */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/crc16.h> #include <linux/slab.h> diff --git a/fs/ubifs/master.c b/fs/ubifs/master.c index 00ca855e81..761e0704e4 100644 --- a/fs/ubifs/master.c +++ b/fs/ubifs/master.c @@ -11,7 +11,6 @@ /* This file implements reading and writing the master node */ -#define __UBOOT__ #include "ubifs.h" #ifdef __UBOOT__ #include <linux/compat.h> diff --git a/fs/ubifs/misc.h b/fs/ubifs/misc.h index 4316d3c8ae..7cad2bed1b 100644 --- a/fs/ubifs/misc.h +++ b/fs/ubifs/misc.h @@ -16,7 +16,6 @@ #ifndef __UBIFS_MISC_H__ #define __UBIFS_MISC_H__ -#define __UBOOT__ /** * ubifs_zn_dirty - check if znode is dirty. * @znode: znode to check diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c index f54a440cd5..763770738b 100644 --- a/fs/ubifs/recovery.c +++ b/fs/ubifs/recovery.c @@ -36,7 +36,6 @@ * refuses to mount. */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/crc32.h> #include <linux/slab.h> diff --git a/fs/ubifs/replay.c b/fs/ubifs/replay.c index 6393b15b18..7268b37a49 100644 --- a/fs/ubifs/replay.c +++ b/fs/ubifs/replay.c @@ -21,7 +21,6 @@ * larger is the journal, the more memory its index may consume. */ -#define __UBOOT__ #ifdef __UBOOT__ #include <linux/compat.h> #include <linux/err.h> diff --git a/fs/ubifs/sb.c b/fs/ubifs/sb.c index fc0194aa26..4983bf6289 100644 --- a/fs/ubifs/sb.c +++ b/fs/ubifs/sb.c @@ -16,7 +16,6 @@ */ #include "ubifs.h" -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/slab.h> #include <linux/random.h> diff --git a/fs/ubifs/scan.c b/fs/ubifs/scan.c index 5523d4e660..6fc464bb48 100644 --- a/fs/ubifs/scan.c +++ b/fs/ubifs/scan.c @@ -16,7 +16,6 @@ * debugging functions. */ -#define __UBOOT__ #ifdef __UBOOT__ #include <linux/err.h> #endif diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index dd9b668ee7..01d449a7af 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -15,7 +15,6 @@ * corresponding subsystems, but most of it is here. */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/init.h> #include <linux/slab.h> diff --git a/fs/ubifs/tnc.c b/fs/ubifs/tnc.c index eda5070557..95cae548bf 100644 --- a/fs/ubifs/tnc.c +++ b/fs/ubifs/tnc.c @@ -19,7 +19,6 @@ * the mutex locked. */ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/crc32.h> #include <linux/slab.h> diff --git a/fs/ubifs/tnc_misc.c b/fs/ubifs/tnc_misc.c index 81bdad9203..f808e0bc2f 100644 --- a/fs/ubifs/tnc_misc.c +++ b/fs/ubifs/tnc_misc.c @@ -16,7 +16,6 @@ * putting it all in one file would make that file too big and unreadable. */ -#define __UBOOT__ #ifdef __UBOOT__ #include <linux/err.h> #endif diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c index b91a6fd26f..49e6f469ca 100644 --- a/fs/ubifs/ubifs.c +++ b/fs/ubifs/ubifs.c @@ -26,7 +26,6 @@ #include "ubifs.h" #include <u-boot/zlib.h> -#define __UBOOT__ #include <linux/err.h> #include <linux/lzo.h> diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index acc6a404dd..0ce2475e0b 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h @@ -15,7 +15,6 @@ #ifndef __UBIFS_H__ #define __UBIFS_H__ -#define __UBOOT__ #ifndef __UBOOT__ #include <asm/div64.h> #include <linux/statfs.h> diff --git a/include/aboot.h b/include/aboot.h new file mode 100644 index 0000000000..30e4d36df8 --- /dev/null +++ b/include/aboot.h @@ -0,0 +1,28 @@ +/* + * Copyright 2014 Broadcom Corporation. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <part.h> +#include <sparse_format.h> + +#define ROUNDUP(x, y) (((x) + ((y) - 1)) & ~((y) - 1)) + +void fastboot_fail(const char *s); +void fastboot_okay(const char *s); + +static inline int is_sparse_image(void *buf) +{ + sparse_header_t *s_header = (sparse_header_t *)buf; + + if ((le32_to_cpu(s_header->magic) == SPARSE_HEADER_MAGIC) && + (le16_to_cpu(s_header->major_version) == 1)) + return 1; + + return 0; +} + +void write_sparse_image(block_dev_desc_t *dev_desc, + disk_partition_t *info, const char *part_name, + void *data, unsigned sz); diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h index df1a6fc528..aef0ad3fbe 100644 --- a/include/configs/am335x_evm.h +++ b/include/configs/am335x_evm.h @@ -115,6 +115,9 @@ "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \ "ip=dhcp\0" \ "bootenv=uEnv.txt\0" \ + "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \ + "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \ + "source ${loadaddr}\0" \ "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \ "importbootenv=echo Importing environment from mmc ...; " \ "env import -t -r $loadaddr $filesize\0" \ @@ -142,17 +145,21 @@ "mmcboot=mmc dev ${mmcdev}; " \ "if mmc rescan; then " \ "echo SD/MMC found on device ${mmcdev};" \ - "if run loadbootenv; then " \ - "echo Loaded environment from ${bootenv};" \ - "run importbootenv;" \ - "fi;" \ - "if test -n $uenvcmd; then " \ - "echo Running uenvcmd ...;" \ - "run uenvcmd;" \ - "fi;" \ - "if run loadimage; then " \ - "run mmcloados;" \ - "fi;" \ + "if run loadbootscript; then " \ + "run bootscript;" \ + "else " \ + "if run loadbootenv; then " \ + "echo Loaded environment from ${bootenv};" \ + "run importbootenv;" \ + "fi;" \ + "if test -n $uenvcmd; then " \ + "echo Running uenvcmd ...;" \ + "run uenvcmd;" \ + "fi;" \ + "if run loadimage; then " \ + "run mmcloados;" \ + "fi;" \ + "fi ;" \ "fi;\0" \ "spiboot=echo Booting from spi ...; " \ "run spiargs; " \ diff --git a/include/configs/at91sam9n12ek.h b/include/configs/at91sam9n12ek.h index 9b0e588c6b..f02fce95b3 100644 --- a/include/configs/at91sam9n12ek.h +++ b/include/configs/at91sam9n12ek.h @@ -31,6 +31,7 @@ #define CONFIG_DISPLAY_CPUINFO #define CONFIG_OF_LIBFDT +#define CONFIG_SYS_GENERIC_BOARD /* general purpose I/O */ #define CONFIG_AT91_GPIO diff --git a/include/configs/at91sam9rlek.h b/include/configs/at91sam9rlek.h index 3747098d2a..b8d5dd156f 100644 --- a/include/configs/at91sam9rlek.h +++ b/include/configs/at91sam9rlek.h @@ -34,6 +34,8 @@ #define CONFIG_CMD_BOOTZ #define CONFIG_OF_LIBFDT +#define CONFIG_SYS_GENERIC_BOARD + #define CONFIG_ATMEL_LEGACY #define CONFIG_AT91_GPIO 1 #define CONFIG_AT91_GPIO_PULLUP 1 diff --git a/include/configs/ls1021aqds.h b/include/configs/ls1021aqds.h new file mode 100644 index 0000000000..657e3b6d48 --- /dev/null +++ b/include/configs/ls1021aqds.h @@ -0,0 +1,389 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#include <config_cmd_default.h> + +#define CONFIG_LS102XA + +#define CONFIG_SYS_GENERIC_BOARD + +#define CONFIG_DISPLAY_CPUINFO +#define CONFIG_DISPLAY_BOARDINFO + +#define CONFIG_SKIP_LOWLEVEL_INIT +#define CONFIG_BOARD_EARLY_INIT_F + +/* + * Size of malloc() pool + */ +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 16 * 1024 * 1024) + +#define CONFIG_SYS_INIT_RAM_ADDR OCRAM_BASE_ADDR +#define CONFIG_SYS_INIT_RAM_SIZE OCRAM_SIZE + +/* + * Generic Timer Definitions + */ +#define GENERIC_TIMER_CLK 12500000 + +#ifndef __ASSEMBLY__ +unsigned long get_board_sys_clk(void); +unsigned long get_board_ddr_clk(void); +#endif + +#define CONFIG_SYS_CLK_FREQ get_board_sys_clk() +#define CONFIG_DDR_CLK_FREQ get_board_ddr_clk() + +#ifndef CONFIG_SYS_TEXT_BASE +#define CONFIG_SYS_TEXT_BASE 0x67f80000 +#endif + +#define CONFIG_NR_DRAM_BANKS 1 + +#define CONFIG_DDR_SPD +#define SPD_EEPROM_ADDRESS 0x51 +#define CONFIG_SYS_SPD_BUS_NUM 0 +#define CONFIG_SYS_DDR_RAW_TIMING + +#define CONFIG_FSL_DDR_INTERACTIVE /* Interactive debugging */ +#define CONFIG_SYS_FSL_DDR3 /* Use DDR3 memory */ +#define CONFIG_DIMM_SLOTS_PER_CTLR 1 +#define CONFIG_CHIP_SELECTS_PER_CTRL 4 + +#define CONFIG_SYS_DDR_SDRAM_BASE 0x80000000UL +#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_SDRAM_BASE + +#define CONFIG_DDR_ECC +#ifdef CONFIG_DDR_ECC +#define CONFIG_ECC_INIT_VIA_DDRCONTROLLER +#define CONFIG_MEM_INIT_VALUE 0xdeadbeef +#endif + +#define CONFIG_SYS_HAS_SERDES + +/* + * IFC Definitions + */ +#define CONFIG_FSL_IFC +#define CONFIG_SYS_FLASH_BASE 0x60000000 +#define CONFIG_SYS_FLASH_BASE_PHYS CONFIG_SYS_FLASH_BASE + +#define CONFIG_SYS_NOR0_CSPR_EXT (0x0) +#define CONFIG_SYS_NOR0_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE_PHYS) | \ + CSPR_PORT_SIZE_16 | \ + CSPR_MSEL_NOR | \ + CSPR_V) +#define CONFIG_SYS_NOR1_CSPR_EXT (0x0) +#define CONFIG_SYS_NOR1_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE_PHYS \ + + 0x8000000) | \ + CSPR_PORT_SIZE_16 | \ + CSPR_MSEL_NOR | \ + CSPR_V) +#define CONFIG_SYS_NOR_AMASK IFC_AMASK(128 * 1024 * 1024) + +#define CONFIG_SYS_NOR_CSOR (CSOR_NOR_ADM_SHIFT(4) | \ + CSOR_NOR_TRHZ_80) +#define CONFIG_SYS_NOR_FTIM0 (FTIM0_NOR_TACSE(0x4) | \ + FTIM0_NOR_TEADC(0x5) | \ + FTIM0_NOR_TEAHC(0x5)) +#define CONFIG_SYS_NOR_FTIM1 (FTIM1_NOR_TACO(0x35) | \ + FTIM1_NOR_TRAD_NOR(0x1a) | \ + FTIM1_NOR_TSEQRAD_NOR(0x13)) +#define CONFIG_SYS_NOR_FTIM2 (FTIM2_NOR_TCS(0x4) | \ + FTIM2_NOR_TCH(0x4) | \ + FTIM2_NOR_TWPH(0xe) | \ + FTIM2_NOR_TWP(0x1c)) +#define CONFIG_SYS_NOR_FTIM3 0 + +#define CONFIG_FLASH_CFI_DRIVER +#define CONFIG_SYS_FLASH_CFI +#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE +#define CONFIG_SYS_FLASH_QUIET_TEST +#define CONFIG_FLASH_SHOW_PROGRESS 45 +#define CONFIG_CFI_FLASH_USE_WEAK_ACCESSORS + +#define CONFIG_SYS_MAX_FLASH_BANKS 2 /* number of banks */ +#define CONFIG_SYS_MAX_FLASH_SECT 1024 /* sectors per device */ +#define CONFIG_SYS_FLASH_ERASE_TOUT 60000 /* Flash Erase Timeout (ms) */ +#define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (ms) */ + +#define CONFIG_SYS_FLASH_EMPTY_INFO +#define CONFIG_SYS_FLASH_BANKS_LIST {CONFIG_SYS_FLASH_BASE_PHYS, \ + CONFIG_SYS_FLASH_BASE_PHYS + 0x8000000} + +/* + * NAND Flash Definitions + */ +#define CONFIG_NAND_FSL_IFC + +#define CONFIG_SYS_NAND_BASE 0x7e800000 +#define CONFIG_SYS_NAND_BASE_PHYS CONFIG_SYS_NAND_BASE + +#define CONFIG_SYS_NAND_CSPR_EXT (0x0) + +#define CONFIG_SYS_NAND_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \ + | CSPR_PORT_SIZE_8 \ + | CSPR_MSEL_NAND \ + | CSPR_V) +#define CONFIG_SYS_NAND_AMASK IFC_AMASK(64*1024) +#define CONFIG_SYS_NAND_CSOR (CSOR_NAND_ECC_ENC_EN /* ECC on encode */ \ + | CSOR_NAND_ECC_DEC_EN /* ECC on decode */ \ + | CSOR_NAND_ECC_MODE_4 /* 4-bit ECC */ \ + | CSOR_NAND_RAL_3 /* RAL = 3 Bytes */ \ + | CSOR_NAND_PGS_2K /* Page Size = 2K */ \ + | CSOR_NAND_SPRZ_64 /* Spare size = 64 */ \ + | CSOR_NAND_PB(64)) /* 64 Pages Per Block */ + +#define CONFIG_SYS_NAND_ONFI_DETECTION + +#define CONFIG_SYS_NAND_FTIM0 (FTIM0_NAND_TCCST(0x7) | \ + FTIM0_NAND_TWP(0x18) | \ + FTIM0_NAND_TWCHT(0x7) | \ + FTIM0_NAND_TWH(0xa)) +#define CONFIG_SYS_NAND_FTIM1 (FTIM1_NAND_TADLE(0x32) | \ + FTIM1_NAND_TWBE(0x39) | \ + FTIM1_NAND_TRR(0xe) | \ + FTIM1_NAND_TRP(0x18)) +#define CONFIG_SYS_NAND_FTIM2 (FTIM2_NAND_TRAD(0xf) | \ + FTIM2_NAND_TREH(0xa) | \ + FTIM2_NAND_TWHRE(0x1e)) +#define CONFIG_SYS_NAND_FTIM3 0x0 + +#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE } +#define CONFIG_SYS_MAX_NAND_DEVICE 1 +#define CONFIG_MTD_NAND_VERIFY_WRITE +#define CONFIG_CMD_NAND + +#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024) + +/* + * QIXIS Definitions + */ +#define CONFIG_FSL_QIXIS + +#ifdef CONFIG_FSL_QIXIS +#define QIXIS_BASE 0x7fb00000 +#define QIXIS_BASE_PHYS QIXIS_BASE +#define CONFIG_SYS_I2C_FPGA_ADDR 0x66 +#define QIXIS_LBMAP_SWITCH 6 +#define QIXIS_LBMAP_MASK 0x0f +#define QIXIS_LBMAP_SHIFT 0 +#define QIXIS_LBMAP_DFLTBANK 0x00 +#define QIXIS_LBMAP_ALTBANK 0x04 +#define QIXIS_RST_CTL_RESET 0x44 +#define QIXIS_RCFG_CTL_RECONFIG_IDLE 0x20 +#define QIXIS_RCFG_CTL_RECONFIG_START 0x21 +#define QIXIS_RCFG_CTL_WATCHDOG_ENBLE 0x08 + +#define CONFIG_SYS_FPGA_CSPR_EXT (0x0) +#define CONFIG_SYS_FPGA_CSPR (CSPR_PHYS_ADDR(QIXIS_BASE_PHYS) | \ + CSPR_PORT_SIZE_8 | \ + CSPR_MSEL_GPCM | \ + CSPR_V) +#define CONFIG_SYS_FPGA_AMASK IFC_AMASK(64 * 1024) +#define CONFIG_SYS_FPGA_CSOR (CSOR_NOR_ADM_SHIFT(4) | \ + CSOR_NOR_NOR_MODE_AVD_NOR | \ + CSOR_NOR_TRHZ_80) + +/* + * QIXIS Timing parameters for IFC GPCM + */ +#define CONFIG_SYS_FPGA_FTIM0 (FTIM0_GPCM_TACSE(0xe) | \ + FTIM0_GPCM_TEADC(0xe) | \ + FTIM0_GPCM_TEAHC(0xe)) +#define CONFIG_SYS_FPGA_FTIM1 (FTIM1_GPCM_TACO(0xe) | \ + FTIM1_GPCM_TRAD(0x1f)) +#define CONFIG_SYS_FPGA_FTIM2 (FTIM2_GPCM_TCS(0xe) | \ + FTIM2_GPCM_TCH(0xe) | \ + FTIM2_GPCM_TWP(0xf0)) +#define CONFIG_SYS_FPGA_FTIM3 0x0 +#endif + +#define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NOR0_CSPR_EXT +#define CONFIG_SYS_CSPR0 CONFIG_SYS_NOR0_CSPR +#define CONFIG_SYS_AMASK0 CONFIG_SYS_NOR_AMASK +#define CONFIG_SYS_CSOR0 CONFIG_SYS_NOR_CSOR +#define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NOR_FTIM0 +#define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NOR_FTIM1 +#define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NOR_FTIM2 +#define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NOR_FTIM3 +#define CONFIG_SYS_CSPR1_EXT CONFIG_SYS_NOR1_CSPR_EXT +#define CONFIG_SYS_CSPR1 CONFIG_SYS_NOR1_CSPR +#define CONFIG_SYS_AMASK1 CONFIG_SYS_NOR_AMASK +#define CONFIG_SYS_CSOR1 CONFIG_SYS_NOR_CSOR +#define CONFIG_SYS_CS1_FTIM0 CONFIG_SYS_NOR_FTIM0 +#define CONFIG_SYS_CS1_FTIM1 CONFIG_SYS_NOR_FTIM1 +#define CONFIG_SYS_CS1_FTIM2 CONFIG_SYS_NOR_FTIM2 +#define CONFIG_SYS_CS1_FTIM3 CONFIG_SYS_NOR_FTIM3 +#define CONFIG_SYS_CSPR2_EXT CONFIG_SYS_NAND_CSPR_EXT +#define CONFIG_SYS_CSPR2 CONFIG_SYS_NAND_CSPR +#define CONFIG_SYS_AMASK2 CONFIG_SYS_NAND_AMASK +#define CONFIG_SYS_CSOR2 CONFIG_SYS_NAND_CSOR +#define CONFIG_SYS_CS2_FTIM0 CONFIG_SYS_NAND_FTIM0 +#define CONFIG_SYS_CS2_FTIM1 CONFIG_SYS_NAND_FTIM1 +#define CONFIG_SYS_CS2_FTIM2 CONFIG_SYS_NAND_FTIM2 +#define CONFIG_SYS_CS2_FTIM3 CONFIG_SYS_NAND_FTIM3 +#define CONFIG_SYS_CSPR3_EXT CONFIG_SYS_FPGA_CSPR_EXT +#define CONFIG_SYS_CSPR3 CONFIG_SYS_FPGA_CSPR +#define CONFIG_SYS_AMASK3 CONFIG_SYS_FPGA_AMASK +#define CONFIG_SYS_CSOR3 CONFIG_SYS_FPGA_CSOR +#define CONFIG_SYS_CS3_FTIM0 CONFIG_SYS_FPGA_FTIM0 +#define CONFIG_SYS_CS3_FTIM1 CONFIG_SYS_FPGA_FTIM1 +#define CONFIG_SYS_CS3_FTIM2 CONFIG_SYS_FPGA_FTIM2 +#define CONFIG_SYS_CS3_FTIM3 CONFIG_SYS_FPGA_FTIM3 + +/* + * Serial Port + */ +#define CONFIG_CONS_INDEX 1 +#define CONFIG_SYS_NS16550 +#define CONFIG_SYS_NS16550_SERIAL +#define CONFIG_SYS_NS16550_REG_SIZE 1 +#define CONFIG_SYS_NS16550_CLK get_serial_clock() + +#define CONFIG_BAUDRATE 115200 + +/* + * I2C + */ +#define CONFIG_CMD_I2C +#define CONFIG_SYS_I2C +#define CONFIG_SYS_I2C_MXC + +/* + * I2C bus multiplexer + */ +#define I2C_MUX_PCA_ADDR_PRI 0x77 +#define I2C_MUX_CH_DEFAULT 0x8 + +/* + * MMC + */ +#define CONFIG_MMC +#define CONFIG_CMD_MMC +#define CONFIG_FSL_ESDHC +#define CONFIG_GENERIC_MMC + +/* + * eTSEC + */ +#define CONFIG_TSEC_ENET + +#ifdef CONFIG_TSEC_ENET +#define CONFIG_MII +#define CONFIG_MII_DEFAULT_TSEC 3 +#define CONFIG_TSEC1 1 +#define CONFIG_TSEC1_NAME "eTSEC1" +#define CONFIG_TSEC2 1 +#define CONFIG_TSEC2_NAME "eTSEC2" +#define CONFIG_TSEC3 1 +#define CONFIG_TSEC3_NAME "eTSEC3" + +#define TSEC1_PHY_ADDR 1 +#define TSEC2_PHY_ADDR 2 +#define TSEC3_PHY_ADDR 3 + +#define TSEC1_FLAGS (TSEC_GIGABIT | TSEC_REDUCED) +#define TSEC2_FLAGS (TSEC_GIGABIT | TSEC_REDUCED) +#define TSEC3_FLAGS (TSEC_GIGABIT | TSEC_REDUCED) + +#define TSEC1_PHYIDX 0 +#define TSEC2_PHYIDX 0 +#define TSEC3_PHYIDX 0 + +#define CONFIG_ETHPRIME "eTSEC1" + +#define CONFIG_PHY_GIGE +#define CONFIG_PHYLIB +#define CONFIG_PHY_REALTEK + +#define CONFIG_HAS_ETH0 +#define CONFIG_HAS_ETH1 +#define CONFIG_HAS_ETH2 + +#define CONFIG_FSL_SGMII_RISER 1 +#define SGMII_RISER_PHY_OFFSET 0x1b + +#ifdef CONFIG_FSL_SGMII_RISER +#define CONFIG_SYS_TBIPA_VALUE 8 +#endif + +#endif +#define CONFIG_CMD_PING +#define CONFIG_CMD_DHCP +#define CONFIG_CMD_MII +#define CONFIG_CMD_NET + +#define CONFIG_CMDLINE_TAG +#define CONFIG_CMDLINE_EDITING +#define CONFIG_CMD_IMLS + +#define CONFIG_HWCONFIG +#define HWCONFIG_BUFFER_SIZE 128 + +#define CONFIG_BOOTDELAY 3 + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "bootargs=root=/dev/ram0 rw console=ttyS0,115200\0" \ + "fdt_high=0xcfffffff\0" \ + "initrd_high=0xcfffffff\0" \ + "hwconfig=fsl_ddr:ctlr_intlv=null,bank_intlv=null\0" + +/* + * Miscellaneous configurable options + */ +#define CONFIG_SYS_LONGHELP /* undef to save memory */ +#define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */ +#define CONFIG_SYS_PROMPT_HUSH_PS2 "> " +#define CONFIG_SYS_PROMPT "=> " +#define CONFIG_AUTO_COMPLETE +#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ +#define CONFIG_SYS_PBSIZE \ + (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) +#define CONFIG_SYS_MAXARGS 16 /* max number of command args */ +#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE + +#define CONFIG_CMD_ENV_EXISTS +#define CONFIG_CMD_GREPENV +#define CONFIG_CMD_MEMINFO +#define CONFIG_CMD_MEMTEST +#define CONFIG_SYS_MEMTEST_START 0x80000000 +#define CONFIG_SYS_MEMTEST_END 0x9fffffff + +#define CONFIG_SYS_LOAD_ADDR 0x82000000 +#define CONFIG_SYS_HZ 1000 + +/* + * Stack sizes + * The stack sizes are set up in start.S using the settings below + */ +#define CONFIG_STACKSIZE (30 * 1024) + +#define CONFIG_SYS_INIT_SP_OFFSET \ + (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) +#define CONFIG_SYS_INIT_SP_ADDR \ + (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) + +#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */ + +/* + * Environment + */ +#define CONFIG_ENV_OVERWRITE + +#define CONFIG_ENV_IS_IN_FLASH +#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SECT_SIZE) +#define CONFIG_ENV_SIZE 0x2000 +#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K (one sector) */ + +#define CONFIG_OF_LIBFDT +#define CONFIG_OF_BOARD_SETUP +#define CONFIG_CMD_BOOTZ + +#endif diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h new file mode 100644 index 0000000000..45b2272ff5 --- /dev/null +++ b/include/configs/ls1021atwr.h @@ -0,0 +1,291 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#include <config_cmd_default.h> + +#define CONFIG_LS102XA + +#define CONFIG_SYS_GENERIC_BOARD + +#define CONFIG_DISPLAY_CPUINFO +#define CONFIG_DISPLAY_BOARDINFO + +#define CONFIG_SKIP_LOWLEVEL_INIT +#define CONFIG_BOARD_EARLY_INIT_F + +/* + * Size of malloc() pool + */ +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 16 * 1024 * 1024) + +#define CONFIG_SYS_INIT_RAM_ADDR OCRAM_BASE_ADDR +#define CONFIG_SYS_INIT_RAM_SIZE OCRAM_SIZE + +/* + * Generic Timer Definitions + */ +#define GENERIC_TIMER_CLK 12500000 + +#define CONFIG_SYS_CLK_FREQ 100000000 +#define CONFIG_DDR_CLK_FREQ 100000000 + +#ifndef CONFIG_SYS_TEXT_BASE +#define CONFIG_SYS_TEXT_BASE 0x67f80000 +#endif + +#define CONFIG_NR_DRAM_BANKS 1 +#define PHYS_SDRAM 0x80000000 +#define PHYS_SDRAM_SIZE (1u * 1024 * 1024 * 1024) + +#define CONFIG_SYS_DDR_SDRAM_BASE 0x80000000UL +#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_SDRAM_BASE + +#define CONFIG_SYS_HAS_SERDES + +/* + * IFC Definitions + */ +#define CONFIG_FSL_IFC +#define CONFIG_SYS_FLASH_BASE 0x60000000 +#define CONFIG_SYS_FLASH_BASE_PHYS CONFIG_SYS_FLASH_BASE + +#define CONFIG_SYS_NOR0_CSPR_EXT (0x0) +#define CONFIG_SYS_NOR0_CSPR (CSPR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE_PHYS) | \ + CSPR_PORT_SIZE_16 | \ + CSPR_MSEL_NOR | \ + CSPR_V) +#define CONFIG_SYS_NOR_AMASK IFC_AMASK(128 * 1024 * 1024) + +/* NOR Flash Timing Params */ +#define CONFIG_SYS_NOR_CSOR (CSOR_NOR_ADM_SHIFT(4) | \ + CSOR_NOR_TRHZ_80) +#define CONFIG_SYS_NOR_FTIM0 (FTIM0_NOR_TACSE(0x4) | \ + FTIM0_NOR_TEADC(0x5) | \ + FTIM0_NOR_TAVDS(0x0) | \ + FTIM0_NOR_TEAHC(0x5)) +#define CONFIG_SYS_NOR_FTIM1 (FTIM1_NOR_TACO(0x35) | \ + FTIM1_NOR_TRAD_NOR(0x1A) | \ + FTIM1_NOR_TSEQRAD_NOR(0x13)) +#define CONFIG_SYS_NOR_FTIM2 (FTIM2_NOR_TCS(0x4) | \ + FTIM2_NOR_TCH(0x4) | \ + FTIM2_NOR_TWP(0x1c) | \ + FTIM2_NOR_TWPH(0x0e)) +#define CONFIG_SYS_NOR_FTIM3 0 + +#define CONFIG_FLASH_CFI_DRIVER +#define CONFIG_SYS_FLASH_CFI +#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE +#define CONFIG_SYS_FLASH_QUIET_TEST +#define CONFIG_FLASH_SHOW_PROGRESS 45 /* count down from 45/5: 9..1 */ + +#define CONFIG_SYS_MAX_FLASH_BANKS 1 /* number of banks */ +#define CONFIG_SYS_MAX_FLASH_SECT 1024 /* sectors per device */ +#define CONFIG_SYS_FLASH_ERASE_TOUT 60000 /* Flash Erase Timeout (ms) */ +#define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (ms) */ + +#define CONFIG_SYS_FLASH_EMPTY_INFO +#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE_PHYS } + +#define CONFIG_CFI_FLASH_USE_WEAK_ACCESSORS + +/* CPLD */ + +#define CONFIG_SYS_CPLD_BASE 0x7fb00000 +#define CPLD_BASE_PHYS CONFIG_SYS_CPLD_BASE + +#define CONFIG_SYS_FPGA_CSPR_EXT (0x0) +#define CONFIG_SYS_FPGA_CSPR (CSPR_PHYS_ADDR(CPLD_BASE_PHYS) | \ + CSPR_PORT_SIZE_8 | \ + CSPR_MSEL_GPCM | \ + CSPR_V) +#define CONFIG_SYS_FPGA_AMASK IFC_AMASK(64 * 1024) +#define CONFIG_SYS_FPGA_CSOR (CSOR_NOR_ADM_SHIFT(4) | \ + CSOR_NOR_NOR_MODE_AVD_NOR | \ + CSOR_NOR_TRHZ_80) + +/* CPLD Timing parameters for IFC GPCM */ +#define CONFIG_SYS_FPGA_FTIM0 (FTIM0_GPCM_TACSE(0xf) | \ + FTIM0_GPCM_TEADC(0xf) | \ + FTIM0_GPCM_TEAHC(0xf)) +#define CONFIG_SYS_FPGA_FTIM1 (FTIM1_GPCM_TACO(0xff) | \ + FTIM1_GPCM_TRAD(0x3f)) +#define CONFIG_SYS_FPGA_FTIM2 (FTIM2_GPCM_TCS(0xf) | \ + FTIM2_GPCM_TCH(0xf) | \ + FTIM2_GPCM_TWP(0xff)) +#define CONFIG_SYS_FPGA_FTIM3 0x0 +#define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NOR0_CSPR_EXT +#define CONFIG_SYS_CSPR0 CONFIG_SYS_NOR0_CSPR +#define CONFIG_SYS_AMASK0 CONFIG_SYS_NOR_AMASK +#define CONFIG_SYS_CSOR0 CONFIG_SYS_NOR_CSOR +#define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NOR_FTIM0 +#define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NOR_FTIM1 +#define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NOR_FTIM2 +#define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NOR_FTIM3 +#define CONFIG_SYS_CSPR1_EXT CONFIG_SYS_FPGA_CSPR_EXT +#define CONFIG_SYS_CSPR1 CONFIG_SYS_FPGA_CSPR +#define CONFIG_SYS_AMASK1 CONFIG_SYS_FPGA_AMASK +#define CONFIG_SYS_CSOR1 CONFIG_SYS_FPGA_CSOR +#define CONFIG_SYS_CS1_FTIM0 CONFIG_SYS_FPGA_FTIM0 +#define CONFIG_SYS_CS1_FTIM1 CONFIG_SYS_FPGA_FTIM1 +#define CONFIG_SYS_CS1_FTIM2 CONFIG_SYS_FPGA_FTIM2 +#define CONFIG_SYS_CS1_FTIM3 CONFIG_SYS_FPGA_FTIM3 + +/* + * Serial Port + */ +#define CONFIG_CONS_INDEX 1 +#define CONFIG_SYS_NS16550 +#define CONFIG_SYS_NS16550_SERIAL +#define CONFIG_SYS_NS16550_REG_SIZE 1 +#define CONFIG_SYS_NS16550_CLK get_serial_clock() + +#define CONFIG_BAUDRATE 115200 + +/* + * I2C + */ +#define CONFIG_CMD_I2C +#define CONFIG_SYS_I2C +#define CONFIG_SYS_I2C_MXC + +/* + * MMC + */ +#define CONFIG_MMC +#define CONFIG_CMD_MMC +#define CONFIG_FSL_ESDHC +#define CONFIG_GENERIC_MMC + +/* + * Video + */ +#define CONFIG_FSL_DCU_FB + +#ifdef CONFIG_FSL_DCU_FB +#define CONFIG_VIDEO +#define CONFIG_CMD_BMP +#define CONFIG_CFB_CONSOLE +#define CONFIG_VGA_AS_SINGLE_DEVICE +#define CONFIG_VIDEO_LOGO +#define CONFIG_VIDEO_BMP_LOGO + +#define CONFIG_FSL_DCU_SII9022A +#define CONFIG_SYS_I2C_DVI_BUS_NUM 1 +#define CONFIG_SYS_I2C_DVI_ADDR 0x39 +#endif + +/* + * eTSEC + */ +#define CONFIG_TSEC_ENET + +#ifdef CONFIG_TSEC_ENET +#define CONFIG_MII +#define CONFIG_MII_DEFAULT_TSEC 1 +#define CONFIG_TSEC1 1 +#define CONFIG_TSEC1_NAME "eTSEC1" +#define CONFIG_TSEC2 1 +#define CONFIG_TSEC2_NAME "eTSEC2" +#define CONFIG_TSEC3 1 +#define CONFIG_TSEC3_NAME "eTSEC3" + +#define TSEC1_PHY_ADDR 2 +#define TSEC2_PHY_ADDR 0 +#define TSEC3_PHY_ADDR 1 + +#define TSEC1_FLAGS (TSEC_GIGABIT | TSEC_REDUCED) +#define TSEC2_FLAGS (TSEC_GIGABIT | TSEC_REDUCED) +#define TSEC3_FLAGS (TSEC_GIGABIT | TSEC_REDUCED) + +#define TSEC1_PHYIDX 0 +#define TSEC2_PHYIDX 0 +#define TSEC3_PHYIDX 0 + +#define CONFIG_ETHPRIME "eTSEC1" + +#define CONFIG_PHY_GIGE +#define CONFIG_PHYLIB +#define CONFIG_PHY_ATHEROS + +#define CONFIG_HAS_ETH0 +#define CONFIG_HAS_ETH1 +#define CONFIG_HAS_ETH2 +#endif + +#define CONFIG_CMD_PING +#define CONFIG_CMD_DHCP +#define CONFIG_CMD_MII +#define CONFIG_CMD_NET + +#define CONFIG_CMDLINE_TAG +#define CONFIG_CMDLINE_EDITING +#define CONFIG_CMD_IMLS + +#define CONFIG_HWCONFIG +#define HWCONFIG_BUFFER_SIZE 128 + +#define CONFIG_BOOTDELAY 3 + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "bootargs=root=/dev/ram0 rw console=ttyS0,115200\0" \ + "initrd_high=0xcfffffff\0" \ + "fdt_high=0xcfffffff\0" + +/* + * Miscellaneous configurable options + */ +#define CONFIG_SYS_LONGHELP /* undef to save memory */ +#define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */ +#define CONFIG_SYS_PROMPT_HUSH_PS2 "> " +#define CONFIG_SYS_PROMPT "=> " +#define CONFIG_AUTO_COMPLETE +#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ +#define CONFIG_SYS_PBSIZE \ + (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) +#define CONFIG_SYS_MAXARGS 16 /* max number of command args */ +#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE + +#define CONFIG_CMD_ENV_EXISTS +#define CONFIG_CMD_GREPENV +#define CONFIG_CMD_MEMINFO +#define CONFIG_CMD_MEMTEST +#define CONFIG_SYS_MEMTEST_START 0x80000000 +#define CONFIG_SYS_MEMTEST_END 0x9fffffff + +#define CONFIG_SYS_LOAD_ADDR 0x82000000 +#define CONFIG_SYS_HZ 1000 + +/* + * Stack sizes + * The stack sizes are set up in start.S using the settings below + */ +#define CONFIG_STACKSIZE (30 * 1024) + +#define CONFIG_SYS_INIT_SP_OFFSET \ + (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) +#define CONFIG_SYS_INIT_SP_ADDR \ + (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) + +#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */ + +/* + * Environment + */ +#define CONFIG_ENV_OVERWRITE + +#define CONFIG_ENV_IS_IN_FLASH +#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SECT_SIZE) +#define CONFIG_ENV_SIZE 0x20000 +#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K (one sector) */ + +#define CONFIG_OF_LIBFDT +#define CONFIG_OF_BOARD_SETUP +#define CONFIG_CMD_BOOTZ + +#endif diff --git a/include/configs/sama5d3xek.h b/include/configs/sama5d3xek.h index 56c2454dff..0104d5f90a 100644 --- a/include/configs/sama5d3xek.h +++ b/include/configs/sama5d3xek.h @@ -79,8 +79,19 @@ #define CONFIG_BOOTP_GATEWAY #define CONFIG_BOOTP_HOSTNAME -/* No NOR flash */ +/* NOR flash */ +#define CONFIG_CMD_FLASH + +#ifdef CONFIG_CMD_FLASH +#define CONFIG_FLASH_CFI_DRIVER +#define CONFIG_SYS_FLASH_CFI +#define CONFIG_SYS_FLASH_PROTECTION +#define CONFIG_SYS_FLASH_BASE 0x10000000 +#define CONFIG_SYS_MAX_FLASH_SECT 131 +#define CONFIG_SYS_MAX_FLASH_BANKS 1 +#else #define CONFIG_SYS_NO_FLASH +#endif /* * Command line configuration. diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h index bf2d25c871..f5fa4b3ddc 100644 --- a/include/configs/sandbox.h +++ b/include/configs/sandbox.h @@ -31,6 +31,9 @@ #define CONFIG_DM_DEMO_SHAPE #define CONFIG_DM_GPIO #define CONFIG_DM_TEST +#define CONFIG_DM_SERIAL + +#define CONFIG_SYS_STDIO_DEREGISTER /* Number of bits in a C 'long' on this architecture */ #define CONFIG_SANDBOX_BITS_PER_LONG 64 diff --git a/include/configs/tegra-common.h b/include/configs/tegra-common.h index d27fcebd7c..834b3d5686 100644 --- a/include/configs/tegra-common.h +++ b/include/configs/tegra-common.h @@ -20,6 +20,10 @@ #define CONFIG_DM #define CONFIG_CMD_DM +#define CONFIG_DM_GPIO +#ifndef CONFIG_SPL_BUILD +#define CONFIG_DM_SERIAL +#endif #define CONFIG_SYS_TIMER_RATE 1000000 #define CONFIG_SYS_TIMER_COUNTER NV_PA_TMRUS_BASE @@ -40,14 +44,19 @@ * Size of malloc() pool */ #define CONFIG_SYS_MALLOC_LEN (4 << 20) /* 4MB */ +#define CONFIG_SYS_MALLOC_F_LEN (1 << 10) /* * NS16550 Configuration */ -#define CONFIG_SYS_NS16550 +#ifdef CONFIG_SPL_BUILD #define CONFIG_SYS_NS16550_SERIAL #define CONFIG_SYS_NS16550_REG_SIZE (-4) #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK +#else +#define CONFIG_TEGRA_SERIAL +#endif +#define CONFIG_SYS_NS16550 /* * Common HW configuration. diff --git a/include/configs/ti_omap4_common.h b/include/configs/ti_omap4_common.h index 8c7310c9a1..b0f199e3f4 100644 --- a/include/configs/ti_omap4_common.h +++ b/include/configs/ti_omap4_common.h @@ -101,10 +101,10 @@ "vram=${vram} " \ "root=${mmcroot} " \ "rootfstype=${mmcrootfstype}\0" \ - "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \ + "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \ "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \ "source ${loadaddr}\0" \ - "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \ + "loadbootenv=load mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \ "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \ "env import -t ${loadaddr} ${filesize}\0" \ "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ diff --git a/include/dm/lists.h b/include/dm/lists.h index 87a3af59c2..2356895246 100644 --- a/include/dm/lists.h +++ b/include/dm/lists.h @@ -53,7 +53,11 @@ int lists_bind_drivers(struct udevice *parent, bool pre_reloc_only); * @parent: parent driver (root) * @blob: device tree blob * @offset: offset of this device tree node + * @devp: if non-NULL, returns a pointer to the bound device + * @return 0 if device was bound, -EINVAL if the device tree is invalid, + * other -ve value on error */ -int lists_bind_fdt(struct udevice *parent, const void *blob, int offset); +int lists_bind_fdt(struct udevice *parent, const void *blob, int offset, + struct udevice **devp); #endif diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h index dd95fca428..7f0e37b7b7 100644 --- a/include/dm/uclass-id.h +++ b/include/dm/uclass-id.h @@ -21,6 +21,7 @@ enum uclass_id { /* U-Boot uclasses start here */ UCLASS_GPIO, /* Bank of general-purpose I/O pins */ + UCLASS_SERIAL, /* Serial UART */ UCLASS_COUNT, UCLASS_INVALID = -1, diff --git a/include/dt-bindings/clock/tegra114-car.h b/include/dt-bindings/clock/tegra114-car.h new file mode 100644 index 0000000000..6d0d8d8ef3 --- /dev/null +++ b/include/dt-bindings/clock/tegra114-car.h @@ -0,0 +1,342 @@ +/* + * This header provides constants for binding nvidia,tegra114-car. + * + * The first 160 clocks are numbered to match the bits in the CAR's CLK_OUT_ENB + * registers. These IDs often match those in the CAR's RST_DEVICES registers, + * but not in all cases. Some bits in CLK_OUT_ENB affect multiple clocks. In + * this case, those clocks are assigned IDs above 160 in order to highlight + * this issue. Implementations that interpret these clock IDs as bit values + * within the CLK_OUT_ENB or RST_DEVICES registers should be careful to + * explicitly handle these special cases. + * + * The balance of the clocks controlled by the CAR are assigned IDs of 160 and + * above. + */ + +#ifndef _DT_BINDINGS_CLOCK_TEGRA114_CAR_H +#define _DT_BINDINGS_CLOCK_TEGRA114_CAR_H + +/* 0 */ +/* 1 */ +/* 2 */ +/* 3 */ +#define TEGRA114_CLK_RTC 4 +#define TEGRA114_CLK_TIMER 5 +#define TEGRA114_CLK_UARTA 6 +/* 7 (register bit affects uartb and vfir) */ +/* 8 */ +#define TEGRA114_CLK_SDMMC2 9 +/* 10 (register bit affects spdif_in and spdif_out) */ +#define TEGRA114_CLK_I2S1 11 +#define TEGRA114_CLK_I2C1 12 +#define TEGRA114_CLK_NDFLASH 13 +#define TEGRA114_CLK_SDMMC1 14 +#define TEGRA114_CLK_SDMMC4 15 +/* 16 */ +#define TEGRA114_CLK_PWM 17 +#define TEGRA114_CLK_I2S2 18 +#define TEGRA114_CLK_EPP 19 +/* 20 (register bit affects vi and vi_sensor) */ +#define TEGRA114_CLK_GR2D 21 +#define TEGRA114_CLK_USBD 22 +#define TEGRA114_CLK_ISP 23 +#define TEGRA114_CLK_GR3D 24 +/* 25 */ +#define TEGRA114_CLK_DISP2 26 +#define TEGRA114_CLK_DISP1 27 +#define TEGRA114_CLK_HOST1X 28 +#define TEGRA114_CLK_VCP 29 +#define TEGRA114_CLK_I2S0 30 +/* 31 */ + +/* 32 */ +/* 33 */ +#define TEGRA114_CLK_APBDMA 34 +/* 35 */ +#define TEGRA114_CLK_KBC 36 +/* 37 */ +/* 38 */ +/* 39 (register bit affects fuse and fuse_burn) */ +#define TEGRA114_CLK_KFUSE 40 +#define TEGRA114_CLK_SBC1 41 +#define TEGRA114_CLK_NOR 42 +/* 43 */ +#define TEGRA114_CLK_SBC2 44 +/* 45 */ +#define TEGRA114_CLK_SBC3 46 +#define TEGRA114_CLK_I2C5 47 +#define TEGRA114_CLK_DSIA 48 +/* 49 */ +#define TEGRA114_CLK_MIPI 50 +#define TEGRA114_CLK_HDMI 51 +#define TEGRA114_CLK_CSI 52 +/* 53 */ +#define TEGRA114_CLK_I2C2 54 +#define TEGRA114_CLK_UARTC 55 +#define TEGRA114_CLK_MIPI_CAL 56 +#define TEGRA114_CLK_EMC 57 +#define TEGRA114_CLK_USB2 58 +#define TEGRA114_CLK_USB3 59 +/* 60 */ +#define TEGRA114_CLK_VDE 61 +#define TEGRA114_CLK_BSEA 62 +#define TEGRA114_CLK_BSEV 63 + +/* 64 */ +#define TEGRA114_CLK_UARTD 65 +/* 66 */ +#define TEGRA114_CLK_I2C3 67 +#define TEGRA114_CLK_SBC4 68 +#define TEGRA114_CLK_SDMMC3 69 +/* 70 */ +#define TEGRA114_CLK_OWR 71 +/* 72 */ +#define TEGRA114_CLK_CSITE 73 +/* 74 */ +/* 75 */ +#define TEGRA114_CLK_LA 76 +#define TEGRA114_CLK_TRACE 77 +#define TEGRA114_CLK_SOC_THERM 78 +#define TEGRA114_CLK_DTV 79 +#define TEGRA114_CLK_NDSPEED 80 +#define TEGRA114_CLK_I2CSLOW 81 +#define TEGRA114_CLK_DSIB 82 +#define TEGRA114_CLK_TSEC 83 +/* 84 */ +/* 85 */ +/* 86 */ +/* 87 */ +/* 88 */ +#define TEGRA114_CLK_XUSB_HOST 89 +/* 90 */ +#define TEGRA114_CLK_MSENC 91 +#define TEGRA114_CLK_CSUS 92 +/* 93 */ +/* 94 */ +/* 95 (bit affects xusb_dev and xusb_dev_src) */ + +/* 96 */ +/* 97 */ +/* 98 */ +#define TEGRA114_CLK_MSELECT 99 +#define TEGRA114_CLK_TSENSOR 100 +#define TEGRA114_CLK_I2S3 101 +#define TEGRA114_CLK_I2S4 102 +#define TEGRA114_CLK_I2C4 103 +#define TEGRA114_CLK_SBC5 104 +#define TEGRA114_CLK_SBC6 105 +#define TEGRA114_CLK_D_AUDIO 106 +#define TEGRA114_CLK_APBIF 107 +#define TEGRA114_CLK_DAM0 108 +#define TEGRA114_CLK_DAM1 109 +#define TEGRA114_CLK_DAM2 110 +#define TEGRA114_CLK_HDA2CODEC_2X 111 +/* 112 */ +#define TEGRA114_CLK_AUDIO0_2X 113 +#define TEGRA114_CLK_AUDIO1_2X 114 +#define TEGRA114_CLK_AUDIO2_2X 115 +#define TEGRA114_CLK_AUDIO3_2X 116 +#define TEGRA114_CLK_AUDIO4_2X 117 +#define TEGRA114_CLK_SPDIF_2X 118 +#define TEGRA114_CLK_ACTMON 119 +#define TEGRA114_CLK_EXTERN1 120 +#define TEGRA114_CLK_EXTERN2 121 +#define TEGRA114_CLK_EXTERN3 122 +/* 123 */ +/* 124 */ +#define TEGRA114_CLK_HDA 125 +/* 126 */ +#define TEGRA114_CLK_SE 127 + +#define TEGRA114_CLK_HDA2HDMI 128 +/* 129 */ +/* 130 */ +/* 131 */ +/* 132 */ +/* 133 */ +/* 134 */ +/* 135 */ +/* 136 */ +/* 137 */ +/* 138 */ +/* 139 */ +/* 140 */ +/* 141 */ +/* 142 */ +/* 143 (bit affects xusb_falcon_src, xusb_fs_src, */ +/* xusb_host_src and xusb_ss_src) */ +#define TEGRA114_CLK_CILAB 144 +#define TEGRA114_CLK_CILCD 145 +#define TEGRA114_CLK_CILE 146 +#define TEGRA114_CLK_DSIALP 147 +#define TEGRA114_CLK_DSIBLP 148 +/* 149 */ +#define TEGRA114_CLK_DDS 150 +/* 151 */ +#define TEGRA114_CLK_DP2 152 +#define TEGRA114_CLK_AMX 153 +#define TEGRA114_CLK_ADX 154 +/* 155 (bit affects dfll_ref and dfll_soc) */ +#define TEGRA114_CLK_XUSB_SS 156 +/* 157 */ +/* 158 */ +/* 159 */ + +/* 160 */ +/* 161 */ +/* 162 */ +/* 163 */ +/* 164 */ +/* 165 */ +/* 166 */ +/* 167 */ +/* 168 */ +/* 169 */ +/* 170 */ +/* 171 */ +/* 172 */ +/* 173 */ +/* 174 */ +/* 175 */ +/* 176 */ +/* 177 */ +/* 178 */ +/* 179 */ +/* 180 */ +/* 181 */ +/* 182 */ +/* 183 */ +/* 184 */ +/* 185 */ +/* 186 */ +/* 187 */ +/* 188 */ +/* 189 */ +/* 190 */ +/* 191 */ + +#define TEGRA114_CLK_UARTB 192 +#define TEGRA114_CLK_VFIR 193 +#define TEGRA114_CLK_SPDIF_IN 194 +#define TEGRA114_CLK_SPDIF_OUT 195 +#define TEGRA114_CLK_VI 196 +#define TEGRA114_CLK_VI_SENSOR 197 +#define TEGRA114_CLK_FUSE 198 +#define TEGRA114_CLK_FUSE_BURN 199 +#define TEGRA114_CLK_CLK_32K 200 +#define TEGRA114_CLK_CLK_M 201 +#define TEGRA114_CLK_CLK_M_DIV2 202 +#define TEGRA114_CLK_CLK_M_DIV4 203 +#define TEGRA114_CLK_PLL_REF 204 +#define TEGRA114_CLK_PLL_C 205 +#define TEGRA114_CLK_PLL_C_OUT1 206 +#define TEGRA114_CLK_PLL_C2 207 +#define TEGRA114_CLK_PLL_C3 208 +#define TEGRA114_CLK_PLL_M 209 +#define TEGRA114_CLK_PLL_M_OUT1 210 +#define TEGRA114_CLK_PLL_P 211 +#define TEGRA114_CLK_PLL_P_OUT1 212 +#define TEGRA114_CLK_PLL_P_OUT2 213 +#define TEGRA114_CLK_PLL_P_OUT3 214 +#define TEGRA114_CLK_PLL_P_OUT4 215 +#define TEGRA114_CLK_PLL_A 216 +#define TEGRA114_CLK_PLL_A_OUT0 217 +#define TEGRA114_CLK_PLL_D 218 +#define TEGRA114_CLK_PLL_D_OUT0 219 +#define TEGRA114_CLK_PLL_D2 220 +#define TEGRA114_CLK_PLL_D2_OUT0 221 +#define TEGRA114_CLK_PLL_U 222 +#define TEGRA114_CLK_PLL_U_480M 223 + +#define TEGRA114_CLK_PLL_U_60M 224 +#define TEGRA114_CLK_PLL_U_48M 225 +#define TEGRA114_CLK_PLL_U_12M 226 +#define TEGRA114_CLK_PLL_X 227 +#define TEGRA114_CLK_PLL_X_OUT0 228 +#define TEGRA114_CLK_PLL_RE_VCO 229 +#define TEGRA114_CLK_PLL_RE_OUT 230 +#define TEGRA114_CLK_PLL_E_OUT0 231 +#define TEGRA114_CLK_SPDIF_IN_SYNC 232 +#define TEGRA114_CLK_I2S0_SYNC 233 +#define TEGRA114_CLK_I2S1_SYNC 234 +#define TEGRA114_CLK_I2S2_SYNC 235 +#define TEGRA114_CLK_I2S3_SYNC 236 +#define TEGRA114_CLK_I2S4_SYNC 237 +#define TEGRA114_CLK_VIMCLK_SYNC 238 +#define TEGRA114_CLK_AUDIO0 239 +#define TEGRA114_CLK_AUDIO1 240 +#define TEGRA114_CLK_AUDIO2 241 +#define TEGRA114_CLK_AUDIO3 242 +#define TEGRA114_CLK_AUDIO4 243 +#define TEGRA114_CLK_SPDIF 244 +#define TEGRA114_CLK_CLK_OUT_1 245 +#define TEGRA114_CLK_CLK_OUT_2 246 +#define TEGRA114_CLK_CLK_OUT_3 247 +#define TEGRA114_CLK_BLINK 248 +/* 249 */ +/* 250 */ +/* 251 */ +#define TEGRA114_CLK_XUSB_HOST_SRC 252 +#define TEGRA114_CLK_XUSB_FALCON_SRC 253 +#define TEGRA114_CLK_XUSB_FS_SRC 254 +#define TEGRA114_CLK_XUSB_SS_SRC 255 + +#define TEGRA114_CLK_XUSB_DEV_SRC 256 +#define TEGRA114_CLK_XUSB_DEV 257 +#define TEGRA114_CLK_XUSB_HS_SRC 258 +#define TEGRA114_CLK_SCLK 259 +#define TEGRA114_CLK_HCLK 260 +#define TEGRA114_CLK_PCLK 261 +#define TEGRA114_CLK_CCLK_G 262 +#define TEGRA114_CLK_CCLK_LP 263 +#define TEGRA114_CLK_DFLL_REF 264 +#define TEGRA114_CLK_DFLL_SOC 265 +/* 266 */ +/* 267 */ +/* 268 */ +/* 269 */ +/* 270 */ +/* 271 */ +/* 272 */ +/* 273 */ +/* 274 */ +/* 275 */ +/* 276 */ +/* 277 */ +/* 278 */ +/* 279 */ +/* 280 */ +/* 281 */ +/* 282 */ +/* 283 */ +/* 284 */ +/* 285 */ +/* 286 */ +/* 287 */ + +/* 288 */ +/* 289 */ +/* 290 */ +/* 291 */ +/* 292 */ +/* 293 */ +/* 294 */ +/* 295 */ +/* 296 */ +/* 297 */ +/* 298 */ +/* 299 */ +#define TEGRA114_CLK_AUDIO0_MUX 300 +#define TEGRA114_CLK_AUDIO1_MUX 301 +#define TEGRA114_CLK_AUDIO2_MUX 302 +#define TEGRA114_CLK_AUDIO3_MUX 303 +#define TEGRA114_CLK_AUDIO4_MUX 304 +#define TEGRA114_CLK_SPDIF_MUX 305 +#define TEGRA114_CLK_CLK_OUT_1_MUX 306 +#define TEGRA114_CLK_CLK_OUT_2_MUX 307 +#define TEGRA114_CLK_CLK_OUT_3_MUX 308 +#define TEGRA114_CLK_DSIA_MUX 309 +#define TEGRA114_CLK_DSIB_MUX 310 +#define TEGRA114_CLK_CLK_MAX 311 + +#endif /* _DT_BINDINGS_CLOCK_TEGRA114_CAR_H */ diff --git a/include/dt-bindings/clock/tegra124-car.h b/include/dt-bindings/clock/tegra124-car.h new file mode 100644 index 0000000000..fd8d62ac7f --- /dev/null +++ b/include/dt-bindings/clock/tegra124-car.h @@ -0,0 +1,342 @@ +/* + * This header provides constants for binding nvidia,tegra124-car. + * + * The first 192 clocks are numbered to match the bits in the CAR's CLK_OUT_ENB + * registers. These IDs often match those in the CAR's RST_DEVICES registers, + * but not in all cases. Some bits in CLK_OUT_ENB affect multiple clocks. In + * this case, those clocks are assigned IDs above 185 in order to highlight + * this issue. Implementations that interpret these clock IDs as bit values + * within the CLK_OUT_ENB or RST_DEVICES registers should be careful to + * explicitly handle these special cases. + * + * The balance of the clocks controlled by the CAR are assigned IDs of 185 and + * above. + */ + +#ifndef _DT_BINDINGS_CLOCK_TEGRA124_CAR_H +#define _DT_BINDINGS_CLOCK_TEGRA124_CAR_H + +/* 0 */ +/* 1 */ +/* 2 */ +#define TEGRA124_CLK_ISPB 3 +#define TEGRA124_CLK_RTC 4 +#define TEGRA124_CLK_TIMER 5 +#define TEGRA124_CLK_UARTA 6 +/* 7 (register bit affects uartb and vfir) */ +/* 8 */ +#define TEGRA124_CLK_SDMMC2 9 +/* 10 (register bit affects spdif_in and spdif_out) */ +#define TEGRA124_CLK_I2S1 11 +#define TEGRA124_CLK_I2C1 12 +#define TEGRA124_CLK_NDFLASH 13 +#define TEGRA124_CLK_SDMMC1 14 +#define TEGRA124_CLK_SDMMC4 15 +/* 16 */ +#define TEGRA124_CLK_PWM 17 +#define TEGRA124_CLK_I2S2 18 +/* 20 (register bit affects vi and vi_sensor) */ +/* 21 */ +#define TEGRA124_CLK_USBD 22 +#define TEGRA124_CLK_ISP 23 +/* 26 */ +/* 25 */ +#define TEGRA124_CLK_DISP2 26 +#define TEGRA124_CLK_DISP1 27 +#define TEGRA124_CLK_HOST1X 28 +#define TEGRA124_CLK_VCP 29 +#define TEGRA124_CLK_I2S0 30 +/* 31 */ + +/* 32 */ +/* 33 */ +#define TEGRA124_CLK_APBDMA 34 +/* 35 */ +#define TEGRA124_CLK_KBC 36 +/* 37 */ +/* 38 */ +/* 39 (register bit affects fuse and fuse_burn) */ +#define TEGRA124_CLK_KFUSE 40 +#define TEGRA124_CLK_SBC1 41 +#define TEGRA124_CLK_NOR 42 +/* 43 */ +#define TEGRA124_CLK_SBC2 44 +/* 45 */ +#define TEGRA124_CLK_SBC3 46 +#define TEGRA124_CLK_I2C5 47 +#define TEGRA124_CLK_DSIA 48 +/* 49 */ +#define TEGRA124_CLK_MIPI 50 +#define TEGRA124_CLK_HDMI 51 +#define TEGRA124_CLK_CSI 52 +/* 53 */ +#define TEGRA124_CLK_I2C2 54 +#define TEGRA124_CLK_UARTC 55 +#define TEGRA124_CLK_MIPI_CAL 56 +#define TEGRA124_CLK_EMC 57 +#define TEGRA124_CLK_USB2 58 +#define TEGRA124_CLK_USB3 59 +/* 60 */ +#define TEGRA124_CLK_VDE 61 +#define TEGRA124_CLK_BSEA 62 +#define TEGRA124_CLK_BSEV 63 + +/* 64 */ +#define TEGRA124_CLK_UARTD 65 +#define TEGRA124_CLK_UARTE 66 +#define TEGRA124_CLK_I2C3 67 +#define TEGRA124_CLK_SBC4 68 +#define TEGRA124_CLK_SDMMC3 69 +#define TEGRA124_CLK_PCIE 70 +#define TEGRA124_CLK_OWR 71 +#define TEGRA124_CLK_AFI 72 +#define TEGRA124_CLK_CSITE 73 +/* 74 */ +/* 75 */ +#define TEGRA124_CLK_LA 76 +#define TEGRA124_CLK_TRACE 77 +#define TEGRA124_CLK_SOC_THERM 78 +#define TEGRA124_CLK_DTV 79 +#define TEGRA124_CLK_NDSPEED 80 +#define TEGRA124_CLK_I2CSLOW 81 +#define TEGRA124_CLK_DSIB 82 +#define TEGRA124_CLK_TSEC 83 +/* 84 */ +/* 85 */ +/* 86 */ +/* 87 */ +/* 88 */ +#define TEGRA124_CLK_XUSB_HOST 89 +/* 90 */ +#define TEGRA124_CLK_MSENC 91 +#define TEGRA124_CLK_CSUS 92 +/* 93 */ +/* 94 */ +/* 95 (bit affects xusb_dev and xusb_dev_src) */ + +/* 96 */ +/* 97 */ +/* 98 */ +#define TEGRA124_CLK_MSELECT 99 +#define TEGRA124_CLK_TSENSOR 100 +#define TEGRA124_CLK_I2S3 101 +#define TEGRA124_CLK_I2S4 102 +#define TEGRA124_CLK_I2C4 103 +#define TEGRA124_CLK_SBC5 104 +#define TEGRA124_CLK_SBC6 105 +#define TEGRA124_CLK_D_AUDIO 106 +#define TEGRA124_CLK_APBIF 107 +#define TEGRA124_CLK_DAM0 108 +#define TEGRA124_CLK_DAM1 109 +#define TEGRA124_CLK_DAM2 110 +#define TEGRA124_CLK_HDA2CODEC_2X 111 +/* 112 */ +#define TEGRA124_CLK_AUDIO0_2X 113 +#define TEGRA124_CLK_AUDIO1_2X 114 +#define TEGRA124_CLK_AUDIO2_2X 115 +#define TEGRA124_CLK_AUDIO3_2X 116 +#define TEGRA124_CLK_AUDIO4_2X 117 +#define TEGRA124_CLK_SPDIF_2X 118 +#define TEGRA124_CLK_ACTMON 119 +#define TEGRA124_CLK_EXTERN1 120 +#define TEGRA124_CLK_EXTERN2 121 +#define TEGRA124_CLK_EXTERN3 122 +#define TEGRA124_CLK_SATA_OOB 123 +#define TEGRA124_CLK_SATA 124 +#define TEGRA124_CLK_HDA 125 +/* 126 */ +#define TEGRA124_CLK_SE 127 + +#define TEGRA124_CLK_HDA2HDMI 128 +#define TEGRA124_CLK_SATA_COLD 129 +/* 130 */ +/* 131 */ +/* 132 */ +/* 133 */ +/* 134 */ +/* 135 */ +/* 136 */ +/* 137 */ +/* 138 */ +/* 139 */ +/* 140 */ +/* 141 */ +/* 142 */ +/* 143 (bit affects xusb_falcon_src, xusb_fs_src, */ +/* xusb_host_src and xusb_ss_src) */ +#define TEGRA124_CLK_CILAB 144 +#define TEGRA124_CLK_CILCD 145 +#define TEGRA124_CLK_CILE 146 +#define TEGRA124_CLK_DSIALP 147 +#define TEGRA124_CLK_DSIBLP 148 +#define TEGRA124_CLK_ENTROPY 149 +#define TEGRA124_CLK_DDS 150 +/* 151 */ +#define TEGRA124_CLK_DP2 152 +#define TEGRA124_CLK_AMX 153 +#define TEGRA124_CLK_ADX 154 +/* 155 (bit affects dfll_ref and dfll_soc) */ +#define TEGRA124_CLK_XUSB_SS 156 +/* 157 */ +/* 158 */ +/* 159 */ + +/* 160 */ +/* 161 */ +/* 162 */ +/* 163 */ +/* 164 */ +/* 165 */ +#define TEGRA124_CLK_I2C6 166 +/* 167 */ +/* 168 */ +/* 169 */ +/* 170 */ +#define TEGRA124_CLK_VIM2_CLK 171 +/* 172 */ +/* 173 */ +/* 174 */ +/* 175 */ +#define TEGRA124_CLK_HDMI_AUDIO 176 +#define TEGRA124_CLK_CLK72MHZ 177 +#define TEGRA124_CLK_VIC03 178 +/* 179 */ +#define TEGRA124_CLK_ADX1 180 +#define TEGRA124_CLK_DPAUX 181 +#define TEGRA124_CLK_SOR0 182 +/* 183 */ +#define TEGRA124_CLK_GPU 184 +#define TEGRA124_CLK_AMX1 185 +#define TEGRA124_CLK_AFC0 186 +#define TEGRA124_CLK_AFC1 187 +#define TEGRA124_CLK_AFC2 188 +#define TEGRA124_CLK_AFC3 189 +#define TEGRA124_CLK_AFC4 190 +#define TEGRA124_CLK_AFC5 191 +#define TEGRA124_CLK_UARTB 192 +#define TEGRA124_CLK_VFIR 193 +#define TEGRA124_CLK_SPDIF_IN 194 +#define TEGRA124_CLK_SPDIF_OUT 195 +#define TEGRA124_CLK_VI 196 +#define TEGRA124_CLK_VI_SENSOR 197 +#define TEGRA124_CLK_FUSE 198 +#define TEGRA124_CLK_FUSE_BURN 199 +#define TEGRA124_CLK_CLK_32K 200 +#define TEGRA124_CLK_CLK_M 201 +#define TEGRA124_CLK_CLK_M_DIV2 202 +#define TEGRA124_CLK_CLK_M_DIV4 203 +#define TEGRA124_CLK_PLL_REF 204 +#define TEGRA124_CLK_PLL_C 205 +#define TEGRA124_CLK_PLL_C_OUT1 206 +#define TEGRA124_CLK_PLL_C2 207 +#define TEGRA124_CLK_PLL_C3 208 +#define TEGRA124_CLK_PLL_M 209 +#define TEGRA124_CLK_PLL_M_OUT1 210 +#define TEGRA124_CLK_PLL_P 211 +#define TEGRA124_CLK_PLL_P_OUT1 212 +#define TEGRA124_CLK_PLL_P_OUT2 213 +#define TEGRA124_CLK_PLL_P_OUT3 214 +#define TEGRA124_CLK_PLL_P_OUT4 215 +#define TEGRA124_CLK_PLL_A 216 +#define TEGRA124_CLK_PLL_A_OUT0 217 +#define TEGRA124_CLK_PLL_D 218 +#define TEGRA124_CLK_PLL_D_OUT0 219 +#define TEGRA124_CLK_PLL_D2 220 +#define TEGRA124_CLK_PLL_D2_OUT0 221 +#define TEGRA124_CLK_PLL_U 222 +#define TEGRA124_CLK_PLL_U_480M 223 + +#define TEGRA124_CLK_PLL_U_60M 224 +#define TEGRA124_CLK_PLL_U_48M 225 +#define TEGRA124_CLK_PLL_U_12M 226 +#define TEGRA124_CLK_PLL_X 227 +#define TEGRA124_CLK_PLL_X_OUT0 228 +#define TEGRA124_CLK_PLL_RE_VCO 229 +#define TEGRA124_CLK_PLL_RE_OUT 230 +#define TEGRA124_CLK_PLL_E 231 +#define TEGRA124_CLK_SPDIF_IN_SYNC 232 +#define TEGRA124_CLK_I2S0_SYNC 233 +#define TEGRA124_CLK_I2S1_SYNC 234 +#define TEGRA124_CLK_I2S2_SYNC 235 +#define TEGRA124_CLK_I2S3_SYNC 236 +#define TEGRA124_CLK_I2S4_SYNC 237 +#define TEGRA124_CLK_VIMCLK_SYNC 238 +#define TEGRA124_CLK_AUDIO0 239 +#define TEGRA124_CLK_AUDIO1 240 +#define TEGRA124_CLK_AUDIO2 241 +#define TEGRA124_CLK_AUDIO3 242 +#define TEGRA124_CLK_AUDIO4 243 +#define TEGRA124_CLK_SPDIF 244 +#define TEGRA124_CLK_CLK_OUT_1 245 +#define TEGRA124_CLK_CLK_OUT_2 246 +#define TEGRA124_CLK_CLK_OUT_3 247 +#define TEGRA124_CLK_BLINK 248 +/* 249 */ +/* 250 */ +/* 251 */ +#define TEGRA124_CLK_XUSB_HOST_SRC 252 +#define TEGRA124_CLK_XUSB_FALCON_SRC 253 +#define TEGRA124_CLK_XUSB_FS_SRC 254 +#define TEGRA124_CLK_XUSB_SS_SRC 255 + +#define TEGRA124_CLK_XUSB_DEV_SRC 256 +#define TEGRA124_CLK_XUSB_DEV 257 +#define TEGRA124_CLK_XUSB_HS_SRC 258 +#define TEGRA124_CLK_SCLK 259 +#define TEGRA124_CLK_HCLK 260 +#define TEGRA124_CLK_PCLK 261 +#define TEGRA124_CLK_CCLK_G 262 +#define TEGRA124_CLK_CCLK_LP 263 +#define TEGRA124_CLK_DFLL_REF 264 +#define TEGRA124_CLK_DFLL_SOC 265 +#define TEGRA124_CLK_VI_SENSOR2 266 +#define TEGRA124_CLK_PLL_P_OUT5 267 +#define TEGRA124_CLK_CML0 268 +#define TEGRA124_CLK_CML1 269 +#define TEGRA124_CLK_PLL_C4 270 +#define TEGRA124_CLK_PLL_DP 271 +#define TEGRA124_CLK_PLL_E_MUX 272 +/* 273 */ +/* 274 */ +/* 275 */ +/* 276 */ +/* 277 */ +/* 278 */ +/* 279 */ +/* 280 */ +/* 281 */ +/* 282 */ +/* 283 */ +/* 284 */ +/* 285 */ +/* 286 */ +/* 287 */ + +/* 288 */ +/* 289 */ +/* 290 */ +/* 291 */ +/* 292 */ +/* 293 */ +/* 294 */ +/* 295 */ +/* 296 */ +/* 297 */ +/* 298 */ +/* 299 */ +#define TEGRA124_CLK_AUDIO0_MUX 300 +#define TEGRA124_CLK_AUDIO1_MUX 301 +#define TEGRA124_CLK_AUDIO2_MUX 302 +#define TEGRA124_CLK_AUDIO3_MUX 303 +#define TEGRA124_CLK_AUDIO4_MUX 304 +#define TEGRA124_CLK_SPDIF_MUX 305 +#define TEGRA124_CLK_CLK_OUT_1_MUX 306 +#define TEGRA124_CLK_CLK_OUT_2_MUX 307 +#define TEGRA124_CLK_CLK_OUT_3_MUX 308 +#define TEGRA124_CLK_DSIA_MUX 309 +#define TEGRA124_CLK_DSIB_MUX 310 +#define TEGRA124_CLK_SOR0_LVDS 311 +#define TEGRA124_CLK_PLL_M_UD 311 +#define TEGRA124_CLK_CLK_MAX 312 + +#endif /* _DT_BINDINGS_CLOCK_TEGRA124_CAR_H */ diff --git a/include/dt-bindings/clock/tegra20-car.h b/include/dt-bindings/clock/tegra20-car.h new file mode 100644 index 0000000000..9406207cfa --- /dev/null +++ b/include/dt-bindings/clock/tegra20-car.h @@ -0,0 +1,158 @@ +/* + * This header provides constants for binding nvidia,tegra20-car. + * + * The first 96 clocks are numbered to match the bits in the CAR's CLK_OUT_ENB + * registers. These IDs often match those in the CAR's RST_DEVICES registers, + * but not in all cases. Some bits in CLK_OUT_ENB affect multiple clocks. In + * this case, those clocks are assigned IDs above 95 in order to highlight + * this issue. Implementations that interpret these clock IDs as bit values + * within the CLK_OUT_ENB or RST_DEVICES registers should be careful to + * explicitly handle these special cases. + * + * The balance of the clocks controlled by the CAR are assigned IDs of 96 and + * above. + */ + +#ifndef _DT_BINDINGS_CLOCK_TEGRA20_CAR_H +#define _DT_BINDINGS_CLOCK_TEGRA20_CAR_H + +#define TEGRA20_CLK_CPU 0 +/* 1 */ +/* 2 */ +#define TEGRA20_CLK_AC97 3 +#define TEGRA20_CLK_RTC 4 +#define TEGRA20_CLK_TIMER 5 +#define TEGRA20_CLK_UARTA 6 +/* 7 (register bit affects uart2 and vfir) */ +#define TEGRA20_CLK_GPIO 8 +#define TEGRA20_CLK_SDMMC2 9 +/* 10 (register bit affects spdif_in and spdif_out) */ +#define TEGRA20_CLK_I2S1 11 +#define TEGRA20_CLK_I2C1 12 +#define TEGRA20_CLK_NDFLASH 13 +#define TEGRA20_CLK_SDMMC1 14 +#define TEGRA20_CLK_SDMMC4 15 +#define TEGRA20_CLK_TWC 16 +#define TEGRA20_CLK_PWM 17 +#define TEGRA20_CLK_I2S2 18 +#define TEGRA20_CLK_EPP 19 +/* 20 (register bit affects vi and vi_sensor) */ +#define TEGRA20_CLK_GR2D 21 +#define TEGRA20_CLK_USBD 22 +#define TEGRA20_CLK_ISP 23 +#define TEGRA20_CLK_GR3D 24 +#define TEGRA20_CLK_IDE 25 +#define TEGRA20_CLK_DISP2 26 +#define TEGRA20_CLK_DISP1 27 +#define TEGRA20_CLK_HOST1X 28 +#define TEGRA20_CLK_VCP 29 +/* 30 */ +#define TEGRA20_CLK_CACHE2 31 + +#define TEGRA20_CLK_MEM 32 +#define TEGRA20_CLK_AHBDMA 33 +#define TEGRA20_CLK_APBDMA 34 +/* 35 */ +#define TEGRA20_CLK_KBC 36 +#define TEGRA20_CLK_STAT_MON 37 +#define TEGRA20_CLK_PMC 38 +#define TEGRA20_CLK_FUSE 39 +#define TEGRA20_CLK_KFUSE 40 +#define TEGRA20_CLK_SBC1 41 +#define TEGRA20_CLK_NOR 42 +#define TEGRA20_CLK_SPI 43 +#define TEGRA20_CLK_SBC2 44 +#define TEGRA20_CLK_XIO 45 +#define TEGRA20_CLK_SBC3 46 +#define TEGRA20_CLK_DVC 47 +#define TEGRA20_CLK_DSI 48 +/* 49 (register bit affects tvo and cve) */ +#define TEGRA20_CLK_MIPI 50 +#define TEGRA20_CLK_HDMI 51 +#define TEGRA20_CLK_CSI 52 +#define TEGRA20_CLK_TVDAC 53 +#define TEGRA20_CLK_I2C2 54 +#define TEGRA20_CLK_UARTC 55 +/* 56 */ +#define TEGRA20_CLK_EMC 57 +#define TEGRA20_CLK_USB2 58 +#define TEGRA20_CLK_USB3 59 +#define TEGRA20_CLK_MPE 60 +#define TEGRA20_CLK_VDE 61 +#define TEGRA20_CLK_BSEA 62 +#define TEGRA20_CLK_BSEV 63 + +#define TEGRA20_CLK_SPEEDO 64 +#define TEGRA20_CLK_UARTD 65 +#define TEGRA20_CLK_UARTE 66 +#define TEGRA20_CLK_I2C3 67 +#define TEGRA20_CLK_SBC4 68 +#define TEGRA20_CLK_SDMMC3 69 +#define TEGRA20_CLK_PEX 70 +#define TEGRA20_CLK_OWR 71 +#define TEGRA20_CLK_AFI 72 +#define TEGRA20_CLK_CSITE 73 +/* 74 */ +#define TEGRA20_CLK_AVPUCQ 75 +#define TEGRA20_CLK_LA 76 +/* 77 */ +/* 78 */ +/* 79 */ +/* 80 */ +/* 81 */ +/* 82 */ +/* 83 */ +#define TEGRA20_CLK_IRAMA 84 +#define TEGRA20_CLK_IRAMB 85 +#define TEGRA20_CLK_IRAMC 86 +#define TEGRA20_CLK_IRAMD 87 +#define TEGRA20_CLK_CRAM2 88 +#define TEGRA20_CLK_AUDIO_2X 89 /* a/k/a audio_2x_sync_clk */ +#define TEGRA20_CLK_CLK_D 90 +/* 91 */ +#define TEGRA20_CLK_CSUS 92 +#define TEGRA20_CLK_CDEV2 93 +#define TEGRA20_CLK_CDEV1 94 +/* 95 */ + +#define TEGRA20_CLK_UARTB 96 +#define TEGRA20_CLK_VFIR 97 +#define TEGRA20_CLK_SPDIF_IN 98 +#define TEGRA20_CLK_SPDIF_OUT 99 +#define TEGRA20_CLK_VI 100 +#define TEGRA20_CLK_VI_SENSOR 101 +#define TEGRA20_CLK_TVO 102 +#define TEGRA20_CLK_CVE 103 +#define TEGRA20_CLK_OSC 104 +#define TEGRA20_CLK_CLK_32K 105 /* a/k/a clk_s */ +#define TEGRA20_CLK_CLK_M 106 +#define TEGRA20_CLK_SCLK 107 +#define TEGRA20_CLK_CCLK 108 +#define TEGRA20_CLK_HCLK 109 +#define TEGRA20_CLK_PCLK 110 +#define TEGRA20_CLK_BLINK 111 +#define TEGRA20_CLK_PLL_A 112 +#define TEGRA20_CLK_PLL_A_OUT0 113 +#define TEGRA20_CLK_PLL_C 114 +#define TEGRA20_CLK_PLL_C_OUT1 115 +#define TEGRA20_CLK_PLL_D 116 +#define TEGRA20_CLK_PLL_D_OUT0 117 +#define TEGRA20_CLK_PLL_E 118 +#define TEGRA20_CLK_PLL_M 119 +#define TEGRA20_CLK_PLL_M_OUT1 120 +#define TEGRA20_CLK_PLL_P 121 +#define TEGRA20_CLK_PLL_P_OUT1 122 +#define TEGRA20_CLK_PLL_P_OUT2 123 +#define TEGRA20_CLK_PLL_P_OUT3 124 +#define TEGRA20_CLK_PLL_P_OUT4 125 +#define TEGRA20_CLK_PLL_S 126 +#define TEGRA20_CLK_PLL_U 127 + +#define TEGRA20_CLK_PLL_X 128 +#define TEGRA20_CLK_COP 129 /* a/k/a avp */ +#define TEGRA20_CLK_AUDIO 130 /* a/k/a audio_sync_clk */ +#define TEGRA20_CLK_PLL_REF 131 +#define TEGRA20_CLK_TWD 132 +#define TEGRA20_CLK_CLK_MAX 133 + +#endif /* _DT_BINDINGS_CLOCK_TEGRA20_CAR_H */ diff --git a/include/dt-bindings/clock/tegra30-car.h b/include/dt-bindings/clock/tegra30-car.h new file mode 100644 index 0000000000..889e49ba0a --- /dev/null +++ b/include/dt-bindings/clock/tegra30-car.h @@ -0,0 +1,273 @@ +/* + * This header provides constants for binding nvidia,tegra30-car. + * + * The first 130 clocks are numbered to match the bits in the CAR's CLK_OUT_ENB + * registers. These IDs often match those in the CAR's RST_DEVICES registers, + * but not in all cases. Some bits in CLK_OUT_ENB affect multiple clocks. In + * this case, those clocks are assigned IDs above 160 in order to highlight + * this issue. Implementations that interpret these clock IDs as bit values + * within the CLK_OUT_ENB or RST_DEVICES registers should be careful to + * explicitly handle these special cases. + * + * The balance of the clocks controlled by the CAR are assigned IDs of 160 and + * above. + */ + +#ifndef _DT_BINDINGS_CLOCK_TEGRA30_CAR_H +#define _DT_BINDINGS_CLOCK_TEGRA30_CAR_H + +#define TEGRA30_CLK_CPU 0 +/* 1 */ +/* 2 */ +/* 3 */ +#define TEGRA30_CLK_RTC 4 +#define TEGRA30_CLK_TIMER 5 +#define TEGRA30_CLK_UARTA 6 +/* 7 (register bit affects uartb and vfir) */ +#define TEGRA30_CLK_GPIO 8 +#define TEGRA30_CLK_SDMMC2 9 +/* 10 (register bit affects spdif_in and spdif_out) */ +#define TEGRA30_CLK_I2S1 11 +#define TEGRA30_CLK_I2C1 12 +#define TEGRA30_CLK_NDFLASH 13 +#define TEGRA30_CLK_SDMMC1 14 +#define TEGRA30_CLK_SDMMC4 15 +/* 16 */ +#define TEGRA30_CLK_PWM 17 +#define TEGRA30_CLK_I2S2 18 +#define TEGRA30_CLK_EPP 19 +/* 20 (register bit affects vi and vi_sensor) */ +#define TEGRA30_CLK_GR2D 21 +#define TEGRA30_CLK_USBD 22 +#define TEGRA30_CLK_ISP 23 +#define TEGRA30_CLK_GR3D 24 +/* 25 */ +#define TEGRA30_CLK_DISP2 26 +#define TEGRA30_CLK_DISP1 27 +#define TEGRA30_CLK_HOST1X 28 +#define TEGRA30_CLK_VCP 29 +#define TEGRA30_CLK_I2S0 30 +#define TEGRA30_CLK_COP_CACHE 31 + +#define TEGRA30_CLK_MC 32 +#define TEGRA30_CLK_AHBDMA 33 +#define TEGRA30_CLK_APBDMA 34 +/* 35 */ +#define TEGRA30_CLK_KBC 36 +#define TEGRA30_CLK_STATMON 37 +#define TEGRA30_CLK_PMC 38 +/* 39 (register bit affects fuse and fuse_burn) */ +#define TEGRA30_CLK_KFUSE 40 +#define TEGRA30_CLK_SBC1 41 +#define TEGRA30_CLK_NOR 42 +/* 43 */ +#define TEGRA30_CLK_SBC2 44 +/* 45 */ +#define TEGRA30_CLK_SBC3 46 +#define TEGRA30_CLK_I2C5 47 +#define TEGRA30_CLK_DSIA 48 +/* 49 (register bit affects cve and tvo) */ +#define TEGRA30_CLK_MIPI 50 +#define TEGRA30_CLK_HDMI 51 +#define TEGRA30_CLK_CSI 52 +#define TEGRA30_CLK_TVDAC 53 +#define TEGRA30_CLK_I2C2 54 +#define TEGRA30_CLK_UARTC 55 +/* 56 */ +#define TEGRA30_CLK_EMC 57 +#define TEGRA30_CLK_USB2 58 +#define TEGRA30_CLK_USB3 59 +#define TEGRA30_CLK_MPE 60 +#define TEGRA30_CLK_VDE 61 +#define TEGRA30_CLK_BSEA 62 +#define TEGRA30_CLK_BSEV 63 + +#define TEGRA30_CLK_SPEEDO 64 +#define TEGRA30_CLK_UARTD 65 +#define TEGRA30_CLK_UARTE 66 +#define TEGRA30_CLK_I2C3 67 +#define TEGRA30_CLK_SBC4 68 +#define TEGRA30_CLK_SDMMC3 69 +#define TEGRA30_CLK_PCIE 70 +#define TEGRA30_CLK_OWR 71 +#define TEGRA30_CLK_AFI 72 +#define TEGRA30_CLK_CSITE 73 +/* 74 */ +#define TEGRA30_CLK_AVPUCQ 75 +#define TEGRA30_CLK_LA 76 +/* 77 */ +/* 78 */ +#define TEGRA30_CLK_DTV 79 +#define TEGRA30_CLK_NDSPEED 80 +#define TEGRA30_CLK_I2CSLOW 81 +#define TEGRA30_CLK_DSIB 82 +/* 83 */ +#define TEGRA30_CLK_IRAMA 84 +#define TEGRA30_CLK_IRAMB 85 +#define TEGRA30_CLK_IRAMC 86 +#define TEGRA30_CLK_IRAMD 87 +#define TEGRA30_CLK_CRAM2 88 +/* 89 */ +#define TEGRA30_CLK_AUDIO_2X 90 /* a/k/a audio_2x_sync_clk */ +/* 91 */ +#define TEGRA30_CLK_CSUS 92 +#define TEGRA30_CLK_CDEV2 93 +#define TEGRA30_CLK_CDEV1 94 +/* 95 */ + +#define TEGRA30_CLK_CPU_G 96 +#define TEGRA30_CLK_CPU_LP 97 +#define TEGRA30_CLK_GR3D2 98 +#define TEGRA30_CLK_MSELECT 99 +#define TEGRA30_CLK_TSENSOR 100 +#define TEGRA30_CLK_I2S3 101 +#define TEGRA30_CLK_I2S4 102 +#define TEGRA30_CLK_I2C4 103 +#define TEGRA30_CLK_SBC5 104 +#define TEGRA30_CLK_SBC6 105 +#define TEGRA30_CLK_D_AUDIO 106 +#define TEGRA30_CLK_APBIF 107 +#define TEGRA30_CLK_DAM0 108 +#define TEGRA30_CLK_DAM1 109 +#define TEGRA30_CLK_DAM2 110 +#define TEGRA30_CLK_HDA2CODEC_2X 111 +#define TEGRA30_CLK_ATOMICS 112 +#define TEGRA30_CLK_AUDIO0_2X 113 +#define TEGRA30_CLK_AUDIO1_2X 114 +#define TEGRA30_CLK_AUDIO2_2X 115 +#define TEGRA30_CLK_AUDIO3_2X 116 +#define TEGRA30_CLK_AUDIO4_2X 117 +#define TEGRA30_CLK_SPDIF_2X 118 +#define TEGRA30_CLK_ACTMON 119 +#define TEGRA30_CLK_EXTERN1 120 +#define TEGRA30_CLK_EXTERN2 121 +#define TEGRA30_CLK_EXTERN3 122 +#define TEGRA30_CLK_SATA_OOB 123 +#define TEGRA30_CLK_SATA 124 +#define TEGRA30_CLK_HDA 125 +/* 126 */ +#define TEGRA30_CLK_SE 127 + +#define TEGRA30_CLK_HDA2HDMI 128 +#define TEGRA30_CLK_SATA_COLD 129 +/* 130 */ +/* 131 */ +/* 132 */ +/* 133 */ +/* 134 */ +/* 135 */ +/* 136 */ +/* 137 */ +/* 138 */ +/* 139 */ +/* 140 */ +/* 141 */ +/* 142 */ +/* 143 */ +/* 144 */ +/* 145 */ +/* 146 */ +/* 147 */ +/* 148 */ +/* 149 */ +/* 150 */ +/* 151 */ +/* 152 */ +/* 153 */ +/* 154 */ +/* 155 */ +/* 156 */ +/* 157 */ +/* 158 */ +/* 159 */ + +#define TEGRA30_CLK_UARTB 160 +#define TEGRA30_CLK_VFIR 161 +#define TEGRA30_CLK_SPDIF_IN 162 +#define TEGRA30_CLK_SPDIF_OUT 163 +#define TEGRA30_CLK_VI 164 +#define TEGRA30_CLK_VI_SENSOR 165 +#define TEGRA30_CLK_FUSE 166 +#define TEGRA30_CLK_FUSE_BURN 167 +#define TEGRA30_CLK_CVE 168 +#define TEGRA30_CLK_TVO 169 +#define TEGRA30_CLK_CLK_32K 170 +#define TEGRA30_CLK_CLK_M 171 +#define TEGRA30_CLK_CLK_M_DIV2 172 +#define TEGRA30_CLK_CLK_M_DIV4 173 +#define TEGRA30_CLK_PLL_REF 174 +#define TEGRA30_CLK_PLL_C 175 +#define TEGRA30_CLK_PLL_C_OUT1 176 +#define TEGRA30_CLK_PLL_M 177 +#define TEGRA30_CLK_PLL_M_OUT1 178 +#define TEGRA30_CLK_PLL_P 179 +#define TEGRA30_CLK_PLL_P_OUT1 180 +#define TEGRA30_CLK_PLL_P_OUT2 181 +#define TEGRA30_CLK_PLL_P_OUT3 182 +#define TEGRA30_CLK_PLL_P_OUT4 183 +#define TEGRA30_CLK_PLL_A 184 +#define TEGRA30_CLK_PLL_A_OUT0 185 +#define TEGRA30_CLK_PLL_D 186 +#define TEGRA30_CLK_PLL_D_OUT0 187 +#define TEGRA30_CLK_PLL_D2 188 +#define TEGRA30_CLK_PLL_D2_OUT0 189 +#define TEGRA30_CLK_PLL_U 190 +#define TEGRA30_CLK_PLL_X 191 + +#define TEGRA30_CLK_PLL_X_OUT0 192 +#define TEGRA30_CLK_PLL_E 193 +#define TEGRA30_CLK_SPDIF_IN_SYNC 194 +#define TEGRA30_CLK_I2S0_SYNC 195 +#define TEGRA30_CLK_I2S1_SYNC 196 +#define TEGRA30_CLK_I2S2_SYNC 197 +#define TEGRA30_CLK_I2S3_SYNC 198 +#define TEGRA30_CLK_I2S4_SYNC 199 +#define TEGRA30_CLK_VIMCLK_SYNC 200 +#define TEGRA30_CLK_AUDIO0 201 +#define TEGRA30_CLK_AUDIO1 202 +#define TEGRA30_CLK_AUDIO2 203 +#define TEGRA30_CLK_AUDIO3 204 +#define TEGRA30_CLK_AUDIO4 205 +#define TEGRA30_CLK_SPDIF 206 +#define TEGRA30_CLK_CLK_OUT_1 207 /* (extern1) */ +#define TEGRA30_CLK_CLK_OUT_2 208 /* (extern2) */ +#define TEGRA30_CLK_CLK_OUT_3 209 /* (extern3) */ +#define TEGRA30_CLK_SCLK 210 +#define TEGRA30_CLK_BLINK 211 +#define TEGRA30_CLK_CCLK_G 212 +#define TEGRA30_CLK_CCLK_LP 213 +#define TEGRA30_CLK_TWD 214 +#define TEGRA30_CLK_CML0 215 +#define TEGRA30_CLK_CML1 216 +#define TEGRA30_CLK_HCLK 217 +#define TEGRA30_CLK_PCLK 218 +/* 219 */ +/* 220 */ +/* 221 */ +/* 222 */ +/* 223 */ + +/* 288 */ +/* 289 */ +/* 290 */ +/* 291 */ +/* 292 */ +/* 293 */ +/* 294 */ +/* 295 */ +/* 296 */ +/* 297 */ +/* 298 */ +/* 299 */ +#define TEGRA30_CLK_CLK_OUT_1_MUX 300 +#define TEGRA30_CLK_CLK_OUT_2_MUX 301 +#define TEGRA30_CLK_CLK_OUT_3_MUX 302 +#define TEGRA30_CLK_AUDIO0_MUX 303 +#define TEGRA30_CLK_AUDIO1_MUX 304 +#define TEGRA30_CLK_AUDIO2_MUX 305 +#define TEGRA30_CLK_AUDIO3_MUX 306 +#define TEGRA30_CLK_AUDIO4_MUX 307 +#define TEGRA30_CLK_SPDIF_MUX 308 +#define TEGRA30_CLK_CLK_MAX 309 + +#endif /* _DT_BINDINGS_CLOCK_TEGRA30_CAR_H */ diff --git a/include/fdtdec.h b/include/fdtdec.h index 5f88938c83..2590d3071f 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -376,6 +376,18 @@ int fdtdec_get_alias_seq(const void *blob, const char *base, int node, */ int fdtdec_get_alias_node(const void *blob, const char *name); +/** + * Get the offset of the given chosen node + * + * This looks up a property in /chosen containing the path to another node, + * then finds the offset of that node. + * + * @param blob Device tree blob (if NULL, then error is returned) + * @param name Property name, e.g. "stdout-path" + * @return Node offset referred to by that chosen node, or -ve FDT_ERR_... + */ +int fdtdec_get_chosen_node(const void *blob, const char *name); + /* * Get the name for a compatible ID * diff --git a/include/fm_eth.h b/include/fm_eth.h index 98edfcf4ad..e46a684129 100644 --- a/include/fm_eth.h +++ b/include/fm_eth.h @@ -8,8 +8,8 @@ #define __FM_ETH_H__ #include <common.h> +#include <phy.h> #include <asm/types.h> -#include <asm/fsl_enet.h> enum fm_port { FM1_DTSEC1, diff --git a/include/fsl_dcu_fb.h b/include/fsl_dcu_fb.h new file mode 100644 index 0000000000..42632984d3 --- /dev/null +++ b/include/fsl_dcu_fb.h @@ -0,0 +1,16 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * FSL DCU Framebuffer driver + * + * SPDX-License-Identifier: GPL-2.0+ + */ +#include <linux/fb.h> + +int fsl_dcu_init(unsigned int xres, unsigned int yres, + unsigned int pixel_format); + +/* Prototypes for external board-specific functions */ +int platform_dcu_init(unsigned int xres, unsigned int yres, + const char *port, struct fb_videomode *dcu_fb_videomode); +unsigned int dcu_set_pixel_clock(unsigned int pixclock); diff --git a/include/fsl_ddr_sdram.h b/include/fsl_ddr_sdram.h index e8a2db91cb..987119b014 100644 --- a/include/fsl_ddr_sdram.h +++ b/include/fsl_ddr_sdram.h @@ -281,6 +281,7 @@ typedef struct memctl_options_partial_s { #define DDR_DATA_BUS_WIDTH_64 0 #define DDR_DATA_BUS_WIDTH_32 1 #define DDR_DATA_BUS_WIDTH_16 2 +#define DDR_CSWL_CS0 0x04000001 /* * Generalized parameters for memory controller configuration, * might be a little specific to the FSL memory controller @@ -340,6 +341,7 @@ typedef struct memctl_options_s { unsigned int cpo_override; unsigned int write_data_delay; /* DQS adjust */ + unsigned int cswl_override; unsigned int wrlvl_override; unsigned int wrlvl_sample; /* Write leveling */ unsigned int wrlvl_start; diff --git a/include/fsl_esdhc.h b/include/fsl_esdhc.h index 9814964937..c1b6648591 100644 --- a/include/fsl_esdhc.h +++ b/include/fsl_esdhc.h @@ -162,7 +162,19 @@ struct fsl_esdhc_cfg { }; /* Select the correct accessors depending on endianess */ -#if __BYTE_ORDER == __LITTLE_ENDIAN +#if defined CONFIG_SYS_FSL_ESDHC_LE +#define esdhc_read32 in_le32 +#define esdhc_write32 out_le32 +#define esdhc_clrsetbits32 clrsetbits_le32 +#define esdhc_clrbits32 clrbits_le32 +#define esdhc_setbits32 setbits_le32 +#elif defined(CONFIG_SYS_FSL_ESDHC_BE) +#define esdhc_read32 in_be32 +#define esdhc_write32 out_be32 +#define esdhc_clrsetbits32 clrsetbits_be32 +#define esdhc_clrbits32 clrbits_be32 +#define esdhc_setbits32 setbits_be32 +#elif __BYTE_ORDER == __LITTLE_ENDIAN #define esdhc_read32 in_le32 #define esdhc_write32 out_le32 #define esdhc_clrsetbits32 clrsetbits_le32 diff --git a/include/fsl_mdio.h b/include/fsl_mdio.h index b58713d896..2137282df3 100644 --- a/include/fsl_mdio.h +++ b/include/fsl_mdio.h @@ -10,7 +10,18 @@ #include <net.h> #include <miiphy.h> -#include <asm/fsl_enet.h> + +struct tsec_mii_mng { + u32 miimcfg; /* MII management configuration reg */ + u32 miimcom; /* MII management command reg */ + u32 miimadd; /* MII management address reg */ + u32 miimcon; /* MII management control reg */ + u32 miimstat; /* MII management status reg */ + u32 miimind; /* MII management indication reg */ + u32 ifstat; /* Interface Status Register */ +}; + +int fdt_fixup_phy_connection(void *blob, int offset, phy_interface_t phyc); /* PHY register offsets */ #define PHY_EXT_PAGE_ACCESS 0x1f diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h new file mode 100644 index 0000000000..d1e49d52b6 --- /dev/null +++ b/include/linux/compiler-clang.h @@ -0,0 +1,12 @@ +#ifndef __LINUX_COMPILER_H +#error "Please don't include <linux/compiler-clang.h> directly, include <linux/compiler.h> instead." +#endif + +/* Some compiler specific definitions are overwritten here + * for Clang compiler + */ + +#ifdef uninitialized_var +#undef uninitialized_var +#define uninitialized_var(x) x = *(&(x)) +#endif diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 9896e547b9..02ae99e8e6 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -5,6 +5,9 @@ /* * Common definitions for all gcc versions go here. */ +#define GCC_VERSION (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100 \ + + __GNUC_PATCHLEVEL__) /* Optimization barrier */ @@ -34,9 +37,15 @@ __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \ (typeof(ptr)) (__ptr + (off)); }) +/* Make the optimizer believe the variable can be manipulated arbitrarily. */ +#define OPTIMIZER_HIDE_VAR(var) __asm__ ("" : "=r" (var) : "0" (var)) + +#ifdef __CHECKER__ +#define __must_be_array(arr) 0 +#else /* &a[0] degrades to a pointer: a different type from an array */ -#define __must_be_array(a) \ - BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0]))) +#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) +#endif /* * Force always-inline if the user requests it so via the .config, @@ -44,15 +53,18 @@ */ #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \ !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) -# define inline inline __attribute__((always_inline)) -# define __inline__ __inline__ __attribute__((always_inline)) -# define __inline __inline __attribute__((always_inline)) +# define inline inline __attribute__((always_inline)) notrace +# define __inline__ __inline__ __attribute__((always_inline)) notrace +# define __inline __inline __attribute__((always_inline)) notrace +#else +/* A lot of inline functions can cause havoc with function tracing */ +# define inline inline notrace +# define __inline__ __inline__ notrace +# define __inline __inline notrace #endif #define __deprecated __attribute__((deprecated)) -#ifndef __packed -# define __packed __attribute__((packed)) -#endif +#define __packed __attribute__((packed)) #define __weak __attribute__((weak)) /* @@ -60,8 +72,12 @@ * naked functions because then mcount is called without stack and frame pointer * being set up and there is no chance to restore the lr register to the value * before mcount was called. + * + * The asm() bodies of naked functions often depend on standard calling conventions, + * therefore they must be noinline and noclone. GCC 4.[56] currently fail to enforce + * this, so we must do so ourselves. See GCC PR44290. */ -#define __naked __attribute__((naked)) notrace +#define __naked __attribute__((naked)) noinline __noclone notrace #define __noreturn __attribute__((noreturn)) @@ -75,13 +91,10 @@ * would be. * [...] */ -#ifndef __pure -# define __pure __attribute__((pure)) -#endif -#ifndef __aligned -# define __aligned(x) __attribute__((aligned(x))) -#endif -#define __printf(a,b) __attribute__((format(printf,a,b))) +#define __pure __attribute__((pure)) +#define __aligned(x) __attribute__((aligned(x))) +#define __printf(a, b) __attribute__((format(printf, a, b))) +#define __scanf(a, b) __attribute__((format(scanf, a, b))) #define noinline __attribute__((noinline)) #define __attribute_const__ __attribute__((__const__)) #define __maybe_unused __attribute__((unused)) @@ -91,3 +104,15 @@ #define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h) #define gcc_header(x) _gcc_header(x) #include gcc_header(__GNUC__) + +#if !defined(__noclone) +#define __noclone /* not needed */ +#endif + +/* + * A trick to suppress uninitialized variable warning without generating any + * code + */ +#define uninitialized_var(x) x = x + +#define __always_inline inline __attribute__((always_inline)) diff --git a/include/linux/compiler-gcc3.h b/include/linux/compiler-gcc3.h index 2befe6513c..7d89febe4d 100644 --- a/include/linux/compiler-gcc3.h +++ b/include/linux/compiler-gcc3.h @@ -2,20 +2,22 @@ #error "Please don't include <linux/compiler-gcc3.h> directly, include <linux/compiler.h> instead." #endif -#if __GNUC_MINOR__ >= 3 +#if GCC_VERSION < 30200 +# error Sorry, your compiler is too old - please upgrade it. +#endif + +#if GCC_VERSION >= 30300 # define __used __attribute__((__used__)) #else # define __used __attribute__((__unused__)) #endif -#if __GNUC_MINOR__ >= 4 +#if GCC_VERSION >= 30400 #define __must_check __attribute__((warn_unused_result)) #endif -/* - * A trick to suppress uninitialized variable warning without generating any - * code - */ -#define uninitialized_var(x) x = x - -#define __always_inline inline __attribute__((always_inline)) +#ifdef CONFIG_GCOV_KERNEL +# if GCC_VERSION < 30400 +# error "GCOV profiling support for gcc versions below 3.4 not included" +# endif /* __GNUC_MINOR__ */ +#endif /* CONFIG_GCOV_KERNEL */ diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 27d11ca7b0..2507fd2a1e 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h @@ -4,7 +4,7 @@ /* GCC 4.1.[01] miscompiles __weak */ #ifdef __KERNEL__ -# if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 1 +# if GCC_VERSION >= 40100 && GCC_VERSION <= 40101 # error Your version of gcc miscompiles the __weak directive # endif #endif @@ -12,17 +12,12 @@ #define __used __attribute__((__used__)) #define __must_check __attribute__((warn_unused_result)) #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) -#ifndef __always_inline -# define __always_inline inline __attribute__((always_inline)) -#endif -/* - * A trick to suppress uninitialized variable warning without generating any - * code - */ -#define uninitialized_var(x) x = x +#if GCC_VERSION >= 40100 && GCC_VERSION < 40600 +# define __compiletime_object_size(obj) __builtin_object_size(obj, 0) +#endif -#if __GNUC_MINOR__ >= 3 +#if GCC_VERSION >= 40300 /* Mark functions as cold. gcc will assume any path leading to a call to them will be unlikely. This means a lot of manual unlikely()s are unnecessary now for any paths leading to the usual suspects @@ -38,8 +33,15 @@ the kernel context */ #define __cold __attribute__((__cold__)) +#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) -#if __GNUC_MINOR__ >= 5 +#ifndef __CHECKER__ +# define __compiletime_warning(message) __attribute__((warning(message))) +# define __compiletime_error(message) __attribute__((error(message))) +#endif /* __CHECKER__ */ +#endif /* GCC_VERSION >= 40300 */ + +#if GCC_VERSION >= 40500 /* * Mark a position in code as unreachable. This can be used to * suppress control flow warnings after asm blocks that transfer @@ -50,14 +52,37 @@ * unreleased. Really, we need to have autoconf for the kernel. */ #define unreachable() __builtin_unreachable() -#endif +/* Mark a function definition as prohibited from being cloned. */ +#define __noclone __attribute__((__noclone__)) + +#endif /* GCC_VERSION >= 40500 */ + +#if GCC_VERSION >= 40600 +/* + * Tell the optimizer that something else uses this function or variable. + */ +#define __visible __attribute__((externally_visible)) #endif -#if __GNUC_MINOR__ > 0 -#define __compiletime_object_size(obj) __builtin_object_size(obj, 0) +/* + * GCC 'asm goto' miscompiles certain code sequences: + * + * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 + * + * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. + * Fixed in GCC 4.8.2 and later versions. + * + * (asm goto is automatically volatile - the naming reflects this.) + */ +#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) + +#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP +#if GCC_VERSION >= 40400 +#define __HAVE_BUILTIN_BSWAP32__ +#define __HAVE_BUILTIN_BSWAP64__ #endif -#if __GNUC_MINOR__ >= 4 -#define __compiletime_warning(message) __attribute__((warning(message))) -#define __compiletime_error(message) __attribute__((error(message))) +#if GCC_VERSION >= 40800 || (defined(__powerpc__) && GCC_VERSION >= 40600) +#define __HAVE_BUILTIN_BSWAP16__ #endif +#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ diff --git a/include/linux/compiler-intel.h b/include/linux/compiler-intel.h new file mode 100644 index 0000000000..ba147a1727 --- /dev/null +++ b/include/linux/compiler-intel.h @@ -0,0 +1,40 @@ +#ifndef __LINUX_COMPILER_H +#error "Please don't include <linux/compiler-intel.h> directly, include <linux/compiler.h> instead." +#endif + +#ifdef __ECC + +/* Some compiler specific definitions are overwritten here + * for Intel ECC compiler + */ + +#include <asm/intrinsics.h> + +/* Intel ECC compiler doesn't support gcc specific asm stmts. + * It uses intrinsics to do the equivalent things. + */ +#undef RELOC_HIDE +#undef OPTIMIZER_HIDE_VAR + +#define RELOC_HIDE(ptr, off) \ + ({ unsigned long __ptr; \ + __ptr = (unsigned long) (ptr); \ + (typeof(ptr)) (__ptr + (off)); }) + +/* This should act as an optimization barrier on var. + * Given that this compiler does not have inline assembly, a compiler barrier + * is the best we can do. + */ +#define OPTIMIZER_HIDE_VAR(var) barrier() + +/* Intel ECC compiler doesn't support __builtin_types_compatible_p() */ +#define __must_be_array(a) 0 + +#endif + +#ifndef __HAVE_BUILTIN_BSWAP16__ +/* icc has this, but it's called _bswap16 */ +#define __HAVE_BUILTIN_BSWAP16__ +#define __builtin_bswap16 _bswap16 +#endif + diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 5be3dab4a6..d5ad7b1118 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -5,16 +5,23 @@ #ifdef __CHECKER__ # define __user __attribute__((noderef, address_space(1))) -# define __kernel /* default address space */ +# define __kernel __attribute__((address_space(0))) # define __safe __attribute__((safe)) # define __force __attribute__((force)) # define __nocast __attribute__((nocast)) # define __iomem __attribute__((noderef, address_space(2))) +# define __must_hold(x) __attribute__((context(x,1,1))) # define __acquires(x) __attribute__((context(x,0,1))) # define __releases(x) __attribute__((context(x,1,0))) # define __acquire(x) __context__(x,1) # define __release(x) __context__(x,-1) # define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) +# define __percpu __attribute__((noderef, address_space(3))) +#ifdef CONFIG_SPARSE_RCU_POINTER +# define __rcu __attribute__((noderef, address_space(4))) +#else +# define __rcu +#endif extern void __chk_user_ptr(const volatile void __user *); extern void __chk_io_ptr(const volatile void __iomem *); #else @@ -27,13 +34,20 @@ extern void __chk_io_ptr(const volatile void __iomem *); # define __chk_user_ptr(x) (void)0 # define __chk_io_ptr(x) (void)0 # define __builtin_warning(x, y...) (1) +# define __must_hold(x) # define __acquires(x) # define __releases(x) # define __acquire(x) (void)0 # define __release(x) (void)0 # define __cond_lock(x,c) (c) +# define __percpu +# define __rcu #endif +/* Indirect macros required for expanded argument pasting, eg. __LINE__. */ +#define ___PASTE(a,b) a##b +#define __PASTE(a,b) ___PASTE(a,b) + #ifdef __KERNEL__ #ifdef __GNUC__ @@ -49,6 +63,13 @@ extern void __chk_io_ptr(const volatile void __iomem *); # include <linux/compiler-intel.h> #endif +/* Clang compiler defines __GNUC__. So we will overwrite implementations + * coming from above header files here + */ +#ifdef __clang__ +#include <linux/compiler-clang.h> +#endif + /* * Generic compiler-dependent macros required for kernel * build go below this comment. Actual compiler/compiler version @@ -156,6 +177,15 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); (typeof(ptr)) (__ptr + (off)); }) #endif +#ifndef OPTIMIZER_HIDE_VAR +#define OPTIMIZER_HIDE_VAR(var) barrier() +#endif + +/* Not-quite-unique ID. */ +#ifndef __UNIQUE_ID +# define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __LINE__) +#endif + #endif /* __KERNEL__ */ #endif /* __ASSEMBLY__ */ @@ -228,7 +258,7 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); /* * Rather then using noinline to prevent stack consumption, use - * noinline_for_stack instead. For documentaiton reasons. + * noinline_for_stack instead. For documentation reasons. */ #define noinline_for_stack noinline @@ -270,11 +300,20 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); # define __section(S) __attribute__ ((__section__(#S))) #endif +#ifndef __visible +#define __visible +#endif + /* Are two types/vars the same type (ignoring qualifiers)? */ #ifndef __same_type # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) #endif +/* Is this type a native word size -- useful for atomic operations */ +#ifndef __native_word +# define __native_word(t) (sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long)) +#endif + /* Compile time object size, -1 for unknown */ #ifndef __compiletime_object_size # define __compiletime_object_size(obj) -1 @@ -284,8 +323,49 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); #endif #ifndef __compiletime_error # define __compiletime_error(message) +/* + * Sparse complains of variable sized arrays due to the temporary variable in + * __compiletime_assert. Unfortunately we can't just expand it out to make + * sparse see a constant array size without breaking compiletime_assert on old + * versions of GCC (e.g. 4.2.4), so hide the array from sparse altogether. + */ +# ifndef __CHECKER__ +# define __compiletime_error_fallback(condition) \ + do { ((void)sizeof(char[1 - 2 * condition])); } while (0) +# endif +#endif +#ifndef __compiletime_error_fallback +# define __compiletime_error_fallback(condition) do { } while (0) #endif +#define __compiletime_assert(condition, msg, prefix, suffix) \ + do { \ + bool __cond = !(condition); \ + extern void prefix ## suffix(void) __compiletime_error(msg); \ + if (__cond) \ + prefix ## suffix(); \ + __compiletime_error_fallback(__cond); \ + } while (0) + +#define _compiletime_assert(condition, msg, prefix, suffix) \ + __compiletime_assert(condition, msg, prefix, suffix) + +/** + * compiletime_assert - break build and emit msg if condition is false + * @condition: a compile-time constant condition to check + * @msg: a message to emit if condition is false + * + * In tradition of POSIX assert, this macro will break the build if the + * supplied condition is *false*, emitting the supplied error message if the + * compiler has support to do so. + */ +#define compiletime_assert(condition, msg) \ + _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) + +#define compiletime_assert_atomic_type(t) \ + compiletime_assert(__native_word(t), \ + "Need native word sized stores/loads for atomicity.") + /* * Prevent the compiler from merging or refetching accesses. The compiler * is also forbidden from reordering successive instances of ACCESS_ONCE(), @@ -300,4 +380,12 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); */ #define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) +/* Ignore/forbid kprobes attach on very low level functions marked by this attribute: */ +#ifdef CONFIG_KPROBES +# define __kprobes __attribute__((__section__(".kprobes.text"))) +# define nokprobe_inline __always_inline +#else +# define __kprobes +# define nokprobe_inline inline +#endif #endif /* __LINUX_COMPILER_H */ diff --git a/include/linux/mtd/flashchip.h b/include/linux/mtd/flashchip.h index 7028ee1e77..e5c7d1cf0d 100644 --- a/include/linux/mtd/flashchip.h +++ b/include/linux/mtd/flashchip.h @@ -9,7 +9,6 @@ #ifndef __MTD_FLASHCHIP_H__ #define __MTD_FLASHCHIP_H__ -#define __UBOOT__ #ifndef __UBOOT__ /* For spinlocks. sched.h includes spinlock.h from whichever directory it * happens to be in - so we don't have to care whether we're on 2.2, which diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 1526d075c7..8666413275 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -8,7 +8,6 @@ #ifndef __MTD_MTD_H__ #define __MTD_MTD_H__ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/types.h> #include <linux/uio.h> diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 67d2651481..8438490fe4 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -16,7 +16,6 @@ #ifndef __LINUX_MTD_NAND_H #define __LINUX_MTD_NAND_H -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/wait.h> #include <linux/spinlock.h> diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h index d9e58aedf6..05d0ab54c0 100644 --- a/include/linux/mtd/ubi.h +++ b/include/linux/mtd/ubi.h @@ -10,7 +10,6 @@ #define __LINUX_UBI_H__ #include <linux/types.h> -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/ioctl.h> #include <mtd/ubi-user.h> diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h index b5994e3799..2cc16a3e7d 100644 --- a/include/linux/rbtree.h +++ b/include/linux/rbtree.h @@ -17,7 +17,6 @@ #ifndef _LINUX_RBTREE_H #define _LINUX_RBTREE_H -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/kernel.h> #endif diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h index b9f4bcb154..0ef582aeec 100644 --- a/include/mtd/mtd-abi.h +++ b/include/mtd/mtd-abi.h @@ -8,7 +8,6 @@ #ifndef __MTD_ABI_H__ #define __MTD_ABI_H__ -#define __UBOOT__ #ifdef __UBOOT__ #include <linux/compat.h> #endif diff --git a/include/ns16550.h b/include/ns16550.h index d1f3a906c0..5784cfd97b 100644 --- a/include/ns16550.h +++ b/include/ns16550.h @@ -23,6 +23,14 @@ #include <linux/types.h> +#ifdef CONFIG_DM_SERIAL +/* + * For driver model we always use one byte per register, and sort out the + * differences in the driver + */ +#define CONFIG_SYS_NS16550_REG_SIZE (-1) +#endif + #if !defined(CONFIG_SYS_NS16550_REG_SIZE) || (CONFIG_SYS_NS16550_REG_SIZE == 0) #error "Please define NS16550 registers size." #elif defined(CONFIG_SYS_NS16550_MEM32) @@ -37,6 +45,21 @@ unsigned char postpad_##x[-CONFIG_SYS_NS16550_REG_SIZE - 1]; #endif +/** + * struct ns16550_platdata - information about a NS16550 port + * + * @base: Base register address + * @reg_shift: Shift size of registers (0=byte, 1=16bit, 2=32bit...) + * @clock: UART base clock speed in Hz + */ +struct ns16550_platdata { + unsigned char *base; + int reg_shift; + int clock; +}; + +struct udevice; + struct NS16550 { UART_REG(rbr); /* 0 */ UART_REG(ier); /* 1 */ @@ -65,6 +88,9 @@ struct NS16550 { UART_REG(scr); /* 10*/ UART_REG(ssr); /* 11*/ #endif +#ifdef CONFIG_DM_SERIAL + struct ns16550_platdata *plat; +#endif }; #define thr rbr @@ -170,3 +196,43 @@ void NS16550_putc(NS16550_t com_port, char c); char NS16550_getc(NS16550_t com_port); int NS16550_tstc(NS16550_t com_port); void NS16550_reinit(NS16550_t com_port, int baud_divisor); + +/** + * ns16550_calc_divisor() - calculate the divisor given clock and baud rate + * + * Given the UART input clock and required baudrate, calculate the divisor + * that should be used. + * + * @port: UART port + * @clock: UART input clock speed in Hz + * @baudrate: Required baud rate + * @return baud rate divisor that should be used + */ +int ns16550_calc_divisor(NS16550_t port, int clock, int baudrate); + +/** + * ns16550_serial_ofdata_to_platdata() - convert DT to platform data + * + * Decode a device tree node for an ns16550 device. This includes the + * register base address and register shift properties. The caller must set + * up the clock frequency. + * + * @dev: dev to decode platform data for + * @return: 0 if OK, -EINVAL on error + */ +int ns16550_serial_ofdata_to_platdata(struct udevice *dev); + +/** + * ns16550_serial_probe() - probe a serial port + * + * This sets up the serial port ready for use, except for the baud rate + * @return 0, or -ve on error + */ +int ns16550_serial_probe(struct udevice *dev); + +/** + * struct ns16550_serial_ops - ns16550 serial operations + * + * These should be used by the client driver for the driver's 'ops' member + */ +extern const struct dm_serial_ops ns16550_serial_ops; diff --git a/include/serial.h b/include/serial.h index d232d470a3..8f574e4ef8 100644 --- a/include/serial.h +++ b/include/serial.h @@ -72,4 +72,96 @@ extern int write_port(struct stdio_dev *port, char *buf); extern int read_port(struct stdio_dev *port, char *buf, int size); #endif +struct udevice; + +/** + * struct struct dm_serial_ops - Driver model serial operations + * + * The uclass interface is implemented by all serial devices which use + * driver model. + */ +struct dm_serial_ops { + /** + * setbrg() - Set up the baud rate generator + * + * Adjust baud rate divisors to set up a new baud rate for this + * device. Not all devices will support all rates. If the rate + * cannot be supported, the driver is free to select the nearest + * available rate. or return -EINVAL if this is not possible. + * + * @dev: Device pointer + * @baudrate: New baud rate to use + * @return 0 if OK, -ve on error + */ + int (*setbrg)(struct udevice *dev, int baudrate); + /** + * getc() - Read a character and return it + * + * If no character is available, this should return -EAGAIN without + * waiting. + * + * @dev: Device pointer + * @return character (0..255), -ve on error + */ + int (*getc)(struct udevice *dev); + /** + * putc() - Write a character + * + * @dev: Device pointer + * @ch: character to write + * @return 0 if OK, -ve on error + */ + int (*putc)(struct udevice *dev, const char ch); + /** + * pending() - Check if input/output characters are waiting + * + * This can be used to return an indication of the number of waiting + * characters if the driver knows this (e.g. by looking at the FIFO + * level). It is acceptable to return 1 if an indeterminant number + * of characters is waiting. + * + * This method is optional. + * + * @dev: Device pointer + * @input: true to check input characters, false for output + * @return number of waiting characters, 0 for none, -ve on error + */ + int (*pending)(struct udevice *dev, bool input); + /** + * clear() - Clear the serial FIFOs/holding registers + * + * This method is optional. + * + * This quickly clears any input/output characters from the UART. + * If this is not possible, but characters still exist, then it + * is acceptable to return -EAGAIN (try again) or -EINVAL (not + * supported). + * + * @dev: Device pointer + * @return 0 if OK, -ve on error + */ + int (*clear)(struct udevice *dev); +#if CONFIG_POST & CONFIG_SYS_POST_UART + /** + * loop() - Control serial device loopback mode + * + * @dev: Device pointer + * @on: 1 to turn loopback on, 0 to turn if off + */ + int (*loop)(struct udevice *dev, int on); +#endif +}; + +/** + * struct serial_dev_priv - information about a device used by the uclass + * + * @sdev: stdio device attached to this uart + */ +struct serial_dev_priv { + struct stdio_dev *sdev; +}; + +/* Access the serial operations for a device */ +#define serial_get_ops(dev) ((struct dm_serial_ops *)(dev)->driver->ops) + #endif diff --git a/include/sparse_defs.h b/include/sparse_defs.h new file mode 100644 index 0000000000..d0612c94e5 --- /dev/null +++ b/include/sparse_defs.h @@ -0,0 +1,7 @@ +/* + * Copyright 2014 Broadcom Corporation. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <linux/types.h> diff --git a/include/stdio_dev.h b/include/stdio_dev.h index a7d0825c7e..268de8ea70 100644 --- a/include/stdio_dev.h +++ b/include/stdio_dev.h @@ -78,7 +78,29 @@ extern char *stdio_names[MAX_FILES]; */ int stdio_register (struct stdio_dev * dev); int stdio_register_dev(struct stdio_dev *dev, struct stdio_dev **devp); -int stdio_init (void); + +/** + * stdio_init_tables() - set up stdio tables ready for devices + * + * This does not add any devices, but just prepares stdio for use. + */ +int stdio_init_tables(void); + +/** + * stdio_add_devices() - Add stdio devices to the table + * + * This makes calls to all the various subsystems that use stdio, to make + * them register with stdio. + */ +int stdio_add_devices(void); + +/** + * stdio_init() - Sets up stdio ready for use + * + * This calls stdio_init_tables() and stdio_add_devices() + */ +int stdio_init(void); + void stdio_print_current_devices(void); #ifdef CONFIG_SYS_STDIO_DEREGISTER int stdio_deregister(const char *devname); diff --git a/include/systemace.h b/include/systemace.h index 73affc42be..3f342d565c 100644 --- a/include/systemace.h +++ b/include/systemace.h @@ -6,7 +6,6 @@ * * SPDX-License-Identifier: GPL-2.0+ */ -#ident "$Id:$" #ifdef CONFIG_SYSTEMACE diff --git a/include/tsec.h b/include/tsec.h index 1046426c5c..58cdc19df3 100644 --- a/include/tsec.h +++ b/include/tsec.h @@ -20,10 +20,14 @@ #include <net.h> #include <config.h> #include <phy.h> -#include <asm/fsl_enet.h> +#ifdef CONFIG_LS102XA +#define TSEC_SIZE 0x40000 +#define TSEC_MDIO_OFFSET 0x40000 +#else #define TSEC_SIZE 0x01000 #define TSEC_MDIO_OFFSET 0x01000 +#endif #define CONFIG_SYS_MDIO_BASE_ADDR (MDIO_BASE_ADDR + 0x520) @@ -125,9 +129,14 @@ #define MINFLR_INIT_SETTINGS 0x00000040 +#ifdef CONFIG_LS102XA +#define DMACTRL_INIT_SETTINGS 0x00000003 +#else #define DMACTRL_INIT_SETTINGS 0x000000c3 +#endif #define DMACTRL_GRS 0x00000010 #define DMACTRL_GTS 0x00000008 +#define DMACTRL_LE 0x00008000 #define TSTAT_CLEAR_THALT 0x80000000 #define RSTAT_CLEAR_RHALT 0x00800000 diff --git a/lib/fdtdec.c b/lib/fdtdec.c index c2f3645253..06d4542029 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -382,6 +382,21 @@ int fdtdec_get_alias_node(const void *blob, const char *name) return fdt_path_offset(blob, prop); } +int fdtdec_get_chosen_node(const void *blob, const char *name) +{ + const char *prop; + int chosen_node; + int len; + + if (!blob) + return -FDT_ERR_NOTFOUND; + chosen_node = fdt_path_offset(blob, "/chosen"); + prop = fdt_getprop(blob, chosen_node, name, &len); + if (!prop) + return -FDT_ERR_NOTFOUND; + return fdt_path_offset(blob, prop); +} + int fdtdec_check_fdt(void) { /* diff --git a/lib/list_sort.c b/lib/list_sort.c index 81de0a17de..e841da53ee 100644 --- a/lib/list_sort.c +++ b/lib/list_sort.c @@ -1,4 +1,3 @@ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/kernel.h> #include <linux/module.h> diff --git a/lib/rbtree.c b/lib/rbtree.c index 9e52f70d17..5de3bf4026 100644 --- a/lib/rbtree.c +++ b/lib/rbtree.c @@ -9,7 +9,6 @@ linux/lib/rbtree.c */ -#define __UBOOT__ #include <linux/rbtree_augmented.h> #ifndef __UBOOT__ #include <linux/export.h> @@ -202,5 +202,8 @@ DnsStart(void) NetSetTimeout(DNS_TIMEOUT, DnsTimeout); net_set_udp_handler(DnsHandler); + /* Clear a previous MAC address, the server IP might have changed. */ + memset(NetServerEther, 0, sizeof(NetServerEther)); + DnsSend(); } diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean index d6dcd47f6f..88f14e2d8f 100644 --- a/scripts/Makefile.clean +++ b/scripts/Makefile.clean @@ -45,8 +45,8 @@ subdir-ymn := $(foreach f, $(subdir-ymn), \ # build a list of files to remove, usually relative to the current # directory -__clean-files := $(extra-y) $(always) \ - $(targets) $(clean-files) \ +__clean-files := $(extra-y) $(extra-m) $(extra-) \ + $(always) $(targets) $(clean-files) \ $(host-progs) \ $(hostprogs-y) $(hostprogs-m) $(hostprogs-) diff --git a/scripts/multiconfig.sh b/scripts/multiconfig.sh index 4190798a97..4a8737f352 100644 --- a/scripts/multiconfig.sh +++ b/scripts/multiconfig.sh @@ -118,6 +118,13 @@ do_board_defconfig () { defconfig_path=$srctree/configs/$1 tmp_defconfig_path=configs/.tmp_defconfig + if [ ! -r $defconfig_path ]; then + echo >&2 "***" + echo >&2 "*** Can't find default configuration \"confis/$1\"!" + echo >&2 "***" + exit 1 + fi + mkdir -p arch configs # defconfig for Normal: # pick lines without prefixes and lines starting '+' prefix @@ -170,7 +177,7 @@ do_savedefconfig () { # backslashes as an escape character while read -r line do - output_lines="$output_lines $line" + output_lines="$output_lines%$line" done < defconfig for img in $subimages @@ -185,42 +192,93 @@ do_savedefconfig () { tmp= match= + # "# CONFIG_FOO is not set" should not be divided. + # Use "%" as a separator, instead of a whitespace. + # "%" is unlikely to appear in defconfig context. + save_IFS=$IFS + IFS=% # coalesce common lines together for i in $output_lines do case "$i" in - "[+A-Z]*:$line") - tmp="$tmp $unmatched" + [+A-Z]*:$line) + tmp="$tmp%$unmatched" i=$(echo "$i" | \ - sed -e "s/^\([^:]\)*/\1$symbol/") - tmp="$tmp $i" + sed -e "s/^\([^:]*\)/\1$symbol/") + tmp="$tmp%$i" match=1 ;; - "$line") - tmp="$tmp $unmatched" - tmp="$tmp +$symbol:$i" + $line) + tmp="$tmp%$unmatched" + tmp="$tmp%+$symbol:$i" match=1 ;; *) - tmp="$tmp $i" + tmp="$tmp%$i" ;; esac done + # Restore the default separator for the outer for loop. + IFS=$save_IFS + if [ "$match" ]; then output_lines="$tmp" unmatched= else - unmatched="$unmatched $symbol:$line" + unmatched="$unmatched%$symbol:$line" fi done < defconfig done rm -f defconfig + touch defconfig + + save_IFS=$IFS + IFS=% + for line in $output_lines do - echo $line >> defconfig + case "$line" in + "") + # do not output blank lines + ;; + *) + echo $line >> defconfig + ;; + esac done + + IFS=$save_IFS +} + +# Some sanity checks before running "make <objdir>/<target>", +# where <objdir> should be either "spl" or "tpl". +# Doing "make spl/menuconfig" etc. on a non-SPL board makes no sense. +# It should be allowed only when ".config" exists and "CONFIG_SPL" is enabled. +# +# Usage: +# check_enabled_sumbimage <objdir>/<target> <objdir> +check_enabled_subimage () { + + case $2 in + spl|tpl) ;; + *) + echo >&2 "***" + echo >&2 "*** \"make $1\" is not supported." + echo >&2 "***" + exit 1 + ;; + esac + test -r "$KCONFIG_CONFIG" && get_enabled_subimages | grep -q $2 || { + config=CONFIG_$(echo $2 | tr '[a-z]' '[A-Z]') + + echo >&2 "***" + echo >&2 "*** Create \"$KCONFIG_CONFIG\" with \"$config\" enabled" + echo >&2 "*** before \"make $1\"." + echo >&2 "***" + exit 1 + } } # Usage: @@ -236,6 +294,7 @@ do_others () { objdir= else objdir=${1%/*} + check_enabled_subimage $1 $objdir fi run_make_config $target $objdir diff --git a/tools/buildman/README b/tools/buildman/README index d4e840480a..8ba19ec103 100644 --- a/tools/buildman/README +++ b/tools/buildman/README @@ -114,6 +114,13 @@ the '&' operator to limit the selection: * 'freescale & arm sandbox' All Freescale boards with ARM architecture, plus sandbox +You can also use -x to specifically exclude some boards. For example: + + buildmand arm -x nvidia,freescale,.*ball$ + +means to build all arm boards except nvidia, freescale and anything ending +with 'ball'. + It is convenient to use the -n option to see whaat will be built based on the subset given. @@ -435,7 +442,11 @@ is fixed, but there is a new one at line 126. This is probably only because we added some code and moved the broken line father down the file. If many boards have the same error, then -e will display the error only -once. This makes the output as concise as possible. +once. This makes the output as concise as possible. To see which boards have +each error, use -l. + +Buildman tries to distinguish warnings from errors, and shows warning lines +separately with a 'w' prefix. The full build output in this case is available in: @@ -670,7 +681,9 @@ snapper9g45=${at91-boards} BUILD_TAG=443 This will use 'make ENABLE_AT91_TEST=1 BUILD_TAG=442' for snapper9260 and 'make ENABLE_AT91_TEST=1 BUILD_TAG=443' for snapper9g45. A special variable ${target} is available to access the target name (snapper9260 and -snapper9g20 in this case). Variables are resolved recursively. +snapper9g20 in this case). Variables are resolved recursively. Note that +variables can only contain the characters A-Z, a-z, 0-9, hyphen (-) and +underscore (_). It is expected that any variables added are dealt with in U-Boot's config.mk file and documented in the README. @@ -690,6 +703,12 @@ Other options Buildman has various other command line options. Try --help to see them. +When doing builds, Buildman's return code will reflect the overall result: + + 0 (success) No errors or warnings found + 128 Errors found + 129 Warnings found + How to change from MAKEALL ========================== @@ -730,10 +749,10 @@ followed by (afterwards, or perhaps concurrently in another terminal): to see the results of the build. Rather than showing you all the output, buildman just shows a summary, with red indicating that a commit introduced an error and green indicating that a commit fixed an error. Use the -e -flag to see the full errors. +flag to see the full errors and -l to see which boards caused which errors. If you really want to see build results as they happen, use -v when doing a -build (and -e if you want to see errors as well). +build (-e will be enabled automatically). You don't need to stick around on that branch while buildman is running. It checks out its own copy of the source code, so you can change branches, diff --git a/tools/buildman/board.py b/tools/buildman/board.py index a333287624..5d536d5f20 100644 --- a/tools/buildman/board.py +++ b/tools/buildman/board.py @@ -239,13 +239,14 @@ class Boards: terms.append(term) return terms - def SelectBoards(self, args): + def SelectBoards(self, args, exclude=[]): """Mark boards selected based on args Args: - List of strings specifying boards to include, either named, or - by their target, architecture, cpu, vendor or soc. If empty, all - boards are selected. + args: List of strings specifying boards to include, either named, + or by their target, architecture, cpu, vendor or soc. If + empty, all boards are selected. + exclude: List of boards to exclude, regardless of 'args' Returns: Dictionary which holds the number of boards which were selected @@ -258,17 +259,33 @@ class Boards: for term in terms: result[str(term)] = 0 + exclude_list = [] + for expr in exclude: + exclude_list.append(Expr(expr)) + for board in self._boards: + matching_term = None + build_it = False if terms: match = False for term in terms: if term.Matches(board.props): - board.build_it = True - result[str(term)] += 1 - result['all'] += 1 + matching_term = str(term) + build_it = True break else: + build_it = True + + # Check that it is not specifically excluded + for expr in exclude_list: + if expr.Matches(board.props): + build_it = False + break + + if build_it: board.build_it = True + if matching_term: + result[matching_term] += 1 result['all'] += 1 return result diff --git a/tools/buildman/bsettings.py b/tools/buildman/bsettings.py index 916479866c..fdd875b073 100644 --- a/tools/buildman/bsettings.py +++ b/tools/buildman/bsettings.py @@ -5,6 +5,7 @@ import ConfigParser import os +import StringIO def Setup(fname=''): @@ -17,11 +18,15 @@ def Setup(fname=''): global config_fname settings = ConfigParser.SafeConfigParser() - config_fname = fname - if config_fname == '': - config_fname = '%s/.buildman' % os.getenv('HOME') - if config_fname: - settings.read(config_fname) + if fname is not None: + config_fname = fname + if config_fname == '': + config_fname = '%s/.buildman' % os.getenv('HOME') + if config_fname: + settings.read(config_fname) + +def AddFile(data): + settings.readfp(StringIO.StringIO(data)) def GetItems(section): """Get the items from a section of the config. diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index a555bd81fc..8155c1681e 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -20,6 +20,7 @@ import builderthread import command import gitutil import terminal +from terminal import Print import toolchain @@ -140,6 +141,7 @@ class Builder: Private members: _base_board_dict: Last-summarised Dict of boards _base_err_lines: Last-summarised list of errors + _base_warn_lines: Last-summarised list of warnings _build_period_us: Time taken for a single build (float object). _complete_delay: Expected delay until completion (timedelta) _next_delay_update: Next time we plan to display a progress update @@ -214,6 +216,11 @@ class Builder: self.col = terminal.Color() + self._re_function = re.compile('(.*): In function.*') + self._re_files = re.compile('In file included from.*') + self._re_warning = re.compile('(.*):(\d*):(\d*): warning: .*') + self._re_note = re.compile('(.*):(\d*):(\d*): note: this is the location of the previous.*') + self.queue = Queue.Queue() self.out_queue = Queue.Queue() for i in range(self.num_threads): @@ -237,18 +244,21 @@ class Builder: del t def SetDisplayOptions(self, show_errors=False, show_sizes=False, - show_detail=False, show_bloat=False): + show_detail=False, show_bloat=False, + list_error_boards=False): """Setup display options for the builder. show_errors: True to show summarised error/warning info show_sizes: Show size deltas show_detail: Show detail for each board show_bloat: Show detail for each function + list_error_boards: Show the boards which caused each error/warning """ self._show_errors = show_errors self._show_sizes = show_sizes self._show_detail = show_detail self._show_bloat = show_bloat + self._list_error_boards = list_error_boards def _AddTimestamp(self): """Add a new timestamp to the list and record the build period. @@ -290,8 +300,8 @@ class Builder: length: Length of new line, in characters """ if length < self.last_line_len: - print ' ' * (self.last_line_len - length), - print '\r', + Print(' ' * (self.last_line_len - length), newline=False) + Print('\r', newline=False) self.last_line_len = length sys.stdout.flush() @@ -342,7 +352,7 @@ class Builder: if result.already_done: self.already_done += 1 if self._verbose: - print '\r', + Print('\r', newline=False) self.ClearLine(0) boards_selected = {target : result.brd} self.ResetResultSummary(boards_selected) @@ -370,7 +380,7 @@ class Builder: self.commit_count) name += target - print line + name, + Print(line + name, newline=False) length = 14 + len(name) self.ClearLine(length) @@ -486,7 +496,7 @@ class Builder: try: size, type, name = line[:-1].split() except: - print "Invalid line in file '%s': '%s'" % (fname, line[:-1]) + Print("Invalid line in file '%s': '%s'" % (fname, line[:-1])) continue if type in 'tTdDbB': # function names begin with '.' on 64-bit powerpc @@ -569,19 +579,57 @@ class Builder: Tuple: Dict containing boards which passed building this commit. keyed by board.target - List containing a summary of error/warning lines + List containing a summary of error lines + Dict keyed by error line, containing a list of the Board + objects with that error + List containing a summary of warning lines + Dict keyed by error line, containing a list of the Board + objects with that warning """ + def AddLine(lines_summary, lines_boards, line, board): + line = line.rstrip() + if line in lines_boards: + lines_boards[line].append(board) + else: + lines_boards[line] = [board] + lines_summary.append(line) + board_dict = {} err_lines_summary = [] + err_lines_boards = {} + warn_lines_summary = [] + warn_lines_boards = {} for board in boards_selected.itervalues(): outcome = self.GetBuildOutcome(commit_upto, board.target, read_func_sizes) board_dict[board.target] = outcome - for err in outcome.err_lines: - if err and not err.rstrip() in err_lines_summary: - err_lines_summary.append(err.rstrip()) - return board_dict, err_lines_summary + last_func = None + last_was_warning = False + for line in outcome.err_lines: + if line: + if (self._re_function.match(line) or + self._re_files.match(line)): + last_func = line + else: + is_warning = self._re_warning.match(line) + is_note = self._re_note.match(line) + if is_warning or (last_was_warning and is_note): + if last_func: + AddLine(warn_lines_summary, warn_lines_boards, + last_func, board) + AddLine(warn_lines_summary, warn_lines_boards, + line, board) + else: + if last_func: + AddLine(err_lines_summary, err_lines_boards, + last_func, board) + AddLine(err_lines_summary, err_lines_boards, + line, board) + last_was_warning = is_warning + last_func = None + return (board_dict, err_lines_summary, err_lines_boards, + warn_lines_summary, warn_lines_boards) def AddOutcome(self, board_dict, arch_list, changes, char, color): """Add an output to our list of outcomes for each architecture @@ -636,6 +684,9 @@ class Builder: for board in board_selected: self._base_board_dict[board] = Builder.Outcome(0, [], [], {}) self._base_err_lines = [] + self._base_warn_lines = [] + self._base_err_line_boards = {} + self._base_warn_line_boards = {} def PrintFuncSizeDetail(self, fname, old, new): grow, shrink, add, remove, up, down = 0, 0, 0, 0, 0, 0 @@ -673,16 +724,16 @@ class Builder: return args = [self.ColourNum(x) for x in args] indent = ' ' * 15 - print ('%s%s: add: %s/%s, grow: %s/%s bytes: %s/%s (%s)' % - tuple([indent, self.col.Color(self.col.YELLOW, fname)] + args)) - print '%s %-38s %7s %7s %+7s' % (indent, 'function', 'old', 'new', - 'delta') + Print('%s%s: add: %s/%s, grow: %s/%s bytes: %s/%s (%s)' % + tuple([indent, self.col.Color(self.col.YELLOW, fname)] + args)) + Print('%s %-38s %7s %7s %+7s' % (indent, 'function', 'old', 'new', + 'delta')) for diff, name in delta: if diff: color = self.col.RED if diff > 0 else self.col.GREEN msg = '%s %-38s %7s %7s %+7d' % (indent, name, old.get(name, '-'), new.get(name,'-'), diff) - print self.col.Color(color, msg) + Print(msg, colour=color) def PrintSizeDetail(self, target_list, show_bloat): @@ -707,11 +758,12 @@ class Builder: color = self.col.RED if diff > 0 else self.col.GREEN msg = ' %s %+d' % (name, diff) if not printed_target: - print '%10s %-15s:' % ('', result['_target']), + Print('%10s %-15s:' % ('', result['_target']), + newline=False) printed_target = True - print self.col.Color(color, msg), + Print(msg, colour=color, newline=False) if printed_target: - print + Print() if show_bloat: target = result['_target'] outcome = result['_outcome'] @@ -816,18 +868,19 @@ class Builder: color = self.col.RED if avg_diff > 0 else self.col.GREEN msg = ' %s %+1.1f' % (name, avg_diff) if not printed_arch: - print '%10s: (for %d/%d boards)' % (arch, count, - arch_count[arch]), + Print('%10s: (for %d/%d boards)' % (arch, count, + arch_count[arch]), newline=False) printed_arch = True - print self.col.Color(color, msg), + Print(msg, colour=color, newline=False) if printed_arch: - print + Print() if show_detail: self.PrintSizeDetail(target_list, show_bloat) def PrintResultSummary(self, board_selected, board_dict, err_lines, + err_line_boards, warn_lines, warn_line_boards, show_sizes, show_detail, show_bloat): """Compare results with the base results and display delta. @@ -843,10 +896,48 @@ class Builder: commit, keyed by board.target. The value is an Outcome object. err_lines: A list of errors for this commit, or [] if there is none, or we don't want to print errors + err_line_boards: Dict keyed by error line, containing a list of + the Board objects with that error + warn_lines: A list of warnings for this commit, or [] if there is + none, or we don't want to print errors + warn_line_boards: Dict keyed by warning line, containing a list of + the Board objects with that warning show_sizes: Show image size deltas show_detail: Show detail for each board show_bloat: Show detail for each function """ + def _BoardList(line, line_boards): + """Helper function to get a line of boards containing a line + + Args: + line: Error line to search for + Return: + String containing a list of boards with that error line, or + '' if the user has not requested such a list + """ + if self._list_error_boards: + names = [] + for board in line_boards[line]: + names.append(board.target) + names_str = '(%s) ' % ','.join(names) + else: + names_str = '' + return names_str + + def _CalcErrorDelta(base_lines, base_line_boards, lines, line_boards, + char): + better_lines = [] + worse_lines = [] + for line in lines: + if line not in base_lines: + worse_lines.append(char + '+' + + _BoardList(line, line_boards) + line) + for line in base_lines: + if line not in lines: + better_lines.append(char + '-' + + _BoardList(line, base_line_boards) + line) + return better_lines, worse_lines + better = [] # List of boards fixed since last commit worse = [] # List of new broken boards since last commit new = [] # List of boards that didn't exist last time @@ -870,17 +961,14 @@ class Builder: new.append(target) # Get a list of errors that have appeared, and disappeared - better_err = [] - worse_err = [] - for line in err_lines: - if line not in self._base_err_lines: - worse_err.append('+' + line) - for line in self._base_err_lines: - if line not in err_lines: - better_err.append('-' + line) + better_err, worse_err = _CalcErrorDelta(self._base_err_lines, + self._base_err_line_boards, err_lines, err_line_boards, '') + better_warn, worse_warn = _CalcErrorDelta(self._base_warn_lines, + self._base_warn_line_boards, warn_lines, warn_line_boards, 'w') # Display results by arch - if better or worse or unknown or new or worse_err or better_err: + if (better or worse or unknown or new or worse_err or better_err + or worse_warn or better_warn): arch_list = {} self.AddOutcome(board_selected, arch_list, better, '', self.col.GREEN) @@ -891,13 +979,19 @@ class Builder: self.AddOutcome(board_selected, arch_list, unknown, '?', self.col.MAGENTA) for arch, target_list in arch_list.iteritems(): - print '%10s: %s' % (arch, target_list) + Print('%10s: %s' % (arch, target_list)) self._error_lines += 1 if better_err: - print self.col.Color(self.col.GREEN, '\n'.join(better_err)) + Print('\n'.join(better_err), colour=self.col.GREEN) self._error_lines += 1 if worse_err: - print self.col.Color(self.col.RED, '\n'.join(worse_err)) + Print('\n'.join(worse_err), colour=self.col.RED) + self._error_lines += 1 + if better_warn: + Print('\n'.join(better_warn), colour=self.col.CYAN) + self._error_lines += 1 + if worse_warn: + Print('\n'.join(worse_warn), colour=self.col.MAGENTA) self._error_lines += 1 if show_sizes: @@ -907,6 +1001,9 @@ class Builder: # Save our updated information for the next call to this function self._base_board_dict = board_dict self._base_err_lines = err_lines + self._base_warn_lines = warn_lines + self._base_err_line_boards = err_line_boards + self._base_warn_line_boards = warn_line_boards # Get a list of boards that did not get built, if needed not_built = [] @@ -914,18 +1011,21 @@ class Builder: if not board in board_dict: not_built.append(board) if not_built: - print "Boards not built (%d): %s" % (len(not_built), - ', '.join(not_built)) + Print("Boards not built (%d): %s" % (len(not_built), + ', '.join(not_built))) def ProduceResultSummary(self, commit_upto, commits, board_selected): - board_dict, err_lines = self.GetResultSummary(board_selected, - commit_upto, read_func_sizes=self._show_bloat) + (board_dict, err_lines, err_line_boards, warn_lines, + warn_line_boards) = self.GetResultSummary( + board_selected, commit_upto, + read_func_sizes=self._show_bloat) if commits: msg = '%02d: %s' % (commit_upto + 1, commits[commit_upto].subject) - print self.col.Color(self.col.BLUE, msg) + Print(msg, colour=self.col.BLUE) self.PrintResultSummary(board_selected, board_dict, - err_lines if self._show_errors else [], + err_lines if self._show_errors else [], err_line_boards, + warn_lines if self._show_errors else [], warn_line_boards, self._show_sizes, self._show_detail, self._show_bloat) def ShowSummary(self, commits, board_selected): @@ -946,7 +1046,7 @@ class Builder: for commit_upto in range(0, self.commit_count, self._step): self.ProduceResultSummary(commit_upto, commits, board_selected) if not self._error_lines: - print self.col.Color(self.col.GREEN, '(no errors to report)') + Print('(no errors to report)', colour=self.col.GREEN) def SetupBuild(self, board_selected, commits): @@ -991,7 +1091,7 @@ class Builder: if os.path.exists(git_dir): gitutil.Fetch(git_dir, thread_dir) else: - print 'Cloning repo for thread %d' % thread_num + Print('Cloning repo for thread %d' % thread_num) gitutil.Clone(src_dir, thread_dir) def _PrepareWorkingSpace(self, max_threads, setup_git): @@ -1031,13 +1131,17 @@ class Builder: value is Board object keep_outputs: True to save build output files verbose: Display build results as they are completed + Returns: + Tuple containing: + - number of boards that failed to build + - number of boards that issued warnings """ self.commit_count = len(commits) if commits else 1 self.commits = commits self._verbose = verbose self.ResetResultSummary(board_selected) - builderthread.Mkdir(self.base_dir) + builderthread.Mkdir(self.base_dir, parents = True) self._PrepareWorkingSpace(min(self.num_threads, len(board_selected)), commits is not None) self._PrepareOutputSpace() @@ -1058,5 +1162,6 @@ class Builder: # Wait until we have processed all output self.out_queue.join() - print + Print() self.ClearLine(0) + return (self.fail, self.warned) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index 8214662e36..a9cf68a801 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -12,14 +12,17 @@ import threading import command import gitutil -def Mkdir(dirname): +def Mkdir(dirname, parents = False): """Make a directory if it doesn't already exist. Args: dirname: Directory to create """ try: - os.mkdir(dirname) + if parents: + os.makedirs(dirname) + else: + os.mkdir(dirname) except OSError as err: if err.errno == errno.EEXIST: pass @@ -138,16 +141,17 @@ class BuilderThread(threading.Thread): result.already_done = os.path.exists(done_file) will_build = (force_build or force_build_failures or not result.already_done) - if result.already_done and will_build: + if result.already_done: # Get the return code from that build and use it with open(done_file, 'r') as fd: result.return_code = int(fd.readline()) - err_file = self.builder.GetErrFile(commit_upto, brd.target) - if os.path.exists(err_file) and os.stat(err_file).st_size: - result.stderr = 'bad' - elif not force_build: - # The build passed, so no need to build it again - will_build = False + if will_build: + err_file = self.builder.GetErrFile(commit_upto, brd.target) + if os.path.exists(err_file) and os.stat(err_file).st_size: + result.stderr = 'bad' + elif not force_build: + # The build passed, so no need to build it again + will_build = False if will_build: # We are going to have to build it. First, get a toolchain @@ -177,6 +181,7 @@ class BuilderThread(threading.Thread): Mkdir(out_dir) args = [] cwd = work_dir + src_dir = os.path.realpath(work_dir) if not self.builder.in_tree: if commit_upto is None: # In this case we are building in the original source @@ -189,6 +194,7 @@ class BuilderThread(threading.Thread): work_dir = os.path.realpath(work_dir) args.append('O=%s/build' % work_dir) cwd = None + src_dir = os.getcwd() else: args.append('O=build') args.append('-s') @@ -209,7 +215,7 @@ class BuilderThread(threading.Thread): if result.return_code == 0: result = self.Make(commit, brd, 'build', cwd, *args, env=env) - result.stdout = config_out + result.stdout + result.stderr = result.stderr.replace(src_dir + '/', '') else: result.return_code = 1 result.stderr = 'No tool chain for %s\n' % brd.arch diff --git a/tools/buildman/buildman.py b/tools/buildman/buildman.py index e18859b3d7..d0afeda6c0 100755 --- a/tools/buildman/buildman.py +++ b/tools/buildman/buildman.py @@ -8,7 +8,6 @@ """See README for more information""" import multiprocessing -from optparse import OptionParser import os import re import sys @@ -20,9 +19,10 @@ sys.path.append(os.path.join(our_path, '../patman')) # Our modules import board +import bsettings import builder import checkpatch -import command +import cmdline import control import doctest import gitutil @@ -31,27 +31,20 @@ import terminal import toolchain def RunTests(): + import func_test import test import doctest result = unittest.TestResult() - for module in ['toolchain']: + for module in ['toolchain', 'gitutil']: suite = doctest.DocTestSuite(module) suite.run(result) - # TODO: Surely we can just 'print' result? - print result - for test, err in result.errors: - print err - for test, err in result.failures: - print err - sys.argv = [sys.argv[0]] - suite = unittest.TestLoader().loadTestsFromTestCase(test.TestBuild) - result = unittest.TestResult() - suite.run(result) + for module in (test.TestBuild, func_test.TestFunctional): + suite = unittest.TestLoader().loadTestsFromTestCase(module) + suite.run(result) - # TODO: Surely we can just 'print' result? print result for test, err in result.errors: print err @@ -59,81 +52,14 @@ def RunTests(): print err -parser = OptionParser() -parser.add_option('-b', '--branch', type='string', - help='Branch name to build') -parser.add_option('-B', '--bloat', dest='show_bloat', - action='store_true', default=False, - help='Show changes in function code size for each board') -parser.add_option('-c', '--count', dest='count', type='int', - default=-1, help='Run build on the top n commits') -parser.add_option('-C', '--force-reconfig', dest='force_reconfig', - action='store_true', default=False, - help='Reconfigure for every commit (disable incremental build)') -parser.add_option('-d', '--detail', dest='show_detail', - action='store_true', default=False, - help='Show detailed information for each board in summary') -parser.add_option('-e', '--show_errors', action='store_true', - default=False, help='Show errors and warnings') -parser.add_option('-f', '--force-build', dest='force_build', - action='store_true', default=False, - help='Force build of boards even if already built') -parser.add_option('-F', '--force-build-failures', dest='force_build_failures', - action='store_true', default=False, - help='Force build of previously-failed build') -parser.add_option('-g', '--git', type='string', - help='Git repo containing branch to build', default='.') -parser.add_option('-G', '--config-file', type='string', - help='Path to buildman config file', default='') -parser.add_option('-H', '--full-help', action='store_true', dest='full_help', - default=False, help='Display the README file') -parser.add_option('-i', '--in-tree', dest='in_tree', - action='store_true', default=False, - help='Build in the source tree instead of a separate directory') -parser.add_option('-j', '--jobs', dest='jobs', type='int', - default=None, help='Number of jobs to run at once (passed to make)') -parser.add_option('-k', '--keep-outputs', action='store_true', - default=False, help='Keep all build output files (e.g. binaries)') -parser.add_option('--list-tool-chains', action='store_true', default=False, - help='List available tool chains') -parser.add_option('-n', '--dry-run', action='store_true', dest='dry_run', - default=False, help="Do a try run (describe actions, but no nothing)") -parser.add_option('-o', '--output-dir', type='string', - dest='output_dir', default='..', - help='Directory where all builds happen and buildman has its workspace (default is ../)') -parser.add_option('-Q', '--quick', action='store_true', - default=False, help='Do a rough build, with limited warning resolution') -parser.add_option('-s', '--summary', action='store_true', - default=False, help='Show a build summary') -parser.add_option('-S', '--show-sizes', action='store_true', - default=False, help='Show image size variation in summary') -parser.add_option('--step', type='int', - default=1, help='Only build every n commits (0=just first and last)') -parser.add_option('-t', '--test', action='store_true', dest='test', - default=False, help='run tests') -parser.add_option('-T', '--threads', type='int', - default=None, help='Number of builder threads to use') -parser.add_option('-u', '--show_unknown', action='store_true', - default=False, help='Show boards with unknown build result') -parser.add_option('-v', '--verbose', action='store_true', - default=False, help='Show build results while the build progresses') - -parser.usage += """ - -Build U-Boot for all commits in a branch. Use -n to do a dry run""" - -(options, args) = parser.parse_args() +options, args = cmdline.ParseArgs() # Run our meagre tests if options.test: RunTests() -elif options.full_help: - pager = os.getenv('PAGER') - if not pager: - pager = 'more' - fname = os.path.join(os.path.dirname(sys.argv[0]), 'README') - command.Run(pager, fname) # Build selected commits for selected boards else: - control.DoBuildman(options, args) + bsettings.Setup(options.config_file) + ret_code = control.DoBuildman(options, args) + sys.exit(ret_code) diff --git a/tools/buildman/cmdline.py b/tools/buildman/cmdline.py new file mode 100644 index 0000000000..27d3c708e6 --- /dev/null +++ b/tools/buildman/cmdline.py @@ -0,0 +1,85 @@ +# +# Copyright (c) 2014 Google, Inc +# +# SPDX-License-Identifier: GPL-2.0+ +# + +from optparse import OptionParser + +def ParseArgs(): + """Parse command line arguments from sys.argv[] + + Returns: + tuple containing: + options: command line options + args: command lin arguments + """ + parser = OptionParser() + parser.add_option('-b', '--branch', type='string', + help='Branch name to build') + parser.add_option('-B', '--bloat', dest='show_bloat', + action='store_true', default=False, + help='Show changes in function code size for each board') + parser.add_option('-c', '--count', dest='count', type='int', + default=-1, help='Run build on the top n commits') + parser.add_option('-C', '--force-reconfig', dest='force_reconfig', + action='store_true', default=False, + help='Reconfigure for every commit (disable incremental build)') + parser.add_option('-d', '--detail', dest='show_detail', + action='store_true', default=False, + help='Show detailed information for each board in summary') + parser.add_option('-e', '--show_errors', action='store_true', + default=False, help='Show errors and warnings') + parser.add_option('-f', '--force-build', dest='force_build', + action='store_true', default=False, + help='Force build of boards even if already built') + parser.add_option('-F', '--force-build-failures', dest='force_build_failures', + action='store_true', default=False, + help='Force build of previously-failed build') + parser.add_option('-g', '--git', type='string', + help='Git repo containing branch to build', default='.') + parser.add_option('-G', '--config-file', type='string', + help='Path to buildman config file', default='') + parser.add_option('-H', '--full-help', action='store_true', dest='full_help', + default=False, help='Display the README file') + parser.add_option('-i', '--in-tree', dest='in_tree', + action='store_true', default=False, + help='Build in the source tree instead of a separate directory') + parser.add_option('-j', '--jobs', dest='jobs', type='int', + default=None, help='Number of jobs to run at once (passed to make)') + parser.add_option('-k', '--keep-outputs', action='store_true', + default=False, help='Keep all build output files (e.g. binaries)') + parser.add_option('-l', '--list-error-boards', action='store_true', + default=False, help='Show a list of boards next to each error/warning') + parser.add_option('--list-tool-chains', action='store_true', default=False, + help='List available tool chains') + parser.add_option('-n', '--dry-run', action='store_true', dest='dry_run', + default=False, help="Do a dry run (describe actions, but do nothing)") + parser.add_option('-o', '--output-dir', type='string', + dest='output_dir', default='..', + help='Directory where all builds happen and buildman has its workspace (default is ../)') + parser.add_option('-Q', '--quick', action='store_true', + default=False, help='Do a rough build, with limited warning resolution') + parser.add_option('-s', '--summary', action='store_true', + default=False, help='Show a build summary') + parser.add_option('-S', '--show-sizes', action='store_true', + default=False, help='Show image size variation in summary') + parser.add_option('--step', type='int', + default=1, help='Only build every n commits (0=just first and last)') + parser.add_option('-t', '--test', action='store_true', dest='test', + default=False, help='run tests') + parser.add_option('-T', '--threads', type='int', + default=None, help='Number of builder threads to use') + parser.add_option('-u', '--show_unknown', action='store_true', + default=False, help='Show boards with unknown build result') + parser.add_option('-v', '--verbose', action='store_true', + default=False, help='Show build results while the build progresses') + parser.add_option('-x', '--exclude', dest='exclude', + type='string', action='append', + help='Specify a list of boards to exclude, separated by comma') + + parser.usage += """ + + Build U-Boot for all commits in a branch. Use -n to do a dry run""" + + return parser.parse_args() diff --git a/tools/buildman/control.py b/tools/buildman/control.py index 68ea961876..e97350f9a0 100644 --- a/tools/buildman/control.py +++ b/tools/buildman/control.py @@ -5,6 +5,7 @@ import multiprocessing import os +import shutil import sys import board @@ -13,6 +14,7 @@ from builder import Builder import gitutil import patchstream import terminal +from terminal import Print import toolchain import command import subprocess @@ -77,24 +79,44 @@ def ShowActions(series, why_selected, boards_selected, builder, options): print ('Total boards to build for each commit: %d\n' % why_selected['all']) -def DoBuildman(options, args): +def DoBuildman(options, args, toolchains=None, make_func=None, boards=None, + clean_dir=False): """The main control code for buildman Args: options: Command line options object args: Command line arguments (list of strings) + toolchains: Toolchains to use - this should be a Toolchains() + object. If None, then it will be created and scanned + make_func: Make function to use for the builder. This is called + to execute 'make'. If this is None, the normal function + will be used, which calls the 'make' tool with suitable + arguments. This setting is useful for tests. + board: Boards() object to use, containing a list of available + boards. If this is None it will be created and scanned. """ + global builder + + if options.full_help: + pager = os.getenv('PAGER') + if not pager: + pager = 'more' + fname = os.path.join(os.path.dirname(sys.argv[0]), 'README') + command.Run(pager, fname) + return 0 + gitutil.Setup() - bsettings.Setup(options.config_file) options.git_dir = os.path.join(options.git, '.git') - toolchains = toolchain.Toolchains() - toolchains.Scan(options.list_tool_chains) + if not toolchains: + toolchains = toolchain.Toolchains() + toolchains.GetSettings() + toolchains.Scan(options.list_tool_chains) if options.list_tool_chains: toolchains.List() print - return + return 0 # Work out how many commits to build. We want to build everything on the # branch. We also build the upstream commit as a control so we can see @@ -119,15 +141,22 @@ def DoBuildman(options, args): sys.exit(col.Color(col.RED, str)) # Work out what subset of the boards we are building - board_file = os.path.join(options.git, 'boards.cfg') - status = subprocess.call([os.path.join(options.git, - 'tools/genboardscfg.py')]) - if status != 0: - sys.exit("Failed to generate boards.cfg") - - boards = board.Boards() - boards.ReadBoards(os.path.join(options.git, 'boards.cfg')) - why_selected = boards.SelectBoards(args) + if not boards: + board_file = os.path.join(options.git, 'boards.cfg') + status = subprocess.call([os.path.join(options.git, + 'tools/genboardscfg.py')]) + if status != 0: + sys.exit("Failed to generate boards.cfg") + + boards = board.Boards() + boards.ReadBoards(os.path.join(options.git, 'boards.cfg')) + + exclude = [] + if options.exclude: + for arg in options.exclude: + exclude += arg.split(',') + + why_selected = boards.SelectBoards(args, exclude) selected = boards.GetSelected() if not len(selected): sys.exit(col.Color(col.RED, 'No matching boards found')) @@ -137,6 +166,10 @@ def DoBuildman(options, args): # upstream/master~..branch but that isn't possible if upstream/master is # a merge commit (it will list all the commits that form part of the # merge) + # Conflicting tags are not a problem for buildman, since it does not use + # them. For example, Series-version is not useful for buildman. On the + # other hand conflicting tags will cause an error. So allow later tags + # to overwrite earlier ones by setting allow_overwrite=True if options.branch: if count == -1: range_expr = gitutil.GetRangeInBranch(options.git_dir, @@ -144,19 +177,14 @@ def DoBuildman(options, args): upstream_commit = gitutil.GetUpstream(options.git_dir, options.branch) series = patchstream.GetMetaDataForList(upstream_commit, - options.git_dir, 1) + options.git_dir, 1, series=None, allow_overwrite=True) - # Conflicting tags are not a problem for buildman, since it does - # not use them. For example, Series-version is not useful for - # buildman. On the other hand conflicting tags will cause an - # error. So allow later tags to overwrite earlier ones. - series.allow_overwrite = True series = patchstream.GetMetaDataForList(range_expr, - options.git_dir, None, series) + options.git_dir, None, series, allow_overwrite=True) else: # Honour the count series = patchstream.GetMetaDataForList(options.branch, - options.git_dir, count) + options.git_dir, count, series=None, allow_overwrite=True) else: series = None options.verbose = True @@ -180,14 +208,18 @@ def DoBuildman(options, args): # Create a new builder with the selected options if options.branch: - dirname = options.branch + dirname = options.branch.replace('/', '_') else: dirname = 'current' output_dir = os.path.join(options.output_dir, dirname) + if clean_dir and os.path.exists(output_dir): + shutil.rmtree(output_dir) builder = Builder(toolchains, output_dir, options.git_dir, options.threads, options.jobs, gnu_make=gnu_make, checkout=True, show_unknown=options.show_unknown, step=options.step) builder.force_config_on_failure = not options.quick + if make_func: + builder.do_make = make_func # For a dry run, just show our actions as a sanity check if options.dry_run: @@ -203,19 +235,28 @@ def DoBuildman(options, args): if series: commits = series.commits + # Number the commits for test purposes + for commit in range(len(commits)): + commits[commit].sequence = commit else: commits = None - print GetActionSummary(options.summary, commits, board_selected, - options) + Print(GetActionSummary(options.summary, commits, board_selected, + options)) builder.SetDisplayOptions(options.show_errors, options.show_sizes, - options.show_detail, options.show_bloat) + options.show_detail, options.show_bloat, + options.list_error_boards) if options.summary: # We can't show function sizes without board details at present if options.show_bloat: options.show_detail = True builder.ShowSummary(commits, board_selected) else: - builder.BuildBoards(commits, board_selected, + fail, warned = builder.BuildBoards(commits, board_selected, options.keep_outputs, options.verbose) + if fail: + return 128 + elif warned: + return 129 + return 0 diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py new file mode 100644 index 0000000000..75eb3a97bb --- /dev/null +++ b/tools/buildman/func_test.py @@ -0,0 +1,519 @@ +# +# Copyright (c) 2014 Google, Inc +# +# SPDX-License-Identifier: GPL-2.0+ +# + +import os +import shutil +import sys +import tempfile +import unittest + +import board +import bsettings +import cmdline +import command +import control +import gitutil +import terminal +import toolchain + +settings_data = ''' +# Buildman settings file + +[toolchain] + +[toolchain-alias] + +[make-flags] +src=/home/sjg/c/src +chroot=/home/sjg/c/chroot +vboot=USE_STDINT=1 VBOOT_DEBUG=1 MAKEFLAGS_VBOOT=DEBUG=1 CFLAGS_EXTRA_VBOOT=-DUNROLL_LOOPS VBOOT_SOURCE=${src}/platform/vboot_reference +chromeos_coreboot=VBOOT=${chroot}/build/link/usr ${vboot} +chromeos_daisy=VBOOT=${chroot}/build/daisy/usr ${vboot} +chromeos_peach=VBOOT=${chroot}/build/peach_pit/usr ${vboot} +''' + +boards = [ + ['Active', 'arm', 'armv7', '', 'Tester', 'ARM Board 1', 'board0', ''], + ['Active', 'arm', 'armv7', '', 'Tester', 'ARM Board 2', 'board1', ''], + ['Active', 'powerpc', 'powerpc', '', 'Tester', 'PowerPC board 1', 'board2', ''], + ['Active', 'powerpc', 'mpc5xx', '', 'Tester', 'PowerPC board 2', 'board3', ''], + ['Active', 'sandbox', 'sandbox', '', 'Tester', 'Sandbox board', 'board4', ''], +] + +commit_shortlog = """4aca821 patman: Avoid changing the order of tags +39403bb patman: Use --no-pager' to stop git from forking a pager +db6e6f2 patman: Remove the -a option +f2ccf03 patman: Correct unit tests to run correctly +1d097f9 patman: Fix indentation in terminal.py +d073747 patman: Support the 'reverse' option for 'git log +""" + +commit_log = ["""commit 7f6b8315d18f683c5181d0c3694818c1b2a20dcd +Author: Masahiro Yamada <yamada.m@jp.panasonic.com> +Date: Fri Aug 22 19:12:41 2014 +0900 + + buildman: refactor help message + + "buildman [options]" is displayed by default. + + Append the rest of help messages to parser.usage + instead of replacing it. + + Besides, "-b <branch>" is not mandatory since commit fea5858e. + Drop it from the usage. + + Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> +""", +"""commit d0737479be6baf4db5e2cdbee123e96bc5ed0ba8 +Author: Simon Glass <sjg@chromium.org> +Date: Thu Aug 14 16:48:25 2014 -0600 + + patman: Support the 'reverse' option for 'git log' + + This option is currently not supported, but needs to be, for buildman to + operate as expected. + + Series-changes: 7 + - Add new patch to fix the 'reverse' bug + + Series-version: 8 + + Change-Id: I79078f792e8b390b8a1272a8023537821d45feda + Reported-by: York Sun <yorksun@freescale.com> + Signed-off-by: Simon Glass <sjg@chromium.org> + +""", +"""commit 1d097f9ab487c5019152fd47bda126839f3bf9fc +Author: Simon Glass <sjg@chromium.org> +Date: Sat Aug 9 11:44:32 2014 -0600 + + patman: Fix indentation in terminal.py + + This code came from a different project with 2-character indentation. Fix + it for U-Boot. + + Series-changes: 6 + - Add new patch to fix indentation in teminal.py + + Change-Id: I5a74d2ebbb3cc12a665f5c725064009ac96e8a34 + Signed-off-by: Simon Glass <sjg@chromium.org> + +""", +"""commit f2ccf03869d1e152c836515a3ceb83cdfe04a105 +Author: Simon Glass <sjg@chromium.org> +Date: Sat Aug 9 11:08:24 2014 -0600 + + patman: Correct unit tests to run correctly + + It seems that doctest behaves differently now, and some of the unit tests + do not run. Adjust the tests to work correctly. + + ./tools/patman/patman --test + <unittest.result.TestResult run=10 errors=0 failures=0> + + Series-changes: 6 + - Add new patch to fix patman unit tests + + Change-Id: I3d2ca588f4933e1f9d6b1665a00e4ae58269ff3b + +""", +"""commit db6e6f2f9331c5a37647d6668768d4a40b8b0d1c +Author: Simon Glass <sjg@chromium.org> +Date: Sat Aug 9 12:06:02 2014 -0600 + + patman: Remove the -a option + + It seems that this is no longer needed, since checkpatch.pl will catch + whitespace problems in patches. Also the option is not widely used, so + it seems safe to just remove it. + + Series-changes: 6 + - Add new patch to remove patman's -a option + + Suggested-by: Masahiro Yamada <yamada.m@jp.panasonic.com> + Change-Id: I5821a1c75154e532c46513486ca40b808de7e2cc + +""", +"""commit 39403bb4f838153028a6f21ca30bf100f3791133 +Author: Simon Glass <sjg@chromium.org> +Date: Thu Aug 14 21:50:52 2014 -0600 + + patman: Use --no-pager' to stop git from forking a pager + +""", +"""commit 4aca821e27e97925c039e69fd37375b09c6f129c +Author: Simon Glass <sjg@chromium.org> +Date: Fri Aug 22 15:57:39 2014 -0600 + + patman: Avoid changing the order of tags + + patman collects tags that it sees in the commit and places them nicely + sorted at the end of the patch. However, this is not really necessary and + in fact is apparently not desirable. + + Series-changes: 9 + - Add new patch to avoid changing the order of tags + + Series-version: 9 + + Suggested-by: Masahiro Yamada <yamada.m@jp.panasonic.com> + Change-Id: Ib1518588c1a189ad5c3198aae76f8654aed8d0db +"""] + +TEST_BRANCH = '__testbranch' + +class TestFunctional(unittest.TestCase): + """Functional test for buildman. + + This aims to test from just below the invocation of buildman (parsing + of arguments) to 'make' and 'git' invocation. It is not a true + emd-to-end test, as it mocks git, make and the tool chain. But this + makes it easier to detect when the builder is doing the wrong thing, + since in many cases this test code will fail. For example, only a + very limited subset of 'git' arguments is supported - anything + unexpected will fail. + """ + def setUp(self): + self._base_dir = tempfile.mkdtemp() + self._git_dir = os.path.join(self._base_dir, 'src') + self._buildman_pathname = sys.argv[0] + self._buildman_dir = os.path.dirname(sys.argv[0]) + command.test_result = self._HandleCommand + self.setupToolchains() + self._toolchains.Add('arm-gcc', test=False) + self._toolchains.Add('powerpc-gcc', test=False) + bsettings.Setup(None) + bsettings.AddFile(settings_data) + self._boards = board.Boards() + for brd in boards: + self._boards.AddBoard(board.Board(*brd)) + + # Directories where the source been cloned + self._clone_dirs = [] + self._commits = len(commit_shortlog.splitlines()) + 1 + self._total_builds = self._commits * len(boards) + + # Number of calls to make + self._make_calls = 0 + + # Map of [board, commit] to error messages + self._error = {} + + self._test_branch = TEST_BRANCH + + # Avoid sending any output and clear all terminal output + terminal.SetPrintTestMode() + terminal.GetPrintTestLines() + + def tearDown(self): + shutil.rmtree(self._base_dir) + + def setupToolchains(self): + self._toolchains = toolchain.Toolchains() + self._toolchains.Add('gcc', test=False) + + def _RunBuildman(self, *args): + return command.RunPipe([[self._buildman_pathname] + list(args)], + capture=True, capture_stderr=True) + + def _RunControl(self, *args, **kwargs): + sys.argv = [sys.argv[0]] + list(args) + options, args = cmdline.ParseArgs() + result = control.DoBuildman(options, args, toolchains=self._toolchains, + make_func=self._HandleMake, boards=self._boards, + clean_dir=kwargs.get('clean_dir', True)) + self._builder = control.builder + return result + + def testFullHelp(self): + command.test_result = None + result = self._RunBuildman('-H') + help_file = os.path.join(self._buildman_dir, 'README') + self.assertEqual(len(result.stdout), os.path.getsize(help_file)) + self.assertEqual(0, len(result.stderr)) + self.assertEqual(0, result.return_code) + + def testHelp(self): + command.test_result = None + result = self._RunBuildman('-h') + help_file = os.path.join(self._buildman_dir, 'README') + self.assertTrue(len(result.stdout) > 1000) + self.assertEqual(0, len(result.stderr)) + self.assertEqual(0, result.return_code) + + def testGitSetup(self): + """Test gitutils.Setup(), from outside the module itself""" + command.test_result = command.CommandResult(return_code=1) + gitutil.Setup() + self.assertEqual(gitutil.use_no_decorate, False) + + command.test_result = command.CommandResult(return_code=0) + gitutil.Setup() + self.assertEqual(gitutil.use_no_decorate, True) + + def _HandleCommandGitLog(self, args): + if '-n0' in args: + return command.CommandResult(return_code=0) + elif args[-1] == 'upstream/master..%s' % self._test_branch: + return command.CommandResult(return_code=0, stdout=commit_shortlog) + elif args[:3] == ['--no-color', '--no-decorate', '--reverse']: + if args[-1] == self._test_branch: + count = int(args[3][2:]) + return command.CommandResult(return_code=0, + stdout=''.join(commit_log[:count])) + + # Not handled, so abort + print 'git log', args + sys.exit(1) + + def _HandleCommandGitConfig(self, args): + config = args[0] + if config == 'sendemail.aliasesfile': + return command.CommandResult(return_code=0) + elif config.startswith('branch.badbranch'): + return command.CommandResult(return_code=1) + elif config == 'branch.%s.remote' % self._test_branch: + return command.CommandResult(return_code=0, stdout='upstream\n') + elif config == 'branch.%s.merge' % self._test_branch: + return command.CommandResult(return_code=0, + stdout='refs/heads/master\n') + + # Not handled, so abort + print 'git config', args + sys.exit(1) + + def _HandleCommandGit(self, in_args): + """Handle execution of a git command + + This uses a hacked-up parser. + + Args: + in_args: Arguments after 'git' from the command line + """ + git_args = [] # Top-level arguments to git itself + sub_cmd = None # Git sub-command selected + args = [] # Arguments to the git sub-command + for arg in in_args: + if sub_cmd: + args.append(arg) + elif arg[0] == '-': + git_args.append(arg) + else: + if git_args and git_args[-1] in ['--git-dir', '--work-tree']: + git_args.append(arg) + else: + sub_cmd = arg + if sub_cmd == 'config': + return self._HandleCommandGitConfig(args) + elif sub_cmd == 'log': + return self._HandleCommandGitLog(args) + elif sub_cmd == 'clone': + return command.CommandResult(return_code=0) + elif sub_cmd == 'checkout': + return command.CommandResult(return_code=0) + + # Not handled, so abort + print 'git', git_args, sub_cmd, args + sys.exit(1) + + def _HandleCommandNm(self, args): + return command.CommandResult(return_code=0) + + def _HandleCommandObjdump(self, args): + return command.CommandResult(return_code=0) + + def _HandleCommandSize(self, args): + return command.CommandResult(return_code=0) + + def _HandleCommand(self, **kwargs): + """Handle a command execution. + + The command is in kwargs['pipe-list'], as a list of pipes, each a + list of commands. The command should be emulated as required for + testing purposes. + + Returns: + A CommandResult object + """ + pipe_list = kwargs['pipe_list'] + wc = False + if len(pipe_list) != 1: + if pipe_list[1] == ['wc', '-l']: + wc = True + else: + print 'invalid pipe', kwargs + sys.exit(1) + cmd = pipe_list[0][0] + args = pipe_list[0][1:] + result = None + if cmd == 'git': + result = self._HandleCommandGit(args) + elif cmd == './scripts/show-gnu-make': + return command.CommandResult(return_code=0, stdout='make') + elif cmd.endswith('nm'): + return self._HandleCommandNm(args) + elif cmd.endswith('objdump'): + return self._HandleCommandObjdump(args) + elif cmd.endswith( 'size'): + return self._HandleCommandSize(args) + + if not result: + # Not handled, so abort + print 'unknown command', kwargs + sys.exit(1) + + if wc: + result.stdout = len(result.stdout.splitlines()) + return result + + def _HandleMake(self, commit, brd, stage, cwd, *args, **kwargs): + """Handle execution of 'make' + + Args: + commit: Commit object that is being built + brd: Board object that is being built + stage: Stage that we are at (mrproper, config, build) + cwd: Directory where make should be run + args: Arguments to pass to make + kwargs: Arguments to pass to command.RunPipe() + """ + self._make_calls += 1 + if stage == 'mrproper': + return command.CommandResult(return_code=0) + elif stage == 'config': + return command.CommandResult(return_code=0, + combined='Test configuration complete') + elif stage == 'build': + stderr = '' + if type(commit) is not str: + stderr = self._error.get((brd.target, commit.sequence)) + if stderr: + return command.CommandResult(return_code=1, stderr=stderr) + return command.CommandResult(return_code=0) + + # Not handled, so abort + print 'make', stage + sys.exit(1) + + # Example function to print output lines + def print_lines(self, lines): + print len(lines) + for line in lines: + print line + #self.print_lines(terminal.GetPrintTestLines()) + + def testNoBoards(self): + """Test that buildman aborts when there are no boards""" + self._boards = board.Boards() + with self.assertRaises(SystemExit): + self._RunControl() + + def testCurrentSource(self): + """Very simple test to invoke buildman on the current source""" + self.setupToolchains(); + self._RunControl() + lines = terminal.GetPrintTestLines() + self.assertIn('Building current source for %d boards' % len(boards), + lines[0].text) + + def testBadBranch(self): + """Test that we can detect an invalid branch""" + with self.assertRaises(ValueError): + self._RunControl('-b', 'badbranch') + + def testBadToolchain(self): + """Test that missing toolchains are detected""" + self.setupToolchains(); + ret_code = self._RunControl('-b', TEST_BRANCH) + lines = terminal.GetPrintTestLines() + + # Buildman always builds the upstream commit as well + self.assertIn('Building %d commits for %d boards' % + (self._commits, len(boards)), lines[0].text) + self.assertEqual(self._builder.count, self._total_builds) + + # Only sandbox should succeed, the others don't have toolchains + self.assertEqual(self._builder.fail, + self._total_builds - self._commits) + self.assertEqual(ret_code, 128) + + for commit in range(self._commits): + for board in self._boards.GetList(): + if board.arch != 'sandbox': + errfile = self._builder.GetErrFile(commit, board.target) + fd = open(errfile) + self.assertEqual(fd.readlines(), + ['No tool chain for %s\n' % board.arch]) + fd.close() + + def testBranch(self): + """Test building a branch with all toolchains present""" + self._RunControl('-b', TEST_BRANCH) + self.assertEqual(self._builder.count, self._total_builds) + self.assertEqual(self._builder.fail, 0) + + def testCount(self): + """Test building a specific number of commitst""" + self._RunControl('-b', TEST_BRANCH, '-c2') + self.assertEqual(self._builder.count, 2 * len(boards)) + self.assertEqual(self._builder.fail, 0) + # Each board has a mrproper, config, and then one make per commit + self.assertEqual(self._make_calls, len(boards) * (2 + 2)) + + def testIncremental(self): + """Test building a branch twice - the second time should do nothing""" + self._RunControl('-b', TEST_BRANCH) + + # Each board has a mrproper, config, and then one make per commit + self.assertEqual(self._make_calls, len(boards) * (self._commits + 2)) + self._make_calls = 0 + self._RunControl('-b', TEST_BRANCH, clean_dir=False) + self.assertEqual(self._make_calls, 0) + self.assertEqual(self._builder.count, self._total_builds) + self.assertEqual(self._builder.fail, 0) + + def testForceBuild(self): + """The -f flag should force a rebuild""" + self._RunControl('-b', TEST_BRANCH) + self._make_calls = 0 + self._RunControl('-b', TEST_BRANCH, '-f', clean_dir=False) + # Each board has a mrproper, config, and then one make per commit + self.assertEqual(self._make_calls, len(boards) * (self._commits + 2)) + + def testForceReconfigure(self): + """The -f flag should force a rebuild""" + self._RunControl('-b', TEST_BRANCH, '-C') + # Each commit has a mrproper, config and make + self.assertEqual(self._make_calls, len(boards) * self._commits * 3) + + def testErrors(self): + """Test handling of build errors""" + self._error['board2', 1] = 'fred\n' + self._RunControl('-b', TEST_BRANCH) + self.assertEqual(self._builder.count, self._total_builds) + self.assertEqual(self._builder.fail, 1) + + # Remove the error. This should have no effect since the commit will + # not be rebuilt + del self._error['board2', 1] + self._make_calls = 0 + self._RunControl('-b', TEST_BRANCH, clean_dir=False) + self.assertEqual(self._builder.count, self._total_builds) + self.assertEqual(self._make_calls, 0) + self.assertEqual(self._builder.fail, 1) + + # Now use the -F flag to force rebuild of the bad commit + self._RunControl('-b', TEST_BRANCH, '-F', clean_dir=False) + self.assertEqual(self._builder.count, self._total_builds) + self.assertEqual(self._builder.fail, 0) + self.assertEqual(self._make_calls, 3) + + def testBranchWithSlash(self): + """Test building a branch with a '/' in the name""" + self._test_branch = '/__dev/__testbranch' + self._RunControl('-b', self._test_branch, clean_dir=False) + self.assertEqual(self._builder.count, self._total_builds) + self.assertEqual(self._builder.fail, 0) diff --git a/tools/buildman/kconfiglib.py b/tools/buildman/kconfiglib.py new file mode 100644 index 0000000000..655cf4470f --- /dev/null +++ b/tools/buildman/kconfiglib.py @@ -0,0 +1,3799 @@ +# +# SPDX-License-Identifier: ISC +# +# Author: Ulf Magnusson +# https://github.com/ulfalizer/Kconfiglib + +# This is Kconfiglib, a Python library for scripting, debugging, and extracting +# information from Kconfig-based configuration systems. To view the +# documentation, run +# +# $ pydoc kconfiglib +# +# or, if you prefer HTML, +# +# $ pydoc -w kconfiglib +# +# The examples/ subdirectory contains examples, to be run with e.g. +# +# $ make scriptconfig SCRIPT=Kconfiglib/examples/print_tree.py +# +# Look in testsuite.py for the test suite. + +""" +Kconfiglib is a Python library for scripting and extracting information from +Kconfig-based configuration systems. Features include the following: + + - Symbol values and properties can be looked up and values assigned + programmatically. + - .config files can be read and written. + - Expressions can be evaluated in the context of a Kconfig configuration. + - Relations between symbols can be quickly determined, such as finding all + symbols that reference a particular symbol. + - Highly compatible with the scripts/kconfig/*conf utilities. The test suite + automatically compares outputs between Kconfiglib and the C implementation + for a large number of cases. + +For the Linux kernel, scripts are run using + + $ make scriptconfig SCRIPT=<path to script> [SCRIPT_ARG=<arg>] + +Running scripts via the 'scriptconfig' target ensures that required environment +variables (SRCARCH, ARCH, srctree, KERNELVERSION, etc.) are set up correctly. +Alternative architectures can be specified like for other 'make *config' +targets: + + $ make scriptconfig ARCH=mips SCRIPT=<path to script> [SCRIPT_ARG=<arg>] + +The script will receive the name of the Kconfig file to load in sys.argv[1]. +(As of Linux 3.7.0-rc8 this is always "Kconfig" from the kernel top-level +directory.) If an argument is provided with SCRIPT_ARG, it will appear in +sys.argv[2]. + +To get an interactive Python prompt with Kconfiglib preloaded and a Config +object 'c' created, use + + $ make iscriptconfig [ARCH=<architecture>] + +Kconfiglib requires Python 2. For (i)scriptconfig the command to run the Python +interpreter can be passed in the environment variable PYTHONCMD (defaults to +'python'; PyPy works too and is a bit faster). + +Look in the examples/ subdirectory for examples, which can be run with e.g. + + $ make scriptconfig SCRIPT=Kconfiglib/examples/print_tree.py + +or + + $ make scriptconfig SCRIPT=Kconfiglib/examples/help_grep.py SCRIPT_ARG="kernel" + +Look in testsuite.py for the test suite. + +Credits: Written by Ulf "Ulfalizer" Magnusson + +Send bug reports, suggestions and other feedback to kconfiglib@gmail.com . +Don't wrestle with internal APIs. Tell me what you need and I might add it in a +safe way as a client API instead.""" + +# If you have Psyco installed (32-bit installations, Python <= 2.6 only), +# setting this to True (right here, not at runtime) might give a nice speedup. +# (22% faster for parsing arch/x86/Kconfig and 58% faster for evaluating all +# symbols in it without a .config on my Core Duo.) +use_psyco = False + +import os +import re +import string +import sys + +class Config(): + + """Represents a Kconfig configuration, e.g. for i386 or ARM. This is the + set of symbols and other items appearing in the configuration together with + their values. Creating any number of Config objects -- including for + different architectures -- is safe; Kconfiglib has no global state.""" + + # + # Public interface + # + + def __init__(self, + filename = "Kconfig", + base_dir = "$srctree", + print_warnings = True, + print_undef_assign = False): + """Creates a new Config object, representing a Kconfig configuration. + Raises Kconfig_Syntax_Error on syntax errors. + + filename (default: "Kconfig") -- The base Kconfig file of the + configuration. For the Linux kernel, this should usually be be + "Kconfig" from the top-level directory, as environment + variables will make sure the right Kconfig is included from + there (usually arch/<architecture>/Kconfig). If you are using + kconfiglib via 'make scriptconfig' the filename of the + correct Kconfig will be in sys.argv[1]. + + base_dir (default: "$srctree") -- The base directory relative to which + 'source' statements within Kconfig files will work. For the + Linux kernel this should be the top-level directory of the + kernel tree. $-references to environment variables will be + expanded. + + The environment variable 'srctree' is set by the Linux makefiles + to the top-level kernel directory. A default of "." would not + work if an alternative build directory is used. + + print_warnings (default: True) -- Set to True if warnings related to + this configuration should be printed to stderr. This can + be changed later with Config.set_print_warnings(). It is + provided as a constructor argument since warnings might + be generated during parsing. + + print_undef_assign (default: False) -- Set to True if informational + messages related to assignments to undefined symbols + should be printed to stderr for this configuration. + Can be changed later with + Config.set_print_undef_assign().""" + + # The set of all symbols, indexed by name (a string) + self.syms = {} + + # The set of all defined symbols in the configuration in the order they + # appear in the Kconfig files. This excludes the special symbols n, m, + # and y as well as symbols that are referenced but never defined. + self.kconfig_syms = [] + + # The set of all named choices (yes, choices can have names), indexed + # by name (a string) + self.named_choices = {} + + def register_special_symbol(type, name, value): + sym = Symbol() + sym.is_special_ = True + sym.is_defined_ = True + sym.config = self + sym.name = name + sym.type = type + sym.cached_value = value + self.syms[name] = sym + return sym + + # The special symbols n, m and y, used as shorthand for "n", "m" and + # "y" + self.n = register_special_symbol(TRISTATE, "n", "n") + self.m = register_special_symbol(TRISTATE, "m", "m") + self.y = register_special_symbol(TRISTATE, "y", "y") + + # DEFCONFIG_LIST uses this + register_special_symbol(STRING, "UNAME_RELEASE", os.uname()[2]) + + # The symbol with "option defconfig_list" set, containing a list of + # default .config files + self.defconfig_sym = None + + # See Symbol.get_(src)arch() + self.arch = os.environ.get("ARCH") + self.srcarch = os.environ.get("SRCARCH") + + # See Config.__init__(). We need this for get_defconfig_filename(). + self.srctree = os.environ.get("srctree") + if self.srctree is None: + self.srctree = "." + + self.filename = filename + self.base_dir = _strip_trailing_slash(os.path.expandvars(base_dir)) + + # The 'mainmenu' text + self.mainmenu_text = None + + # The filename of the most recently loaded .config file + self.config_filename = None + + # The textual header of the most recently loaded .config, uncommented + self.config_header = None + + self.print_warnings = print_warnings + self.print_undef_assign = print_undef_assign + + # Lists containing all choices, menus and comments in the configuration + + self.choices = [] + self.menus = [] + self.comments = [] + + # For parsing routines that stop when finding a line belonging to a + # different construct, these holds that line and the tokenized version + # of that line. The purpose is to avoid having to re-tokenize the line, + # which is inefficient and causes problems when recording references to + # symbols. + self.end_line = None + self.end_line_tokens = None + + # See the comment in _parse_expr(). + self.parse_expr_cur_sym_or_choice = None + self.parse_expr_line = None + self.parse_expr_filename = None + self.parse_expr_linenr = None + self.parse_expr_transform_m = None + + # Parse the Kconfig files + self.top_block = self._parse_file(filename, None, None, None) + + # Build Symbol.dep for all symbols + self._build_dep() + + def load_config(self, filename, replace = True): + """Loads symbol values from a file in the familiar .config format. + Equivalent to calling Symbol.set_user_value() to set each of the + values. + + filename -- The .config file to load. $-references to environment + variables will be expanded. For scripts to work even + when an alternative build directory is used with the + Linux kernel, you need to refer to the top-level kernel + directory with "$srctree". + + replace (default: True) -- True if the configuration should replace + the old configuration; False if it should add to it.""" + + def warn_override(filename, linenr, name, old_user_val, new_user_val): + self._warn("overriding the value of {0}. " + 'Old value: "{1}", new value: "{2}".' + .format(name, old_user_val, new_user_val), + filename, + linenr) + + filename = os.path.expandvars(filename) + + # Put this first so that a missing file doesn't screw up our state + line_feeder = _FileFeed(_get_lines(filename), filename) + + self.config_filename = filename + + # Invalidate everything. This is usually faster than finding the + # minimal set of symbols that needs to be invalidated, as nearly all + # symbols will tend to be affected anyway. + if replace: + self.unset_user_values() + else: + self._invalidate_all() + + # Read header + + self.config_header = None + + def is_header_line(line): + return line.startswith("#") and \ + not unset_re.match(line) + + first_line = line_feeder.get_next() + + if first_line is None: + return + + if not is_header_line(first_line): + line_feeder.go_back() + else: + self.config_header = first_line[1:] + + # Read remaining header lines + while 1: + line = line_feeder.get_next() + + if line is None: + break + + if not is_header_line(line): + line_feeder.go_back() + break + + self.config_header += line[1:] + + # Remove trailing newline + if self.config_header.endswith("\n"): + self.config_header = self.config_header[:-1] + + # Read assignments + + filename = line_feeder.get_filename() + + while 1: + line = line_feeder.get_next() + if line is None: + return + + linenr = line_feeder.get_linenr() + + line = line.strip() + + set_re_match = set_re.match(line) + if set_re_match: + name, val = set_re_match.groups() + # The unescaping producedure below should be safe since " can + # only appear as \" inside the string + val = _strip_quotes(val, line, filename, linenr)\ + .replace('\\"', '"').replace("\\\\", "\\") + if name in self.syms: + sym = self.syms[name] + + old_user_val = sym.user_val + if old_user_val is not None: + warn_override(filename, linenr, name, old_user_val, val) + + if sym.is_choice_symbol_: + user_mode = sym.parent.user_mode + if user_mode is not None and user_mode != val: + self._warn("assignment to {0} changes mode of containing " + 'choice from "{1}" to "{2}".' + .format(name, val, user_mode), + filename, + linenr) + + sym._set_user_value_no_invalidate(val, True) + + else: + self._undef_assign('attempt to assign the value "{0}" to the ' + "undefined symbol {1}." + .format(val, name), + filename, + linenr) + + else: + unset_re_match = unset_re.match(line) + if unset_re_match: + name = unset_re_match.group(1) + if name in self.syms: + sym = self.syms[name] + + old_user_val = sym.user_val + if old_user_val is not None: + warn_override(filename, linenr, name, old_user_val, "n") + + sym._set_user_value_no_invalidate("n", True) + + def write_config(self, filename, header = None): + """Writes out symbol values in the familiar .config format. + + filename -- The filename under which to save the configuration. + + header (default: None) -- A textual header that will appear at the + beginning of the file, with each line commented out + automatically. None means no header.""" + + # already_written is set when _make_conf() is called on a symbol, so + # that symbols defined in multiple locations only get one entry in the + # .config. We need to reset it prior to writing out a new .config. + for sym in self.syms.itervalues(): + sym.already_written = False + + with open(filename, "w") as f: + # Write header + if header is not None: + f.write(_comment(header)) + f.write("\n") + + # Write configuration. + # (You'd think passing a list around to all the nodes and appending + # to it to avoid copying would be faster, but it's actually a lot + # slower with PyPy, and about as fast with Python. Passing the file + # around is slower too.) + f.write("\n".join(self.top_block._make_conf())) + f.write("\n") + + def get_kconfig_filename(self): + """Returns the name of the (base) kconfig file this configuration was + loaded from.""" + return self.filename + + def get_arch(self): + """Returns the value the environment variable ARCH had at the time the + Config instance was created, or None if ARCH was not set. For the + kernel, this corresponds to the architecture being built for, with + values such as "i386" or "mips".""" + return self.arch + + def get_srcarch(self): + """Returns the value the environment variable SRCARCH had at the time + the Config instance was created, or None if SRCARCH was not set. For + the kernel, this corresponds to the arch/ subdirectory containing + architecture-specific source code.""" + return self.srcarch + + def get_srctree(self): + """Returns the value the environment variable srctree had at the time + the Config instance was created, or None if srctree was not defined. + This variable points to the source directory and is used when building + in a separate directory.""" + return self.srctree + + def get_config_filename(self): + """Returns the name of the most recently loaded configuration file, or + None if no configuration has been loaded.""" + return self.config_filename + + def get_mainmenu_text(self): + """Returns the text of the 'mainmenu' statement (with $-references to + symbols replaced by symbol values), or None if the configuration has no + 'mainmenu' statement.""" + return None if self.mainmenu_text is None else \ + self._expand_sym_refs(self.mainmenu_text) + + def get_defconfig_filename(self): + """Returns the name of the defconfig file, which is the first existing + file in the list given in a symbol having 'option defconfig_list' set. + $-references to symbols will be expanded ("$FOO bar" -> "foo bar" if + FOO has the value "foo"). Returns None in case of no defconfig file. + Setting 'option defconfig_list' on multiple symbols currently results + in undefined behavior. + + If the environment variable 'srctree' was set when the Config was + created, get_defconfig_filename() will first look relative to that + directory before looking in the current directory; see + Config.__init__().""" + + if self.defconfig_sym is None: + return None + + for (filename, cond_expr) in self.defconfig_sym.def_exprs: + if self._eval_expr(cond_expr) == "y": + filename = self._expand_sym_refs(filename) + + # We first look in $srctree. os.path.join() won't work here as + # an absolute path in filename would override $srctree. + srctree_filename = os.path.normpath(self.srctree + "/" + filename) + if os.path.exists(srctree_filename): + return srctree_filename + + if os.path.exists(filename): + return filename + + return None + + def get_symbol(self, name): + """Returns the symbol with name 'name', or None if no such symbol + appears in the configuration. An alternative shorthand is conf[name], + where conf is a Config instance, though that will instead raise + KeyError if the symbol does not exist.""" + return self.syms.get(name) + + def get_top_level_items(self): + """Returns a list containing the items (symbols, menus, choice + statements and comments) at the top level of the configuration -- that + is, all items that do not appear within a menu or choice. The items + appear in the same order as within the configuration.""" + return self.top_block.get_items() + + def get_symbols(self, all_symbols = True): + """Returns a list of symbols from the configuration. An alternative for + iterating over all defined symbols (in the order of definition) is + + for sym in config: + ... + + which relies on Config implementing __iter__() and is equivalent to + + for sym in config.get_symbols(False): + ... + + all_symbols (default: True) -- If True, all symbols - including special + and undefined symbols - will be included in the result, in + an undefined order. If False, only symbols actually defined + and not merely referred to in the configuration will be + included in the result, and will appear in the order that + they are defined within the Kconfig configuration files.""" + return self.syms.values() if all_symbols else self.kconfig_syms + + def get_choices(self): + """Returns a list containing all choice statements in the + configuration, in the order they appear in the Kconfig files.""" + return self.choices + + def get_menus(self): + """Returns a list containing all menus in the configuration, in the + order they appear in the Kconfig files.""" + return self.menus + + def get_comments(self): + """Returns a list containing all comments in the configuration, in the + order they appear in the Kconfig files.""" + return self.comments + + def eval(self, s): + """Returns the value of the expression 's' -- where 's' is represented + as a string -- in the context of the configuration. Raises + Kconfig_Syntax_Error if syntax errors are detected in 's'. + + For example, if FOO and BAR are tristate symbols at least one of which + has the value "y", then config.eval("y && (FOO || BAR)") => "y" + + This functions always yields a tristate value. To get the value of + non-bool, non-tristate symbols, use Symbol.get_value(). + + The result of this function is consistent with how evaluation works for + conditional expressions in the configuration as well as in the C + implementation. "m" and m are rewritten as '"m" && MODULES' and 'm && + MODULES', respectively, and a result of "m" will get promoted to "y" if + we're running without modules.""" + return self._eval_expr(self._parse_expr(self._tokenize(s, True), # Feed + None, # Current symbol or choice + s)) # line + + def get_config_header(self): + """Returns the (uncommented) textual header of the .config file most + recently loaded with load_config(). Returns None if no .config file has + been loaded or if the most recently loaded .config file has no header. + The header comprises all lines up to but not including the first line + that either + + 1. Does not start with "#" + 2. Has the form "# CONFIG_FOO is not set." + """ + return self.config_header + + def get_base_dir(self): + """Returns the base directory relative to which 'source' statements + will work, passed as an argument to Config.__init__().""" + return self.base_dir + + def set_print_warnings(self, print_warnings): + """Determines whether warnings related to this configuration (for + things like attempting to assign illegal values to symbols with + Symbol.set_user_value()) should be printed to stderr. + + print_warnings -- True if warnings should be + printed, otherwise False.""" + self.print_warnings = print_warnings + + def set_print_undef_assign(self, print_undef_assign): + """Determines whether informational messages related to assignments to + undefined symbols should be printed to stderr for this configuration. + + print_undef_assign -- If True, such messages will be printed.""" + self.print_undef_assign = print_undef_assign + + def __getitem__(self, key): + """Returns the symbol with name 'name'. Raises KeyError if the symbol + does not appear in the configuration.""" + return self.syms[key] + + def __iter__(self): + """Convenience function for iterating over the set of all defined + symbols in the configuration, used like + + for sym in conf: + ... + + The iteration happens in the order of definition within the Kconfig + configuration files. Symbols only referred to but not defined will not + be included, nor will the special symbols n, m, and y. If you want to + include such symbols as well, see config.get_symbols().""" + return iter(self.kconfig_syms) + + def unset_user_values(self): + """Resets the values of all symbols, as if Config.load_config() or + Symbol.set_user_value() had never been called.""" + for sym in self.syms.itervalues(): + sym._unset_user_value_no_recursive_invalidate() + + def __str__(self): + """Returns a string containing various information about the Config.""" + return _sep_lines("Configuration", + "File : " + self.filename, + "Base directory : " + self.base_dir, + "Value of $ARCH at creation time : " + + ("(not set)" if self.arch is None else self.arch), + "Value of $SRCARCH at creation time : " + + ("(not set)" if self.srcarch is None else self.srcarch), + "Source tree (derived from $srctree;", + "defaults to '.' if $srctree isn't set) : " + self.srctree, + "Most recently loaded .config : " + + ("(no .config loaded)" if self.config_filename is None else + self.config_filename), + "Print warnings : " + + bool_str[self.print_warnings], + "Print assignments to undefined symbols : " + + bool_str[self.print_undef_assign]) + + + # + # Private methods + # + + def _invalidate_all(self): + for sym in self.syms.itervalues(): + sym._invalidate() + + def _tokenize(self, + s, + for_eval = False, + filename = None, + linenr = None): + """Returns a _Feed instance containing tokens derived from the string + 's'. Registers any new symbols encountered (via _sym_lookup()). + + (I experimented with a pure regular expression implementation, but it + came out slower, less readable, and wouldn't have been as flexible.) + + for_eval -- True when parsing an expression for a call to + Config.eval(), in which case we should not treat the first + token specially nor register new symbols.""" + s = s.lstrip() + if s == "" or s[0] == "#": + return _Feed([]) + + if for_eval: + i = 0 # The current index in the string being tokenized + previous = None # The previous token seen + tokens = [] + else: + # The initial word on a line is parsed specially. Let + # command_chars = [A-Za-z0-9_]. Then + # - leading non-command_chars characters on the line are ignored, and + # - the first token consists the following one or more command_chars + # characters. + # This is why things like "----help--" are accepted. + + initial_token_match = initial_token_re.match(s) + if initial_token_match is None: + return _Feed([]) + # The current index in the string being tokenized + i = initial_token_match.end() + + keyword = keywords.get(initial_token_match.group(1)) + if keyword is None: + # We expect a keyword as the first token + _tokenization_error(s, len(s), filename, linenr) + if keyword == T_HELP: + # Avoid junk after "help", e.g. "---", being registered as a + # symbol + return _Feed([T_HELP]) + tokens = [keyword] + previous = keyword + + # _tokenize() is a hotspot during parsing, and this speeds things up a + # bit + strlen = len(s) + append = tokens.append + + # Main tokenization loop. (Handles tokens past the first one.) + while i < strlen: + # Test for an identifier/keyword preceded by whitespace first; this + # is the most common case. + id_keyword_match = id_keyword_re.match(s, i) + if id_keyword_match: + # We have an identifier or keyword. The above also stripped any + # whitespace for us. + name = id_keyword_match.group(1) + # Jump past it + i = id_keyword_match.end() + + # Keyword? + keyword = keywords.get(name) + if keyword is not None: + append(keyword) + # What would ordinarily be considered a name is treated as a + # string after certain tokens. + elif previous in string_lex: + append(name) + else: + # We're dealing with a symbol. _sym_lookup() will take care + # of allocating a new Symbol instance if it's the first + # time we see it. + sym = self._sym_lookup(name, not for_eval) + + if previous == T_CONFIG or previous == T_MENUCONFIG: + # If the previous token is T_(MENU)CONFIG + # ("(menu)config"), we're tokenizing the first line of + # a symbol definition, and should remember this as a + # location where the symbol is defined. + sym.def_locations.append((filename, linenr)) + else: + # Otherwise, it's a reference to the symbol + sym.ref_locations.append((filename, linenr)) + + append(sym) + + else: + # This restrips whitespace that could have been stripped in the + # regex above, but it's worth it since identifiers/keywords are + # more common + s = s[i:].lstrip() + if s == "": + break + strlen = len(s) + i = 0 + c = s[0] + + # String literal (constant symbol) + if c == '"' or c == "'": + i += 1 + + if "\\" in s: + # Slow path: This could probably be sped up, but it's a + # very unusual case anyway. + quote = c + value = "" + while 1: + if i >= strlen: + _tokenization_error(s, strlen, filename, + linenr) + c = s[i] + if c == quote: + break + if c == "\\": + if i + 1 >= strlen: + _tokenization_error(s, strlen, filename, + linenr) + value += s[i + 1] + i += 2 + else: + value += c + i += 1 + i += 1 + append(value) + else: + # Fast path: If the string contains no backslashes (almost + # always) we can simply look for the matching quote. + end = s.find(c, i) + if end == -1: + _tokenization_error(s, strlen, filename, linenr) + append(s[i:end]) + i = end + 1 + + elif c == "&": + if i + 1 >= strlen: + # Invalid characters are ignored + continue + if s[i + 1] != "&": + # Invalid characters are ignored + i += 1 + continue + append(T_AND) + i += 2 + + elif c == "|": + if i + 1 >= strlen: + # Invalid characters are ignored + continue + if s[i + 1] != "|": + # Invalid characters are ignored + i += 1 + continue + append(T_OR) + i += 2 + + elif c == "!": + if i + 1 >= strlen: + _tokenization_error(s, strlen, filename, linenr) + if s[i + 1] == "=": + append(T_UNEQUAL) + i += 2 + else: + append(T_NOT) + i += 1 + + elif c == "=": + append(T_EQUAL) + i += 1 + + elif c == "(": + append(T_OPEN_PAREN) + i += 1 + + elif c == ")": + append(T_CLOSE_PAREN) + i += 1 + + elif c == "#": + break + + else: + # Invalid characters are ignored + i += 1 + continue + + previous = tokens[-1] + + return _Feed(tokens) + + # + # Parsing + # + + # Expression grammar: + # + # <expr> -> <symbol> + # <symbol> '=' <symbol> + # <symbol> '!=' <symbol> + # '(' <expr> ')' + # '!' <expr> + # <expr> '&&' <expr> + # <expr> '||' <expr> + + def _parse_expr(self, + feed, + cur_sym_or_choice, + line, + filename = None, + linenr = None, + transform_m = True): + """Parse an expression from the tokens in 'feed' using a simple + top-down approach. The result has the form (<operator>, <list + containing parsed operands>). + + feed -- _Feed instance containing the tokens for the expression. + + cur_sym_or_choice -- The symbol or choice currently being parsed, or + None if we're not parsing a symbol or choice. + Used for recording references to symbols. + + line -- The line containing the expression being parsed. + + filename (default: None) -- The file containing the expression. + + linenr (default: None) -- The line number containing the expression. + + transform_m (default: False) -- Determines if 'm' should be rewritten to + 'm && MODULES' -- see + parse_val_and_cond().""" + + # Use instance variables to avoid having to pass these as arguments + # through the top-down parser in _parse_expr_2(), which is tedious and + # obfuscates the code. A profiler run shows no noticeable performance + # difference. + self.parse_expr_cur_sym_or_choice = cur_sym_or_choice + self.parse_expr_line = line + self.parse_expr_filename = filename + self.parse_expr_linenr = linenr + self.parse_expr_transform_m = transform_m + + return self._parse_expr_2(feed) + + def _parse_expr_2(self, feed): + or_terms = [self._parse_or_term(feed)] + # Keep parsing additional terms while the lookahead is '||' + while feed.check(T_OR): + or_terms.append(self._parse_or_term(feed)) + + return or_terms[0] if len(or_terms) == 1 else (OR, or_terms) + + def _parse_or_term(self, feed): + and_terms = [self._parse_factor(feed)] + # Keep parsing additional terms while the lookahead is '&&' + while feed.check(T_AND): + and_terms.append(self._parse_factor(feed)) + + return and_terms[0] if len(and_terms) == 1 else (AND, and_terms) + + def _parse_factor(self, feed): + if feed.check(T_OPEN_PAREN): + expr_parse = self._parse_expr_2(feed) + + if not feed.check(T_CLOSE_PAREN): + _parse_error(self.parse_expr_line, + "missing end parenthesis.", + self.parse_expr_filename, + self.parse_expr_linenr) + + return expr_parse + + if feed.check(T_NOT): + return (NOT, self._parse_factor(feed)) + + sym_or_string = feed.get_next() + + if not isinstance(sym_or_string, (Symbol, str)): + _parse_error(self.parse_expr_line, + "malformed expression.", + self.parse_expr_filename, + self.parse_expr_linenr) + + if self.parse_expr_cur_sym_or_choice is not None and \ + isinstance(sym_or_string, Symbol): + self.parse_expr_cur_sym_or_choice.referenced_syms.add(sym_or_string) + + next_token = feed.peek_next() + + # For conditional expressions ('depends on <expr>', '... if <expr>', + # etc.), "m" and m are rewritten to "m" && MODULES. + if next_token != T_EQUAL and next_token != T_UNEQUAL: + if self.parse_expr_transform_m and (sym_or_string is self.m or + sym_or_string == "m"): + return (AND, ["m", self._sym_lookup("MODULES")]) + return sym_or_string + + relation = EQUAL if (feed.get_next() == T_EQUAL) else UNEQUAL + sym_or_string_2 = feed.get_next() + + if self.parse_expr_cur_sym_or_choice is not None and \ + isinstance(sym_or_string_2, Symbol): + self.parse_expr_cur_sym_or_choice.referenced_syms.add(sym_or_string_2) + + if sym_or_string is self.m: + sym_or_string = "m" + + if sym_or_string_2 is self.m: + sym_or_string_2 = "m" + + return (relation, sym_or_string, sym_or_string_2) + + def _parse_file(self, filename, parent, deps, visible_if_deps, res = None): + """Parse the Kconfig file 'filename'. The result is a _Block with all + items from the file. See _parse_block() for the meaning of the + parameters.""" + line_feeder = _FileFeed(_get_lines(filename), filename) + return self._parse_block(line_feeder, None, parent, deps, visible_if_deps, res) + + def _parse_block(self, line_feeder, end_marker, parent, deps, + visible_if_deps = None, res = None): + """Parses a block, which is the contents of either a file or an if, + menu, or choice statement. The result is a _Block with the items from + the block. + + end_marker -- The token that ends the block, e.g. T_ENDIF ("endif") for + if's. None for files. + + parent -- The enclosing menu, choice or if, or None if we're at the top + level. + + deps -- Dependencies from enclosing menus, choices and if's. + + visible_if_deps (default: None) -- 'visible if' dependencies from + enclosing menus. + + res (default: None) -- The _Block to add items to. If None, a new + _Block is created to hold the items.""" + + block = _Block() if res is None else res + + filename = line_feeder.get_filename() + + while 1: + + # Do we already have a tokenized line that we determined wasn't + # part of whatever we were parsing earlier? See comment in + # Config.__init__(). + if self.end_line is not None: + assert self.end_line_tokens is not None + tokens = self.end_line_tokens + tokens.go_to_start() + + line = self.end_line + linenr = line_feeder.get_linenr() + + self.end_line = None + self.end_line_tokens = None + + else: + line = line_feeder.get_next() + if line is None: + if end_marker is not None: + raise Kconfig_Syntax_Error, ( + "Unexpected end of file {0}." + .format(line_feeder.get_filename())) + return block + + linenr = line_feeder.get_linenr() + + tokens = self._tokenize(line, False, filename, linenr) + + if tokens.is_empty(): + continue + + t0 = tokens.get_next() + + # Have we reached the end of the block? + if t0 == end_marker: + return block + + if t0 == T_CONFIG or t0 == T_MENUCONFIG: + # The tokenizer will automatically allocate a new Symbol object + # for any new names it encounters, so we don't need to worry + # about that here. + sym = tokens.get_next() + + # Symbols defined in multiple places get the parent of their + # first definition. However, for symbols whose parents are choice + # statements, the choice statement takes precedence. + if not sym.is_defined_ or isinstance(parent, Choice): + sym.parent = parent + + sym.is_defined_ = True + + self.kconfig_syms.append(sym) + block.add_item(sym) + + self._parse_properties(line_feeder, sym, deps, visible_if_deps) + + elif t0 == T_MENU: + menu = Menu() + self.menus.append(menu) + menu.config = self + menu.parent = parent + menu.title = tokens.get_next() + + menu.filename = filename + menu.linenr = linenr + + # Parse properties and contents + self._parse_properties(line_feeder, menu, deps, visible_if_deps) + menu.block = self._parse_block(line_feeder, + T_ENDMENU, + menu, + menu.dep_expr, + _make_and(visible_if_deps, + menu.visible_if_expr)) + + block.add_item(menu) + + elif t0 == T_IF: + # If statements are treated as syntactic sugar for adding + # dependencies to enclosed items and do not have an explicit + # object representation. + + dep_expr = self._parse_expr(tokens, None, line, filename, linenr) + self._parse_block(line_feeder, + T_ENDIF, + parent, + _make_and(dep_expr, deps), + visible_if_deps, + block) # Add items to the same block + + elif t0 == T_CHOICE: + # We support named choices + already_defined = False + name = None + if len(tokens) > 1 and isinstance(tokens[1], str): + name = tokens[1] + already_defined = name in self.named_choices + + if already_defined: + choice = self.named_choices[name] + else: + choice = Choice() + self.choices.append(choice) + if name is not None: + choice.name = name + self.named_choices[name] = choice + + choice.config = self + choice.parent = parent + + choice.def_locations.append((filename, linenr)) + + # Parse properties and contents + self._parse_properties(line_feeder, choice, deps, visible_if_deps) + choice.block = self._parse_block(line_feeder, + T_ENDCHOICE, + choice, + None, + visible_if_deps) + + choice._determine_actual_symbols() + + # If no type is set for the choice, its type is that of the first + # choice item + if choice.type == UNKNOWN: + for item in choice.get_symbols(): + if item.type != UNKNOWN: + choice.type = item.type + break + + # Each choice item of UNKNOWN type gets the type of the choice + for item in choice.get_symbols(): + if item.type == UNKNOWN: + item.type = choice.type + + # For named choices defined in multiple locations, only record + # at the first definition + if not already_defined: + block.add_item(choice) + + elif t0 == T_COMMENT: + comment = Comment() + comment.config = self + comment.parent = parent + + comment.filename = filename + comment.linenr = linenr + + comment.text = tokens.get_next() + self._parse_properties(line_feeder, comment, deps, visible_if_deps) + + block.add_item(comment) + self.comments.append(comment) + + elif t0 == T_SOURCE: + kconfig_file = tokens.get_next() + exp_kconfig_file = self._expand_sym_refs(kconfig_file) + f = os.path.join(self.base_dir, exp_kconfig_file) + + if not os.path.exists(f): + raise IOError, ('{0}:{1}: sourced file "{2}" (expands to\n' + '"{3}") not found. Perhaps base_dir\n' + '(argument to Config.__init__(), currently\n' + '"{4}") is set to the wrong value.' + .format(filename, + linenr, + kconfig_file, + exp_kconfig_file, + self.base_dir)) + + # Add items to the same block + self._parse_file(f, parent, deps, visible_if_deps, block) + + elif t0 == T_MAINMENU: + text = tokens.get_next() + + if self.mainmenu_text is not None: + self._warn("overriding 'mainmenu' text. " + 'Old value: "{0}", new value: "{1}".' + .format(self.mainmenu_text, text), + filename, + linenr) + + self.mainmenu_text = text + + else: + _parse_error(line, "unrecognized construct.", filename, linenr) + + def _parse_properties(self, line_feeder, stmt, deps, visible_if_deps): + """Parsing of properties for symbols, menus, choices, and comments.""" + + def parse_val_and_cond(tokens, line, filename, linenr): + """Parses '<expr1> if <expr2>' constructs, where the 'if' part is + optional. Returns a tuple containing the parsed expressions, with + None as the second element if the 'if' part is missing.""" + val = self._parse_expr(tokens, stmt, line, filename, linenr, False) + + if tokens.check(T_IF): + return (val, self._parse_expr(tokens, stmt, line, filename, linenr)) + + return (val, None) + + # In case the symbol is defined in multiple locations, we need to + # remember what prompts, defaults, and selects are new for this + # definition, as "depends on" should only apply to the local + # definition. + new_prompt = None + new_def_exprs = [] + new_selects = [] + + # Dependencies from 'depends on' statements + depends_on_expr = None + + while 1: + line = line_feeder.get_next() + if line is None: + break + + filename = line_feeder.get_filename() + linenr = line_feeder.get_linenr() + + tokens = self._tokenize(line, False, filename, linenr) + + if tokens.is_empty(): + continue + + t0 = tokens.get_next() + + if t0 == T_HELP: + # Find first non-empty line and get its indentation + + line_feeder.remove_while(str.isspace) + line = line_feeder.get_next() + + if line is None: + stmt.help = "" + break + + indent = _indentation(line) + + # If the first non-empty lines has zero indent, there is no + # help text + if indent == 0: + stmt.help = "" + line_feeder.go_back() + break + + help_lines = [_deindent(line, indent)] + + # The help text goes on till the first non-empty line with less + # indent + while 1: + line = line_feeder.get_next() + if (line is None) or \ + (not line.isspace() and _indentation(line) < indent): + stmt.help = "".join(help_lines) + break + + help_lines.append(_deindent(line, indent)) + + if line is None: + break + + line_feeder.go_back() + + elif t0 == T_PROMPT: + # 'prompt' properties override each other within a single + # definition of a symbol, but additional prompts can be added + # by defining the symbol multiple times; hence 'new_prompt' + # instead of 'prompt'. + new_prompt = parse_val_and_cond(tokens, line, filename, linenr) + + elif t0 == T_DEFAULT: + new_def_exprs.append(parse_val_and_cond(tokens, line, filename, linenr)) + + elif t0 == T_DEPENDS: + if not tokens.check(T_ON): + _parse_error(line, 'expected "on" after "depends".', filename, linenr) + + parsed_deps = self._parse_expr(tokens, stmt, line, filename, linenr) + + if isinstance(stmt, (Menu, Comment)): + stmt.dep_expr = _make_and(stmt.dep_expr, parsed_deps) + else: + depends_on_expr = _make_and(depends_on_expr, parsed_deps) + + elif t0 == T_VISIBLE: + if not tokens.check(T_IF): + _parse_error(line, 'expected "if" after "visible".', filename, linenr) + if not isinstance(stmt, Menu): + _parse_error(line, + "'visible if' is only valid for menus.", + filename, + linenr) + + parsed_deps = self._parse_expr(tokens, stmt, line, filename, linenr) + stmt.visible_if_expr = _make_and(stmt.visible_if_expr, parsed_deps) + + elif t0 == T_SELECT: + target = tokens.get_next() + + stmt.referenced_syms.add(target) + stmt.selected_syms.add(target) + + if tokens.check(T_IF): + new_selects.append((target, + self._parse_expr(tokens, stmt, line, filename, linenr))) + else: + new_selects.append((target, None)) + + elif t0 in (T_BOOL, T_TRISTATE, T_INT, T_HEX, T_STRING): + stmt.type = token_to_type[t0] + + if len(tokens) > 1: + new_prompt = parse_val_and_cond(tokens, line, filename, linenr) + + elif t0 == T_RANGE: + lower = tokens.get_next() + upper = tokens.get_next() + stmt.referenced_syms.add(lower) + stmt.referenced_syms.add(upper) + + if tokens.check(T_IF): + stmt.ranges.append((lower, upper, + self._parse_expr(tokens, stmt, line, filename, linenr))) + else: + stmt.ranges.append((lower, upper, None)) + + elif t0 == T_DEF_BOOL: + stmt.type = BOOL + + if len(tokens) > 1: + new_def_exprs.append(parse_val_and_cond(tokens, line, filename, linenr)) + + elif t0 == T_DEF_TRISTATE: + stmt.type = TRISTATE + + if len(tokens) > 1: + new_def_exprs.append(parse_val_and_cond(tokens, line, filename, linenr)) + + elif t0 == T_OPTIONAL: + if not isinstance(stmt, Choice): + _parse_error(line, + '"optional" is only valid for choices.', + filename, + linenr) + stmt.optional = True + + elif t0 == T_OPTION: + if tokens.check(T_ENV) and tokens.check(T_EQUAL): + env_var = tokens.get_next() + + stmt.is_special_ = True + stmt.is_from_env = True + + if env_var not in os.environ: + self._warn(""" +The symbol {0} references the non-existent environment variable {1} and will +get the empty string as its value. + +If you're using kconfiglib via 'make (i)scriptconfig' it should have set up the +environment correctly for you. If you still got this message, that might be an +error, and you should e-mail kconfiglib@gmail.com. +.""" .format(stmt.name, env_var), + filename, + linenr) + + stmt.cached_value = "" + else: + stmt.cached_value = os.environ[env_var] + + elif tokens.check(T_DEFCONFIG_LIST): + self.defconfig_sym = stmt + + elif tokens.check(T_MODULES): + self._warn("the 'modules' option is not supported. " + "Let me know if this is a problem for you; " + "it shouldn't be that hard to implement.", + filename, + linenr) + + else: + _parse_error(line, "unrecognized option.", filename, linenr) + + else: + # See comment in Config.__init__() + self.end_line = line + self.end_line_tokens = tokens + break + + # Propagate dependencies from enclosing menus and if's. + + # For menus and comments.. + if isinstance(stmt, (Menu, Comment)): + stmt.orig_deps = stmt.dep_expr + stmt.deps_from_containing = deps + stmt.dep_expr = _make_and(stmt.dep_expr, deps) + + stmt.all_referenced_syms = \ + stmt.referenced_syms | _get_expr_syms(deps) + + # For symbols and choices.. + else: + + # See comment for 'menu_dep' + stmt.menu_dep = depends_on_expr + + # Propagate dependencies specified with 'depends on' to any new + # default expressions, prompts, and selections. ("New" since a + # symbol might be defined in multiple places and the dependencies + # should only apply to the local definition.) + + new_def_exprs = [(val_expr, _make_and(cond_expr, depends_on_expr)) + for (val_expr, cond_expr) in new_def_exprs] + + new_selects = [(target, _make_and(cond_expr, depends_on_expr)) + for (target, cond_expr) in new_selects] + + if new_prompt is not None: + prompt, cond_expr = new_prompt + + # 'visible if' dependencies from enclosing menus get propagated + # to prompts + if visible_if_deps is not None: + cond_expr = _make_and(cond_expr, visible_if_deps) + + new_prompt = (prompt, _make_and(cond_expr, depends_on_expr)) + + # We save the original expressions -- before any menu and if + # conditions have been propagated -- so these can be retrieved + # later. + + stmt.orig_def_exprs.extend(new_def_exprs) + if new_prompt is not None: + stmt.orig_prompts.append(new_prompt) + + # Only symbols can select + if isinstance(stmt, Symbol): + stmt.orig_selects.extend(new_selects) + + # Save dependencies from enclosing menus and if's + stmt.deps_from_containing = deps + + # The set of symbols referenced directly by the symbol/choice plus + # all symbols referenced by enclosing menus and if's. + stmt.all_referenced_syms = \ + stmt.referenced_syms | _get_expr_syms(deps) + + # Propagate dependencies from enclosing menus and if's + + stmt.def_exprs.extend([(val_expr, _make_and(cond_expr, deps)) + for (val_expr, cond_expr) in new_def_exprs]) + + for (target, cond) in new_selects: + target.rev_dep = _make_or(target.rev_dep, + _make_and(stmt, + _make_and(cond, deps))) + + if new_prompt is not None: + prompt, cond_expr = new_prompt + stmt.prompts.append((prompt, _make_and(cond_expr, deps))) + + # + # Symbol table manipulation + # + + def _sym_lookup(self, name, add_sym_if_not_exists = True): + """Fetches the symbol 'name' from the symbol table, optionally adding + it if it does not exist (this is usually what we want).""" + if name in self.syms: + return self.syms[name] + + new_sym = Symbol() + new_sym.config = self + new_sym.name = name + + if add_sym_if_not_exists: + self.syms[name] = new_sym + else: + # This warning is generated while evaluating an expression + # containing undefined symbols using Config.eval() + self._warn("no symbol {0} in configuration".format(name)) + + return new_sym + + # + # Evaluation of symbols and expressions + # + + def _eval_expr(self, expr): + """Evaluates an expression and returns one of the tristate values "n", + "m" or "y".""" + res = self._eval_expr_2(expr) + + # Promote "m" to "y" if we're running without modules. Internally, "m" + # is often rewritten to "m" && MODULES by both the C implementation and + # kconfiglib, which takes care of cases where "m" should be false if + # we're running without modules. + if res == "m" and not self._has_modules(): + return "y" + + return res + + def _eval_expr_2(self, expr): + if expr is None: + return "y" + + if isinstance(expr, Symbol): + # Non-bool/tristate symbols are always "n" in a tristate sense, + # regardless of their value + if expr.type != BOOL and expr.type != TRISTATE: + return "n" + return expr.get_value() + + if isinstance(expr, str): + return expr if (expr == "y" or expr == "m") else "n" + + first_expr = expr[0] + + if first_expr == OR: + res = "n" + + for subexpr in expr[1]: + ev = self._eval_expr_2(subexpr) + + # Return immediately upon discovering a "y" term + if ev == "y": + return "y" + + if ev == "m": + res = "m" + + # 'res' is either "n" or "m" here; we already handled the + # short-circuiting "y" case in the loop. + return res + + if first_expr == AND: + res = "y" + + for subexpr in expr[1]: + ev = self._eval_expr_2(subexpr) + + # Return immediately upon discovering an "n" term + if ev == "n": + return "n" + + if ev == "m": + res = "m" + + # 'res' is either "m" or "y" here; we already handled the + # short-circuiting "n" case in the loop. + return res + + if first_expr == NOT: + ev = self._eval_expr_2(expr[1]) + + if ev == "y": + return "n" + + return "y" if (ev == "n") else "m" + + if first_expr == EQUAL: + return "y" if (self._get_str_value(expr[1]) == + self._get_str_value(expr[2])) else "n" + + if first_expr == UNEQUAL: + return "y" if (self._get_str_value(expr[1]) != + self._get_str_value(expr[2])) else "n" + + _internal_error("Internal error while evaluating expression: " + "unknown operation {0}.".format(first_expr)) + + def _get_str_value(self, obj): + if isinstance(obj, str): + return obj + # obj is a Symbol + return obj.get_value() + + def _eval_min(self, e1, e2): + e1_eval = self._eval_expr(e1) + e2_eval = self._eval_expr(e2) + + return e1_eval if tri_less(e1_eval, e2_eval) else e2_eval + + def _eval_max(self, e1, e2): + e1_eval = self._eval_expr(e1) + e2_eval = self._eval_expr(e2) + + return e1_eval if tri_greater(e1_eval, e2_eval) else e2_eval + + # + # Methods related to the MODULES symbol + # + + def _has_modules(self): + modules_sym = self.syms.get("MODULES") + return (modules_sym is not None) and (modules_sym.get_value() == "y") + + # + # Dependency tracking + # + + def _build_dep(self): + """Populates the Symbol.dep sets, linking the symbol to the symbols + that immediately depend on it in the sense that changing the value of + the symbol might affect the values of those other symbols. This is used + for caching/invalidation purposes. The calculated sets might be larger + than necessary as we don't do any complicated analysis of the + expressions.""" + for sym in self.syms.itervalues(): + sym.dep = set() + + # Adds 'sym' as a directly dependent symbol to all symbols that appear + # in the expression 'e' + def add_expr_deps(e, sym): + for s in _get_expr_syms(e): + s.dep.add(sym) + + # The directly dependent symbols of a symbol are: + # - Any symbols whose prompts, default values, rev_dep (select + # condition), or ranges depend on the symbol + # - Any symbols that belong to the same choice statement as the symbol + # (these won't be included in 'dep' as that makes the dependency + # graph unwieldy, but Symbol._get_dependent() will include them) + # - Any symbols in a choice statement that depends on the symbol + for sym in self.syms.itervalues(): + for (_, e) in sym.prompts: + add_expr_deps(e, sym) + + for (v, e) in sym.def_exprs: + add_expr_deps(v, sym) + add_expr_deps(e, sym) + + add_expr_deps(sym.rev_dep, sym) + + for (l, u, e) in sym.ranges: + add_expr_deps(l, sym) + add_expr_deps(u, sym) + add_expr_deps(e, sym) + + if sym.is_choice_symbol_: + choice = sym.parent + + for (_, e) in choice.prompts: + add_expr_deps(e, sym) + + for (_, e) in choice.def_exprs: + add_expr_deps(e, sym) + + def _expr_val_str(self, expr, no_value_str = "(none)", get_val_instead_of_eval = False): + # Since values are valid expressions, _expr_to_str() will get a nice + # string representation for those as well. + + if expr is None: + return no_value_str + + if get_val_instead_of_eval: + if isinstance(expr, str): + return _expr_to_str(expr) + val = expr.get_value() + else: + val = self._eval_expr(expr) + + return "{0} (value: {1})".format(_expr_to_str(expr), _expr_to_str(val)) + + def _expand_sym_refs(self, s): + """Expands $-references to symbols in 's' to symbol values, or to the + empty string for undefined symbols.""" + + while 1: + sym_ref_re_match = sym_ref_re.search(s) + if sym_ref_re_match is None: + return s + + sym_name = sym_ref_re_match.group(0)[1:] + sym = self.syms.get(sym_name) + expansion = "" if sym is None else sym.get_value() + + s = s[:sym_ref_re_match.start()] + \ + expansion + \ + s[sym_ref_re_match.end():] + + def _get_sym_or_choice_str(self, sc): + """Symbols and choices have many properties in common, so we factor out + common __str__() stuff here. "sc" is short for "symbol or choice".""" + + # As we deal a lot with string representations here, use some + # convenient shorthand: + s = _expr_to_str + + # + # Common symbol/choice properties + # + + user_value_str = "(no user value)" if sc.user_val is None else s(sc.user_val) + + visibility_str = s(sc.get_visibility()) + + # Build prompts string + if sc.prompts == []: + prompts_str = " (no prompts)" + else: + prompts_str_rows = [] + + for (prompt, cond_expr) in sc.orig_prompts: + if cond_expr is None: + prompts_str_rows.append(' "{0}"'.format(prompt)) + else: + prompts_str_rows.append(' "{0}" if '.format(prompt) + + self._expr_val_str(cond_expr)) + + prompts_str = "\n".join(prompts_str_rows) + + # Build locations string + if sc.def_locations == []: + locations_str = "(no locations)" + else: + locations_str = " ".join(["{0}:{1}".format(filename, linenr) for + (filename, linenr) in sc.def_locations]) + + # Build additional-dependencies-from-menus-and-if's string + additional_deps_str = " " + self._expr_val_str(sc.deps_from_containing, + "(no additional dependencies)") + + # + # Symbol-specific stuff + # + + if isinstance(sc, Symbol): + + # Build value string + value_str = s(sc.get_value()) + + # Build ranges string + if isinstance(sc, Symbol): + if sc.ranges == []: + ranges_str = " (no ranges)" + else: + ranges_str_rows = [] + + for (l, u, cond_expr) in sc.ranges: + if cond_expr is None: + ranges_str_rows.append(" [{0}, {1}]".format(s(l), s(u))) + else: + ranges_str_rows.append(" [{0}, {1}] if {2}" + .format(s(l), s(u), self._expr_val_str(cond_expr))) + + ranges_str = "\n".join(ranges_str_rows) + + # Build default values string + if sc.def_exprs == []: + defaults_str = " (no default values)" + else: + defaults_str_rows = [] + + for (val_expr, cond_expr) in sc.orig_def_exprs: + row_str = " " + self._expr_val_str(val_expr, "(none)", sc.type == STRING) + defaults_str_rows.append(row_str) + defaults_str_rows.append(" Condition: " + self._expr_val_str(cond_expr)) + + defaults_str = "\n".join(defaults_str_rows) + + # Build selects string + if sc.orig_selects == []: + selects_str = " (no selects)" + else: + selects_str_rows = [] + + for (target, cond_expr) in sc.orig_selects: + if cond_expr is None: + selects_str_rows.append(" {0}".format(target.name)) + else: + selects_str_rows.append(" {0} if ".format(target.name) + + self._expr_val_str(cond_expr)) + + selects_str = "\n".join(selects_str_rows) + + # Build reverse dependencies string + if sc.rev_dep == "n": + rev_dep_str = " (no reverse dependencies)" + else: + rev_dep_str = " " + self._expr_val_str(sc.rev_dep) + + res = _sep_lines("Symbol " + (sc.name if sc.name is not None else "(no name)"), + "Type : " + typename[sc.type], + "Value : " + value_str, + "User value : " + user_value_str, + "Visibility : " + visibility_str, + "Is choice item : " + bool_str[sc.is_choice_symbol_], + "Is defined : " + bool_str[sc.is_defined_], + "Is from env. : " + bool_str[sc.is_from_env], + "Is special : " + bool_str[sc.is_special_] + "\n") + + if sc.ranges != []: + res += _sep_lines("Ranges:", + ranges_str + "\n") + + res += _sep_lines("Prompts:", + prompts_str, + "Default values:", + defaults_str, + "Selects:", + selects_str, + "Reverse dependencies:", + rev_dep_str, + "Additional dependencies from enclosing menus and if's:", + additional_deps_str, + "Locations: " + locations_str) + + return res + + # + # Choice-specific stuff + # + + # Build name string (for named choices) + if sc.name is None: + name_str = "(no name)" + else: + name_str = sc.name + + # Build selected symbol string + sel = sc.get_selection() + if sel is None: + sel_str = "(no selection)" + else: + sel_str = sel.name + + # Build mode string + mode_str = s(sc.get_mode()) + + # Build default values string + if sc.def_exprs == []: + defaults_str = " (no default values)" + else: + defaults_str_rows = [] + + for (sym, cond_expr) in sc.orig_def_exprs: + if cond_expr is None: + defaults_str_rows.append(" {0}".format(sym.name)) + else: + defaults_str_rows.append(" {0} if ".format(sym.name) + + self._expr_val_str(cond_expr)) + + defaults_str = "\n".join(defaults_str_rows) + + # Build contained symbols string + names = [sym.name for sym in sc.get_symbols()] + + if names == []: + syms_string = "(empty)" + else: + syms_string = " ".join(names) + + return _sep_lines("Choice", + "Name (for named choices): " + name_str, + "Type : " + typename[sc.type], + "Selected symbol : " + sel_str, + "User value : " + user_value_str, + "Mode : " + mode_str, + "Visibility : " + visibility_str, + "Optional : " + bool_str[sc.optional], + "Prompts:", + prompts_str, + "Defaults:", + defaults_str, + "Choice symbols:", + " " + syms_string, + "Additional dependencies from enclosing menus and if's:", + additional_deps_str, + "Locations: " + locations_str) + + def _expr_depends_on(self, expr, sym): + """Reimplementation of expr_depends_symbol() from mconf.c. Used to + determine if a submenu should be implicitly created, which influences what + items inside choice statements are considered choice items.""" + if expr is None: + return False + + def rec(expr): + if isinstance(expr, str): + return False + + if isinstance(expr, Symbol): + return expr is sym + + e0 = expr[0] + + if e0 == EQUAL or e0 == UNEQUAL: + return self._eq_to_sym(expr) is sym + + if e0 == AND: + for and_expr in expr[1]: + if rec(and_expr): + return True + + return False + + return rec(expr) + + def _eq_to_sym(self, eq): + """_expr_depends_on() helper. For (in)equalities of the form sym = y/m + or sym != n, returns sym. For other (in)equalities, returns None.""" + relation, left, right = eq + + left = self._transform_n_m_y(left) + right = self._transform_n_m_y(right) + + # Make sure the symbol (if any) appears to the left + if not isinstance(left, Symbol): + left, right = right, left + + if not isinstance(left, Symbol): + return None + + if (relation == EQUAL and (right == "m" or right == "y")) or \ + (relation == UNEQUAL and right == "n"): + return left + + return None + + def _transform_n_m_y(self, item): + """_eq_to_sym() helper. Translates the symbols n, m, and y to their + string equivalents.""" + if item is self.n: + return "n" + if item is self.m: + return "m" + if item is self.y: + return "y" + return item + + def _warn(self, msg, filename = None, linenr = None): + """For printing warnings to stderr.""" + if self.print_warnings: + self._warn_or_undef_assign(msg, WARNING, filename, linenr) + + def _undef_assign(self, msg, filename = None, linenr = None): + """For printing informational messages related to assignments + to undefined variables to stderr.""" + if self.print_undef_assign: + self._warn_or_undef_assign(msg, UNDEF_ASSIGN, filename, linenr) + + def _warn_or_undef_assign(self, msg, msg_type, filename, linenr): + if filename is not None: + sys.stderr.write("{0}:".format(_clean_up_path(filename))) + if linenr is not None: + sys.stderr.write("{0}:".format(linenr)) + + if msg_type == WARNING: + sys.stderr.write("warning: ") + elif msg_type == UNDEF_ASSIGN: + sys.stderr.write("info: ") + else: + _internal_error('Internal error while printing warning: unknown warning type "{0}".' + .format(msg_type)) + + sys.stderr.write(msg + "\n") + +def _get_expr_syms(expr): + """Returns the set() of symbols appearing in expr.""" + res = set() + if expr is None: + return res + + def rec(expr): + if isinstance(expr, Symbol): + res.add(expr) + return + + if isinstance(expr, str): + return + + e0 = expr[0] + + if e0 == OR or e0 == AND: + for term in expr[1]: + rec(term) + + elif e0 == NOT: + rec(expr[1]) + + elif e0 == EQUAL or e0 == UNEQUAL: + _, v1, v2 = expr + + if isinstance(v1, Symbol): + res.add(v1) + + if isinstance(v2, Symbol): + res.add(v2) + + else: + _internal_error("Internal error while fetching symbols from an " + "expression with token stream {0}.".format(expr)) + + rec(expr) + return res + + +# +# Construction of expressions +# + +# These functions as well as the _eval_min/max() functions above equate +# None with "y", which is usually what we want, but needs to be kept in +# mind. + +def _make_or(e1, e2): + # Perform trivial simplification and avoid None's (which + # correspond to y's) + if e1 is None or e2 is None or \ + e1 == "y" or e2 == "y": + return "y" + + if e1 == "n": + return e2 + + if e2 == "n": + return e1 + + # Prefer to merge/update argument list if possible instead of creating + # a new OR node + + if isinstance(e1, tuple) and e1[0] == OR: + if isinstance(e2, tuple) and e2[0] == OR: + return (OR, e1[1] + e2[1]) + return (OR, e1[1] + [e2]) + + if isinstance(e2, tuple) and e2[0] == OR: + return (OR, e2[1] + [e1]) + + return (OR, [e1, e2]) + +# Note: returns None if e1 == e2 == None + +def _make_and(e1, e2): + if e1 == "n" or e2 == "n": + return "n" + + if e1 is None or e1 == "y": + return e2 + + if e2 is None or e2 == "y": + return e1 + + # Prefer to merge/update argument list if possible instead of creating + # a new AND node + + if isinstance(e1, tuple) and e1[0] == AND: + if isinstance(e2, tuple) and e2[0] == AND: + return (AND, e1[1] + e2[1]) + return (AND, e1[1] + [e2]) + + if isinstance(e2, tuple) and e2[0] == AND: + return (AND, e2[1] + [e1]) + + return (AND, [e1, e2]) + +# +# Constants and functions related to types, parsing, evaluation and printing, +# put globally to unclutter the Config class a bit. +# + +# Tokens +(T_OR, T_AND, T_NOT, + T_OPEN_PAREN, T_CLOSE_PAREN, + T_EQUAL, T_UNEQUAL, + T_MAINMENU, T_MENU, T_ENDMENU, + T_SOURCE, T_CHOICE, T_ENDCHOICE, + T_COMMENT, T_CONFIG, T_MENUCONFIG, + T_HELP, T_IF, T_ENDIF, T_DEPENDS, T_ON, + T_OPTIONAL, T_PROMPT, T_DEFAULT, + T_BOOL, T_TRISTATE, T_HEX, T_INT, T_STRING, + T_DEF_BOOL, T_DEF_TRISTATE, + T_SELECT, T_RANGE, T_OPTION, T_ENV, + T_DEFCONFIG_LIST, T_MODULES, T_VISIBLE) = range(0, 38) + +# Keyword to token map +keywords = { + "mainmenu" : T_MAINMENU, + "menu" : T_MENU, + "endmenu" : T_ENDMENU, + "endif" : T_ENDIF, + "endchoice" : T_ENDCHOICE, + "source" : T_SOURCE, + "choice" : T_CHOICE, + "config" : T_CONFIG, + "comment" : T_COMMENT, + "menuconfig" : T_MENUCONFIG, + "help" : T_HELP, + "if" : T_IF, + "depends" : T_DEPENDS, + "on" : T_ON, + "optional" : T_OPTIONAL, + "prompt" : T_PROMPT, + "default" : T_DEFAULT, + "bool" : T_BOOL, + "boolean" : T_BOOL, + "tristate" : T_TRISTATE, + "int" : T_INT, + "hex" : T_HEX, + "def_bool" : T_DEF_BOOL, + "def_tristate" : T_DEF_TRISTATE, + "string" : T_STRING, + "select" : T_SELECT, + "range" : T_RANGE, + "option" : T_OPTION, + "env" : T_ENV, + "defconfig_list" : T_DEFCONFIG_LIST, + "modules" : T_MODULES, + "visible" : T_VISIBLE } + +# Strings to use for True and False +bool_str = { False : "false", True : "true" } + +# Tokens after which identifier-like lexemes are treated as strings. T_CHOICE +# is included to avoid symbols being registered for named choices. +string_lex = frozenset((T_BOOL, T_TRISTATE, T_INT, T_HEX, T_STRING, T_CHOICE, + T_PROMPT, T_MENU, T_COMMENT, T_SOURCE, T_MAINMENU)) + +# Matches the initial token on a line; see _tokenize(). +initial_token_re = re.compile(r"[^\w]*(\w+)") + +# Matches an identifier/keyword optionally preceded by whitespace +id_keyword_re = re.compile(r"\s*([\w./-]+)") + +# Regular expressions for parsing .config files +set_re = re.compile(r"CONFIG_(\w+)=(.*)") +unset_re = re.compile(r"# CONFIG_(\w+) is not set") + +# Regular expression for finding $-references to symbols in strings +sym_ref_re = re.compile(r"\$[A-Za-z_]+") + +# Integers representing symbol types +UNKNOWN, BOOL, TRISTATE, STRING, HEX, INT = range(0, 6) + +# Strings to use for types +typename = { + UNKNOWN : "unknown", + BOOL : "bool", + TRISTATE : "tristate", + STRING : "string", + HEX : "hex", + INT : "int" } + +# Token to type mapping +token_to_type = { T_BOOL : BOOL, + T_TRISTATE : TRISTATE, + T_STRING : STRING, + T_INT : INT, + T_HEX : HEX } + +# Default values for symbols of different types (the value the symbol gets if +# it is not assigned a user value and none of its 'default' clauses kick in) +default_value = { BOOL : "n", + TRISTATE : "n", + STRING : "", + INT : "", + HEX : "" } + +# Indicates that no item is selected in a choice statement +NO_SELECTION = 0 + +# Integers representing expression types +OR, AND, NOT, EQUAL, UNEQUAL = range(0, 5) + +# Map from tristate values to integers +tri_to_int = { "n" : 0, "m" : 1, "y" : 2 } + +# Printing-related stuff + +op_to_str = { AND : " && ", + OR : " || ", + EQUAL : " = ", + UNEQUAL : " != " } + +precedence = { OR : 0, AND : 1, NOT : 2 } + +# Types of informational messages +WARNING = 0 +UNDEF_ASSIGN = 1 + +def _intersperse(lst, op): + """_expr_to_str() helper. Gets the string representation of each expression in lst + and produces a list where op has been inserted between the elements.""" + if lst == []: + return "" + + res = [] + + def handle_sub_expr(expr): + no_parens = isinstance(expr, (str, Symbol)) or \ + expr[0] in (EQUAL, UNEQUAL) or \ + precedence[op] <= precedence[expr[0]] + if not no_parens: + res.append("(") + res.extend(_expr_to_str_rec(expr)) + if not no_parens: + res.append(")") + + op_str = op_to_str[op] + + handle_sub_expr(lst[0]) + for expr in lst[1:]: + res.append(op_str) + handle_sub_expr(expr) + + return res + +def _expr_to_str(expr): + s = "".join(_expr_to_str_rec(expr)) + return s + +def _sym_str_string(sym_or_str): + if isinstance(sym_or_str, str): + return '"{0}"'.format(sym_or_str) + return sym_or_str.name + +def _expr_to_str_rec(expr): + if expr is None: + return [""] + + if isinstance(expr, (Symbol, str)): + return [_sym_str_string(expr)] + + e0 = expr[0] + + if e0 == OR or e0 == AND: + return _intersperse(expr[1], expr[0]) + + if e0 == NOT: + need_parens = not isinstance(expr[1], (str, Symbol)) + + res = ["!"] + if need_parens: + res.append("(") + res.extend(_expr_to_str_rec(expr[1])) + if need_parens: + res.append(")") + return res + + if e0 == EQUAL or e0 == UNEQUAL: + return [_sym_str_string(expr[1]), + op_to_str[expr[0]], + _sym_str_string(expr[2])] + +class _Block: + + """Represents a list of items (symbols, menus, choice statements and + comments) appearing at the top-level of a file or witin a menu, choice or + if statement.""" + + def __init__(self): + self.items = [] + + def get_items(self): + return self.items + + def add_item(self, item): + self.items.append(item) + + def _make_conf(self): + # Collect the substrings in a list and later use join() instead of += + # to build the final .config contents. With older Python versions, this + # yields linear instead of quadratic complexity. + strings = [] + for item in self.items: + strings.extend(item._make_conf()) + + return strings + + def add_depend_expr(self, expr): + for item in self.items: + item.add_depend_expr(expr) + +class Item(): + + """Base class for symbols and other Kconfig constructs. Subclasses are + Symbol, Choice, Menu, and Comment.""" + + def is_symbol(self): + """Returns True if the item is a symbol, otherwise False. Short for + isinstance(item, kconfiglib.Symbol).""" + return isinstance(self, Symbol) + + def is_choice(self): + """Returns True if the item is a choice, otherwise False. Short for + isinstance(item, kconfiglib.Choice).""" + return isinstance(self, Choice) + + def is_menu(self): + """Returns True if the item is a menu, otherwise False. Short for + isinstance(item, kconfiglib.Menu).""" + return isinstance(self, Menu) + + def is_comment(self): + """Returns True if the item is a comment, otherwise False. Short for + isinstance(item, kconfiglib.Comment).""" + return isinstance(self, Comment) + +class _HasVisibility(): + + """Base class for elements that have a "visibility" that acts as an upper + limit on the values a user can set for them. Subclasses are Symbol and + Choice (which supply some of the attributes).""" + + def __init__(self): + self.cached_visibility = None + self.prompts = [] + + def _invalidate(self): + self.cached_visibility = None + + def _get_visibility(self): + if self.cached_visibility is None: + vis = "n" + for (prompt, cond_expr) in self.prompts: + vis = self.config._eval_max(vis, cond_expr) + + if isinstance(self, Symbol) and self.is_choice_symbol_: + vis = self.config._eval_min(vis, self.parent._get_visibility()) + + # Promote "m" to "y" if we're dealing with a non-tristate + if vis == "m" and self.type != TRISTATE: + vis = "y" + + self.cached_visibility = vis + + return self.cached_visibility + +class Symbol(Item, _HasVisibility): + + """Represents a configuration symbol - e.g. FOO for + + config FOO + ...""" + + # + # Public interface + # + + def get_value(self): + """Calculate and return the value of the symbol. See also + Symbol.set_user_value().""" + + if self.cached_value is not None: + return self.cached_value + + self.write_to_conf = False + + # As a quirk of Kconfig, undefined symbols get their name as their + # value. This is why things like "FOO = bar" work for seeing if FOO has + # the value "bar". + if self.type == UNKNOWN: + self.cached_value = self.name + return self.name + + new_val = default_value[self.type] + + vis = self._get_visibility() + + if self.type == BOOL or self.type == TRISTATE: + # The visibility and mode (modules-only or single-selection) of + # choice items will be taken into account in self._get_visibility() + + if self.is_choice_symbol_: + if vis != "n": + choice = self.parent + mode = choice.get_mode() + + self.write_to_conf = (mode != "n") + + if mode == "y": + new_val = "y" if (choice.get_selection() is self) else "n" + elif mode == "m": + if self.user_val == "m" or self.user_val == "y": + new_val = "m" + + else: + use_defaults = True + + if vis != "n": + # If the symbol is visible and has a user value, use that. + # Otherwise, look at defaults. + self.write_to_conf = True + + if self.user_val is not None: + new_val = self.config._eval_min(self.user_val, vis) + use_defaults = False + + if use_defaults: + for (val_expr, cond_expr) in self.def_exprs: + cond_eval = self.config._eval_expr(cond_expr) + + if cond_eval != "n": + self.write_to_conf = True + new_val = self.config._eval_min(val_expr, cond_eval) + break + + # Reverse dependencies take precedence + rev_dep_val = self.config._eval_expr(self.rev_dep) + + if rev_dep_val != "n": + self.write_to_conf = True + new_val = self.config._eval_max(new_val, rev_dep_val) + + # Promote "m" to "y" for booleans + if new_val == "m" and self.type == BOOL: + new_val = "y" + + elif self.type == STRING: + use_defaults = True + + if vis != "n": + self.write_to_conf = True + if self.user_val is not None: + new_val = self.user_val + use_defaults = False + + if use_defaults: + for (val_expr, cond_expr) in self.def_exprs: + if self.config._eval_expr(cond_expr) != "n": + self.write_to_conf = True + new_val = self.config._get_str_value(val_expr) + break + + elif self.type == HEX or self.type == INT: + has_active_range = False + low = None + high = None + use_defaults = True + + base = 16 if self.type == HEX else 10 + + for(l, h, cond_expr) in self.ranges: + if self.config._eval_expr(cond_expr) != "n": + has_active_range = True + + low_str = self.config._get_str_value(l) + high_str = self.config._get_str_value(h) + + low = int(low_str, base) if \ + _is_base_n(low_str, base) else 0 + high = int(high_str, base) if \ + _is_base_n(high_str, base) else 0 + + break + + if vis != "n": + self.write_to_conf = True + + if self.user_val is not None and \ + _is_base_n(self.user_val, base) and \ + (not has_active_range or + low <= int(self.user_val, base) <= high): + + # If the user value is OK, it is stored in exactly the same + # form as specified in the assignment (with or without + # "0x", etc). + + use_defaults = False + new_val = self.user_val + + if use_defaults: + for (val_expr, cond_expr) in self.def_exprs: + if self.config._eval_expr(cond_expr) != "n": + self.write_to_conf = True + + # If the default value is OK, it is stored in exactly + # the same form as specified. Otherwise, it is clamped + # to the range, and the output has "0x" as appropriate + # for the type. + + new_val = self.config._get_str_value(val_expr) + + if _is_base_n(new_val, base): + new_val_num = int(new_val, base) + if has_active_range: + clamped_val = None + + if new_val_num < low: + clamped_val = low + elif new_val_num > high: + clamped_val = high + + if clamped_val is not None: + new_val = (hex(clamped_val) if \ + self.type == HEX else str(clamped_val)) + + break + else: # For the for loop + # If no user value or default kicks in but the hex/int has + # an active range, then the low end of the range is used, + # provided it's > 0, with "0x" prepended as appropriate. + + if has_active_range and low > 0: + new_val = (hex(low) if self.type == HEX else str(low)) + + self.cached_value = new_val + return new_val + + def set_user_value(self, v): + """Sets the user value of the symbol. + + Equal in effect to assigning the value to the symbol within a .config + file. Use get_lower/upper_bound() or get_assignable_values() to find + the range of currently assignable values for bool and tristate symbols; + setting values outside this range will cause the user value to differ + from the result of Symbol.get_value() (be truncated). Values that are + invalid for the type (such as a_bool.set_user_value("foo")) are + ignored, and a warning is emitted if an attempt is made to assign such + a value. + + For any type of symbol, is_modifiable() can be used to check if a user + value will currently have any effect on the symbol, as determined by + its visibility and range of assignable values. Any value that is valid + for the type (bool, tristate, etc.) will end up being reflected in + get_user_value() though, and might have an effect later if conditions + change. To get rid of the user value, use unset_user_value(). + + Any symbols dependent on the symbol are (recursively) invalidated, so + things will just work with regards to dependencies. + + v -- The user value to give to the symbol.""" + self._set_user_value_no_invalidate(v, False) + + # There might be something more efficient you could do here, but play + # it safe. + if self.name == "MODULES": + self.config._invalidate_all() + return + + self._invalidate() + self._invalidate_dependent() + + def unset_user_value(self): + """Resets the user value of the symbol, as if the symbol had never + gotten a user value via Config.load_config() or + Symbol.set_user_value().""" + self._unset_user_value_no_recursive_invalidate() + self._invalidate_dependent() + + def get_user_value(self): + """Returns the value assigned to the symbol in a .config or via + Symbol.set_user_value() (provided the value was valid for the type of the + symbol). Returns None in case of no user value.""" + return self.user_val + + def get_name(self): + """Returns the name of the symbol.""" + return self.name + + def get_prompts(self): + """Returns a list of prompts defined for the symbol, in the order they + appear in the configuration files. Returns the empty list for symbols + with no prompt. + + This list will have a single entry for the vast majority of symbols + having prompts, but having multiple prompts for a single symbol is + possible through having multiple 'config' entries for it.""" + return [prompt for prompt, _ in self.orig_prompts] + + def get_upper_bound(self): + """For string/hex/int symbols and for bool and tristate symbols that + cannot be modified (see is_modifiable()), returns None. + + Otherwise, returns the highest value the symbol can be set to with + Symbol.set_user_value() (that will not be truncated): one of "m" or "y", + arranged from lowest to highest. This corresponds to the highest value + the symbol could be given in e.g. the 'make menuconfig' interface. + + See also the tri_less*() and tri_greater*() functions, which could come + in handy.""" + if self.type != BOOL and self.type != TRISTATE: + return None + rev_dep = self.config._eval_expr(self.rev_dep) + # A bool selected to "m" gets promoted to "y" + if self.type == BOOL and rev_dep == "m": + rev_dep = "y" + vis = self._get_visibility() + if (tri_to_int[vis] - tri_to_int[rev_dep]) > 0: + return vis + return None + + def get_lower_bound(self): + """For string/hex/int symbols and for bool and tristate symbols that + cannot be modified (see is_modifiable()), returns None. + + Otherwise, returns the lowest value the symbol can be set to with + Symbol.set_user_value() (that will not be truncated): one of "n" or "m", + arranged from lowest to highest. This corresponds to the lowest value + the symbol could be given in e.g. the 'make menuconfig' interface. + + See also the tri_less*() and tri_greater*() functions, which could come + in handy.""" + if self.type != BOOL and self.type != TRISTATE: + return None + rev_dep = self.config._eval_expr(self.rev_dep) + # A bool selected to "m" gets promoted to "y" + if self.type == BOOL and rev_dep == "m": + rev_dep = "y" + if (tri_to_int[self._get_visibility()] - tri_to_int[rev_dep]) > 0: + return rev_dep + return None + + def get_assignable_values(self): + """For string/hex/int symbols and for bool and tristate symbols that + cannot be modified (see is_modifiable()), returns the empty list. + + Otherwise, returns a list containing the user values that can be + assigned to the symbol (that won't be truncated). Usage example: + + if "m" in sym.get_assignable_values(): + sym.set_user_value("m") + + This is basically a more convenient interface to + get_lower/upper_bound() when wanting to test if a particular tristate + value can be assigned.""" + if self.type != BOOL and self.type != TRISTATE: + return [] + rev_dep = self.config._eval_expr(self.rev_dep) + # A bool selected to "m" gets promoted to "y" + if self.type == BOOL and rev_dep == "m": + rev_dep = "y" + res = ["n", "m", "y"][tri_to_int[rev_dep] : + tri_to_int[self._get_visibility()] + 1] + return res if len(res) > 1 else [] + + def get_type(self): + """Returns the type of the symbol: one of UNKNOWN, BOOL, TRISTATE, + STRING, HEX, or INT. These are defined at the top level of the module, + so you'd do something like + + if sym.get_type() == kconfiglib.STRING: + ...""" + return self.type + + def get_visibility(self): + """Returns the visibility of the symbol: one of "n", "m" or "y". For + bool and tristate symbols, this is an upper bound on the value users + can set for the symbol. For other types of symbols, a visibility of "n" + means the user value will be ignored. A visibility of "n" corresponds + to not being visible in the 'make *config' interfaces. + + Example (assuming we're running with modules enabled -- i.e., MODULES + set to 'y'): + + # Assume this has been assigned 'n' + config N_SYM + tristate "N_SYM" + + # Assume this has been assigned 'm' + config M_SYM + tristate "M_SYM" + + # Has visibility 'n' + config A + tristate "A" + depends on N_SYM + + # Has visibility 'm' + config B + tristate "B" + depends on M_SYM + + # Has visibility 'y' + config C + tristate "C" + + # Has no prompt, and hence visibility 'n' + config D + tristate + + Having visibility be tri-valued ensures that e.g. a symbol cannot be + set to "y" by the user if it depends on a symbol with value "m", which + wouldn't be safe. + + You should probably look at get_lower/upper_bound(), + get_assignable_values() and is_modifiable() before using this.""" + return self._get_visibility() + + def get_parent(self): + """Returns the menu or choice statement that contains the symbol, or + None if the symbol is at the top level. Note that if statements are + treated as syntactic and do not have an explicit class + representation.""" + return self.parent + + def get_referenced_symbols(self, refs_from_enclosing = False): + """Returns the set() of all symbols referenced by this symbol. For + example, the symbol defined by + + config FOO + bool + prompt "foo" if A && B + default C if D + depends on E + select F if G + + references the symbols A through G. + + refs_from_enclosing (default: False) -- If True, the symbols + referenced by enclosing menus and if's will be + included in the result.""" + return self.all_referenced_syms if refs_from_enclosing else self.referenced_syms + + def get_selected_symbols(self): + """Returns the set() of all symbols X for which this symbol has a + 'select X' or 'select X if Y' (regardless of whether Y is satisfied or + not). This is a subset of the symbols returned by + get_referenced_symbols().""" + return self.selected_syms + + def get_help(self): + """Returns the help text of the symbol, or None if the symbol has no + help text.""" + return self.help + + def get_config(self): + """Returns the Config instance this symbol is from.""" + return self.config + + def get_def_locations(self): + """Returns a list of (filename, linenr) tuples, where filename (string) + and linenr (int) represent a location where the symbol is defined. For + the vast majority of symbols this list will only contain one element. + For the following Kconfig, FOO would get two entries: the lines marked + with *. + + config FOO * + bool "foo prompt 1" + + config FOO * + bool "foo prompt 2" + """ + return self.def_locations + + def get_ref_locations(self): + """Returns a list of (filename, linenr) tuples, where filename (string) + and linenr (int) represent a location where the symbol is referenced in + the configuration. For example, the lines marked by * would be included + for FOO below: + + config A + bool + default BAR || FOO * + + config B + tristate + depends on FOO * + default m if FOO * + + if FOO * + config A + bool "A" + endif + + config FOO (definition not included) + bool + """ + return self.ref_locations + + def is_modifiable(self): + """Returns True if the value of the symbol could be modified by calling + Symbol.set_user_value() and False otherwise. + + For bools and tristates, this corresponds to the symbol being visible + in the 'make menuconfig' interface and not already being pinned to a + specific value (e.g. because it is selected by another symbol). + + For strings and numbers, this corresponds to just being visible. (See + Symbol.get_visibility().)""" + if self.is_special_: + return False + if self.type == BOOL or self.type == TRISTATE: + rev_dep = self.config._eval_expr(self.rev_dep) + # A bool selected to "m" gets promoted to "y" + if self.type == BOOL and rev_dep == "m": + rev_dep = "y" + return (tri_to_int[self._get_visibility()] - + tri_to_int[rev_dep]) > 0 + return self._get_visibility() != "n" + + def is_defined(self): + """Returns False if the symbol is referred to in the Kconfig but never + actually defined, otherwise True.""" + return self.is_defined_ + + def is_special(self): + """Returns True if the symbol is one of the special symbols n, m, y, or + UNAME_RELEASE, or gets its value from the environment. Otherwise, + returns False.""" + return self.is_special_ + + def is_from_environment(self): + """Returns True if the symbol gets its value from the environment. + Otherwise, returns False.""" + return self.is_from_env + + def has_ranges(self): + """Returns True if the symbol is of type INT or HEX and has ranges that + limits what values it can take on, otherwise False.""" + return self.ranges != [] + + def is_choice_symbol(self): + """Returns True if the symbol is in a choice statement and is an actual + choice symbol (see Choice.get_symbols()); otherwise, returns + False.""" + return self.is_choice_symbol_ + + def is_choice_selection(self): + """Returns True if the symbol is contained in a choice statement and is + the selected item, otherwise False. Equivalent to 'sym.is_choice_symbol() + and sym.get_parent().get_selection() is sym'.""" + return self.is_choice_symbol_ and self.parent.get_selection() is self + + def __str__(self): + """Returns a string containing various information about the symbol.""" + return self.config._get_sym_or_choice_str(self) + + # + # Private methods + # + + def __init__(self): + """Symbol constructor -- not intended to be called directly by + kconfiglib clients.""" + + # Set default values + _HasVisibility.__init__(self) + + self.config = None + + self.parent = None + self.name = None + self.type = UNKNOWN + + self.def_exprs = [] + self.ranges = [] + self.rev_dep = "n" + + # The prompt, default value and select conditions without any + # dependencies from menus or if's propagated to them + + self.orig_prompts = [] + self.orig_def_exprs = [] + self.orig_selects = [] + + # Dependencies inherited from containing menus and if's + self.deps_from_containing = None + + self.help = None + + # The set of symbols referenced by this symbol (see + # get_referenced_symbols()) + self.referenced_syms = set() + + # The set of symbols selected by this symbol (see + # get_selected_symbols()) + self.selected_syms = set() + + # Like 'referenced_syms', but includes symbols from + # dependencies inherited from enclosing menus and if's + self.all_referenced_syms = set() + + # This is set to True for "actual" choice symbols. See + # Choice._determine_actual_symbols(). The trailing underscore avoids a + # collision with is_choice_symbol(). + self.is_choice_symbol_ = False + + # This records only dependencies specified with 'depends on'. Needed + # when determining actual choice items (hrrrr...). See also + # Choice._determine_actual_symbols(). + self.menu_dep = None + + # See Symbol.get_ref/def_locations(). + self.def_locations = [] + self.ref_locations = [] + + self.user_val = None + + # Flags + + # Should the symbol get an entry in .config? + self.write_to_conf = False + + # Caches the calculated value + self.cached_value = None + + # Note: An instance variable 'self.dep' gets set on the Symbol in + # Config._build_dep(), linking the symbol to the symbols that + # immediately depend on it (in a caching/invalidation sense). The total + # set of dependent symbols for the symbol (the transitive closure) is + # calculated on an as-needed basis in _get_dependent(). + + # Caches the total list of dependent symbols. Calculated in + # _get_dependent(). + self.cached_deps = None + + # Does the symbol have an entry in the Kconfig file? The trailing + # underscore avoids a collision with is_defined(). + self.is_defined_ = False + + # Does the symbol get its value in some special way, e.g. from the + # environment or by being one of the special symbols n, m, and y? If + # so, the value is stored in self.cached_value, which is never + # invalidated. The trailing underscore avoids a collision with + # is_special(). + self.is_special_ = False + + # Does the symbol get its value from the environment? + self.is_from_env = False + + def _invalidate(self): + if self.is_special_: + return + + if self.is_choice_symbol_: + self.parent._invalidate() + + _HasVisibility._invalidate(self) + + self.write_to_conf = False + self.cached_value = None + + def _invalidate_dependent(self): + for sym in self._get_dependent(): + sym._invalidate() + + def _set_user_value_no_invalidate(self, v, suppress_load_warnings): + """Like set_user_value(), but does not invalidate any symbols. + + suppress_load_warnings -- + some warnings are annoying when loading a .config that can be helpful + when manually invoking set_user_value(). This flag is set to True to + suppress such warnings. + + Perhaps this could be made optional for load_config() instead.""" + + if self.is_special_: + if self.is_from_env: + self.config._warn('attempt to assign the value "{0}" to the ' + 'symbol {1}, which gets its value from the ' + 'environment. Assignment ignored.' + .format(v, self.name)) + else: + self.config._warn('attempt to assign the value "{0}" to the ' + 'special symbol {1}. Assignment ignored.' + .format(v, self.name)) + + return + + + if not self.is_defined_: + filename, linenr = self.ref_locations[0] + + self.config._undef_assign('attempt to assign the value "{0}" to {1}, ' + "which is referenced at {2}:{3} but never " + "defined. Assignment ignored." + .format(v, self.name, filename, linenr)) + return + + # Check if the value is valid for our type + + if not (( self.type == BOOL and (v == "n" or v == "y") ) or + ( self.type == TRISTATE and (v == "n" or v == "m" or + v == "y") ) or + ( self.type == STRING ) or + ( self.type == INT and _is_base_n(v, 10) ) or + ( self.type == HEX and _is_base_n(v, 16) )): + + self.config._warn('the value "{0}" is invalid for {1}, which has type {2}. ' + "Assignment ignored." + .format(v, self.name, typename[self.type])) + return + + if self.prompts == [] and not suppress_load_warnings: + self.config._warn('assigning "{0}" to the symbol {1} which ' + 'lacks prompts and thus has visibility "n". ' + 'The assignment will have no effect.' + .format(v, self.name)) + + self.user_val = v + + if self.is_choice_symbol_ and (self.type == BOOL or + self.type == TRISTATE): + choice = self.parent + if v == "y": + choice.user_val = self + choice.user_mode = "y" + elif v == "m": + choice.user_val = None + choice.user_mode = "m" + + def _unset_user_value_no_recursive_invalidate(self): + self._invalidate() + self.user_val = None + + if self.is_choice_symbol_: + self.parent._unset_user_value() + + def _make_conf(self): + if self.already_written: + return [] + + self.already_written = True + + # Note: write_to_conf is determined in get_value() + val = self.get_value() + if not self.write_to_conf: + return [] + + if self.type == BOOL or self.type == TRISTATE: + if val == "m" or val == "y": + return ["CONFIG_{0}={1}".format(self.name, val)] + return ["# CONFIG_{0} is not set".format(self.name)] + + elif self.type == STRING: + # Escape \ and " + return ['CONFIG_{0}="{1}"' + .format(self.name, + val.replace("\\", "\\\\").replace('"', '\\"'))] + + elif self.type == INT or self.type == HEX: + return ["CONFIG_{0}={1}".format(self.name, val)] + + else: + _internal_error('Internal error while creating .config: unknown type "{0}".' + .format(self.type)) + + def _get_dependent(self): + """Returns the set of symbols that should be invalidated if the value + of the symbol changes, because they might be affected by the change. + Note that this is an internal API -- it's probably of limited + usefulness to clients.""" + if self.cached_deps is not None: + return self.cached_deps + + res = set() + + self._add_dependent_ignore_siblings(res) + if self.is_choice_symbol_: + for s in self.parent.get_symbols(): + if s is not self: + res.add(s) + s._add_dependent_ignore_siblings(res) + + self.cached_deps = res + return res + + def _add_dependent_ignore_siblings(self, to): + """Calculating dependencies gets a bit tricky for choice items as they + all depend on each other, potentially leading to infinite recursion. + This helper function calculates dependencies ignoring the other symbols + in the choice. It also works fine for symbols that are not choice + items.""" + for s in self.dep: + to.add(s) + to |= s._get_dependent() + + def _has_auto_menu_dep_on(self, on): + """See Choice._determine_actual_symbols().""" + if not isinstance(self.parent, Choice): + _internal_error("Attempt to determine auto menu dependency for symbol ouside of choice.") + + if self.prompts == []: + # If we have no prompt, use the menu dependencies instead (what was + # specified with 'depends on') + return self.menu_dep is not None and \ + self.config._expr_depends_on(self.menu_dep, on) + + for (_, cond_expr) in self.prompts: + if self.config._expr_depends_on(cond_expr, on): + return True + + return False + +class Menu(Item): + + """Represents a menu statement.""" + + # + # Public interface + # + + def get_config(self): + """Return the Config instance this menu is from.""" + return self.config + + def get_visibility(self): + """Returns the visibility of the menu. This also affects the visibility + of subitems. See also Symbol.get_visibility().""" + return self.config._eval_expr(self.dep_expr) + + def get_visible_if_visibility(self): + """Returns the visibility the menu gets from its 'visible if' + condition. "y" if the menu has no 'visible if' condition.""" + return self.config._eval_expr(self.visible_if_expr) + + def get_items(self, recursive = False): + """Returns a list containing the items (symbols, menus, choice + statements and comments) in in the menu, in the same order that the + items appear within the menu. + + recursive (default: False) -- True if items contained in items within + the menu should be included + recursively (preorder).""" + + if not recursive: + return self.block.get_items() + + res = [] + for item in self.block.get_items(): + res.append(item) + if isinstance(item, Menu): + res.extend(item.get_items(True)) + elif isinstance(item, Choice): + res.extend(item.get_items()) + return res + + def get_symbols(self, recursive = False): + """Returns a list containing the symbols in the menu, in the same order + that they appear within the menu. + + recursive (default: False) -- True if symbols contained in items within + the menu should be included + recursively.""" + + return [item for item in self.get_items(recursive) if isinstance(item, Symbol)] + + def get_title(self): + """Returns the title text of the menu.""" + return self.title + + def get_parent(self): + """Returns the menu or choice statement that contains the menu, or + None if the menu is at the top level. Note that if statements are + treated as syntactic sugar and do not have an explicit class + representation.""" + return self.parent + + def get_referenced_symbols(self, refs_from_enclosing = False): + """See Symbol.get_referenced_symbols().""" + return self.all_referenced_syms if refs_from_enclosing else self.referenced_syms + + def get_location(self): + """Returns the location of the menu as a (filename, linenr) tuple, + where filename is a string and linenr an int.""" + return (self.filename, self.linenr) + + def __str__(self): + """Returns a string containing various information about the menu.""" + depends_on_str = self.config._expr_val_str(self.orig_deps, + "(no dependencies)") + visible_if_str = self.config._expr_val_str(self.visible_if_expr, + "(no dependencies)") + + additional_deps_str = " " + self.config._expr_val_str(self.deps_from_containing, + "(no additional dependencies)") + + return _sep_lines("Menu", + "Title : " + self.title, + "'depends on' dependencies : " + depends_on_str, + "'visible if' dependencies : " + visible_if_str, + "Additional dependencies from enclosing menus and if's:", + additional_deps_str, + "Location: {0}:{1}".format(self.filename, self.linenr)) + + # + # Private methods + # + + def __init__(self): + """Menu constructor -- not intended to be called directly by + kconfiglib clients.""" + + self.config = None + + self.parent = None + self.title = None + self.block = None + self.dep_expr = None + + # Dependency expression without dependencies from enclosing menus and + # if's propagated + self.orig_deps = None + + # Dependencies inherited from containing menus and if's + self.deps_from_containing = None + + # The 'visible if' expression + self.visible_if_expr = None + + # The set of symbols referenced by this menu (see + # get_referenced_symbols()) + self.referenced_syms = set() + + # Like 'referenced_syms', but includes symbols from + # dependencies inherited from enclosing menus and if's + self.all_referenced_syms = None + + self.filename = None + self.linenr = None + + def _make_conf(self): + item_conf = self.block._make_conf() + + if self.config._eval_expr(self.dep_expr) != "n" and \ + self.config._eval_expr(self.visible_if_expr) != "n": + return ["\n#\n# {0}\n#".format(self.title)] + item_conf + return item_conf + +class Choice(Item, _HasVisibility): + + """Represents a choice statement. A choice can be in one of three modes: + + "n" - The choice is not visible and no symbols can be selected. + + "m" - Any number of symbols can be set to "m". The rest will be "n". This + is safe since potentially conflicting options don't actually get + compiled into the kernel simultaneously with "m". + + "y" - One symbol will be "y" while the rest are "n". + + Only tristate choices can be in "m" mode, and the visibility of the choice + is an upper bound on the mode, so that e.g. a choice that depends on a + symbol with value "m" will be in "m" mode. + + The mode changes automatically when a value is assigned to a symbol within + the choice. + + See Symbol.get_visibility() too.""" + + # + # Public interface + # + + def get_selection(self): + """Returns the symbol selected (either by the user or through + defaults), or None if either no symbol is selected or the mode is not + "y".""" + if self.cached_selection is not None: + if self.cached_selection == NO_SELECTION: + return None + return self.cached_selection + + if self.get_mode() != "y": + return self._cache_ret(None) + + # User choice available? + if self.user_val is not None and \ + self.user_val._get_visibility() == "y": + return self._cache_ret(self.user_val) + + if self.optional: + return self._cache_ret(None) + + return self._cache_ret(self.get_selection_from_defaults()) + + def get_selection_from_defaults(self): + """Like Choice.get_selection(), but acts as if no symbol has been + selected by the user and no 'optional' flag is in effect.""" + + if self.actual_symbols == []: + return None + + for (symbol, cond_expr) in self.def_exprs: + if self.config._eval_expr(cond_expr) != "n": + chosen_symbol = symbol + break + else: + chosen_symbol = self.actual_symbols[0] + + # Is the chosen symbol visible? + if chosen_symbol._get_visibility() != "n": + return chosen_symbol + # Otherwise, pick the first visible symbol + for sym in self.actual_symbols: + if sym._get_visibility() != "n": + return sym + return None + + def get_user_selection(self): + """If the choice is in "y" mode and has a user-selected symbol, returns + that symbol. Otherwise, returns None.""" + return self.user_val + + def get_config(self): + """Returns the Config instance this choice is from.""" + return self.config + + def get_name(self): + """For named choices, returns the name. Returns None for unnamed + choices. No named choices appear anywhere in the kernel Kconfig files + as of Linux 3.7.0-rc8.""" + return self.name + + def get_prompts(self): + """Returns a list of prompts defined for the choice, in the order they + appear in the configuration files. Returns the empty list for choices + with no prompt. + + This list will have a single entry for the vast majority of choices + having prompts, but having multiple prompts for a single choice is + possible through having multiple 'choice' entries for it (though I'm + not sure if that ever happens in practice).""" + return [prompt for prompt, _ in self.orig_prompts] + + def get_help(self): + """Returns the help text of the choice, or None if the choice has no + help text.""" + return self.help + + def get_type(self): + """Returns the type of the choice. See Symbol.get_type().""" + return self.type + + def get_items(self): + """Gets all items contained in the choice in the same order as within + the configuration ("items" instead of "symbols" since choices and + comments might appear within choices. This only happens in one place as + of Linux 3.7.0-rc8, in drivers/usb/gadget/Kconfig).""" + return self.block.get_items() + + def get_symbols(self): + """Returns a list containing the choice's symbols. + + A quirk (perhaps a bug) of Kconfig is that you can put items within a + choice that will not be considered members of the choice insofar as + selection is concerned. This happens for example if one symbol within a + choice 'depends on' the symbol preceding it, or if you put non-symbol + items within choices. + + As of Linux 3.7.0-rc8, this seems to be used intentionally in one + place: drivers/usb/gadget/Kconfig. + + This function returns the "proper" symbols of the choice in the order + they appear in the choice, excluding such items. If you want all items + in the choice, use get_items().""" + return self.actual_symbols + + def get_parent(self): + """Returns the menu or choice statement that contains the choice, or + None if the choice is at the top level. Note that if statements are + treated as syntactic sugar and do not have an explicit class + representation.""" + return self.parent + + def get_referenced_symbols(self, refs_from_enclosing = False): + """See Symbol.get_referenced_symbols().""" + return self.all_referenced_syms if refs_from_enclosing else self.referenced_syms + + def get_def_locations(self): + """Returns a list of (filename, linenr) tuples, where filename (string) + and linenr (int) represent a location where the choice is defined. For + the vast majority of choices (all of them as of Linux 3.7.0-rc8) this + list will only contain one element, but its possible for named choices + to be defined in multiple locations.""" + return self.def_locations + + def get_visibility(self): + """Returns the visibility of the choice statement: one of "n", "m" or + "y". This acts as an upper limit on the mode of the choice (though bool + choices can only have the mode "y"). See the class documentation for an + explanation of modes.""" + return self._get_visibility() + + def get_mode(self): + """Returns the mode of the choice. See the class documentation for + an explanation of modes.""" + minimum_mode = "n" if self.optional else "m" + mode = self.user_mode if self.user_mode is not None else minimum_mode + mode = self.config._eval_min(mode, self._get_visibility()) + + # Promote "m" to "y" for boolean choices + if mode == "m" and self.type == BOOL: + return "y" + + return mode + + def is_optional(self): + """Returns True if the symbol has the optional flag set (and so will default + to "n" mode). Otherwise, returns False.""" + return self.optional + + def __str__(self): + """Returns a string containing various information about the choice + statement.""" + return self.config._get_sym_or_choice_str(self) + + # + # Private methods + # + + def __init__(self): + """Choice constructor -- not intended to be called directly by + kconfiglib clients.""" + + _HasVisibility.__init__(self) + + self.config = None + + self.parent = None + self.name = None # Yes, choices can be named + self.type = UNKNOWN + self.def_exprs = [] + self.help = None + self.optional = False + self.block = None + + # The prompts and default values without any dependencies from + # enclosing menus or if's propagated + + self.orig_prompts = [] + self.orig_def_exprs = [] + + # Dependencies inherited from containing menus and if's + self.deps_from_containing = None + + # We need to filter out symbols that appear within the choice block but + # are not considered choice items (see + # Choice._determine_actual_symbols()) This list holds the "actual" choice + # items. + self.actual_symbols = [] + + # The set of symbols referenced by this choice (see + # get_referenced_symbols()) + self.referenced_syms = set() + + # Like 'referenced_syms', but includes symbols from + # dependencies inherited from enclosing menus and if's + self.all_referenced_syms = set() + + # See Choice.get_def_locations() + self.def_locations = [] + + self.user_val = None + self.user_mode = None + + self.cached_selection = None + + def _determine_actual_symbols(self): + """If a symbol's visibility depends on the preceding symbol within a + choice, it is no longer viewed as a choice item (quite possibly a bug, + but some things consciously use it.. ugh. It stems from automatic + submenu creation). In addition, it's possible to have choices and + comments within choices, and those shouldn't be considered as choice + items either. Only drivers/usb/gadget/Kconfig seems to depend on any of + this. This method computes the "actual" items in the choice and sets + the is_choice_symbol_ flag on them (retrieved via is_choice_symbol()). + + Don't let this scare you: an earlier version simply checked for a + sequence of symbols where all symbols after the first appeared in the + 'depends on' expression of the first, and that worked fine. The added + complexity is to be future-proof in the event that + drivers/usb/gadget/Kconfig turns even more sinister. It might very well + be overkilling things (especially if that file is refactored ;).""" + + items = self.block.get_items() + + # Items might depend on each other in a tree structure, so we need a + # stack to keep track of the current tentative parent + stack = [] + + for item in items: + if not isinstance(item, Symbol): + stack = [] + continue + + while stack != []: + if item._has_auto_menu_dep_on(stack[-1]): + # The item should not be viewed as a choice item, so don't + # set item.is_choice_symbol_. + stack.append(item) + break + else: + stack.pop() + else: + item.is_choice_symbol_ = True + self.actual_symbols.append(item) + stack.append(item) + + def _cache_ret(self, selection): + # As None is used to indicate the lack of a cached value we can't use + # that to cache the fact that the choice has no selection. Instead, we + # use the symbolic constant NO_SELECTION. + if selection is None: + self.cached_selection = NO_SELECTION + else: + self.cached_selection = selection + + return selection + + def _invalidate(self): + _HasVisibility._invalidate(self) + self.cached_selection = None + + def _unset_user_value(self): + self._invalidate() + self.user_val = None + self.user_mode = None + + def _make_conf(self): + return self.block._make_conf() + +class Comment(Item): + + """Represents a comment statement.""" + + # + # Public interface + # + + def get_config(self): + """Returns the Config instance this comment is from.""" + return self.config + + def get_visibility(self): + """Returns the visibility of the comment. See also + Symbol.get_visibility().""" + return self.config._eval_expr(self.dep_expr) + + def get_text(self): + """Returns the text of the comment.""" + return self.text + + def get_parent(self): + """Returns the menu or choice statement that contains the comment, or + None if the comment is at the top level. Note that if statements are + treated as syntactic sugar and do not have an explicit class + representation.""" + return self.parent + + def get_referenced_symbols(self, refs_from_enclosing = False): + """See Symbol.get_referenced_symbols().""" + return self.all_referenced_syms if refs_from_enclosing else self.referenced_syms + + def get_location(self): + """Returns the location of the comment as a (filename, linenr) tuple, + where filename is a string and linenr an int.""" + return (self.filename, self.linenr) + + def __str__(self): + """Returns a string containing various information about the comment.""" + dep_str = self.config._expr_val_str(self.orig_deps, "(no dependencies)") + + additional_deps_str = " " + self.config._expr_val_str(self.deps_from_containing, + "(no additional dependencies)") + + return _sep_lines("Comment", + "Text: " + str(self.text), + "Dependencies: " + dep_str, + "Additional dependencies from enclosing menus and if's:", + additional_deps_str, + "Location: {0}:{1}".format(self.filename, self.linenr)) + + # + # Private methods + # + + def __init__(self): + """Comment constructor -- not intended to be called directly by + kconfiglib clients.""" + + self.config = None + + self.parent = None + self.text = None + self.dep_expr = None + + # Dependency expression without dependencies from enclosing menus and + # if's propagated + self.orig_deps = None + + # Dependencies inherited from containing menus and if's + self.deps_from_containing = None + + # The set of symbols referenced by this comment (see + # get_referenced_symbols()) + self.referenced_syms = set() + + # Like 'referenced_syms', but includes symbols from + # dependencies inherited from enclosing menus and if's + self.all_referenced_syms = None + + self.filename = None + self.linenr = None + + def _make_conf(self): + if self.config._eval_expr(self.dep_expr) != "n": + return ["\n#\n# {0}\n#".format(self.text)] + return [] + +class _Feed: + + """Class for working with sequences in a stream-like fashion; handy for tokens.""" + + def __init__(self, items): + self.items = items + self.length = len(self.items) + self.i = 0 + + def get_next(self): + if self.i >= self.length: + return None + + item = self.items[self.i] + self.i += 1 + return item + + def peek_next(self): + return None if self.i >= self.length else self.items[self.i] + + def go_to_start(self): + self.i = 0 + + def __getitem__(self, index): + return self.items[index] + + def __len__(self): + return len(self.items) + + def is_empty(self): + return self.items == [] + + def check(self, token): + """Check if the next token is 'token'. If so, remove it from the token + feed and return True. Otherwise, leave it in and return False.""" + if self.i >= self.length: + return None + + if self.items[self.i] == token: + self.i += 1 + return True + + return False + + def remove_while(self, pred): + while self.i < self.length and pred(self.items[self.i]): + self.i += 1 + + def go_back(self): + if self.i <= 0: + _internal_error("Attempt to move back in Feed while already at the beginning.") + self.i -= 1 + +class _FileFeed(_Feed): + + """Feed subclass that keeps track of the current filename and line + number.""" + + def __init__(self, lines, filename): + self.filename = _clean_up_path(filename) + _Feed.__init__(self, lines) + + def get_filename(self): + return self.filename + + def get_linenr(self): + return self.i + +# +# Misc. public global utility functions +# + +def tri_less(v1, v2): + """Returns True if the tristate v1 is less than the tristate v2, where "n", + "m" and "y" are ordered from lowest to highest. Otherwise, returns + False.""" + return tri_to_int[v1] < tri_to_int[v2] + +def tri_less_eq(v1, v2): + """Returns True if the tristate v1 is less than or equal to the tristate + v2, where "n", "m" and "y" are ordered from lowest to highest. Otherwise, + returns False.""" + return tri_to_int[v1] <= tri_to_int[v2] + +def tri_greater(v1, v2): + """Returns True if the tristate v1 is greater than the tristate v2, where + "n", "m" and "y" are ordered from lowest to highest. Otherwise, returns + False.""" + return tri_to_int[v1] > tri_to_int[v2] + +def tri_greater_eq(v1, v2): + """Returns True if the tristate v1 is greater than or equal to the tristate + v2, where "n", "m" and "y" are ordered from lowest to highest. Otherwise, + returns False.""" + return tri_to_int[v1] >= tri_to_int[v2] + +# +# Helper functions, mostly related to text processing +# + +def _strip_quotes(s, line, filename, linenr): + """Removes any quotes surrounding 's' if it has them; otherwise returns 's' + unmodified.""" + s = s.strip() + if not s: + return "" + if s[0] == '"' or s[0] == "'": + if len(s) < 2 or s[-1] != s[0]: + _parse_error(line, + "malformed string literal", + filename, + linenr) + return s[1:-1] + return s + +def _indentation(line): + """Returns the indentation of the line, treating tab stops as being spaced + 8 characters apart.""" + if line.isspace(): + _internal_error("Attempt to take indentation of blank line.") + indent = 0 + for c in line: + if c == " ": + indent += 1 + elif c == "\t": + # Go to the next tab stop + indent = (indent + 8) & ~7 + else: + return indent + +def _deindent(line, indent): + """Deindent 'line' by 'indent' spaces.""" + line = line.expandtabs() + if len(line) <= indent: + return line + return line[indent:] + +def _is_base_n(s, n): + try: + int(s, n) + return True + except ValueError: + return False + +def _sep_lines(*args): + """Returns a string comprised of all arguments, with newlines inserted + between them.""" + return "\n".join(args) + +def _comment(s): + """Returns a new string with "#" inserted before each line in 's'.""" + if not s: + return "#" + res = "".join(["#" + line for line in s.splitlines(True)]) + if s.endswith("\n"): + return res + "#" + return res + +def _get_lines(filename): + """Returns a list of lines from 'filename', joining any line ending in \\ + with the following line.""" + with open(filename, "r") as f: + lines = [] + accum = "" + while 1: + line = f.readline() + + if line == "": + return lines + + if line.endswith("\\\n"): + accum += line[:-2] + else: + accum += line + lines.append(accum) + accum = "" + +def _strip_trailing_slash(path): + """Removes any trailing slash from 'path'.""" + return path[:-1] if path.endswith("/") else path + +def _clean_up_path(path): + """Strips any initial "./" and trailing slash from 'path'.""" + if path.startswith("./"): + path = path[2:] + return _strip_trailing_slash(path) + +# +# Error handling +# + +class Kconfig_Syntax_Error(Exception): + """Exception raised for syntax errors.""" + pass + +class Internal_Error(Exception): + """Exception raised for internal errors.""" + pass + +def _tokenization_error(s, index, filename, linenr): + if filename is not None: + assert linenr is not None + sys.stderr.write("{0}:{1}:\n".format(filename, linenr)) + + if s.endswith("\n"): + s = s[:-1] + + # Calculate the visual offset corresponding to index 'index' in 's' + # assuming tabstops are spaced 8 characters apart + vis_index = 0 + for c in s[:index]: + if c == "\t": + vis_index = (vis_index + 8) & ~7 + else: + vis_index += 1 + + # Don't output actual tabs to be independent of how the terminal renders + # them + s = s.expandtabs() + + raise Kconfig_Syntax_Error, ( + _sep_lines("Error during tokenization at location indicated by caret.\n", + s, + " " * vis_index + "^\n")) + +def _parse_error(s, msg, filename, linenr): + error_str = "" + + if filename is not None: + assert linenr is not None + error_str += "{0}:{1}: ".format(filename, linenr) + + if s.endswith("\n"): + s = s[:-1] + + error_str += 'Error while parsing "{0}"'.format(s) + \ + ("." if msg is None else ": " + msg) + + raise Kconfig_Syntax_Error, error_str + +def _internal_error(msg): + msg += "\nSorry! You may want to send an email to kconfiglib@gmail.com " \ + "to tell me about this. Include the message above and the stack " \ + "trace and describe what you were doing." + + raise Internal_Error, msg + +if use_psyco: + import psyco + + Config._tokenize = psyco.proxy(Config._tokenize) + Config._eval_expr = psyco.proxy(Config._eval_expr) + + _indentation = psyco.proxy(_indentation) + _get_lines = psyco.proxy(_get_lines) diff --git a/tools/buildman/test.py b/tools/buildman/test.py index a51c9429e9..a2a85ac9ce 100644 --- a/tools/buildman/test.py +++ b/tools/buildman/test.py @@ -21,20 +21,21 @@ import builder import control import command import commit +import terminal import toolchain errors = [ '''main.c: In function 'main_loop': main.c:260:6: warning: unused variable 'joe' [-Wunused-variable] ''', - '''main.c: In function 'main_loop': + '''main.c: In function 'main_loop2': main.c:295:2: error: 'fred' undeclared (first use in this function) main.c:295:2: note: each undeclared identifier is reported only once for each function it appears in make[1]: *** [main.o] Error 1 make: *** [common/libcommon.o] Error 2 Make failed ''', - '''main.c: In function 'main_loop': + '''main.c: In function 'main_loop3': main.c:280:6: warning: unused variable 'mary' [-Wunused-variable] ''', '''powerpc-linux-ld: warning: dot moved backwards before `.bss' @@ -45,6 +46,20 @@ powerpc-linux-ld: u-boot: section .reloc lma 0xffffa400 overlaps previous sectio powerpc-linux-ld: u-boot: section .data lma 0xffffcd38 overlaps previous sections powerpc-linux-ld: u-boot: section .u_boot_cmd lma 0xffffeb40 overlaps previous sections powerpc-linux-ld: u-boot: section .bootpg lma 0xfffff198 overlaps previous sections +''', + '''In file included from %(basedir)sarch/sandbox/cpu/cpu.c:9:0: +%(basedir)sarch/sandbox/include/asm/state.h:44:0: warning: "xxxx" redefined [enabled by default] +%(basedir)sarch/sandbox/include/asm/state.h:43:0: note: this is the location of the previous definition +%(basedir)sarch/sandbox/cpu/cpu.c: In function 'do_reset': +%(basedir)sarch/sandbox/cpu/cpu.c:27:1: error: unknown type name 'blah' +%(basedir)sarch/sandbox/cpu/cpu.c:28:12: error: expected declaration specifiers or '...' before numeric constant +make[2]: *** [arch/sandbox/cpu/cpu.o] Error 1 +make[1]: *** [arch/sandbox/cpu] Error 2 +make[1]: *** Waiting for unfinished jobs.... +In file included from %(basedir)scommon/board_f.c:55:0: +%(basedir)sarch/sandbox/include/asm/state.h:44:0: warning: "xxxx" redefined [enabled by default] +%(basedir)sarch/sandbox/include/asm/state.h:43:0: note: this is the location of the previous definition +make: *** [sub-make] Error 2 ''' ] @@ -56,7 +71,8 @@ commits = [ ['9012', 'Third commit, error', 1, errors[0:2]], ['3456', 'Fourth commit, warning', 0, [errors[0], errors[2]]], ['7890', 'Fifth commit, link errors', 1, [errors[0], errors[3]]], - ['abcd', 'Sixth commit, fixes all errors', 0, []] + ['abcd', 'Sixth commit, fixes all errors', 0, []], + ['ef01', 'Seventh commit, check directory suppression', 1, [errors[4]]], ] boards = [ @@ -103,16 +119,24 @@ class TestBuild(unittest.TestCase): self.toolchains.Add('powerpc-linux-gcc', test=False) self.toolchains.Add('gcc', test=False) + # Avoid sending any output + terminal.SetPrintTestMode() + self._col = terminal.Color() + def Make(self, commit, brd, stage, *args, **kwargs): + global base_dir + result = command.CommandResult() boardnum = int(brd.target[-1]) result.return_code = 0 result.stderr = '' result.stdout = ('This is the test output for board %s, commit %s' % (brd.target, commit.hash)) - if boardnum >= 1 and boardnum >= commit.sequence: + if ((boardnum >= 1 and boardnum >= commit.sequence) or + boardnum == 4 and commit.sequence == 6): result.return_code = commit.return_code - result.stderr = ''.join(commit.error_list) + result.stderr = (''.join(commit.error_list) + % {'basedir' : base_dir + '/.bm-work/00/'}) if stage == 'build': target_dir = None for arg in args: @@ -121,25 +145,129 @@ class TestBuild(unittest.TestCase): if not os.path.isdir(target_dir): os.mkdir(target_dir) - #time.sleep(.2 + boardnum * .2) result.combined = result.stdout + result.stderr return result - def testBasic(self): - """Test basic builder operation""" - output_dir = tempfile.mkdtemp() - if not os.path.isdir(output_dir): - os.mkdir(output_dir) - build = builder.Builder(self.toolchains, output_dir, None, 1, 2, + def assertSummary(self, text, arch, plus, boards, ok=False): + col = self._col + expected_colour = col.GREEN if ok else col.RED + expect = '%10s: ' % arch + # TODO(sjg@chromium.org): If plus is '', we shouldn't need this + expect += col.Color(expected_colour, plus) + expect += ' ' + for board in boards: + expect += col.Color(expected_colour, ' %s' % board) + self.assertEqual(text, expect) + + def testOutput(self): + """Test basic builder operation and output + + This does a line-by-line verification of the summary output. + """ + global base_dir + + base_dir = tempfile.mkdtemp() + if not os.path.isdir(base_dir): + os.mkdir(base_dir) + build = builder.Builder(self.toolchains, base_dir, None, 1, 2, checkout=False, show_unknown=False) build.do_make = self.Make board_selected = self.boards.GetSelectedDict() build.BuildBoards(self.commits, board_selected, keep_outputs=False, verbose=False) + lines = terminal.GetPrintTestLines() + count = 0 + for line in lines: + if line.text.strip(): + count += 1 + + # We should get one starting message, then an update for every commit + # built. + self.assertEqual(count, len(commits) * len(boards) + 1) build.SetDisplayOptions(show_errors=True); build.ShowSummary(self.commits, board_selected) + #terminal.EchoPrintTestLines() + lines = terminal.GetPrintTestLines() + self.assertEqual(lines[0].text, '01: %s' % commits[0][1]) + self.assertEqual(lines[1].text, '02: %s' % commits[1][1]) + + # We expect all archs to fail + col = terminal.Color() + self.assertSummary(lines[2].text, 'sandbox', '+', ['board4']) + self.assertSummary(lines[3].text, 'arm', '+', ['board1']) + self.assertSummary(lines[4].text, 'powerpc', '+', ['board2', 'board3']) + + # Now we should have the compiler warning + self.assertEqual(lines[5].text, 'w+%s' % + errors[0].rstrip().replace('\n', '\nw+')) + self.assertEqual(lines[5].colour, col.MAGENTA) + + self.assertEqual(lines[6].text, '03: %s' % commits[2][1]) + self.assertSummary(lines[7].text, 'sandbox', '+', ['board4']) + self.assertSummary(lines[8].text, 'arm', '', ['board1'], ok=True) + self.assertSummary(lines[9].text, 'powerpc', '+', ['board2', 'board3']) + + # Compiler error + self.assertEqual(lines[10].text, '+%s' % + errors[1].rstrip().replace('\n', '\n+')) + + self.assertEqual(lines[11].text, '04: %s' % commits[3][1]) + self.assertSummary(lines[12].text, 'sandbox', '', ['board4'], ok=True) + self.assertSummary(lines[13].text, 'powerpc', '', ['board2', 'board3'], + ok=True) + + # Compile error fixed + self.assertEqual(lines[14].text, '-%s' % + errors[1].rstrip().replace('\n', '\n-')) + self.assertEqual(lines[14].colour, col.GREEN) + + self.assertEqual(lines[15].text, 'w+%s' % + errors[2].rstrip().replace('\n', '\nw+')) + self.assertEqual(lines[15].colour, col.MAGENTA) + + self.assertEqual(lines[16].text, '05: %s' % commits[4][1]) + self.assertSummary(lines[17].text, 'sandbox', '+', ['board4']) + self.assertSummary(lines[18].text, 'powerpc', '', ['board3'], ok=True) + + # The second line of errors[3] is a duplicate, so buildman will drop it + expect = errors[3].rstrip().split('\n') + expect = [expect[0]] + expect[2:] + self.assertEqual(lines[19].text, '+%s' % + '\n'.join(expect).replace('\n', '\n+')) + + self.assertEqual(lines[20].text, 'w-%s' % + errors[2].rstrip().replace('\n', '\nw-')) + + self.assertEqual(lines[21].text, '06: %s' % commits[5][1]) + self.assertSummary(lines[22].text, 'sandbox', '', ['board4'], ok=True) + + # The second line of errors[3] is a duplicate, so buildman will drop it + expect = errors[3].rstrip().split('\n') + expect = [expect[0]] + expect[2:] + self.assertEqual(lines[23].text, '-%s' % + '\n'.join(expect).replace('\n', '\n-')) + + self.assertEqual(lines[24].text, 'w-%s' % + errors[0].rstrip().replace('\n', '\nw-')) + + self.assertEqual(lines[25].text, '07: %s' % commits[6][1]) + self.assertSummary(lines[26].text, 'sandbox', '+', ['board4']) + + # Pick out the correct error lines + expect_str = errors[4].rstrip().replace('%(basedir)s', '').split('\n') + expect = expect_str[3:8] + [expect_str[-1]] + self.assertEqual(lines[27].text, '+%s' % + '\n'.join(expect).replace('\n', '\n+')) + + # Now the warnings lines + expect = [expect_str[0]] + expect_str[10:12] + [expect_str[9]] + self.assertEqual(lines[28].text, 'w+%s' % + '\n'.join(expect).replace('\n', '\nw+')) + + self.assertEqual(len(lines), 29) + shutil.rmtree(base_dir) def _testGit(self): """Test basic builder operation by building a branch""" @@ -164,6 +292,7 @@ class TestBuild(unittest.TestCase): options.keep_outputs = False args = ['tegra20'] control.DoBuildman(options, args) + shutil.rmtree(base_dir) def testBoardSingle(self): """Test single board selection""" diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py index 1b9771f8e6..27dc31889b 100644 --- a/tools/buildman/toolchain.py +++ b/tools/buildman/toolchain.py @@ -99,6 +99,9 @@ class Toolchains: def __init__(self): self.toolchains = {} self.paths = [] + self._make_flags = dict(bsettings.GetItems('make-flags')) + + def GetSettings(self): toolchains = bsettings.GetItems('toolchain') if not toolchains: print ("Warning: No tool chains - please add a [toolchain] section" @@ -110,7 +113,6 @@ class Toolchains: self.paths += glob.glob(value) else: self.paths.append(value) - self._make_flags = dict(bsettings.GetItems('make-flags')) def Add(self, fname, test=True, verbose=False): """Add a toolchain to our list @@ -198,7 +200,7 @@ class Toolchains: >>> tcs.ResolveReferences(var_dict, 'this=${oblique}_set${first}nd') 'this=OBLIQUE_setfi2ndrstnd' """ - re_var = re.compile('(\$\{[a-z0-9A-Z]{1,}\})') + re_var = re.compile('(\$\{[-_a-z0-9A-Z]{1,}\})') while True: m = re_var.search(args) diff --git a/tools/genboardscfg.py b/tools/genboardscfg.py index e6870f5bba..654100bf07 100755 --- a/tools/genboardscfg.py +++ b/tools/genboardscfg.py @@ -6,34 +6,33 @@ # """ -Converter from Kconfig and MAINTAINERS to boards.cfg +Converter from Kconfig and MAINTAINERS to a board database. -Run 'tools/genboardscfg.py' to create boards.cfg file. +Run 'tools/genboardscfg.py' to create a board database. Run 'tools/genboardscfg.py -h' for available options. -This script only works on python 2.6 or later, but not python 3.x. +Python 2.6 or later, but not Python 3.x is necessary to run this script. """ import errno import fnmatch import glob +import multiprocessing import optparse import os -import re -import shutil import subprocess import sys import tempfile import time -BOARD_FILE = 'boards.cfg' -CONFIG_DIR = 'configs' -REFORMAT_CMD = [os.path.join('tools', 'reformat.py'), - '-i', '-d', '-', '-s', '8'] -SHOW_GNU_MAKE = 'scripts/show-gnu-make' -SLEEP_TIME=0.003 +sys.path.append(os.path.join(os.path.dirname(__file__), 'buildman')) +import kconfiglib +### constant variables ### +OUTPUT_FILE = 'boards.cfg' +CONFIG_DIR = 'configs' +SLEEP_TIME = 0.03 COMMENT_BLOCK = '''# # List of boards # Automatically generated by %s: don't edit @@ -43,35 +42,14 @@ COMMENT_BLOCK = '''# ''' % __file__ ### helper functions ### -def get_terminal_columns(): - """Get the width of the terminal. - - Returns: - The width of the terminal, or zero if the stdout is not - associated with tty. - """ +def try_remove(f): + """Remove a file ignoring 'No such file or directory' error.""" try: - return shutil.get_terminal_size().columns # Python 3.3~ - except AttributeError: - import fcntl - import termios - import struct - arg = struct.pack('hhhh', 0, 0, 0, 0) - try: - ret = fcntl.ioctl(sys.stdout.fileno(), termios.TIOCGWINSZ, arg) - except IOError as exception: - # If 'Inappropriate ioctl for device' error occurs, - # stdout is probably redirected. Return 0. - return 0 - return struct.unpack('hhhh', ret)[1] - -def get_devnull(): - """Get the file object of '/dev/null' device.""" - try: - devnull = subprocess.DEVNULL # py3k - except AttributeError: - devnull = open(os.devnull, 'wb') - return devnull + os.remove(f) + except OSError as exception: + # Ignore 'No such file or directory' error + if exception.errno != errno.ENOENT: + raise def check_top_directory(): """Exit if we are not at the top of source directory.""" @@ -79,23 +57,15 @@ def check_top_directory(): if not os.path.exists(f): sys.exit('Please run at the top of source directory.') -def get_make_cmd(): - """Get the command name of GNU Make.""" - process = subprocess.Popen([SHOW_GNU_MAKE], stdout=subprocess.PIPE) - ret = process.communicate() - if process.returncode: - sys.exit('GNU Make not found') - return ret[0].rstrip() - -def output_is_new(): - """Check if the boards.cfg file is up to date. +def output_is_new(output): + """Check if the output file is up to date. Returns: - True if the boards.cfg file exists and is newer than any of + True if the given output file exists and is newer than any of *_defconfig, MAINTAINERS and Kconfig*. False otherwise. """ try: - ctime = os.path.getctime(BOARD_FILE) + ctime = os.path.getctime(output) except OSError as exception: if exception.errno == errno.ENOENT: # return False on 'No such file or directory' error @@ -121,9 +91,9 @@ def output_is_new(): if ctime < os.path.getctime(filepath): return False - # Detect a board that has been removed since the current boards.cfg + # Detect a board that has been removed since the current board database # was generated - with open(BOARD_FILE) as f: + with open(output) as f: for line in f: if line[0] == '#' or line == '\n': continue @@ -134,6 +104,172 @@ def output_is_new(): return True ### classes ### +class KconfigScanner: + + """Kconfig scanner.""" + + ### constant variable only used in this class ### + _SYMBOL_TABLE = { + 'arch' : 'SYS_ARCH', + 'cpu' : 'SYS_CPU', + 'soc' : 'SYS_SOC', + 'vendor' : 'SYS_VENDOR', + 'board' : 'SYS_BOARD', + 'config' : 'SYS_CONFIG_NAME', + 'options' : 'SYS_EXTRA_OPTIONS' + } + + def __init__(self): + """Scan all the Kconfig files and create a Config object.""" + # Define environment variables referenced from Kconfig + os.environ['srctree'] = os.getcwd() + os.environ['UBOOTVERSION'] = 'dummy' + os.environ['KCONFIG_OBJDIR'] = '' + self._conf = kconfiglib.Config() + + def __del__(self): + """Delete a leftover temporary file before exit. + + The scan() method of this class creates a temporay file and deletes + it on success. If scan() method throws an exception on the way, + the temporary file might be left over. In that case, it should be + deleted in this destructor. + """ + if hasattr(self, '_tmpfile') and self._tmpfile: + try_remove(self._tmpfile) + + def scan(self, defconfig): + """Load a defconfig file to obtain board parameters. + + Arguments: + defconfig: path to the defconfig file to be processed + + Returns: + A dictionary of board parameters. It has a form of: + { + 'arch': <arch_name>, + 'cpu': <cpu_name>, + 'soc': <soc_name>, + 'vendor': <vendor_name>, + 'board': <board_name>, + 'target': <target_name>, + 'config': <config_header_name>, + 'options': <extra_options> + } + """ + # strip special prefixes and save it in a temporary file + fd, self._tmpfile = tempfile.mkstemp() + with os.fdopen(fd, 'w') as f: + for line in open(defconfig): + colon = line.find(':CONFIG_') + if colon == -1: + f.write(line) + else: + f.write(line[colon + 1:]) + + self._conf.load_config(self._tmpfile) + + try_remove(self._tmpfile) + self._tmpfile = None + + params = {} + + # Get the value of CONFIG_SYS_ARCH, CONFIG_SYS_CPU, ... etc. + # Set '-' if the value is empty. + for key, symbol in self._SYMBOL_TABLE.items(): + value = self._conf.get_symbol(symbol).get_value() + if value: + params[key] = value + else: + params[key] = '-' + + defconfig = os.path.basename(defconfig) + params['target'], match, rear = defconfig.partition('_defconfig') + assert match and not rear, '%s : invalid defconfig' % defconfig + + # fix-up for aarch64 + if params['arch'] == 'arm' and params['cpu'] == 'armv8': + params['arch'] = 'aarch64' + + # fix-up options field. It should have the form: + # <config name>[:comma separated config options] + if params['options'] != '-': + params['options'] = params['config'] + ':' + \ + params['options'].replace(r'\"', '"') + elif params['config'] != params['target']: + params['options'] = params['config'] + + return params + +def scan_defconfigs_for_multiprocess(queue, defconfigs): + """Scan defconfig files and queue their board parameters + + This function is intended to be passed to + multiprocessing.Process() constructor. + + Arguments: + queue: An instance of multiprocessing.Queue(). + The resulting board parameters are written into it. + defconfigs: A sequence of defconfig files to be scanned. + """ + kconf_scanner = KconfigScanner() + for defconfig in defconfigs: + queue.put(kconf_scanner.scan(defconfig)) + +def read_queues(queues, params_list): + """Read the queues and append the data to the paramers list""" + for q in queues: + while not q.empty(): + params_list.append(q.get()) + +def scan_defconfigs(jobs=1): + """Collect board parameters for all defconfig files. + + This function invokes multiple processes for faster processing. + + Arguments: + jobs: The number of jobs to run simultaneously + """ + all_defconfigs = [] + for (dirpath, dirnames, filenames) in os.walk(CONFIG_DIR): + for filename in fnmatch.filter(filenames, '*_defconfig'): + if fnmatch.fnmatch(filename, '.*'): + continue + all_defconfigs.append(os.path.join(dirpath, filename)) + + total_boards = len(all_defconfigs) + processes = [] + queues = [] + for i in range(jobs): + defconfigs = all_defconfigs[total_boards * i / jobs : + total_boards * (i + 1) / jobs] + q = multiprocessing.Queue(maxsize=-1) + p = multiprocessing.Process(target=scan_defconfigs_for_multiprocess, + args=(q, defconfigs)) + p.start() + processes.append(p) + queues.append(q) + + # The resulting data should be accumulated to this list + params_list = [] + + # Data in the queues should be retrieved preriodically. + # Otherwise, the queues would become full and subprocesses would get stuck. + while any([p.is_alive() for p in processes]): + read_queues(queues, params_list) + # sleep for a while until the queues are filled + time.sleep(SLEEP_TIME) + + # Joining subprocesses just in case + # (All subprocesses should already have been finished) + for p in processes: + p.join() + + # retrieve leftover data + read_queues(queues, params_list) + + return params_list + class MaintainersDatabase: """The database of board status and maintainers.""" @@ -145,8 +281,12 @@ class MaintainersDatabase: def get_status(self, target): """Return the status of the given board. + The board status is generally either 'Active' or 'Orphan'. + Display a warning message and return '-' if status information + is not found. + Returns: - Either 'Active' or 'Orphan' + 'Active', 'Orphan' or '-'. """ if not target in self.database: print >> sys.stderr, "WARNING: no status info for '%s'" % target @@ -165,8 +305,9 @@ class MaintainersDatabase: def get_maintainers(self, target): """Return the maintainers of the given board. - If the board has two or more maintainers, they are separated - with colons. + Returns: + Maintainers of the board. If the board has two or more maintainers, + they are separated with colons. """ if not target in self.database: print >> sys.stderr, "WARNING: no maintainers for '%s'" % target @@ -175,10 +316,10 @@ class MaintainersDatabase: return ':'.join(self.database[target][1]) def parse_file(self, file): - """Parse the given MAINTAINERS file. + """Parse a MAINTAINERS file. - This method parses MAINTAINERS and add board status and - maintainers information to the database. + Parse a MAINTAINERS file and accumulates board status and + maintainers information. Arguments: file: MAINTAINERS file to be parsed @@ -210,414 +351,91 @@ class MaintainersDatabase: for target in targets: self.database[target] = (status, maintainers) -class DotConfigParser: +def insert_maintainers_info(params_list): + """Add Status and Maintainers information to the board parameters list. - """A parser of .config file. - - Each line of the output should have the form of: - Status, Arch, CPU, SoC, Vendor, Board, Target, Options, Maintainers - Most of them are extracted from .config file. - MAINTAINERS files are also consulted for Status and Maintainers fields. + Arguments: + params_list: A list of the board parameters """ + database = MaintainersDatabase() + for (dirpath, dirnames, filenames) in os.walk('.'): + if 'MAINTAINERS' in filenames: + database.parse_file(os.path.join(dirpath, 'MAINTAINERS')) - re_arch = re.compile(r'CONFIG_SYS_ARCH="(.*)"') - re_cpu = re.compile(r'CONFIG_SYS_CPU="(.*)"') - re_soc = re.compile(r'CONFIG_SYS_SOC="(.*)"') - re_vendor = re.compile(r'CONFIG_SYS_VENDOR="(.*)"') - re_board = re.compile(r'CONFIG_SYS_BOARD="(.*)"') - re_config = re.compile(r'CONFIG_SYS_CONFIG_NAME="(.*)"') - re_options = re.compile(r'CONFIG_SYS_EXTRA_OPTIONS="(.*)"') - re_list = (('arch', re_arch), ('cpu', re_cpu), ('soc', re_soc), - ('vendor', re_vendor), ('board', re_board), - ('config', re_config), ('options', re_options)) - must_fields = ('arch', 'config') - - def __init__(self, build_dir, output, maintainers_database): - """Create a new .config perser. + for i, params in enumerate(params_list): + target = params['target'] + params['status'] = database.get_status(target) + params['maintainers'] = database.get_maintainers(target) + params_list[i] = params - Arguments: - build_dir: Build directory where .config is located - output: File object which the result is written to - maintainers_database: An instance of class MaintainersDatabase - """ - self.dotconfig = os.path.join(build_dir, '.config') - self.output = output - self.database = maintainers_database +def format_and_output(params_list, output): + """Write board parameters into a file. - def parse(self, defconfig): - """Parse .config file and output one-line database for the given board. - - Arguments: - defconfig: Board (defconfig) name - """ - fields = {} - for line in open(self.dotconfig): - if not line.startswith('CONFIG_SYS_'): - continue - for (key, pattern) in self.re_list: - m = pattern.match(line) - if m and m.group(1): - fields[key] = m.group(1) - break - - # sanity check of '.config' file - for field in self.must_fields: - if not field in fields: - print >> sys.stderr, ( - "WARNING: '%s' is not defined in '%s'. Skip." % - (field, defconfig)) - return + Columnate the board parameters, sort lines alphabetically, + and then write them to a file. - # fix-up for aarch64 - if fields['arch'] == 'arm' and 'cpu' in fields: - if fields['cpu'] == 'armv8': - fields['arch'] = 'aarch64' - - target, match, rear = defconfig.partition('_defconfig') - assert match and not rear, \ - '%s : invalid defconfig file name' % defconfig - - fields['status'] = self.database.get_status(target) - fields['maintainers'] = self.database.get_maintainers(target) - - if 'options' in fields: - options = fields['config'] + ':' + \ - fields['options'].replace(r'\"', '"') - elif fields['config'] != target: - options = fields['config'] - else: - options = '-' - - self.output.write((' '.join(['%s'] * 9) + '\n') % - (fields['status'], - fields['arch'], - fields.get('cpu', '-'), - fields.get('soc', '-'), - fields.get('vendor', '-'), - fields.get('board', '-'), - target, - options, - fields['maintainers'])) - -class Slot: - - """A slot to store a subprocess. - - Each instance of this class handles one subprocess. - This class is useful to control multiple processes - for faster processing. + Arguments: + params_list: The list of board parameters + output: The path to the output file """ + FIELDS = ('status', 'arch', 'cpu', 'soc', 'vendor', 'board', 'target', + 'options', 'maintainers') - def __init__(self, output, maintainers_database, devnull, make_cmd): - """Create a new slot. - - Arguments: - output: File object which the result is written to - maintainers_database: An instance of class MaintainersDatabase - devnull: file object of 'dev/null' - make_cmd: the command name of Make - """ - self.build_dir = tempfile.mkdtemp() - self.devnull = devnull - self.ps = subprocess.Popen([make_cmd, 'O=' + self.build_dir, - 'allnoconfig'], stdout=devnull) - self.occupied = True - self.parser = DotConfigParser(self.build_dir, output, - maintainers_database) - self.env = os.environ.copy() - self.env['srctree'] = os.getcwd() - self.env['UBOOTVERSION'] = 'dummy' - self.env['KCONFIG_OBJDIR'] = '' - - def __del__(self): - """Delete the working directory""" - if not self.occupied: - while self.ps.poll() == None: - pass - shutil.rmtree(self.build_dir) - - def add(self, defconfig): - """Add a new subprocess to the slot. + # First, decide the width of each column + max_length = dict([ (f, 0) for f in FIELDS]) + for params in params_list: + for f in FIELDS: + max_length[f] = max(max_length[f], len(params[f])) - Fails if the slot is occupied, that is, the current subprocess - is still running. + output_lines = [] + for params in params_list: + line = '' + for f in FIELDS: + # insert two spaces between fields like column -t would + line += ' ' + params[f].ljust(max_length[f]) + output_lines.append(line.strip()) - Arguments: - defconfig: Board (defconfig) name - - Returns: - Return True on success or False on fail - """ - if self.occupied: - return False - - with open(os.path.join(self.build_dir, '.tmp_defconfig'), 'w') as f: - for line in open(os.path.join(CONFIG_DIR, defconfig)): - colon = line.find(':CONFIG_') - if colon == -1: - f.write(line) - else: - f.write(line[colon + 1:]) - - self.ps = subprocess.Popen([os.path.join('scripts', 'kconfig', 'conf'), - '--defconfig=.tmp_defconfig', 'Kconfig'], - stdout=self.devnull, - cwd=self.build_dir, - env=self.env) - - self.defconfig = defconfig - self.occupied = True - return True - - def wait(self): - """Wait until the current subprocess finishes.""" - while self.occupied and self.ps.poll() == None: - time.sleep(SLEEP_TIME) - self.occupied = False - - def poll(self): - """Check if the subprocess is running and invoke the .config - parser if the subprocess is terminated. - - Returns: - Return True if the subprocess is terminated, False otherwise - """ - if not self.occupied: - return True - if self.ps.poll() == None: - return False - if self.ps.poll() == 0: - self.parser.parse(self.defconfig) - else: - print >> sys.stderr, ("WARNING: failed to process '%s'. skip." % - self.defconfig) - self.occupied = False - return True - -class Slots: - - """Controller of the array of subprocess slots.""" - - def __init__(self, jobs, output, maintainers_database): - """Create a new slots controller. - - Arguments: - jobs: A number of slots to instantiate - output: File object which the result is written to - maintainers_database: An instance of class MaintainersDatabase - """ - self.slots = [] - devnull = get_devnull() - make_cmd = get_make_cmd() - for i in range(jobs): - self.slots.append(Slot(output, maintainers_database, - devnull, make_cmd)) - for slot in self.slots: - slot.wait() - - def add(self, defconfig): - """Add a new subprocess if a vacant slot is available. - - Arguments: - defconfig: Board (defconfig) name - - Returns: - Return True on success or False on fail - """ - for slot in self.slots: - if slot.add(defconfig): - return True - return False - - def available(self): - """Check if there is a vacant slot. - - Returns: - Return True if a vacant slot is found, False if all slots are full - """ - for slot in self.slots: - if slot.poll(): - return True - return False - - def empty(self): - """Check if all slots are vacant. - - Returns: - Return True if all slots are vacant, False if at least one slot - is running - """ - ret = True - for slot in self.slots: - if not slot.poll(): - ret = False - return ret - -class Indicator: - - """A class to control the progress indicator.""" - - MIN_WIDTH = 15 - MAX_WIDTH = 70 - - def __init__(self, total): - """Create an instance. - - Arguments: - total: A number of boards - """ - self.total = total - self.cur = 0 - width = get_terminal_columns() - width = min(width, self.MAX_WIDTH) - width -= self.MIN_WIDTH - if width > 0: - self.enabled = True - else: - self.enabled = False - self.width = width - - def inc(self): - """Increment the counter and show the progress bar.""" - if not self.enabled: - return - self.cur += 1 - arrow_len = self.width * self.cur // self.total - msg = '%4d/%d [' % (self.cur, self.total) - msg += '=' * arrow_len + '>' + ' ' * (self.width - arrow_len) + ']' - sys.stdout.write('\r' + msg) - sys.stdout.flush() - -class BoardsFileGenerator: - - """Generator of boards.cfg.""" - - def __init__(self): - """Prepare basic things for generating boards.cfg.""" - # All the defconfig files to be processed - defconfigs = [] - for (dirpath, dirnames, filenames) in os.walk(CONFIG_DIR): - dirpath = dirpath[len(CONFIG_DIR) + 1:] - for filename in fnmatch.filter(filenames, '*_defconfig'): - if fnmatch.fnmatch(filename, '.*'): - continue - defconfigs.append(os.path.join(dirpath, filename)) - self.defconfigs = defconfigs - self.indicator = Indicator(len(defconfigs)) - - # Parse all the MAINTAINERS files - maintainers_database = MaintainersDatabase() - for (dirpath, dirnames, filenames) in os.walk('.'): - if 'MAINTAINERS' in filenames: - maintainers_database.parse_file(os.path.join(dirpath, - 'MAINTAINERS')) - self.maintainers_database = maintainers_database - - def __del__(self): - """Delete the incomplete boards.cfg - - This destructor deletes boards.cfg if the private member 'in_progress' - is defined as True. The 'in_progress' member is set to True at the - beginning of the generate() method and set to False at its end. - So, in_progress==True means generating boards.cfg was terminated - on the way. - """ + # ignore case when sorting + output_lines.sort(key=str.lower) - if hasattr(self, 'in_progress') and self.in_progress: - try: - os.remove(BOARD_FILE) - except OSError as exception: - # Ignore 'No such file or directory' error - if exception.errno != errno.ENOENT: - raise - print 'Removed incomplete %s' % BOARD_FILE + with open(output, 'w') as f: + f.write(COMMENT_BLOCK + '\n'.join(output_lines) + '\n') - def generate(self, jobs): - """Generate boards.cfg - - This method sets the 'in_progress' member to True at the beginning - and sets it to False on success. The boards.cfg should not be - touched before/after this method because 'in_progress' is used - to detect the incomplete boards.cfg. - - Arguments: - jobs: The number of jobs to run simultaneously - """ - - self.in_progress = True - print 'Generating %s ... (jobs: %d)' % (BOARD_FILE, jobs) - - # Output lines should be piped into the reformat tool - reformat_process = subprocess.Popen(REFORMAT_CMD, - stdin=subprocess.PIPE, - stdout=open(BOARD_FILE, 'w')) - pipe = reformat_process.stdin - pipe.write(COMMENT_BLOCK) - - slots = Slots(jobs, pipe, self.maintainers_database) - - # Main loop to process defconfig files: - # Add a new subprocess into a vacant slot. - # Sleep if there is no available slot. - for defconfig in self.defconfigs: - while not slots.add(defconfig): - while not slots.available(): - # No available slot: sleep for a while - time.sleep(SLEEP_TIME) - self.indicator.inc() - - # wait until all the subprocesses finish - while not slots.empty(): - time.sleep(SLEEP_TIME) - print '' - - # wait until the reformat tool finishes - reformat_process.communicate() - if reformat_process.returncode != 0: - sys.exit('"%s" failed' % REFORMAT_CMD[0]) - - self.in_progress = False - -def gen_boards_cfg(jobs=1, force=False): - """Generate boards.cfg file. - - The incomplete boards.cfg is deleted if an error (including - the termination by the keyboard interrupt) occurs on the halfway. +def gen_boards_cfg(output, jobs=1, force=False): + """Generate a board database file. Arguments: + output: The name of the output file jobs: The number of jobs to run simultaneously + force: Force to generate the output even if it is new """ check_top_directory() - if not force and output_is_new(): - print "%s is up to date. Nothing to do." % BOARD_FILE + + if not force and output_is_new(output): + print "%s is up to date. Nothing to do." % output sys.exit(0) - generator = BoardsFileGenerator() - generator.generate(jobs) + params_list = scan_defconfigs(jobs) + insert_maintainers_info(params_list) + format_and_output(params_list, output) def main(): + try: + cpu_count = multiprocessing.cpu_count() + except NotImplementedError: + cpu_count = 1 + parser = optparse.OptionParser() # Add options here - parser.add_option('-j', '--jobs', - help='the number of jobs to run simultaneously') parser.add_option('-f', '--force', action="store_true", default=False, help='regenerate the output even if it is new') + parser.add_option('-j', '--jobs', type='int', default=cpu_count, + help='the number of jobs to run simultaneously') + parser.add_option('-o', '--output', default=OUTPUT_FILE, + help='output file [default=%s]' % OUTPUT_FILE) (options, args) = parser.parse_args() - if options.jobs: - try: - jobs = int(options.jobs) - except ValueError: - sys.exit('Option -j (--jobs) takes a number') - else: - try: - jobs = int(subprocess.Popen(['getconf', '_NPROCESSORS_ONLN'], - stdout=subprocess.PIPE).communicate()[0]) - except (OSError, ValueError): - print 'info: failed to get the number of CPUs. Set jobs to 1' - jobs = 1 - - gen_boards_cfg(jobs, force=options.force) + gen_boards_cfg(options.output, jobs=options.jobs, force=options.force) if __name__ == '__main__': main() diff --git a/tools/patman/command.py b/tools/patman/command.py index 449d3d0e03..d586f11158 100644 --- a/tools/patman/command.py +++ b/tools/patman/command.py @@ -20,9 +20,25 @@ class CommandResult: def __init__(self): self.stdout = None self.stderr = None + self.combined = None self.return_code = None self.exception = None + def __init__(self, stdout='', stderr='', combined='', return_code=0, + exception=None): + self.stdout = stdout + self.stderr = stderr + self.combined = combined + self.return_code = return_code + self.exception = exception + + +# This permits interception of RunPipe for test purposes. If it is set to +# a function, then that function is called with the pipe list being +# executed. Otherwise, it is assumed to be a CommandResult object, and is +# returned as the result for every RunPipe() call. +# When this value is None, commands are executed as normal. +test_result = None def RunPipe(pipe_list, infile=None, outfile=None, capture=False, capture_stderr=False, oneline=False, @@ -44,10 +60,16 @@ def RunPipe(pipe_list, infile=None, outfile=None, Returns: CommandResult object """ + if test_result: + if hasattr(test_result, '__call__'): + return test_result(pipe_list=pipe_list) + return test_result result = CommandResult() last_pipe = None pipeline = list(pipe_list) user_pipestr = '|'.join([' '.join(pipe) for pipe in pipe_list]) + kwargs['stdout'] = None + kwargs['stderr'] = None while pipeline: cmd = pipeline.pop(0) if last_pipe is not None: diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py index e2b4959d58..b68df5d72e 100644 --- a/tools/patman/gitutil.py +++ b/tools/patman/gitutil.py @@ -33,7 +33,7 @@ def LogCmd(commit_range, git_dir=None, oneline=False, reverse=False, cmd = ['git'] if git_dir: cmd += ['--git-dir', git_dir] - cmd += ['log', '--no-color'] + cmd += ['--no-pager', 'log', '--no-color'] if oneline: cmd.append('--oneline') if use_no_decorate: @@ -152,7 +152,8 @@ def Checkout(commit_hash, git_dir=None, work_tree=None, force=False): if force: pipe.append('-f') pipe.append(commit_hash) - result = command.RunPipe([pipe], capture=True, raise_on_error=False) + result = command.RunPipe([pipe], capture=True, raise_on_error=False, + capture_stderr=True) if result.return_code != 0: raise OSError, 'git checkout (%s): %s' % (pipe, result.stderr) @@ -163,7 +164,8 @@ def Clone(git_dir, output_dir): commit_hash: Commit hash to check out """ pipe = ['git', 'clone', git_dir, '.'] - result = command.RunPipe([pipe], capture=True, cwd=output_dir) + result = command.RunPipe([pipe], capture=True, cwd=output_dir, + capture_stderr=True) if result.return_code != 0: raise OSError, 'git clone: %s' % result.stderr @@ -179,7 +181,7 @@ def Fetch(git_dir=None, work_tree=None): if work_tree: pipe.extend(['--work-tree', work_tree]) pipe.append('fetch') - result = command.RunPipe([pipe], capture=True) + result = command.RunPipe([pipe], capture=True, capture_stderr=True) if result.return_code != 0: raise OSError, 'git fetch: %s' % result.stderr @@ -215,94 +217,6 @@ def CreatePatches(start, count, series): else: return None, files -def ApplyPatch(verbose, fname): - """Apply a patch with git am to test it - - TODO: Convert these to use command, with stderr option - - Args: - fname: filename of patch file to apply - """ - col = terminal.Color() - cmd = ['git', 'am', fname] - pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - stdout, stderr = pipe.communicate() - re_error = re.compile('^error: patch failed: (.+):(\d+)') - for line in stderr.splitlines(): - if verbose: - print line - match = re_error.match(line) - if match: - print checkpatch.GetWarningMsg(col, 'warning', match.group(1), - int(match.group(2)), 'Patch failed') - return pipe.returncode == 0, stdout - -def ApplyPatches(verbose, args, start_point): - """Apply the patches with git am to make sure all is well - - Args: - verbose: Print out 'git am' output verbatim - args: List of patch files to apply - start_point: Number of commits back from HEAD to start applying. - Normally this is len(args), but it can be larger if a start - offset was given. - """ - error_count = 0 - col = terminal.Color() - - # Figure out our current position - cmd = ['git', 'name-rev', 'HEAD', '--name-only'] - pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE) - stdout, stderr = pipe.communicate() - if pipe.returncode: - str = 'Could not find current commit name' - print col.Color(col.RED, str) - print stdout - return False - old_head = stdout.splitlines()[0] - if old_head == 'undefined': - str = "Invalid HEAD '%s'" % stdout.strip() - print col.Color(col.RED, str) - return False - - # Checkout the required start point - cmd = ['git', 'checkout', 'HEAD~%d' % start_point] - pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - stdout, stderr = pipe.communicate() - if pipe.returncode: - str = 'Could not move to commit before patch series' - print col.Color(col.RED, str) - print stdout, stderr - return False - - # Apply all the patches - for fname in args: - ok, stdout = ApplyPatch(verbose, fname) - if not ok: - print col.Color(col.RED, 'git am returned errors for %s: will ' - 'skip this patch' % fname) - if verbose: - print stdout - error_count += 1 - cmd = ['git', 'am', '--skip'] - pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE) - stdout, stderr = pipe.communicate() - if pipe.returncode != 0: - print col.Color(col.RED, 'Unable to skip patch! Aborting...') - print stdout - break - - # Return to our previous position - cmd = ['git', 'checkout', old_head] - pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - stdout, stderr = pipe.communicate() - if pipe.returncode: - print col.Color(col.RED, 'Could not move back to head commit') - print stdout, stderr - return error_count == 0 - def BuildEmailList(in_list, tag=None, alias=None, raise_on_error=True): """Build a list of email addresses based on an input list. @@ -478,13 +392,13 @@ def LookupEmail(lookup_name, alias=None, raise_on_error=True, level=0): ... OSError: Recursive email alias at 'other' >>> LookupEmail('odd', alias, raise_on_error=False) - \033[1;31mAlias 'odd' not found\033[0m + Alias 'odd' not found [] >>> # In this case the loop part will effectively be ignored. >>> LookupEmail('loop', alias, raise_on_error=False) - \033[1;31mRecursive email alias at 'other'\033[0m - \033[1;31mRecursive email alias at 'john'\033[0m - \033[1;31mRecursive email alias at 'mary'\033[0m + Recursive email alias at 'other' + Recursive email alias at 'john' + Recursive email alias at 'mary' ['j.bloggs@napier.co.nz', 'm.poppins@cloud.net'] """ if not alias: @@ -569,6 +483,8 @@ def GetDefaultUserEmail(): def Setup(): """Set up git utils, by reading the alias files.""" # Check for a git alias file also + global use_no_decorate + alias_fname = GetAliasFile() if alias_fname: settings.ReadGitAliases(alias_fname) diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py index 00404681c4..d630157f8f 100644 --- a/tools/patman/patchstream.py +++ b/tools/patman/patchstream.py @@ -72,7 +72,6 @@ class PatchStream: self.in_change = 0 # Non-zero if we are in a change list self.blank_count = 0 # Number of blank lines stored up self.state = STATE_MSG_HEADER # What state are we in? - self.tags = [] # Tags collected, like Tested-by... self.signoff = [] # Contents of signoff line self.commit = None # Current commit @@ -113,16 +112,6 @@ class PatchStream: self.series.AddCommit(self.commit) self.commit = None - def FormatTags(self, tags): - out_list = [] - for tag in sorted(tags): - if tag.startswith('Cc:'): - tag_list = tag[4:].split(',') - out_list += gitutil.BuildEmailList(tag_list, 'Cc:') - else: - out_list.append(tag) - return out_list - def ProcessLine(self, line): """Process a single line of a patch file or commit log @@ -271,11 +260,11 @@ class PatchStream: elif tag_match.group(1) == 'Patch-cc': self.commit.AddCc(tag_match.group(2).split(',')) else: - self.tags.append(line); + out = [line] # Suppress duplicate signoffs elif signoff_match: - if (self.is_log or + if (self.is_log or not self.commit or self.commit.CheckDuplicateSignoff(signoff_match.group(1))): out = [line] @@ -311,8 +300,10 @@ class PatchStream: # Output the tags (signeoff first), then change list out = [] log = self.series.MakeChangeLog(self.commit) - out += self.FormatTags(self.tags) - out += [line] + self.commit.notes + [''] + log + out += [line] + if self.commit: + out += self.commit.notes + out += [''] + log elif self.found_test: if not re_allowed_after_test.match(line): self.lines_after_test += 1 @@ -364,7 +355,7 @@ class PatchStream: def GetMetaDataForList(commit_range, git_dir=None, count=None, - series = Series()): + series = None, allow_overwrite=False): """Reads out patch series metadata from the commits This does a 'git log' on the relevant commits and pulls out the tags we @@ -376,9 +367,13 @@ def GetMetaDataForList(commit_range, git_dir=None, count=None, count: Number of commits to list, or None for no limit series: Series object to add information into. By default a new series is started. + allow_overwrite: Allow tags to overwrite an existing tag Returns: A Series object containing information about the commits. """ + if not series: + series = Series() + series.allow_overwrite = allow_overwrite params = gitutil.LogCmd(commit_range,reverse=True, count=count, git_dir=git_dir) stdout = command.RunPipe([params], capture=True).stdout diff --git a/tools/patman/patman.py b/tools/patman/patman.py index ca34cb9fd8..2ab6b351d6 100755 --- a/tools/patman/patman.py +++ b/tools/patman/patman.py @@ -25,9 +25,6 @@ import test parser = OptionParser() -parser.add_option('-a', '--no-apply', action='store_false', - dest='apply_patches', default=True, - help="Don't test-apply patches with git am") parser.add_option('-H', '--full-help', action='store_true', dest='full_help', default=False, help='Display the README file') parser.add_option('-c', '--count', dest='count', type='int', @@ -143,23 +140,24 @@ else: ok = checkpatch.CheckPatches(options.verbose, args) else: ok = True - if options.apply_patches: - if not gitutil.ApplyPatches(options.verbose, args, - options.count + options.start): - ok = False cc_file = series.MakeCcFile(options.process_tags, cover_fname, not options.ignore_bad_tags) # Email the patches out (giving the user time to check / cancel) cmd = '' - if ok or options.ignore_errors: + its_a_go = ok or options.ignore_errors + if its_a_go: cmd = gitutil.EmailPatches(series, cover_fname, args, options.dry_run, not options.ignore_bad_tags, cc_file, in_reply_to=options.in_reply_to) + else: + print col.Color(col.RED, "Not sending emails due to errors/warnings") # For a dry run, just show our actions as a sanity check if options.dry_run: series.ShowActions(args, cmd, options.process_tags) + if not its_a_go: + print col.Color(col.RED, "Email would not be sent") os.remove(cc_file) diff --git a/tools/patman/terminal.py b/tools/patman/terminal.py index 597d526861..e78a7c14f5 100644 --- a/tools/patman/terminal.py +++ b/tools/patman/terminal.py @@ -14,67 +14,145 @@ import sys # Selection of when we want our output to be colored COLOR_IF_TERMINAL, COLOR_ALWAYS, COLOR_NEVER = range(3) -class Color(object): - """Conditionally wraps text in ANSI color escape sequences.""" - BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8) - BOLD = -1 - BRIGHT_START = '\033[1;%dm' - NORMAL_START = '\033[22;%dm' - BOLD_START = '\033[1m' - RESET = '\033[0m' +# Initially, we are set up to print to the terminal +print_test_mode = False +print_test_list = [] - def __init__(self, colored=COLOR_IF_TERMINAL): - """Create a new Color object, optionally disabling color output. +class PrintLine: + """A line of text output - Args: - enabled: True if color output should be enabled. If False then this - class will not add color codes at all. + Members: + text: Text line that was printed + newline: True to output a newline after the text + colour: Text colour to use """ - self._enabled = (colored == COLOR_ALWAYS or - (colored == COLOR_IF_TERMINAL and os.isatty(sys.stdout.fileno()))) + def __init__(self, text, newline, colour): + self.text = text + self.newline = newline + self.colour = colour - def Start(self, color, bright=True): - """Returns a start color code. + def __str__(self): + return 'newline=%s, colour=%s, text=%s' % (self.newline, self.colour, + self.text) - Args: - color: Color to use, .e.g BLACK, RED, etc. +def Print(text='', newline=True, colour=None): + """Handle a line of output to the terminal. - Returns: - If color is enabled, returns an ANSI sequence to start the given color, - otherwise returns empty string + In test mode this is recorded in a list. Otherwise it is output to the + terminal. + + Args: + text: Text to print + newline: True to add a new line at the end of the text + colour: Colour to use for the text """ - if self._enabled: - base = self.BRIGHT_START if bright else self.NORMAL_START - return base % (color + 30) - return '' + if print_test_mode: + print_test_list.append(PrintLine(text, newline, colour)) + else: + if colour: + col = Color() + text = col.Color(colour, text) + print text, + if newline: + print + +def SetPrintTestMode(): + """Go into test mode, where all printing is recorded""" + global print_test_mode + + print_test_mode = True - def Stop(self): - """Retruns a stop color code. +def GetPrintTestLines(): + """Get a list of all lines output through Print() Returns: - If color is enabled, returns an ANSI color reset sequence, otherwise - returns empty string + A list of PrintLine objects """ - if self._enabled: - return self.RESET - return '' + global print_test_list - def Color(self, color, text, bright=True): - """Returns text with conditionally added color escape sequences. + ret = print_test_list + print_test_list = [] + return ret - Keyword arguments: - color: Text color -- one of the color constants defined in this class. - text: The text to color. +def EchoPrintTestLines(): + """Print out the text lines collected""" + for line in print_test_list: + if line.colour: + col = Color() + print col.Color(line.colour, line.text), + else: + print line.text, + if line.newline: + print - Returns: - If self._enabled is False, returns the original text. If it's True, - returns text with color escape sequences based on the value of color. - """ - if not self._enabled: - return text - if color == self.BOLD: - start = self.BOLD_START - else: - base = self.BRIGHT_START if bright else self.NORMAL_START - start = base % (color + 30) - return start + text + self.RESET + +class Color(object): + """Conditionally wraps text in ANSI color escape sequences.""" + BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8) + BOLD = -1 + BRIGHT_START = '\033[1;%dm' + NORMAL_START = '\033[22;%dm' + BOLD_START = '\033[1m' + RESET = '\033[0m' + + def __init__(self, colored=COLOR_IF_TERMINAL): + """Create a new Color object, optionally disabling color output. + + Args: + enabled: True if color output should be enabled. If False then this + class will not add color codes at all. + """ + try: + self._enabled = (colored == COLOR_ALWAYS or + (colored == COLOR_IF_TERMINAL and + os.isatty(sys.stdout.fileno()))) + except: + self._enabled = False + + def Start(self, color, bright=True): + """Returns a start color code. + + Args: + color: Color to use, .e.g BLACK, RED, etc. + + Returns: + If color is enabled, returns an ANSI sequence to start the given + color, otherwise returns empty string + """ + if self._enabled: + base = self.BRIGHT_START if bright else self.NORMAL_START + return base % (color + 30) + return '' + + def Stop(self): + """Retruns a stop color code. + + Returns: + If color is enabled, returns an ANSI color reset sequence, + otherwise returns empty string + """ + if self._enabled: + return self.RESET + return '' + + def Color(self, color, text, bright=True): + """Returns text with conditionally added color escape sequences. + + Keyword arguments: + color: Text color -- one of the color constants defined in this + class. + text: The text to color. + + Returns: + If self._enabled is False, returns the original text. If it's True, + returns text with color escape sequences based on the value of + color. + """ + if not self._enabled: + return text + if color == self.BOLD: + start = self.BOLD_START + else: + base = self.BRIGHT_START if bright else self.NORMAL_START + start = base % (color + 30) + return start + text + self.RESET diff --git a/tools/patman/test.py b/tools/patman/test.py index 8fcfe530dc..e8f7472785 100644 --- a/tools/patman/test.py +++ b/tools/patman/test.py @@ -55,6 +55,7 @@ This adds functions to enable/disable clocks and reset to on-chip peripherals. Signed-off-by: Simon Glass <sjg@chromium.org> --- + arch/arm/cpu/armv7/tegra2/Makefile | 2 +- arch/arm/cpu/armv7/tegra2/ap20.c | 57 ++---- arch/arm/cpu/armv7/tegra2/clock.c | 163 +++++++++++++++++ @@ -200,7 +201,7 @@ index 0000000..2234c87 self.assertEqual(result.errors, 0) self.assertEqual(result.warnings, 0) self.assertEqual(result.checks, 0) - self.assertEqual(result.lines, 67) + self.assertEqual(result.lines, 56) os.remove(inf) def testNoSignoff(self): @@ -211,18 +212,18 @@ index 0000000..2234c87 self.assertEqual(result.errors, 1) self.assertEqual(result.warnings, 0) self.assertEqual(result.checks, 0) - self.assertEqual(result.lines, 67) + self.assertEqual(result.lines, 56) os.remove(inf) def testSpaces(self): inf = self.SetupData('spaces') result = checkpatch.CheckPatch(inf) self.assertEqual(result.ok, False) - self.assertEqual(len(result.problems), 1) + self.assertEqual(len(result.problems), 2) self.assertEqual(result.errors, 0) - self.assertEqual(result.warnings, 1) + self.assertEqual(result.warnings, 2) self.assertEqual(result.checks, 0) - self.assertEqual(result.lines, 67) + self.assertEqual(result.lines, 56) os.remove(inf) def testIndent(self): @@ -233,7 +234,7 @@ index 0000000..2234c87 self.assertEqual(result.errors, 0) self.assertEqual(result.warnings, 0) self.assertEqual(result.checks, 1) - self.assertEqual(result.lines, 67) + self.assertEqual(result.lines, 56) os.remove(inf) |