1 /*
2  * Copyright 2020 NXP
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #include <assert.h>
9 
10 #include <fspi_api.h>
11 #include <lib/mmio.h>
12 #include <lib/xlat_tables/xlat_tables_v2.h>
13 
flexspi_nor_io_setup(uintptr_t nxp_flexspi_flash_addr,size_t nxp_flexspi_flash_size,uint32_t fspi_base_reg_addr)14 int flexspi_nor_io_setup(uintptr_t nxp_flexspi_flash_addr,
15 			 size_t nxp_flexspi_flash_size, uint32_t fspi_base_reg_addr)
16 {
17 	int ret = 0;
18 
19 	ret = fspi_init(fspi_base_reg_addr, nxp_flexspi_flash_addr);
20 	/* Adding NOR Memory Map in XLAT Table */
21 	mmap_add_region(nxp_flexspi_flash_addr, nxp_flexspi_flash_addr,
22 			nxp_flexspi_flash_size, MT_MEMORY | MT_RW);
23 
24 	return ret;
25 }
26