When CONFIG_ESP_BRINGUP_BYPASS_RANDOM_SETTING is enabled (which defaults to
y for chips without SOC_RNG_SUPPORTED like ESP32-S31), esp_random() would get
stuck reading WDEV_RND_REG in an infinite loop. This caused boot failures,
especially when stack checking was enabled as it calls esp_random().
Previously the RTC timer entropy was being mixed with the RNG timer
in a wrong way. Which led to the overwriting of the LSB with rtc
timer value.
This change fixes that behaviour
* The RNG reading frequency of 200 KHz has been too high for
C6 and H2 since on these chips the RNG output is combined
with the RTC slow clock which is only 150KHz. Reduced the max
reading frequency via esp_random() from 200KHz to 62.5KHz,
which show best results in tests.
Also updated the bootloader_fill_random() max frequency to the
same value to be in line, even though it was just 83KHz.
This commit marks all functions in interrupt_controller_hal.h, cpu_ll.h and cpu_hal.h as deprecated.
Users should use functions from esp_cpu.h instead.