1 /*
2  * Copyright 2020 NXP
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <zephyr/device.h>
8 #include <sys/types.h>
9 #include <fsl_flexspi.h>
10 
11 enum memc_flexspi_clock_t {
12 	/* Flexspi clock 332M, DDR mode, internal clock 166M. */
13 	MEMC_FLEXSPI_CLOCK_166M,
14 	/* Flexspi clock 83M, DDR mode, internal clock 42M. */
15 	MEMC_FLEXSPI_CLOCK_42M,
16 };
17 
18 void memc_flexspi_wait_bus_idle(const struct device *dev);
19 
20 bool memc_flexspi_is_running_xip(const struct device *dev);
21 
22 int memc_flexspi_update_lut(const struct device *dev, uint32_t index,
23 		const uint32_t *cmd, uint32_t count);
24 
25 int memc_flexspi_update_clock(const struct device *dev,
26 		flexspi_device_config_t *device_config,
27 		flexspi_port_t port, enum memc_flexspi_clock_t clock);
28 
29 int memc_flexspi_set_device_config(const struct device *dev,
30 		const flexspi_device_config_t *device_config,
31 		flexspi_port_t port);
32 
33 int memc_flexspi_reset(const struct device *dev);
34 
35 int memc_flexspi_transfer(const struct device *dev,
36 		flexspi_transfer_t *transfer);
37 
38 void *memc_flexspi_get_ahb_address(const struct device *dev,
39 		flexspi_port_t port, off_t offset);
40