Skip to content

Commit

Permalink
boards: imx93_evk: document the configuration of board muxes
Browse files Browse the repository at this point in the history
Document the added board level driver to control EXP_SEL muxes

(cherry picked from commit cb47ed2)

Original-Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
GitOrigin-RevId: cb47ed2
Cr-Build-Id: 8739453998936228337
Cr-Build-Url: https://cr-buildbucket.appspot.com/build/8739453998936228337
Copybot-Job-Name: zephyr-main-copybot-downstream
Change-Id: I4cdd128bee5464b44b1f23e010069f26f83572cd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5793303
Reviewed-by: Dawid Niedźwiecki <dawidn@google.com>
Tested-by: Dawid Niedźwiecki <dawidn@google.com>
Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
Commit-Queue: Dawid Niedźwiecki <dawidn@google.com>
  • Loading branch information
CkovMk authored and Chromeos LUCI committed Aug 16, 2024
1 parent dc06129 commit e511a87
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 8 deletions.
12 changes: 4 additions & 8 deletions boards/nxp/imx93_evk/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@

LOG_MODULE_REGISTER(board_control, CONFIG_BOARD_MIMX93_EVK_LOG_LEVEL);

#if DT_HAS_COMPAT_STATUS_OKAY(imx93evk_exp_sel) && \
IS_ENABLED(CONFIG_BOARD_MIMX93_EVK_EXP_SEL_INIT)
#if DT_HAS_COMPAT_STATUS_OKAY(imx93evk_exp_sel) && IS_ENABLED(CONFIG_BOARD_MIMX93_EVK_EXP_SEL_INIT)

#define BOARD_EXP_SEL_NODE DT_COMPAT_GET_ANY_STATUS_OKAY(imx93evk_exp_sel)

Expand All @@ -22,8 +21,7 @@ LOG_MODULE_REGISTER(board_control, CONFIG_BOARD_MIMX93_EVK_LOG_LEVEL);
static int board_init_exp_sel(void)
{
int rc = 0;
const struct gpio_dt_spec mux =
GPIO_DT_SPEC_GET(BOARD_EXP_SEL_NODE, mux_gpios);
const struct gpio_dt_spec mux = GPIO_DT_SPEC_GET(BOARD_EXP_SEL_NODE, mux_gpios);
uint32_t pin_state = DT_ENUM_IDX(BOARD_EXP_SEL_NODE, mux);

if (!gpio_is_ready_dt(&mux)) {
Expand All @@ -43,10 +41,8 @@ static int board_init_exp_sel(void)
LOG_ERR("Write EXP_SEL Pin error %d", rc);
return rc;
}
LOG_INF("EXP_SEL mux %c with priority %d",
pin_state ? 'B' : 'A',
CONFIG_BOARD_MIMX93_EVK_EXP_SEL_INIT_PRIO
);
LOG_INF("EXP_SEL mux %c with priority %d", pin_state ? 'B' : 'A',
CONFIG_BOARD_MIMX93_EVK_EXP_SEL_INIT_PRIO);

return 0;
}
Expand Down
29 changes: 29 additions & 0 deletions boards/nxp/imx93_evk/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,35 @@ Serial Port
This board configuration uses a single serial communication channel with the
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
*************************

Expand Down

0 comments on commit e511a87

Please sign in to comment.