From 81602e16a20e50bdf23c9d7ffa0fd979ab78a97c Mon Sep 17 00:00:00 2001 From: likun17 Date: Wed, 18 Mar 2026 19:38:46 +0800 Subject: [PATCH] boards/risc-v/esp32p4: restore chip revision check with macro guard The chip revision check was disabled with #if 0 for v1.0 bringup. Restore the original #ifndef ESP32P4_IGNORE_CHIP_REVISION_CHECK guard so boards can selectively bypass the PANIC by defining this macro, while keeping the warning message in the #else branch. Signed-off-by: likun17 --- arch/risc-v/src/esp32p4/esp_chip_rev.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/risc-v/src/esp32p4/esp_chip_rev.c b/arch/risc-v/src/esp32p4/esp_chip_rev.c index 2f57b40449b..2f28ea20fc7 100644 --- a/arch/risc-v/src/esp32p4/esp_chip_rev.c +++ b/arch/risc-v/src/esp32p4/esp_chip_rev.c @@ -24,6 +24,8 @@ * Included Files ****************************************************************************/ +#include + #include "hal/efuse_hal.h" /**************************************************************************** @@ -65,21 +67,22 @@ void esp_chip_revision_check(void) if (chip_rev < ESP32P4_MIN_FULLY_SUPPORTED_VERSION) { -#ifndef ESP32P4_IGNORE_CHIP_REVISION_CHECK +#if !defined(CONFIG_ESP32P4_SELECTS_REV_LESS_V3) ets_printf("ERROR: NuttX supports ESP32-P4 chip revision > v%d.%01d" " (chip revision is v%" PRIu32 ".%" PRIu32 ")\n", ESP32P4_MIN_FULLY_SUPPORTED_VERSION / 100, ESP32P4_MIN_FULLY_SUPPORTED_VERSION % 100, chip_rev / 100, chip_rev % 100); PANIC(); -#endif +#else ets_printf("WARNING: NuttX supports ESP32-P4 chip revision > v%d.%01d" " (chip revision is v%" PRIu32 ".%" PRIu32 ").\n" "Ignoring this error and continuing because " - "`ESP32P4_IGNORE_CHIP_REVISION_CHECK` is set...\n" + "`CONFIG_ESP32P4_SELECTS_REV_LESS_V3` is set...\n" "THIS MAY NOT WORK! DON'T USE THIS CHIP IN PRODUCTION!\n", ESP32P4_MIN_FULLY_SUPPORTED_VERSION / 100, ESP32P4_MIN_FULLY_SUPPORTED_VERSION % 100, chip_rev / 100, chip_rev % 100); +#endif } }