diff options
author | Sandrine Bailleux <sandrine.bailleux@arm.com> | 2015-05-01 11:43:21 +0100 |
---|---|---|
committer | Sandrine Bailleux <sandrine.bailleux@arm.com> | 2015-06-09 13:34:34 +0100 |
commit | 2c40f00c9c0aee6b5d0f258dd754bcc572a19c14 (patch) | |
tree | 3df3cd01141a25b9424ce7c22832a72955dcfac7 /plat/common | |
parent | 90b5aa0a1bd6ea26bcd997c7b7f79009e65746b8 (diff) |
Fix the value of TESTS_NVM_RESULTS_SIZE
On all 3 supported platforms, the TESTS_NVM_RESULTS_SIZE #define is
currently 64MB, which corresponds to the entire Flash memory.
However, the first 40MB of Flash are reserved for firmware usage,
as the TESTS_NVM_RESULTS_OFFSET #define accounts for. This means
the TFTF can only use the last 24MB.
This patch fixes the value of TESTS_NVM_RESULTS_SIZE to reflect this.
It also changes the names of TESTS_NVM_RESULTS_OFFSET and
TESTS_NVM_RESULTS_SIZE to better reflect their meaning.
Change-Id: I9b8edd185885af112e5f0b1a0c61fa923288fc7f
Diffstat (limited to 'plat/common')
-rw-r--r-- | plat/common/tftf_nvm_accessors.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/plat/common/tftf_nvm_accessors.c b/plat/common/tftf_nvm_accessors.c index 0022e57..9bbffe6 100644 --- a/plat/common/tftf_nvm_accessors.c +++ b/plat/common/tftf_nvm_accessors.c @@ -44,7 +44,7 @@ STATUS tftf_nvm_write(UINTN offset, const void *buffer, UINTN size) size_t length_written; #endif - if (offset + size > TESTS_NVM_RESULTS_SIZE) + if (offset + size > TFTF_NVM_SIZE) return STATUS_OUT_OF_RESOURCES; #if USE_NVM @@ -52,7 +52,7 @@ STATUS tftf_nvm_write(UINTN offset, const void *buffer, UINTN size) plat_get_nvm_handle(&nvm_handle); ret = io_seek(nvm_handle, IO_SEEK_SET, - offset + TESTS_NVM_RESULTS_OFFSET); + offset + TFTF_NVM_OFFSET); if (ret != IO_SUCCESS) return STATUS_FAIL; @@ -63,8 +63,7 @@ STATUS tftf_nvm_write(UINTN offset, const void *buffer, UINTN size) assert(length_written == size); #else - memcpy((void *)(DRAM_BASE + TESTS_NVM_RESULTS_OFFSET + offset), - buffer, size); + memcpy((void *)(DRAM_BASE + TFTF_NVM_OFFSET + offset), buffer, size); #endif return STATUS_SUCCESS; @@ -78,15 +77,14 @@ STATUS tftf_nvm_read(UINTN offset, void *buffer, UINTN size) size_t length_read; #endif - if (offset + size > TESTS_NVM_RESULTS_SIZE) + if (offset + size > TFTF_NVM_SIZE) return STATUS_OUT_OF_RESOURCES; #if USE_NVM /* Obtain a handle to the NVM by querying the platfom layer */ plat_get_nvm_handle(&nvm_handle); - ret = io_seek(nvm_handle, IO_SEEK_SET, - TESTS_NVM_RESULTS_OFFSET + offset); + ret = io_seek(nvm_handle, IO_SEEK_SET, TFTF_NVM_OFFSET + offset); if (ret != IO_SUCCESS) return STATUS_FAIL; @@ -96,8 +94,7 @@ STATUS tftf_nvm_read(UINTN offset, void *buffer, UINTN size) assert(length_read == size); #else - memcpy(buffer, (void *)(DRAM_BASE + TESTS_NVM_RESULTS_OFFSET + offset), - size); + memcpy(buffer, (void *)(DRAM_BASE + TFTF_NVM_OFFSET + offset), size); #endif return STATUS_SUCCESS; } |