|
| 1 | +From 717b63ce10981d1c3684e465f625e10b0b9efe96 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Martino Facchin < [email protected]> |
| 3 | +Date: Tue, 2 Jul 2024 16:30:07 +0200 |
| 4 | +Subject: [PATCH] emac_stm32: properly invalidate DCache before disabling it |
| 5 | + |
| 6 | +--- |
| 7 | + .../TARGET_STM/TARGET_STM32H7/TARGET_OPTA/stm32h7_eth_init.c | 3 +++ |
| 8 | + .../TARGET_STM32H7/TARGET_PORTENTA_H7/stm32h7_eth_init.c | 1 + |
| 9 | + 2 files changed, 4 insertions(+) |
| 10 | + |
| 11 | +diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_OPTA/stm32h7_eth_init.c b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_OPTA/stm32h7_eth_init.c |
| 12 | +index 0572fae7a2..8b9cc8bcd0 100644 |
| 13 | +--- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_OPTA/stm32h7_eth_init.c |
| 14 | ++++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_OPTA/stm32h7_eth_init.c |
| 15 | +@@ -66,7 +66,10 @@ void HAL_ETH_MspInit(ETH_HandleTypeDef *heth) |
| 16 | + |
| 17 | + #if !(defined(DUAL_CORE) && defined(CORE_CM4)) |
| 18 | + /* Disable DCache for STM32H7 family */ |
| 19 | ++ core_util_critical_section_enter(); |
| 20 | ++ SCB_CleanInvalidateDCache(); |
| 21 | + SCB_DisableDCache(); |
| 22 | ++ core_util_critical_section_exit(); |
| 23 | + #endif |
| 24 | + |
| 25 | + /* GPIO Ports Clock Enable */ |
| 26 | +diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_PORTENTA_H7/stm32h7_eth_init.c b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_PORTENTA_H7/stm32h7_eth_init.c |
| 27 | +index 643fc5acd3..7f5b4206cb 100644 |
| 28 | +--- a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_PORTENTA_H7/stm32h7_eth_init.c |
| 29 | ++++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_PORTENTA_H7/stm32h7_eth_init.c |
| 30 | +@@ -68,6 +68,7 @@ void HAL_ETH_MspInit(ETH_HandleTypeDef *heth) |
| 31 | + #if !(defined(DUAL_CORE) && defined(CORE_CM4)) |
| 32 | + /* Disable DCache for STM32H7 family */ |
| 33 | + core_util_critical_section_enter(); |
| 34 | ++ SCB_CleanInvalidateDCache(); |
| 35 | + SCB_DisableDCache(); |
| 36 | + core_util_critical_section_exit(); |
| 37 | + #endif |
| 38 | +-- |
| 39 | +2.45.2 |
| 40 | + |
0 commit comments