From 711b5fd23253bace6bef75630229aa71eeb0ffb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Beh=C3=BAn?= Date: Tue, 13 Sep 2022 18:10:28 +0200 Subject: [PATCH 1/2] arm: mvebu: turris_omnia: Fix setting switch CONFIG pins on new board design MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It seems that waiting only 10 ms after releasing LAN switch from reset is not enough for the strapping pins to latch the requested values. P6_MODE[0] is latched to 0 instead of 1. Increasing the delay to 50 ms fixes this issue. Signed-off-by: Marek BehĂșn Reviewed-by: Stefan Roese --- board/CZ.NIC/turris_omnia/turris_omnia.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c index a7f96e5b773..19c5043fcba 100644 --- a/board/CZ.NIC/turris_omnia/turris_omnia.c +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c @@ -654,7 +654,7 @@ static void initialize_switch(void) ctrl[1] = EXT_CTL_nRES_LAN; err = omnia_mcu_write(CMD_EXT_CONTROL, ctrl, sizeof(ctrl)); - mdelay(10); + mdelay(50); /* Change RGMII pins back to RGMII mode */ From 5996a8a8356c11c6eb504eeea93c267f9adbf53c Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Thu, 15 Sep 2022 16:20:36 +0200 Subject: [PATCH 2/2] timer: orion-timer: Use timer_conv_64() to fix timer wrap around While testing on some Kirkwood platforms it was noticed that the timer did not function correctly all the time. The driver did not correctly handle 32bit timer value wrap arounds. Using the timer_conv_64() conversion function fixes this issue. Fixes: e9e73d78a8fb ("timer: add orion-timer support") Suggested-by: Stefan Herbrechtsmeier Signed-off-by: Stefan Roese Tested-by: Tony Dinh --- drivers/timer/orion-timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/timer/orion-timer.c b/drivers/timer/orion-timer.c index fd30e1bf036..d7d1a1b2446 100644 --- a/drivers/timer/orion-timer.c +++ b/drivers/timer/orion-timer.c @@ -19,7 +19,7 @@ static uint64_t orion_timer_get_count(struct udevice *dev) { struct orion_timer_priv *priv = dev_get_priv(dev); - return ~readl(priv->base + TIMER0_VAL); + return timer_conv_64(~readl(priv->base + TIMER0_VAL)); } static int orion_timer_probe(struct udevice *dev)