diff options
Diffstat (limited to 'zephyr/shim/chip/npcx')
-rw-r--r-- | zephyr/shim/chip/npcx/Kconfig.npcx | 2 | ||||
-rw-r--r-- | zephyr/shim/chip/npcx/system.c | 28 |
2 files changed, 15 insertions, 15 deletions
diff --git a/zephyr/shim/chip/npcx/Kconfig.npcx b/zephyr/shim/chip/npcx/Kconfig.npcx index 1107a846a8..b044912ae1 100644 --- a/zephyr/shim/chip/npcx/Kconfig.npcx +++ b/zephyr/shim/chip/npcx/Kconfig.npcx @@ -12,7 +12,7 @@ config CROS_SYSTEM_NPCX_PRE_INIT_PRIORITY help This sets the priority of the NPCX chip system initialization. The chip system initialization verifies the integrity of the BBRAM and - must be a lower priority than CONFIG_CROS_BBRAM_NPCX_INIT_PRIORITY and + must be a lower priority than CONFIG_BBRAM_INIT_PRIORITY and must be a higher priority than PLATFORM_EC_SYSTEM_PRE_INIT. endif # PLATFORM_EC diff --git a/zephyr/shim/chip/npcx/system.c b/zephyr/shim/chip/npcx/system.c index 0a1f50844e..3700026104 100644 --- a/zephyr/shim/chip/npcx/system.c +++ b/zephyr/shim/chip/npcx/system.c @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -#include <drivers/cros_bbram.h> +#include <drivers/bbram.h> #include <logging/log.h> #include "system.h" @@ -11,9 +11,10 @@ LOG_MODULE_REGISTER(shim_npcx_system, LOG_LEVEL_ERR); -void chip_bbram_status_check(void) +static void chip_bbram_status_check(void) { const struct device *bbram_dev; + int res; bbram_dev = DEVICE_DT_GET(DT_NODELABEL(bbram)); if (!device_is_ready(bbram_dev)) { @@ -21,18 +22,18 @@ void chip_bbram_status_check(void) return; } - if (cros_bbram_get_ibbr(bbram_dev)) { + res = bbram_check_invalid(bbram_dev); + if (res != 0 && res != -ENOTSUP) LOG_ERR("VBAT power drop!"); - cros_bbram_reset_ibbr(bbram_dev); - } - if (cros_bbram_get_vsby(bbram_dev)) { + + res = bbram_check_standby_power(bbram_dev); + if (res != 0 && res != -ENOTSUP) LOG_ERR("VSBY power drop!"); - cros_bbram_reset_vsby(bbram_dev); - } - if (cros_bbram_get_vcc1(bbram_dev)) { + + res = bbram_check_power(bbram_dev); + if (res != 0 && res != -ENOTSUP) LOG_ERR("VCC1 power drop!"); - cros_bbram_reset_vcc1(bbram_dev); - } + } /* @@ -89,10 +90,9 @@ static int chip_system_init(const struct device *unused) /* * The priority should be lower than CROS_BBRAM_NPCX_INIT_PRIORITY. */ -#if (CONFIG_CROS_SYSTEM_NPCX_PRE_INIT_PRIORITY <= \ - CONFIG_CROS_BBRAM_NPCX_INIT_PRIORITY) +#if (CONFIG_CROS_SYSTEM_NPCX_PRE_INIT_PRIORITY <= CONFIG_BBRAM_INIT_PRIORITY) #error CONFIG_CROS_SYSTEM_NPCX_PRE_INIT_PRIORITY must greater than \ - CONFIG_CROS_BBRAM_NPCX_INIT_PRIORITY + CONFIG_BBRAM_INIT_PRIORITY #endif SYS_INIT(chip_system_init, PRE_KERNEL_1, CONFIG_CROS_SYSTEM_NPCX_PRE_INIT_PRIORITY); |