mirror of
https://github.com/espressif/esp-idf.git
synced 2025-11-26 20:53:11 +00:00
feat(mbedtls/esp_crypto_shared_gdma): support AXI-DMA in the crypto shared gdma layer
- In case of AXI-DMA, the DMA descriptors need to be 8 bytes aligned lldesc_t do not satify this condition thus we need to replace it with dma_descriptor_t (align(4) and align(8)) in esp_crypto_shared_gdma. - Added new shared gdma start API that supports the dma_descriptor_t DMA descriptor. - Added some generic dma descriptor macros and helper functions - replace lldesc_t with dma_descriptor_t
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "soc/lldesc.h"
|
||||
#include "esp_crypto_dma.h"
|
||||
#include "esp_private/gdma.h"
|
||||
#include "esp_err.h"
|
||||
#include "soc/lldesc.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -16,17 +17,31 @@ extern "C" {
|
||||
|
||||
/**
|
||||
* @brief Start a GDMA transfer on the shared crypto DMA channel
|
||||
* Only supports AHB-DMA.
|
||||
*
|
||||
* @note Will allocate a GDMA channel for AES & SHA if no such channel is already allocated
|
||||
*
|
||||
* @param input Input linked list descriptor
|
||||
* @param output Output linked list descriptor
|
||||
* @param input Input linked list descriptor (lldesc_t *)
|
||||
* @param output Output linked list descriptor (lldesc_t *)
|
||||
* @param peripheral Crypto peripheral to connect the DMA to, either GDMA_TRIG_PERIPH_AES or
|
||||
* GDMA_TRIG_PERIPH_SHA
|
||||
* @return esp_err_t ESP_FAIL if no GDMA channel available
|
||||
*/
|
||||
esp_err_t esp_crypto_shared_gdma_start(const lldesc_t *input, const lldesc_t *output, gdma_trigger_peripheral_t peripheral);
|
||||
|
||||
/**
|
||||
* @brief Start a GDMA transfer on the shared crypto DMA channel
|
||||
* Supports AXI-DMA and AHB-DMA.
|
||||
*
|
||||
* @note Will allocate a GDMA channel for AES & SHA if no such channel is already allocated
|
||||
*
|
||||
* @param input Input linked list descriptor (crypto_dma_desc_t *)
|
||||
* @param output Output linked list descriptor (crypto_dma_desc_t *)
|
||||
* @param peripheral Crypto peripheral to connect the DMA to, either GDMA_TRIG_PERIPH_AES or
|
||||
* GDMA_TRIG_PERIPH_SHA
|
||||
* @return esp_err_t ESP_FAIL if no GDMA channel available
|
||||
*/
|
||||
esp_err_t esp_crypto_shared_gdma_start_axi_ahb(const crypto_dma_desc_t *input, const crypto_dma_desc_t *output, gdma_trigger_peripheral_t peripheral);
|
||||
|
||||
/**
|
||||
* @brief Frees any shared crypto DMA channel, if esp_crypto_shared_gdma_start is called after
|
||||
|
||||
Reference in New Issue
Block a user