driver: place iram functions by linker generator

This commit is contained in:
morris 2022-01-17 14:39:50 +08:00
parent e51474ef70
commit 608a1dc237
3 changed files with 16 additions and 22 deletions

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -34,12 +34,6 @@ static const char *TAG = "gdma";
#define GDMA_MEM_ALLOC_CAPS MALLOC_CAP_DEFAULT
#endif // CONFIG_GDMA_ISR_IRAM_SAFE
#if CONFIG_GDMA_CTRL_FUNC_IN_IRAM
#define GDMA_CTRL_FUNC_ATTR IRAM_ATTR
#else
#define GDMA_CTRL_FUNC_ATTR
#endif // CONFIG_GDMA_CTRL_FUNC_IN_IRAM
#define GDMA_INVALID_PERIPH_TRIG (0x3F)
#define SEARCH_REQUEST_RX_CHANNEL (1 << 0)
#define SEARCH_REQUEST_TX_CHANNEL (1 << 1)
@ -452,7 +446,7 @@ err:
return ret;
}
GDMA_CTRL_FUNC_ATTR esp_err_t gdma_start(gdma_channel_handle_t dma_chan, intptr_t desc_base_addr)
esp_err_t gdma_start(gdma_channel_handle_t dma_chan, intptr_t desc_base_addr)
{
esp_err_t ret = ESP_OK;
gdma_pair_t *pair = NULL;
@ -473,7 +467,7 @@ err:
return ret;
}
GDMA_CTRL_FUNC_ATTR esp_err_t gdma_stop(gdma_channel_handle_t dma_chan)
esp_err_t gdma_stop(gdma_channel_handle_t dma_chan)
{
esp_err_t ret = ESP_OK;
gdma_pair_t *pair = NULL;
@ -492,7 +486,7 @@ err:
return ret;
}
GDMA_CTRL_FUNC_ATTR esp_err_t gdma_append(gdma_channel_handle_t dma_chan)
esp_err_t gdma_append(gdma_channel_handle_t dma_chan)
{
esp_err_t ret = ESP_OK;
gdma_pair_t *pair = NULL;
@ -511,7 +505,7 @@ err:
return ret;
}
GDMA_CTRL_FUNC_ATTR esp_err_t gdma_reset(gdma_channel_handle_t dma_chan)
esp_err_t gdma_reset(gdma_channel_handle_t dma_chan)
{
esp_err_t ret = ESP_OK;
gdma_pair_t *pair = NULL;

View File

@ -35,12 +35,6 @@
#define GPTIMER_MEM_ALLOC_CAPS MALLOC_CAP_DEFAULT
#endif //CONFIG_GPTIMER_ISR_IRAM_SAFE
#if CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM
#define GPTIMER_CTRL_FUNC_ATTR IRAM_ATTR
#else
#define GPTIMER_CTRL_FUNC_ATTR
#endif // CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM
#define GPTIMER_PM_LOCK_NAME_LEN_MAX 16
static const char *TAG = "gptimer";
@ -213,7 +207,6 @@ esp_err_t gptimer_del_timer(gptimer_handle_t timer)
return ESP_OK;
}
GPTIMER_CTRL_FUNC_ATTR
esp_err_t gptimer_set_raw_count(gptimer_handle_t timer, unsigned long long value)
{
ESP_RETURN_ON_FALSE(timer, ESP_ERR_INVALID_ARG, TAG, "invalid argument");
@ -224,7 +217,6 @@ esp_err_t gptimer_set_raw_count(gptimer_handle_t timer, unsigned long long value
return ESP_OK;
}
GPTIMER_CTRL_FUNC_ATTR
esp_err_t gptimer_get_raw_count(gptimer_handle_t timer, unsigned long long *value)
{
ESP_RETURN_ON_FALSE(timer && value, ESP_ERR_INVALID_ARG, TAG, "invalid argument");
@ -265,7 +257,6 @@ esp_err_t gptimer_register_event_callbacks(gptimer_handle_t timer, const gptimer
return ESP_OK;
}
GPTIMER_CTRL_FUNC_ATTR
esp_err_t gptimer_set_alarm_action(gptimer_handle_t timer, const gptimer_alarm_config_t *config)
{
ESP_RETURN_ON_FALSE(timer, ESP_ERR_INVALID_ARG, TAG, "invalid argument");
@ -295,7 +286,6 @@ esp_err_t gptimer_set_alarm_action(gptimer_handle_t timer, const gptimer_alarm_c
return ESP_OK;
}
GPTIMER_CTRL_FUNC_ATTR
esp_err_t gptimer_start(gptimer_handle_t timer)
{
ESP_RETURN_ON_FALSE(timer, ESP_ERR_INVALID_ARG, TAG, "invalid argument");
@ -318,7 +308,6 @@ esp_err_t gptimer_start(gptimer_handle_t timer)
return ESP_OK;
}
GPTIMER_CTRL_FUNC_ATTR
esp_err_t gptimer_stop(gptimer_handle_t timer)
{
ESP_RETURN_ON_FALSE(timer, ESP_ERR_INVALID_ARG, TAG, "invalid argument");

View File

@ -7,3 +7,14 @@ entries:
# placed in flash.
if TWAI_ISR_IN_IRAM = y && (TWAI_ERRATA_FIX_RX_FRAME_INVALID = y || TWAI_ERRATA_FIX_RX_FIFO_CORRUPT = y):
periph_ctrl: periph_module_reset (noflash)
if GPTIMER_CTRL_FUNC_IN_IRAM = y:
gptimer: gptimer_set_raw_count (noflash)
gptimer: gptimer_get_raw_count (noflash)
gptimer: gptimer_set_alarm_action (noflash)
gptimer: gptimer_start (noflash)
gptimer: gptimer_stop (noflash)
if GDMA_CTRL_FUNC_IN_IRAM = y:
gdma: gdma_start (noflash)
gdma: gdma_stop (noflash)
gdma: gdma_append (noflash)
gdma: gdma_reset (noflash)