summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/clk.h25
-rw-r--r--include/configs/dra7xx_evm.h29
-rw-r--r--include/configs/ls2080a_simu.h3
-rw-r--r--include/configs/ti_armv7_keystone2.h8
-rw-r--r--include/configs/ti_omap4_common.h1
-rw-r--r--include/configs/ti_omap5_common.h1
-rw-r--r--include/cros_ec.h4
-rw-r--r--include/environment.h5
-rw-r--r--include/s_record.h2
-rw-r--r--include/search.h28
-rw-r--r--include/spi_flash.h3
-rw-r--r--include/spl.h152
12 files changed, 164 insertions, 97 deletions
diff --git a/include/clk.h b/include/clk.h
index fe1f8922c6..5a5c2ff1e6 100644
--- a/include/clk.h
+++ b/include/clk.h
@@ -98,6 +98,19 @@ int clk_get_by_index(struct udevice *dev, int index, struct clk *clk);
* @return 0 if OK, or a negative error code.
*/
int clk_get_by_name(struct udevice *dev, const char *name, struct clk *clk);
+#else
+static inline int clk_get_by_index(struct udevice *dev, int index,
+ struct clk *clk)
+{
+ return -ENOSYS;
+}
+
+static inline int clk_get_by_name(struct udevice *dev, const char *name,
+ struct clk *clk)
+{
+ return -ENOSYS;
+}
+#endif
/**
* clk_request - Request a clock by provider-specific ID.
@@ -162,17 +175,5 @@ int clk_enable(struct clk *clk);
int clk_disable(struct clk *clk);
int soc_clk_dump(void);
-#else
-static inline int clk_get_by_index(struct udevice *dev, int index,
- struct clk *clk)
-{
- return -ENOSYS;
-}
-static inline int clk_get_by_name(struct udevice *dev, const char *name,
- struct clk *clk)
-{
- return -ENOSYS;
-}
-#endif
#endif
diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h
index 66ce82cabb..798002d4cd 100644
--- a/include/configs/dra7xx_evm.h
+++ b/include/configs/dra7xx_evm.h
@@ -105,10 +105,7 @@
#define DFU_ALT_INFO_QSPI \
"dfu_alt_info_qspi=" \
- "MLO raw 0x0 0x010000;" \
- "MLO.backup1 raw 0x010000 0x010000;" \
- "MLO.backup2 raw 0x020000 0x010000;" \
- "MLO.backup3 raw 0x030000 0x010000;" \
+ "MLO raw 0x0 0x040000;" \
"u-boot.img raw 0x040000 0x0100000;" \
"u-boot-spl-os raw 0x140000 0x080000;" \
"u-boot-env raw 0x1C0000 0x010000;" \
@@ -121,22 +118,21 @@
DFU_ALT_INFO_EMMC \
DFU_ALT_INFO_RAM \
DFU_ALT_INFO_QSPI
-
-/* Fastboot */
-#define CONFIG_USB_FUNCTION_FASTBOOT
-#define CONFIG_CMD_FASTBOOT
-#define CONFIG_ANDROID_BOOT_IMAGE
-#define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR
-#define CONFIG_FASTBOOT_BUF_SIZE 0x2F000000
-#define CONFIG_FASTBOOT_FLASH
-#define CONFIG_FASTBOOT_FLASH_MMC_DEV 1
+#else
+/* Discard fastboot in SPL build, to spare some space */
+#undef CONFIG_FASTBOOT
+#undef CONFIG_USB_FUNCTION_FASTBOOT
+#undef CONFIG_CMD_FASTBOOT
+#undef CONFIG_ANDROID_BOOT_IMAGE
+#undef CONFIG_FASTBOOT_BUF_ADDR
+#undef CONFIG_FASTBOOT_BUF_SIZE
+#undef CONFIG_FASTBOOT_FLASH
#endif
#ifdef CONFIG_SPL_BUILD
#undef CONFIG_CMD_BOOTD
#ifdef CONFIG_SPL_DFU_SUPPORT
#define CONFIG_SPL_LOAD_FIT_ADDRESS 0x80200000
-#define CONFIG_SPL_ENV_SUPPORT
#define CONFIG_SPL_HASH_SUPPORT
#define DFU_ALT_INFO_RAM \
"dfu_alt_info_ram=" \
@@ -184,10 +180,7 @@
/*
* Default to using SPI for environment, etc.
- * 0x000000 - 0x010000 : QSPI.SPL (64KiB)
- * 0x010000 - 0x020000 : QSPI.SPL.backup1 (64KiB)
- * 0x020000 - 0x030000 : QSPI.SPL.backup2 (64KiB)
- * 0x030000 - 0x040000 : QSPI.SPL.backup3 (64KiB)
+ * 0x000000 - 0x040000 : QSPI.SPL (256KiB)
* 0x040000 - 0x140000 : QSPI.u-boot (1MiB)
* 0x140000 - 0x1C0000 : QSPI.u-boot-spl-os (512KiB)
* 0x1C0000 - 0x1D0000 : QSPI.u-boot-env (64KiB)
diff --git a/include/configs/ls2080a_simu.h b/include/configs/ls2080a_simu.h
index 1851d41b58..f0ec6c4d6a 100644
--- a/include/configs/ls2080a_simu.h
+++ b/include/configs/ls2080a_simu.h
@@ -146,9 +146,6 @@
#define CONFIG_SYS_DEBUG_SERVER_FW_ADDR 0x580C00000ULL
/* MC firmware */
-#define CONFIG_SYS_LS_MC_FW_IN_NOR
-#define CONFIG_SYS_LS_MC_FW_ADDR 0x580200000ULL
-
#define CONFIG_SYS_LS_MC_DPL_IN_NOR
#define CONFIG_SYS_LS_MC_DPL_ADDR 0x5806C0000ULL
diff --git a/include/configs/ti_armv7_keystone2.h b/include/configs/ti_armv7_keystone2.h
index c42dedbbd1..df265281a3 100644
--- a/include/configs/ti_armv7_keystone2.h
+++ b/include/configs/ti_armv7_keystone2.h
@@ -68,14 +68,14 @@
#define CONFIG_CONS_INDEX 1
#ifndef CONFIG_SOC_K2G
-#define CONFIG_SYS_NS16550_CLK clk_get_rate(KS2_CLK1_6)
+#define CONFIG_SYS_NS16550_CLK ks_clk_get_rate(KS2_CLK1_6)
#else
-#define CONFIG_SYS_NS16550_CLK clk_get_rate(uart_pll_clk) / 2
+#define CONFIG_SYS_NS16550_CLK ks_clk_get_rate(uart_pll_clk) / 2
#endif
/* SPI Configuration */
#define CONFIG_DAVINCI_SPI
-#define CONFIG_SYS_SPI_CLK clk_get_rate(KS2_CLK1_6)
+#define CONFIG_SYS_SPI_CLK ks_clk_get_rate(KS2_CLK1_6)
#define CONFIG_SF_DEFAULT_SPEED 30000000
#define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
#define CONFIG_SYS_SPI0
@@ -314,7 +314,7 @@
#include <asm/arch/hardware.h>
#include <asm/arch/clock.h>
#ifndef CONFIG_SOC_K2G
-#define CONFIG_SYS_HZ_CLOCK clk_get_rate(KS2_CLK1_6)
+#define CONFIG_SYS_HZ_CLOCK ks_clk_get_rate(KS2_CLK1_6)
#else
#define CONFIG_SYS_HZ_CLOCK external_clk[sys_clk]
#endif
diff --git a/include/configs/ti_omap4_common.h b/include/configs/ti_omap4_common.h
index 4115c78e94..8502c8ac7f 100644
--- a/include/configs/ti_omap4_common.h
+++ b/include/configs/ti_omap4_common.h
@@ -151,7 +151,6 @@
* So moving TEXT_BASE down to non-HS limit.
*/
#define CONFIG_SPL_TEXT_BASE 0x40300000
-#define CONFIG_SPL_DISPLAY_PRINT
#define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/omap-common/u-boot-spl.lds"
#define CONFIG_SYS_SPL_ARGS_ADDR (CONFIG_SYS_SDRAM_BASE + \
(128 << 20))
diff --git a/include/configs/ti_omap5_common.h b/include/configs/ti_omap5_common.h
index a483850d19..9229599b67 100644
--- a/include/configs/ti_omap5_common.h
+++ b/include/configs/ti_omap5_common.h
@@ -160,7 +160,6 @@
#define CONFIG_SPL_TEXT_BASE 0x40300000
#endif
-#define CONFIG_SPL_DISPLAY_PRINT
#define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/omap-common/u-boot-spl.lds"
#define CONFIG_SYS_SPL_ARGS_ADDR (CONFIG_SYS_SDRAM_BASE + \
(128 << 20))
diff --git a/include/cros_ec.h b/include/cros_ec.h
index 5fa5f6f782..30b19089b1 100644
--- a/include/cros_ec.h
+++ b/include/cros_ec.h
@@ -395,9 +395,11 @@ struct i2c_msg;
* Tunnel an I2C transfer to the EC
*
* @param dev CROS-EC device
+ * @param port The remote port on EC to use
* @param msg List of messages to transfer
* @param nmsgs Number of messages to transfer
*/
-int cros_ec_i2c_tunnel(struct udevice *dev, struct i2c_msg *msg, int nmsgs);
+int cros_ec_i2c_tunnel(struct udevice *dev, int port, struct i2c_msg *msg,
+ int nmsgs);
#endif
diff --git a/include/environment.h b/include/environment.h
index 1fdbdad882..b602e8ac46 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -16,10 +16,9 @@
* shifts the remaining entries to the front. Replacing an entry is a
* combination of deleting the old value and adding the new one.
*
- * The environment is preceeded by a 32 bit CRC over the data part.
+ * The environment is preceded by a 32 bit CRC over the data part.
*
- **************************************************************************
- */
+ *************************************************************************/
#if defined(CONFIG_ENV_IS_IN_FLASH)
# ifndef CONFIG_ENV_ADDR
diff --git a/include/s_record.h b/include/s_record.h
index 6db7174648..81245bab0b 100644
--- a/include/s_record.h
+++ b/include/s_record.h
@@ -29,7 +29,7 @@
* 2 data record with 24-bit address
* 3 data record with 32-bit address
* 4 symbol record (LSI extension)
- * 5 number of data records in preceeding block
+ * 5 number of data records in preceding block
* 6 unused
* 7 ending record for S3 records
* 8 ending record for S2 records
diff --git a/include/search.h b/include/search.h
index 343dbc3d48..402dfd84fb 100644
--- a/include/search.h
+++ b/include/search.h
@@ -12,8 +12,8 @@
* Copyright (C) 2010-2013 Wolfgang Denk <wd@denx.de>
*/
-#ifndef _SEARCH_H
-#define _SEARCH_H 1
+#ifndef _SEARCH_H_
+#define _SEARCH_H_
#include <stddef.h>
@@ -25,7 +25,7 @@ enum env_op {
env_op_overwrite,
};
-/* Action which shall be performed in the call the hsearch. */
+/* Action which shall be performed in the call to hsearch. */
typedef enum {
FIND,
ENTER
@@ -45,7 +45,7 @@ struct _ENTRY;
/*
* Family of hash table handling functions. The functions also
* have reentrant counterparts ending with _r. The non-reentrant
- * functions all work on a signle internal hashing table.
+ * functions all work on a single internal hash table.
*/
/* Data type for reentrant functions. */
@@ -55,38 +55,38 @@ struct hsearch_data {
unsigned int filled;
/*
* Callback function which will check whether the given change for variable
- * "item" to "newval" may be applied or not, and possibly apply such change.
+ * "__item" to "newval" may be applied or not, and possibly apply such change.
* When (flag & H_FORCE) is set, it shall not print out any error message and
* shall force overwriting of write-once variables.
-.* Must return 0 for approval, 1 for denial.
+ * Must return 0 for approval, 1 for denial.
*/
int (*change_ok)(const ENTRY *__item, const char *newval, enum env_op,
int flag);
};
-/* Create a new hashing table which will at most contain NEL elements. */
+/* Create a new hash table which will contain at most "__nel" elements. */
extern int hcreate_r(size_t __nel, struct hsearch_data *__htab);
-/* Destroy current internal hashing table. */
+/* Destroy current internal hash table. */
extern void hdestroy_r(struct hsearch_data *__htab);
/*
- * Search for entry matching ITEM.key in internal hash table. If
+ * Search for entry matching __item.key in internal hash table. If
* ACTION is `FIND' return found entry or signal error by returning
* NULL. If ACTION is `ENTER' replace existing data (if any) with
- * ITEM.data.
+ * __item.data.
* */
extern int hsearch_r(ENTRY __item, ACTION __action, ENTRY ** __retval,
struct hsearch_data *__htab, int __flag);
/*
- * Search for an entry matching `MATCH'. Otherwise, Same semantics
+ * Search for an entry matching "__match". Otherwise, Same semantics
* as hsearch_r().
*/
extern int hmatch_r(const char *__match, int __last_idx, ENTRY ** __retval,
struct hsearch_data *__htab);
-/* Search and delete entry matching ITEM.key in internal hash table. */
+/* Search and delete entry matching "__key" in internal hash table. */
extern int hdelete_r(const char *__key, struct hsearch_data *__htab,
int __flag);
@@ -97,8 +97,6 @@ extern ssize_t hexport_r(struct hsearch_data *__htab,
/*
* nvars: length of vars array
* vars: array of strings (variable names) to import (nvars == 0 means all)
- * do_apply: whether to call callback function to check the new argument,
- * and possibly apply changes (false means accept everything)
*/
extern int himport_r(struct hsearch_data *__htab,
const char *__env, size_t __size, const char __sep,
@@ -123,4 +121,4 @@ extern int hwalk_r(struct hsearch_data *__htab, int (*callback)(ENTRY *));
#define H_PROGRAMMATIC (1 << 9) /* indicate that an import is from setenv() */
#define H_ORIGIN_FLAGS (H_INTERACTIVE | H_PROGRAMMATIC)
-#endif /* search.h */
+#endif /* _SEARCH_H_ */
diff --git a/include/spi_flash.h b/include/spi_flash.h
index d0ce9e721a..be2fe3f84c 100644
--- a/include/spi_flash.h
+++ b/include/spi_flash.h
@@ -239,7 +239,4 @@ static inline int spi_flash_protect(struct spi_flash *flash, u32 ofs, u32 len,
return flash->flash_unlock(flash, ofs, len);
}
-void spi_boot(void) __noreturn;
-void spi_spl_load_image(uint32_t offs, unsigned int size, void *vdst);
-
#endif /* _SPI_FLASH_H_ */
diff --git a/include/spl.h b/include/spl.h
index 30eda36fef..e080a82b97 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -49,6 +49,7 @@ struct spl_load_info {
/**
* spl_load_simple_fit() - Loads a fit image from a device.
+ * @spl_image: Image description to set up
* @info: Structure containing the information required to load data.
* @sector: Sector number where FIT image is located in the device
* @fdt: Pointer to the copied FIT header.
@@ -57,66 +58,146 @@ struct spl_load_info {
* specified load address and copies the dtb to end of u-boot image.
* Returns 0 on success.
*/
-int spl_load_simple_fit(struct spl_load_info *info, ulong sector, void *fdt);
+int spl_load_simple_fit(struct spl_image_info *spl_image,
+ struct spl_load_info *info, ulong sector, void *fdt);
#define SPL_COPY_PAYLOAD_ONLY 1
-extern struct spl_image_info spl_image;
-
/* SPL common functions */
void preloader_console_init(void);
u32 spl_boot_device(void);
u32 spl_boot_mode(const u32 boot_device);
-void spl_set_header_raw_uboot(void);
-int spl_parse_image_header(const struct image_header *header);
-void spl_board_prepare_for_linux(void);
-void spl_board_prepare_for_boot(void);
-int spl_board_ubi_load_image(u32 boot_device);
-void __noreturn jump_to_image_linux(void *arg);
-int spl_start_uboot(void);
-void spl_display_print(void);
-/* NAND SPL functions */
-int spl_nand_load_image(void);
+/**
+ * spl_set_header_raw_uboot() - Set up a standard SPL image structure
+ *
+ * This sets up the given spl_image which the standard values obtained from
+ * config options: CONFIG_SYS_MONITOR_LEN, CONFIG_SYS_UBOOT_START,
+ * CONFIG_SYS_TEXT_BASE.
+ *
+ * @spl_image: Image description to set up
+ */
+void spl_set_header_raw_uboot(struct spl_image_info *spl_image);
-/* OneNAND SPL functions */
-int spl_onenand_load_image(void);
+/**
+ * spl_parse_image_header() - parse the image header and set up info
+ *
+ * This parses the legacy image header information at @header and sets up
+ * @spl_image according to what is found. If no image header is found, then
+ * a raw image or bootz is assumed. If CONFIG_SPL_PANIC_ON_RAW_IMAGE is
+ * enabled, then this causes a panic. If CONFIG_SPL_ABORT_ON_RAW_IMAGE is
+ * enabled then U-Boot gives up. Otherwise U-Boot sets up the image using
+ * spl_set_header_raw_uboot(), or possibly the bootz header.
+ *
+ * @spl_image: Image description to set up
+ * @header image header to parse
+ * @return 0 if a header was correctly parsed, -ve on error
+ */
+int spl_parse_image_header(struct spl_image_info *spl_image,
+ const struct image_header *header);
-/* NOR SPL functions */
-int spl_nor_load_image(void);
+void spl_board_prepare_for_linux(void);
+void spl_board_prepare_for_boot(void);
+int spl_board_ubi_load_image(u32 boot_device);
-/* UBI SPL functions */
-int spl_ubi_load_image(u32 boot_device);
+/**
+ * jump_to_image_linux() - Jump to a Linux kernel from SPL
+ *
+ * This jumps into a Linux kernel using the information in @spl_image.
+ *
+ * @spl_image: Image description to set up
+ * @arg: Argument to pass to Linux (typically a device tree pointer)
+ */
+void __noreturn jump_to_image_linux(struct spl_image_info *spl_image,
+ void *arg);
-/* MMC SPL functions */
-int spl_mmc_load_image(u32 boot_device);
+/**
+ * spl_start_uboot() - Check if SPL should start the kernel or U-Boot
+ *
+ * This is called by the various SPL loaders to determine whether the board
+ * wants to load the kernel or U-Boot. This function should be provided by
+ * the board.
+ *
+ * @return 0 if SPL should start the kernel, 1 if U-Boot must be started
+ */
+int spl_start_uboot(void);
-/* YMODEM SPL functions */
-int spl_ymodem_load_image(void);
+/**
+ * spl_display_print() - Display a board-specific message in SPL
+ *
+ * If CONFIG_SPL_DISPLAY_PRINT is enabled, U-Boot will call this function
+ * immediately after displaying the SPL console banner ("U-Boot SPL ...").
+ * This function should be provided by the board.
+ */
+void spl_display_print(void);
-/* SPI SPL functions */
-int spl_spi_load_image(void);
+/**
+ * struct spl_boot_device - Describes a boot device used by SPL
+ *
+ * @boot_device: A number indicating the BOOT_DEVICE type. There are various
+ * BOOT_DEVICE... #defines and enums in U-Boot and they are not consistently
+ * numbered.
+ * @boot_device_name: Named boot device, or NULL if none.
+ *
+ * Note: Additional fields can be added here, bearing in mind that SPL is
+ * size-sensitive and common fields will be present on all boards. This
+ * struct can also be used to return additional information about the load
+ * process if that becomes useful.
+ */
+struct spl_boot_device {
+ uint boot_device;
+ const char *boot_device_name;
+};
-/* Ethernet SPL functions */
-int spl_net_load_image(const char *device);
+/**
+ * Holds information about a way of loading an SPL image
+ *
+ * @boot_device: Boot device that this loader supports
+ * @load_image: Function to call to load image
+ */
+struct spl_image_loader {
+ uint boot_device;
+ /**
+ * load_image() - Load an SPL image
+ *
+ * @spl_image: place to put image information
+ * @bootdev: describes the boot device to load from
+ */
+ int (*load_image)(struct spl_image_info *spl_image,
+ struct spl_boot_device *bootdev);
+};
-/* USB SPL functions */
-int spl_usb_load_image(void);
+/* Declare an SPL image loader */
+#define SPL_LOAD_IMAGE(__name) \
+ ll_entry_declare(struct spl_image_loader, __name, spl_image_loader)
-/* SATA SPL functions */
-int spl_sata_load_image(void);
+/*
+ * __priority is the priority of this method, 0 meaning it will be the top
+ * choice for this device, 9 meaning it is the bottom choice.
+ * __boot_device is the BOOT_DEVICE_... value
+ * __method is the load_image function to call
+ */
+#define SPL_LOAD_IMAGE_METHOD(__priority, __boot_device, __method) \
+ SPL_LOAD_IMAGE(__method ## __priority ## __boot_device) = { \
+ .boot_device = __boot_device, \
+ .load_image = __method, \
+ }
/* SPL FAT image functions */
-int spl_load_image_fat(struct blk_desc *block_dev, int partition,
+int spl_load_image_fat(struct spl_image_info *spl_image,
+ struct blk_desc *block_dev, int partition,
const char *filename);
-int spl_load_image_fat_os(struct blk_desc *block_dev, int partition);
+int spl_load_image_fat_os(struct spl_image_info *spl_image,
+ struct blk_desc *block_dev, int partition);
void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image);
/* SPL EXT image functions */
-int spl_load_image_ext(struct blk_desc *block_dev, int partition,
+int spl_load_image_ext(struct spl_image_info *spl_image,
+ struct blk_desc *block_dev, int partition,
const char *filename);
-int spl_load_image_ext_os(struct blk_desc *block_dev, int partition);
+int spl_load_image_ext_os(struct spl_image_info *spl_image,
+ struct blk_desc *block_dev, int partition);
/**
* spl_init() - Set up device tree and driver model in SPL if enabled
@@ -152,4 +233,5 @@ bool spl_was_boot_source(void);
* @return 0 on success, otherwise error code
*/
int spl_dfu_cmd(int usbctrl, char *dfu_alt_info, char *interface, char *devstr);
+
#endif