mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-09-13 14:51:56 +00:00
The ARM Cortex-M1/M3 DesignStart FPGA reference designs support booting from an off-board, memory-mapped QSPI NOR flash device. The V2C DAPlink shield from ARM Ltd. provides support for this feature. If the board/shield is not configured for booting from the QSPI NOR device, that same device is available as a regular QSPI NOR flash device. The presense of a shield configured for QSPI NOR flash boot is indicated through an IRQ line used as a level-detect, non-interrupt signal. Introduce a board specific devicetree binding for the DAPLink QSPI MUX and provide a board specific API accessing it. Automatically set the QSPI MUX to to provide regular QSPI NOR flash access if the board/shield is not configured for memory-mapped QSPI NOR flash boot. Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
41 lines
1.0 KiB
C
41 lines
1.0 KiB
C
/*
|
|
* Copyright (c) 2020 Henrik Brix Andersen <henrik@brixandersen.dk>
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#ifndef __INC_BOARD_H
|
|
#define __INC_BOARD_H
|
|
|
|
enum board_daplink_qspi_mux_mode {
|
|
/* eXecute-In-Place mode */
|
|
BOARD_DAPLINK_QSPI_MUX_MODE_XIP,
|
|
/* Normal mode */
|
|
BOARD_DAPLINK_QSPI_MUX_MODE_NORMAL,
|
|
};
|
|
|
|
/**
|
|
* @brief Select the mode of the DAPlink QSPI multiplexer.
|
|
*
|
|
* Note: The multiplexer mode must not be changed while executing code from the
|
|
* off-board QSPI flash in XIP mode.
|
|
*
|
|
* @param mode The multiplexer mode to be selected.
|
|
*
|
|
* @retval 0 If successful, negative errno otherwise.
|
|
*/
|
|
int board_daplink_qspi_mux_select(enum board_daplink_qspi_mux_mode mode);
|
|
|
|
/**
|
|
* @brief Determine if the DAPlink shield is fitted.
|
|
*
|
|
* Determine if the DAPlink shield is fitted based on the state of the
|
|
* DAPLINK_fitted_n signal.
|
|
*
|
|
* @retval true If the DAPlink shield is fitted.
|
|
* @retval false If the DAPlink shield is not fitted.
|
|
*/
|
|
bool board_daplink_is_fitted(void);
|
|
|
|
#endif /* __INC_BOARD_H */
|