boards: imx93_evk: document the configuration of board muxes
Document the added board level driver to control EXP_SEL muxes Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
This commit is contained in:
parent
10e4d091a2
commit
cb47ed206b
2 changed files with 33 additions and 8 deletions
|
@ -11,8 +11,7 @@
|
||||||
|
|
||||||
LOG_MODULE_REGISTER(board_control, CONFIG_BOARD_MIMX93_EVK_LOG_LEVEL);
|
LOG_MODULE_REGISTER(board_control, CONFIG_BOARD_MIMX93_EVK_LOG_LEVEL);
|
||||||
|
|
||||||
#if DT_HAS_COMPAT_STATUS_OKAY(imx93evk_exp_sel) && \
|
#if DT_HAS_COMPAT_STATUS_OKAY(imx93evk_exp_sel) && IS_ENABLED(CONFIG_BOARD_MIMX93_EVK_EXP_SEL_INIT)
|
||||||
IS_ENABLED(CONFIG_BOARD_MIMX93_EVK_EXP_SEL_INIT)
|
|
||||||
|
|
||||||
#define BOARD_EXP_SEL_NODE DT_COMPAT_GET_ANY_STATUS_OKAY(imx93evk_exp_sel)
|
#define BOARD_EXP_SEL_NODE DT_COMPAT_GET_ANY_STATUS_OKAY(imx93evk_exp_sel)
|
||||||
|
|
||||||
|
@ -22,8 +21,7 @@ LOG_MODULE_REGISTER(board_control, CONFIG_BOARD_MIMX93_EVK_LOG_LEVEL);
|
||||||
static int board_init_exp_sel(void)
|
static int board_init_exp_sel(void)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
const struct gpio_dt_spec mux =
|
const struct gpio_dt_spec mux = GPIO_DT_SPEC_GET(BOARD_EXP_SEL_NODE, mux_gpios);
|
||||||
GPIO_DT_SPEC_GET(BOARD_EXP_SEL_NODE, mux_gpios);
|
|
||||||
uint32_t pin_state = DT_ENUM_IDX(BOARD_EXP_SEL_NODE, mux);
|
uint32_t pin_state = DT_ENUM_IDX(BOARD_EXP_SEL_NODE, mux);
|
||||||
|
|
||||||
if (!gpio_is_ready_dt(&mux)) {
|
if (!gpio_is_ready_dt(&mux)) {
|
||||||
|
@ -43,10 +41,8 @@ static int board_init_exp_sel(void)
|
||||||
LOG_ERR("Write EXP_SEL Pin error %d", rc);
|
LOG_ERR("Write EXP_SEL Pin error %d", rc);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
LOG_INF("EXP_SEL mux %c with priority %d",
|
LOG_INF("EXP_SEL mux %c with priority %d", pin_state ? 'B' : 'A',
|
||||||
pin_state ? 'B' : 'A',
|
CONFIG_BOARD_MIMX93_EVK_EXP_SEL_INIT_PRIO);
|
||||||
CONFIG_BOARD_MIMX93_EVK_EXP_SEL_INIT_PRIO
|
|
||||||
);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,6 +85,35 @@ Serial Port
|
||||||
This board configuration uses a single serial communication channel with the
|
This board configuration uses a single serial communication channel with the
|
||||||
CPU's UART4.
|
CPU's UART4.
|
||||||
|
|
||||||
|
Board MUX Control
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
This board configuration uses a series of digital multiplexers to switch between
|
||||||
|
different board functions. The multiplexers are controlled by a GPIO signal called
|
||||||
|
``EXP_SEL`` from onboard GPIO expander ADP5585. It can be configured to select
|
||||||
|
function set "A" or "B" by dts configuration if board control module is enabled.
|
||||||
|
The following dts node is defined:
|
||||||
|
|
||||||
|
.. code-block:: dts
|
||||||
|
|
||||||
|
board_exp_sel: board-exp-sel {
|
||||||
|
compatible = "imx93evk-exp-sel";
|
||||||
|
mux-gpios = <&gpio_exp0 4 GPIO_ACTIVE_HIGH>;
|
||||||
|
mux = "A";
|
||||||
|
};
|
||||||
|
|
||||||
|
Following steps are required to configure the ``EXP_SEL`` signal:
|
||||||
|
|
||||||
|
1. Enable Kconfig option ``CONFIG_BOARD_MIMX93_EVK_EXP_SEL_INIT``.
|
||||||
|
2. Select ``mux="A";`` or ``mux="B";`` in ``&board_exp_sel`` devicetree node.
|
||||||
|
|
||||||
|
Kconfig option ``CONFIG_BOARD_MIMX93_EVK_EXP_SEL_INIT`` is enabled if a board
|
||||||
|
function that requires configuring the mux is enabled. The MUX option is
|
||||||
|
automatically selected if certain board function is enabled, and takes precedence
|
||||||
|
over dts config. For instance, if ``CONFIG_CAN`` is enabled, MUX A is selected
|
||||||
|
even if ``mux="B";`` is configured in dts, and an warning would be reported in
|
||||||
|
the log.
|
||||||
|
|
||||||
Programming and Debugging
|
Programming and Debugging
|
||||||
*************************
|
*************************
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue