Skip to content

Commit 81602e1

Browse files
Otpvondoiatssimbit18
authored andcommitted
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 <likun17@xiaomi.com>
1 parent 6123cc3 commit 81602e1

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

arch/risc-v/src/esp32p4/esp_chip_rev.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
* Included Files
2525
****************************************************************************/
2626

27+
#include <nuttx/config.h>
28+
2729
#include "hal/efuse_hal.h"
2830

2931
/****************************************************************************
@@ -65,21 +67,22 @@ void esp_chip_revision_check(void)
6567

6668
if (chip_rev < ESP32P4_MIN_FULLY_SUPPORTED_VERSION)
6769
{
68-
#ifndef ESP32P4_IGNORE_CHIP_REVISION_CHECK
70+
#if !defined(CONFIG_ESP32P4_SELECTS_REV_LESS_V3)
6971
ets_printf("ERROR: NuttX supports ESP32-P4 chip revision > v%d.%01d"
7072
" (chip revision is v%" PRIu32 ".%" PRIu32 ")\n",
7173
ESP32P4_MIN_FULLY_SUPPORTED_VERSION / 100,
7274
ESP32P4_MIN_FULLY_SUPPORTED_VERSION % 100,
7375
chip_rev / 100, chip_rev % 100);
7476
PANIC();
75-
#endif
77+
#else
7678
ets_printf("WARNING: NuttX supports ESP32-P4 chip revision > v%d.%01d"
7779
" (chip revision is v%" PRIu32 ".%" PRIu32 ").\n"
7880
"Ignoring this error and continuing because "
79-
"`ESP32P4_IGNORE_CHIP_REVISION_CHECK` is set...\n"
81+
"`CONFIG_ESP32P4_SELECTS_REV_LESS_V3` is set...\n"
8082
"THIS MAY NOT WORK! DON'T USE THIS CHIP IN PRODUCTION!\n",
8183
ESP32P4_MIN_FULLY_SUPPORTED_VERSION / 100,
8284
ESP32P4_MIN_FULLY_SUPPORTED_VERSION % 100,
8385
chip_rev / 100, chip_rev % 100);
86+
#endif
8487
}
8588
}

0 commit comments

Comments
 (0)