summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/bios_emulator/x86emu/ops.c2
-rw-r--r--drivers/crypto/fsl/jobdesc.c2
-rw-r--r--drivers/ddr/marvell/a38x/ddr3_training.c2
-rw-r--r--drivers/i2c/cros_ec_tunnel.c24
-rw-r--r--drivers/misc/cros_ec.c5
-rw-r--r--drivers/mmc/Makefile1
-rw-r--r--drivers/mmc/mmc_private.h7
-rw-r--r--drivers/mtd/spi/Makefile1
-rw-r--r--drivers/mtd/spi/fsl_espi_spl.c4
-rw-r--r--drivers/mtd/spi/spi_spl_load.c123
-rw-r--r--drivers/mtd/spi/sunxi_spi_spl.c11
-rw-r--r--drivers/net/4xx_enet.c2
-rw-r--r--drivers/pwm/pwm-imx-util.c2
-rw-r--r--drivers/pwm/pwm-imx-util.h2
-rw-r--r--drivers/pwm/pwm-imx.c2
-rw-r--r--drivers/serial/ns16550.c9
-rw-r--r--drivers/spi/fsl_dspi.c2
17 files changed, 50 insertions, 151 deletions
diff --git a/drivers/bios_emulator/x86emu/ops.c b/drivers/bios_emulator/x86emu/ops.c
index 5752fee..ba18135 100644
--- a/drivers/bios_emulator/x86emu/ops.c
+++ b/drivers/bios_emulator/x86emu/ops.c
@@ -41,7 +41,7 @@
* to the 256 byte-"opcodes" found on the 8086. The table which
* dispatches this is found in the files optab.[ch].
*
-* Each opcode proc has a comment preceeding it which gives it's table
+* Each opcode proc has a comment preceding it which gives it's table
* address. Several opcodes are missing (undefined) in the table.
*
* Each proc includes information for decoding (DECODE_PRINTF and
diff --git a/drivers/crypto/fsl/jobdesc.c b/drivers/crypto/fsl/jobdesc.c
index fd0c4f7..6125bbb 100644
--- a/drivers/crypto/fsl/jobdesc.c
+++ b/drivers/crypto/fsl/jobdesc.c
@@ -41,7 +41,7 @@ uint32_t secmem_set_cmd(uint32_t sec_mem_cmd)
/*!
* CAAM page allocation:
* Allocates a partition from secure memory, with the id
- * equal to partion_num. This will de-allocate the page
+ * equal to partition_num. This will de-allocate the page
* if it is already allocated. The partition will have
* full access permissions. The permissions are set before,
* running a job descriptor. A memory page of secure RAM
diff --git a/drivers/ddr/marvell/a38x/ddr3_training.c b/drivers/ddr/marvell/a38x/ddr3_training.c
index 80ef050..7e0749f 100644
--- a/drivers/ddr/marvell/a38x/ddr3_training.c
+++ b/drivers/ddr/marvell/a38x/ddr3_training.c
@@ -1302,7 +1302,7 @@ int ddr3_tip_freq_set(u32 dev_num, enum hws_access_type access_type,
}
if (mem_mask != 0) {
- /* motib redundent in KW28 */
+ /* motib redundant in KW28 */
CHECK_STATUS(ddr3_tip_if_write(dev_num, access_type,
if_id,
CS_ENABLE_REG, 0, 0x8));
diff --git a/drivers/i2c/cros_ec_tunnel.c b/drivers/i2c/cros_ec_tunnel.c
index e2c6e44..9cf8e7d 100644
--- a/drivers/i2c/cros_ec_tunnel.c
+++ b/drivers/i2c/cros_ec_tunnel.c
@@ -11,6 +11,12 @@
#include <errno.h>
#include <i2c.h>
+DECLARE_GLOBAL_DATA_PTR;
+
+struct cros_ec_i2c_bus {
+ int remote_bus;
+};
+
static int cros_ec_i2c_set_bus_speed(struct udevice *dev, unsigned int speed)
{
return 0;
@@ -19,7 +25,21 @@ static int cros_ec_i2c_set_bus_speed(struct udevice *dev, unsigned int speed)
static int cros_ec_i2c_xfer(struct udevice *dev, struct i2c_msg *msg,
int nmsgs)
{
- return cros_ec_i2c_tunnel(dev->parent, msg, nmsgs);
+ struct cros_ec_i2c_bus *i2c_bus = dev_get_priv(dev);
+
+ return cros_ec_i2c_tunnel(dev->parent, i2c_bus->remote_bus, msg, nmsgs);
+}
+
+static int cros_ec_i2c_ofdata_to_platdata(struct udevice *dev)
+{
+ struct cros_ec_i2c_bus *i2c_bus = dev_get_priv(dev);
+ const void *blob = gd->fdt_blob;
+ int node = dev->of_offset;
+
+ i2c_bus->remote_bus = fdtdec_get_uint(blob, node, "google,remote-bus",
+ 0);
+
+ return 0;
}
static const struct dm_i2c_ops cros_ec_i2c_ops = {
@@ -36,5 +56,7 @@ U_BOOT_DRIVER(cros_ec_tunnel) = {
.name = "cros_ec_tunnel",
.id = UCLASS_I2C,
.of_match = cros_ec_i2c_ids,
+ .ofdata_to_platdata = cros_ec_i2c_ofdata_to_platdata,
+ .priv_auto_alloc_size = sizeof(struct cros_ec_i2c_bus),
.ops = &cros_ec_i2c_ops,
};
diff --git a/drivers/misc/cros_ec.c b/drivers/misc/cros_ec.c
index 9378e96..5225cdb 100644
--- a/drivers/misc/cros_ec.c
+++ b/drivers/misc/cros_ec.c
@@ -1058,7 +1058,8 @@ int cros_ec_decode_ec_flash(const void *blob, int node,
return 0;
}
-int cros_ec_i2c_tunnel(struct udevice *dev, struct i2c_msg *in, int nmsgs)
+int cros_ec_i2c_tunnel(struct udevice *dev, int port, struct i2c_msg *in,
+ int nmsgs)
{
struct cros_ec_dev *cdev = dev_get_uclass_priv(dev);
union {
@@ -1078,7 +1079,7 @@ int cros_ec_i2c_tunnel(struct udevice *dev, struct i2c_msg *in, int nmsgs)
int rv;
int i;
- p->port = 0;
+ p->port = port;
p->num_msgs = nmsgs;
size = sizeof(*p) + p->num_msgs * sizeof(*msg);
diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
index 18351fb..d850758 100644
--- a/drivers/mmc/Makefile
+++ b/drivers/mmc/Makefile
@@ -60,6 +60,7 @@ obj-$(CONFIG_ROCKCHIP_SDHCI) += rockchip_sdhci.o
ifdef CONFIG_SPL_BUILD
obj-$(CONFIG_SPL_MMC_BOOT) += fsl_esdhc_spl.o
+obj-$(CONFIG_SPL_SAVEENV) += mmc_write.o
else
obj-$(CONFIG_GENERIC_MMC) += mmc_write.o
endif
diff --git a/drivers/mmc/mmc_private.h b/drivers/mmc/mmc_private.h
index 49ec022..d8b399e 100644
--- a/drivers/mmc/mmc_private.h
+++ b/drivers/mmc/mmc_private.h
@@ -28,8 +28,7 @@ ulong mmc_bread(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt,
void *dst);
#endif
-#ifndef CONFIG_SPL_BUILD
-
+#if !(defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_SAVEENV))
unsigned long mmc_berase(struct blk_desc *block_dev, lbaint_t start,
lbaint_t blkcnt);
@@ -41,9 +40,9 @@ ulong mmc_bwrite(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt,
const void *src);
#endif
-#else /* CONFIG_SPL_BUILD */
+#else /* CONFIG_SPL_BUILD and CONFIG_SPL_SAVEENV is not defined */
-/* SPL will never write or erase, declare dummies to reduce code size. */
+/* declare dummies to reduce code size. */
#ifdef CONFIG_BLK
static inline unsigned long mmc_berase(struct udevice *dev,
diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile
index 6f47a66..f3dc409 100644
--- a/drivers/mtd/spi/Makefile
+++ b/drivers/mtd/spi/Makefile
@@ -8,7 +8,6 @@
obj-$(CONFIG_DM_SPI_FLASH) += sf-uclass.o
ifdef CONFIG_SPL_BUILD
-obj-$(CONFIG_SPL_SPI_LOAD) += spi_spl_load.o
obj-$(CONFIG_SPL_SPI_BOOT) += fsl_espi_spl.o
obj-$(CONFIG_SPL_SPI_SUNXI) += sunxi_spi_spl.o
endif
diff --git a/drivers/mtd/spi/fsl_espi_spl.c b/drivers/mtd/spi/fsl_espi_spl.c
index b915469..1dd44e2 100644
--- a/drivers/mtd/spi/fsl_espi_spl.c
+++ b/drivers/mtd/spi/fsl_espi_spl.c
@@ -12,7 +12,7 @@
#define ESPI_BOOT_IMAGE_ADDR 0x50
#define CONFIG_CFG_DATA_SECTOR 0
-void spi_spl_load_image(uint32_t offs, unsigned int size, void *vdst)
+void fsl_spi_spl_load_image(uint32_t offs, unsigned int size, void *vdst)
{
struct spi_flash *flash;
@@ -31,7 +31,7 @@ void spi_spl_load_image(uint32_t offs, unsigned int size, void *vdst)
* configured and available since this code loads the main U-Boot image
* from SPI into SDRAM and starts it from there.
*/
-void spi_boot(void)
+void fsl_spi_boot(void)
{
void (*uboot)(void) __noreturn;
u32 offset, code_len, copy_len = 0;
diff --git a/drivers/mtd/spi/spi_spl_load.c b/drivers/mtd/spi/spi_spl_load.c
deleted file mode 100644
index bac1e85..0000000
--- a/drivers/mtd/spi/spi_spl_load.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (C) 2011 OMICRON electronics GmbH
- *
- * based on drivers/mtd/nand/nand_spl_load.c
- *
- * Copyright (C) 2011
- * Heiko Schocher, DENX Software Engineering, hs@denx.de.
- *
- * SPDX-License-Identifier: GPL-2.0+
- */
-
-#include <common.h>
-#include <spi.h>
-#include <spi_flash.h>
-#include <errno.h>
-#include <spl.h>
-
-#ifdef CONFIG_SPL_OS_BOOT
-/*
- * Load the kernel, check for a valid header we can parse, and if found load
- * the kernel and then device tree.
- */
-static int spi_load_image_os(struct spi_flash *flash,
- struct image_header *header)
-{
- int err;
-
- /* Read for a header, parse or error out. */
- spi_flash_read(flash, CONFIG_SYS_SPI_KERNEL_OFFS, 0x40,
- (void *)header);
-
- if (image_get_magic(header) != IH_MAGIC)
- return -1;
-
- err = spl_parse_image_header(header);
- if (err)
- return err;
-
- spi_flash_read(flash, CONFIG_SYS_SPI_KERNEL_OFFS,
- spl_image.size, (void *)spl_image.load_addr);
-
- /* Read device tree. */
- spi_flash_read(flash, CONFIG_SYS_SPI_ARGS_OFFS,
- CONFIG_SYS_SPI_ARGS_SIZE,
- (void *)CONFIG_SYS_SPL_ARGS_ADDR);
-
- return 0;
-}
-#endif
-
-static ulong spl_spi_fit_read(struct spl_load_info *load, ulong sector,
- ulong count, void *buf)
-{
- struct spi_flash *flash = load->dev;
- ulong ret;
-
- ret = spi_flash_read(flash, sector, count, buf);
- if (!ret)
- return count;
- else
- return 0;
-}
-/*
- * The main entry for SPI booting. It's necessary that SDRAM is already
- * configured and available since this code loads the main U-Boot image
- * from SPI into SDRAM and starts it from there.
- */
-int spl_spi_load_image(void)
-{
- int err = 0;
- struct spi_flash *flash;
- struct image_header *header;
-
- /*
- * Load U-Boot image from SPI flash into RAM
- */
-
- flash = spi_flash_probe(CONFIG_SF_DEFAULT_BUS,
- CONFIG_SF_DEFAULT_CS,
- CONFIG_SF_DEFAULT_SPEED,
- CONFIG_SF_DEFAULT_MODE);
- if (!flash) {
- puts("SPI probe failed.\n");
- return -ENODEV;
- }
-
- /* use CONFIG_SYS_TEXT_BASE as temporary storage area */
- header = (struct image_header *)(CONFIG_SYS_TEXT_BASE);
-
-#ifdef CONFIG_SPL_OS_BOOT
- if (spl_start_uboot() || spi_load_image_os(flash, header))
-#endif
- {
- /* Load u-boot, mkimage header is 64 bytes. */
- err = spi_flash_read(flash, CONFIG_SYS_SPI_U_BOOT_OFFS, 0x40,
- (void *)header);
- if (err)
- return err;
-
- if (IS_ENABLED(CONFIG_SPL_LOAD_FIT)) {
- struct spl_load_info load;
-
- debug("Found FIT\n");
- load.dev = flash;
- load.priv = NULL;
- load.filename = NULL;
- load.bl_len = 1;
- load.read = spl_spi_fit_read;
- err = spl_load_simple_fit(&load,
- CONFIG_SYS_SPI_U_BOOT_OFFS,
- header);
- } else {
- err = spl_parse_image_header(header);
- if (err)
- return err;
- err = spi_flash_read(flash, CONFIG_SYS_SPI_U_BOOT_OFFS,
- spl_image.size,
- (void *)spl_image.load_addr);
- }
- }
-
- return err;
-}
diff --git a/drivers/mtd/spi/sunxi_spi_spl.c b/drivers/mtd/spi/sunxi_spi_spl.c
index e3ded5b..67c7edd 100644
--- a/drivers/mtd/spi/sunxi_spi_spl.c
+++ b/drivers/mtd/spi/sunxi_spi_spl.c
@@ -262,7 +262,8 @@ static void spi0_read_data(void *buf, u32 addr, u32 len)
/*****************************************************************************/
-int spl_spi_load_image(void)
+static int spl_spi_load_image(struct spl_image_info *spl_image,
+ struct spl_boot_device *bootdev)
{
int err;
struct image_header *header;
@@ -271,13 +272,15 @@ int spl_spi_load_image(void)
spi0_init();
spi0_read_data((void *)header, CONFIG_SYS_SPI_U_BOOT_OFFS, 0x40);
- err = spl_parse_image_header(header);
+ err = spl_parse_image_header(spl_image, header);
if (err)
return err;
- spi0_read_data((void *)spl_image.load_addr, CONFIG_SYS_SPI_U_BOOT_OFFS,
- spl_image.size);
+ spi0_read_data((void *)spl_image->load_addr, CONFIG_SYS_SPI_U_BOOT_OFFS,
+ spl_image->size);
spi0_deinit();
return 0;
}
+/* Use priorty 0 to override the default if it happens to be linked in */
+SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_SPI, spl_spi_load_image);
diff --git a/drivers/net/4xx_enet.c b/drivers/net/4xx_enet.c
index b718481..ca11396 100644
--- a/drivers/net/4xx_enet.c
+++ b/drivers/net/4xx_enet.c
@@ -899,7 +899,7 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
* current transfer) have got the time to arrived before
* netloop calls eth_halt
*/
- printf ("About preceeding transfer (eth%d):\n"
+ printf ("About preceding transfer (eth%d):\n"
"- Sent packet number %d\n"
"- Received packet number %d\n"
"- Handled packet number %d\n",
diff --git a/drivers/pwm/pwm-imx-util.c b/drivers/pwm/pwm-imx-util.c
index f92c370..285564a 100644
--- a/drivers/pwm/pwm-imx-util.c
+++ b/drivers/pwm/pwm-imx-util.c
@@ -2,7 +2,7 @@
* (C) Copyright 2014
* Heiko Schocher, DENX Software Engineering, hs@denx.de.
*
- * Basic support for the pwm modul on imx6.
+ * Basic support for the pwm module on imx6.
*
* Based on linux:drivers/pwm/pwm-imx.c
* from
diff --git a/drivers/pwm/pwm-imx-util.h b/drivers/pwm/pwm-imx-util.h
index 45465c4..5c18651 100644
--- a/drivers/pwm/pwm-imx-util.h
+++ b/drivers/pwm/pwm-imx-util.h
@@ -2,7 +2,7 @@
* (C) Copyright 2014
* Heiko Schocher, DENX Software Engineering, hs@denx.de.
*
- * Basic support for the pwm modul on imx6.
+ * Basic support for the pwm module on imx6.
*
* SPDX-License-Identifier: GPL-2.0
*/
diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c
index 47799fc..3f808f9 100644
--- a/drivers/pwm/pwm-imx.c
+++ b/drivers/pwm/pwm-imx.c
@@ -2,7 +2,7 @@
* (C) Copyright 2014
* Heiko Schocher, DENX Software Engineering, hs@denx.de.
*
- * Basic support for the pwm modul on imx6.
+ * Basic support for the pwm module on imx6.
*
* SPDX-License-Identifier: GPL-2.0+
*/
diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 765499d..6e9b946 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -13,7 +13,6 @@
#include <serial.h>
#include <watchdog.h>
#include <linux/types.h>
-#include <linux/compiler.h>
#include <asm/io.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -354,8 +353,8 @@ int ns16550_serial_ofdata_to_platdata(struct udevice *dev)
{
struct ns16550_platdata *plat = dev->platdata;
fdt_addr_t addr;
- __maybe_unused struct clk clk;
- __maybe_unused int err;
+ struct clk clk;
+ int err;
/* try Processor Local Bus device first */
addr = dev_get_addr(dev);
@@ -402,17 +401,15 @@ int ns16550_serial_ofdata_to_platdata(struct udevice *dev)
plat->reg_shift = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
"reg-shift", 0);
-#ifdef CONFIG_CLK
err = clk_get_by_index(dev, 0, &clk);
if (!err) {
err = clk_get_rate(&clk);
if (!IS_ERR_VALUE(err))
plat->clock = err;
- } else if (err != -ENODEV && err != -ENOSYS) {
+ } else if (err != -ENOENT && err != -ENODEV && err != -ENOSYS) {
debug("ns16550 failed to get clock\n");
return err;
}
-#endif
if (!plat->clock)
plat->clock = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
diff --git a/drivers/spi/fsl_dspi.c b/drivers/spi/fsl_dspi.c
index c8dcb27..f213587 100644
--- a/drivers/spi/fsl_dspi.c
+++ b/drivers/spi/fsl_dspi.c
@@ -594,7 +594,7 @@ static int fsl_dspi_claim_bus(struct udevice *dev)
priv = dev_get_priv(bus);
- /* processor special prepartion work */
+ /* processor special preparation work */
cpu_dspi_claim_bus(bus->seq, slave_plat->cs);
/* configure transfer mode */