diff options
author | Tom Rini <trini@konsulko.com> | 2020-04-22 08:58:41 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-04-22 08:58:41 -0400 |
commit | 2b63959e30f23ef3088dbed6626341c6d8371a66 (patch) | |
tree | 1ea89ae7672fbb34886d05c0f6eabfea4d0e00d3 /common | |
parent | 2f2031e647564be8121c05507fbec8e6c5bc0e63 (diff) | |
parent | 2448c34f9fc26d3c459e6e7b28c6357656bfa287 (diff) | |
download | u-boot-2b63959e30f23ef3088dbed6626341c6d8371a66.zip u-boot-2b63959e30f23ef3088dbed6626341c6d8371a66.tar.gz u-boot-2b63959e30f23ef3088dbed6626341c6d8371a66.tar.bz2 |
Merge tag 'mmc-2020-4-22' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmc
- iproc_sdhci memory leak fix and enable R1B resp quirk
- more mmc cmds and several mmc updates from Heinirich
- Use bounce buffer for tmio sdhci
- Alignment check for tmio sdhci
Diffstat (limited to 'common')
-rw-r--r-- | common/bouncebuf.c | 20 | ||||
-rw-r--r-- | common/spl/spl_mmc.c | 9 |
2 files changed, 19 insertions, 10 deletions
diff --git a/common/bouncebuf.c b/common/bouncebuf.c index 614eb36..0ace152 100644 --- a/common/bouncebuf.c +++ b/common/bouncebuf.c @@ -31,17 +31,19 @@ static int addr_aligned(struct bounce_buffer *state) return 1; } -int bounce_buffer_start(struct bounce_buffer *state, void *data, - size_t len, unsigned int flags) +int bounce_buffer_start_extalign(struct bounce_buffer *state, void *data, + size_t len, unsigned int flags, + size_t alignment, + int (*addr_is_aligned)(struct bounce_buffer *state)) { state->user_buffer = data; state->bounce_buffer = data; state->len = len; - state->len_aligned = roundup(len, ARCH_DMA_MINALIGN); + state->len_aligned = roundup(len, alignment); state->flags = flags; - if (!addr_aligned(state)) { - state->bounce_buffer = memalign(ARCH_DMA_MINALIGN, + if (!addr_is_aligned(state)) { + state->bounce_buffer = memalign(alignment, state->len_aligned); if (!state->bounce_buffer) return -ENOMEM; @@ -62,6 +64,14 @@ int bounce_buffer_start(struct bounce_buffer *state, void *data, return 0; } +int bounce_buffer_start(struct bounce_buffer *state, void *data, + size_t len, unsigned int flags) +{ + return bounce_buffer_start_extalign(state, data, len, flags, + ARCH_DMA_MINALIGN, + addr_aligned); +} + int bounce_buffer_stop(struct bounce_buffer *state) { if (state->flags & GEN_BB_WRITE) { diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index a2ea363..a68cdec 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -298,7 +298,7 @@ static int spl_mmc_do_fs_boot(struct spl_image_info *spl_image, struct mmc *mmc, } #endif -u32 __weak spl_boot_mode(const u32 boot_device) +u32 __weak spl_mmc_boot_mode(const u32 boot_device) { #if defined(CONFIG_SPL_FS_FAT) || defined(CONFIG_SPL_FS_EXT4) return MMCSD_MODE_FS; @@ -310,8 +310,7 @@ u32 __weak spl_boot_mode(const u32 boot_device) } #ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION -__weak -int spl_boot_partition(const u32 boot_device) +int __weak spl_mmc_boot_partition(const u32 boot_device) { return CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION; } @@ -350,7 +349,7 @@ int spl_mmc_load(struct spl_image_info *spl_image, } } - boot_mode = spl_boot_mode(bootdev->boot_device); + boot_mode = spl_mmc_boot_mode(bootdev->boot_device); err = -EINVAL; switch (boot_mode) { case MMCSD_MODE_EMMCBOOT: @@ -431,7 +430,7 @@ int spl_mmc_load_image(struct spl_image_info *spl_image, NULL, #endif #ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION - spl_boot_partition(bootdev->boot_device), + spl_mmc_boot_partition(bootdev->boot_device), #else 0, #endif |