arm-trusted-firmware/drivers/nxp/flexspi/nor/flexspi_nor.c
Kuldeep Singh b525a8f0d2 nxp: add flexspi driver support
Flexspi driver now introduces read/write/erase APIs for complete flash
size, FAST-READ are by default used and IP bus is used for erase, read
and write using flexspi APIs.

Framework layer is currently embedded in driver itself using flash_info
defines.

Test cases are also added to confirm flash functionality currently under
DEBUG flag.

Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Change-Id: I755c0f763f6297a35cad6885f84640de50f51bb0
2021-03-24 09:49:31 +05:30

25 lines
560 B
C

/*
* Copyright 2020 NXP
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/
#include <assert.h>
#include <fspi_api.h>
#include <lib/mmio.h>
#include <lib/xlat_tables/xlat_tables_v2.h>
int flexspi_nor_io_setup(uintptr_t nxp_flexspi_flash_addr,
size_t nxp_flexspi_flash_size, uint32_t fspi_base_reg_addr)
{
int ret = 0;
ret = fspi_init(fspi_base_reg_addr, nxp_flexspi_flash_addr);
/* Adding NOR Memory Map in XLAT Table */
mmap_add_region(nxp_flexspi_flash_addr, nxp_flexspi_flash_addr,
nxp_flexspi_flash_size, MT_MEMORY | MT_RW);
return ret;
}