diff options
-rw-r--r-- | drivers/dma/dma-uclass.c | 4 | ||||
-rw-r--r-- | drivers/mtd/cfi_flash.c | 24 | ||||
-rw-r--r-- | drivers/mtd/cfi_mtd.c | 4 |
3 files changed, 11 insertions, 21 deletions
diff --git a/drivers/dma/dma-uclass.c b/drivers/dma/dma-uclass.c index 8cbb3640427..50403148d6d 100644 --- a/drivers/dma/dma-uclass.c +++ b/drivers/dma/dma-uclass.c @@ -219,8 +219,8 @@ int dma_get_device(u32 transfer_type, struct udevice **devp) } if (!dev) { - pr_err("No DMA device found that supports %x type\n", - transfer_type); + pr_debug("No DMA device found that supports %x type\n", + transfer_type); return -EPROTONOSUPPORT; } diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index b7289ba5394..9e3a652f445 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -2468,29 +2468,17 @@ unsigned long flash_init(void) #ifdef CONFIG_CFI_FLASH /* for driver model */ static int cfi_flash_probe(struct udevice *dev) { - const fdt32_t *cell; - int addrc, sizec; - int len, idx; + fdt_addr_t addr; + int idx; - addrc = dev_read_addr_cells(dev); - sizec = dev_read_size_cells(dev); - - /* decode regs; there may be multiple reg tuples. */ - cell = dev_read_prop(dev, "reg", &len); - if (!cell) - return -ENOENT; - idx = 0; - len /= sizeof(fdt32_t); - while (idx < len) { - phys_addr_t addr; - - addr = dev_translate_address(dev, cell + idx); + for (idx = 0; idx < CFI_MAX_FLASH_BANKS; idx++) { + addr = dev_read_addr_index(dev, idx); + if (addr == FDT_ADDR_T_NONE) + break; flash_info[cfi_flash_num_flash_banks].dev = dev; flash_info[cfi_flash_num_flash_banks].base = addr; cfi_flash_num_flash_banks++; - - idx += addrc + sizec; } gd->bd->bi_flashstart = flash_info[0].base; diff --git a/drivers/mtd/cfi_mtd.c b/drivers/mtd/cfi_mtd.c index a5bb0962e55..78293caa2f7 100644 --- a/drivers/mtd/cfi_mtd.c +++ b/drivers/mtd/cfi_mtd.c @@ -6,6 +6,7 @@ */ #include <common.h> +#include <dma.h> #include <flash.h> #include <malloc.h> @@ -70,7 +71,8 @@ static int cfi_mtd_read(struct mtd_info *mtd, loff_t from, size_t len, flash_info_t *fi = mtd->priv; u_char *f = (u_char*)(fi->start[0]) + from; - memcpy(buf, f, len); + if (dma_memcpy(buf, f, len) < 0) + memcpy(buf, f, len); *retlen = len; return 0; |