diff options
author | Soby Mathew <soby.mathew@arm.com> | 2020-01-17 17:41:21 +0000 |
---|---|---|
committer | TrustedFirmware Code Review <review@review.trustedfirmware.org> | 2020-01-17 17:41:21 +0000 |
commit | 45cc606ea7bbf8931be715a51c1819e7dd22e936 (patch) | |
tree | d0fc5d2abd7342373f56d406522115a218d8373b /drivers/renesas/rcar | |
parent | 5a4b090fccfa7ee7b06dc849dd1b9136a8d657c7 (diff) | |
parent | 70cb0bff7d42bd9e09dddef3c2fc6e3b385c6e5a (diff) | |
download | trusted-firmware-a-45cc606ea7bbf8931be715a51c1819e7dd22e936.tar.gz |
Merge changes from topic "ld/mtd_framework" into integration
* changes:
io: change seek offset to signed long long
compiler_rt: Import aeabi_ldivmode.S file and dependencies
Diffstat (limited to 'drivers/renesas/rcar')
-rw-r--r-- | drivers/renesas/rcar/io/io_emmcdrv.c | 20 | ||||
-rw-r--r-- | drivers/renesas/rcar/io/io_memdrv.c | 19 |
2 files changed, 20 insertions, 19 deletions
diff --git a/drivers/renesas/rcar/io/io_emmcdrv.c b/drivers/renesas/rcar/io/io_emmcdrv.c index 4b464fb3e4..84240d2606 100644 --- a/drivers/renesas/rcar/io/io_emmcdrv.c +++ b/drivers/renesas/rcar/io/io_emmcdrv.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2017, Renesas Electronics Corporation. All rights reserved. + * Copyright (c) 2015-2019, Renesas Electronics Corporation. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -25,7 +25,7 @@ static int32_t emmcdrv_dev_close(io_dev_info_t *dev_info); typedef struct { uint32_t in_use; uintptr_t base; - ssize_t file_pos; + signed long long file_pos; EMMC_PARTITION_ID partition; } file_state_t; @@ -39,7 +39,7 @@ static io_type_t device_type_emmcdrv(void) } static int32_t emmcdrv_block_seek(io_entity_t *entity, int32_t mode, - ssize_t offset) + signed long long offset) { if (mode != IO_SEEK_SET) return IO_FAIL; @@ -59,12 +59,12 @@ static int32_t emmcdrv_block_read(io_entity_t *entity, uintptr_t buffer, sector_add = current_file.file_pos >> EMMC_SECTOR_SIZE_SHIFT; sector_num = (length + EMMC_SECTOR_SIZE - 1U) >> EMMC_SECTOR_SIZE_SHIFT; - NOTICE("BL2: Load dst=0x%lx src=(p:%d)0x%lx(%d) len=0x%lx(%d)\n", + NOTICE("BL2: Load dst=0x%lx src=(p:%d)0x%llx(%d) len=0x%lx(%d)\n", buffer, current_file.partition, current_file.file_pos, sector_add, length, sector_num); - if (buffer + length - 1 <= UINT32_MAX) + if ((buffer + length - 1U) <= (uintptr_t)UINT32_MAX) emmc_dma = LOADIMAGE_FLAGS_DMA_ENABLE; if (emmc_read_sector((uint32_t *) buffer, sector_add, sector_num, @@ -72,7 +72,7 @@ static int32_t emmcdrv_block_read(io_entity_t *entity, uintptr_t buffer, result = IO_FAIL; *length_read = length; - fp->file_pos += length; + fp->file_pos += (signed long long)length; return result; } @@ -82,7 +82,7 @@ static int32_t emmcdrv_block_open(io_dev_info_t *dev_info, { const io_drv_spec_t *block_spec = (io_drv_spec_t *) spec; - if (current_file.in_use) { + if (current_file.in_use != 0U) { WARN("mmc_block: Only one open spec at a time\n"); return IO_RESOURCES_EXHAUSTED; } @@ -103,9 +103,9 @@ static int32_t emmcdrv_block_open(io_dev_info_t *dev_info, return IO_FAIL; } - if (PARTITION_ID_USER == block_spec->partition || - PARTITION_ID_BOOT_1 == block_spec->partition || - PARTITION_ID_BOOT_2 == block_spec->partition) + if ((PARTITION_ID_USER == block_spec->partition) || + (PARTITION_ID_BOOT_1 == block_spec->partition) || + (PARTITION_ID_BOOT_2 == block_spec->partition)) current_file.partition = block_spec->partition; else current_file.partition = emmcdrv_bootpartition; diff --git a/drivers/renesas/rcar/io/io_memdrv.c b/drivers/renesas/rcar/io/io_memdrv.c index 3f6b4c71b1..7e8c1d3a65 100644 --- a/drivers/renesas/rcar/io/io_memdrv.c +++ b/drivers/renesas/rcar/io/io_memdrv.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2018, Renesas Electronics Corporation. All rights reserved. + * Copyright (c) 2015-2019, Renesas Electronics Corporation. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -28,7 +28,7 @@ static int32_t memdrv_dev_close(io_dev_info_t *dev_info); typedef struct { uint32_t in_use; uintptr_t base; - ssize_t file_pos; + signed long long file_pos; } file_state_t; static file_state_t current_file = { 0 }; @@ -47,7 +47,7 @@ static int32_t memdrv_block_open(io_dev_info_t *dev_info, const uintptr_t spec, * spec at a time. When we have dynamic memory we can malloc and set * entity->info. */ - if (current_file.in_use) + if (current_file.in_use != 0U) return IO_RESOURCES_EXHAUSTED; /* File cursor offset for seek and incremental reads etc. */ @@ -61,7 +61,7 @@ static int32_t memdrv_block_open(io_dev_info_t *dev_info, const uintptr_t spec, } static int32_t memdrv_block_seek(io_entity_t *entity, int32_t mode, - ssize_t offset) + signed long long offset) { if (mode != IO_SEEK_SET) return IO_FAIL; @@ -78,16 +78,17 @@ static int32_t memdrv_block_read(io_entity_t *entity, uintptr_t buffer, fp = (file_state_t *) entity->info; - NOTICE("BL2: dst=0x%lx src=0x%lx len=%ld(0x%lx)\n", - buffer, fp->base + fp->file_pos, length, length); + NOTICE("BL2: dst=0x%lx src=0x%llx len=%ld(0x%lx)\n", + buffer, (unsigned long long)fp->base + + (unsigned long long)fp->file_pos, length, length); - if (FLASH_MEMORY_SIZE < fp->file_pos + length) { + if (FLASH_MEMORY_SIZE < (fp->file_pos + (signed long long)length)) { ERROR("BL2: check load image (source address)\n"); return IO_FAIL; } - rcar_dma_exec(buffer, fp->base + fp->file_pos, length); - fp->file_pos += length; + rcar_dma_exec(buffer, fp->base + (uintptr_t)fp->file_pos, length); + fp->file_pos += (signed long long)length; *cnt = length; return IO_SUCCESS; |