1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 06:32:45 +01:00
RIOT/pkg/esp32_sdk/patches/0010-spi_flash-disable-functions-not-required-or-not-supp.patch

48 lines
1.8 KiB
Diff
Raw Normal View History

2022-02-01 20:58:14 +01:00
From 85fc96683ff351d5780388bfd870f023c9d2e486 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.
---
components/spi_flash/cache_utils.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/components/spi_flash/cache_utils.c b/components/spi_flash/cache_utils.c
index 7715900055..79b6f0a685 100644
--- a/components/spi_flash/cache_utils.c
+++ b/components/spi_flash/cache_utils.c
@@ -62,6 +62,7 @@ static __attribute__((unused)) const char *TAG = "cache";
#define DPORT_CACHE_GET_VAL(cpuid) (cpuid == 0) ? DPORT_CACHE_VAL(PRO) : DPORT_CACHE_VAL(APP)
#define DPORT_CACHE_GET_MASK(cpuid) (cpuid == 0) ? DPORT_CACHE_MASK(PRO) : DPORT_CACHE_MASK(APP)
+#ifndef RIOT_VERSION
static void IRAM_ATTR spi_flash_disable_cache(uint32_t cpuid, uint32_t *saved_state);
static void IRAM_ATTR spi_flash_restore_cache(uint32_t cpuid, uint32_t saved_state);
@@ -357,6 +358,7 @@ static void IRAM_ATTR spi_flash_restore_cache(uint32_t cpuid, uint32_t saved_sta
Cache_Resume_ICache(saved_state >> 16);
#endif
}
+#endif /* RIOT_VERSION */
IRAM_ATTR bool spi_flash_cache_enabled(void)
{
@@ -373,6 +375,7 @@ IRAM_ATTR bool spi_flash_cache_enabled(void)
return result;
}
+#ifndef RIOT_VERSION
#if CONFIG_IDF_TARGET_ESP32S2
IRAM_ATTR void esp_config_instruction_cache_mode(void)
{
@@ -939,3 +942,4 @@ void IRAM_ATTR spi_flash_enable_cache(uint32_t cpuid)
spi_flash_restore_cache(0, 0); // TODO cache_value should be non-zero
#endif
}
+#endif /* RIOT_VERSION */
--
2.17.1