summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/board_f.c16
-rw-r--r--common/board_r.c12
-rw-r--r--common/console.c30
-rw-r--r--common/env_sf.c8
-rw-r--r--common/fdt_support.c5
-rw-r--r--common/iomux.c4
-rw-r--r--common/spl/Kconfig47
-rw-r--r--common/spl/spl_spi.c5
-rw-r--r--common/usb_kbd.c6
9 files changed, 96 insertions, 37 deletions
diff --git a/common/board_f.c b/common/board_f.c
index 99c0b5a..ae6cd85 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -768,7 +768,8 @@ static int setup_reloc(void)
}
/* ARM calls relocate_code from its crt0.S */
-#if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX)
+#if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX) && \
+ !CONFIG_IS_ENABLED(X86_64)
static int jump_to_copy(void)
{
@@ -845,7 +846,7 @@ __weak int arch_cpu_init_dm(void)
return 0;
}
-static init_fnc_t init_sequence_f[] = {
+static const init_fnc_t init_sequence_f[] = {
#ifdef CONFIG_SANDBOX
setup_ram_buf,
#endif
@@ -1032,13 +1033,14 @@ static init_fnc_t init_sequence_f[] = {
setup_reloc,
#if defined(CONFIG_X86) || defined(CONFIG_ARC)
copy_uboot_to_ram,
- clear_bss,
do_elf_reloc_fixups,
+ clear_bss,
#endif
#if defined(CONFIG_XTENSA)
clear_bss,
#endif
-#if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX)
+#if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX) && \
+ !CONFIG_IS_ENABLED(X86_64)
jump_to_copy,
#endif
NULL,
@@ -1072,7 +1074,7 @@ void board_init_f(ulong boot_flags)
hang();
#if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX) && \
- !defined(CONFIG_EFI_APP)
+ !defined(CONFIG_EFI_APP) && !CONFIG_IS_ENABLED(X86_64)
/* NOTREACHED - jump_to_copy() does not return */
hang();
#endif
@@ -1096,8 +1098,10 @@ void board_init_f(ulong boot_flags)
* NOTE: At present only x86 uses this route, but it is intended that
* all archs will move to this when generic relocation is implemented.
*/
-static init_fnc_t init_sequence_f_r[] = {
+static const init_fnc_t init_sequence_f_r[] = {
+#if !CONFIG_IS_ENABLED(X86_64)
init_cache_f_r,
+#endif
NULL,
};
diff --git a/common/board_r.c b/common/board_r.c
index 48fa4ee..8077280 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -737,7 +737,7 @@ static int run_main_loop(void)
*
* TODO: perhaps reset the watchdog in the initcall function after each call?
*/
-init_fnc_t init_sequence_r[] = {
+static init_fnc_t init_sequence_r[] = {
initr_trace,
initr_reloc,
/* TODO: could x86/PPC have this also perhaps? */
@@ -947,6 +947,16 @@ init_fnc_t init_sequence_r[] = {
void board_init_r(gd_t *new_gd, ulong dest_addr)
{
+ /*
+ * Set up the new global data pointer. So far only x86 does this
+ * here.
+ * TODO(sjg@chromium.org): Consider doing this for all archs, or
+ * dropping the new_gd parameter.
+ */
+#if CONFIG_IS_ENABLED(X86_64)
+ arch_setup_gd(new_gd);
+#endif
+
#ifdef CONFIG_NEEDS_MANUAL_RELOC
int i;
#endif
diff --git a/common/console.c b/common/console.c
index e1d8476..1232808 100644
--- a/common/console.c
+++ b/common/console.c
@@ -41,14 +41,14 @@ static int on_console(const char *name, const char *value, enum env_op op,
case env_op_create:
case env_op_overwrite:
-#ifdef CONFIG_CONSOLE_MUX
+#if CONFIG_IS_ENABLED(CONSOLE_MUX)
if (iomux_doenv(console, value))
return 1;
#else
/* Try assigning specified device */
if (console_assign(console, value) < 0)
return 1;
-#endif /* CONFIG_CONSOLE_MUX */
+#endif
return 0;
case env_op_delete:
@@ -85,7 +85,7 @@ static int on_silent(const char *name, const char *value, enum env_op op,
U_BOOT_ENV_CALLBACK(silent, on_silent);
#endif
-#ifdef CONFIG_SYS_CONSOLE_IS_IN_ENV
+#if CONFIG_IS_ENABLED(SYS_CONSOLE_IS_IN_ENV)
/*
* if overwrite_console returns 1, the stdin, stderr and stdout
* are switched to the serial port, else the settings in the
@@ -98,7 +98,7 @@ extern int overwrite_console(void);
#define OVERWRITE_CONSOLE 0
#endif /* CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE */
-#endif /* CONFIG_SYS_CONSOLE_IS_IN_ENV */
+#endif /* CONFIG_IS_ENABLED(SYS_CONSOLE_IS_IN_ENV) */
static int console_setfile(int file, struct stdio_dev * dev)
{
@@ -145,7 +145,7 @@ static int console_setfile(int file, struct stdio_dev * dev)
return error;
}
-#if defined(CONFIG_CONSOLE_MUX)
+#if CONFIG_IS_ENABLED(CONSOLE_MUX)
/** Console I/O multiplexing *******************************************/
static struct stdio_dev *tstcdev;
@@ -265,7 +265,7 @@ static inline void console_doenv(int file, struct stdio_dev *dev)
{
console_setfile(file, dev);
}
-#endif /* defined(CONFIG_CONSOLE_MUX) */
+#endif /* CONIFIG_IS_ENABLED(CONSOLE_MUX) */
/** U-Boot INITIAL CONSOLE-NOT COMPATIBLE FUNCTIONS *************************/
@@ -290,7 +290,7 @@ int serial_printf(const char *fmt, ...)
int fgetc(int file)
{
if (file < MAX_FILES) {
-#if defined(CONFIG_CONSOLE_MUX)
+#if CONFIG_IS_ENABLED(CONSOLE_MUX)
/*
* Effectively poll for input wherever it may be available.
*/
@@ -736,7 +736,7 @@ void stdio_print_current_devices(void)
}
}
-#ifdef CONFIG_SYS_CONSOLE_IS_IN_ENV
+#if CONFIG_IS_ENABLED(SYS_CONSOLE_IS_IN_ENV)
/* Called after the relocation - use desired console functions */
int console_init_r(void)
{
@@ -745,7 +745,7 @@ int console_init_r(void)
#ifdef CONFIG_SYS_CONSOLE_ENV_OVERWRITE
int i;
#endif /* CONFIG_SYS_CONSOLE_ENV_OVERWRITE */
-#ifdef CONFIG_CONSOLE_MUX
+#if CONFIG_IS_ENABLED(CONSOLE_MUX)
int iomux_err = 0;
#endif
@@ -766,7 +766,7 @@ int console_init_r(void)
inputdev = search_device(DEV_FLAGS_INPUT, stdinname);
outputdev = search_device(DEV_FLAGS_OUTPUT, stdoutname);
errdev = search_device(DEV_FLAGS_OUTPUT, stderrname);
-#ifdef CONFIG_CONSOLE_MUX
+#if CONFIG_IS_ENABLED(CONSOLE_MUX)
iomux_err = iomux_doenv(stdin, stdinname);
iomux_err += iomux_doenv(stdout, stdoutname);
iomux_err += iomux_doenv(stderr, stderrname);
@@ -799,7 +799,7 @@ int console_init_r(void)
console_doenv(stdin, inputdev);
}
-#ifdef CONFIG_CONSOLE_MUX
+#if CONFIG_IS_ENABLED(CONSOLE_MUX)
done:
#endif
@@ -829,7 +829,7 @@ done:
return 0;
}
-#else /* CONFIG_SYS_CONSOLE_IS_IN_ENV */
+#else /* !CONFIG_IS_ENABLED(SYS_CONSOLE_IS_IN_ENV) */
/* Called after the relocation - use desired console functions */
int console_init_r(void)
@@ -873,7 +873,7 @@ int console_init_r(void)
if (outputdev != NULL) {
console_setfile(stdout, outputdev);
console_setfile(stderr, outputdev);
-#ifdef CONFIG_CONSOLE_MUX
+#if CONFIG_IS_ENABLED(CONSOLE_MUX)
console_devices[stdout][0] = outputdev;
console_devices[stderr][0] = outputdev;
#endif
@@ -882,7 +882,7 @@ int console_init_r(void)
/* Initializes input console */
if (inputdev != NULL) {
console_setfile(stdin, inputdev);
-#ifdef CONFIG_CONSOLE_MUX
+#if CONFIG_IS_ENABLED(CONSOLE_MUX)
console_devices[stdin][0] = inputdev;
#endif
}
@@ -907,4 +907,4 @@ int console_init_r(void)
return 0;
}
-#endif /* CONFIG_SYS_CONSOLE_IS_IN_ENV */
+#endif /* CONFIG_IS_ENABLED(SYS_CONSOLE_IS_IN_ENV) */
diff --git a/common/env_sf.c b/common/env_sf.c
index c53200f..27b4d12 100644
--- a/common/env_sf.c
+++ b/common/env_sf.c
@@ -19,16 +19,16 @@
#include <dm/device-internal.h>
#ifndef CONFIG_ENV_SPI_BUS
-# define CONFIG_ENV_SPI_BUS 0
+# define CONFIG_ENV_SPI_BUS CONFIG_SF_DEFAULT_BUS
#endif
#ifndef CONFIG_ENV_SPI_CS
-# define CONFIG_ENV_SPI_CS 0
+# define CONFIG_ENV_SPI_CS CONFIG_SF_DEFAULT_CS
#endif
#ifndef CONFIG_ENV_SPI_MAX_HZ
-# define CONFIG_ENV_SPI_MAX_HZ 1000000
+# define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
#endif
#ifndef CONFIG_ENV_SPI_MODE
-# define CONFIG_ENV_SPI_MODE SPI_MODE_3
+# define CONFIG_ENV_SPI_MODE CONFIG_SF_DEFAULT_MODE
#endif
#ifdef CONFIG_ENV_OFFSET_REDUND
diff --git a/common/fdt_support.c b/common/fdt_support.c
index f160391..55d4d6f 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -903,14 +903,9 @@ void fdt_fixup_mtdparts(void *blob, void *node_info, int node_info_size)
{
struct node_info *ni = node_info;
struct mtd_device *dev;
- char *parts;
int i, idx;
int noff;
- parts = getenv("mtdparts");
- if (!parts)
- return;
-
if (mtdparts_init() != 0)
return;
diff --git a/common/iomux.c b/common/iomux.c
index 3d8d00b..0e4e680 100644
--- a/common/iomux.c
+++ b/common/iomux.c
@@ -10,7 +10,7 @@
#include <serial.h>
#include <malloc.h>
-#ifdef CONFIG_CONSOLE_MUX
+#if CONFIG_IS_ENABLED(CONSOLE_MUX)
void iomux_printdevs(const int console)
{
int i;
@@ -145,4 +145,4 @@ int iomux_doenv(const int console, const char *arg)
free(cons_set);
return 0;
}
-#endif /* CONFIG_CONSOLE_MUX */
+#endif /* CONSOLE_MUX */
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index b2ba492..cf714c2 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -149,6 +149,16 @@ config SPL_SHA256_SUPPORT
SHA256 variant is supported: SHA512 and others are not currently
supported in U-Boot.
+config SPL_CPU_SUPPORT
+ bool "Support CPU drivers"
+ depends on SPL
+ help
+ Enable this to support CPU drivers in SPL. These drivers can set
+ up CPUs and provide information about them such as the model and
+ name. This can be useful in SPL since setting up the CPUs earlier
+ may improve boot performance. Enable this option to build the
+ drivers in drivers/cpu as part of an SPL build.
+
config SPL_CRYPTO_SUPPORT
bool "Support crypto drivers"
depends on SPL
@@ -425,6 +435,24 @@ config SYS_OS_BASE
endif # SPL_OS_BOOT
+config SPL_PCI_SUPPORT
+ bool "Support PCI drivers"
+ depends on SPL
+ help
+ Enable support for PCI in SPL. For platforms that need PCI to boot,
+ or must perform some init using PCI in SPL, this provides the
+ necessary driver support. This enables the drivers in drivers/pci
+ as part of an SPL build.
+
+config SPL_PCH_SUPPORT
+ bool "Support PCH drivers"
+ depends on SPL
+ help
+ Enable support for PCH (Platform Controller Hub) devices in SPL.
+ These are used to set up GPIOs and the SPI peripheral early in
+ boot. This enables the drivers in drivers/pch as part of an SPL
+ build.
+
config SPL_POST_MEM_SUPPORT
bool "Support POST drivers"
depends on SPL
@@ -465,6 +493,16 @@ config SPL_RAM_DEVICE
be already in memory when SPL takes over, e.g. loaded by the boot
ROM.
+config SPL_RTC_SUPPORT
+ bool "Support RTC drivers"
+ depends on SPL
+ help
+ Enable RTC (Real-time Clock) support in SPL. This includes support
+ for reading and setting the time. Some RTC devices also have some
+ non-volatile (battery-backed) memory which is accessible if
+ needed. This enables the drivers in drivers/rtc as part of an SPL
+ build.
+
config SPL_SATA_SUPPORT
bool "Support loading from SATA"
depends on SPL
@@ -508,6 +546,15 @@ config SPL_SPI_SUPPORT
enable SPI drivers that are needed for other purposes also, such
as a SPI PMIC.
+config SPL_TIMER_SUPPORT
+ bool "Support timer drivers"
+ depends on SPL
+ help
+ Enable support for timer drivers in SPL. These can be used to get
+ a timer value when in SPL, or perhaps for implementing a delay
+ function. This enables the drivers in drivers/timer as part of an
+ SPL build.
+
config SPL_USB_HOST_SUPPORT
bool "Support USB host drivers"
depends on SPL
diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c
index cd1d6b2..925a1b1 100644
--- a/common/spl/spl_spi.c
+++ b/common/spl/spl_spi.c
@@ -96,8 +96,11 @@ static int spl_spi_load_image(struct spl_image_info *spl_image,
/* Load u-boot, mkimage header is 64 bytes. */
err = spi_flash_read(flash, CONFIG_SYS_SPI_U_BOOT_OFFS, 0x40,
(void *)header);
- if (err)
+ if (err) {
+ debug("%s: Failed to read from SPI flash (err=%d)\n",
+ __func__, err);
return err;
+ }
if (IS_ENABLED(CONFIG_SPL_LOAD_FIT) &&
image_get_magic(header) == FDT_MAGIC) {
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 5f9a64a..d2d29cc 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -516,7 +516,7 @@ static int probe_usb_keyboard(struct usb_device *dev)
return error;
stdinname = getenv("stdin");
-#ifdef CONFIG_CONSOLE_MUX
+#if CONFIG_IS_ENABLED(CONSOLE_MUX)
error = iomux_doenv(stdin, stdinname);
if (error)
return error;
@@ -581,7 +581,7 @@ int usb_kbd_deregister(int force)
data = usb_kbd_dev->privptr;
if (stdio_deregister_dev(dev, force) != 0)
return 1;
-#ifdef CONFIG_CONSOLE_MUX
+#if CONFIG_IS_ENABLED(CONSOLE_MUX)
if (iomux_doenv(stdin, getenv("stdin")) != 0)
return 1;
#endif
@@ -626,7 +626,7 @@ static int usb_kbd_remove(struct udevice *dev)
ret = -EPERM;
goto err;
}
-#ifdef CONFIG_CONSOLE_MUX
+#if CONFIG_IS_ENABLED(CONSOLE_MUX)
if (iomux_doenv(stdin, getenv("stdin"))) {
ret = -ENOLINK;
goto err;