mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-17 01:54:22 +00:00
feat(stm32mp1): add define for external scratch buffer for nand devices
Override the default platform function to use an external buffer on STM32MP13 platform. It allows to use a temporary buffer located at the SRAM1 memory end. Signed-off-by: Lionel Debieve <lionel.debieve@foss.st.com> Change-Id: Ibd84bb336c60af24608268916b3a18bb5a0fa3db
This commit is contained in:
parent
f29c0702d2
commit
9ee2510b62
2 changed files with 18 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <common/debug.h>
|
||||
|
@ -15,6 +16,17 @@
|
|||
#include <plat/common/platform.h>
|
||||
|
||||
#if STM32MP_RAW_NAND || STM32MP_SPI_NAND
|
||||
#if STM32MP13
|
||||
void plat_get_scratch_buffer(void **buffer_addr, size_t *buf_size)
|
||||
{
|
||||
assert(buffer_addr != NULL);
|
||||
assert(buf_size != NULL);
|
||||
|
||||
*buffer_addr = (void *)STM32MP_MTD_BUFFER;
|
||||
*buf_size = PLATFORM_MTD_MAX_PAGE_SIZE;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int get_data_from_otp(struct nand_device *nand_dev, bool is_slc)
|
||||
{
|
||||
uint32_t nand_param;
|
||||
|
|
|
@ -194,6 +194,12 @@ enum ddr_type {
|
|||
/* Define maximum page size for NAND devices */
|
||||
#define PLATFORM_MTD_MAX_PAGE_SIZE U(0x1000)
|
||||
|
||||
/* Define location for the MTD scratch buffer */
|
||||
#if STM32MP13
|
||||
#define STM32MP_MTD_BUFFER (SRAM1_BASE + \
|
||||
SRAM1_SIZE - \
|
||||
PLATFORM_MTD_MAX_PAGE_SIZE)
|
||||
#endif
|
||||
/*******************************************************************************
|
||||
* STM32MP1 device/io map related constants (used for MMU)
|
||||
******************************************************************************/
|
||||
|
|
Loading…
Add table
Reference in a new issue