diff options
author | Wealian Liao <whliao@nuvoton.corp-partner.google.com> | 2021-02-26 10:16:11 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-24 17:27:46 +0000 |
commit | 893a8b354f45750e50a419670307fcc2e59ba4cb (patch) | |
tree | 224363e0c91e48b4cfb689a84f40e9afcdeef7c7 /docs | |
parent | 09d0027924a74efaa8d1b55805af11377962d180 (diff) | |
download | chrome-ec-893a8b354f45750e50a419670307fcc2e59ba4cb.tar.gz |
zephyr: npcx: add reset cause check
The reset cause will influence the initialization flow. We define some
of initial flow of the reset cause for the following development.
This CL include the following:
1. Add check_reset_cause() which sets the system reset flag.
2. Add chip_bbram_status_check() to clear the error status & show the
error message.
3. Add CONFIG_BOARD_RESET_AFTER_POWER_ON feature.
4. Define the initialize flow for reset cause.
BRANCH=none
BUG=b:178101173
TEST=check the following reset cause by 'sysinfo'
1. power-up
2. reset-pin reset
3. soft by 'reboot' console command
4. watchdog by 'waitms 2000'
Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com>
Change-Id: I515868d8cda4544fdbe782210b0108b4dda0d8cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2731180
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/zephyr_init.md | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/docs/zephyr_init.md b/docs/zephyr_init.md new file mode 100644 index 0000000000..8822736efb --- /dev/null +++ b/docs/zephyr_init.md @@ -0,0 +1,53 @@ +# Zephyr OS-based EC Initialization Order + +Zephyr provides Z_INIT_ENTRY_DEFINE() & the extend macro to install the initial +function. The initialize flow for different levels would be like the following +(not very detailed): +* architecture-specific initialization +* `PRE_KERNEL_1` level +* `PRE_KERNEL_2` level +* `POST_KERNEL` level +* `APPLICATION` level +* main() + +The kernel and driver initial functions separate into specific initialize +levels. It couldn't put all initial functions in main() for the Zephyr OS-based +EC. It is also hard to maintain those initial priority which separates into +different files. + +This file defines some Zephyr OS-based EC initial priorities which have critical +sequence requirement for initializing: + +## PRE_KERNEL_1 +* Priority (0-9) - Reserved for system testability: + + The highest priority could be used in zephyr. Don't use it when system + development. Buffer it for the following system development & testing. + +* Priority (10-19) - Chip level system pre-initialization: + + These priorities in this range are used for critical chip initialization, + including determining the reset cause and initializing the battery-backed + RAM driver. Most chip drivers should only be initialized after + `PLATFORM_EC_SYSTEM_PRE_INIT`. + +* Priority (20) - PLATFORM_EC_SYSTEM_PRE_INIT: + + At this initialization priority, the CROS system checks the reset cause and + initializing the system reset flags. Any chip level drivers related to + determining the reset type must be at a higher priority. + +* TODO + +## PRE_KERNEL_2 +* TODO + +## POST_KERNEL +* TODO + +## APPLICATION +* TODO + +## main() +* TODO +* Start the tasks. |