diff options
Diffstat (limited to 'drivers')
26 files changed, 207 insertions, 161 deletions
diff --git a/drivers/bios_emulator/x86emu/ops.c b/drivers/bios_emulator/x86emu/ops.c index 5752fee1cd..ba18135fe1 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 fd0c4f7f2f..6125bbb558 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 80ef050bdc..7e0749fde3 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 e2c6e44795..9cf8e7dec0 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 9378e96129..5225cdb1c0 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/misc/mxc_ocotp.c b/drivers/misc/mxc_ocotp.c index 6b8566c8d0..8a100c19bd 100644 --- a/drivers/misc/mxc_ocotp.c +++ b/drivers/misc/mxc_ocotp.c @@ -18,6 +18,7 @@ #include <asm/io.h> #include <asm/arch/clock.h> #include <asm/arch/imx-regs.h> +#include <asm/imx-common/sys_proto.h> #define BO_CTRL_WR_UNLOCK 16 #define BM_CTRL_WR_UNLOCK 0xffff0000 @@ -61,6 +62,8 @@ #define FUSE_BANK_SIZE 0x80 #ifdef CONFIG_MX6SL #define FUSE_BANKS 8 +#elif defined(CONFIG_MX6ULL) +#define FUSE_BANKS 9 #else #define FUSE_BANKS 16 #endif @@ -72,11 +75,11 @@ #endif #if defined(CONFIG_MX6) -#include <asm/arch/sys_proto.h> /* * There is a hole in shadow registers address map of size 0x100 - * between bank 5 and bank 6 on iMX6QP, iMX6DQ, iMX6SDL, iMX6SX and iMX6UL. + * between bank 5 and bank 6 on iMX6QP, iMX6DQ, iMX6SDL, iMX6SX, + * iMX6UL and i.MX6ULL. * Bank 5 ends at 0x6F0 and Bank 6 starts at 0x800. When reading the fuses, * we should account for this hole in address space. * @@ -97,7 +100,10 @@ u32 fuse_bank_physical(int index) if (is_mx6sl()) { phy_index = index; - } else if (is_mx6ul()) { + } else if (is_mx6ul() || is_mx6ull()) { + if (is_mx6ull() && index == 8) + index = 7; + if (index >= 6) phy_index = fuse_bank_physical(5) + (index - 6) + 3; else @@ -112,11 +118,27 @@ u32 fuse_bank_physical(int index) } return phy_index; } + +u32 fuse_word_physical(u32 bank, u32 word_index) +{ + if (is_mx6ull()) { + if (bank == 8) + word_index = word_index + 4; + } + + return word_index; +} #else u32 fuse_bank_physical(int index) { return index; } + +u32 fuse_word_physical(u32 bank, u32 word_index) +{ + return word_index; +} + #endif static void wait_busy(struct ocotp_regs *regs, unsigned int delay_us) @@ -142,6 +164,14 @@ static int prepare_access(struct ocotp_regs **regs, u32 bank, u32 word, return -EINVAL; } + if (is_mx6ull()) { + if ((bank == 7 || bank == 8) && + word >= ARRAY_SIZE((*regs)->bank[0].fuse_regs) >> 3) { + printf("mxc_ocotp %s(): Invalid argument on 6ULL\n", caller); + return -EINVAL; + } + } + enable_ocotp_clk(1); wait_busy(*regs, 1); @@ -176,14 +206,16 @@ int fuse_read(u32 bank, u32 word, u32 *val) struct ocotp_regs *regs; int ret; u32 phy_bank; + u32 phy_word; ret = prepare_read(®s, bank, word, val, __func__); if (ret) return ret; phy_bank = fuse_bank_physical(bank); + phy_word = fuse_word_physical(bank, word); - *val = readl(®s->bank[phy_bank].fuse_regs[word << 2]); + *val = readl(®s->bank[phy_bank].fuse_regs[phy_word << 2]); return finish_access(regs, __func__); } @@ -237,7 +269,13 @@ static void setup_direct_access(struct ocotp_regs *regs, u32 bank, u32 word, #ifdef CONFIG_MX7 u32 addr = bank; #else - u32 addr = bank << 3 | word; + u32 addr; + /* Bank 7 and Bank 8 only supports 4 words each for i.MX6ULL */ + if ((is_mx6ull()) && (bank > 7)) { + bank = bank - 1; + word += 4; + } + addr = bank << 3 | word; #endif set_timing(regs); @@ -325,14 +363,16 @@ int fuse_override(u32 bank, u32 word, u32 val) struct ocotp_regs *regs; int ret; u32 phy_bank; + u32 phy_word; ret = prepare_write(®s, bank, word, __func__); if (ret) return ret; phy_bank = fuse_bank_physical(bank); + phy_word = fuse_word_physical(bank, word); - writel(val, ®s->bank[phy_bank].fuse_regs[word << 2]); + writel(val, ®s->bank[phy_bank].fuse_regs[phy_word << 2]); return finish_access(regs, __func__); } diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile index 18351fb48a..d8507589ca 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/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index 103b32e9cf..9796d39c65 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -1010,6 +1010,7 @@ static int fsl_esdhc_probe(struct udevice *dev) } upriv->mmc = priv->mmc; + priv->mmc->dev = dev; return 0; } diff --git a/drivers/mmc/mmc_private.h b/drivers/mmc/mmc_private.h index 49ec022a9e..d8b399e364 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 6f47a66f40..f3dc409632 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 b915469b40..1dd44e2ca9 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 bac1e85af3..0000000000 --- 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 e3ded5b4e8..67c7edd92d 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 b71848168a..ca1139676b 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/pinctrl/nxp/pinctrl-imx.c b/drivers/pinctrl/nxp/pinctrl-imx.c index 40b0616c0b..949d0f32d8 100644 --- a/drivers/pinctrl/nxp/pinctrl-imx.c +++ b/drivers/pinctrl/nxp/pinctrl-imx.c @@ -222,7 +222,7 @@ int imx_pinctrl_probe(struct udevice *dev, return -ENOMEM; } - dev_info(dev, "initialized IMX pinctrl driver\n"); + dev_dbg(dev, "initialized IMX pinctrl driver\n"); return 0; } diff --git a/drivers/pinctrl/nxp/pinctrl-imx6.c b/drivers/pinctrl/nxp/pinctrl-imx6.c index 24f139e95c..32b4754919 100644 --- a/drivers/pinctrl/nxp/pinctrl-imx6.c +++ b/drivers/pinctrl/nxp/pinctrl-imx6.c @@ -12,6 +12,10 @@ static struct imx_pinctrl_soc_info imx6_pinctrl_soc_info; +static struct imx_pinctrl_soc_info imx6_snvs_pinctrl_soc_info = { + .flags = ZERO_OFFSET_VALID, +}; + static int imx6_pinctrl_probe(struct udevice *dev) { struct imx_pinctrl_soc_info *info = @@ -26,6 +30,7 @@ static const struct udevice_id imx6_pinctrl_match[] = { { .compatible = "fsl,imx6sl-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info }, { .compatible = "fsl,imx6sx-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info }, { .compatible = "fsl,imx6ul-iomuxc", .data = (ulong)&imx6_pinctrl_soc_info }, + { .compatible = "fsl,imx6ull-iomuxc-snvs", .data = (ulong)&imx6_snvs_pinctrl_soc_info }, { /* sentinel */ } }; diff --git a/drivers/power/pmic/Kconfig b/drivers/power/pmic/Kconfig index 69f8d51885..13d293a93d 100644 --- a/drivers/power/pmic/Kconfig +++ b/drivers/power/pmic/Kconfig @@ -127,6 +127,14 @@ config PMIC_S5M8767 driver provides basic register access and sets up the attached regulators if regulator support is enabled. +config PMIC_RN5T567 + bool "Enable driver for Ricoh RN5T567 PMIC" + depends on DM_PMIC + ---help--- + The RN5T567 is a PMIC with 4 step-down DC/DC converters, 5 LDO + regulators Real-Time Clock and 4 GPIOs. This driver provides + register access only. + config PMIC_TPS65090 bool "Enable driver for Texas Instruments TPS65090 PMIC" depends on DM_PMIC diff --git a/drivers/power/pmic/Makefile b/drivers/power/pmic/Makefile index 52b4f711fb..37d9eb5599 100644 --- a/drivers/power/pmic/Makefile +++ b/drivers/power/pmic/Makefile @@ -13,6 +13,7 @@ obj-$(CONFIG_DM_PMIC_SANDBOX) += sandbox.o i2c_pmic_emul.o obj-$(CONFIG_PMIC_ACT8846) += act8846.o obj-$(CONFIG_PMIC_PM8916) += pm8916.o obj-$(CONFIG_PMIC_RK808) += rk808.o +obj-$(CONFIG_PMIC_RN5T567) += rn5t567.o obj-$(CONFIG_PMIC_TPS65090) += tps65090.o obj-$(CONFIG_PMIC_S5M8767) += s5m8767.o diff --git a/drivers/power/pmic/rn5t567.c b/drivers/power/pmic/rn5t567.c new file mode 100644 index 0000000000..001e69553e --- /dev/null +++ b/drivers/power/pmic/rn5t567.c @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2016 Toradex AG + * Stefan Agner <stefan.agner@toradex.com> + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <dm.h> +#include <errno.h> +#include <fdtdec.h> +#include <libfdt.h> +#include <power/rn5t567_pmic.h> +#include <power/pmic.h> + +static int rn5t567_reg_count(struct udevice *dev) +{ + return RN5T567_NUM_OF_REGS; +} + +static int rn5t567_write(struct udevice *dev, uint reg, const uint8_t *buff, + int len) +{ + int ret; + + ret = dm_i2c_write(dev, reg, buff, len); + if (ret) { + debug("write error to device: %p register: %#x!", dev, reg); + return ret; + } + + return 0; +} + +static int rn5t567_read(struct udevice *dev, uint reg, uint8_t *buff, int len) +{ + int ret; + + ret = dm_i2c_read(dev, reg, buff, len); + if (ret) { + debug("read error from device: %p register: %#x!", dev, reg); + return ret; + } + + return 0; +} + +static struct dm_pmic_ops rn5t567_ops = { + .reg_count = rn5t567_reg_count, + .read = rn5t567_read, + .write = rn5t567_write, +}; + +static const struct udevice_id rn5t567_ids[] = { + { .compatible = "ricoh,rn5t567" }, + { } +}; + +U_BOOT_DRIVER(pmic_rn5t567) = { + .name = "rn5t567 pmic", + .id = UCLASS_PMIC, + .of_match = rn5t567_ids, + .ops = &rn5t567_ops, +}; diff --git a/drivers/pwm/pwm-imx-util.c b/drivers/pwm/pwm-imx-util.c index f92c3700f8..285564a6db 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 45465c4fde..5c1865135f 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 47799fc0d1..3f808f925b 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 765499dab6..6e9b946bf7 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/serial/serial_mxc.c b/drivers/serial/serial_mxc.c index 8545714411..4fd2b1dd05 100644 --- a/drivers/serial/serial_mxc.c +++ b/drivers/serial/serial_mxc.c @@ -108,6 +108,8 @@ #define UTS_RXFULL (1<<3) /* RxFIFO full */ #define UTS_SOFTRST (1<<0) /* Software reset */ +DECLARE_GLOBAL_DATA_PTR; + #ifndef CONFIG_DM_SERIAL #ifndef CONFIG_MXC_UART_BASE @@ -135,8 +137,6 @@ #define UBRC 0xac /* Baud Rate Count Register */ #define UTS 0xb4 /* UART Test Register (mx31) */ -DECLARE_GLOBAL_DATA_PTR; - #define TXTL 2 /* reset default */ #define RXTL 1 /* reset default */ #define RFDIV 4 /* divide input clock by 2 */ @@ -347,9 +347,37 @@ static const struct dm_serial_ops mxc_serial_ops = { .setbrg = mxc_serial_setbrg, }; +#if CONFIG_IS_ENABLED(OF_CONTROL) +static int mxc_serial_ofdata_to_platdata(struct udevice *dev) +{ + struct mxc_serial_platdata *plat = dev->platdata; + fdt_addr_t addr; + + addr = dev_get_addr(dev); + if (addr == FDT_ADDR_T_NONE) + return -EINVAL; + + plat->reg = (struct mxc_uart *)addr; + + plat->use_dte = fdtdec_get_bool(gd->fdt_blob, dev->of_offset, + "fsl,dte-mode"); + return 0; +} + +static const struct udevice_id mxc_serial_ids[] = { + { .compatible = "fsl,imx7d-uart" }, + { } +}; +#endif + U_BOOT_DRIVER(serial_mxc) = { .name = "serial_mxc", .id = UCLASS_SERIAL, +#if CONFIG_IS_ENABLED(OF_CONTROL) + .of_match = mxc_serial_ids, + .ofdata_to_platdata = mxc_serial_ofdata_to_platdata, + .platdata_auto_alloc_size = sizeof(struct mxc_serial_platdata), +#endif .probe = mxc_serial_probe, .ops = &mxc_serial_ops, .flags = DM_FLAG_PRE_RELOC, diff --git a/drivers/spi/fsl_dspi.c b/drivers/spi/fsl_dspi.c index c8dcb277f2..f213587557 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 */ diff --git a/drivers/watchdog/imx_watchdog.c b/drivers/watchdog/imx_watchdog.c index 2938d9f1fe..3f826d10eb 100644 --- a/drivers/watchdog/imx_watchdog.c +++ b/drivers/watchdog/imx_watchdog.c @@ -34,7 +34,7 @@ void hw_watchdog_init(void) #endif timeout = (CONFIG_WATCHDOG_TIMEOUT_MSECS / 500) - 1; writew(WCR_WDZST | WCR_WDBG | WCR_WDE | WCR_WDT | WCR_SRS | - SET_WCR_WT(timeout), &wdog->wcr); + WCR_WDA | SET_WCR_WT(timeout), &wdog->wcr); hw_watchdog_reset(); } #endif |