Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[imx9 boot reason 4/4] Use PMIC registers to store bootmode information #886

Merged
merged 3 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion boards/ssrc/common
20 changes: 20 additions & 0 deletions platforms/nuttx/src/px4/nxp/imx9/board_reset/board_reset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,38 @@
#include <errno.h>
#include <nuttx/board.h>
#include <debug.h>
#include "imx9_pmic.h"

extern "C" void __start(void);

static void board_reset_enter_bootloader()
{
/* WDOG_B pin is unused in current HW design.
* Related configuration bits (WDOG_B_CFG) from PMIC RESET_CTRL
* register are borrowed for stay in bootloader reason delivery.
*
* stay in bootloader: WDOG_B_CFG 11b
*/

imx9_pmic_set_reset_ctrl(IMX9_PMIC_RESET_CTRL_DEFAULT |
IMX9_PMIC_RESET_CTRL_WDOG_COLD_RESET_MASK);

/* Reset the whole SoC */

up_systemreset();
}

static void board_reset_enter_bootloader_and_continue_boot()
{
/* WDOG_B pin is unused in current HW design.
* Related configuration bits (WDOG_B_CFG) from PMIC RESET_CTRL
* register are borrowed for stay in bootloader reason delivery.
*
* With PMIC register power on value system will boot normally.
*/

imx9_pmic_set_reset_ctrl(IMX9_PMIC_RESET_CTRL_DEFAULT);

/* Reset the whole SoC */

up_systemreset();
Expand Down