From 112f65776588ef0cc3307f8bef208a480037d7d0 Mon Sep 17 00:00:00 2001 From: "Kwabena W. Agyeman" Date: Thu, 23 Jan 2025 23:17:00 -0800 Subject: [PATCH] stm32/eth: Make ETH DMA buffer attributes configurable. Signed-off-by: Kwabena W. Agyeman --- ports/stm32/eth.c | 2 +- ports/stm32/mpconfigboard_common.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ports/stm32/eth.c b/ports/stm32/eth.c index fd46bde23cb3f..9f655306816d9 100644 --- a/ports/stm32/eth.c +++ b/ports/stm32/eth.c @@ -121,7 +121,7 @@ typedef struct _eth_t { int16_t (*phy_get_link_status)(uint32_t phy_addr); } eth_t; -static eth_dma_t eth_dma __attribute__((aligned(16384))); +static eth_dma_t eth_dma MICROPY_HW_ETH_DMA_ATTRIBUTE; eth_t eth_instance; diff --git a/ports/stm32/mpconfigboard_common.h b/ports/stm32/mpconfigboard_common.h index e1c9c159ecf6f..4ce0a75b87e2b 100644 --- a/ports/stm32/mpconfigboard_common.h +++ b/ports/stm32/mpconfigboard_common.h @@ -669,3 +669,7 @@ #endif #define MICROPY_HW_USES_BOOTLOADER (MICROPY_HW_VTOR != 0x08000000) + +#ifndef MICROPY_HW_ETH_DMA_ATTRIBUTE +#define MICROPY_HW_ETH_DMA_ATTRIBUTE __attribute__((aligned(16384))); +#endif