aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJavier Almansa Sobrino <javier.almansasobrino@arm.com>2019-12-09 13:32:00 +0000
committerJavier Almansa Sobrino <javier.almansasobrino@arm.com>2019-12-16 13:10:37 +0000
commitd31b6b55e12ed5aa334805000864eeeaca857ddb (patch)
tree3252d5f674e87f76df326d5dd27ed912d1284192 /drivers
parent3c96c4b7a1e650aaf6a13e91d1beecce00a8233a (diff)
downloadtf-a-tests-d31b6b55e12ed5aa334805000864eeeaca857ddb.tar.gz
Aligning block_buffer to uint32_t
block_buffer will eventually be used by the flash_write_buffer() implementation of the NOR driver for the Juno board. That implementation requires the buffer passed to it to be 32bit aligned, which might not be enforced depending on the compiler optimizations. This patch will enforce that alignment on all cases. Change-Id: I84d22f6b796d5d6c93d3c69dd24c7ebe01103691 Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/io/vexpress_nor/io_vexpress_nor_hw.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/io/vexpress_nor/io_vexpress_nor_hw.c b/drivers/io/vexpress_nor/io_vexpress_nor_hw.c
index 6e563c9f..ada813b7 100644
--- a/drivers/io/vexpress_nor/io_vexpress_nor_hw.c
+++ b/drivers/io/vexpress_nor/io_vexpress_nor_hw.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -8,6 +8,7 @@
#include <debug.h>
#include <mmio.h>
#include <string.h>
+#include <cdefs.h>
#include "io_vexpress_nor_internal.h"
#include "norflash.h"
@@ -405,7 +406,7 @@ lock_block:
}
/* In case of partial write we need to save the block into a temporary buffer */
-static char block_buffer[NOR_FLASH_BLOCK_SIZE];
+static char block_buffer[NOR_FLASH_BLOCK_SIZE] __aligned(sizeof(uint32_t));
int flash_partial_write(file_state_t *fp, uint32_t offset,
const uintptr_t buffer, size_t length, size_t *written)