1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/pkg/esp32_sdk/patches/0010-spi_flash-disable-functions-not-required-or-not-supp.patch
Gunar Schorcht ca34e970f1 pkg/esp32_sdk: additional patches required for ESP32-S3
The patches include the following changes:
- define ARRAY_SIZE in `component/spi_flash/spi_flash_timing_tuning.c` only if it is not yet defined by RIOT macros
- add alternative implementations for`spi_flash_disable_interrupts_caches_and_other_cpu` and `spi_flash_enable_interrupts_caches_and_other_cpu` if compiled for RIOT
- fix the undefined reference to `rtc_gpio_force_hold_en_all` in `components/driver/gpio.c`
- rename the bootloader patch to fix the serial number
2022-08-08 08:18:08 +02:00

52 lines
1.9 KiB
Diff

From 5285a8f5898074d38d71054010cf912c2d7ffb2d Mon Sep 17 00:00:00 2001
From: Gunar Schorcht <gunar@schorcht.net>
Date: Sun, 30 Jan 2022 09:50:50 +0100
Subject: [PATCH 10/12] spi_flash: disable functions not required or not
supported
- Various cache utility functions are neither required nor can they be supported by the means of RIOT. For example, it is not possible to change the priority of a thread. They have to be therefore disabled in RIOT.
- Add alternative implementations for `spi_flash_disable_interrupts_caches_and_other_cpu` and `spi_flash_enable_interrupts_caches_and_other_cpu` if compiled for RIOT
---
components/spi_flash/cache_utils.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/components/spi_flash/cache_utils.c b/components/spi_flash/cache_utils.c
index 7715900055..d7d750abdd 100644
--- a/components/spi_flash/cache_utils.c
+++ b/components/spi_flash/cache_utils.c
@@ -67,6 +67,8 @@ static void IRAM_ATTR spi_flash_restore_cache(uint32_t cpuid, uint32_t saved_sta
static uint32_t s_flash_op_cache_state[2];
+#ifndef RIOT_VERSION
+
#ifndef CONFIG_FREERTOS_UNICORE
static SemaphoreHandle_t s_flash_op_mutex;
static volatile bool s_flash_op_can_start = false;
@@ -293,6 +295,22 @@ void IRAM_ATTR spi_flash_enable_interrupts_caches_no_os(void)
#endif // CONFIG_FREERTOS_UNICORE
+#else /* RIOT_VERSION */
+
+void IRAM_ATTR spi_flash_disable_interrupts_caches_and_other_cpu(void)
+{
+ irq_disable();
+ spi_flash_disable_cache(0, &s_flash_op_cache_state[0]);
+}
+
+void IRAM_ATTR spi_flash_enable_interrupts_caches_and_other_cpu(void)
+{
+ spi_flash_restore_cache(0, s_flash_op_cache_state[0]);
+ irq_enable();
+}
+
+#endif /* RIOT_VERSION */
+
/**
* The following two functions are replacements for Cache_Read_Disable and Cache_Read_Enable
* function in ROM. They are used to work around a bug where Cache_Read_Disable requires a call to
--
2.17.1