forked from Openwrt-EcoNet/openwrt
Add STM32MP157C-DK2 support. This profile also supports the STM32MP157F-DK2 board. The only difference between these two boards is the CPU frequency (650MHz for 157C and 800MHz for 157F). A SCMI variant is available. With this variant the reset and clock resources are provided by OP-TEE and the associated SCMI services. It is the configuration recommended by STMicroelectronics, with secured system resources. The specifications bellow only list supported features. Specifications -------------- SOC: STM32MP157C RAM: 512 MiB Storage: SD Card Ethernet: 1x 1 Gbps Wireless: 2.4GHz Cypress CYW43455 (802.11b/g/n) LEDs: Heartbeat (Blue) USB: 4x 2.0 Type-A Signed-off-by: Thomas Richard <thomas.richard@bootlin.com> Link: https://github.com/openwrt/openwrt/pull/18119 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
33 lines
1.3 KiB
Diff
33 lines
1.3 KiB
Diff
From 3cd1d4651cebe9776a0142ade36ff9f2e3545436 Mon Sep 17 00:00:00 2001
|
|
From: Christophe Roullier <christophe.roullier@foss.st.com>
|
|
Date: Mon, 1 Jul 2024 08:48:37 +0200
|
|
Subject: [PATCH] net: stmmac: dwmac-stm32: Add test to verify if ETHCK is used
|
|
before checking clk rate
|
|
|
|
When we want to use clock from RCC to clock Ethernet PHY (with ETHCK)
|
|
we need to check if value of clock rate is authorized.
|
|
If ETHCK is unused, the ETHCK frequency is 0Hz and validation fails.
|
|
It makes no sense to validate unused ETHCK, so skip the validation.
|
|
|
|
Fixes: 582ac134963e ("net: stmmac: dwmac-stm32: Separate out external clock rate validation")
|
|
Signed-off-by: Christophe Roullier <christophe.roullier@foss.st.com>
|
|
Reviewed-by: Marek Vasut <marex@denx.de>
|
|
Tested-by: Mark Brown <broonie@kernel.org>
|
|
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|
---
|
|
drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c | 3 +++
|
|
1 file changed, 3 insertions(+)
|
|
|
|
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
|
|
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
|
|
@@ -195,6 +195,9 @@ static int stm32mp1_validate_ethck_rate(
|
|
struct stm32_dwmac *dwmac = plat_dat->bsp_priv;
|
|
const u32 clk_rate = clk_get_rate(dwmac->clk_eth_ck);
|
|
|
|
+ if (!dwmac->enable_eth_ck)
|
|
+ return 0;
|
|
+
|
|
switch (plat_dat->mac_interface) {
|
|
case PHY_INTERFACE_MODE_MII:
|
|
case PHY_INTERFACE_MODE_GMII:
|